Fix timeboost auction resolution queue handling #2764
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If there were auction resolution transactions in the timeboostAuctionResolutionTxQueue but no normal transactions came through the txQueue, then the auction resolution tx would not be processed because the main createBlock loop was waiting on the txQueue channel and not the auction resolution queue. We had tried to use the same pattern as we had used for the txRetryQueue but this is not correct as the auction resolution queue, like the txQueue, can have items added to it asynchronously, whereas the txRetryQueue is only added to from the createBlock itself.
This commit makes the timeboostAuctionResolutionTxQueue also a channel so that it can be waited on in the same select statement and handle asynchronous events correctly.
This also fixes two issues related to shutdown. The first was a race condition with shutting down and txRetryQueue handling, and the second was that we were missing adding forwarding for outstanding auction resolution txs upon shutdown.
Fixes NIT-2878
Testing done
Express lane system test passes
Confirmed fix by re-running manual repro test with nitro-testnode.
Followed instructions in OffchainLabs/nitro-testnode#95 to start nitro testnode in timeboost mode and made a bid. As soon as the auction was resolved it was picked up immediately by the sequencer.