core, miner: add isOsaka field

This commit is contained in:
Gary Rong 2025-06-11 22:00:17 +08:00
parent e2420abbc3
commit ccf302067e
2 changed files with 5 additions and 3 deletions

View file

@ -82,9 +82,12 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
}
// Blob transactions may be present after the Cancun fork.
var blobs int
var (
blobs int
isOsaka = v.config.IsOsaka(block.Number(), block.Time())
)
for i, tx := range block.Transactions() {
if v.config.IsOsaka(block.Number(), block.Time()) && tx.Gas() > params.MaxTxGas {
if isOsaka && tx.Gas() > params.MaxTxGas {
return fmt.Errorf("%w (cap: %d, tx: %d)", ErrGasLimitTooHigh, params.MaxTxGas, tx.Gas())
}

View file

@ -448,7 +448,6 @@ func (miner *Miner) fillTransactions(interrupt *atomic.Int32, env *environment)
filter.GasLimitCap = params.MaxTxGas
}
filter.OnlyPlainTxs, filter.OnlyBlobTxs = true, false
pendingPlainTxs := miner.txpool.Pending(filter)
filter.OnlyPlainTxs, filter.OnlyBlobTxs = false, true