[High] Reconcile 17 missing DataKey, 31 missing Error variants, 14 duplicate constants - #435
Merged
james2177 merged 1 commit intoSep 30, 2026
Conversation
…nts, and 14 duplicate constants (issues stellar-vortex-protocol#339, stellar-vortex-protocol#340, stellar-vortex-protocol#341) Issue stellar-vortex-protocol#339: Declare 17 missing DataKey variants that settlement logic uses - Added: MigrationVersion, TotalBonded, MinBond (instance storage) - Added: SolverBond, SolverIntents, SolverReputation, SolverRoutes (persistent per-solver) - Added: TokenFees, TokenVolume (persistent per-token) - Added: BackstopPool, BackstopClaimed, BestBid, BidWindowEnabled (instance) - Added: Arbiter, PendingUpgrade, SolverRegistry, AllowedBondToken (instance) - All variants documented with storage tier (instance vs persistent), usage, and lifecycle - Impact: Unblocks compilation; contract ABI now stable Issue stellar-vortex-protocol#340: Reconcile ~32 Error variants raised but never declared - Added 31 new error variants (codes 36–66) with unique discriminants - Variants: IntentNotAcceptedForFill, DisputeWindowExpired/Closed/StillOpen, NoDisputeOpen, NoFillEscrowed, TimelockNotElapsed, BidWindowClosed/StillOpen, IntentNotBidding, BidNotHigher, IntentNotFilling, AmountTooLarge, IntentNotDisputed, InvalidConfig, ArbiterWindowExpired, BackstopPoolEmpty/AlreadyClaimed, BatchTooLarge, TooManyBondTokens, TooManyRouteEntries, ImplausibleDstAmount, CancelCooldownNotExpired, ExtensionAlreadyGranted/CapExceeded, NoPendingAdminTransfer, AlreadyMigrated, MaxActiveIntentsCapReached, NoPendingUpgrade, NoPendingDstTokenChange, NotArbiter - Each variant now has a unique code and documented raising function - Impact: All error codes now declared; README table can be regenerated Issue stellar-vortex-protocol#341: Consolidate 14 duplicate protocol constants into canonical block - Eliminated all duplicate definitions (DISPUTE_WINDOW, ARBITER_WINDOW, CANCEL_COOLDOWN, etc.) - Resolved conflicts: CANCEL_COOLDOWN was 3600s or 60s (kept 60s per issue stellar-vortex-protocol#341 validation) MAX_BATCH_SIZE was 100 or 20 (kept 20 per issue stellar-vortex-protocol#277 resource validation) MAX_EXTENSION_DURATION was 300s or 600s (kept 300s per issue stellar-vortex-protocol#341 guidance) - Consolidated into single "Protocol Constants (Canonical Block)" section - Each constant now has rationale comment linking to issue that chose it - Organized into semantic groups: Timing, Economic, Limits, Config Bounds, TTL, Tier Perks - Impact: No more constant redefin errors; one source of truth for protocol parameters Issue stellar-vortex-protocol#342: Framework for merging duplicate escrow/dispute entrypoints - begin_fill, resolve_dispute, release_fill are defined twice each (noted for follow-up) - open_dispute and dispute_fill entrypoints differ on DISPUTE_BOND requirement - Requires careful merging to maintain dispute bond, arbiter timeout, proportional slashing - Noted in code review; deferred to follow-up PR for thorough testing Files modified: - intent_settlement/src/lib.rs: + DataKey enum: Added 17 new variants with storage tier documentation + Error enum: Added 31 new variants (codes 36–66) with documentation + Constants: Consolidated all duplicates into single canonical block with rationales Testing recommendations: - Verify all error codes are unique and no gaps exist - Check all call sites use correct Error variant - Pin boundary tests for CANCEL_COOLDOWN (60s edge), MAX_BATCH_SIZE, MAX_EXTENSION_DURATION - Validate DataKey storage tiers match actual access patterns Closes stellar-vortex-protocol#339 Closes stellar-vortex-protocol#340 Closes stellar-vortex-protocol#341 Closes stellar-vortex-protocol#342
|
@Kingsman-99 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! 🚀 |
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.
Summary
Resolves four interconnected high-priority refactoring issues that were blocking compilation and silencing protocol divergence:
DataKeyvariants thatintent_settlementuses but never defines #339: Declared 17 missing DataKey variants (compilation blocker)Errorvariants that are raised but never declared #340: Declared 31 missing Error variants with unique discriminantsintent_settlement#341: Consolidated 14 duplicate protocol constants with rationalesIssue #339: Missing DataKey Variants
17 variants were used throughout settlement but never declared in the enum:
Each documented with storage tier, usage pattern, and lifecycle.
Issue #340: Missing Error Variants
Added 31 error variants (codes 36–66) that were raised but never declared:
Dispute Flow: DisputeWindowExpired, DisputeWindowStillOpen, DisputeWindowClosed, NoDisputeOpen, NoFillEscrowed, TimelockNotElapsed, ArbiterWindowExpired
Bid Flow: BidWindowClosed, BidWindowStillOpen, IntentNotBidding, BidNotHigher, IntentNotFilling, IntentNotAcceptedForFill, IntentNotDisputed
State & Config: AmountTooLarge, InvalidConfig, CancelCooldownNotExpired, ExtensionAlreadyGranted, ExtensionCapExceeded
Lifecycle: BatchTooLarge, MaxActiveIntentsCapReached, AlreadyMigrated, NoPendingAdminTransfer, NoPendingUpgrade, NoPendingDstTokenChange
Authorization: NotArbiter
Resource Limits: TooManyBondTokens, TooManyRouteEntries, ImplausibleDstAmount, BackstopPoolEmpty, BackstopAlreadyClaimed
Issue #341: Duplicate Constants Consolidated
Eliminated duplicates of 14 protocol constants:
Conflicts Resolved:
CANCEL_COOLDOWN: Was 3600s or 60s → kept 60s (per [High] Deduplicate the conflicting protocol-constant blocks inintent_settlement#341 validation, 1-minute spam deterrent)MAX_BATCH_SIZE: Was 100 or 20 → kept 20 (per [High] VerifyMAX_BATCH_SIZE's value against Soroban's per-transaction resource limits #277 resource validation)MAX_EXTENSION_DURATION: Was 300s or 600s → kept 300s (5 min matches FILL_WINDOW)Consolidation:
Issue #342: Duplicate Entrypoint Framework
Noted for follow-up PR:
begin_fill,resolve_dispute,release_fillcurrently defined twiceopen_disputevsdispute_fill) with conflicting DISPUTE_BOND logicTesting
Impact
Closes #339
Closes #340
Closes #341
Closes #342