Expand description
Tempo EVM Handler implementation.
StructsΒ§
- Tempo
EvmHandler - Tempo EVM [
Handler] implementation with Tempo specific modifications: - Validation
Context - Context returned by
TempoEvmHandler::validate_transactionwith resolved fee token and key expiry information for use by the transaction pool.
ConstantsΒ§
- EXPIRING_
NONCE_ GAS - Gas cost for expiring nonce transactions (replay check + insert).
- KEYCHAIN_
VALIDATION_ πGAS - Additional gas for Keychain signatures (key validation overhead: COLD_SLOAD_COST + 900 processing)
- KEY_
AUTH_ πBASE_ GAS - Base gas for KeyAuthorization (22k storage + 5k buffer), signature gas added at runtime
- KEY_
AUTH_ πPER_ LIMIT_ GAS - Gas per spending limit in KeyAuthorization
- P256_
VERIFY_ πGAS - Additional gas for P256 signature verification P256 precompile cost (6900 from EIP-7951) + 1100 for 129 bytes extra signature size - ecrecover savings (3000)
FunctionsΒ§
- calculate_
aa_ batch_ intrinsic_ gas - Calculates intrinsic gas for an AA transaction batch using revm helpers.
- calculate_
key_ πauthorization_ gas - Calculates the intrinsic gas cost for a KeyAuthorization.
- call_
scope_ πextra_ gas - Charges the unpriced scope-helper bookkeeping for T4 key authorizations.
The dynamic SSTORE rows are already counted by
call_scope_storage_slots(). What remains is the helper work around them: clearing the empty scope tree for fresh keys, target/set maintenance, selector/set maintenance, and recipient-set writes. We use rounded constants here because the goal is to stop the undercharge without mirroring every storage helper exactly. - call_
scope_ πstorage_ slots - Counts the scope storage rows that pay the dynamic SSTORE-set path for the active spec.
- check_
gas_ πlimit - Checks if gas limit is sufficient and returns OOG frame result if not.
- get_
token_ balance - IMPORTANT: the caller must ensure
tokenis a valid TIP20Token address. - normalize_
failed_ πbatch_ result_ gas - Rewrites a failed batch stepβs gas accounting to match whole-transaction semantics.
- oog_
frame_ πresult - Helper function to create a frame result for an out of gas error.
- primitive_
signature_ πverification_ gas - Calculates the gas cost for verifying a primitive signature.
- tempo_
signature_ πverification_ gas - Calculates the gas cost for verifying an AA signature.
- translate_
allowed_ πcalls_ for_ precompile - validate_
aa_ πinitial_ tx_ gas - Validates and calculates initial transaction gas for AA transactions.
- validate_
time_ window - Validates time window for AA transactions