fix(svm): repin V5 Gateway and prefunded rent refunds - #1565
Reinis-FRP wants to merge 4 commits into
Conversation
66f8661 to
53aaca1
Compare
droplet-rl
left a comment
There was a problem hiding this comment.
Approving. I recomputed every regenerated constant from scratch (standalone keccak-256, secp256k1 recovery and find_program_address implementations, no repo tooling) and cross-checked the pin against across-protocol/solana-v5@e2b91eb0 — everything matches.
Independently verified
Program identity:
gatewayBytesandv5_gateway_path.json#executorboth equal the base58 decode ofpVs6PJ3ofdqPyDhCXXdVW7waG6oNnwKQBKtuM6Mi6JP.GATEWAY_VAULT_AUTHORITY=PDA(["vault_authority"], gateway)→GLU32tN1sN…5NVH, bump 255 ✓. This also matches upstreamprograms/gateway/src/constants.rsat the pin, which moved to the same key/bump.GATEWAY_DISPATCH_AUTHORITY=PDA(["dispatch_authority", svm_spoke], gateway)→8xGrXYfSb2…ARQF, bump 255 ✓ (seed set confirmed againsthardcoded_v5_authorities_match_canonical_pdas).svmSpokeBytescorrectly left unchanged.
Fixture regeneration (v5_adapter_v1.json):
syntheticNonceunchanged and still correct;depositId=keccak(gateway ‖ depositor ‖ syntheticNonce)→0xd3a75ad8…dbe2✓.domain=keccak(nameHash ‖ gateway)→0xd41f3c41…98d8✓;digest✓;nameHashcorrectly unchanged.signaturerecovers to0xf39Fd6e5…2266, matchingjit.authority;sis canonical low-s;highSSignatureis the exactn − scomplement withvflipped 28→27 — so the negative-path vector is still a genuine high-s rejection, not a coincidentally-invalid blob.fillStatus=PDA(["fills", depositId], spoke)→64SUuEZc…RJFz, bump 255 ✓.depositDelegate/fillDelegate/fillPayercorrectly untouched (spoke-derived, gateway-independent).- Wire blobs self-consistent:
depositJit == newOutputAmount ‖ newExclusiveRelayer ‖ signature,fillJitembeds the newdepositId,dispatch.dataends with the newdepositJitand still containsdepositInput.
v5_gateway_path.json: pathId, siblingPathId, sorted-pair stepRoot and PREFIX ‖ stepRoot witness all recompute exactly.
Upstream pin: commit e2b91eb0 exists; its Anchor.toml declares gateway = pVs6PJ3… and prefunded_adapter = 8kUXfjTu…, matching reference.ts. RENT_REFUND_SEED == b"rent_refund", ClaimRent's account order is exactly (payer, rent_refund, system_program) as the test builds it, and DeliveryAccounts::resolve now resolves rent_refund_address(payer) + validate_rent_refund instead of the payer — so the JIT layout credit ‖ rent_refund ‖ payer(32) and the two writable injected slots line up with the adapter's jit_data being a bare 32-byte payer key.
Hygiene: no stale reference to 34trBszX…, 7S5DKhyg…, 457cf693 or the old gatewayBytes survives anywhere in the tree. Test-side vault/executor/dispatch authorities are all derived from GATEWAY rather than hardcoded, so they follow the repin automatically. The new origin() assertions are order-safe: rentRefundBefore is snapshotted per-call, and the claim_rent test drains the PDA only after the assertion, so later prefunded tests re-baseline at zero.
Comments below are non-blocking follow-ups, mostly about what the repin silently adopts.
53aaca1 to
567f7cc
Compare
8c8812d to
959567a
Compare
567f7cc to
a2fb97c
Compare
|
@droplet-rl please recheck this PR with the latest review responses |
|
Rechecked at Rebase: after the rebase onto the updated #1564, Follow-ups in
Optional nit: I couldn't run the real-Gateway suite here, so the 25 passing are from your run. I checked the new tests by reading them against the fixture setup and the upstream Gateway source. |
|
Fixed the optional confirmation-overload nit from the latest recheck in 9b82336. Claimer funding now uses The affected real-Gateway prefunded integration test, test type-checking, formatting and commit hooks pass. The commit includes DCO sign-off. Sent from Reinis Martinsons's Codex Agent using gpt-6-astra 🤖 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
9b82336 to
cd0fd1a
Compare
c0c1ebd to
982580e
Compare
b062034 to
d4faa63
Compare
982580e to
e915cf5
Compare
d4faa63 to
cad6931
Compare
e915cf5 to
58b936f
Compare
eff487b to
344b1ba
Compare
f8dea0e to
248223d
Compare
344b1ba to
714af9c
Compare
720446e to
a9c09e9
Compare
714af9c to
00cba19
Compare
a9c09e9 to
2594146
Compare
00cba19 to
0e000a9
Compare
0e000a9 to
31ace75
Compare
2594146 to
7f3e357
Compare
31ace75 to
966a064
Compare
7f3e357 to
3b9fec2
Compare
966a064 to
0299d0c
Compare
ccd106c to
81a2211
Compare
9d7898a to
0a6b5ab
Compare
0a6b5ab to
bb37ba1
Compare
8861526 to
48ef30e
Compare
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
48ef30e to
e210d80
Compare
The SVM V5 adapter and conformance fixtures targeted the old Gateway and PrefundedAdapter deployment. Repin to
e2b91eb0454136773728f941b33163346e039aa4, update program IDs and canonical PDAs/bumps, and regenerate the affected deposit-ID, signature and path fixtures.Prefunded integration injects the payer's
rent_refundPDA instead of the payer account. The real-Gateway tests verify credit closure, rent custody and a separateclaim_renttransaction signed and paid for by an unrelated claimer. They also cover remainder transfers and zero-transfer recipient omission.Restacked on #1564's final self-transfer implementation. Preserve its approval regressions and cleared-allowance assertion alongside the rent-refund coverage. Adapt the zero-transfer test to select the floor/transfer suffix after the new approval commands.
Validation after restacking: 16 Rust tests, strict TypeScript checking, and 9 focused real-Gateway tests passed, covering guarded Token-2022 funding, external fills/rent reclaim, missing/wrong approvals, separate prefunded rent claims, remainder transfers and zero transfers. Guarded SBF builds and formatting passed. This is focused local validation; the full verified-build and conformance suites were not rerun locally for the restack.
Targets #1564 (
reinis/svm-v5-core-simplification).Sent from Reinis Martinsons's Codex CLI Agent using gpt-6-astra 🤖