fn calculate_key_authorization_gas(
key_auth: &SignedKeyAuthorization,
gas_params: &GasParams,
spec: TempoHardfork,
) -> (u64, u64)Expand description
Calculates the intrinsic gas cost for a KeyAuthorization.
This is charged before execution as part of transaction validation.
Pre-T1B: Gas = BASE (27k) + signature verification + (22k per spending limit) On T1/T1A this was double-charged alongside the gas-metered precompile call.
T1B+: Gas = signature verification + SLOAD (existing key check) + SSTORE (write key) + N × SSTORE (per spending limit) This is the sole gas accounting — the precompile runs with unlimited gas.
Returns (total_gas, state_gas) where total_gas includes the state gas portion.
On T4+, each storage-creating SSTORE contributes sstore_set_state_gas to state gas
per TIP-1016.