docs: note that Execute.amount is u64::MAX for confidential transfers - #156
Merged
joncinque merged 2 commits intoSep 3, 2026
Conversation
The doc on `TransferHookInstruction::Execute.amount` reads "Amount of tokens to transfer". On the confidential-transfer path Token-2022 passes `u64::MAX` instead, because the amount is encrypted and unavailable to the program. The convention is deliberate and commented at the call site, but nothing on the receiving side records it — `u64::MAX` appears nowhere in this repository. A hook implementing amount-based policy reads this field's documentation and has no reason to expect a sentinel.
pwsaragossy
force-pushed
the
docs/confidential-transfer-amount-sentinel
branch
from
August 25, 2026 00:35
a1d4920 to
c44c4c4
Compare
joncinque
reviewed
Aug 28, 2026
joncinque
left a comment
Contributor
There was a problem hiding this comment.
Thanks for your contribution! Just a little bit to trim, then it's good to go on my side
joncinque
approved these changes
Sep 3, 2026
joncinque
left a comment
Contributor
There was a problem hiding this comment.
Applied suggestion, landing
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.
The doc on
TransferHookInstruction::Execute.amountreads "Amount of tokens to transfer". On the confidential-transfer path that is not accurate: Token-2022 passesu64::MAX, because the amount is encrypted and unavailable to the program.https://github.com/solana-program/token-2022/blob/6d87d47d6bbd/program/src/extension/confidential_transfer/processor.rs#L826-L836
The convention is deliberate and there is a comment at the call site. Nothing on the receiving side says so —
u64::MAXdoes not appear anywhere in this repository. A hook implementing amount-based policy reads this field's documentation and has no reason to expect a sentinel.The consequence depends on how the policy is written:
amount > limit) rejects every confidential transfer, at any sizetotal + amount) overflows; withoverflow-checksoff, Cargo's release default, it wraps and the check silently passesDocumentation only, no behavior change.
Reproduced against a pinned commit using upstream's own tests, unmodified — the only change is an instrumented hook that reports the amount it was handed: https://github.com/pwsaragossy/t22-conformance