From 1b4d23fd20c90d8c61f33c64cace740d0616f930 Mon Sep 17 00:00:00 2001 From: Talha Cross <47772477+soc1c@users.noreply.github.com> Date: Sat, 2 Nov 2019 12:26:38 +0100 Subject: [PATCH] ethcore/res: add mordor testnet configuration (#11200) * ethcore/res: add mordor testnet configuration * ethcore/spec: add mordor testnet configuration * parity/cli: add mordor testnet configuration * parity/config: fix tests * ethcore/res: update mordor spec with agharta hardfork block 301243 * ethcore/res: update kotti with agharta block 1705549 * ethcore/res: update morden with agharta block 5000381 * ethcore/res: multiple prices and activations for mordor testnet * fix mordor spec json * fix mordor spec json --- ethcore/res/ethereum/kotti.json | 3 + ethcore/res/ethereum/morden.json | 5 +- ethcore/res/ethereum/mordor.json | 189 +++++++++++++++++++++++++++++++ ethcore/spec/src/chain.rs | 2 + parity/account_utils.rs | 2 +- parity/cli/mod.rs | 8 +- parity/configuration.rs | 2 +- parity/params.rs | 29 ++--- 8 files changed, 220 insertions(+), 20 deletions(-) create mode 100644 ethcore/res/ethereum/mordor.json diff --git a/ethcore/res/ethereum/kotti.json b/ethcore/res/ethereum/kotti.json index 81bd2c29608..7876fe8cd2b 100644 --- a/ethcore/res/ethereum/kotti.json +++ b/ethcore/res/ethereum/kotti.json @@ -13,6 +13,7 @@ "accountStartNonce": "0x0", "chainID": "0x6", "eip140Transition": "0xaef49", + "eip145Transition": "0x1a064d", "eip150Transition": "0x0", "eip155Transition": "0x0", "eip160Transition": "0x0", @@ -21,6 +22,8 @@ "eip211Transition": "0xaef49", "eip214Transition": "0xaef49", "eip658Transition": "0xaef49", + "eip1014Transition": "0x1a064d", + "eip1052Transition": "0x1a064d", "gasLimitBoundDivisor": "0x400", "maxCodeSize": "0x6000", "maxCodeSizeTransition": "0xaef49", diff --git a/ethcore/res/ethereum/morden.json b/ethcore/res/ethereum/morden.json index 442baea4bfb..5db2a4c04b7 100644 --- a/ethcore/res/ethereum/morden.json +++ b/ethcore/res/ethereum/morden.json @@ -37,7 +37,10 @@ "eip140Transition": "0x4829ba", "eip211Transition": "0x4829ba", "eip214Transition": "0x4829ba", - "eip658Transition": "0x4829ba" + "eip658Transition": "0x4829ba", + "eip145Transition": "0x4c4cbd", + "eip1014Transition": "0x4c4cbd", + "eip1052Transition": "0x4c4cbd" }, "genesis": { "seal": { diff --git a/ethcore/res/ethereum/mordor.json b/ethcore/res/ethereum/mordor.json new file mode 100644 index 00000000000..ceaa9de6d51 --- /dev/null +++ b/ethcore/res/ethereum/mordor.json @@ -0,0 +1,189 @@ +{ + "name":"Mordor Classic Testnet", + "dataDir":"mordor", + "engine":{ + "Ethash":{ + "params":{ + "minimumDifficulty":"0x20000", + "difficultyBoundDivisor":"0x800", + "durationLimit":"0xd", + "blockReward":"0x4563918244F40000", + "homesteadTransition":"0x0", + "ecip1010PauseTransition":"0x0", + "ecip1010ContinueTransition":"0x0", + "ecip1017EraRounds":"0x1e8480", + "bombDefuseTransition":"0x0", + "eip100bTransition":"0x0" + } + } + }, + "params":{ + "gasLimitBoundDivisor":"0x400", + "accountStartNonce":"0x0", + "maximumExtraDataSize":"0x20", + "minGasLimit":"0x1388", + "networkID":"0x7", + "chainID":"0x3f", + "eip150Transition":"0x0", + "eip160Transition":"0x0", + "eip161abcTransition":"0x0", + "eip161dTransition":"0x0", + "eip155Transition":"0x0", + "maxCodeSize":"0x6000", + "maxCodeSizeTransition":"0x0", + "eip140Transition":"0x0", + "eip211Transition":"0x0", + "eip214Transition":"0x0", + "eip658Transition":"0x0", + "eip145Transition":"0x498bb", + "eip1014Transition":"0x498bb", + "eip1052Transition":"0x498bb" + }, + "genesis":{ + "seal":{ + "ethereum":{ + "nonce":"0x0000000000000000", + "mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "difficulty":"0x20000", + "author":"0x0000000000000000000000000000000000000000", + "timestamp":"0x5d9676db", + "parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000", + "extraData":"0x70686f656e697820636869636b656e206162737572642062616e616e61", + "gasLimit":"0x2fefd8" + }, + "nodes":[ + "enode://03b133f731049e3f7be827339c3759be92778c05e54a1847d178c0fdb56fa168aa1e7e61fc77791a7afdd0328a00318f73c01212eb3f3bbe919f5ce8f5b4a314@192.227.105.4:32000", + "enode://06fdbeb591d26f53b2e7250025fe955ca013431ded930920cf1e3cd1f0c920e9a5e727949d209bc25a07288327b525279b11c5551315c50ff0db483e69fc159b@34.218.225.178:32000", + "enode://1813e90a0afdd7c1e4892c5376960e3577a9e6c5a4f86fa405a405c7421a4a1608248d77cc90333842f13d8954d82113dec480cfb76b4fef8cb475157cf4d5f2@10.28.224.3:30000", + "enode://2b69a3926f36a7748c9021c34050be5e0b64346225e477fe7377070f6289bd363b2be73a06010fd516e6ea3ee90778dd0399bc007bb1281923a79374f842675a@51.15.116.226:30303", + "enode://621e28e529146fd501709194885f50540c494f1a2985d1fb4ec8769226b5cb0b0d1a11545926077821474c2767cdd87888ead8a2509a2c9069dd5584e4b1c3b8@10.28.223.8:30000", + "enode://a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd@51.15.116.226:30303" + ], + "accounts":{ + "0x0000000000000000000000000000000000000001":{ + "builtin":{ + "name":"ecrecover", + "pricing":{ + "linear":{ + "base":3000, + "word":0 + } + } + } + }, + "0x0000000000000000000000000000000000000002":{ + "builtin":{ + "name":"sha256", + "pricing":{ + "linear":{ + "base":60, + "word":12 + } + } + } + }, + "0x0000000000000000000000000000000000000003":{ + "builtin":{ + "name":"ripemd160", + "pricing":{ + "linear":{ + "base":600, + "word":120 + } + } + } + }, + "0x0000000000000000000000000000000000000004":{ + "builtin":{ + "name":"identity", + "pricing":{ + "linear":{ + "base":15, + "word":3 + } + } + } + }, + "0x0000000000000000000000000000000000000005":{ + "builtin":{ + "activate_at":"0x0", + "name":"modexp", + "pricing":{ + "modexp":{ + "divisor":20 + } + } + } + }, + "0x0000000000000000000000000000000000000006":{ + "builtin":{ + "name":"alt_bn128_add", + "pricing":{ + "0x0":{ + "price":{ + "alt_bn128_const_operations":{ + "price":500 + } + } + }, + "0x7fffffffffffff":{ + "info":"EIP 1108 transition", + "price":{ + "alt_bn128_const_operations":{ + "price":150 + } + } + } + } + } + }, + "0x0000000000000000000000000000000000000007":{ + "builtin":{ + "name":"alt_bn128_mul", + "pricing":{ + "0x0":{ + "price":{ + "alt_bn128_const_operations":{ + "price":40000 + } + } + }, + "0x7fffffffffffff":{ + "info":"EIP 1108 transition", + "price":{ + "alt_bn128_const_operations":{ + "price":6000 + } + } + } + } + } + }, + "0x0000000000000000000000000000000000000008":{ + "builtin":{ + "name":"alt_bn128_pairing", + "pricing":{ + "0x0":{ + "price":{ + "alt_bn128_pairing":{ + "base":100000, + "pair":80000 + } + } + }, + "0x7fffffffffffff":{ + "info":"EIP 1108 transition", + "price":{ + "alt_bn128_pairing":{ + "base":45000, + "pair":34000 + } + } + } + } + } + } + } +} diff --git a/ethcore/spec/src/chain.rs b/ethcore/spec/src/chain.rs index 60bf84e3c5e..eaf73bfea0c 100644 --- a/ethcore/spec/src/chain.rs +++ b/ethcore/spec/src/chain.rs @@ -69,6 +69,7 @@ bundle_release_spec! { "ethereum/kovan" => new_kovan, "ethereum/mix" => new_mix, "ethereum/morden" => new_morden, + "ethereum/mordor" => new_mordor, "ethereum/musicoin" => new_musicoin, "ethereum/poacore" => new_poanet, "ethereum/xdai" => new_xdai, @@ -96,6 +97,7 @@ bundle_test_spec! { "ethereum/kovan_wasm_test" => new_kovan_wasm_test, "ethereum/mcip3_test" => new_mcip3_test, "ethereum/morden" => new_morden_test, + "ethereum/mordor" => new_mordor_test, "ethereum/ropsten" => new_ropsten_test, "ethereum/st_peters_test" => new_constantinople_fix_test, "ethereum/transition_test" => new_transition_test, diff --git a/parity/account_utils.rs b/parity/account_utils.rs index 727bb875222..056481af8bc 100644 --- a/parity/account_utils.rs +++ b/parity/account_utils.rs @@ -81,7 +81,7 @@ mod accounts { let account_settings = AccountProviderSettings { unlock_keep_secret: cfg.enable_fast_unlock, blacklisted_accounts: match *spec { - SpecType::Morden | SpecType::Ropsten | SpecType::Kovan | SpecType::Sokol | SpecType::Dev => vec![], + SpecType::Morden | SpecType::Mordor | SpecType::Ropsten | SpecType::Kovan | SpecType::Goerli | SpecType::Kotti | SpecType::Sokol | SpecType::Dev => vec![], _ => vec![ H160::from_str("00a329c0648769a73afac7f9381e08fb43dbea72").expect("the string is valid hex; qed"), ], diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index efa1429cf65..6ec06057894 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -300,7 +300,7 @@ usage! { ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(), "--chain=[CHAIN]", - "Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, xdai, volta, ewc, musicoin, ellaism, mix, callisto, morden, ropsten, kovan, rinkeby, goerli, kotti, poasokol, testnet, or dev.", + "Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, xdai, volta, ewc, musicoin, ellaism, mix, callisto, morden, mordor, ropsten, kovan, rinkeby, goerli, kotti, poasokol, testnet, or dev.", ARG arg_keys_path: (String) = "$BASE/keys", or |c: &Config| c.parity.as_ref()?.keys_path.clone(), "--keys-path=[PATH]", @@ -1564,14 +1564,14 @@ mod tests { // given let mut config = Config::default(); let mut operating = Operating::default(); - operating.chain = Some("morden".into()); + operating.chain = Some("mordor".into()); config.parity = Some(operating); // when let args = Args::parse_with_config(&["parity"], config).unwrap(); // then - assert_eq!(args.arg_chain, "morden".to_owned()); + assert_eq!(args.arg_chain, "mordor".to_owned()); } #[test] @@ -1579,7 +1579,7 @@ mod tests { // given let mut config = Config::default(); let mut operating = Operating::default(); - operating.chain = Some("morden".into()); + operating.chain = Some("mordor".into()); config.parity = Some(operating); // when diff --git a/parity/configuration.rs b/parity/configuration.rs index 0ca62f07275..02527d247ea 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -1569,7 +1569,7 @@ mod tests { // then assert_eq!(conf.network_settings(), Ok(NetworkSettings { name: "testname".to_owned(), - chain: "kovan".to_owned(), + chain: "goerli".to_owned(), is_dev_chain: false, network_port: 30303, rpc_enabled: true, diff --git a/parity/params.rs b/parity/params.rs index 45547b46b9b..ae81a2e6b0b 100644 --- a/parity/params.rs +++ b/parity/params.rs @@ -44,6 +44,7 @@ pub enum SpecType { Mix, Callisto, Morden, + Mordor, Ropsten, Kovan, Rinkeby, @@ -65,8 +66,8 @@ impl str::FromStr for SpecType { fn from_str(s: &str) -> Result { let spec = match s { - "ethereum" | "frontier" | "homestead" | "byzantium" | "foundation" | "mainnet" => SpecType::Foundation, - "classic" | "frontier-dogmatic" | "homestead-dogmatic" => SpecType::Classic, + "eth" | "ethereum" | "foundation" | "mainnet" => SpecType::Foundation, + "etc" | "classic" => SpecType::Classic, "poanet" | "poacore" => SpecType::Poanet, "xdai" => SpecType::Xdai, "volta" => SpecType::Volta, @@ -75,11 +76,12 @@ impl str::FromStr for SpecType { "ellaism" => SpecType::Ellaism, "mix" => SpecType::Mix, "callisto" => SpecType::Callisto, - "morden" | "classic-testnet" => SpecType::Morden, + "morden" => SpecType::Morden, + "mordor" | "classic-testnet" => SpecType::Mordor, "ropsten" => SpecType::Ropsten, - "kovan" | "testnet" => SpecType::Kovan, + "kovan" => SpecType::Kovan, "rinkeby" => SpecType::Rinkeby, - "goerli" | "görli" => SpecType::Goerli, + "goerli" | "görli" | "testnet" => SpecType::Goerli, "kotti" => SpecType::Kotti, "sokol" | "poasokol" => SpecType::Sokol, "dev" => SpecType::Dev, @@ -103,6 +105,7 @@ impl fmt::Display for SpecType { SpecType::Mix => "mix", SpecType::Callisto => "callisto", SpecType::Morden => "morden", + SpecType::Mordor => "mordor", SpecType::Ropsten => "ropsten", SpecType::Kovan => "kovan", SpecType::Rinkeby => "rinkeby", @@ -130,6 +133,7 @@ impl SpecType { SpecType::Mix => Ok(spec::new_mix(params)), SpecType::Callisto => Ok(spec::new_callisto(params)), SpecType::Morden => Ok(spec::new_morden(params)), + SpecType::Mordor => Ok(spec::new_mordor(params)), SpecType::Ropsten => Ok(spec::new_ropsten(params)), SpecType::Kovan => Ok(spec::new_kovan(params)), SpecType::Rinkeby => Ok(spec::new_rinkeby(params)), @@ -369,15 +373,12 @@ mod tests { #[test] fn test_spec_type_parsing() { + assert_eq!(SpecType::Foundation, "eth".parse().unwrap()); + assert_eq!(SpecType::Foundation, "ethereum".parse().unwrap()); assert_eq!(SpecType::Foundation, "foundation".parse().unwrap()); - assert_eq!(SpecType::Foundation, "frontier".parse().unwrap()); - assert_eq!(SpecType::Foundation, "homestead".parse().unwrap()); - assert_eq!(SpecType::Foundation, "byzantium".parse().unwrap()); assert_eq!(SpecType::Foundation, "mainnet".parse().unwrap()); - assert_eq!(SpecType::Foundation, "ethereum".parse().unwrap()); + assert_eq!(SpecType::Classic, "etc".parse().unwrap()); assert_eq!(SpecType::Classic, "classic".parse().unwrap()); - assert_eq!(SpecType::Classic, "frontier-dogmatic".parse().unwrap()); - assert_eq!(SpecType::Classic, "homestead-dogmatic".parse().unwrap()); assert_eq!(SpecType::Poanet, "poanet".parse().unwrap()); assert_eq!(SpecType::Poanet, "poacore".parse().unwrap()); assert_eq!(SpecType::Xdai, "xdai".parse().unwrap()); @@ -389,13 +390,14 @@ mod tests { assert_eq!(SpecType::Mix, "mix".parse().unwrap()); assert_eq!(SpecType::Callisto, "callisto".parse().unwrap()); assert_eq!(SpecType::Morden, "morden".parse().unwrap()); - assert_eq!(SpecType::Morden, "classic-testnet".parse().unwrap()); + assert_eq!(SpecType::Mordor, "mordor".parse().unwrap()); + assert_eq!(SpecType::Mordor, "classic-testnet".parse().unwrap()); assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap()); assert_eq!(SpecType::Kovan, "kovan".parse().unwrap()); - assert_eq!(SpecType::Kovan, "testnet".parse().unwrap()); assert_eq!(SpecType::Rinkeby, "rinkeby".parse().unwrap()); assert_eq!(SpecType::Goerli, "goerli".parse().unwrap()); assert_eq!(SpecType::Goerli, "görli".parse().unwrap()); + assert_eq!(SpecType::Goerli, "testnet".parse().unwrap()); assert_eq!(SpecType::Kotti, "kotti".parse().unwrap()); assert_eq!(SpecType::Sokol, "sokol".parse().unwrap()); assert_eq!(SpecType::Sokol, "poasokol".parse().unwrap()); @@ -419,6 +421,7 @@ mod tests { assert_eq!(format!("{}", SpecType::Mix), "mix"); assert_eq!(format!("{}", SpecType::Callisto), "callisto"); assert_eq!(format!("{}", SpecType::Morden), "morden"); + assert_eq!(format!("{}", SpecType::Mordor), "mordor"); assert_eq!(format!("{}", SpecType::Ropsten), "ropsten"); assert_eq!(format!("{}", SpecType::Kovan), "kovan"); assert_eq!(format!("{}", SpecType::Rinkeby), "rinkeby");