Skip to content

Commit

Permalink
Merge pull request #4255 from yangby-cryptape/no-chain_root-in-1st-bl…
Browse files Browse the repository at this point in the history
…ock-of-mmr-activated-epoch

fix: no chain_root in 1st block of the mmr activated epoch
  • Loading branch information
zhangsoledad authored Dec 8, 2023
2 parents 3d674d5 + ee78320 commit 98a583d
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() > 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 98a583d

Please sign in to comment.