Skip to content

Proof registry pause, is_intent_fillable view, proof freshness, chain ID mapping - #325

Open
studiomonkeyx wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
studiomonkeyx:feature/253-254-259-264-issue-batch
Open

Proof registry pause, is_intent_fillable view, proof freshness, chain ID mapping#325
studiomonkeyx wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
studiomonkeyx:feature/253-254-259-264-issue-batch

Conversation

@studiomonkeyx

Copy link
Copy Markdown

Summary

Batches four assigned issues into one PR:

  • [High] Add a pause/circuit-breaker to proof_registry.receive_message #264proof_registry pause/circuit-breaker: admin-only pause()/unpause()/is_paused() gating receive_message, mirroring intent_settlement's existing mechanism. get_proof/has_proof stay available during a pause. mock_set_proof/mock_remove_proof deliberately ignore the pause flag (documented) since they're test scaffolding, not the production receipt path.
  • [High] Add an is_intent_fillable convenience view #259is_intent_fillable(intent_id, solver) view on intent_settlement: lets solver bots self-check fill_intent's pre-transfer guards before spending a transaction. The guard sequence (intent exists, state Accepted, caller matches intent.solver, deadline not passed) is extracted into a private check_fill_guards helper shared by both fill_intent and the new view, so they can never silently drift apart.
  • [High] Add proof expiry/freshness semantics to ProofRegistry #254 — Proof expiry/freshness: proof_registry::get_fresh_proof(intent_id) returns the proof only if now - received_at <= PROOF_VALIDITY_WINDOW (1 hour, chosen to comfortably exceed FILL_WINDOW + realistic VAA-relay latency), otherwise panics with a new ProofStale error distinct from ProofNotFound.
  • [High] Implement the src_chain-to-Wormhole-chain-ID mapping table #253IntentSettlement::src_chain_to_wormhole_id(src_chain): single source-of-truth mapping from the 8 canonical src_chain strings to their Wormhole chain IDs (per docs/132-supported-chains.md §2 / docs/129-proof-mismatch-fallback.md §4), failing closed with a new SrcChainNotSupported error 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 breaks cargo fmt/cargo test/CI for the entire crate independent of this change — confirmed present on a clean checkout of main before 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 test locally in my environment for either crate, including on a clean checkout of main with none of this PR's changes applied. Specifically:

  • intent_settlement: even on unmodified main, cargo build against the committed Cargo.lock (soroban-sdk 21.7.7) fails with ~50 pre-existing errors unrelated to this PR — several DataKey variants used in lib.rs (AllowedDstTokenList, MinBondMultiplier, Config) are not declared in the DataKey enum, and String/Bytes::get calls don't match that soroban-sdk version's API (e.g. Bytes::get returns Option<u8>, not u8).
  • proof_registry: has no committed Cargo.lock, so it freely re-resolves to the same soroban-sdk 21.7.7 and hits the same Bytes::get/String::from_bytes API 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_guards mirrors fill_intent's existing guard order exactly; src_chain_to_wormhole_id's string-comparison closure is copied verbatim in style from the existing validate_src_token helper 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

… 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.
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant