diff --git a/consensus/consensus-types/src/pipelined_block.rs b/consensus/consensus-types/src/pipelined_block.rs index fedc2aa65b007..397c2bc1a95e1 100644 --- a/consensus/consensus-types/src/pipelined_block.rs +++ b/consensus/consensus-types/src/pipelined_block.rs @@ -67,8 +67,6 @@ pub struct PipelinedBlock { block: Block, /// A window of blocks that are needed for execution with the execution pool, excluding the current block block_window: OrderedBlockWindow, - /// Input transactions in the order of execution - input_transactions: Vec, /// The state_compute_result is calculated for all the pending blocks prior to insertion to /// the tree. The execution results are not persisted: they're recalculated again for the /// pending blocks upon restart. @@ -93,14 +91,15 @@ impl Serialize for PipelinedBlock { struct SerializedBlock<'a> { block: &'a Block, block_window: &'a OrderedBlockWindow, - input_transactions: &'a Vec, + // Removed, keeping for backwards compatibility + _input_transactions: &'a Vec, randomness: Option<&'a Randomness>, } let serialized = SerializedBlock { block: &self.block, block_window: &self.block_window, - input_transactions: &self.input_transactions, + _input_transactions: &vec![], randomness: self.randomness.get(), }; serialized.serialize(serializer) @@ -117,14 +116,15 @@ impl<'de> Deserialize<'de> for PipelinedBlock { struct SerializedBlock { block: Block, block_window: OrderedBlockWindow, - input_transactions: Vec, + // Removed, keeping for backwards compatibility + _input_transactions: Vec, randomness: Option, } let SerializedBlock { block, block_window, - input_transactions, + _input_transactions: _, randomness, } = SerializedBlock::deserialize(deserializer)?; @@ -137,7 +137,6 @@ impl<'de> Deserialize<'de> for PipelinedBlock { let block = PipelinedBlock { block, block_window, - input_transactions, state_compute_result: StateComputeResult::new_dummy(), randomness: OnceCell::new(), pipeline_insertion_time: OnceCell::new(), @@ -158,14 +157,13 @@ impl PipelinedBlock { pipeline_execution_result: PipelineExecutionResult, ) -> Self { let PipelineExecutionResult { - input_txns, + input_txns: _, result, execution_time, pre_commit_fut, } = pipeline_execution_result; self.state_compute_result = result; - self.input_transactions = input_txns; self.pre_commit_fut = Arc::new(Mutex::new(Some(pre_commit_fut))); let mut to_commit = 0; @@ -252,11 +250,7 @@ impl Display for PipelinedBlock { } impl PipelinedBlock { - pub fn new( - block: Block, - input_transactions: Vec, - state_compute_result: StateComputeResult, - ) -> Self { + pub fn new(block: Block, state_compute_result: StateComputeResult) -> Self { info!( "New PipelinedBlock with block_id: {}, parent_id: {}, round: {}, epoch: {}, txns: {}", block.id(), @@ -269,7 +263,6 @@ impl PipelinedBlock { Self { block, block_window: OrderedBlockWindow::new(vec![]), - input_transactions, state_compute_result, randomness: OnceCell::new(), pipeline_insertion_time: OnceCell::new(), @@ -291,7 +284,6 @@ impl PipelinedBlock { Self { block, block_window: window, - input_transactions: vec![], state_compute_result: StateComputeResult::new_dummy(), randomness: OnceCell::new(), pipeline_insertion_time: OnceCell::new(), @@ -314,7 +306,6 @@ impl PipelinedBlock { Self { block, block_window: OrderedBlockWindow::empty(), - input_transactions: vec![], state_compute_result: StateComputeResult::new_dummy(), randomness: OnceCell::new(), pipeline_insertion_time: OnceCell::new(), @@ -339,10 +330,6 @@ impl PipelinedBlock { self.block().id() } - pub fn input_transactions(&self) -> &Vec { - &self.input_transactions - } - pub fn epoch(&self) -> u64 { self.block.epoch() } diff --git a/consensus/src/block_storage/block_store.rs b/consensus/src/block_storage/block_store.rs index 7255c7b0ff94d..40b41dfb3bc80 100644 --- a/consensus/src/block_storage/block_store.rs +++ b/consensus/src/block_storage/block_store.rs @@ -196,7 +196,6 @@ impl BlockStore { let pipelined_root_block = PipelinedBlock::new( *window_block, - vec![], // Create a dummy state_compute_result with necessary fields filled in. result, ); diff --git a/consensus/src/dag/adapter.rs b/consensus/src/dag/adapter.rs index 35650eab6ee72..ba711c1b93d8c 100644 --- a/consensus/src/dag/adapter.rs +++ b/consensus/src/dag/adapter.rs @@ -195,7 +195,6 @@ impl OrderedNotifier for OrderedNotifierAdapter { parents_bitvec, node_digests, ), - vec![], StateComputeResult::new_dummy(), ); let block_info = block.block_info(); diff --git a/consensus/src/pipeline/buffer_item.rs b/consensus/src/pipeline/buffer_item.rs index 67fcca255875e..d42dc9c891f79 100644 --- a/consensus/src/pipeline/buffer_item.rs +++ b/consensus/src/pipeline/buffer_item.rs @@ -517,7 +517,6 @@ mod test { BlockData::dummy_with_validator_txns(vec![]), None, ), - vec![], StateComputeResult::new_dummy(), ) } diff --git a/consensus/src/pipeline/tests/execution_phase_tests.rs b/consensus/src/pipeline/tests/execution_phase_tests.rs index a0d7eb6a76c43..acf95a1740233 100644 --- a/consensus/src/pipeline/tests/execution_phase_tests.rs +++ b/consensus/src/pipeline/tests/execution_phase_tests.rs @@ -90,11 +90,7 @@ fn add_execution_phase_test_cases( // happy path phase_tester.add_test_case( ExecutionRequest { - ordered_blocks: vec![PipelinedBlock::new( - block, - vec![], - StateComputeResult::new_dummy(), - )], + ordered_blocks: vec![PipelinedBlock::new(block, StateComputeResult::new_dummy())], lifetime_guard: dummy_guard(), }, Box::new(move |resp| { @@ -132,7 +128,6 @@ fn add_execution_phase_test_cases( ExecutionRequest { ordered_blocks: vec![PipelinedBlock::new( bad_block, - vec![], StateComputeResult::new_dummy(), )], lifetime_guard: dummy_guard(), diff --git a/consensus/src/pipeline/tests/test_utils.rs b/consensus/src/pipeline/tests/test_utils.rs index b0c2243ed659e..8ca54e489cdda 100644 --- a/consensus/src/pipeline/tests/test_utils.rs +++ b/consensus/src/pipeline/tests/test_utils.rs @@ -111,9 +111,7 @@ pub fn prepare_executed_blocks_with_ledger_info( let executed_blocks: Vec = proposals .iter() - .map(|proposal| { - PipelinedBlock::new(proposal.block().clone(), vec![], compute_result.clone()) - }) + .map(|proposal| PipelinedBlock::new(proposal.block().clone(), compute_result.clone())) .collect(); (executed_blocks, li_sig, proposals) diff --git a/consensus/src/rand/rand_gen/test_utils.rs b/consensus/src/rand/rand_gen/test_utils.rs index f24c310c697a9..edfe183ab3468 100644 --- a/consensus/src/rand/rand_gen/test_utils.rs +++ b/consensus/src/rand/rand_gen/test_utils.rs @@ -36,7 +36,6 @@ pub fn create_ordered_blocks(rounds: Vec) -> OrderedBlocks { ), None, ), - vec![], StateComputeResult::new_dummy(), ) })