-
Notifications
You must be signed in to change notification settings - Fork 39
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
refactor: Use earliest batch number to sign (BFT-474) #150
Merged
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
aakoshh
changed the title
BFT-474: Refactor attestation to use earliest batch number to sign
refactor: Use earliest batch number to sign (BFT-474)
Jul 8, 2024
brunoffranca
approved these changes
Jul 8, 2024
7 tasks
aakoshh
force-pushed
the
bft-474-earliest-unsigned
branch
from
July 9, 2024 09:23
d0b31f8
to
e79137f
Compare
aakoshh
force-pushed
the
bft-474-earliest-unsigned
branch
from
July 9, 2024 09:56
e79137f
to
0466e99
Compare
4 tasks
## What ❔ Adds a `max_batch_size` setting and uses it to set a `max_req_size` limit in the RPC that deals with `SyncBatch`. Fixes some of the comments added in #150 ### Alternative configuration The size of `SyncBatch` depends on how many blocks are in the batch, plus a fixed size proof. Since we already have a limit for the size of block payloads, ostensibly we could add a limit on the number of blocks in the batch; I used 100 in the protobuf reader if the field was missing. Perhaps this setting is already available somewhere in zksync-era? ## Why ❔ Tests failed in matter-labs/zksync-era#2340 when I unintentionally enabled the gossiping of `SyncBatch` due to the large size of the requests. It turns out they were either hardcoded constants copied from the block store state gossip (which doesn't depend on the payload size, only the QC), or they wrongly used the block payload limit.
RomanBrodetski
approved these changes
Jul 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What ❔
Followup for some design discussions in #148
BatchStore::unsigned_batch_numbers
BatchStore::earliest_batch_number_to_sign
BatchStore::latest_batch_number
AttesterRunner
to have a mutable range ofearliest_batch_number
andlatest_batch_number
instead of queryingunsigned_batch_numbers
and filtering it with amin_batch_number
Why ❔
This might be more intuitive than the original version.
Another motivation was that the current implementation of
unsigned_batch_numbers
in matter-labs/zksync-era#2399 has to do two queries: 1) to figure out the latest batch number and 2) to find all batches without certificates within a limited range of the latest batch.Here we only query the latest batch number in each loop, and we forego the check on whether a QC already exists, otherwise we'd be back at doing two queries, or some ugly book keeping to only check it on the first loop after a restart. It should be cheap enough to publish a duplicate vote.