Manual finalization endpoint (#7059)

* Load block roots from fork choice where possible to avoid loading state from disk when serving block by range requests.

* Check if the start slot is newer than finalization (`start_slot >= finalized_slot`), and use fork choice in that case.

* force finalization endpoint

* cleanup

* Remove ds store

* Don't import blocks that conflict with the split

* Disconnect and ban peer if we get blocks conflicting manual checkpoint

* immediately commit state to cold db

* revert

* Fix descent from split check

* Add safety check to checkpoint when doing manual finalization.

---------

Co-authored-by: Jimmy Chen <jchen.tc@gmail.com>
Co-authored-by: Michael Sproul <michael@sigmaprime.io>
Co-authored-by: Pawan Dhananjay <pawandhananjay@gmail.com>
This commit is contained in:
Eitan Seri-Levi
2025-03-02 21:31:52 -08:00
committed by GitHub
parent 73b7cad202
commit 8f43cb98b7
8 changed files with 163 additions and 17 deletions

View File

@@ -1255,6 +1255,11 @@ where
.is_finalized_checkpoint_or_descendant::<E>(block_root)
}
pub fn is_descendant(&self, ancestor_root: Hash256, descendant_root: Hash256) -> bool {
self.proto_array
.is_descendant(ancestor_root, descendant_root)
}
/// Returns `Ok(true)` if `block_root` has been imported optimistically or deemed invalid.
///
/// Returns `Ok(false)` if `block_root`'s execution payload has been elected as fully VALID, if