Pseudo finalization endpoint (#7103)

This is a backport of:
-  https://github.com/sigp/lighthouse/pull/7059
- https://github.com/sigp/lighthouse/pull/7071

For:
- https://github.com/sigp/lighthouse/issues/7039


  Introduce a new lighthouse endpoint that allows a user to force a pseudo finalization. This migrates data to the freezer db and prunes sidechains which may help reduce disk space issues on non finalized networks like Holesky

We also ban peers that send us blocks that conflict with the manually finalized checkpoint.

There were some CI fixes in https://github.com/sigp/lighthouse/pull/7071 that I tried including here

Co-authored with: @jimmygchen  @pawanjay176 @michaelsproul
This commit is contained in:
Eitan Seri-Levi
2025-03-17 23:21:05 -06:00
committed by GitHub
parent 58482586f5
commit 27aabe8159
9 changed files with 353 additions and 23 deletions

View File

@@ -740,6 +740,19 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
debug!(self.log, "Finalized or earlier block processed";);
Ok(())
}
BlockError::NotFinalizedDescendant { block_parent_root } => {
debug!(
self.log,
"Not syncing to a chain that conflicts with the canonical or manual finalized checkpoint"
);
Err(ChainSegmentFailed {
message: format!(
"Block with parent_root {} conflicts with our checkpoint state",
block_parent_root
),
peer_action: Some(PeerAction::Fatal),
})
}
BlockError::GenesisBlock => {
debug!(self.log, "Genesis block was processed");
Ok(())