Skip to content

Remove unnecessary transfer hook token program account info#1004

Merged
yugure-orca merged 3 commits intoorca-so:mainfrom
Arrowana:transfer-hook-unnecessary-account-info
Aug 13, 2025
Merged

Remove unnecessary transfer hook token program account info#1004
yugure-orca merged 3 commits intoorca-so:mainfrom
Arrowana:transfer-hook-unnecessary-account-info

Conversation

@Arrowana
Copy link
Copy Markdown
Contributor

@Arrowana Arrowana commented Jul 10, 2025

There is no need for the token program in account info

https://github.com/solana-program/transfer-hook/tree/main/interface

It is not required or necessary

@Arrowana Arrowana changed the title Remove unnecessary transfer hook account info Remove unnecessary transfer hook token program account info Jul 10, 2025
@yugure-orca
Copy link
Copy Markdown
Collaborator

@Arrowana
Thanks for the PR!

@yugure-orca
Copy link
Copy Markdown
Collaborator

yugure-orca commented Jul 15, 2025

Knowledge update:

note: I tested whether a self-CPI could work without including the program's AccountInfo—just in case it was no longer required—but it didn’t work. In other words, while we can omit it in the CPI context, we still need to receive the program being called as an account, not just as a program_id.

@Arrowana
Copy link
Copy Markdown
Contributor Author

Knowledge update:

note: I tested whether a self-CPI could work without including the program's AccountInfo—just in case it was no longer required—but it didn’t work. In other words, while we can omit it in the CPI context, we still need to receive the program being called as an account, not just as a program_id.

Correct, it is also planned to completely remove the need to pass a program to be able to cpi into it. https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0163-lift-cpi-caller-restriction.md
This would simplify tx building even further.

@yugure-orca
Copy link
Copy Markdown
Collaborator

Correct, it is also planned to completely remove the need to pass a program to be able to cpi into it. https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0163-lift-cpi-caller-restriction.md This would simplify tx building even further.

Cool, good to know.
Thanks again!

Once self-CPI becomes possible, we should be able to emit events without the risk of them being truncated — although there’s still the issue of the event authority....

The PR looks good to me, so planning to merge the PR before the next upgrade.

@yugure-orca yugure-orca merged commit 95e9ddb into orca-so:main Aug 13, 2025
6 checks passed
@yugure-orca
Copy link
Copy Markdown
Collaborator

yugure-orca commented Jan 30, 2026

Notes for SIMD-0163 Lift CPI caller restriction:

  • It has been withdrawn due to security concerns.
  • For now, the prospect of being able to freely call programs in the future is off the table.
  • However, this PR is still valid. The caller (the Whirlpool program) always receives the Token-2022 (if token is a Token-2022 based token), which guarantees that the caller holds the callee’s AccountInfo.

@Arrowana Arrowana deleted the transfer-hook-unnecessary-account-info branch January 30, 2026 10:01
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