fix: F-2026-18815 | follow the gateway recipient ATA creation on SVM revert and rescue - #361
Merged
Merged
Conversation
…rsement event" This reverts commit 2565b87.
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.
Follows the gateway update in
pc20-3rd-iteration(92a3bbe,da6cca5). Built on currentaudit-fixes. Replaces #355.Gateway now creates the recipient ATA everywhere
buildCreateATAIdempotentInstruction. Creating it here makes the gateway see the account already present, leaving the rent outsidegas_used, which is the original F-2026-18815 leak.buildRevertAccountsgained the two slots the gateway needs to do the create:associated_token_programat 12 andrentat 13. Native passes six None sentinels instead of four. Rescue shares the builder.Revert no longer reports a gas fee
RevertUniversalTxdroppedgas_used. Offset 144 now holdsrevert_instruction, so the old read reported pubkey bytes as lamports.applyGasRefundreturns early forINBOUND_REVERT, and it is the only outbound type whose event lacks it. Rescue still carries it inFundsRescued, withdraw and execute inUniversalTxFinalized, and both of those do refund."0"rather than empty. Core rejects an emptygas_fee_usedand the value feeds the outbound ballot key, so it has to be present and identical across validators.Tests
"0", reaches quorum and refunds nothing, end to end across three validators.Note for whoever sizes gas_fee
gas_feeis now a ceiling and must cover ATA rent (~2,039,280 lamports) when the recipient's canonical ATA does not exist, or the gateway tripsInsufficientGasBudgetbefore any lamport moves. The client does not choose this value; it comes from the outbound event.