Skip to content

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

Merged
fmoletta merged 4 commits into
mainfrom
fix-cancelling-storage-healer
Apr 16, 2025
Merged

fix(l1): don't cancel storage healer if state healing ends earlier#2464
fmoletta merged 4 commits into
mainfrom
fix-cancelling-storage-healer

Conversation

@fmoletta

Copy link
Copy Markdown
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
@github-actions

github-actions Bot commented Apr 14, 2025

Copy link
Copy Markdown

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
@fmoletta fmoletta deleted the fix-cancelling-storage-healer branch April 16, 2025 15:58
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
…ambdaclass#2464)

**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.
<!-- Why does this pull request exist? What are its goals? -->

**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
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->

Closes #issue_number
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