Skip to content

fix(l1): don't cancel storage healer if state healing ends earlier #2464

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

Merged
merged 4 commits into from
Apr 16, 2025

Conversation

fmoletta
Copy link
Contributor

Motivation
Currenlty, when state healing finishes, the storage healer is cancelled, even if there are still storages to be fetched and the tries are not stale yet, which slows down storage healing due to the frequent restarts if state healing ends before storage healing. This PR aims to fix this by changing the behaviour to not cancel storage healing if state healing is complete, but to instead give this information to the storage healer via an AtomicBoo, so that it can decide whether to stop based on if the state has become stale, or if no more paths are left to heal and mo more will be added by the state healer.

Description

  • Add AtomicBool param to storage_healer to signal whether state healing has ended
  • Don't cancel storage healing if state healer ended due to state healing being complete
  • End storage healer if there are no more pending storages left & state healing has ended
  • (Misc) Remove outdated comment

Closes #issue_number

@fmoletta fmoletta marked this pull request as ready for review April 14, 2025 21:50
@fmoletta fmoletta requested a review from a team as a code owner April 14, 2025 21:50
Copy link

github-actions bot commented Apr 14, 2025

Lines of code report

Total lines added: 16
Total lines removed: 0
Total lines changed: 16

Detailed view
+------------------------------------------------------+-------+------+
| File                                                 | Lines | Diff |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync.rs                 | 573   | +6   |
+------------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync/storage_healing.rs | 97    | +10  |
+------------------------------------------------------+-------+------+

This reverts commit 83e9a38.
@fmoletta fmoletta added this pull request to the merge queue Apr 16, 2025
Merged via the queue into main with commit 9e9ca0b Apr 16, 2025
19 checks passed
@fmoletta fmoletta deleted the fix-cancelling-storage-healer branch April 16, 2025 15: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.

3 participants