Skip to content

Commit

Permalink
don't serialize PipelinedBlock::state_compute_result (#14969)
Browse files Browse the repository at this point in the history
  • Loading branch information
msmouse authored Oct 16, 2024
1 parent b481f94 commit 0b46c71
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions consensus/consensus-types/src/pipelined_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ impl Serialize for PipelinedBlock {
struct SerializedBlock<'a> {
block: &'a Block,
input_transactions: &'a Vec<SignedTransaction>,
state_compute_result: &'a StateComputeResult,
randomness: Option<&'a Randomness>,
}

let serialized = SerializedBlock {
block: &self.block,
input_transactions: &self.input_transactions,
state_compute_result: &self.state_compute_result,
randomness: self.randomness.get(),
};
serialized.serialize(serializer)
Expand All @@ -86,21 +84,19 @@ impl<'de> Deserialize<'de> for PipelinedBlock {
struct SerializedBlock {
block: Block,
input_transactions: Vec<SignedTransaction>,
state_compute_result: StateComputeResult,
randomness: Option<Randomness>,
}

let SerializedBlock {
block,
input_transactions,
state_compute_result,
randomness,
} = SerializedBlock::deserialize(deserializer)?;

let block = PipelinedBlock {
block,
input_transactions,
state_compute_result,
state_compute_result: StateComputeResult::new_dummy(),
randomness: OnceCell::new(),
pipeline_insertion_time: OnceCell::new(),
execution_summary: Arc::new(OnceCell::new()),
Expand Down

0 comments on commit 0b46c71

Please sign in to comment.