From f4c705af6ff6aaeedb13df5533741273f9842183 Mon Sep 17 00:00:00 2001 From: jackzhhuang Date: Tue, 11 Jun 2024 18:13:44 +0800 Subject: [PATCH] fix test_flexidag_config_get_for_halley --- chain/src/chain.rs | 7 +++++-- config/src/genesis_config.rs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/chain/src/chain.rs b/chain/src/chain.rs index 8918560dce..c550ff7bb9 100644 --- a/chain/src/chain.rs +++ b/chain/src/chain.rs @@ -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 {}", @@ -1979,7 +1982,7 @@ impl ChainReader for BlockChain { fn execute(&mut self, verified_block: VerifiedBlock) -> Result { 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()) { diff --git a/config/src/genesis_config.rs b/config/src/genesis_config.rs index 840b095ae8..de2eda4d19 100644 --- a/config/src/genesis_config.rs +++ b/config/src/genesis_config.rs @@ -950,7 +950,7 @@ pub static G_HALLEY_CONFIG: Lazy = Lazy::new(|| { min_action_delay: 60 * 60 * 1000, // 1h }, transaction_timeout: ONE_DAY, - dag_effective_height: 0, + dag_effective_height: 1, } });