Proof registry pause, is_intent_fillable view, proof freshness, chain ID mapping - #325
Open
studiomonkeyx wants to merge 1 commit into
Conversation
… chain ID mapping Closes stellar-vortex-protocol#264 Closes stellar-vortex-protocol#259 Closes stellar-vortex-protocol#254 Closes stellar-vortex-protocol#253 - proof_registry: admin-only pause()/unpause()/is_paused() gating receive_message for incident response, mirroring intent_settlement's existing pause mechanism (stellar-vortex-protocol#264). - intent_settlement: is_intent_fillable(intent_id, solver) view so solver bots can self-check fill_intent's pre-transfer guards without reimplementing them; guard logic extracted into check_fill_guards so fill_intent and the view can never disagree (stellar-vortex-protocol#259). - proof_registry: PROOF_VALIDITY_WINDOW + get_fresh_proof(intent_id), rejecting a ProofRecord older than the window with a new ProofStale error distinct from ProofNotFound (stellar-vortex-protocol#254). - intent_settlement: src_chain_to_wormhole_id(src_chain), the single source-of-truth mapping from canonical src_chain strings to Wormhole chain IDs, failing closed with SrcChainNotSupported for unmapped chains (stellar-vortex-protocol#253). Also fixes a missing closing brace in intent_settlement/src/test.rs (pauser_cannot_unpause) left by a prior merge, which made the file unparseable and broke cargo fmt/cargo test for the whole crate regardless of this change. Note: this environment's Rust toolchain could not fully build either crate against currently-resolvable dependency versions even on a clean checkout of main (pre-existing, unrelated to this change) -- see PR description for details.
|
@studiomonkeyx 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
Batches four assigned issues into one PR:
proof_registry.receive_message#264 —proof_registrypause/circuit-breaker: admin-onlypause()/unpause()/is_paused()gatingreceive_message, mirroringintent_settlement's existing mechanism.get_proof/has_proofstay available during a pause.mock_set_proof/mock_remove_proofdeliberately ignore the pause flag (documented) since they're test scaffolding, not the production receipt path.is_intent_fillableconvenience view #259 —is_intent_fillable(intent_id, solver)view onintent_settlement: lets solver bots self-checkfill_intent's pre-transfer guards before spending a transaction. The guard sequence (intent exists, stateAccepted, caller matchesintent.solver, deadline not passed) is extracted into a privatecheck_fill_guardshelper shared by bothfill_intentand the new view, so they can never silently drift apart.ProofRegistry#254 — Proof expiry/freshness:proof_registry::get_fresh_proof(intent_id)returns the proof only ifnow - received_at <= PROOF_VALIDITY_WINDOW(1 hour, chosen to comfortably exceedFILL_WINDOW+ realistic VAA-relay latency), otherwise panics with a newProofStaleerror distinct fromProofNotFound.src_chain-to-Wormhole-chain-ID mapping table #253 —IntentSettlement::src_chain_to_wormhole_id(src_chain): single source-of-truth mapping from the 8 canonicalsrc_chainstrings to their Wormhole chain IDs (perdocs/132-supported-chains.md§2 /docs/129-proof-mismatch-fallback.md§4), failing closed with a newSrcChainNotSupportederror for unmapped chains.Docs updated:
docs/mainnet-deployment-runbook.md(proof_registry incident response),docs/124-proof-verification-interface.md§8,docs/129-proof-mismatch-fallback.md§4,docs/132-supported-chains.md§7,README.md,CHANGELOG.md.Also included: a one-line fix for a missing closing brace in
intent_settlement/src/test.rs(pauser_cannot_unpause), left by a prior merge (PR #185). It made the file unparseable and breakscargo fmt/cargo test/CI for the entire crate independent of this change — confirmed present on a clean checkout ofmainbefore this PR. It's unrelated to the four issues above but was required just to keep the file (which #259 and #253 also touch) syntactically valid.Validation performed
I was not able to get a green
cargo build/cargo testlocally in my environment for either crate, including on a clean checkout ofmainwith none of this PR's changes applied. Specifically:intent_settlement: even on unmodifiedmain,cargo buildagainst the committedCargo.lock(soroban-sdk 21.7.7) fails with ~50 pre-existing errors unrelated to this PR — severalDataKeyvariants used inlib.rs(AllowedDstTokenList,MinBondMultiplier,Config) are not declared in theDataKeyenum, andString/Bytes::getcalls don't match that soroban-sdk version's API (e.g.Bytes::getreturnsOption<u8>, notu8).proof_registry: has no committedCargo.lock, so it freely re-resolves to the same soroban-sdk 21.7.7 and hits the sameBytes::get/String::from_bytesAPI mismatches in existing, unmodified code (receive_message,bytes_to_hex_string).These are pre-existing, repo-wide issues unrelated to any of the four issues in this PR — I did not attempt to fix them beyond the one syntax-breaking missing brace noted above, per scope. I instead manually reviewed every change for correctness against the exact patterns already established in each file (e.g.
check_fill_guardsmirrorsfill_intent's existing guard order exactly;src_chain_to_wormhole_id's string-comparison closure is copied verbatim in style from the existingvalidate_src_tokenhelper so it will compile under whatever soroban-sdk version this repo's actual CI environment resolves).New tests were added for all four issues (pause gating + reads-remain-available for #264, guard-parity + nonexistent-intent for #259, fresh/stale/boundary/missing-proof for #254, full round-trip + unknown-chain rejection for #253) following each file's existing test conventions, and should run once CI's actual pinned toolchain builds the crate successfully.
Issues closed
Closes #264
Closes #259
Closes #254
Closes #253