Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
ammend clarifying comment for duplicate instance detection (#31008)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbiseda authored Mar 31, 2023
1 parent 9600643 commit 0e2c6c8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions gossip/src/crds_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,12 @@ impl NodeInstance {
Self { wallclock, ..*self }
}

// Returns true if the crds-value is a duplicate instance
// of this node, with a more recent timestamp.
// The older instance is considered the duplicate instance because:
// - If a staked node is restarted it will receive its old instance value
// from gossip. Considering the new instance as the duplicate would
// prevent the node from restarting.
// - Similarly, hotswap relies on the the old instance being considered the
// duplicate instance.
// Returns true if the crds-value is a duplicate instance of this node,
// with a more recent timestamp.
// The older instance is considered the duplicate instance. If a staked
// node is restarted it will receive its old instance value from gossip.
// Considering the new instance as the duplicate would prevent the node
// from restarting.
pub(crate) fn check_duplicate(&self, other: &CrdsValue) -> bool {
match &other.data {
CrdsData::NodeInstance(other) => {
Expand Down

0 comments on commit 0e2c6c8

Please sign in to comment.