mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 06:14:38 +00:00
Extend block reward APIs (#3290)
## Proposed Changes Add a new HTTP endpoint `POST /lighthouse/analysis/block_rewards` which takes a vec of `BeaconBlock`s as input and outputs the `BlockReward`s for them. Augment the `BlockReward` struct with the attestation data for attestations in the block, which simplifies access to this information from blockprint. Using attestation data I've been able to make blockprint up to 95% accurate across Prysm/Lighthouse/Teku/Nimbus. I hope to go even higher using a bunch of synthetic blocks produced for Prysm/Nimbus/Lodestar, which are underrepresented in the current training data.
This commit is contained in:
@@ -1235,7 +1235,7 @@ impl<'a, T: BeaconChainTypes> FullyVerifiedBlock<'a, T> {
|
||||
if let Some(ref event_handler) = chain.event_handler {
|
||||
if event_handler.has_block_reward_subscribers() {
|
||||
let block_reward =
|
||||
chain.compute_block_reward(block.message(), block_root, &state)?;
|
||||
chain.compute_block_reward(block.message(), block_root, &state, true)?;
|
||||
event_handler.register(EventKind::BlockReward(block_reward));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user