Skip to content

Commit

Permalink
[authority] Remove unused cached checkpoint number
Browse files Browse the repository at this point in the history
  • Loading branch information
lxfind committed Sep 16, 2022
1 parent 68140e8 commit 2a6414c
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,6 @@ pub struct AuthorityState {

pub metrics: Arc<AuthorityMetrics>,

// Cache the latest checkpoint number to avoid expensive locking to access checkpoint store
latest_checkpoint_num: AtomicU64,

/// A channel to tell consensus to reconfigure.
tx_reconfigure_consensus: Sender<ReconfigConsensusMessage>,
}
Expand Down Expand Up @@ -1251,7 +1248,6 @@ impl AuthorityState {
),
consensus_guardrail: AtomicUsize::new(0),
metrics: Arc::new(AuthorityMetrics::new(prometheus_registry)),
latest_checkpoint_num: AtomicU64::new(0),
tx_reconfigure_consensus,
};

Expand Down Expand Up @@ -2010,10 +2006,6 @@ impl ExecutionState for AuthorityState {
// to persist the consensus index. If the validator crashes, this transaction
// may be resent to the checkpoint logic that will simply ignore it.

// Cache the next checkpoint number if it changes.
self.latest_checkpoint_num
.store(checkpoint.next_checkpoint(), Ordering::Relaxed);

// TODO: At this point we should know whether we want to change epoch. If we do,
// we should have (i) the new committee and (ii) the new keypair of this authority.
// We then call:
Expand Down

0 comments on commit 2a6414c

Please sign in to comment.