Skip to content

feat(l1): adjust byte code batch size (snap sync parameter)#2338

Merged
fmoletta merged 3 commits intomainfrom
adjust-bytecode-batch-size
Apr 3, 2025
Merged

feat(l1): adjust byte code batch size (snap sync parameter)#2338
fmoletta merged 3 commits intomainfrom
adjust-bytecode-batch-size

Conversation

@fmoletta
Copy link
Copy Markdown
Contributor

Motivation
Previous changes have sped up other components of the snap sync process, making faults in the byte code fetcher more evident. The byte code fetcher used the same batch size as storage requests, 300, which is far more than the byte codes normally returned by a peer request, causing the byte code fetcher to keep on fetching the last batches when all other fetchers have already finished.
This PR reduces the batch size down to 70 so that it coincides with the amount of byte codes regularly returned by peers

Description

  • Rename constant BATCH_SIZE -> STORAGE_BATCH_SIZE
  • Add constant BYTECODE_BATCH_SIZE

Closes #issue_number

@fmoletta fmoletta marked this pull request as ready for review March 27, 2025 19:06
@fmoletta fmoletta requested a review from a team as a code owner March 27, 2025 19:06
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 27, 2025

Lines of code report

Total lines added: 6
Total lines removed: 0
Total lines changed: 6

Detailed view
+-------------------------------------------------------+-------+------+
| File                                                  | Lines | Diff |
+-------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync.rs                  | 563   | +1   |
+-------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/bytecode_fetcher.rs | 45    | +2   |
+-------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/storage_fetcher.rs  | 238   | +3   |
+-------------------------------------------------------+-------+------+

@fmoletta fmoletta added this pull request to the merge queue Apr 3, 2025
Merged via the queue into main with commit c9b0dbb Apr 3, 2025
25 checks passed
@fmoletta fmoletta deleted the adjust-bytecode-batch-size branch April 3, 2025 13:39
jrchatruc pushed a commit that referenced this pull request Apr 3, 2025
**Motivation**
Previous changes have sped up other components of the snap sync process,
making faults in the byte code fetcher more evident. The byte code
fetcher used the same batch size as storage requests, 300, which is far
more than the byte codes normally returned by a peer request, causing
the byte code fetcher to keep on fetching the last batches when all
other fetchers have already finished.
This PR reduces the batch size down to 70 so that it coincides with the
amount of byte codes regularly returned by peers
<!-- Why does this pull request exist? What are its goals? -->

**Description**
* Rename constant `BATCH_SIZE` -> `STORAGE_BATCH_SIZE`
* Add constant `BYTECODE_BATCH_SIZE`
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #issue_number
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
…ass#2338)

**Motivation**
Previous changes have sped up other components of the snap sync process,
making faults in the byte code fetcher more evident. The byte code
fetcher used the same batch size as storage requests, 300, which is far
more than the byte codes normally returned by a peer request, causing
the byte code fetcher to keep on fetching the last batches when all
other fetchers have already finished.
This PR reduces the batch size down to 70 so that it coincides with the
amount of byte codes regularly returned by peers
<!-- Why does this pull request exist? What are its goals? -->

**Description**
* Rename constant `BATCH_SIZE` -> `STORAGE_BATCH_SIZE`
* Add constant `BYTECODE_BATCH_SIZE`
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->

Closes #issue_number
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