-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify the batch poster to support the delay buffer feature #2758
Open
gligneul
wants to merge
17
commits into
bold-review
Choose a base branch
from
gligneul/delay-buffer-bold
base: bold-review
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+331
−29
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get the delay message accumulator from the previous message.
* Test batch poster without delay buffer works * Test delay buffer don't force batch without delayed messages
Rebase the delay buffer PR on top of BoLD's little merge. Then, use the BoLD version of the contracts when appropriate instead of using the delay-buffer development branch.
cla-bot
bot
added
the
s
Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
label
Oct 28, 2024
The tests are failing because of the base branch (bold-review). Locally, the delay-buffer tests are passing, so I'm setting this PR as ready to review. |
eljobe
approved these changes
Nov 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks like a very good PR.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
s
Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
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.
This PR introduces the delay buffer from the sequencer inbox to the batch poster. The delay buffer is a feature that limits repeated sequencer censorship while maintaining the property that allows the sequencer to recover after an outage.
At the high level, we want to achieve two things. The first is ensuring the batch poster posts batches often enough not to consume blocks from the delay buffer. The second is modifying the batch poster to post delay proofs when a batch contains a delayed message.
An immutable field called isDelayBufferable is in the sequencer inbox to indicate whether the delay buffer is enabled. We use this field to enable or disable the delay buffer feature in the batch poster. When getting this field, if the EVM returns an execution error, the batch poster assumes it is using an old version of the contracts.
When creating a batch, if the delay buffer is enabled, the batch contains a delayed message, and the time since the first delayed message is greater than the threshold, then the batch poster posts the batch immediately. We do this to ensure we are not consuming from the delay buffer.
If the batch contains a delayed message, the batch poster includes a delay proof when submitting it. A delay proof contains the accumulator hash of the last accepted delayed message and the current batch's first delayed message. The batch poster stores the contents of the first delayed message in the batchSegments structure to reference it later. Then, depending on whether the batch contains a delayed message, it calls the corresponding contract method in the encodeAddBatch function.
The delay buffer system tests use the BoLD version of the contracts, so this PR also adds initial support for them in the NodeBuilder. All other tests are left unmodified and use the legacy version of the contracts.
Close NIT-2510