Skip to content

Commit

Permalink
Set CIP118 and CIP119 hardfork heights.
Browse files Browse the repository at this point in the history
  • Loading branch information
peilun-conflux committed Jul 26, 2023
1 parent 2374011 commit 6b4fe96
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ build_config! {
(sigma_fix_transition_number, (Option<u64>), Some(125360000))
(cip107_transition_number, (Option<u64>), Some(167000000))
(cip112_transition_height, (Option<u64>), Some(129100000))
(cip118_transition_number, (Option<u64>), None)
(cip119_transition_number, (Option<u64>), None)
(cip118_transition_number, (Option<u64>), Some(171570000))
(cip119_transition_number, (Option<u64>), 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)
Expand Down
3 changes: 3 additions & 0 deletions core/parameters/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 6 additions & 1 deletion core/src/spec/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 6b4fe96

Please sign in to comment.