Skip to main content

calculate_key_authorization_gas

Function calculate_key_authorization_gas 

Source
fn calculate_key_authorization_gas(
    key_auth: &SignedKeyAuthorization,
    gas_params: &GasParams,
    spec: TempoHardfork,
) -> 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.