perf(erc20spl-cached): collapse ATA-existence gate to one SplCached.account(address,mint) read#240
Merged
Merged
Conversation
…ccount(address,mint) read balanceOf/allowance/approve/_transfer derived the target ATA via legacy HelperProgram.ata then read it via SplCached.account(ata) — two EVM->precompile round-trips per gate. The new ISplCached.account(address,bytes32) overload derives external_auth(owner)->ATA internally, so each gate is a single read. Behaviour unchanged. Requires the paired upstream Rome EVM SplCached read selector.
valiksinev
approved these changes
Jun 15, 2026
…r -> user Parity with the existing account(address user) overload.
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.
What
balanceOf,allowance,approve, and_transferderived the target ATA via the legacyHelperProgram.ata(x, mint_id)(0xff..09) then read it viaSplCached.account(ata)— two EVM→precompile round-trips per gate. They now make a singleSplCached.account(x, mint_id)call; the precompile derivesexternal_auth(owner) → ATA(mint)internally.interface.sol: addsISplCached.account(address owner, bytes32 mint)(0xf9827227), mirroringaccount(address)with an explicit mint.examples/cached.sol: worked examplespl_account_mint.Requires the paired upstream Rome EVM
SplCached.account(address,bytes32)read selector.Verify
npx hardhat compile— clean (86 files, solc 0.8.28).Pending before merge
Per-op CU A/B and derivation parity (
account(address,mint)==HelperProgram.ata) on a rebuilt wrapper (Phase 0).