Skip to content

perf(evm): precompute TIP-20 balance slot keccaks during tx recovery#2907

Draft
decofe wants to merge 1 commit intomainfrom
alexey/precompute-tip20-keccaks
Draft

perf(evm): precompute TIP-20 balance slot keccaks during tx recovery#2907
decofe wants to merge 1 commit intomainfrom
alexey/precompute-tip20-keccaks

Conversation

@decofe
Copy link
Member

@decofe decofe commented Feb 27, 2026

Decodes TIP-20 transfer/transferFrom calldata in tx_iterator_for_payload and computes keccak256 balance storage slots for sender and recipient in parallel during signature recovery. The precomputed slots are stored in TempoTxEnv::precomputed_balance_slots as Vec<(Address, U256)> pairs (token address, balance slot).

Handles transfer, transferWithMemo, transferFrom, and transferFromWithMemo selectors targeting contracts with the TIP-20 prefix.

Prompted by: alexey

@shekhirin shekhirin marked this pull request as draft February 27, 2026 16:23
@decofe decofe force-pushed the alexey/precompute-tip20-keccaks branch from c2e3d55 to 5aea382 Compare February 27, 2026 16:28
…covery

Decodes TIP-20 transfer/transferFrom calldata in tx_iterator_for_payload
and computes keccak256 balance storage slots for sender and recipient in
parallel during signature recovery. The keccak256 function caches results
internally, so subsequent calls during execution are free.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c9fd8-f626-765a-96e3-2bd5cda1483c
@decofe decofe force-pushed the alexey/precompute-tip20-keccaks branch from 5aea382 to d256cde Compare February 27, 2026 17:21
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