Skip to content

Commit

Permalink
Merge branch 'zoran/CON-968-remove-state-behind-case' into 'master'
Browse files Browse the repository at this point in the history
chore(ic-replay, CON-968) Remove StateBehind case

Closes CON-968 

Closes CON-968

See merge request dfinity-lab/public/ic!11293
  • Loading branch information
zoran-dfinity committed Mar 16, 2023
2 parents b1a2989 + 65f924d commit 5c108c1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
10 changes: 0 additions & 10 deletions rs/replay/src/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ pub(crate) enum ExitPoint {
/// block with a validation context referencing a newer version than
/// locally known.
NewerRegistryVersion(RegistryVersion),
/// We restored all artifacts before a block with the certified height in
/// the validation context higher than the last state height.
StateBehind(Height),
/// Can't proceed because artifact validation failed after the given height.
ValidationIncomplete(Height),
}
Expand Down Expand Up @@ -167,7 +164,6 @@ pub(crate) fn deserialize_consensus_artifacts(
pool: &mut ConsensusPoolImpl,
height_to_batches: &mut BTreeMap<Height, HeightArtifacts>,
subnet_id: SubnetId,
latest_state_height: Height,
validator: &ReplayValidator,
dkg_manager: &mut DkgKeyManager,
invalid_artifacts: &mut Vec<InvalidArtifact>,
Expand Down Expand Up @@ -256,12 +252,6 @@ pub(crate) fn deserialize_consensus_artifacts(
.unwrap_or_else(|err| panic!("{}", deserialization_error(file, err)));

let validation_context = &proposal.content.as_ref().context;
let certified_height = validation_context.certified_height;
// If the block references newer execution height than we have, we exit.
if certified_height > latest_state_height {
height_to_batches.insert(height, height_artifacts);
return ExitPoint::StateBehind(certified_height);
}

let block_registry_version = validation_context.registry_version;
if block_registry_version > registry_client.get_latest_version() {
Expand Down
8 changes: 0 additions & 8 deletions rs/replay/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,6 @@ impl Player {
self.consensus_pool.as_mut().unwrap(),
&mut height_to_batches,
self.subnet_id,
self.state_manager.latest_state_height(),
self.validator.as_ref().unwrap(),
&mut dkg_manager,
&mut invalid_artifacts,
Expand Down Expand Up @@ -968,13 +967,6 @@ impl Player {
);
println!("Updated the registry.");
}
backup::ExitPoint::StateBehind(certified_height) => {
assert!(
certified_height <= self.state_manager.latest_state_height(),
"The state manager didn't catch up with the expected certified height"
);
self.state_manager.remove_states_below(certified_height);
}
backup::ExitPoint::Done => {
println!(
"Restored the state at the height {:?}",
Expand Down

0 comments on commit 5c108c1

Please sign in to comment.