Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko committed Sep 26, 2023
1 parent 25959c5 commit 38e0c6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ impl LMDBDatabase {
let store = self.validator_node_store(txn);
let constants = self.get_consensus_constants(header.height);
let current_epoch = self.block_height_to_epoch(header.height);
// TODO: What if the validity period has changed?
// TODO: What if the validity period has changed?[https://github.com/tari-project/tari/issues/5798]
let start_height =
self.epoch_to_block_height(current_epoch.saturating_sub(constants.validator_node_validity_period_epochs()));
let end_height = self.epoch_to_block_height(current_epoch);
Expand Down
4 changes: 2 additions & 2 deletions base_layer/core/src/consensus/consensus_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl ConsensusManager {
constants
}

/// Returns the current epoch from the given height
/// Returns the current epoch number as calculated from the given height
pub fn block_height_to_epoch(&self, height: u64) -> VnEpoch {
let mut epoch = 0;
let mut leftover_height = 0;
Expand All @@ -135,7 +135,7 @@ impl ConsensusManager {
VnEpoch(epoch)
}

/// Returns the block height of the start of the given epoch
/// Returns the block height of the start of the given epoch number
pub fn epoch_to_block_height(&self, epoch: VnEpoch) -> u64 {
let mut cur_epoch = 0;
let mut leftover_height = 0;
Expand Down

0 comments on commit 38e0c6f

Please sign in to comment.