diff --git a/chain/chain/src/chain.rs b/chain/chain/src/chain.rs index 5f75aa03759..52f11a8f455 100644 --- a/chain/chain/src/chain.rs +++ b/chain/chain/src/chain.rs @@ -1524,6 +1524,9 @@ impl Chain { let state_part = self.runtime_adapter.obtain_state_part(shard_id, &state_root, part_id, num_parts); + // Before saving State Part data, we need to make sure we can calculate and save State Header + self.get_state_response_header(shard_id, sync_hash)?; + // Saving the part data let mut store_update = self.store.owned_store().store_update(); store_update.set_ser(ColStateParts, &key, &state_part)?; diff --git a/chain/chain/src/store_validator/validate.rs b/chain/chain/src/store_validator/validate.rs index 15216e0a8f1..8918b37e8f7 100644 --- a/chain/chain/src/store_validator/validate.rs +++ b/chain/chain/src/store_validator/validate.rs @@ -742,7 +742,7 @@ pub(crate) fn state_header_block_exists( _header: &ShardStateSyncResponseHeader, ) -> Result<(), StoreValidatorError> { unwrap_or_err_db!( - sv.store.get_ser::(ColBlock, key.1.as_ref()), + sv.store.get_ser::(ColBlock, key.1.as_ref()), "Can't get Block from DB" ); Ok(())