Skip to content

Commit c1dd2e9

Browse files
committed
Add API to compute block packing efficiency data (#2879)
## Issue Addressed N/A ## Proposed Changes Add a HTTP API which can be used to compute the block packing data for all blocks over a discrete range of epochs. ## Usage ### Request ``` curl "http:localhost:5052/lighthouse/analysis/block_packing_efficiency?start_epoch=57730&end_epoch=57732" ``` ### Response ``` [ { "slot": "1847360", "block_hash": "0xa7dc230659802df2f99ea3798faede2e75942bb5735d56e6bfdc2df335dcd61f", "proposer_info": { "validator_index": 1686, "graffiti": "" }, "available_attestations": 7096, "included_attestations": 6459, "prior_skip_slots": 0 }, ... ] ``` ## Additional Info This is notably different to the existing lcli code: - Uses `BlockReplayer` #2863 and as such runs significantly faster than the previous method. - Corrects the off-by-one #2878 - Removes the `offline` validators component. This was only a "best guess" and simply was used as a way to determine an estimate of the "true" packing efficiency and was generally not helpful in terms of direct comparisons between different packing methods. As such it has been removed from the API and any future estimates of "offline" validators would be better suited in a separate/more targeted API or as part of 'beacon watch': #2873 - Includes `prior_skip_slots`.
1 parent 56b2ec6 commit c1dd2e9

File tree

6 files changed

+438
-0
lines changed

6 files changed

+438
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beacon_node/http_api/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ slot_clock = { path = "../../common/slot_clock" }
2727
eth2_ssz = "0.4.1"
2828
bs58 = "0.4.0"
2929
futures = "0.3.8"
30+
parking_lot = "0.11.0"
3031
safe_arith = {path = "../../consensus/safe_arith"}
3132

33+
3234
[dev-dependencies]
3335
store = { path = "../store" }
3436
environment = { path = "../../lighthouse/environment" }

0 commit comments

Comments
 (0)