diff --git a/ethcore/res/ethereum/expanse.json b/ethcore/res/ethereum/expanse.json index ec7e737ead6..8b59a23954f 100644 --- a/ethcore/res/ethereum/expanse.json +++ b/ethcore/res/ethereum/expanse.json @@ -16,7 +16,12 @@ "eip150Transition": "0x927C0", "eip160Transition": "0x927C0", "eip161abcTransition": "0x927C0", - "eip161dTransition": "0x927C0" + "eip161dTransition": "0x927C0", + "eip649Reward": "0x3782DACE9D900000", + "eip100bTransition": 800000, + "eip649Transition": 800000, + "expip2DurationLimit": "0x1E", + "expip2Transition": 800000 } } }, @@ -31,7 +36,11 @@ "subprotocolName": "exp", "eip98Transition": "0x7fffffffffffff", "eip86Transition": "0x7fffffffffffff", - "eip155Transition": "0x927C0" + "eip155Transition": "0x927C0", + "eip140Transition": 800000, + "eip211Transition": 800000, + "eip214Transition": 800000, + "eip658Transition": 800000 }, "genesis": { "seal": { @@ -61,6 +70,10 @@ "0000000000000000000000000000000000000002": { "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, "0000000000000000000000000000000000000003": { "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, "0000000000000000000000000000000000000004": { "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, + "0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": 800000, "pricing": { "modexp": { "divisor": 20 } } } }, + "0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": 800000, "pricing": { "linear": { "base": 500, "word": 0 } } } }, + "0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": 800000, "pricing": { "linear": { "base": 40000, "word": 0 } } } }, + "0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": 800000, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } }, "bb94f0ceb32257275b2a7a9c094c13e469b4563e": { "balance": "10000000000000000000000000" }, diff --git a/ethcore/src/ethereum/ethash.rs b/ethcore/src/ethereum/ethash.rs index 9548fe5113e..fde38449cca 100644 --- a/ethcore/src/ethereum/ethash.rs +++ b/ethcore/src/ethereum/ethash.rs @@ -90,6 +90,10 @@ pub struct EthashParams { pub eip649_delay: u64, /// EIP-649 base reward. pub eip649_reward: Option, + /// EXPIP-2 duration limit + pub expip2_duration_limit: u64, + /// EXPIP-2 block height + pub expip2_transition: u64, } impl From for EthashParams { @@ -355,7 +359,14 @@ impl Ethash { self.ethash_params.difficulty_bound_divisor }; - let duration_limit = self.ethash_params.duration_limit; + let expip2_hardfork = header.number() > self.ethash_params.expip2_transition; + + let duration_limit = if expip2_hardfork { + self.ethash_params.expip2_duration_limit + }else{ + self.ethash_params.duration_limit + } + let frontier_limit = self.ethash_params.homestead_transition; let mut target = if header.number() < frontier_limit { @@ -520,7 +531,7 @@ mod tests { let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, start_reward, block_number); assert_eq!(15, eras); assert_eq!(U256::from_str("271000000000000").unwrap(), reward); - + let block_number = 250000000; let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, start_reward, block_number); assert_eq!(49, eras);