Skip to content

Commit

Permalink
fix test_flexidag_config_get_for_halley
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzhhuang committed Jun 11, 2024
1 parent 5b35308 commit f4c705a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,10 @@ impl BlockChain {
}

pub fn init_dag_with_genesis(&mut self, genesis: BlockHeader) -> Result<()> {
if self.check_dag_type()? == DagHeaderType::Genesis {
let header = self.status().head().clone();
let net: BuiltinNetworkID = header.chain_id().try_into()?;
let dag_fork_height = net.genesis_config().dag_effective_height;
if genesis.number() == dag_fork_height {
let dag_genesis_id = genesis.id();
info!(
"Init dag genesis {dag_genesis_id} height {}",
Expand Down Expand Up @@ -1979,7 +1982,7 @@ impl ChainReader for BlockChain {

fn execute(&mut self, verified_block: VerifiedBlock) -> Result<ExecutedBlock> {
let header = verified_block.0.header().clone();
if self.check_dag_type()? != DagHeaderType::Normal {
if self.check_dag_type()? == DagHeaderType::Single {
let executed = if let Some((executed_data, block_info)) =
MAIN_DIRECT_SAVE_BLOCK_HASH_MAP.get(&verified_block.0.header.id())
{
Expand Down
2 changes: 1 addition & 1 deletion config/src/genesis_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ pub static G_HALLEY_CONFIG: Lazy<GenesisConfig> = Lazy::new(|| {
min_action_delay: 60 * 60 * 1000, // 1h
},
transaction_timeout: ONE_DAY,
dag_effective_height: 0,
dag_effective_height: 1,
}
});

Expand Down

0 comments on commit f4c705a

Please sign in to comment.