mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 22:38:34 +00:00
Optionally check DB invariants at runtime (#8952)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
This commit is contained in:
@@ -3007,6 +3007,19 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
},
|
||||
);
|
||||
|
||||
// GET lighthouse/database/invariants
|
||||
let get_lighthouse_database_invariants = database_path
|
||||
.and(warp::path("invariants"))
|
||||
.and(warp::path::end())
|
||||
.and(task_spawner_filter.clone())
|
||||
.and(chain_filter.clone())
|
||||
.then(
|
||||
|task_spawner: TaskSpawner<T::EthSpec>, chain: Arc<BeaconChain<T>>| {
|
||||
task_spawner
|
||||
.blocking_json_task(Priority::P1, move || database::check_invariants(chain))
|
||||
},
|
||||
);
|
||||
|
||||
// POST lighthouse/database/reconstruct
|
||||
let post_lighthouse_database_reconstruct = database_path
|
||||
.and(warp::path("reconstruct"))
|
||||
@@ -3336,6 +3349,7 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
.uor(get_lighthouse_validator_inclusion)
|
||||
.uor(get_lighthouse_staking)
|
||||
.uor(get_lighthouse_database_info)
|
||||
.uor(get_lighthouse_database_invariants)
|
||||
.uor(get_lighthouse_custody_info)
|
||||
.uor(get_lighthouse_attestation_performance)
|
||||
.uor(get_beacon_light_client_optimistic_update)
|
||||
|
||||
Reference in New Issue
Block a user