Function apply_auth_list_eip2780
pub fn apply_auth_list_eip2780<JOURNAL, ERROR>(
chain_id: u64,
auth_list: impl Iterator<Item = impl AuthorizationTr>,
journal: &mut JOURNAL,
account_write_cost: u64,
new_account_state_gas: u64,
delegation_bytes_state_gas: u64,
written_accounts: &mut HashSet<Address, DefaultHashBuilder>,
gas: &mut GasTracker,
) -> Result<bool, ERROR>Expand description
Applies an EIP-7702 auth list under EIP-2780, recording the
state-dependent runtime charges on the transaction-level gas instead of
the pessimistic intrinsic-charge/refund bookkeeping of apply_auth_list.
Rejected authorizations charge nothing here: the intrinsic
REGULAR_PER_AUTH_BASE_COST already covers the work every authorization
performs (calldata, recovery, authority access), so there is nothing to
refund either.
written_accounts holds the accounts whose leaf write is already paid for
(the sender, and the recipient of a value-bearing transaction); applying an
authorization to any other authority pays ACCOUNT_WRITE on the first
write to that authority within the transaction.
The charges are recorded on gas as the authorizations are applied, so
the phase stops at the first unaffordable charge without loading the
remaining authorities (observable through the EIP-7928 block access list).
Returns whether the authorization processing ran out of gas.