pub struct ManualBlockProducer { /* private fields */ }Expand description
Cloneable in-process control for producing blocks in manual mode.
Implementations§
Source§impl ManualBlockProducer
impl ManualBlockProducer
Sourcepub async fn produce_block(&self) -> Result<ProducedBlock, BlockProductionError>
pub async fn produce_block(&self) -> Result<ProducedBlock, BlockProductionError>
Run one scheduler proposal/commit cycle and await its outcome.
Dropping the returned future before the driver starts the request cancels
it. Once scheduler work begins, dropping the future does not cancel the
cycle. BlockProductionError::TimedOut,
BlockProductionError::OutcomeUnknown,
BlockProductionError::ProposalOutcomeUnknown, and
BlockProductionError::CommitOutcomeUnknown mean callers must inspect
chain state before deciding whether to request another block. Malformed
proposal, commit rejection, and consensus-hash errors are also terminal
because the scheduler may have retained the proposed candidate.
The producer becomes terminal after an indeterminate result so queued
requests cannot overlap scheduler work that may still be running.
The current scheduler protocol reports an empty or otherwise
non-nominatable mempool as BlockProductionError::SchedulerRejected;
it does not expose a distinct empty-mempool outcome.