diff --git a/client/src/configuration.rs b/client/src/configuration.rs index 7f14587dc7..23f24d35f2 100644 --- a/client/src/configuration.rs +++ b/client/src/configuration.rs @@ -158,8 +158,8 @@ build_config! { (sigma_fix_transition_number, (Option), Some(125360000)) (cip107_transition_number, (Option), Some(167000000)) (cip112_transition_height, (Option), Some(129100000)) - (cip118_transition_number, (Option), None) - (cip119_transition_number, (Option), None) + (cip118_transition_number, (Option), Some(171570000)) + (cip119_transition_number, (Option), Some(171570000)) (referee_bound, (usize), REFEREE_DEFAULT_BOUND) (params_dao_vote_period, (u64), DAO_PARAMETER_VOTE_PERIOD) (timer_chain_beta, (u64), TIMER_CHAIN_DEFAULT_BETA) diff --git a/core/parameters/src/lib.rs b/core/parameters/src/lib.rs index 67e95674a7..24ca15e7c9 100644 --- a/core/parameters/src/lib.rs +++ b/core/parameters/src/lib.rs @@ -54,6 +54,9 @@ pub mod consensus { pub const TESTNET_FIX_POS_POS_REFERENCE: &str = "18a6b9c237f025e934a1633bae0cc084f81a457e3be75300447e857c3bc89d82"; pub const CIP112_HEADER_CUSTOM_FIRST_ELEMENT: [u8; 1] = [5]; + /// The height to enable CIP118 and CIP119 for testnet. + pub const TESTNET_CIP119_HEIGHT: u64 = 132220000; + pub const CIP119_HEADER_CUSTOM_FIRST_ELEMENT: [u8; 1] = [6]; } pub mod consensus_internal { diff --git a/core/src/spec/spec.rs b/core/src/spec/spec.rs index 3bb6b63087..b51e6dc973 100644 --- a/core/src/spec/spec.rs +++ b/core/src/spec/spec.rs @@ -21,6 +21,7 @@ use cfx_parameters::{ use cfx_types::{AllChainID, U256, U512}; use primitives::{block::BlockHeight, BlockNumber}; use std::collections::BTreeMap; +use cfx_parameters::consensus::{CIP119_HEADER_CUSTOM_FIRST_ELEMENT, TESTNET_CIP119_HEIGHT}; #[derive(Debug)] pub struct CommonParams { @@ -169,8 +170,12 @@ impl CommonParams { && height < self.transition_heights.cip112 { Some(vec![TESTNET_FIX_POS_HEADER_CUSTOM_FIRST_ELEMENT.to_vec()]) - } else if height >= self.transition_heights.cip112 { + } else if height >= self.transition_heights.cip112 + && height < TESTNET_CIP119_HEIGHT + { Some(vec![CIP112_HEADER_CUSTOM_FIRST_ELEMENT.to_vec()]) + } else if height >= TESTNET_CIP119_HEIGHT { + Some(vec![CIP119_HEADER_CUSTOM_FIRST_ELEMENT.to_vec()]) } else { None }