Skip to content

Commit

Permalink
fix: no chain_root in 1st block of the mmr activated epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape committed Dec 4, 2023
1 parent 3d674d5 commit dd0bf94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util/types/src/utilities/merkle_mountain_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ impl VerifiableHeader {
}

/// Checks if the current verifiable header is valid.
pub fn is_valid(&self, mmr_activated_epoch: EpochNumber) -> bool {
let has_chain_root = self.header().epoch().number() >= mmr_activated_epoch;
pub fn is_valid(&self, mmr_activated_epoch_number: EpochNumber) -> bool {
let mmr_activated_epoch = EpochNumberWithFraction::new(mmr_activated_epoch_number, 0, 1);
let has_chain_root = self.header().epoch().number() > mmr_activated_epoch;
if has_chain_root {
if self.header().is_genesis() {
if !self.parent_chain_root().is_default() {
Expand Down

0 comments on commit dd0bf94

Please sign in to comment.