Skip to content

Commit

Permalink
runtime: Verify freshness with RAK against latest state
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Feb 23, 2024
1 parent 595a1a2 commit 2f7008a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/5567.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
runtime: Verify freshness with RAK against latest state
3 changes: 2 additions & 1 deletion runtime/src/consensus/tendermint/verifier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ impl Verifier {
// Verify our own RAK is published in registry once per epoch.
// This ensures consensus state is recent enough.
if cache.last_verified_epoch != epoch {
self.verify_freshness_with_rak(&next_state, cache)?;
let latest_state = self.latest_consensus_state(cache, instance)?;
self.verify_freshness_with_rak(&latest_state, cache)?;
}

// Cache verified state root and epoch.
Expand Down

0 comments on commit 2f7008a

Please sign in to comment.