eth/catalyst: add comment about spin loop

This commit is contained in:
lightclient 2024-08-19 07:21:59 -06:00
parent bc9f01c3a5
commit 972c05531d
No known key found for this signature in database
GPG key ID: 75C916AFEE20183E

View file

@ -61,6 +61,11 @@ func (a *simulatedBeaconAPI) loop() {
for _ = range doCommit { for _ = range doCommit {
a.sim.Commit() a.sim.Commit()
a.sim.eth.TxPool().Sync() a.sim.eth.TxPool().Sync()
// It's worth noting that in case a tx ends up in the pool listed as
// "executable", but for whatever reason the miner does not include it in
// a block -- maybe the miner is enforcing a higher tip than the pool --
// this code will spinloop.
for { for {
if executable, _ := a.sim.eth.TxPool().Stats(); executable == 0 { if executable, _ := a.sim.eth.TxPool().Stats(); executable == 0 {
break break