Skip to content

fix(svm): add gateway event_cpi accounts to outbound tx builders - #372

Merged
Aman035 merged 1 commit into
developfrom
fix/F-svm-event-cpi-outbound-accounts
Sep 14, 2026
Merged

Aman035 merged 1 commit into
developfrom
fix/F-svm-event-cpi-outbound-accounts

Conversation

@Aman035

@Aman035 Aman035 commented Sep 11, 2026

Copy link
Copy Markdown
Member

The gateway now emits events via Anchor's #[event_cpi] self-CPI instead of plain logs. That macro appends two accounts, event_authority and the program itself, to every affected instruction's account list. Our hand-written outbound builders were never updated for it, so every finalize, revert, rescue, and PC20 remint transaction fails on-chain with AccountNotEnoughKeys or ConstraintSeeds.

  • Adds the event_authority PDA and gateway program to buildWithdrawAndExecuteAccounts, buildRevertAccounts (also covers rescue), buildPC20ExportAccounts, buildPC20RemintAccounts.
  • buildPC20RemintAccounts was also missing two associated_token_program/rent None slots that the plain revert path already carries for the same instruction. Added those too.
  • Updated every account-count and offset assertion in tx_builder_test.go and tx_builder_pc20_test.go to match.

Build, vet, and the full repo test suite (with the test build tag) are green.

Not run: the RUN_SVM_SIM=1 on-chain simulation tests, they need a funded devnet relayer key and a live TSS PDA. Recommend running those before merge.

@Aman035
Aman035 force-pushed the fix/F-svm-event-cpi-outbound-accounts branch from 832c226 to 7b1bf60 Compare September 11, 2026 17:55
@Aman035

Aman035 commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

Fixes verifed on testnet

@Aman035
Aman035 merged commit 98ff9e7 into develop Sep 14, 2026
12 checks passed
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.

1 participant