Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

ethcore/res: add mordor testnet configuration #11200

Merged
merged 11 commits into from
Nov 2, 2019
3 changes: 3 additions & 0 deletions ethcore/res/ethereum/kotti.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"accountStartNonce": "0x0",
"chainID": "0x6",
"eip140Transition": "0xaef49",
"eip145Transition": "0x1a064d",
"eip150Transition": "0x0",
"eip155Transition": "0x0",
"eip160Transition": "0x0",
Expand All @@ -21,6 +22,8 @@
"eip211Transition": "0xaef49",
"eip214Transition": "0xaef49",
"eip658Transition": "0xaef49",
"eip1014Transition": "0x1a064d",
"eip1052Transition": "0x1a064d",
"gasLimitBoundDivisor": "0x400",
"maxCodeSize": "0x6000",
"maxCodeSizeTransition": "0xaef49",
Expand Down
5 changes: 4 additions & 1 deletion ethcore/res/ethereum/morden.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
"eip140Transition": "0x4829ba",
"eip211Transition": "0x4829ba",
"eip214Transition": "0x4829ba",
"eip658Transition": "0x4829ba"
"eip658Transition": "0x4829ba",
"eip145Transition": "0x4c4cbd",
"eip1014Transition": "0x4c4cbd",
"eip1052Transition": "0x4c4cbd"
},
"genesis": {
"seal": {
Expand Down
189 changes: 189 additions & 0 deletions ethcore/res/ethereum/mordor.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions ethcore/spec/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion parity/account_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ mod accounts {
let account_settings = AccountProviderSettings {
unlock_keep_secret: cfg.enable_fast_unlock,
blacklisted_accounts: match *spec {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my education, what is this blacklist for? The docs are oxymoronic: "/// Disallowed accounts.". What did 00a329c0648769a73afac7f9381e08fb43dbea72do to become blacklisted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a relict from the parity wallet UI. there was a chance that a user did not follow instructions and recovered an account from an empty seed phrase. this account is blacklisted from mainnet usage for safety reasons. but as we no longer have the wallet, we could also remove this.

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"),
],
Expand Down
8 changes: 4 additions & 4 deletions parity/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down Expand Up @@ -1564,22 +1564,22 @@ 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]
fn should_not_use_config_if_cli_is_provided() {
// 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
Expand Down
2 changes: 1 addition & 1 deletion parity/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
29 changes: 16 additions & 13 deletions parity/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub enum SpecType {
Mix,
Callisto,
Morden,
Mordor,
Ropsten,
Kovan,
Rinkeby,
Expand All @@ -65,8 +66,8 @@ impl str::FromStr for SpecType {

fn from_str(s: &str) -> Result<Self, Self::Err> {
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,
Expand All @@ -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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, how about we remove "testnet" altogether? What is it useful for?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed the explanation in the PR descr. Something for the relnotes then (cc @s3krit)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a legacy option. I'm open to removing it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a note to myself for the release notes. Thanks

"kotti" => SpecType::Kotti,
"sokol" | "poasokol" => SpecType::Sokol,
"dev" => SpecType::Dev,
Expand All @@ -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",
Expand Down Expand Up @@ -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)),
Expand Down Expand Up @@ -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());
Expand All @@ -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());
Expand All @@ -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");
Expand Down