Skip to content

Commit

Permalink
align commit_and_certify with on_synced_checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuoWangNSL committed Oct 1, 2024
1 parent 2ac7e35 commit e2a78ab
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions rs/state_manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3464,18 +3464,6 @@ impl StateManager for StateManagerImpl {
.certifications_metadata
.insert(height, certification_metadata);

if let Some((state_metadata, compute_manifest_request)) =
state_metadata_and_compute_manifest_request
{
states.states_metadata.insert(height, state_metadata);
debug_assert!(self.tip_channel.len() <= 1);
self.tip_channel
.send(compute_manifest_request)
.expect("failed to send ComputeManifestRequest message");
} else {
debug_assert!(scope != CertificationScope::Full);
}

let latest_height = update_latest_height(&self.latest_state_height, height);
self.metrics.max_resident_height.set(latest_height as i64);
{
Expand All @@ -3491,6 +3479,23 @@ impl StateManager for StateManagerImpl {
}
}

if let Some((state_metadata, compute_manifest_request)) =
state_metadata_and_compute_manifest_request
{
let metadata = states
.states_metadata
.entry(height)
.or_insert(state_metadata);
debug_assert!(self.tip_channel.len() <= 1);
if metadata.bundled_manifest.is_none() {
self.tip_channel
.send(compute_manifest_request)
.expect("failed to send ComputeManifestRequest message");
}
} else {
debug_assert!(scope != CertificationScope::Full);
}

self.metrics
.resident_state_count
.set(states.snapshots.len() as i64);
Expand Down

0 comments on commit e2a78ab

Please sign in to comment.