-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
Move the BlockInfo trait to new crate
Contains code extracted from ethcore that defines `Machine`, `Externalities` and other execution related code.
* master: Fix compiler warnings in util/io and upgrade to edition 2018 Upgrade mio to latest (#10953)
Initial version of extracted Engine trait
Cleanup Executed as exported from machine crate
Sort out default impls for EpochVerifier
Fix Histogram
Don't export ethcore::client::*
Use types from the engine crate Explicit exports from engine::engine
…, ScheduleInfo, StateClient
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.
🎉 Awesome work! A bunch of tiny grumbles.
vm = { path = "../vm" } | ||
trace = { path = "../trace" } | ||
ethcore-miner = { path = "../../miner" } | ||
kvdb = "0.1.0" |
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.
sort?
use block::*; | ||
use client::EngineClient; | ||
use engines::{Engine, Seal, ConstructedVerifier}; | ||
use client_traits::EngineClient; |
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 guess the next step would be to move specific engines implementations into it's own crates? ;)
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.
You nailed it. :)
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.
We're actually already doing that with our WIP Honey Badger engine:
https://github.com/poanetwork/parity-ethereum/tree/hbbft/ethcore/hbbft_engine
Saves a lot of compile time!
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.
@@ -207,17 +241,18 @@ impl Ethash { | |||
// for any block in the chain. | |||
// in the future, we might move the Ethash epoch | |||
// caching onto this mechanism as well. | |||
// NOTE[dvdplm]: the reason we impl this for Arc<Ethash> and not plain Ethash is the |
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.
🎉
* master: Verify transaction against its block during import (#10954) [evmbin] fix compilation (#10976) Update to latest trie version. (#10972) [blooms-db] Fix benchmarks (#10974) Fix ethcore/benches build. (#10964) tx-pool: accept local tx with higher gas price when pool full (#10901) Disable unsyncable expanse chain (#10926)
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!
* master: [.gitlab.yml] cargo check ethcore benches (#10965)
* master: Extract the Engine trait (#10958) Better error message for rpc gas price errors (#10931) [.gitlab.yml] cargo check ethcore benches (#10965) Verify transaction against its block during import (#10954) [evmbin] fix compilation (#10976) Update to latest trie version. (#10972) [blooms-db] Fix benchmarks (#10974) Fix ethcore/benches build. (#10964) tx-pool: accept local tx with higher gas price when pool full (#10901) Disable unsyncable expanse chain (#10926)
Another big, noisy PR. This time the
Engine
trait and associated types are extracted to anengine
crate. Along with this many of the client traits have been moved fromethcore/client/traits.rs
into theclient_traits
crate.To some degree the PR makes arbitrary decisions on which types/traits to move. The criteria used is not so much about what belongs where, but rather given that we want a free standing
Engine
, what else has to move? One example of such unclean division is how theengine
crate now hosts two traits related to snapshotting.The only relevant logic change is in
Ethash
: theepoch_verifier()
method requires a type that implementsEpochVerifier
that can be stuck inside aConstructedVerifier
enum and before this PR this was achieved by an impl onArc<Ethash>
. When theEngine
trait is no longer local, this is not possible. Instead there is now a localEpochVerifier
struct that impls theEpochVerifier
trait, much like the other engines do. This leads to somewhat convoluted code but otoh it saves us the doubly-arc-wrapped setup we had before.Based on #10949