internal/ethapi: skip tx gas limit check for calls

This disables the tx gaslimit cap for eth_call and related RPC operations.
This commit is contained in:
Felix Lange 2025-09-17 16:30:43 +02:00
parent ab95477a65
commit ef133c3c9f
2 changed files with 5 additions and 1 deletions

View file

@ -166,6 +166,9 @@ type Message struct {
// When SkipFromEOACheck is true, the message sender is not checked to be an EOA. // When SkipFromEOACheck is true, the message sender is not checked to be an EOA.
SkipFromEOACheck bool SkipFromEOACheck bool
// If enabled, the message gas limit is not checked against the protocol-enforced tx gaslimit.
SkipTxGasLimitCheck bool
} }
// TransactionToMessage converts a transaction into a Message. // TransactionToMessage converts a transaction into a Message.
@ -399,7 +402,7 @@ func (st *stateTransition) preCheck() error {
} }
} }
// Verify tx gas limit does not exceed EIP-7825 cap. // Verify tx gas limit does not exceed EIP-7825 cap.
if isOsaka && msg.GasLimit > params.MaxTxGas { if isOsaka && !msg.SkipTxGasLimitCheck && msg.GasLimit > params.MaxTxGas {
return fmt.Errorf("%w (cap: %d, tx: %d)", ErrGasLimitTooHigh, params.MaxTxGas, msg.GasLimit) return fmt.Errorf("%w (cap: %d, tx: %d)", ErrGasLimitTooHigh, params.MaxTxGas, msg.GasLimit)
} }
return st.buyGas() return st.buyGas()

View file

@ -492,6 +492,7 @@ func (args *TransactionArgs) ToMessage(baseFee *big.Int, skipNonceCheck, skipEoA
SetCodeAuthorizations: args.AuthorizationList, SetCodeAuthorizations: args.AuthorizationList,
SkipNonceChecks: skipNonceCheck, SkipNonceChecks: skipNonceCheck,
SkipFromEOACheck: skipEoACheck, SkipFromEOACheck: skipEoACheck,
SkipTxGasLimitCheck: true,
} }
} }