mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
Merge fe6e62631f into dddbaa4bf3
This commit is contained in:
commit
5a7b7cc5ba
1 changed files with 12 additions and 2 deletions
|
|
@ -428,6 +428,8 @@ func (miner *Miner) commitTransactions(ctx context.Context, env *environment, pl
|
||||||
defer spanEnd(nil)
|
defer spanEnd(nil)
|
||||||
|
|
||||||
isCancun := miner.chainConfig.IsCancun(env.header.Number, env.header.Time)
|
isCancun := miner.chainConfig.IsCancun(env.header.Number, env.header.Time)
|
||||||
|
var fixSizeRetry = 0
|
||||||
|
const fixSizeRetryLimit = 10
|
||||||
for {
|
for {
|
||||||
// Check interruption signal and abort building if it's fired.
|
// Check interruption signal and abort building if it's fired.
|
||||||
if interrupt != nil {
|
if interrupt != nil {
|
||||||
|
|
@ -498,10 +500,18 @@ func (miner *Miner) commitTransactions(ctx context.Context, env *environment, pl
|
||||||
}
|
}
|
||||||
|
|
||||||
// if inclusion of the transaction would put the block size over the
|
// if inclusion of the transaction would put the block size over the
|
||||||
// maximum we allow, don't add any more txs to the payload.
|
// maximum we allow, skip this sender and try the next sender's
|
||||||
|
// transactions, consistent with the gas and blob space checks above.
|
||||||
if !env.txFitsSize(tx) {
|
if !env.txFitsSize(tx) {
|
||||||
|
log.Trace("Not enough block space left for transaction", "hash", ltx.Hash, "size", tx.Size())
|
||||||
|
txs.Pop()
|
||||||
|
fixSizeRetry++
|
||||||
|
if fixSizeRetry <= fixSizeRetryLimit {
|
||||||
|
continue
|
||||||
|
} else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Error may be ignored here. The error has already been checked
|
// Error may be ignored here. The error has already been checked
|
||||||
// during transaction acceptance in the transaction pool.
|
// during transaction acceptance in the transaction pool.
|
||||||
from, _ := types.Sender(env.signer, tx)
|
from, _ := types.Sender(env.signer, tx)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue