mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-24 20:47:17 +00:00
104e3104f9
## 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`.
43 lines
1.4 KiB
TOML
43 lines
1.4 KiB
TOML
[package]
|
|
name = "http_api"
|
|
version = "0.1.0"
|
|
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
|
edition = "2018"
|
|
autotests = false # using a single test binary compiles faster
|
|
|
|
[dependencies]
|
|
warp = { version = "0.3.2", features = ["tls"] }
|
|
serde = { version = "1.0.116", features = ["derive"] }
|
|
tokio = { version = "1.14.0", features = ["macros","sync"] }
|
|
tokio-stream = { version = "0.1.3", features = ["sync"] }
|
|
types = { path = "../../consensus/types" }
|
|
hex = "0.4.2"
|
|
beacon_chain = { path = "../beacon_chain" }
|
|
eth2 = { path = "../../common/eth2", features = ["lighthouse"] }
|
|
slog = "2.5.2"
|
|
network = { path = "../network" }
|
|
lighthouse_network = { path = "../lighthouse_network" }
|
|
eth1 = { path = "../eth1" }
|
|
state_processing = { path = "../../consensus/state_processing" }
|
|
lighthouse_version = { path = "../../common/lighthouse_version" }
|
|
lighthouse_metrics = { path = "../../common/lighthouse_metrics" }
|
|
lazy_static = "1.4.0"
|
|
warp_utils = { path = "../../common/warp_utils" }
|
|
slot_clock = { path = "../../common/slot_clock" }
|
|
eth2_ssz = "0.4.1"
|
|
bs58 = "0.4.0"
|
|
futures = "0.3.8"
|
|
parking_lot = "0.11.0"
|
|
safe_arith = {path = "../../consensus/safe_arith"}
|
|
|
|
|
|
[dev-dependencies]
|
|
store = { path = "../store" }
|
|
environment = { path = "../../lighthouse/environment" }
|
|
tree_hash = "0.4.1"
|
|
sensitive_url = { path = "../../common/sensitive_url" }
|
|
|
|
[[test]]
|
|
name = "bn_http_api_tests"
|
|
path = "tests/main.rs"
|