cmd/evm, eth/gasestimator, miner: apply the EIP-8037

This commit is contained in:
Gary Rong 2026-04-28 20:11:45 +08:00
parent 76e61c5a1a
commit 184bef1ec3
3 changed files with 8 additions and 6 deletions

View file

@ -185,7 +185,9 @@ func Transaction(ctx *cli.Context) error {
} }
} }
if chainConfig.IsOsaka(new(big.Int), 0) && tx.Gas() > params.MaxTxGas { isOsaka := chainConfig.IsOsaka(new(big.Int), 0)
isAmsterdam := chainConfig.IsAmsterdam(new(big.Int), 0)
if isOsaka && !isAmsterdam && tx.Gas() > params.MaxTxGas {
r.Error = errors.New("gas limit exceeds maximum") r.Error = errors.New("gas limit exceeds maximum")
} }
results = append(results, r) results = append(results, r)

View file

@ -63,10 +63,10 @@ func Estimate(ctx context.Context, call *core.Message, opts *Options, gasCap uin
} }
// Cap the maximum gas allowance according to EIP-7825 if the estimation targets Osaka // Cap the maximum gas allowance according to EIP-7825 if the estimation targets Osaka
if hi > params.MaxTxGas { isOsaka := opts.Config.IsOsaka(opts.Header.Number, opts.Header.Time)
if opts.Config.IsOsaka(opts.Header.Number, opts.Header.Time) { isAmsterdam := opts.Config.IsAmsterdam(opts.Header.Number, opts.Header.Time)
hi = params.MaxTxGas if hi > params.MaxTxGas && isOsaka && !isAmsterdam {
} hi = params.MaxTxGas
} }
// Normalize the max fee per gas the call is willing to spend. // Normalize the max fee per gas the call is willing to spend.

View file

@ -560,7 +560,7 @@ func (miner *Miner) fillTransactions(ctx context.Context, interrupt *atomic.Int3
if env.header.ExcessBlobGas != nil { if env.header.ExcessBlobGas != nil {
filter.BlobFee = uint256.MustFromBig(eip4844.CalcBlobFee(miner.chainConfig, env.header)) filter.BlobFee = uint256.MustFromBig(eip4844.CalcBlobFee(miner.chainConfig, env.header))
} }
if miner.chainConfig.IsOsaka(env.header.Number, env.header.Time) { if miner.chainConfig.IsOsaka(env.header.Number, env.header.Time) && !miner.chainConfig.IsAmsterdam(env.header.Number, env.header.Time) {
filter.GasLimitCap = params.MaxTxGas filter.GasLimitCap = params.MaxTxGas
} }
filter.BlobTxs = false filter.BlobTxs = false