-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fetch parity-common
crates from crates.io
#9410
Conversation
I would worry about "atomic PR" issues, like the one we faced in #9257. 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 |
Fix/update a few deps
* 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)
* 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)
There was a problem hiding this 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.
ethcore/evm/src/interpreter/mod.rs
Outdated
@@ -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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a / b
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it changed?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?).
ethcore/evm/src/interpreter/mod.rs
Outdated
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a / b
registrar/src/registrar.rs
Outdated
@@ -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(); |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
util/triehash-ethereum/Cargo.toml
Outdated
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" } |
There was a problem hiding this comment.
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?
There was a problem hiding this 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
ethcore/evm/src/interpreter/mod.rs
Outdated
@@ -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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it changed?
There was a problem hiding this 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.
ethcore/evm/src/interpreter/mod.rs
Outdated
@@ -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, |
There was a problem hiding this comment.
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.
I was wrong about Div/Rem. They seems alright!
I agree with this strongly and have slapped myself several times already for not having done this already. I will go through |
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. |
Also removes
transaction-pool
andtrace-time
which now are inparity-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