mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Implement checkpoint sync (#2244)
## Issue Addressed Closes #1891 Closes #1784 ## Proposed Changes Implement checkpoint sync for Lighthouse, enabling it to start from a weak subjectivity checkpoint. ## Additional Info - [x] Return unavailable status for out-of-range blocks requested by peers (#2561) - [x] Implement sync daemon for fetching historical blocks (#2561) - [x] Verify chain hashes (either in `historical_blocks.rs` or the calling module) - [x] Consistency check for initial block + state - [x] Fetch the initial state and block from a beacon node HTTP endpoint - [x] Don't crash fetching beacon states by slot from the API - [x] Background service for state reconstruction, triggered by CLI flag or API call. Considered out of scope for this PR: - Drop the requirement to provide the `--checkpoint-block` (this would require some pretty heavy refactoring of block verification) Co-authored-by: Diva M <divma@protonmail.com>
This commit is contained in:
@@ -2101,6 +2101,29 @@ impl ApiTester {
|
||||
self
|
||||
}
|
||||
|
||||
pub async fn test_get_lighthouse_database_info(self) -> Self {
|
||||
let info = self.client.get_lighthouse_database_info().await.unwrap();
|
||||
|
||||
assert_eq!(info.anchor, self.chain.store.get_anchor_info());
|
||||
assert_eq!(info.split, self.chain.store.get_split_info());
|
||||
assert_eq!(
|
||||
info.schema_version,
|
||||
store::metadata::CURRENT_SCHEMA_VERSION.as_u64()
|
||||
);
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub async fn test_post_lighthouse_database_reconstruct(self) -> Self {
|
||||
let response = self
|
||||
.client
|
||||
.post_lighthouse_database_reconstruct()
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(response, "success");
|
||||
self
|
||||
}
|
||||
|
||||
pub async fn test_post_lighthouse_liveness(self) -> Self {
|
||||
let epoch = self.chain.epoch().unwrap();
|
||||
let head_state = self.chain.head_beacon_state().unwrap();
|
||||
@@ -2653,6 +2676,10 @@ async fn lighthouse_endpoints() {
|
||||
.await
|
||||
.test_get_lighthouse_staking()
|
||||
.await
|
||||
.test_get_lighthouse_database_info()
|
||||
.await
|
||||
.test_post_lighthouse_database_reconstruct()
|
||||
.await
|
||||
.test_post_lighthouse_liveness()
|
||||
.await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user