Skip to content

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

github-actions bot commented Jul 14, 2025

Lines of code report

Total lines added: 50
Total lines removed: 0
Total lines changed: 50

Detailed view
+------------------------------------------------------+-------+------+
| File                                                 | Lines | Diff |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/state_healing.rs   | 153   | +20  |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/storage_healing.rs | 130   | +15  |
+------------------------------------------------------+-------+------+
| 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
@mpaulucci mpaulucci moved this to In Review in ethrex_l1 Jul 17, 2025
@fmoletta fmoletta force-pushed the speed-up-healing branch 2 times, most recently from b5b5e6f to 62b5dd8 Compare July 18, 2025 15:45
@mpaulucci mpaulucci marked this pull request as draft August 26, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Ethereum client
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

1 participant