From 1e456b20f047b29a78e4b670b6fffad9911d712c Mon Sep 17 00:00:00 2001 From: MariusVanDerWijden Date: Sun, 14 Jun 2026 13:53:48 +0200 Subject: [PATCH] core/vm: align with current spec (claude), do not charge for invalid auth --- core/state_transition.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 0b0b34d59f..6947f283b4 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -907,9 +907,12 @@ func (st *stateTransition) validateAuthorization(auth *types.SetCodeAuthorizatio func (st *stateTransition) applyAuthorization(rules params.Rules, auth *types.SetCodeAuthorization, delegates map[common.Address]bool) error { authority, err := st.validateAuthorization(auth) if err != nil { - if rules.IsAmsterdam { - st.gasRemaining.RefundState((params.AccountCreationSize + params.AuthorizationCreationSize) * st.evm.Context.CostPerStateByte) - } + // EIP-8037 (spec apply_authorization): an invalid authorization is + // skipped without any state-gas refund. The per-auth intrinsic state + // charge ((NEW_ACCOUNT + AUTH_BASE) * CPSB) was levied for every + // authorization in the list regardless of validity, and only a + // successfully-applied authorization that avoids creating new state + // earns a refund below. Invalid auths therefore pay in full. return err } prevDelegation, curDelegated := types.ParseDelegation(st.state.GetCode(authority))