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

Commit

Permalink
Backports for beta 2.2.5 (#10047)
Browse files Browse the repository at this point in the history
* bump beta to 2.2.5

* Fix empty steps (#9939)

* Don't send empty step twice or empty step then block.

* Perform basic validation of locally sealed blocks.

* Don't include empty step twice.

* Strict empty steps validation (#10041)

* Add two failings tests for strict empty steps.

* Implement strict validation of empty steps.

* ethcore: enable constantinople on ethereum (#10031)

* ethcore: change blockreward to 2e18 for foundation after constantinople

* ethcore: delay diff bomb by 2e6 blocks for foundation after constantinople

* ethcore: enable eip-{145,1014,1052,1283} for foundation after constantinople

* Change test miner max memory to malloc reports. (#10024)

* Fix: test corpus_inaccessible panic (#10019)

If system uptime is less than the duration in the test, thread
will panic due to: 'overflow when subtracting duration from instant'.

Changed duration to 20 seconds to make it unlikely the test will
fail due to this condition.

Since no operations that carry a similar risk of panic occur outside
of the tests, it doesn't seem warranted to depend on an external crate
to fix this.

* Bump crossbeam. (#10048)
  • Loading branch information
Tbaut committed Dec 13, 2018
1 parent f44d885 commit 7fbcdfe
Show file tree
Hide file tree
Showing 13 changed files with 292 additions and 166 deletions.
70 changes: 61 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -2,7 +2,7 @@
description = "Parity Ethereum client"
name = "parity-ethereum"
# NOTE Make sure to update util/version/Cargo.toml as well
version = "2.2.4"
version = "2.2.5"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]

Expand Down
2 changes: 1 addition & 1 deletion ethcore/Cargo.toml
Expand Up @@ -12,7 +12,7 @@ blooms-db = { path = "../util/blooms-db" }
bn = { git = "https://github.com/paritytech/bn", default-features = false }
byteorder = "1.0"
common-types = { path = "types" }
crossbeam = "0.3"
crossbeam = "0.4"
ethash = { path = "../ethash" }
ethcore-bloom-journal = { path = "../util/bloom" }
parity-bytes = "0.1"
Expand Down
5 changes: 3 additions & 2 deletions ethcore/light/src/cache.rs
Expand Up @@ -179,14 +179,15 @@ mod tests {

#[test]
fn corpus_inaccessible() {
let mut cache = Cache::new(Default::default(), Duration::from_secs(5 * 3600));
let duration = Duration::from_secs(20);
let mut cache = Cache::new(Default::default(), duration.clone());

cache.set_gas_price_corpus(vec![].into());
assert_eq!(cache.gas_price_corpus(), Some(vec![].into()));

{
let corpus_time = &mut cache.corpus.as_mut().unwrap().1;
*corpus_time = *corpus_time - Duration::from_secs(6 * 3600);
*corpus_time = *corpus_time - duration;
}
assert!(cache.gas_price_corpus().is_none());
}
Expand Down
12 changes: 9 additions & 3 deletions ethcore/res/ethereum/foundation.json
Expand Up @@ -9,7 +9,8 @@
"durationLimit": "0x0d",
"blockReward": {
"0": "0x4563918244F40000",
"4370000": "0x29A2241AF62C0000"
"4370000": "0x29A2241AF62C0000",
"7080000": "0x1BC16D674EC80000"
},
"homesteadTransition": "0x118c30",
"daoHardforkTransition": "0x1d4c00",
Expand Down Expand Up @@ -134,7 +135,8 @@
],
"eip100bTransition": 4370000,
"difficultyBombDelays": {
"4370000": 3000000
"4370000": 3000000,
"7080000": 2000000
}
}
}
Expand All @@ -159,7 +161,11 @@
"eip140Transition": 4370000,
"eip211Transition": 4370000,
"eip214Transition": 4370000,
"eip658Transition": 4370000
"eip658Transition": 4370000,
"eip145Transition": 7080000,
"eip1014Transition": 7080000,
"eip1052Transition": 7080000,
"eip1283Transition": 7080000
},
"genesis": {
"seal": {
Expand Down
15 changes: 6 additions & 9 deletions ethcore/src/client/client.rs
Expand Up @@ -2305,11 +2305,7 @@ impl ScheduleInfo for Client {
impl ImportSealedBlock for Client {
fn import_sealed_block(&self, block: SealedBlock) -> EthcoreResult<H256> {
let start = Instant::now();
let raw = block.rlp_bytes();
let header = block.header().clone();
let hash = header.hash();
self.notify(|n| n.block_pre_import(&raw, &hash, header.difficulty()));

let route = {
// Do a super duper basic verification to detect potential bugs
if let Err(e) = self.engine.verify_block_basic(&header) {
Expand All @@ -2327,31 +2323,32 @@ impl ImportSealedBlock for Client {
let block_data = block.rlp_bytes();

let route = self.importer.commit_block(block, &header, encoded::Block::new(block_data), self);
trace!(target: "client", "Imported sealed block #{} ({})", header.number(), hash);
trace!(target: "client", "Imported sealed block #{} ({})", header.number(), header.hash());
self.state_db.write().sync_cache(&route.enacted, &route.retracted, false);
route
};
let h = header.hash();
let route = ChainRoute::from([route].as_ref());
self.importer.miner.chain_new_blocks(
self,
&[hash],
&[h],
&[],
route.enacted(),
route.retracted(),
self.engine.seals_internally().is_some(),
);
self.notify(|notify| {
notify.new_blocks(
vec![hash],
vec![h],
vec![],
route.clone(),
vec![hash],
vec![h],
vec![],
start.elapsed(),
);
});
self.db.read().key_value().flush().expect("DB flush failed.");
Ok(hash)
Ok(h)
}
}

Expand Down

0 comments on commit 7fbcdfe

Please sign in to comment.