fix: address issues #457, #458, #460, #461 — validation dedup, storag… - #541
Merged
usmanimamu17-create merged 1 commit intoAug 31, 2026
Merged
Conversation
…pexChainx#461 — validation dedup, storage estimation, and retention metrics - ApexChainx#457: Refactor validate_config to delegate general bounds to validate_general_bounds, eliminating duplicated threshold/penalty/reward range checks. The cross-parameter consistency check remains in validate_config to preserve error precedence (severity-specific checks before cross-parameter), verified by the fuzz_spec parity tests. - ApexChainx#458: Replace hardcoded 1024/120/150 byte constants in storage_estimation with calibrated per-key constants. Byte sizes are documented as measured approximations with tested reasonable ranges (±50%) to guard against Soroban encoding changes. - ApexChainx#460: Add per-key footprint model to get_storage_footprint_estimate. Each instance-storage key (CONFIG map, STATS, telemetry, pause info, etc.) is now counted individually with measured overhead. Lazily-created keys are only included when present in storage. The estimate now covers all fixed instance keys instead of lumping them into a single constant. - ApexChainx#461: Add cumulative pruned/total_entries counters (TOTAL_PRUNED_KEY, TOTAL_ENTRIES_KEY) tracked in calculate_sla auto-trim, prune_history, and prune_history_by_age. Expose retention health via new get_retention_metrics endpoint returning HistoryRetentionMetrics. Updated public API descriptor (61→62 methods), storage key namespace test, and eagerly_written keys list. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@yashimamina6 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…e estimation, and retention metrics
validate_general_bounds duplicates the bounds logic inside validate_config: custom and canonical validation drift independently #457: Refactor validate_config to delegate general bounds to validate_general_bounds, eliminating duplicated threshold/penalty/reward range checks. The cross-parameter consistency check remains in validate_config to preserve error precedence (severity-specific checks before cross-parameter), verified by the fuzz_spec parity tests.
storage_estimation hardcodes 1024/120/150 byte constants: the reported footprint is unverified and tests pin the constants instead of measuring serialized size #458: Replace hardcoded 1024/120/150 byte constants in storage_estimation with calibrated per-key constants. Byte sizes are documented as measured approximations with tested reasonable ranges (±50%) to guard against Soroban encoding changes.
get_storage_footprint_estimate ignores the CONFIG map and other fixed keys: changing canonical config is invisible to the footprint #460: Add per-key footprint model to get_storage_footprint_estimate. Each instance-storage key (CONFIG map, STATS, telemetry, pause info, etc.) is now counted individually with measured overhead. Lazily-created keys are only included when present in storage. The estimate now covers all fixed instance keys instead of lumping them into a single constant.
metrics/history_metrics and retention_stats are never exposed: operators cannot query retention health on-chain #461: Add cumulative pruned/total_entries counters (TOTAL_PRUNED_KEY, TOTAL_ENTRIES_KEY) tracked in calculate_sla auto-trim, prune_history, and prune_history_by_age. Expose retention health via new get_retention_metrics endpoint returning HistoryRetentionMetrics. Updated public API descriptor (61→62 methods), storage key namespace test, and eagerly_written keys list.
🤖 Generated with Codebuff
Description
Brief description of the changes in this PR.
Type of Change
Related Issues
Fixes #(issue number) or relates to #(issue number)
Changes Made
Testing
Describe the testing performed to validate these changes:
Checklist
Screenshots (if applicable)
Add screenshots or logs if applicable.
closes #461
closes #458
closes #457
closes #460