From 4e39c318aae48e16594a03f77a9254c705853b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Fri, 8 Dec 2017 13:08:15 +0100 Subject: [PATCH] [beta] Kovan HF (#7234) * Kovan HF. * Bump version. * Fix aura difficulty race (#7198) * Fix Aura difficulty race * fix test key * extract out score calculation * fix build * Update kovan HF block number. * Add missing byzantium builtins. * Bump installers versions. * Increase allowed time drift to 10s. (#7238) --- Cargo.lock | 52 ++++++++--------- Cargo.toml | 2 +- dapps/node-health/src/time.rs | 2 +- ethcore/res/ethereum/kovan.json | 14 ++++- ethcore/src/engines/authority_round/mod.rs | 67 +++++++++++++++++++--- ethcore/src/engines/basic_authority.rs | 4 +- ethcore/src/engines/instant_seal.rs | 4 +- ethcore/src/engines/mod.rs | 2 +- ethcore/src/engines/tendermint/mod.rs | 4 +- ethcore/src/miner/miner.rs | 8 ++- mac/Parity.pkgproj | 2 +- nsis/installer.nsi | 2 +- util/Cargo.toml | 2 +- 13 files changed, 114 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9368a859..e8a79dc40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -360,7 +360,7 @@ dependencies = [ "bloomable 0.1.0", "ethcore-bigint 0.1.3", "ethcore-bytes 0.1.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethjson 0.1.0", "hash 0.1.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -574,7 +574,7 @@ dependencies = [ "ethcore-ipc-nano 1.8.0", "ethcore-logger 1.8.0", "ethcore-stratum 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethjson 0.1.0", "ethkey 0.2.0", "ethstore 0.1.0", @@ -668,7 +668,7 @@ version = "1.8.0" dependencies = [ "ethcore-bigint 0.1.3", "ethcore-devtools 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "nanomsg 0.5.1 (git+https://github.com/paritytech/nanomsg.rs.git?branch=parity-1.7)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -718,7 +718,7 @@ dependencies = [ "ethcore-ipc 1.8.0", "ethcore-ipc-codegen 1.8.0", "ethcore-ipc-nano 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "nanomsg 0.5.1 (git+https://github.com/paritytech/nanomsg.rs.git?branch=parity-1.7)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -737,7 +737,7 @@ dependencies = [ "ethcore-ipc 1.8.0", "ethcore-ipc-codegen 1.8.0", "ethcore-network 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "evm 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", @@ -787,7 +787,7 @@ dependencies = [ "ethcore-devtools 1.8.0", "ethcore-io 1.8.0", "ethcore-logger 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethcrypto 0.1.0", "ethkey 0.2.0", "hash 0.1.0", @@ -822,7 +822,7 @@ dependencies = [ "ethcore-ipc-codegen 1.8.0", "ethcore-ipc-nano 1.8.0", "ethcore-logger 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethcrypto 0.1.0", "ethkey 0.2.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -857,7 +857,7 @@ dependencies = [ "ethcore-ipc-codegen 1.8.0", "ethcore-ipc-nano 1.8.0", "ethcore-logger 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "hash 0.1.0", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.8)", "jsonrpc-macros 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.8)", @@ -870,7 +870,7 @@ dependencies = [ [[package]] name = "ethcore-util" -version = "1.8.3" +version = "1.8.4" dependencies = [ "clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "elastic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1004,7 +1004,7 @@ dependencies = [ "ethcore-ipc-nano 1.8.0", "ethcore-light 1.8.0", "ethcore-network 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethkey 0.2.0", "hash 0.1.0", "heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1030,7 +1030,7 @@ dependencies = [ "common-types 0.1.0", "ethcore-bigint 0.1.3", "ethcore-logger 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethjson 0.1.0", "evmjit 1.8.0", "hash 0.1.0", @@ -1052,7 +1052,7 @@ dependencies = [ "ethcore 1.8.0", "ethcore-bigint 0.1.3", "ethcore-bytes 0.1.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethjson 0.1.0", "evm 0.1.0", "panic_hook 0.1.0", @@ -1350,7 +1350,7 @@ dependencies = [ "ethcore-bigint 0.1.3", "ethcore-ipc 1.8.0", "ethcore-ipc-codegen 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1843,7 +1843,7 @@ dependencies = [ "ethcore-bytes 0.1.0", "ethcore-io 1.8.0", "ethcore-network 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2042,7 +2042,7 @@ dependencies = [ [[package]] name = "parity" -version = "1.8.3" +version = "1.8.4" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2066,7 +2066,7 @@ dependencies = [ "ethcore-network 1.8.0", "ethcore-secretstore 1.0.0", "ethcore-stratum 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethkey 0.2.0", "ethsync 1.8.0", "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2122,7 +2122,7 @@ dependencies = [ "ethcore-bigint 0.1.3", "ethcore-bytes 0.1.0", "ethcore-devtools 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "fetch 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2184,7 +2184,7 @@ dependencies = [ "ethabi 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.1.3", "ethcore-bytes 0.1.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "fetch 0.1.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "hash 0.1.0", @@ -2206,7 +2206,7 @@ dependencies = [ "ethcore 1.8.0", "ethcore-bigint 0.1.3", "ethcore-bytes 0.1.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "jsonrpc-core 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.8)", "jsonrpc-http-server 8.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.8)", "multihash 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2220,7 +2220,7 @@ version = "0.1.0" dependencies = [ "ethcore 1.8.0", "ethcore-io 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethkey 0.2.0", "kvdb 0.1.0", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2235,7 +2235,7 @@ name = "parity-machine" version = "0.1.0" dependencies = [ "ethcore-bigint 0.1.3", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", ] [[package]] @@ -2263,7 +2263,7 @@ dependencies = [ "ethcore-light 1.8.0", "ethcore-logger 1.8.0", "ethcore-network 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethcrypto 0.1.0", "ethjson 0.1.0", "ethkey 0.2.0", @@ -2373,7 +2373,7 @@ dependencies = [ "ethcore-bytes 0.1.0", "ethcore-ipc 1.8.0", "ethcore-ipc-codegen 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethsync 1.8.0", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-common-types 1.8.0", @@ -2835,7 +2835,7 @@ name = "rpc-cli" version = "1.4.0" dependencies = [ "bigint 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "futures 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "parity-rpc 1.8.0", "parity-rpc-client 1.4.0", @@ -3551,7 +3551,7 @@ dependencies = [ "common-types 0.1.0", "ethcore-bigint 0.1.3", "ethcore-bytes 0.1.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "ethjson 0.1.0", "evmjit 1.8.0", "hash 0.1.0", @@ -3573,7 +3573,7 @@ dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore-bigint 0.1.3", "ethcore-logger 1.8.0", - "ethcore-util 1.8.3", + "ethcore-util 1.8.4", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)", "vm 0.1.0", diff --git a/Cargo.toml b/Cargo.toml index 161a24e1b..33c053ef4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] description = "Parity Ethereum client" name = "parity" -version = "1.8.3" +version = "1.8.4" license = "GPL-3.0" authors = ["Parity Technologies "] build = "build.rs" diff --git a/dapps/node-health/src/time.rs b/dapps/node-health/src/time.rs index 78f1fdd5f..c3da050a4 100644 --- a/dapps/node-health/src/time.rs +++ b/dapps/node-health/src/time.rs @@ -193,7 +193,7 @@ const UPDATE_TIMEOUT_ERR_SECS: u64 = 60; const UPDATE_TIMEOUT_INCOMPLETE_SECS: u64 = 10; /// Maximal valid time drift. -pub const MAX_DRIFT: i64 = 500; +pub const MAX_DRIFT: i64 = 10_000; type BoxFuture = Box + Send>; diff --git a/ethcore/res/ethereum/kovan.json b/ethcore/res/ethereum/kovan.json index 7ce019ee8..877713521 100644 --- a/ethcore/res/ethereum/kovan.json +++ b/ethcore/res/ethereum/kovan.json @@ -24,8 +24,8 @@ }, "validateScoreTransition": 1000000, "validateStepTransition": 1500000, - "maximumUncleCountTransition": 10000000, - "maximumUncleCount": 2 + "maximumUncleCountTransition": 5100000, + "maximumUncleCount": 0 } } }, @@ -39,7 +39,11 @@ "forkCanonHash": "0x0a66d93c2f727dca618fabaf70c39b37018c73d78b939d8b11efbbd09034778f", "validateReceiptsTransition" : 1000000, "eip155Transition": 1000000, - "validateChainIdTransition": 1000000 + "validateChainIdTransition": 1000000, + "eip140Transition": 5100000, + "eip211Transition": 5100000, + "eip214Transition": 5100000, + "eip658Transition": 5100000 }, "genesis": { "seal": { @@ -56,6 +60,10 @@ "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": 5100000, "pricing": { "modexp": { "divisor": 20 } } } }, + "0x0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": 5100000, "pricing": { "linear": { "base": 500, "word": 0 } } } }, + "0x0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": 5100000, "pricing": { "linear": { "base": 40000, "word": 0 } } } }, + "0x0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": 5100000, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } }, "0x00521965e7bd230323c423d96c657db5b79d099f": { "balance": "1606938044258990275541962092341162602522202993782792835301376" } }, "nodes": [ diff --git a/ethcore/src/engines/authority_round/mod.rs b/ethcore/src/engines/authority_round/mod.rs index c0d607e98..1f3226920 100644 --- a/ethcore/src/engines/authority_round/mod.rs +++ b/ethcore/src/engines/authority_round/mod.rs @@ -126,6 +126,11 @@ impl Step { } } +// Chain scoring: total weight is sqrt(U256::max_value())*height - step +fn calculate_score(parent_step: U256, current_step: U256) -> U256 { + U256::from(U128::max_value()) + parent_step - current_step +} + struct EpochManager { epoch_transition_hash: H256, epoch_transition_number: BlockNumber, @@ -456,12 +461,13 @@ impl Engine for AuthorityRound { } fn populate_from_parent(&self, header: &mut Header, parent: &Header) { - // Chain scoring: total weight is sqrt(U256::max_value())*height - step - let new_difficulty = U256::from(U128::max_value()) + header_step(parent).expect("Header has been verified; qed").into() - self.step.load().into(); - header.set_difficulty(new_difficulty); + let parent_step = header_step(parent).expect("Header has been verified; qed"); + let score = calculate_score(parent_step.into(), self.step.load().into()); + header.set_difficulty(score); } fn seals_internally(&self) -> Option { + // TODO: accept a `&Call` here so we can query the validator set. Some(self.signer.read().is_some()) } @@ -469,13 +475,21 @@ impl Engine for AuthorityRound { /// /// This operation is synchronous and may (quite reasonably) not be available, in which case /// `Seal::None` will be returned. - fn generate_seal(&self, block: &ExecutedBlock) -> Seal { + fn generate_seal(&self, block: &ExecutedBlock, parent: &Header) -> Seal { // first check to avoid generating signature most of the time // (but there's still a race to the `compare_and_swap`) if !self.can_propose.load(AtomicOrdering::SeqCst) { return Seal::None; } let header = block.header(); + let parent_step: U256 = header_step(parent) + .expect("Header has been verified; qed").into(); + let step = self.step.load(); + let expected_diff = calculate_score(parent_step, step.into()); + + if header.difficulty() != &expected_diff { + return Seal::None; + } // fetch correct validator set for current epoch, taking into account // finality of previous transitions. @@ -517,6 +531,7 @@ impl Engine for AuthorityRound { trace!(target: "engine", "generate_seal: {} not a proposer for step {}.", header.author(), step); } + Seal::None } @@ -558,7 +573,7 @@ impl Engine for AuthorityRound { } /// Check the number of seal fields. - fn verify_block_basic(&self, header: &Header,) -> Result<(), Error> { + fn verify_block_basic(&self, header: &Header) -> Result<(), Error> { if header.number() >= self.validate_score_transition && *header.difficulty() >= U256::from(U128::max_value()) { Err(From::from(BlockError::DifficultyOutOfBounds( OutOfBounds { min: None, max: Some(U256::from(U128::max_value())), found: *header.difficulty() } @@ -869,17 +884,51 @@ mod tests { let b2 = b2.close_and_lock(); engine.set_signer(tap.clone(), addr1, "1".into()); - if let Seal::Regular(seal) = engine.generate_seal(b1.block()) { + if let Seal::Regular(seal) = engine.generate_seal(b1.block(), &genesis_header) { assert!(b1.clone().try_seal(engine, seal).is_ok()); // Second proposal is forbidden. - assert!(engine.generate_seal(b1.block()) == Seal::None); + assert!(engine.generate_seal(b1.block(), &genesis_header) == Seal::None); } engine.set_signer(tap, addr2, "2".into()); - if let Seal::Regular(seal) = engine.generate_seal(b2.block()) { + if let Seal::Regular(seal) = engine.generate_seal(b2.block(), &genesis_header) { assert!(b2.clone().try_seal(engine, seal).is_ok()); // Second proposal is forbidden. - assert!(engine.generate_seal(b2.block()) == Seal::None); + assert!(engine.generate_seal(b2.block(), &genesis_header) == Seal::None); + } + } + + #[test] + fn checks_difficulty_in_generate_seal() { + let tap = Arc::new(AccountProvider::transient_provider()); + let addr1 = tap.insert_account(keccak("1").into(), "1").unwrap(); + let addr2 = tap.insert_account(keccak("0").into(), "0").unwrap(); + + let spec = Spec::new_test_round(); + let engine = &*spec.engine; + + let genesis_header = spec.genesis_header(); + let db1 = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap(); + let db2 = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap(); + let last_hashes = Arc::new(vec![genesis_header.hash()]); + + let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false).unwrap(); + let b1 = b1.close_and_lock(); + let b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes, addr2, (3141562.into(), 31415620.into()), vec![], false).unwrap(); + let b2 = b2.close_and_lock(); + + engine.set_signer(tap.clone(), addr1, "1".into()); + match engine.generate_seal(b1.block(), &genesis_header) { + Seal::None | Seal::Proposal(_) => panic!("wrong seal"), + Seal::Regular(_) => { + engine.step(); + + engine.set_signer(tap.clone(), addr2, "0".into()); + match engine.generate_seal(b2.block(), &genesis_header) { + Seal::Regular(_) | Seal::Proposal(_) => panic!("sealed despite wrong difficulty"), + Seal::None => {} + } + } } } diff --git a/ethcore/src/engines/basic_authority.rs b/ethcore/src/engines/basic_authority.rs index b0d30b6ee..8aedbff72 100644 --- a/ethcore/src/engines/basic_authority.rs +++ b/ethcore/src/engines/basic_authority.rs @@ -107,7 +107,7 @@ impl Engine for BasicAuthority { } /// Attempt to seal the block internally. - fn generate_seal(&self, block: &ExecutedBlock) -> Seal { + fn generate_seal(&self, block: &ExecutedBlock, _parent: &Header) -> Seal { let header = block.header(); let author = header.author(); if self.validators.contains(header.parent_hash(), author) { @@ -251,7 +251,7 @@ mod tests { let last_hashes = Arc::new(vec![genesis_header.hash()]); let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, addr, (3141562.into(), 31415620.into()), vec![], false).unwrap(); let b = b.close_and_lock(); - if let Seal::Regular(seal) = engine.generate_seal(b.block()) { + if let Seal::Regular(seal) = engine.generate_seal(b.block(), &genesis_header) { assert!(b.try_seal(engine, seal).is_ok()); } } diff --git a/ethcore/src/engines/instant_seal.rs b/ethcore/src/engines/instant_seal.rs index a0700099d..6c6aef415 100644 --- a/ethcore/src/engines/instant_seal.rs +++ b/ethcore/src/engines/instant_seal.rs @@ -43,7 +43,7 @@ impl Engine for InstantSeal fn seals_internally(&self) -> Option { Some(true) } - fn generate_seal(&self, block: &M::LiveBlock) -> Seal { + fn generate_seal(&self, block: &M::LiveBlock, _parent: &M::Header) -> Seal { if block.transactions().is_empty() { Seal::None } else { Seal::Regular(Vec::new()) } } @@ -72,7 +72,7 @@ mod tests { let last_hashes = Arc::new(vec![genesis_header.hash()]); let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::default(), (3141562.into(), 31415620.into()), vec![], false).unwrap(); let b = b.close_and_lock(); - if let Seal::Regular(seal) = engine.generate_seal(b.block()) { + if let Seal::Regular(seal) = engine.generate_seal(b.block(), &genesis_header) { assert!(b.try_seal(engine, seal).is_ok()); } } diff --git a/ethcore/src/engines/mod.rs b/ethcore/src/engines/mod.rs index 5ec1b77ac..9c7538207 100644 --- a/ethcore/src/engines/mod.rs +++ b/ethcore/src/engines/mod.rs @@ -226,7 +226,7 @@ pub trait Engine: Sync + Send { /// /// It is fine to require access to state or a full client for this function, since /// light clients do not generate seals. - fn generate_seal(&self, _block: &M::LiveBlock) -> Seal { Seal::None } + fn generate_seal(&self, _block: &M::LiveBlock, _parent: &M::Header) -> Seal { Seal::None } /// Verify a locally-generated seal of a header. /// diff --git a/ethcore/src/engines/tendermint/mod.rs b/ethcore/src/engines/tendermint/mod.rs index ac43acc09..fcd5437b7 100644 --- a/ethcore/src/engines/tendermint/mod.rs +++ b/ethcore/src/engines/tendermint/mod.rs @@ -483,7 +483,7 @@ impl Engine for Tendermint { /// /// This operation is synchronous and may (quite reasonably) not be available, in which case /// `Seal::None` will be returned. - fn generate_seal(&self, block: &ExecutedBlock) -> Seal { + fn generate_seal(&self, block: &ExecutedBlock, _parent: &Header) -> Seal { let header = block.header(); let author = header.author(); // Only proposer can generate seal if None was generated. @@ -805,7 +805,7 @@ mod tests { let last_hashes = Arc::new(vec![genesis_header.hash()]); let b = OpenBlock::new(spec.engine.as_ref(), Default::default(), false, db.boxed_clone(), &genesis_header, last_hashes, proposer, (3141562.into(), 31415620.into()), vec![], false).unwrap(); let b = b.close(); - if let Seal::Proposal(seal) = spec.engine.generate_seal(b.block()) { + if let Seal::Proposal(seal) = spec.engine.generate_seal(b.block(), &genesis_header) { (b, seal) } else { panic!() diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index 324619273..444404ade 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -525,7 +525,13 @@ impl Miner { fn seal_and_import_block_internally(&self, chain: &MiningBlockChainClient, block: ClosedBlock) -> bool { if !block.transactions().is_empty() || self.forced_sealing() || Instant::now() > *self.next_mandatory_reseal.read() { trace!(target: "miner", "seal_block_internally: attempting internal seal."); - match self.engine.generate_seal(block.block()) { + + let parent_header = match chain.block_header(BlockId::Hash(*block.header().parent_hash())) { + Some(hdr) => hdr.decode(), + None => return false, + }; + + match self.engine.generate_seal(block.block(), &parent_header) { // Save proposal for later seal submission and broadcast it. Seal::Proposal(seal) => { trace!(target: "miner", "Received a Proposal seal."); diff --git a/mac/Parity.pkgproj b/mac/Parity.pkgproj index a04116dda..7e80b8210 100755 --- a/mac/Parity.pkgproj +++ b/mac/Parity.pkgproj @@ -462,7 +462,7 @@ OVERWRITE_PERMISSIONS VERSION - 1.8.3 + 1.8.4 UUID 2DCD5B81-7BAF-4DA1-9251-6274B089FD36 diff --git a/nsis/installer.nsi b/nsis/installer.nsi index 6a9c2a287..56c392d5b 100644 --- a/nsis/installer.nsi +++ b/nsis/installer.nsi @@ -10,7 +10,7 @@ !define DESCRIPTION "Fast, light, robust Ethereum implementation" !define VERSIONMAJOR 1 !define VERSIONMINOR 8 -!define VERSIONBUILD 3 +!define VERSIONBUILD 4 !define ARGS "" !define FIRST_START_ARGS "--mode=passive ui" diff --git a/util/Cargo.toml b/util/Cargo.toml index 197d3ce83..4b6d7d1b4 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -3,7 +3,7 @@ description = "Ethcore utility library" homepage = "http://parity.io" license = "GPL-3.0" name = "ethcore-util" -version = "1.8.3" +version = "1.8.4" authors = ["Parity Technologies "] build = "build.rs"