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

Fetch parity-common crates from crates.io #9410

Merged
merged 28 commits into from
Sep 4, 2018

Conversation

dvdplm
Copy link
Collaborator

@dvdplm dvdplm commented Aug 24, 2018

Also removes transaction-pool and trace-time which now are in parity-common (and published).

Blocked on crate ownership issues: plain_hasher (cc @debris)

Blocked on https://github.com/paritytech/ethabi/pull/117 (also see https://github.com/paritytech/ethabi/issues/118)

Blocked on paritytech/rust-rocksdb#16

@dvdplm dvdplm self-assigned this Aug 24, 2018
@dvdplm dvdplm added A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. M5-dependencies 🖇 Dependencies. F5-task 🎬 Generic label for things that just have to get done but are no issues in first place. labels Aug 24, 2018
@sorpaas
Copy link
Collaborator

sorpaas commented Aug 24, 2018

I would worry about "atomic PR" issues, like the one we faced in #9257.

Have we considered the git submodule approach?

@dvdplm
Copy link
Collaborator Author

dvdplm commented Aug 24, 2018

Have we considered the git submodule approach?

I for one really (really) dislike git submodules and I think once we're "over the hump" and all parity-common crates are published we'll be mostly fine. I think we overdid it a little on #9257 tbh.

@5chdn 5chdn added this to the 2.1 milestone Aug 24, 2018
* master:
  evmbin: Fix gas_used issue in state root mismatch and handle output better (#9418)
  Update hardcoded sync (#9421)
  Add block reward contract config to ethash and allow off-chain contracts (#9312)
  Private packets verification and queue refactoring (#8715)
  Update tobalaba.json (#9419)
  docs: add parity ethereum logo to readme (#9415)
  build: update rocksdb crate (#9414)
  Updating the CI system  (#8765)
  Better support for eth_getLogs in light mode (#9186)
  Add update docs script to CI (#9219)
  `gasleft` extern implemented for WASM runtime (kip-6) (#9357)
  block view! removal in progress (#9397)
  Prevent sync restart if import queue full (#9381)
  nonroot CentOS Docker image (#9280)
  ethcore: kovan: delay activation of strict score validation (#9406)
@5chdn 5chdn removed the F5-task 🎬 Generic label for things that just have to get done but are no issues in first place. label Aug 30, 2018
@dvdplm dvdplm added A0-pleasereview 🤓 Pull request needs code review. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels Aug 30, 2018
* master:
  evmbin: escape newlines in json errors (#9458)
  use kvdb-* and parity-snappy crates from crates.io (#9441)
  Add EIP-1014 transition config flag (#9268)
  add tags for runner selection of build-linux jobs (#9451)
  Remove unused BlockStatus::Pending (#9447)
  ci: only include local paths in coverage script (except target) (#9437)
  Add POA Networks: Core and Sokol (#9413)
  docker: install missing dependencies in arm target dockerfiles (#9436)
  Random small cleanups (#9423)
registrar/src/registrar.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

LGTM! Just minor style grumbles. Feel free to ignore the missing newlines if you don't fancy it. Building a binary out of this branch just to perform a smoke test.

@@ -795,7 +795,7 @@ impl<Cost: CostType> Interpreter<Cost> {
TWO_POW_96 => a >> 96,
TWO_POW_224 => a >> 224,
TWO_POW_248 => a >> 248,
_ => a.overflowing_div(b).0,
_ => a/b,
Copy link
Contributor

Choose a reason for hiding this comment

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

a / b?

Copy link
Collaborator

Choose a reason for hiding this comment

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

why is it changed?

Copy link
Collaborator

@sorpaas sorpaas Sep 4, 2018

Choose a reason for hiding this comment

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

@dvdplm Please change all those cases back. Div panics on default but we need overflowing behavior here, otherwise it breaks consensus.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like these methods were removed when going from bigint to uint, which makes sense since for unsigned integers div and rem should never overflow.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also had the same question though so it's better if @dvdplm confirms.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah right. I think it's this: paritytech/parity-common#32

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Confirmed, that's the PR. I think the reason they were there to begin with was an attempt to fulfill a trait that is no longer in rust (removed ~1.13?).

@@ -821,7 +821,7 @@ impl<Cost: CostType> Interpreter<Cost> {
} else if a == min && b == !U256::zero() {
min
} else {
let c = a.overflowing_div(b).0;
let c = a/b;
Copy link
Contributor

Choose a reason for hiding this comment

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

a / b

@@ -52,7 +52,8 @@ impl Registrar {
};

let address_fetcher = self.registrar.functions().get_address();
let id = address_fetcher.input(keccak(key), DNS_A_RECORD);
let hashed_key : [u8; 32] = keccak(key).into();
Copy link
Contributor

Choose a reason for hiding this comment

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

let hashed_key: [u8; 32] = ...

hashdb = "0.2.1"
plain_hasher = "0.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a newline at the end of this file?

[dev-dependencies]
memorydb = "0.2.1"
keccak-hash = "0.1.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a newline here as well?

triehash = { git = "https://github.com/paritytech/parity-common" }
ethereum-types = "0.3"
triehash = { version = "0.2.3", features = ["ethereum"] }
ethereum-types = "0.4"
keccak-hasher = { path = "../keccak-hasher" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Also newline at end of file?

Copy link
Collaborator

@debris debris left a comment

Choose a reason for hiding this comment

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

LGTM! Just a minor question about changes in interpreter

@@ -795,7 +795,7 @@ impl<Cost: CostType> Interpreter<Cost> {
TWO_POW_96 => a >> 96,
TWO_POW_224 => a >> 224,
TWO_POW_248 => a >> 248,
_ => a.overflowing_div(b).0,
_ => a/b,
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is it changed?

sorpaas
sorpaas previously requested changes Sep 4, 2018
Copy link
Collaborator

@sorpaas sorpaas left a comment

Choose a reason for hiding this comment

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

Overflowing changes in EVM seems not right. I think we need to change them back before merging, otherwise it breaks consensus.

I still have some doubts on the approach here. It indeed feels a little bit harder right now to look into the dependency's code, which is something I need to do often. But that's certainly not "over-my-dead-body" and the solution looks fine. :)

However, @dvdplm one thing that we should do I think is to make sure all dependencies have proper version tags on parity-common repo or other places. I think we will soon have situations where the version we use in parity-ethereum is slightly older compared with parity-common/primitives/other repos. In that case, those tags will be crucial to look into the code for actual code used in parity-ethereum.

@@ -795,7 +795,7 @@ impl<Cost: CostType> Interpreter<Cost> {
TWO_POW_96 => a >> 96,
TWO_POW_224 => a >> 224,
TWO_POW_248 => a >> 248,
_ => a.overflowing_div(b).0,
_ => a/b,
Copy link
Collaborator

@sorpaas sorpaas Sep 4, 2018

Choose a reason for hiding this comment

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

@dvdplm Please change all those cases back. Div panics on default but we need overflowing behavior here, otherwise it breaks consensus.

@sorpaas sorpaas dismissed their stale review September 4, 2018 15:54

I was wrong about Div/Rem. They seems alright!

@dvdplm
Copy link
Collaborator Author

dvdplm commented Sep 4, 2018

all dependencies have proper version tags on parity-common repo or other places.

I agree with this strongly and have slapped myself several times already for not having done this already. I will go through parity-common and make sure it's done and make sure others do the same. In parity-common I have to make tags like kvdb-v0.1 and it'll apply to the whole repo ofc but that's not a big problem I think.

@andresilva
Copy link
Contributor

I built a binary from this branch and synced mainnet (my node was about 4000 blocks away from the chain head) and I also warp-synced on kovan.

@dvdplm dvdplm merged commit 72fd1fa into master Sep 4, 2018
@5chdn 5chdn deleted the dp/chore/fetch-dependencies-from-crates branch September 5, 2018 11:07
@5chdn 5chdn added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Sep 5, 2018
@5chdn 5chdn mentioned this pull request Sep 12, 2018
8 tasks
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. M5-dependencies 🖇 Dependencies.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants