perf(evm): precompute TIP-20 balance slot keccaks during tx recovery#2907
Draft
perf(evm): precompute TIP-20 balance slot keccaks during tx recovery#2907
Conversation
c2e3d55 to
5aea382
Compare
…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
5aea382 to
d256cde
Compare
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.
Decodes TIP-20 transfer/transferFrom calldata in
tx_iterator_for_payloadand computeskeccak256balance storage slots for sender and recipient in parallel during signature recovery. The precomputed slots are stored inTempoTxEnv::precomputed_balance_slotsasVec<(Address, U256)>pairs (token address, balance slot).Handles
transfer,transferWithMemo,transferFrom, andtransferFromWithMemoselectors targeting contracts with the TIP-20 prefix.Prompted by: alexey