From 8d2920bbc4cd427495eaa2e775421a0375615938 Mon Sep 17 00:00:00 2001 From: Pepper Lebeck-Jobe Date: Thu, 6 Mar 2025 11:54:50 +0100 Subject: [PATCH] Avoid a race in the SimulatedBeacon Stop call Fixes: #31327 --- eth/catalyst/simulated_beacon_api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eth/catalyst/simulated_beacon_api.go b/eth/catalyst/simulated_beacon_api.go index 6687805315..515908f86c 100644 --- a/eth/catalyst/simulated_beacon_api.go +++ b/eth/catalyst/simulated_beacon_api.go @@ -71,6 +71,10 @@ func (a *simulatedBeaconAPI) loop() { break } a.sim.Commit() + // Avoid a race condition where tx pool is terminated during Commit. + if err := a.sim.eth.TxPool().Sync(); err != nil { + break + } } } }()