From 592ff53bab593fe5fb0ae3dfc0f2e9cb714fdcaf Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Sun, 11 Dec 2016 18:28:37 +0600 Subject: [PATCH 1/6] EIP-155 configuration for Ethereum Classic --- ethcore/res/ethereum/classic.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethcore/res/ethereum/classic.json b/ethcore/res/ethereum/classic.json index 7c1e9454e..ca4e0ea99 100644 --- a/ethcore/res/ethereum/classic.json +++ b/ethcore/res/ethereum/classic.json @@ -12,7 +12,7 @@ "registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b", "homesteadTransition": "0x118c30", "eip150Transition": "0x2625a0", - "eip155Transition": "0x7fffffffffffffff", + "eip155Transition": 3000000, "eip160Transition": "0x7fffffffffffffff", "eip161abcTransition": "0x7fffffffffffffff", "eip161dTransition": "0x7fffffffffffffff", @@ -25,7 +25,7 @@ "accountStartNonce": "0x00", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", - "networkID" : "0x1", + "networkID" : "0x3d", "forkBlock": "0x1d4c00", "forkCanonHash": "0x94365e3a8c0b35089c1d1195081fe7489b528a84b22199c916180db8b28ade7f" }, From 7b5bc115e9b2c5f163760733cf5d426b3cfa08b6 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Sun, 11 Dec 2016 18:29:40 +0600 Subject: [PATCH 2/6] EIP-160 configuration for Ethereum Classic --- ethcore/res/ethereum/classic.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/res/ethereum/classic.json b/ethcore/res/ethereum/classic.json index ca4e0ea99..9373a2041 100644 --- a/ethcore/res/ethereum/classic.json +++ b/ethcore/res/ethereum/classic.json @@ -13,7 +13,7 @@ "homesteadTransition": "0x118c30", "eip150Transition": "0x2625a0", "eip155Transition": 3000000, - "eip160Transition": "0x7fffffffffffffff", + "eip160Transition": 3000000, "eip161abcTransition": "0x7fffffffffffffff", "eip161dTransition": "0x7fffffffffffffff", "ecip1010PauseTransition": "0x2dc6c0", From aed633d7dfe8b3350627aa140b9891306e86ba8d Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Sun, 11 Dec 2016 19:25:02 +0600 Subject: [PATCH 3/6] Testnet for Ethereum Classic --- ethcore/res/ethereum/classic-morden.json | 58 ++++++++++++++++++++++++ ethcore/src/ethereum/mod.rs | 3 ++ parity/cli/usage.txt | 4 +- parity/params.rs | 6 +++ 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 ethcore/res/ethereum/classic-morden.json diff --git a/ethcore/res/ethereum/classic-morden.json b/ethcore/res/ethereum/classic-morden.json new file mode 100644 index 000000000..40c1d4dcf --- /dev/null +++ b/ethcore/res/ethereum/classic-morden.json @@ -0,0 +1,58 @@ +{ + "name": "Ethereum Classic Morden Testnet", + "forkName": "classic", + "engine": { + "Ethash": { + "params": { + "gasLimitBoundDivisor": "0x0400", + "minimumDifficulty": "0x020000", + "difficultyBoundDivisor": "0x0800", + "durationLimit": "0x0d", + "blockReward": "0x4563918244F40000", + "registrar": "0x52dff57a8a1532e6afb3dc07e2af58bb9eb05b3d", + "homesteadTransition": 494000, + "eip150Transition": 1783000, + "eip155Transition": 1915000, + "eip160Transition": 1915000, + "ecip1010PauseTransition": 1915000, + "ecip1010ContinueTransition": 3415000, + + "eip161abcTransition": "0x7fffffffffffffff", + "eip161dTransition": "0x7fffffffffffffff" + } + } + }, + "params": { + "accountStartNonce": "0x0100000", + "maximumExtraDataSize": "0x20", + "minGasLimit": "0x1388", + "networkID" : "0x3e", + "forkBlock": "0x1b34d8", + "forkCanonHash": "0xf376243aeff1f256d970714c3de9fd78fa4e63cf63e32a51fe1169e375d98145" + }, + "genesis": { + "seal": { + "ethereum": { + "nonce": "0x00006d6f7264656e", + "mixHash": "0x00000000000000000000000000000000000000647572616c65787365646c6578" + } + }, + "difficulty": "0x20000", + "author": "0x0000000000000000000000000000000000000000", + "timestamp": "0x00", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "extraData": "0x", + "gasLimit": "0x2fefd8" + }, + "nodes": [ + "enode://e731347db0521f3476e6bbbb83375dcd7133a1601425ebd15fd10f3835fd4c304fba6282087ca5a0deeafadf0aa0d4fd56c3323331901c1f38bd181c283e3e35@128.199.55.137:30303", + "enode://ceb5c0f85eb994dbe9693bf46d99b03f6b838d17cc74e68d5eb003171ff39e5f120b17f965b267c319303f94d80b9d994b77062fb1486d76ce95d9f3d8fe1cb4@46.101.122.141:30303" + ], + "accounts": { + "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, + "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, + "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, + "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, + "102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" } + } +} diff --git a/ethcore/src/ethereum/mod.rs b/ethcore/src/ethereum/mod.rs index 3916e5ccc..4dd0d2b73 100644 --- a/ethcore/src/ethereum/mod.rs +++ b/ethcore/src/ethereum/mod.rs @@ -42,6 +42,9 @@ pub fn new_frontier() -> Spec { load(include_bytes!("../../res/ethereum/frontier /// Create a new Frontier mainnet chain spec without the DAO hardfork. pub fn new_classic() -> Spec { load(include_bytes!("../../res/ethereum/classic.json")) } +/// Create a new Morden chain spec configured for Thereum Classic +pub fn new_classic_morden() -> Spec { load(include_bytes!("../../res/ethereum/classic-morden.json")) } + /// Create a new Frontier mainnet chain spec without the DAO hardfork. pub fn new_expanse() -> Spec { load(include_bytes!("../../res/ethereum/expanse.json")) } diff --git a/parity/cli/usage.txt b/parity/cli/usage.txt index c58672542..0a5b854dc 100644 --- a/parity/cli/usage.txt +++ b/parity/cli/usage.txt @@ -33,7 +33,7 @@ Operating Options: --chain CHAIN Specify the blockchain type. CHAIN may be either a JSON chain specification file or olympic, frontier, homestead, mainnet, morden, ropsten, classic, expanse, - testnet or dev (default: {flag_chain}). + testnet, classic-morden or dev (default: {flag_chain}). -d --db-path PATH Specify the database & configuration directory path (default: {flag_db_path}). --keys-path PATH Specify the path for JSON key files to be found @@ -266,7 +266,7 @@ Footprint Options: of all accounts and storage keys. Doubles the size of the state database. BOOL may be one of on, off or auto. (default: {flag_fat_db}) - --scale-verifiers Automatically scale amount of verifier threads based on + --scale-verifiers Automatically scale amount of verifier threads based on workload. Not guaranteed to be faster. (default: {flag_scale_verifiers}) --num-verifiers INT Amount of verifier threads to use or to begin with, if verifier diff --git a/parity/params.rs b/parity/params.rs index 25ddc8814..d8c3db2bc 100644 --- a/parity/params.rs +++ b/parity/params.rs @@ -31,6 +31,7 @@ pub enum SpecType { Ropsten, Olympic, Classic, + ClassicTestnet, Expanse, Dev, Custom(String), @@ -49,6 +50,7 @@ impl str::FromStr for SpecType { let spec = match s { "frontier" | "homestead" | "mainnet" => SpecType::Mainnet, "frontier-dogmatic" | "homestead-dogmatic" | "classic" => SpecType::Classic, + "classic-testnet" | "classic-morden" => SpecType::ClassicTestnet, "morden" | "testnet" => SpecType::Testnet, "ropsten" => SpecType::Ropsten, "olympic" => SpecType::Olympic, @@ -68,6 +70,7 @@ impl SpecType { SpecType::Ropsten => Ok(ethereum::new_ropsten()), SpecType::Olympic => Ok(ethereum::new_olympic()), SpecType::Classic => Ok(ethereum::new_classic()), + SpecType::ClassicTestnet => Ok(ethereum::new_classic_morden()), SpecType::Expanse => Ok(ethereum::new_expanse()), SpecType::Dev => Ok(Spec::new_instant()), SpecType::Custom(ref filename) => { @@ -288,6 +291,9 @@ mod tests { assert_eq!(SpecType::Testnet, "morden".parse().unwrap()); assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap()); assert_eq!(SpecType::Olympic, "olympic".parse().unwrap()); + assert_eq!(SpecType::Classic, "classic".parse().unwrap()); + assert_eq!(SpecType::ClassicTestnet, "classic-testnet".parse().unwrap()); + assert_eq!(SpecType::ClassicTestnet, "classic-morden".parse().unwrap()); } #[test] From 4e3c49c809589d4347c350af599951eb3c1995ae Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Sun, 11 Dec 2016 20:34:46 +0600 Subject: [PATCH 4/6] revert ETC to correct Network ID --- ethcore/res/ethereum/classic-morden.json | 2 +- ethcore/res/ethereum/classic.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ethcore/res/ethereum/classic-morden.json b/ethcore/res/ethereum/classic-morden.json index 40c1d4dcf..bc0bf4c02 100644 --- a/ethcore/res/ethereum/classic-morden.json +++ b/ethcore/res/ethereum/classic-morden.json @@ -26,7 +26,7 @@ "accountStartNonce": "0x0100000", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", - "networkID" : "0x3e", + "networkID" : "0x2", "forkBlock": "0x1b34d8", "forkCanonHash": "0xf376243aeff1f256d970714c3de9fd78fa4e63cf63e32a51fe1169e375d98145" }, diff --git a/ethcore/res/ethereum/classic.json b/ethcore/res/ethereum/classic.json index 9373a2041..9c189e8d8 100644 --- a/ethcore/res/ethereum/classic.json +++ b/ethcore/res/ethereum/classic.json @@ -25,7 +25,7 @@ "accountStartNonce": "0x00", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", - "networkID" : "0x3d", + "networkID" : "0x1", "forkBlock": "0x1d4c00", "forkCanonHash": "0x94365e3a8c0b35089c1d1195081fe7489b528a84b22199c916180db8b28ade7f" }, From 6742b080f556def243e1151631355b79c330289e Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Sun, 11 Dec 2016 20:38:37 +0600 Subject: [PATCH 5/6] use decimals for block numbers in config --- ethcore/res/ethereum/classic.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ethcore/res/ethereum/classic.json b/ethcore/res/ethereum/classic.json index 9c189e8d8..a08dde33b 100644 --- a/ethcore/res/ethereum/classic.json +++ b/ethcore/res/ethereum/classic.json @@ -10,14 +10,15 @@ "durationLimit": "0x0d", "blockReward": "0x4563918244F40000", "registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b", - "homesteadTransition": "0x118c30", - "eip150Transition": "0x2625a0", + "homesteadTransition": 1150000, + "eip150Transition": 2500000, "eip155Transition": 3000000, "eip160Transition": 3000000, + "ecip1010PauseTransition": 3000000, + "ecip1010ContinueTransition": 5000000, + "eip161abcTransition": "0x7fffffffffffffff", - "eip161dTransition": "0x7fffffffffffffff", - "ecip1010PauseTransition": "0x2dc6c0", - "ecip1010ContinueTransition": "0x4c4b40" + "eip161dTransition": "0x7fffffffffffffff" } } }, From e61d14d7f7658d331b41c3d123a7a79556c4088f Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 12 Dec 2016 19:50:32 +0000 Subject: [PATCH 6/6] reuse Morden for Classic Testnet --- ethcore/res/ethereum/classic-morden.json | 58 ------------------------ ethcore/res/ethereum/morden.json | 15 +++--- ethcore/res/ethereum/tests | 2 +- ethcore/src/ethereum/mod.rs | 3 -- parity/cli/usage.txt | 2 +- parity/params.rs | 8 +--- 6 files changed, 13 insertions(+), 75 deletions(-) delete mode 100644 ethcore/res/ethereum/classic-morden.json diff --git a/ethcore/res/ethereum/classic-morden.json b/ethcore/res/ethereum/classic-morden.json deleted file mode 100644 index bc0bf4c02..000000000 --- a/ethcore/res/ethereum/classic-morden.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "Ethereum Classic Morden Testnet", - "forkName": "classic", - "engine": { - "Ethash": { - "params": { - "gasLimitBoundDivisor": "0x0400", - "minimumDifficulty": "0x020000", - "difficultyBoundDivisor": "0x0800", - "durationLimit": "0x0d", - "blockReward": "0x4563918244F40000", - "registrar": "0x52dff57a8a1532e6afb3dc07e2af58bb9eb05b3d", - "homesteadTransition": 494000, - "eip150Transition": 1783000, - "eip155Transition": 1915000, - "eip160Transition": 1915000, - "ecip1010PauseTransition": 1915000, - "ecip1010ContinueTransition": 3415000, - - "eip161abcTransition": "0x7fffffffffffffff", - "eip161dTransition": "0x7fffffffffffffff" - } - } - }, - "params": { - "accountStartNonce": "0x0100000", - "maximumExtraDataSize": "0x20", - "minGasLimit": "0x1388", - "networkID" : "0x2", - "forkBlock": "0x1b34d8", - "forkCanonHash": "0xf376243aeff1f256d970714c3de9fd78fa4e63cf63e32a51fe1169e375d98145" - }, - "genesis": { - "seal": { - "ethereum": { - "nonce": "0x00006d6f7264656e", - "mixHash": "0x00000000000000000000000000000000000000647572616c65787365646c6578" - } - }, - "difficulty": "0x20000", - "author": "0x0000000000000000000000000000000000000000", - "timestamp": "0x00", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "extraData": "0x", - "gasLimit": "0x2fefd8" - }, - "nodes": [ - "enode://e731347db0521f3476e6bbbb83375dcd7133a1601425ebd15fd10f3835fd4c304fba6282087ca5a0deeafadf0aa0d4fd56c3323331901c1f38bd181c283e3e35@128.199.55.137:30303", - "enode://ceb5c0f85eb994dbe9693bf46d99b03f6b838d17cc74e68d5eb003171ff39e5f120b17f965b267c319303f94d80b9d994b77062fb1486d76ce95d9f3d8fe1cb4@46.101.122.141:30303" - ], - "accounts": { - "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, - "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, - "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, - "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, - "102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" } - } -} diff --git a/ethcore/res/ethereum/morden.json b/ethcore/res/ethereum/morden.json index 6e725e8bf..d24e0ec0c 100644 --- a/ethcore/res/ethereum/morden.json +++ b/ethcore/res/ethereum/morden.json @@ -9,12 +9,15 @@ "durationLimit": "0x0d", "blockReward": "0x4563918244F40000", "registrar": "0x52dff57a8a1532e6afb3dc07e2af58bb9eb05b3d", - "homesteadTransition": "0x789b0", - "eip150Transition": "0x1b34d8", - "eip155Transition": 1885000, - "eip160Transition": 1885000, - "eip161abcTransition": 1885000, - "eip161dTransition": 1885000 + "homesteadTransition": 494000, + "eip150Transition": 1783000, + "eip155Transition": 1915000, + "eip160Transition": 1915000, + "ecip1010PauseTransition": 1915000, + "ecip1010ContinueTransition": 3415000, + + "eip161abcTransition": "0x7fffffffffffffff", + "eip161dTransition": "0x7fffffffffffffff" } } }, diff --git a/ethcore/res/ethereum/tests b/ethcore/res/ethereum/tests index e8f4624b7..9028c4801 160000 --- a/ethcore/res/ethereum/tests +++ b/ethcore/res/ethereum/tests @@ -1 +1 @@ -Subproject commit e8f4624b7f1a15c63674eecf577c7ab76c3b16be +Subproject commit 9028c4801fd39fbb71a9796979182549a24e81c8 diff --git a/ethcore/src/ethereum/mod.rs b/ethcore/src/ethereum/mod.rs index 4dd0d2b73..3916e5ccc 100644 --- a/ethcore/src/ethereum/mod.rs +++ b/ethcore/src/ethereum/mod.rs @@ -42,9 +42,6 @@ pub fn new_frontier() -> Spec { load(include_bytes!("../../res/ethereum/frontier /// Create a new Frontier mainnet chain spec without the DAO hardfork. pub fn new_classic() -> Spec { load(include_bytes!("../../res/ethereum/classic.json")) } -/// Create a new Morden chain spec configured for Thereum Classic -pub fn new_classic_morden() -> Spec { load(include_bytes!("../../res/ethereum/classic-morden.json")) } - /// Create a new Frontier mainnet chain spec without the DAO hardfork. pub fn new_expanse() -> Spec { load(include_bytes!("../../res/ethereum/expanse.json")) } diff --git a/parity/cli/usage.txt b/parity/cli/usage.txt index 0a5b854dc..1e99c76fe 100644 --- a/parity/cli/usage.txt +++ b/parity/cli/usage.txt @@ -33,7 +33,7 @@ Operating Options: --chain CHAIN Specify the blockchain type. CHAIN may be either a JSON chain specification file or olympic, frontier, homestead, mainnet, morden, ropsten, classic, expanse, - testnet, classic-morden or dev (default: {flag_chain}). + testnet or dev (default: {flag_chain}). -d --db-path PATH Specify the database & configuration directory path (default: {flag_db_path}). --keys-path PATH Specify the path for JSON key files to be found diff --git a/parity/params.rs b/parity/params.rs index d8c3db2bc..99ceac67b 100644 --- a/parity/params.rs +++ b/parity/params.rs @@ -31,7 +31,6 @@ pub enum SpecType { Ropsten, Olympic, Classic, - ClassicTestnet, Expanse, Dev, Custom(String), @@ -50,8 +49,7 @@ impl str::FromStr for SpecType { let spec = match s { "frontier" | "homestead" | "mainnet" => SpecType::Mainnet, "frontier-dogmatic" | "homestead-dogmatic" | "classic" => SpecType::Classic, - "classic-testnet" | "classic-morden" => SpecType::ClassicTestnet, - "morden" | "testnet" => SpecType::Testnet, + "morden" | "testnet" | "classic-testnet" => SpecType::Testnet, "ropsten" => SpecType::Ropsten, "olympic" => SpecType::Olympic, "expanse" => SpecType::Expanse, @@ -70,7 +68,6 @@ impl SpecType { SpecType::Ropsten => Ok(ethereum::new_ropsten()), SpecType::Olympic => Ok(ethereum::new_olympic()), SpecType::Classic => Ok(ethereum::new_classic()), - SpecType::ClassicTestnet => Ok(ethereum::new_classic_morden()), SpecType::Expanse => Ok(ethereum::new_expanse()), SpecType::Dev => Ok(Spec::new_instant()), SpecType::Custom(ref filename) => { @@ -292,8 +289,7 @@ mod tests { assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap()); assert_eq!(SpecType::Olympic, "olympic".parse().unwrap()); assert_eq!(SpecType::Classic, "classic".parse().unwrap()); - assert_eq!(SpecType::ClassicTestnet, "classic-testnet".parse().unwrap()); - assert_eq!(SpecType::ClassicTestnet, "classic-morden".parse().unwrap()); + assert_eq!(SpecType::Testnet, "classic-testnet".parse().unwrap()); } #[test]