|
|
@ -143,7 +143,7 @@ type Message struct { |
|
|
|
AccessList types.AccessList |
|
|
|
AccessList types.AccessList |
|
|
|
BlobGasFeeCap *big.Int |
|
|
|
BlobGasFeeCap *big.Int |
|
|
|
BlobHashes []common.Hash |
|
|
|
BlobHashes []common.Hash |
|
|
|
AuthList []types.SetCodeAuthorization |
|
|
|
SetCodeAuthorizations []types.SetCodeAuthorization |
|
|
|
|
|
|
|
|
|
|
|
// When SkipNonceChecks is true, the message nonce is not checked against the
|
|
|
|
// When SkipNonceChecks is true, the message nonce is not checked against the
|
|
|
|
// account nonce in state.
|
|
|
|
// account nonce in state.
|
|
|
@ -166,7 +166,7 @@ func TransactionToMessage(tx *types.Transaction, s types.Signer, baseFee *big.In |
|
|
|
Value: tx.Value(), |
|
|
|
Value: tx.Value(), |
|
|
|
Data: tx.Data(), |
|
|
|
Data: tx.Data(), |
|
|
|
AccessList: tx.AccessList(), |
|
|
|
AccessList: tx.AccessList(), |
|
|
|
AuthList: tx.AuthList(), |
|
|
|
SetCodeAuthorizations: tx.SetCodeAuthorizations(), |
|
|
|
SkipNonceChecks: false, |
|
|
|
SkipNonceChecks: false, |
|
|
|
SkipFromEOACheck: false, |
|
|
|
SkipFromEOACheck: false, |
|
|
|
BlobHashes: tx.BlobHashes(), |
|
|
|
BlobHashes: tx.BlobHashes(), |
|
|
@ -372,11 +372,11 @@ func (st *stateTransition) preCheck() error { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// Check that EIP-7702 authorization list signatures are well formed.
|
|
|
|
// Check that EIP-7702 authorization list signatures are well formed.
|
|
|
|
if msg.AuthList != nil { |
|
|
|
if msg.SetCodeAuthorizations != nil { |
|
|
|
if msg.To == nil { |
|
|
|
if msg.To == nil { |
|
|
|
return fmt.Errorf("%w (sender %v)", ErrSetCodeTxCreate, msg.From) |
|
|
|
return fmt.Errorf("%w (sender %v)", ErrSetCodeTxCreate, msg.From) |
|
|
|
} |
|
|
|
} |
|
|
|
if len(msg.AuthList) == 0 { |
|
|
|
if len(msg.SetCodeAuthorizations) == 0 { |
|
|
|
return fmt.Errorf("%w (sender %v)", ErrEmptyAuthList, msg.From) |
|
|
|
return fmt.Errorf("%w (sender %v)", ErrEmptyAuthList, msg.From) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -417,7 +417,7 @@ func (st *stateTransition) execute() (*ExecutionResult, error) { |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// Check clauses 4-5, subtract intrinsic gas if everything is correct
|
|
|
|
// Check clauses 4-5, subtract intrinsic gas if everything is correct
|
|
|
|
gas, err := IntrinsicGas(msg.Data, msg.AccessList, msg.AuthList, contractCreation, rules.IsHomestead, rules.IsIstanbul, rules.IsShanghai) |
|
|
|
gas, err := IntrinsicGas(msg.Data, msg.AccessList, msg.SetCodeAuthorizations, contractCreation, rules.IsHomestead, rules.IsIstanbul, rules.IsShanghai) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
@ -467,8 +467,8 @@ func (st *stateTransition) execute() (*ExecutionResult, error) { |
|
|
|
st.state.SetNonce(msg.From, st.state.GetNonce(msg.From)+1) |
|
|
|
st.state.SetNonce(msg.From, st.state.GetNonce(msg.From)+1) |
|
|
|
|
|
|
|
|
|
|
|
// Apply EIP-7702 authorizations.
|
|
|
|
// Apply EIP-7702 authorizations.
|
|
|
|
if msg.AuthList != nil { |
|
|
|
if msg.SetCodeAuthorizations != nil { |
|
|
|
for _, auth := range msg.AuthList { |
|
|
|
for _, auth := range msg.SetCodeAuthorizations { |
|
|
|
// Note errors are ignored, we simply skip invalid authorizations here.
|
|
|
|
// Note errors are ignored, we simply skip invalid authorizations here.
|
|
|
|
st.applyAuthorization(msg, &auth) |
|
|
|
st.applyAuthorization(msg, &auth) |
|
|
|
} |
|
|
|
} |
|
|
|