mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 05:44:44 +00:00
Merge readiness endpoint (#3349)
## Issue Addressed Resolves final task in https://github.com/sigp/lighthouse/issues/3260 ## Proposed Changes Adds a lighthouse http endpoint to indicate merge readiness. Blocked on #3339
This commit is contained in:
@@ -2887,6 +2887,18 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
})
|
||||
});
|
||||
|
||||
// GET lighthouse/merge_readiness
|
||||
let get_lighthouse_merge_readiness = warp::path("lighthouse")
|
||||
.and(warp::path("merge_readiness"))
|
||||
.and(warp::path::end())
|
||||
.and(chain_filter.clone())
|
||||
.and_then(|chain: Arc<BeaconChain<T>>| async move {
|
||||
let merge_readiness = chain.check_merge_readiness().await;
|
||||
Ok::<_, warp::reject::Rejection>(warp::reply::json(&api_types::GenericResponse::from(
|
||||
merge_readiness,
|
||||
)))
|
||||
});
|
||||
|
||||
let get_events = eth1_v1
|
||||
.and(warp::path("events"))
|
||||
.and(warp::path::end())
|
||||
@@ -3015,6 +3027,7 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
.or(get_lighthouse_block_rewards.boxed())
|
||||
.or(get_lighthouse_attestation_performance.boxed())
|
||||
.or(get_lighthouse_block_packing_efficiency.boxed())
|
||||
.or(get_lighthouse_merge_readiness.boxed())
|
||||
.or(get_events.boxed()),
|
||||
)
|
||||
.or(warp::post().and(
|
||||
|
||||
Reference in New Issue
Block a user