Skip to content

feat: SpokePool SVM V5 modifier - #1495

Open
fusmanii wants to merge 2 commits into
epic-v5/svmfrom
faisal/svm-spoke-v5
Open

feat: SpokePool SVM V5 modifier#1495
fusmanii wants to merge 2 commits into
epic-v5/svmfrom
faisal/svm-spoke-v5

Conversation

@fusmanii

@fusmanii fusmanii commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Similar to EVM V5 SpokePool modifier

Closes ACP-190

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
@fusmanii
fusmanii marked this pull request as ready for review July 20, 2026 15:28
Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
@fusmanii
fusmanii requested a review from droplet-rl July 20, 2026 15:39

@droplet-rl droplet-rl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-scoped port of the EVM nonV5Fill quarantine to the SVM spoke. Verified the details that matter here:

Constant parity — I recomputed keccak256("AcrossV5MessagePrefix.V1") independently and it matches the hardcoded bytes exactly (0x89ae4bc7...27fd), so the SVM constant is byte-for-byte identical to the EVM V5_MAGIC_PREFIX in #1481.

Predicate parityis_v5_message (len >= 32 && message[..32] == PREFIX) has identical semantics to the EVM _isV5Message (length < 32 → false, first 32 bytes compared), including the edge case of a message that is exactly the 32-byte prefix.

Coverage — the guard lands on all three settlement entrypoints that consume relay_data.message: fill_relay, request_slow_fill, and execute_slow_relay_leaf. The EVM PR guards a fourth function (fillRelayWithUpdatedDeposit), which has no SVM counterpart, so this is the complete set. The deposit side is intentionally unguarded, matching EVM (V5 deposits are ordinary deposits with a stamped witness message).

Placement — in all three handlers the check runs after unwrap_*_params, so it covers both the direct-argument path and the instruction_params buffer path, and it runs before any state mutation or token transfer.

Error enumV5FillOnly is appended at the end of CommonError, so no existing error codes shift, and the name matches the EVM V5FillOnly() error.

Tests — deriving the prefix via keccak256 in the tests (rather than copying the program constant) makes them double as the cross-VM parity check, which is a nice touch. Test isolation is fine: both suites reset relayData in beforeEach, and updateRelayData in SvmSpoke.Fill.ts is synchronous, so the non-awaited call is correct. The untested execute_slow_relay_leaf guard is genuinely unreachable end-to-end (the fill-status PDA for a V5 relay hash can never exist since both request_slow_fill and fill_relay reject first), and the test comment says so — no action needed.

cargo check on the program passes with no errors. Two non-blocking notes inline.

Comment thread programs/svm-spoke/src/instructions/fill.rs
Comment thread test/svm/SvmSpoke.Fill.ts
@droplet-rl

Copy link
Copy Markdown
Contributor

🔎 View trace

@fusmanii fusmanii changed the title feat: SpokePool SVM V5 feat: SpokePool SVM V5 modifier Jul 20, 2026
@linear

linear Bot commented Jul 22, 2026

Copy link
Copy Markdown

ACP-190

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants