eth/catalyst: ensure TxPool is synced in Fork (#29876)

This should fix an occasional test failure in ethclient/simulated.TestForkResendTx.
Inspection of logs revealed the cause of the failure to be that the txpool was not done
reorganizing by the time Fork is called.
pull/29881/head
Felix Lange 4 months ago committed by GitHub
parent 2f06c1e854
commit 6bb13e8e2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      eth/catalyst/simulated_beacon.go

@ -279,9 +279,12 @@ func (c *SimulatedBeacon) Rollback() {
// Fork sets the head to the provided hash.
func (c *SimulatedBeacon) Fork(parentHash common.Hash) error {
// Ensure no pending transactions.
c.eth.TxPool().Sync()
if len(c.eth.TxPool().Pending(txpool.PendingFilter{})) != 0 {
return errors.New("pending block dirty")
}
parent := c.eth.BlockChain().GetBlockByHash(parentHash)
if parent == nil {
return errors.New("parent not found")

Loading…
Cancel
Save