Skip to main content

Module handler

Module handler 

Source
Expand description

Tempo EVM Handler implementation.

StructsΒ§

TempoEvmHandler
Tempo EVM [Handler] implementation with Tempo specific modifications:
ValidationContext
Context returned by TempoEvmHandler::validate_transaction with 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 token is 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