Skip to content

Commit

Permalink
parity: add --chain goerli (#2)
Browse files Browse the repository at this point in the history
* ethcore: add goerli chainspec

* ethcore: allow using goerli chain spec

* cli: add goerli to cli description

* parity: add goerli chain to params

* rpc(debug_getBadBlocks): fix test (openethereum#9502)
  • Loading branch information
5chdn authored and priom committed Sep 8, 2018
1 parent 49e99dd commit a670db5
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 2 deletions.
66 changes: 66 additions & 0 deletions ethcore/res/ethereum/goerli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "Görli",
"dataDir": "goerli",
"engine": {
"authorityRound": {
"params": {
"stepDuration": "4",
"blockReward": "0x4563918244F40000",
"validators" : {
"list": [
"0x0082a7bf6aaadab094061747872243059c3c6a07",
"0x00faa37564140c1a5e96095f05466b9f73441e44"
]
},
"validateScoreTransition": "0x0",
"validateStepTransition": "0x0",
"maximumUncleCountTransition": "0x0",
"maximumUncleCount": "0x0"
}
}
},
"params": {
"gasLimitBoundDivisor": "0x400",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID" : "0x188B",
"eip155Transition": "0x0",
"maxCodeSize": "0x6000",
"maxCodeSizeTransition": "0x0",
"validateChainIdTransition": "0x0",
"validateReceiptsTransition" : "0x0",
"eip140Transition": "0x0",
"eip211Transition": "0x0",
"eip214Transition": "0x0",
"eip658Transition": "0x0"
},
"genesis": {
"seal": {
"authorityRound": {
"step": "0x0",
"signature": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AC1DC0FFEE"
}
},
"difficulty": "0x20000",
"gasLimit": "0x5B8D80"
},
"accounts": {
"0x0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },
"0x0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
"0x0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
"0x0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
"0x0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "0x0", "pricing": { "modexp": { "divisor": 20 } } } },
"0x0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": "0x0", "pricing": { "linear": { "base": 500, "word": 0 } } } },
"0x0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": "0x0", "pricing": { "linear": { "base": 40000, "word": 0 } } } },
"0x0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": "0x0", "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
"0x0015c90d0e12186bc51c9d51aff4d3fb6e984291": { "balance": "1606938044258990275541962092341162602522202993782792835301376" },
"0x009fcc115ad9ef38288a82a014dea30f63a84383": { "balance": "1606938044258990275541962092341162602522202993782792835301376" }

},
"nodes": [
"enode://ffc0d1bcc54dee616617be06edf2b3abdd200beb3765d4475ae9fb1750d98fb0d753b30e691912bb6775b7d442b71072c91becab2141191ce73de5b6d57ac723@40.114.122.81:30303",
"enode://5b360e4baabf9e89e42e9241d4d00e7ff7a804759049be7dde30980ccce445f1fb0f91a4b9a4a28ee371b18d679fcced3cac3d73654059dd69c4a7b772bd4abf@40.87.8.76:30303",
"enode://b95468b5fa80293c4f2fce2df7a02a52f0b259063d99a78a571afcb69f736ead79ca73412b37cb2336da75066f02439d2e50e22dedc1b78380a6ab36ebdda3fc@40.87.4.17:30303",
"enode://3969e0879235c0b2bcc8957fc6d62d53763fcff0e750788eae029d40f1b4fa69f4d5a952ea3d02f85eb558faaae6bd5fbd1f394867edc6728c9fe7b9959329b0@40.87.1.35:30303"
]
}
5 changes: 5 additions & 0 deletions ethcore/src/ethereum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,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 Goerli testnet chain spec.
pub fn new_goerli<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
load(params.into(), include_bytes!("../../res/ethereum/goerli.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/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,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, tobalaba, expanse, musicoin, ellaism, easthub, social, olympic, morden, ropsten, kovan, poasokol, testnet, or dev.",
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, tobalaba, expanse, musicoin, ellaism, easthub, social, olympic, morden, ropsten, kovan, poasokol, goerli, 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
7 changes: 7 additions & 0 deletions parity/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub enum SpecType {
Ropsten,
Kovan,
Sokol,
Goerli,
Dev,
Custom(String),
}
Expand Down Expand Up @@ -74,6 +75,7 @@ impl str::FromStr for SpecType {
"ropsten" => SpecType::Ropsten,
"kovan" | "testnet" => SpecType::Kovan,
"sokol" | "poasokol" => SpecType::Sokol,
"goerli" | "gorli" => SpecType::Goerli,
"dev" => SpecType::Dev,
other => SpecType::Custom(other.into()),
};
Expand All @@ -98,6 +100,7 @@ impl fmt::Display for SpecType {
SpecType::Ropsten => "ropsten",
SpecType::Kovan => "kovan",
SpecType::Sokol => "sokol",
SpecType::Goerli => "goerli",
SpecType::Dev => "dev",
SpecType::Custom(ref custom) => custom,
})
Expand All @@ -122,6 +125,7 @@ impl SpecType {
SpecType::Ropsten => Ok(ethereum::new_ropsten(params)),
SpecType::Kovan => Ok(ethereum::new_kovan(params)),
SpecType::Sokol => Ok(ethereum::new_sokol(params)),
SpecType::Goerli => Ok(ethereum::new_goerli(params)),
SpecType::Dev => Ok(Spec::new_instant()),
SpecType::Custom(ref filename) => {
let file = fs::File::open(filename).map_err(|e| format!("Could not load specification file at {}: {}", filename, e))?;
Expand Down Expand Up @@ -378,6 +382,8 @@ mod tests {
assert_eq!(SpecType::Kovan, "testnet".parse().unwrap());
assert_eq!(SpecType::Sokol, "sokol".parse().unwrap());
assert_eq!(SpecType::Sokol, "poasokol".parse().unwrap());
assert_eq!(SpecType::Goerli, "goerli".parse().unwrap());
assert_eq!(SpecType::Goerli, "gorli".parse().unwrap());
}

#[test]
Expand All @@ -401,6 +407,7 @@ mod tests {
assert_eq!(format!("{}", SpecType::Ropsten), "ropsten");
assert_eq!(format!("{}", SpecType::Kovan), "kovan");
assert_eq!(format!("{}", SpecType::Sokol), "sokol");
assert_eq!(format!("{}", SpecType::Goerli), "goerli");
assert_eq!(format!("{}", SpecType::Dev), "dev");
assert_eq!(format!("{}", SpecType::Custom("foo/bar".into())), "foo/bar");
}
Expand Down
2 changes: 1 addition & 1 deletion parity/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ fn prepare_account_provider(spec: &SpecType, dirs: &Directories, data_dir: &str,
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::Ropsten | SpecType::Kovan | SpecType::Sokol | SpecType::Goerli | SpecType::Dev => vec![],
_ => vec![
"00a329c0648769a73afac7f9381e08fb43dbea72".into()
],
Expand Down

0 comments on commit a670db5

Please sign in to comment.