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.
Important
This PR is a rebase from #1637
Fix batcher queue ord
Description
There was a bug in the batcher queue ordering of elements, which led to a wrong placement of proofs when a same sender sent proofs with same max_fee.
The consecuence of this bug was seen when the batcher queue is filled, the proofs sent to chain will be not from lowest to highest nonce, but the other way around.
To Test
You can view the unit tests.
Also you can add the following print statements (and can do before this PR so you can verify the bug indeed existed).
in
batcher/aligned-batcher/src/lib.rs
, line 1175:in
messaging.rs
, line 161:This will help to view the resulting state of the batcher queue.
To execute the bug you should send a burst bigger than the batch_qty limit. For this it is recommended to lower this value,
config-batcher.yaml
:Then send a burst of size 8, so that the first batch is of size 5 and the second of size 3. (this ensures you don't get the
batch already submitted
contract revert).For this you can set
BURST_SIZE ?= 8
in the Makefile.Type of change
Checklist
testnet
, everything else tostaging