Skip to content

Commit

Permalink
Avoid a race in the SimulatedBeacon Stop call
Browse files Browse the repository at this point in the history
The go routine which is responsible for committing blocks was spewing our errors
in a spinLoop because it was continuing to call Commit when the txPool was
already terminated.

This could cause intense i/o and lead to VSCode hanging, or CI being unable to
process the logs.
  • Loading branch information
eljobe committed Mar 6, 2025
1 parent 846c6cf commit 1448c93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eth/catalyst/simulated_beacon_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}()
Expand Down

0 comments on commit 1448c93

Please sign in to comment.