Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko committed Apr 16, 2024
1 parent 5acecd9 commit 545dd8c
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 @@ -1376,7 +1376,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 @@ -111,7 +111,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 @@ -133,7 +133,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 545dd8c

Please sign in to comment.