From bfd06132750f4fd1c2bdf5f62873ca2f8e0d8afb Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Mon, 14 Jan 2019 06:30:52 +0000 Subject: [PATCH 1/3] Plus and minus, not so similar --- core/src/consensus.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/consensus.rs b/core/src/consensus.rs index 70d5d8c3b..c2e82509f 100644 --- a/core/src/consensus.rs +++ b/core/src/consensus.rs @@ -62,7 +62,7 @@ pub const COINBASE_MATURITY: u64 = DAY_HEIGHT; /// function of block height (time). Starts at 90% losing a percent /// approximately every week. Represented as an integer between 0 and 100. pub fn secondary_pow_ratio(height: u64) -> u64 { - 90u64.saturating_sub(height / (2 * YEAR_HEIGHT / 90)) + 90u64.saturating_add(height / (2 * YEAR_HEIGHT / 90)) } /// The AR scale damping factor to use. Dependent on block height From 224a26faedd5736fd73a3688d270719fd0803fc3 Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Mon, 14 Jan 2019 20:07:10 +0000 Subject: [PATCH 2/3] Mainnet enablement 1. Remove the exit guarding running a node in mainnet mode. 2. Set initial difficulty in genesis. --- core/src/genesis.rs | 2 +- src/bin/grin.rs | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/core/src/genesis.rs b/core/src/genesis.rs index c8a87b143..442cfea52 100644 --- a/core/src/genesis.rs +++ b/core/src/genesis.rs @@ -179,7 +179,7 @@ pub fn genesis_main() -> core::Block { output_mmr_size: 1, kernel_mmr_size: 1, pow: ProofOfWork { - total_difficulty: Difficulty::from_num(10_u64.pow(8)), + total_difficulty: Difficulty::from_num(2_u64.pow(34)), secondary_scaling: 1856, nonce: 1, // REPLACE proof: Proof { diff --git a/src/bin/grin.rs b/src/bin/grin.rs index dc525af12..4bb5c9b36 100644 --- a/src/bin/grin.rs +++ b/src/bin/grin.rs @@ -87,12 +87,6 @@ fn real_main() -> i32 { global::ChainTypes::Mainnet }; - // TODO remove for mainnet - if chain_type == global::ChainTypes::Mainnet { - println!("Mainnet not ready yet! In the meantime run 'grin --floonet ...'"); - exit(1); - } - // Deal with configuration file creation match args.subcommand() { ("server", Some(server_args)) => { From 6bb611a2f00e3bb7f7a06417971648e80cd8ff51 Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Mon, 14 Jan 2019 20:19:17 +0000 Subject: [PATCH 3/3] Fix spurious change added by git merge --- core/src/consensus.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/consensus.rs b/core/src/consensus.rs index dc87f578b..a6d0ef841 100644 --- a/core/src/consensus.rs +++ b/core/src/consensus.rs @@ -62,7 +62,7 @@ pub const COINBASE_MATURITY: u64 = DAY_HEIGHT; /// function of block height (time). Starts at 90% losing a percent /// approximately every week. Represented as an integer between 0 and 100. pub fn secondary_pow_ratio(height: u64) -> u64 { - 90u64.saturating_add(height / (2 * YEAR_HEIGHT / 90)) + 90u64.saturating_sub(height / (2 * YEAR_HEIGHT / 90)) } /// The AR scale damping factor to use. Dependent on block height