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

persisted_trie_updates data lost on restart prevents node from handling reorgs #13940

Open
klkvr opened this issue Jan 22, 2025 · 0 comments · May be fixed by #13942
Open

persisted_trie_updates data lost on restart prevents node from handling reorgs #13940

klkvr opened this issue Jan 22, 2025 · 0 comments · May be fixed by #13942
Labels
C-enhancement New feature or request S-needs-triage This issue needs to be labelled

Comments

@klkvr
Copy link
Collaborator

klkvr commented Jan 22, 2025

Describe the feature

If node is restarted, then we are losing persisted_trie_updates data in TreeState. This results in executed_block_by_hash always returning None for canonical blocks

let Some((_, updates)) = self.state.tree_state.persisted_trie_updates.get(&hash) else {
return Ok(None)
};

This results in node not being able to handle reorgs by ending up here

// This shouldn't happen as we're walking back the canonical chain
warn!(target: "engine::tree", current_hash=?old_hash, "Canonical block not found in TreeState");
return Ok(None);

Solution for this is to ignore cache misses in persisted_trie_updates for canonical blocks because we don't need TrieUpdates for reorg of the canonical chain, and for sidechains they are always present because those live fully in memory

Additional context

No response

@klkvr klkvr added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Jan 22, 2025
@klkvr klkvr linked a pull request Jan 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request S-needs-triage This issue needs to be labelled
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

1 participant