eth/catalyst: abort dev mode block commit if shut down is triggered (#32166)

alternate approach to https://github.com/ethereum/go-ethereum/pull/31328
suggested by @MariusVanDerWijden . This prevents Geth from outputting a
lot of logs when trying to commit on-demand dev mode blocks while the
client is shutting down.

The issue is hard to reproduce, but I've seen it myself and it is
annoying when it happens. I think this is a reasonable simple solution,
and we can revisit if we find that the output is still too large (i.e.
there is a large delay between initiating shut down and the simulated
beacon receiving the signal, while in this loop).

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
This commit is contained in:
jwasinger 2025-07-08 22:15:53 +09:00 committed by GitHub
parent e71487b033
commit 43832e65fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,7 +70,12 @@ func (a *simulatedBeaconAPI) loop() {
if executable, _ := a.sim.eth.TxPool().Stats(); executable == 0 {
break
}
a.sim.Commit()
select {
case <-a.sim.shutdownCh:
return
default:
a.sim.Commit()
}
}
}
}()