|
@@ -20,7 +20,6 @@ use lazy_static::lazy_static;
|
|
|
|
|
|
|
|
use crate::{consensus::Float10, util::time::Timestamp};
|
|
use crate::{consensus::Float10, util::time::Timestamp};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
lazy_static! {
|
|
lazy_static! {
|
|
|
/// Genesis hash for the mainnet chain
|
|
/// Genesis hash for the mainnet chain
|
|
|
pub static ref MAINNET_GENESIS_HASH_BYTES: blake3::Hash = blake3::hash(b"darkfi_mainnet");
|
|
pub static ref MAINNET_GENESIS_HASH_BYTES: blake3::Hash = blake3::hash(b"darkfi_mainnet");
|
|
@@ -28,10 +27,10 @@ lazy_static! {
|
|
|
// NOTE: On initial network bootstrap, genesis timestamp should be equal to boostrap timestamp.
|
|
// NOTE: On initial network bootstrap, genesis timestamp should be equal to boostrap timestamp.
|
|
|
// On network restart only change bootstrap timestamp to schedule when nodes become active.
|
|
// On network restart only change bootstrap timestamp to schedule when nodes become active.
|
|
|
/// Genesis timestamp for the mainnet chain
|
|
/// Genesis timestamp for the mainnet chain
|
|
|
- pub static ref MAINNET_GENESIS_TIMESTAMP: Timestamp = Timestamp(1773025405);
|
|
|
|
|
|
|
+ pub static ref MAINNET_GENESIS_TIMESTAMP: Timestamp = Timestamp(1650887115);
|
|
|
|
|
|
|
|
/// Bootstrap timestamp for the mainnet chain
|
|
/// Bootstrap timestamp for the mainnet chain
|
|
|
- pub static ref MAINNET_BOOTSTRAP_TIMESTAMP: Timestamp = Timestamp(1773025405);
|
|
|
|
|
|
|
+ pub static ref MAINNET_BOOTSTRAP_TIMESTAMP: Timestamp = Timestamp(1650887115);
|
|
|
|
|
|
|
|
/// Total sum of initial staking coins for the mainnet chain
|
|
/// Total sum of initial staking coins for the mainnet chain
|
|
|
pub static ref MAINNET_INITIAL_DISTRIBUTION: u64 = 1000;
|
|
pub static ref MAINNET_INITIAL_DISTRIBUTION: u64 = 1000;
|
|
@@ -40,43 +39,39 @@ lazy_static! {
|
|
|
pub static ref TESTNET_GENESIS_HASH_BYTES: blake3::Hash = blake3::hash(b"darkfi_testnet");
|
|
pub static ref TESTNET_GENESIS_HASH_BYTES: blake3::Hash = blake3::hash(b"darkfi_testnet");
|
|
|
|
|
|
|
|
/// Genesis timestamp for the testnet chain
|
|
/// Genesis timestamp for the testnet chain
|
|
|
- pub static ref TESTNET_GENESIS_TIMESTAMP: Timestamp = Timestamp(1673281500);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ pub static ref TESTNET_GENESIS_TIMESTAMP: Timestamp = Timestamp(1672785000);
|
|
|
|
|
|
|
|
/// Bootstrap timestamp for the testnet chain
|
|
/// Bootstrap timestamp for the testnet chain
|
|
|
- pub static ref TESTNET_BOOTSTRAP_TIMESTAMP: Timestamp = Timestamp(1673281500);
|
|
|
|
|
|
|
+ pub static ref TESTNET_BOOTSTRAP_TIMESTAMP: Timestamp = Timestamp(1672785000);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/// Total sum of initial staking coins for the testnet chain
|
|
/// Total sum of initial staking coins for the testnet chain
|
|
|
pub static ref TESTNET_INITIAL_DISTRIBUTION: u64 = 1000;
|
|
pub static ref TESTNET_INITIAL_DISTRIBUTION: u64 = 1000;
|
|
|
|
|
|
|
|
// Commonly used Float10
|
|
// Commonly used Float10
|
|
|
|
|
|
|
|
- pub static ref FLOAT10_NEG_ONE: Float10 = Float10::from_str_native("-1").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref FLOAT10_NEG_TWO: Float10 = Float10::from_str_native("-2").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref FLOAT10_ZERO: Float10 = Float10::from_str_native("0").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref FLOAT10_ONE: Float10 = Float10::from_str_native("1").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref FLOAT10_TWO: Float10 = Float10::from_str_native("2").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref FLOAT10_THREE: Float10 = Float10::from_str_native("3").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref FLOAT10_FIVE: Float10 = Float10::from_str_native("5").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref FLOAT10_NINE: Float10 = Float10::from_str_native("9").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref FLOAT10_TEN: Float10 = Float10::from_str_native("10").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ pub static ref FLOAT10_NEG_TWO: Float10 = Float10::try_from("-2").unwrap();
|
|
|
|
|
+ pub static ref FLOAT10_NEG_ONE: Float10 = Float10::try_from("-1").unwrap();
|
|
|
|
|
+ pub static ref FLOAT10_ZERO: Float10 = Float10::try_from("0").unwrap();
|
|
|
|
|
+ pub static ref FLOAT10_ONE: Float10 = Float10::try_from("1").unwrap();
|
|
|
|
|
+ pub static ref FLOAT10_TWO: Float10 = Float10::try_from("2").unwrap();
|
|
|
|
|
+ pub static ref FLOAT10_THREE: Float10 = Float10::try_from("3").unwrap();
|
|
|
|
|
+ pub static ref FLOAT10_FIVE: Float10 = Float10::try_from("5").unwrap();
|
|
|
|
|
+ pub static ref FLOAT10_NINE: Float10 = Float10::try_from("9").unwrap();
|
|
|
|
|
+ pub static ref FLOAT10_TEN: Float10 = Float10::try_from("10").unwrap();
|
|
|
|
|
|
|
|
// Consensus parameters
|
|
// Consensus parameters
|
|
|
|
|
|
|
|
- pub static ref TI: Float10 = FLOAT10_ONE.clone();
|
|
|
|
|
- pub static ref TD: Float10 = FLOAT10_ONE.clone();
|
|
|
|
|
- // pid discrete parameters
|
|
|
|
|
-
|
|
|
|
|
- pub static ref KP: Float10 = Float10::from_str_native("0.18").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref KI: Float10 = Float10::from_str_native("0.02").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref KD: Float10 = Float10::from_str_native("-0.1").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
|
|
|
|
|
- pub static ref PID_OUT_STEP: Float10 = Float10::from_str_native("0.1").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref MAX_DER: Float10 = Float10::from_str_native("0.1").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref MIN_DER: Float10 = Float10::from_str_native("-0.1").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref MAX_F: Float10 = Float10::from_str_native("0.99").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref MIN_F: Float10 = Float10::from_str_native("0.01").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
- pub static ref DEG_RATE: Float10 = Float10::from_str_native("0.9").unwrap().with_precision(RADIX_BITS).value();
|
|
|
|
|
|
|
+ pub static ref KP: Float10 = Float10::try_from("0.18").unwrap();
|
|
|
|
|
+ pub static ref KI: Float10 = Float10::try_from("0.02").unwrap();
|
|
|
|
|
+ pub static ref KD: Float10 = Float10::try_from("-0.1").unwrap();
|
|
|
|
|
+ pub static ref PID_OUT_STEP: Float10 = Float10::try_from("0.1").unwrap();
|
|
|
|
|
+ pub static ref MAX_DER: Float10 = Float10::try_from("0.1").unwrap();
|
|
|
|
|
+ pub static ref MIN_DER: Float10 = Float10::try_from("-0.1").unwrap();
|
|
|
|
|
+ pub static ref MAX_F: Float10 = Float10::try_from("0.99").unwrap();
|
|
|
|
|
+ pub static ref MIN_F: Float10 = Float10::try_from("0.05").unwrap();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|