mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 22:43:47 +00:00
fix(miner): fix repeatedly processing dropped txs in a new block (#491)
* squash * improve comments * Remove tx (#493) * force drop * minor * store skipped L2 tx for `circuitcapacitychecker.ErrUnknown` * Update miner/worker.go Co-authored-by: Péter Garamvölgyi <peter@scroll.io> * add lock * use mu --------- Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
This commit is contained in:
parent
f883dcdc21
commit
ea3a3c9a5d
3 changed files with 14 additions and 1 deletions
|
|
@ -1023,6 +1023,15 @@ func (pool *TxPool) Has(hash common.Hash) bool {
|
||||||
return pool.all.Get(hash) != nil
|
return pool.all.Get(hash) != nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoveTx is similar to removeTx, but with locking to prevent concurrency.
|
||||||
|
// Note: currently should only be called by miner/worker.go.
|
||||||
|
func (pool *TxPool) RemoveTx(hash common.Hash, outofbound bool) {
|
||||||
|
pool.mu.Lock()
|
||||||
|
defer pool.mu.Unlock()
|
||||||
|
|
||||||
|
pool.removeTx(hash, outofbound)
|
||||||
|
}
|
||||||
|
|
||||||
// removeTx removes a single transaction from the queue, moving all subsequent
|
// removeTx removes a single transaction from the queue, moving all subsequent
|
||||||
// transactions back to the future queue.
|
// transactions back to the future queue.
|
||||||
func (pool *TxPool) removeTx(hash common.Hash, outofbound bool) {
|
func (pool *TxPool) removeTx(hash common.Hash, outofbound bool) {
|
||||||
|
|
|
||||||
|
|
@ -1090,6 +1090,7 @@ loop:
|
||||||
// Skip L2 transaction and all other transactions from the same sender account
|
// Skip L2 transaction and all other transactions from the same sender account
|
||||||
log.Info("Skipping L2 message", "tx", tx.Hash().String(), "block", w.current.header.Number, "reason", "first tx row consumption overflow")
|
log.Info("Skipping L2 message", "tx", tx.Hash().String(), "block", w.current.header.Number, "reason", "first tx row consumption overflow")
|
||||||
txs.Pop()
|
txs.Pop()
|
||||||
|
w.eth.TxPool().RemoveTx(tx.Hash(), true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset ccc so that we can process other transactions for this block
|
// Reset ccc so that we can process other transactions for this block
|
||||||
|
|
@ -1121,10 +1122,13 @@ loop:
|
||||||
// Circuit capacity check: unknown circuit capacity checker error for L2MessageTx, skip the account
|
// Circuit capacity check: unknown circuit capacity checker error for L2MessageTx, skip the account
|
||||||
log.Trace("Unknown circuit capacity checker error for L2MessageTx", "tx", tx.Hash().String())
|
log.Trace("Unknown circuit capacity checker error for L2MessageTx", "tx", tx.Hash().String())
|
||||||
log.Info("Skipping L2 message", "tx", tx.Hash().String(), "block", w.current.header.Number, "reason", "unknown row consumption error")
|
log.Info("Skipping L2 message", "tx", tx.Hash().String(), "block", w.current.header.Number, "reason", "unknown row consumption error")
|
||||||
|
// TODO: propagate more info about the error from CCC
|
||||||
|
rawdb.WriteSkippedTransaction(w.eth.ChainDb(), tx, "unknown circuit capacity checker error", w.current.header.Number.Uint64(), nil)
|
||||||
|
|
||||||
// Normally we would do `txs.Pop()` here.
|
// Normally we would do `txs.Pop()` here.
|
||||||
// However, after `ErrUnknown`, ccc might remain in an
|
// However, after `ErrUnknown`, ccc might remain in an
|
||||||
// inconsistent state, so we cannot pack more transactions.
|
// inconsistent state, so we cannot pack more transactions.
|
||||||
|
w.eth.TxPool().RemoveTx(tx.Hash(), true)
|
||||||
circuitCapacityReached = true
|
circuitCapacityReached = true
|
||||||
break loop
|
break loop
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
const (
|
const (
|
||||||
VersionMajor = 4 // Major version component of the current release
|
VersionMajor = 4 // Major version component of the current release
|
||||||
VersionMinor = 3 // Minor version component of the current release
|
VersionMinor = 3 // Minor version component of the current release
|
||||||
VersionPatch = 55 // Patch version component of the current release
|
VersionPatch = 56 // Patch version component of the current release
|
||||||
VersionMeta = "sepolia" // Version metadata to append to the version string
|
VersionMeta = "sepolia" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue