Skip to content
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

fix: Add max_batch_size to limit the SyncBatch request sizes #152

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Jul 9, 2024

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.

@aakoshh aakoshh requested a review from pompon0 as a code owner July 9, 2024 10:33
@aakoshh aakoshh changed the base branch from main to bft-474-earliest-unsigned July 9, 2024 10:33
@aakoshh aakoshh requested review from brunoffranca and removed request for brunoffranca July 9, 2024 10:38
@brunoffranca brunoffranca merged commit ed5832d into bft-474-earliest-unsigned Jul 9, 2024
5 checks passed
@brunoffranca brunoffranca deleted the fix-sync-batch-size-limit branch July 9, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants