ab_client_block_authoring/
lib.rs1#![feature(async_fn_traits, unboxed_closures)]
4
5pub mod beacon_chain;
6pub mod slot_worker;
7
8use ab_core_primitives::block::header::{
9 BeaconChainHeader, BlockHeaderConsensusInfo, OwnedBlockHeaderSeal,
10};
11use ab_core_primitives::hashes::Blake3Hash;
12use ab_core_primitives::pot::PotCheckpoints;
13
14#[derive(Debug)]
15pub struct ClaimedSlot {
16 pub consensus_info: BlockHeaderConsensusInfo,
18 pub checkpoints: Vec<PotCheckpoints>,
21}
22
23pub trait BlockProducer: Send {
25 fn produce_block<SealBlock>(
27 &mut self,
28 claimed_slot: ClaimedSlot,
29 best_beacon_chain_header: &BeaconChainHeader<'_>,
30 seal_block: SealBlock,
31 ) -> impl Future<Output = ()> + Send
32 where
33 SealBlock: AsyncFnOnce<(Blake3Hash,), Output = Option<OwnedBlockHeaderSeal>, CallOnceFuture: Send>
34 + Send;
35}