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

Update a few parity-common dependencies #9663

Merged
merged 19 commits into from
Oct 9, 2018
Merged

Conversation

dvdplm
Copy link
Collaborator

@dvdplm dvdplm commented Sep 27, 2018

Update parity-ethereum to use the latest hashdb, rlp, memorydb and patricia_trie crates. While the PR touch many files, the relevant changes are:

  1. Change the RLP return type from ElasticArrayXXX to Vec<u8>
  2. As hashdb is now generic over the DB data type, hashdb::DBValue is gone and replaced with kvdb::DBValue (wrapper for ElasticArray128<u8> for the time being)
  3. The hashdb refactorings bubble up in memorydb as well

Related to paritytech/parity-common#67

A (rather big) caveat to this PR is that recent correctness fixes in rlp broke tests in util/network-devp2p. The commits are:

  1. fix accepting non-canonical rlp packages paritytech/parity-common#60 which breaks util/network-devp2p/src/discovery.rs
  2. fix accepting malformed rlp packages paritytech/parity-common#59 which breaks 4 handshake tests: 1, 2, 3, 4

Work is under way to fix the errors and should not stop reviewers.

@dvdplm dvdplm self-assigned this Sep 27, 2018
@dvdplm dvdplm added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Sep 27, 2018
…mon-deps

* origin/master:
  ethereum libfuzzer integration small change (#9547)
  cli: remove reference to --no-ui in --unlock flag help (#9616)
  remove master from releasable branches (#9655)
  ethcore/VerificationQueue don't spawn up extra `worker-threads` when explictly specified not to (#9620)
  RPC: parity_getBlockReceipts (#9527)
  Remove unused dependencies (#9589)
  ignore key_server_cluster randomly failing tests (#9639)
  ethcore: handle vm exception when estimating gas (#9615)
  fix bad-block reporting no reason (#9638)
  Use static call and apparent value transfer for block reward contract code (#9603)
  HF in POA Sokol (2018-09-19) (#9607)
  bump smallvec to 0.6 in ethcore-light, ethstore and whisper (#9588)
  Add constantinople conf to EvmTestClient. (#9570)
@5chdn 5chdn added this to the 2.2 milestone Sep 27, 2018
ethcore/light/Cargo.toml Outdated Show resolved Hide resolved
@@ -210,7 +205,7 @@ fn test_errors() {
assert_eq!(DisconnectReason::Unknown, r);

match *<Error as From<rlp::DecoderError>>::from(rlp::DecoderError::RlpIsTooBig).kind() {
ErrorKind::Auth => {},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice; I was pretty baffled by the Auth error, didn't really make sense.

@dvdplm
Copy link
Collaborator Author

dvdplm commented Sep 28, 2018

@debris unfortunately it looks like we now have a new error in ethcore. :/

@debris
Copy link
Collaborator

debris commented Oct 1, 2018

I'm working on it

let result = SyncHandler::on_peer_new_block(&mut sync, &mut io, 0, &block);

assert!(result.is_ok());
SyncHandler::on_peer_new_block(&mut sync, &mut io, 0, &block).expect("result to be ok");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer using an assert here like before: it's easier to spot what the test is doing if I can scan the code and look for the assert. Just a personal preference, but yeah, please consider it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem with assert!(result.is_ok() is that it gives no information what went wrong. It will report only expected true to be equal false, whereas expect will use fmt::Debug to print unwrapped error

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, didn't think about that. Fine by me then.

@@ -1183,7 +1183,7 @@ pub mod tests {
}

pub fn get_dummy_blocks(order: u32, parent_hash: H256) -> Bytes {
let mut rlp = RlpStream::new_list(1);
let mut rlp = RlpStream::new_list(2);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this was it? Our test was wrong the whole time? :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes :(

…mon-deps

* origin/master:
  CI: Remove unnecessary pipes (#9681)
  test.sh: use cargo --target for platforms other than linux, win or mac (#9650)
  ci: fix push script (#9679)
  Hardfork the testnets (#9562)
  Calculate sha3 instead of sha256 for push-release. (#9673)
  ethcore-io retries failed work steal (#9651)
  fix(light_fetch): avoid race with BlockNumber::Latest (#9665)
  Test fix for windows cache name... (#9658)
  refactor(fetch) : light use only one `DNS` thread (#9647)
…arity-ethereum into dp/chore/update-common-deps

* 'dp/chore/update-common-deps' of github.com:paritytech/parity-ethereum:
  fix util function get_dummy_blocks
…mon-deps

* origin/master:
  Add a new RPC `parity_submitWorkDetail` similar `eth_submitWork` but return block hash (#9404)
  Resumable EVM and heap-allocated callstack (#9360)
  update parity-wordlist library (#9682)
…mon-deps

* origin/master:
  Add Foundation Bootnodes (#9666)
  Docker: run as parity user (#9689)
  ethcore: mcip3 block reward contract (#9605)
  Verify block syncing responses against requests (#9670)
@debris debris added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Oct 4, 2018
Copy link
Collaborator

@ordian ordian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the plan is to merge paritytech/parity-common#67 first with proper versions (w/o beta), should we put this on ice to avoid accidental merge?

@@ -112,6 +112,7 @@ impl OverlayDB {
return Err(error_negatively_reference_hash(&key));
}
let payload = Payload::new(total_rc as u32, x.value);
// let payload = Payload::new(total_rc as u32, x.value.clone());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented out code

@dvdplm
Copy link
Collaborator Author

dvdplm commented Oct 8, 2018

@ordian sure, good idea. Feel free to review anyway ofc.

@dvdplm dvdplm added the A1-onice 🌨 Pull request is reviewed well, but should not yet be merged. label Oct 8, 2018
…mon-deps

* origin/master:
  fix (light/provider) : Make `read_only executions` read-only (#9591)
  ethcore: fix detection of major import (#9552)
  return 0 on error (#9705)
  ethcore: delay ropsten hardfork (#9704)
  make instantSeal engine backwards compatible, closes #9696 (#9700)
  Implement CREATE2 gas changes and fix some potential overflowing (#9694)
  Don't hash the init_code of CREATE. (#9688)
  ethcore: minor optimization of modexp by using LR exponentiation (#9697)
  removed redundant clone before each block import (#9683)
…mon-deps

* origin/master:
  Schedule nightly builds (#9717)
  Fix ancient blocks sync (#9531)
  CI: Skip docs job for nightly (#9693)
@ordian ordian removed the A1-onice 🌨 Pull request is reviewed well, but should not yet be merged. label Oct 9, 2018
hashdb = "0.2.1"
memorydb = "0.2.1"
patricia-trie = "0.2"
hashdb = "0.3.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why double space before = here and below?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I can't grep so well. Sigh. Fixing.

@debris debris merged commit c313039 into master Oct 9, 2018
@debris debris deleted the dp/chore/update-common-deps branch October 9, 2018 20:07
niklasad1 pushed a commit that referenced this pull request Dec 12, 2018
* Update a few parity-common dependencies

* cleanup

* cleanup

* revert update of ethereum/tests

* better reporting of network rlp errors

* Use rlp 0.3.0-beta.1

* fix util function get_dummy_blocks

* Already a Vec

* encode_list returns vec already

* Address grumble

* No need for betas

* Fix double spaces
@Tbaut Tbaut mentioned this pull request Dec 12, 2018
7 tasks
Tbaut added a commit that referenced this pull request Dec 13, 2018
* bump stable to 2.1.10

* RPC: parity_getBlockReceipts (#9527)

* Block receipts RPC.

* Use lazy evaluation of block receipts (ecrecover).

* Optimize transaction_receipt to prevent performance regression.

* Fix RPC grumbles.

* Add block & transaction receipt tests.

* Fix conversion to block id.

* Update a few parity-common dependencies (#9663)

* Update a few parity-common dependencies

* cleanup

* cleanup

* revert update of ethereum/tests

* better reporting of network rlp errors

* Use rlp 0.3.0-beta.1

* fix util function get_dummy_blocks

* Already a Vec

* encode_list returns vec already

* Address grumble

* No need for betas

* Fix double spaces

* 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)

* Bump crossbeam. (#10048)

* Revert "Bump crossbeam. (#10048)"

This reverts commit ed1db0c.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants