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

refactor(l1): modularize sync code & add doc comments for each module #1961

Merged
merged 354 commits into from
Feb 18, 2025

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Feb 14, 2025

Motivation
The code for sync has grown significantly since its start, and having it all under the same module can make it very hard to follow.
This PR aims to solve this by separating each different job into different modules and adding module-level documentation for each, explaining how each part of the sync works and integrates to the system as a whole

Description

  • Separate sync code into different modules, one for each separate functionality
  • Add doc comments for each individual module explaining its purpose and mechanics

Notes for merging:
This PR will likely conflict with #1936 but it has the same exact code, only moving it across modules, so it should be safe to solve all conflicts by keeping the changes from this PR alone. Alternatively, you can also merge this PR into #1936 as it has no conflicts and then merge #1936

Copy link

github-actions bot commented Feb 14, 2025

| File                                                                           | Lines | Diff |
+--------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/sync.rs                  | 403   | -791 |
+--------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/sync/bytecode_fetcher.rs | 43    | +43  |
+--------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/sync/state_healing.rs    | 118   | +118 |
+--------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/sync/state_sync.rs       | 234   | +234 |
+--------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/sync/storage_fetcher.rs  | 150   | +150 |
+--------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/sync/storage_healing.rs  | 97    | +97  |
+--------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/p2p/sync/trie_rebuild.rs     | 236   | +236 |
+--------------------------------------------------------------------------------+-------+------+

Total lines added: +878
Total lines removed: 791
Total lines changed: 1669

@fmoletta fmoletta changed the base branch from main to parallel-state-sync-rebuild-in-background-refactor February 14, 2025 20:26
@fmoletta fmoletta changed the base branch from parallel-state-sync-rebuild-in-background-refactor to parallel-state-sync-rebuild-in-background-plus-tcp-peers February 14, 2025 20:26
@fmoletta fmoletta changed the base branch from parallel-state-sync-rebuild-in-background-plus-tcp-peers to parallel-state-sync-rebuild-in-background-refactor-early-healing February 14, 2025 20:27
@fmoletta fmoletta marked this pull request as ready for review February 14, 2025 23:34
@fmoletta fmoletta requested a review from a team as a code owner February 14, 2025 23:34
Base automatically changed from parallel-state-sync-rebuild-in-background-refactor-early-healing to main February 17, 2025 18:48
@mpaulucci mpaulucci changed the base branch from main to parallel-state-sync-rebuild-in-background-refactor-early-healing February 18, 2025 12:53
@mpaulucci mpaulucci changed the base branch from parallel-state-sync-rebuild-in-background-refactor-early-healing to main February 18, 2025 13:03
@mpaulucci mpaulucci enabled auto-merge February 18, 2025 13:08
@mpaulucci mpaulucci added this pull request to the merge queue Feb 18, 2025
Merged via the queue into main with commit 986dc6c Feb 18, 2025
22 checks passed
@mpaulucci mpaulucci deleted the reorganize-sync-code branch February 18, 2025 13:39
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