Skip to content

Commit ea7bbe4

Browse files
committed
small cleanups and documentation rewording throughout the changes
1 parent 77f2a36 commit ea7bbe4

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

core/txpool/legacypool/legacypool.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ func (pool *LegacyPool) runReorg(done chan struct{}, reset *txpoolResetRequest,
12661266
if pool.chainconfig.IsOsaka(reset.newHead.Number, reset.newHead.Time) && !pool.chainconfig.IsOsaka(reset.oldHead.Number, reset.oldHead.Time) {
12671267
var removeHashes []common.Hash
12681268
pool.all.Range(func(hash common.Hash, tx *types.Transaction) bool {
1269-
if tx.Gas() > 30_000_000 {
1269+
if tx.Gas() > params.MaxTxGas {
12701270
removeHashes = append(removeHashes, hash)
12711271
}
12721272
return true
@@ -1305,7 +1305,6 @@ func (pool *LegacyPool) runReorg(done chan struct{}, reset *txpoolResetRequest,
13051305
pendingBaseFee := eip1559.CalcBaseFee(pool.chainconfig, reset.newHead)
13061306
pool.priced.SetBaseFee(pendingBaseFee)
13071307
} else {
1308-
// condition can only occur in testing?
13091308
pool.priced.Reheap()
13101309
}
13111310
}

core/txpool/txpool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type TxPool struct {
7878
sync chan chan error // Testing / simulator channel to block until internal reset is done
7979

8080
headLock sync.RWMutex
81-
head *types.Header // the head of the current pool state
81+
head *types.Header // this reflects the state from the latest pool reset
8282
}
8383

8484
// New creates a new transaction pool to gather, sort and filter inbound

core/txpool/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
8787
return fmt.Errorf("%w: code size %v, limit %v", core.ErrMaxInitCodeSizeExceeded, len(tx.Data()), params.MaxInitCodeSize)
8888
}
8989
if rules.IsOsaka && tx.Gas() > params.MaxTxGas {
90-
return fmt.Errorf("transaction gas exceeded max allowed (30_000_000): %d", tx.Gas())
90+
return fmt.Errorf("transaction gas exceeded max allowed (%d): %d", params.MaxTxGas, tx.Gas())
9191
}
9292
// Transactions can't be negative. This may never happen using RLP decoded
9393
// transactions but may occur for transactions created using the RPC.

miner/worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ func (miner *Miner) commitTransactions(env *environment, plainTxs, blobTxs *tran
427427
return nil
428428
}
429429

430-
// fiterTxsAboveGas removes any transactions from a sender which exceed masGas.
430+
// fiterTxsAboveGas removes any transactions from the set which exceed a gas threshold.
431431
// If a transaction is removed, all higher-nonce transactions from the same account
432432
// will also be filtered out.
433433
func filterTxsAboveGas(txs map[common.Address][]*txpool.LazyTransaction, maxGas uint64) {

0 commit comments

Comments
 (0)