Skip to content

Commit

Permalink
build genesis header for the current sequencer version
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Jul 10, 2024
1 parent 27e928f commit 1127c84
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions types/src/v0/impls/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,15 +801,8 @@ impl BlockHeader<SeqTypes> for Header {
let block_merkle_tree_root = block_merkle_tree.commitment();
let fee_merkle_tree_root = fee_merkle_tree.commitment();

// The Header is versioned, so we check if there are any upgrades.
// If no upgrades are specified, we use the default V1 Header (version 0.1).
// If an upgrade is specified, we use the version from the latest upgrade.
let upgrades = instance_state.upgrades.last_key_value();
let version = match upgrades {
None => Version { major: 0, minor: 1 },
Some((version, _)) => *version,
};

// The Header is versioned,
// so we create the genesis header for the current version of the sequencer.
Self::create(
instance_state.chain_config.into(),
0,
Expand All @@ -826,7 +819,7 @@ impl BlockHeader<SeqTypes> for Header {
block_merkle_tree_root,
FeeInfo::genesis(),
None,
version,
instance_state.current_version,
)
}

Expand Down

0 comments on commit 1127c84

Please sign in to comment.