diff --git a/collator/src/collator/do_collate.rs b/collator/src/collator/do_collate.rs index e1dad3c46..3826b3417 100644 --- a/collator/src/collator/do_collate.rs +++ b/collator/src/collator/do_collate.rs @@ -1671,14 +1671,21 @@ impl CollatorStdImpl { }; let adapter = self.state_node_adapter.clone(); let labels = labels.clone(); - let new_state_root = finalized.new_state_root.clone(); + + let new_state_root = finalized + .block_candidate + .block + .as_ref() + .load_state_update()? + .new; + async move { let _histogram = HistogramGuard::begin_with_labels( "tycho_collator_build_new_state_time", &labels, ); adapter - .store_state_root(&block_id, meta, new_state_root) + .store_state_root(&block_id, meta, new_state_root, true) .await } }); diff --git a/collator/src/state_node.rs b/collator/src/state_node.rs index 22b867645..dad825d62 100644 --- a/collator/src/state_node.rs +++ b/collator/src/state_node.rs @@ -61,6 +61,7 @@ pub trait StateNodeAdapter: Send + Sync + 'static { block_id: &BlockId, meta: NewBlockMeta, state_root: Cell, + virtualize: bool, ) -> Result; /// Return block by it's id from node local state async fn load_block(&self, block_id: &BlockId) -> Result>; @@ -189,6 +190,7 @@ impl StateNodeAdapter for StateNodeAdapterStdImpl { block_id: &BlockId, meta: NewBlockMeta, state_root: Cell, + virtualize: bool, ) -> Result { let _histogram = HistogramGuard::begin("tycho_collator_state_store_state_root_time"); @@ -202,7 +204,7 @@ impl StateNodeAdapter for StateNodeAdapterStdImpl { let updated = self .storage .shard_state_storage() - .store_state_root(&handle, state_root, false) + .store_state_root(&handle, state_root, virtualize) .await?; Ok(updated)