This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Extract the Engine trait#10958
Merged
Merged
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
tomusdrw
approved these changes
Aug 13, 2019
Collaborator
tomusdrw
left a comment
There was a problem hiding this comment.
🎉 Awesome work! A bunch of tiny grumbles.
| vm = { path = "../vm" } | ||
| trace = { path = "../trace" } | ||
| ethcore-miner = { path = "../../miner" } | ||
| kvdb = "0.1.0" |
| use block::*; | ||
| use client::EngineClient; | ||
| use engines::{Engine, Seal, ConstructedVerifier}; | ||
| use client_traits::EngineClient; |
Collaborator
There was a problem hiding this comment.
I guess the next step would be to move specific engines implementations into it's own crates? ;)
Contributor
There was a problem hiding this comment.
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!
Collaborator
Author
| // 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 |
* 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)
* master: [.gitlab.yml] cargo check ethcore benches (#10965)
dvdplm
added a commit
that referenced
this pull request
Aug 15, 2019
* 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)
This was referenced Nov 5, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another big, noisy PR. This time the
Enginetrait and associated types are extracted to anenginecrate. Along with this many of the client traits have been moved fromethcore/client/traits.rsinto theclient_traitscrate.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 theenginecrate now hosts two traits related to snapshotting.The only relevant logic change is in
Ethash: theepoch_verifier()method requires a type that implementsEpochVerifierthat can be stuck inside aConstructedVerifierenum and before this PR this was achieved by an impl onArc<Ethash>. When theEnginetrait is no longer local, this is not possible. Instead there is now a localEpochVerifierstruct that impls theEpochVerifiertrait, 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