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

Commit

Permalink
Add EtherCore support
Browse files Browse the repository at this point in the history
* support ethercore mainnet with basic token metrics and ProgPoW support, ecip1017, bomb defuse & istanbul
* switch progpow to 0.9.3 version
* update progpow test vectors
  • Loading branch information
EtherCoreAdmin committed Jan 24, 2020
1 parent e1d06ef commit 6a3713d
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 41 deletions.
70 changes: 35 additions & 35 deletions ethash/res/progpow_testvectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,84 +3,84 @@
0,
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000",
"faeb1be51075b03a4ff44b335067951ead07a3b078539ace76fd56fc410557a3",
"63155f732f2bf556967f906155b510c917e48e99685ead76ea83f4eca03ab12b"
"f4ac202715ded4136e72887c39e63a4738331c57fd9eb79f6ec421c281aa8743",
"b3bad9ca6f7c566cf0377d1f8cce29d6516a96562c122d924626281ec948ef02"
],
[
49,
"63155f732f2bf556967f906155b510c917e48e99685ead76ea83f4eca03ab12b",
"b3bad9ca6f7c566cf0377d1f8cce29d6516a96562c122d924626281ec948ef02",
"0000000006ff2c47",
"c789c1180f890ec555ff42042913465481e8e6bc512cb981e1c1108dc3f2227d",
"9e7248f20914913a73d80a70174c331b1d34f260535ac3631d770e656b5dd922"
"7730596f128f675ef9a6bb7281f268e4077d302f2b9078da1ece4349248561dd",
"0b9ed0c11157f1365143e329a6e1cea4248d9d6cb44b9c6daf492c7a076654a4"
],
[
50,
"9e7248f20914913a73d80a70174c331b1d34f260535ac3631d770e656b5dd922",
"0b9ed0c11157f1365143e329a6e1cea4248d9d6cb44b9c6daf492c7a076654a4",
"00000000076e482e",
"c7340542c2a06b3a7dc7222635f7cd402abf8b528ae971ddac6bbe2b0c7cb518",
"de37e1824c86d35d154cf65a88de6d9286aec4f7f10c3fc9f0fa1bcc2687188d"
"829136d4a704eb8d06da773f1a90466e7b5ed12119c44526f045bbff4475d891",
"e2e881c5b893c2f1ef06b96a10cfcbcf7255b307f0818e7d30eb12b2edfc237b"
],
[
99,
"de37e1824c86d35d154cf65a88de6d9286aec4f7f10c3fc9f0fa1bcc2687188d",
"e2e881c5b893c2f1ef06b96a10cfcbcf7255b307f0818e7d30eb12b2edfc237b",
"000000003917afab",
"f5e60b2c5bfddd136167a30cbc3c8dbdbd15a512257dee7964e0bc6daa9f8ba7",
"ac7b55e801511b77e11d52e9599206101550144525b5679f2dab19386f23dcce"
"deb3d8b45bdc596c56aa37a5eba456f478c82e60e5c028ce95f2e654e4bb7b57",
"9bdc2ad2286eaa051d6ca1f5196d2dd1c9a039f1d7ce3e1c856b793deed01778"
],
[
29950,
"ac7b55e801511b77e11d52e9599206101550144525b5679f2dab19386f23dcce",
"9bdc2ad2286eaa051d6ca1f5196d2dd1c9a039f1d7ce3e1c856b793deed01778",
"005d409dbc23a62a",
"07393d15805eb08ee6fc6cb3ad4ad1010533bd0ff92d6006850246829f18fd6e",
"e43d7e0bdc8a4a3f6e291a5ed790b9fa1a0948a2b9e33c844888690847de19f5"
"c01e6d339cc687c77f653b81c74cb9de8b595554f2c5db671a7dde3846d2fa01",
"de0d693e597cf2fd70a4cfaa73f6baafc29e1eee695a81295b278c1116580b72"
],
[
29999,
"e43d7e0bdc8a4a3f6e291a5ed790b9fa1a0948a2b9e33c844888690847de19f5",
"de0d693e597cf2fd70a4cfaa73f6baafc29e1eee695a81295b278c1116580b72",
"005db5fa4c2a3d03",
"7551bddf977491da2f6cfc1679299544b23483e8f8ee0931c4c16a796558a0b8",
"d34519f72c97cae8892c277776259db3320820cb5279a299d0ef1e155e5c6454"
"8b664cdbf396a7a185446c93dddd6611f5a736b11097381ae6bea45e802cec16",
"21ec5d1984a4fd4394b042aa96365085225d964727a45def245ceab326e28128"
],
[
30000,
"d34519f72c97cae8892c277776259db3320820cb5279a299d0ef1e155e5c6454",
"21ec5d1984a4fd4394b042aa96365085225d964727a45def245ceab326e28128",
"005db8607994ff30",
"f1c2c7c32266af9635462e6ce1c98ebe4e7e3ecab7a38aaabfbf2e731e0fbff4",
"8b6ce5da0b06d18db7bd8492d9e5717f8b53e7e098d9fef7886d58a6e913ef64"
"276951d89c1ed262bcac00df4fb9bf7af36991532744a2e287b0b758a56e15aa",
"dc070b76cc311cd82267f98936acbbbd3ec1c1ab25b55e2c885af6474e1e6841"
],
[
30049,
"8b6ce5da0b06d18db7bd8492d9e5717f8b53e7e098d9fef7886d58a6e913ef64",
"dc070b76cc311cd82267f98936acbbbd3ec1c1ab25b55e2c885af6474e1e6841",
"005e2e215a8ca2e7",
"57fe6a9fbf920b4e91deeb66cb0efa971e08229d1a160330e08da54af0689add",
"c2c46173481b9ced61123d2e293b42ede5a1b323210eb2a684df0874ffe09047"
"6248ba0157d0f0592dacfe2963337948fffb37f67e7451a6862c1321d894cebe",
"6fdecf719e2547f585a6ee807d8237db8e9489f63d3f259ab5236451eaded433"
],
[
30050,
"c2c46173481b9ced61123d2e293b42ede5a1b323210eb2a684df0874ffe09047",
"6fdecf719e2547f585a6ee807d8237db8e9489f63d3f259ab5236451eaded433",
"005e30899481055e",
"ba30c61cc5a2c74a5ecaf505965140a08f24a296d687e78720f0b48baf712f2d",
"ea42197eb2ba79c63cb5e655b8b1f612c5f08aae1a49ff236795a3516d87bc71"
"512d8f2bb0441fcfa1764c67e8dbed2afcbe9141de4bbebc5b51e0661dede550",
"cb1587a1c372642cbd9ce4c1ba2f433985d44c571a676a032bc1e8c1ad066e24"
],
[
30099,
"ea42197eb2ba79c63cb5e655b8b1f612c5f08aae1a49ff236795a3516d87bc71",
"cb1587a1c372642cbd9ce4c1ba2f433985d44c571a676a032bc1e8c1ad066e24",
"005ea6aef136f88b",
"cfd5e46048cd133d40f261fe8704e51d3f497fc14203ac6a9ef6a0841780b1cd",
"49e15ba4bf501ce8fe8876101c808e24c69a859be15de554bf85dbc095491bd6"
"be0e7d6afa6edd483ccc304afa9bf0abaca5e0f037a4f05bf5550b9309d1d12c",
"78be18f20569a834d839dad48e0e51d6df6b6537575f0ad29898c7cf357f12cb"
],
[
59950,
"49e15ba4bf501ce8fe8876101c808e24c69a859be15de554bf85dbc095491bd6",
"78be18f20569a834d839dad48e0e51d6df6b6537575f0ad29898c7cf357f12cb",
"02ebe0503bd7b1da",
"21511fbaa31fb9f5fc4998a754e97b3083a866f4de86fa7500a633346f56d773",
"f5c50ba5c0d6210ddb16250ec3efda178de857b2b1703d8d5403bd0f848e19cf"
"b85be51fce670aa437f28c02ea4fd7995fa8b6ac224e959b8dbfb5bdbc6f77ce",
"a68a620ba17e0cf2817bc4397cf4b85f5770983aa7b7931319a7f61bd6f905b1"
],
[
59999,
"f5c50ba5c0d6210ddb16250ec3efda178de857b2b1703d8d5403bd0f848e19cf",
"a68a620ba17e0cf2817bc4397cf4b85f5770983aa7b7931319a7f61bd6f905b1",
"02edb6275bd221e3",
"653eda37d337e39d311d22be9bbd3458d3abee4e643bee4a7280a6d08106ef98",
"341562d10d4afb706ec2c8d5537cb0c810de02b4ebb0a0eea5ae335af6fb2e88"
"ffe745a932c21c0704291bb416fe8bffec76621cd3434861885beab42cec1734",
"9e6667a151ac6f5186a05cb20877a2b3df02317046256a762cb8ec2d96aa34f0"
]
]
10 changes: 5 additions & 5 deletions ethash/src/progpow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ use shared::{ETHASH_ACCESSES, ETHASH_MIX_BYTES, Node, get_data_size};

const PROGPOW_CACHE_BYTES: usize = 16 * 1024;
const PROGPOW_CACHE_WORDS: usize = PROGPOW_CACHE_BYTES / 4;
const PROGPOW_CNT_CACHE: usize = 12;
const PROGPOW_CNT_MATH: usize = 20;
const PROGPOW_CNT_CACHE: usize = 11;
const PROGPOW_CNT_MATH: usize = 18;
const PROGPOW_CNT_DAG: usize = ETHASH_ACCESSES;
const PROGPOW_DAG_LOADS: usize = 4;
const PROGPOW_MIX_BYTES: usize = 2 * ETHASH_MIX_BYTES;
const PROGPOW_PERIOD_LENGTH: usize = 50; // blocks per progpow epoch (N)
const PROGPOW_PERIOD_LENGTH: usize = 10; // blocks per progpow epoch (N)
const PROGPOW_LANES: usize = 16;
const PROGPOW_REGS: usize = 32;

Expand Down Expand Up @@ -546,8 +546,8 @@ mod test {
&c_dag,
);

let expected_digest = FromHex::from_hex("63155f732f2bf556967f906155b510c917e48e99685ead76ea83f4eca03ab12b").unwrap();
let expected_result = FromHex::from_hex("faeb1be51075b03a4ff44b335067951ead07a3b078539ace76fd56fc410557a3").unwrap();
let expected_digest = FromHex::from_hex("b3bad9ca6f7c566cf0377d1f8cce29d6516a96562c122d924626281ec948ef02").unwrap();
let expected_result = FromHex::from_hex("f4ac202715ded4136e72887c39e63a4738331c57fd9eb79f6ec421c281aa8743").unwrap();

assert_eq!(
digest.to_vec(),
Expand Down
211 changes: 211 additions & 0 deletions ethcore/res/ethereum/ethercore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"name": "EtherCore",
"dataDir": "ethercore",
"engine": {
"Ethash": {
"params": {
"minimumDifficulty": "0x20000",
"difficultyBoundDivisor": "0x800",
"durationLimit": "0xd",
"blockReward": "0xde0b6b3a7640000",
"homesteadTransition": "0x0",
"eip100bTransition": "0x0",
"bombDefuseTransition":"0x0",
"ecip1017EraRounds":"0x5f5e100",
"progpowTransition": "0x0"
}
}
},
"params": {
"gasLimitBoundDivisor": "0x400",
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID": "0x1d2",
"eip150Transition": "0x0",
"eip160Transition": "0x0",
"eip161abcTransition": "0x0",
"eip161dTransition": "0x0",
"eip155Transition": "0x0",
"maxCodeSize":"0x6000",
"maxCodeSizeTransition":"0x0",
"eip140Transition": "0x0",
"eip211Transition": "0x0",
"eip214Transition": "0x0",
"eip658Transition": "0x0",
"eip145Transition": "0x0",
"eip1014Transition": "0x0",
"eip1052Transition": "0x0",
"eip1283Transition": "0x0",
"eip1344Transition": "0x0",
"eip1706Transition": "0x0",
"eip1884Transition": "0x0",
"eip2028Transition": "0x0"
},
"genesis": {
"seal": {
"ethereum": {
"nonce": "0x0000000000000042",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x80000",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x5e0be100",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x7a1200"
},
"nodes": [
"enode://dfcfd268e7d4631cec5a94d7eeb5981a2ed3f30235c774e1bf0a4e843672405e5a1c93502e1631edf108b6f1ea8701fb97e6d892eb5e3775c70dc53b2f773b9f@207.148.105.65:30303",
"enode://6c67afac3a018ee5641b0aba996f180fbb718aa7857174cad568b00440a43cccb1845124cd1cbe43c7ce1e95d597a3d20d175f0bf8494d875e83ec15e0f42cb4@207.148.105.65:30503"
],
"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
}
}
},
"0xbe10b":{
"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
}
}
},
"0xbe10b":{
"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
}
}
},
"0xbe10b":{
"info":"EIP 1108 transition",
"price":{
"alt_bn128_pairing":{
"base":45000,
"pair":34000
}
}
}
}
}
},
"0x0000000000000000000000000000000000000009": {
"builtin": {
"name": "blake2_f",
"activate_at": "0x0",
"pricing": {
"blake2_f": {
"gas_per_round": 1
}
}
}
},
"0xaf6F001FdB3CD98CD38A3f6C7306706D98689dF0": {
"balance": "0x295be96e64066972000000"
},
"0xf182a7D9e7789E82e362A98eBC5fCAcdC2904182": {
"balance": "0x295be96e64066972000000"
},
"0x5A23b7d2ee9dccbb7C33103d22852e1cC88548b2": {
"balance": "0xf8277896582678ac000000"
},
"0x22e0176a4aDD34A2a32B4423437B6cf23F7dc638": {
"balance": "0x6342fd08f00f6378000000"
}
}
}
1 change: 1 addition & 0 deletions ethcore/spec/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ bundle_release_spec! {
"ethereum/musicoin" => new_musicoin,
"ethereum/poacore" => new_poanet,
"ethereum/xdai" => new_xdai,
"ethereum/ethercore" => new_ethercore,
"ethereum/poasokol" => new_sokol,
"ethereum/rinkeby" => new_rinkeby,
"ethereum/ropsten" => new_ropsten,
Expand Down
2 changes: 1 addition & 1 deletion 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, mordor, ropsten, kovan, rinkeby, goerli, kotti, poasokol, testnet, evantestcore, evancore 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, ethercore, morden, mordor, ropsten, kovan, rinkeby, goerli, kotti, poasokol, testnet, evantestcore, evancore or dev.",

ARG arg_keys_path: (String) = "$BASE/keys", or |c: &Config| c.parity.as_ref()?.keys_path.clone(),
"--keys-path=[PATH]",
Expand Down
Loading

0 comments on commit 6a3713d

Please sign in to comment.