From 277ab587ee08019e3e4f25fa61bcc276c514d34a Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Wed, 19 Feb 2025 12:05:09 +0100 Subject: [PATCH] chore: Temp rename of `ProvenBlock` to `ProvenBlockWrapper` --- crates/block-producer/src/block_builder/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/block-producer/src/block_builder/mod.rs b/crates/block-producer/src/block_builder/mod.rs index bbdc23c5a..78dd05691 100644 --- a/crates/block-producer/src/block_builder/mod.rs +++ b/crates/block-producer/src/block_builder/mod.rs @@ -100,7 +100,7 @@ impl BlockBuilder { .then(|selected| self.get_block_inputs(selected)) .inspect_ok(BlockSummaryAndInputs::inject_telemetry) .and_then(|inputs| self.prove_block(inputs)) - .inspect_ok(ProvenBlock::inject_telemetry) + .inspect_ok(ProvenBlockWrapper::inject_telemetry) // Failure must be injected before the final pipeline stage i.e. before commit is called. The system cannot // handle errors after it considers the process complete (which makes sense). .and_then(|proven_block| async { self.inject_failure(proven_block) }) @@ -153,7 +153,7 @@ impl BlockBuilder { async fn prove_block( &self, preimage: BlockSummaryAndInputs, - ) -> Result { + ) -> Result { let BlockSummaryAndInputs { batches, summary, inputs } = preimage; let (block_header_witness, updated_accounts) = BlockWitness::new(inputs, &batches)?; @@ -169,14 +169,14 @@ impl BlockBuilder { self.simulate_proving().await; - Ok(ProvenBlock { block }) + Ok(ProvenBlockWrapper { block }) } #[instrument(target = COMPONENT, name = "block_builder.commit_block", skip_all, err)] async fn commit_block( &self, mempool: &SharedMempool, - proven_block: ProvenBlock, + proven_block: ProvenBlockWrapper, ) -> Result<(), BuildBlockError> { self.store .apply_block(&proven_block.block) @@ -275,7 +275,9 @@ struct BlockSummaryAndInputs { summary: BlockSummary, inputs: BlockInputs, } -struct ProvenBlock { + +// TODO: Is this still needed? If so, what should be its name? +struct ProvenBlockWrapper { block: Block, } @@ -314,7 +316,7 @@ impl BlockSummaryAndInputs { } } -impl ProvenBlock { +impl ProvenBlockWrapper { fn inject_telemetry(&self) { let span = Span::current(); let header = self.block.header();