Skip to content

feat(l1): measure & speed up healing during snap sync #3623

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

Open
wants to merge 16 commits into
base: snap-sync-improvements
Choose a base branch
from

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Jul 14, 2025

Based on #2447 (It relies on the async trie write methods added by it)
Motivation
This PR aims to measure and improve the healing stage of snap sync.
Measuring: Measures the time taken to heal 100 state/storage nodes
Improvements: Write nodes asynchronously + Commit storage nodes from different tries at once. Observed improvements in hoodi testnet amounted to halved healing times in both state and storage healing

Description

  • Use async methods to store nodes obtained from peers during healing phase
  • Store nodes from different tries in a single operation for storage nodes
  • Measure and show healing speed (in ms/100nodes)
  • Fix: also fetch pivot block body before executing post-pivot blocks (as validation now requires parent body to be present)

Closes #issue_number

@github-actions github-actions bot added the L1 Ethereum client label Jul 14, 2025
Copy link

Lines of code report

Total lines added: 62
Total lines removed: 0
Total lines changed: 62

Detailed view
+------------------------------------------------------+-------+------+
| File                                                 | Lines | Diff |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync.rs                 | 593   | +11  |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/state_healing.rs   | 153   | +20  |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/storage_healing.rs | 131   | +16  |
+------------------------------------------------------+-------+------+
| ethrex/crates/storage/trie_db/libmdbx_dupsort.rs     | 93    | +15  |
+------------------------------------------------------+-------+------+

@fmoletta fmoletta changed the title feat(l1): measure & speed up healing during snap sync [WIP] feat(l1): measure & speed up healing during snap sync Jul 15, 2025
@fmoletta fmoletta marked this pull request as ready for review July 15, 2025 21:24
@fmoletta fmoletta requested a review from a team as a code owner July 15, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Ethereum client
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant