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

feat(l1): improve healing #1867

Merged
merged 264 commits into from
Feb 3, 2025
Merged

feat(l1): improve healing #1867

merged 264 commits into from
Feb 3, 2025

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Feb 3, 2025

Motivation
Reverts the "slow but safe" approach to healing taken by #1763 and instead adds the intermediate nodes received from peers to the trie.

Description

  • Write nodes fetched during healing to the state instead of writing only leaf values
  • Track paths left in queue when a healing cycle ends due to pivot staleness
  • Condense snap checkpoint clearing to one single method
  • (Misc) Move some noisy p2p info tracing to debug
  • (Fix) When executing full blocks after the pivot block during snap sync execute the block first before setting it as canonical

Comments
A not so pretty solution was implemented on the storage_healer (the startup flag) to avoid blocking storage healing at the start. This can and will be improved but doing so in this PR is not worth it when follow up PRs will already touch up on this logic when parallelizing storage node fetching (similar to storage ranges)

Testing
This proved to work fine in Mekong testnet when introducing forced sleeps and delays to force healing. But it is still too slow to work on Holesky testnet, this should improve once we add more parallelization to state sync & healing

Closes #issue_number

Copy link

github-actions bot commented Feb 3, 2025

| File                                                                      | Lines | Diff |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/cmd/ef_tests/levm/runner/levm_runner.rs   | 392   | -6   |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/blockchain/payload.rs              | 636   | -10  |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/engines/api.rs       | 174   | +1   |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/engines/in_memory.rs | 432   | -5   |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/engines/libmdbx.rs   | 807   | -3   |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/engines/redb.rs      | 796   | +11  |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/storage/store/storage.rs           | 1198  | +7   |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/environment.rs         | 36    | -2   |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/errors.rs              | 239   | -2   |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/utils.rs               | 444   | +13  |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/levm/src/vm.rs                  | 704   | -60  |
+---------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/vm/vm.rs                           | 838   | -4   |
+---------------------------------------------------------------------------+-------+------+

Total lines added: +32
Total lines removed: 92
Total lines changed: 124

@fmoletta fmoletta marked this pull request as ready for review February 3, 2025 19:39
@fmoletta fmoletta requested a review from a team as a code owner February 3, 2025 19:39
@fmoletta fmoletta added this pull request to the merge queue Feb 3, 2025
Merged via the queue into main with commit 906040d Feb 3, 2025
19 checks passed
@fmoletta fmoletta deleted the improve-healing branch February 3, 2025 21:58
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.

2 participants