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

Commit

Permalink
ethcore/res: add mordor testnet configuration (#11200)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
soc1c authored and niklasad1 committed Nov 2, 2019
1 parent 6923ec8 commit 4f64fd2
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 20 deletions.
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
}
}
}
}
}
}
}
}
5 changes: 5 additions & 0 deletions ethcore/src/ethereum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ pub fn new_sokol<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
load(params.into(), include_bytes!("../../res/ethereum/poasokol.json"))
}

/// Create a new Morodor testnet chain spec.
pub fn new_mordor<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
load(params.into(), include_bytes!("../../res/ethereum/mordor.json"))
}

// For tests

/// Create a new Foundation Frontier-era chain spec as though it never changes to Homestead.
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 {
hardware_wallet_classic_key: spec == &SpecType::Classic,
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![
"00a329c0648769a73afac7f9381e08fb43dbea72".into()
],
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, expanse, 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 @@ -1556,22 +1556,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 @@ -1564,7 +1564,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 @@ -45,6 +45,7 @@ pub enum SpecType {
Mix,
Callisto,
Morden,
Mordor,
Ropsten,
Kovan,
Rinkeby,
Expand All @@ -66,8 +67,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 @@ -77,11 +78,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,
Expand All @@ -106,6 +108,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 @@ -134,6 +137,7 @@ impl SpecType {
SpecType::Mix => Ok(ethereum::new_mix(params)),
SpecType::Callisto => Ok(ethereum::new_callisto(params)),
SpecType::Morden => Ok(ethereum::new_morden(params)),
SpecType::Mordor => Ok(ethereum::new_mordor(params)),
SpecType::Ropsten => Ok(ethereum::new_ropsten(params)),
SpecType::Kovan => Ok(ethereum::new_kovan(params)),
SpecType::Rinkeby => Ok(ethereum::new_rinkeby(params)),
Expand Down Expand Up @@ -373,15 +377,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 @@ -394,13 +395,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 @@ -425,6 +427,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

0 comments on commit 4f64fd2

Please sign in to comment.