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
This commit is contained in:
Talha Cross 2019-11-02 12:26:38 +01:00 committed by GitHub
parent 43dc9af03b
commit 1b4d23fd20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 221 additions and 21 deletions

View File

@ -13,6 +13,7 @@
"accountStartNonce": "0x0", "accountStartNonce": "0x0",
"chainID": "0x6", "chainID": "0x6",
"eip140Transition": "0xaef49", "eip140Transition": "0xaef49",
"eip145Transition": "0x1a064d",
"eip150Transition": "0x0", "eip150Transition": "0x0",
"eip155Transition": "0x0", "eip155Transition": "0x0",
"eip160Transition": "0x0", "eip160Transition": "0x0",
@ -21,6 +22,8 @@
"eip211Transition": "0xaef49", "eip211Transition": "0xaef49",
"eip214Transition": "0xaef49", "eip214Transition": "0xaef49",
"eip658Transition": "0xaef49", "eip658Transition": "0xaef49",
"eip1014Transition": "0x1a064d",
"eip1052Transition": "0x1a064d",
"gasLimitBoundDivisor": "0x400", "gasLimitBoundDivisor": "0x400",
"maxCodeSize": "0x6000", "maxCodeSize": "0x6000",
"maxCodeSizeTransition": "0xaef49", "maxCodeSizeTransition": "0xaef49",

View File

@ -37,7 +37,10 @@
"eip140Transition": "0x4829ba", "eip140Transition": "0x4829ba",
"eip211Transition": "0x4829ba", "eip211Transition": "0x4829ba",
"eip214Transition": "0x4829ba", "eip214Transition": "0x4829ba",
"eip658Transition": "0x4829ba" "eip658Transition": "0x4829ba",
"eip145Transition": "0x4c4cbd",
"eip1014Transition": "0x4c4cbd",
"eip1052Transition": "0x4c4cbd"
}, },
"genesis": { "genesis": {
"seal": { "seal": {

View File

@ -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
}
}
}
}
}
}
}
}

View File

@ -69,6 +69,7 @@ bundle_release_spec! {
"ethereum/kovan" => new_kovan, "ethereum/kovan" => new_kovan,
"ethereum/mix" => new_mix, "ethereum/mix" => new_mix,
"ethereum/morden" => new_morden, "ethereum/morden" => new_morden,
"ethereum/mordor" => new_mordor,
"ethereum/musicoin" => new_musicoin, "ethereum/musicoin" => new_musicoin,
"ethereum/poacore" => new_poanet, "ethereum/poacore" => new_poanet,
"ethereum/xdai" => new_xdai, "ethereum/xdai" => new_xdai,
@ -96,6 +97,7 @@ bundle_test_spec! {
"ethereum/kovan_wasm_test" => new_kovan_wasm_test, "ethereum/kovan_wasm_test" => new_kovan_wasm_test,
"ethereum/mcip3_test" => new_mcip3_test, "ethereum/mcip3_test" => new_mcip3_test,
"ethereum/morden" => new_morden_test, "ethereum/morden" => new_morden_test,
"ethereum/mordor" => new_mordor_test,
"ethereum/ropsten" => new_ropsten_test, "ethereum/ropsten" => new_ropsten_test,
"ethereum/st_peters_test" => new_constantinople_fix_test, "ethereum/st_peters_test" => new_constantinople_fix_test,
"ethereum/transition_test" => new_transition_test, "ethereum/transition_test" => new_transition_test,

View File

@ -81,7 +81,7 @@ mod accounts {
let account_settings = AccountProviderSettings { let account_settings = AccountProviderSettings {
unlock_keep_secret: cfg.enable_fast_unlock, unlock_keep_secret: cfg.enable_fast_unlock,
blacklisted_accounts: match *spec { 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![ _ => vec![
H160::from_str("00a329c0648769a73afac7f9381e08fb43dbea72").expect("the string is valid hex; qed"), H160::from_str("00a329c0648769a73afac7f9381e08fb43dbea72").expect("the string is valid hex; qed"),
], ],

View File

@ -300,7 +300,7 @@ usage! {
ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(), ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(),
"--chain=[CHAIN]", "--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(), ARG arg_keys_path: (String) = "$BASE/keys", or |c: &Config| c.parity.as_ref()?.keys_path.clone(),
"--keys-path=[PATH]", "--keys-path=[PATH]",
@ -1564,14 +1564,14 @@ mod tests {
// given // given
let mut config = Config::default(); let mut config = Config::default();
let mut operating = Operating::default(); let mut operating = Operating::default();
operating.chain = Some("morden".into()); operating.chain = Some("mordor".into());
config.parity = Some(operating); config.parity = Some(operating);
// when // when
let args = Args::parse_with_config(&["parity"], config).unwrap(); let args = Args::parse_with_config(&["parity"], config).unwrap();
// then // then
assert_eq!(args.arg_chain, "morden".to_owned()); assert_eq!(args.arg_chain, "mordor".to_owned());
} }
#[test] #[test]
@ -1579,7 +1579,7 @@ mod tests {
// given // given
let mut config = Config::default(); let mut config = Config::default();
let mut operating = Operating::default(); let mut operating = Operating::default();
operating.chain = Some("morden".into()); operating.chain = Some("mordor".into());
config.parity = Some(operating); config.parity = Some(operating);
// when // when

View File

@ -1569,7 +1569,7 @@ mod tests {
// then // then
assert_eq!(conf.network_settings(), Ok(NetworkSettings { assert_eq!(conf.network_settings(), Ok(NetworkSettings {
name: "testname".to_owned(), name: "testname".to_owned(),
chain: "kovan".to_owned(), chain: "goerli".to_owned(),
is_dev_chain: false, is_dev_chain: false,
network_port: 30303, network_port: 30303,
rpc_enabled: true, rpc_enabled: true,

View File

@ -44,6 +44,7 @@ pub enum SpecType {
Mix, Mix,
Callisto, Callisto,
Morden, Morden,
Mordor,
Ropsten, Ropsten,
Kovan, Kovan,
Rinkeby, Rinkeby,
@ -65,8 +66,8 @@ impl str::FromStr for SpecType {
fn from_str(s: &str) -> Result<Self, Self::Err> { fn from_str(s: &str) -> Result<Self, Self::Err> {
let spec = match s { let spec = match s {
"ethereum" | "frontier" | "homestead" | "byzantium" | "foundation" | "mainnet" => SpecType::Foundation, "eth" | "ethereum" | "foundation" | "mainnet" => SpecType::Foundation,
"classic" | "frontier-dogmatic" | "homestead-dogmatic" => SpecType::Classic, "etc" | "classic" => SpecType::Classic,
"poanet" | "poacore" => SpecType::Poanet, "poanet" | "poacore" => SpecType::Poanet,
"xdai" => SpecType::Xdai, "xdai" => SpecType::Xdai,
"volta" => SpecType::Volta, "volta" => SpecType::Volta,
@ -75,11 +76,12 @@ impl str::FromStr for SpecType {
"ellaism" => SpecType::Ellaism, "ellaism" => SpecType::Ellaism,
"mix" => SpecType::Mix, "mix" => SpecType::Mix,
"callisto" => SpecType::Callisto, "callisto" => SpecType::Callisto,
"morden" | "classic-testnet" => SpecType::Morden, "morden" => SpecType::Morden,
"mordor" | "classic-testnet" => SpecType::Mordor,
"ropsten" => SpecType::Ropsten, "ropsten" => SpecType::Ropsten,
"kovan" | "testnet" => SpecType::Kovan, "kovan" => SpecType::Kovan,
"rinkeby" => SpecType::Rinkeby, "rinkeby" => SpecType::Rinkeby,
"goerli" | "görli" => SpecType::Goerli, "goerli" | "görli" | "testnet" => SpecType::Goerli,
"kotti" => SpecType::Kotti, "kotti" => SpecType::Kotti,
"sokol" | "poasokol" => SpecType::Sokol, "sokol" | "poasokol" => SpecType::Sokol,
"dev" => SpecType::Dev, "dev" => SpecType::Dev,
@ -103,6 +105,7 @@ impl fmt::Display for SpecType {
SpecType::Mix => "mix", SpecType::Mix => "mix",
SpecType::Callisto => "callisto", SpecType::Callisto => "callisto",
SpecType::Morden => "morden", SpecType::Morden => "morden",
SpecType::Mordor => "mordor",
SpecType::Ropsten => "ropsten", SpecType::Ropsten => "ropsten",
SpecType::Kovan => "kovan", SpecType::Kovan => "kovan",
SpecType::Rinkeby => "rinkeby", SpecType::Rinkeby => "rinkeby",
@ -130,6 +133,7 @@ impl SpecType {
SpecType::Mix => Ok(spec::new_mix(params)), SpecType::Mix => Ok(spec::new_mix(params)),
SpecType::Callisto => Ok(spec::new_callisto(params)), SpecType::Callisto => Ok(spec::new_callisto(params)),
SpecType::Morden => Ok(spec::new_morden(params)), SpecType::Morden => Ok(spec::new_morden(params)),
SpecType::Mordor => Ok(spec::new_mordor(params)),
SpecType::Ropsten => Ok(spec::new_ropsten(params)), SpecType::Ropsten => Ok(spec::new_ropsten(params)),
SpecType::Kovan => Ok(spec::new_kovan(params)), SpecType::Kovan => Ok(spec::new_kovan(params)),
SpecType::Rinkeby => Ok(spec::new_rinkeby(params)), SpecType::Rinkeby => Ok(spec::new_rinkeby(params)),
@ -369,15 +373,12 @@ mod tests {
#[test] #[test]
fn test_spec_type_parsing() { fn test_spec_type_parsing() {
assert_eq!(SpecType::Foundation, "foundation".parse().unwrap()); assert_eq!(SpecType::Foundation, "eth".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::Foundation, "ethereum".parse().unwrap());
assert_eq!(SpecType::Foundation, "foundation".parse().unwrap());
assert_eq!(SpecType::Foundation, "mainnet".parse().unwrap());
assert_eq!(SpecType::Classic, "etc".parse().unwrap());
assert_eq!(SpecType::Classic, "classic".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, "poanet".parse().unwrap());
assert_eq!(SpecType::Poanet, "poacore".parse().unwrap()); assert_eq!(SpecType::Poanet, "poacore".parse().unwrap());
assert_eq!(SpecType::Xdai, "xdai".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::Mix, "mix".parse().unwrap());
assert_eq!(SpecType::Callisto, "callisto".parse().unwrap()); assert_eq!(SpecType::Callisto, "callisto".parse().unwrap());
assert_eq!(SpecType::Morden, "morden".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::Ropsten, "ropsten".parse().unwrap());
assert_eq!(SpecType::Kovan, "kovan".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::Rinkeby, "rinkeby".parse().unwrap());
assert_eq!(SpecType::Goerli, "goerli".parse().unwrap()); assert_eq!(SpecType::Goerli, "goerli".parse().unwrap());
assert_eq!(SpecType::Goerli, "görli".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::Kotti, "kotti".parse().unwrap());
assert_eq!(SpecType::Sokol, "sokol".parse().unwrap()); assert_eq!(SpecType::Sokol, "sokol".parse().unwrap());
assert_eq!(SpecType::Sokol, "poasokol".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::Mix), "mix");
assert_eq!(format!("{}", SpecType::Callisto), "callisto"); assert_eq!(format!("{}", SpecType::Callisto), "callisto");
assert_eq!(format!("{}", SpecType::Morden), "morden"); assert_eq!(format!("{}", SpecType::Morden), "morden");
assert_eq!(format!("{}", SpecType::Mordor), "mordor");
assert_eq!(format!("{}", SpecType::Ropsten), "ropsten"); assert_eq!(format!("{}", SpecType::Ropsten), "ropsten");
assert_eq!(format!("{}", SpecType::Kovan), "kovan"); assert_eq!(format!("{}", SpecType::Kovan), "kovan");
assert_eq!(format!("{}", SpecType::Rinkeby), "rinkeby"); assert_eq!(format!("{}", SpecType::Rinkeby), "rinkeby");