feat: SpokePool SVM V5 modifier - #1495
Conversation
Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
droplet-rl
left a comment
There was a problem hiding this comment.
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 parity — is_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 enum — V5FillOnly 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.
Similar to EVM V5 SpokePool modifier
Closes ACP-190