POST inclusion list endpoint

This commit is contained in:
Eitan Seri-Levi
2025-02-02 12:37:21 +03:00
parent 3c90258468
commit 88afbb39be
7 changed files with 302 additions and 16 deletions

View File

@@ -34,6 +34,8 @@ use crate::execution_payload::{get_execution_payload, NotifyExecutionLayer, Prep
use crate::fork_choice_signal::{ForkChoiceSignalRx, ForkChoiceSignalTx, ForkChoiceWaitResult};
use crate::graffiti_calculator::GraffitiCalculator;
use crate::head_tracker::{HeadTracker, HeadTrackerReader, SszHeadTracker};
use crate::inclusion_list_verification::GossipInclusionListError;
use crate::inclusion_list_verification::GossipVerifiedInclusionList;
use crate::kzg_utils::reconstruct_blobs;
use crate::light_client_finality_update_verification::{
Error as LightClientFinalityUpdateError, VerifiedLightClientFinalityUpdate,
@@ -2371,6 +2373,26 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
})
}
/// Accepts some `Attestation` from the network and attempts to verify it, returning `Ok(_)` if
/// it is valid to be (re)broadcast on the gossip network.
///
/// The attestation must be "unaggregated", that is it must have exactly one
/// aggregation bit set.
pub fn verify_inclusion_list_for_gossip(
&self,
inclusion_list: &SignedInclusionList<T::EthSpec>,
) -> Result<GossipVerifiedInclusionList<T>, GossipInclusionListError> {
metrics::inc_counter(&metrics::INCLUSION_LIST_PROCESSING_REQUESTS);
let _timer =
metrics::start_timer(&metrics::UNAGGREGATED_ATTESTATION_GOSSIP_VERIFICATION_TIMES);
GossipVerifiedInclusionList::verify(inclusion_list, self).inspect(|_v| {
// TODO(focil) emit event
if let Some(_event_handler) = self.event_handler.as_ref() {}
metrics::inc_counter(&metrics::INCLUSION_LIST_PROCESSING_SUCCESSES);
})
}
/// Accepts some attestation-type object and attempts to verify it in the context of fork
/// choice. If it is valid it is applied to `self.fork_choice`.
///