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

Commit

Permalink
Extract the Engine trait (#10958)
Browse files Browse the repository at this point in the history
* Add client-traits crate
Move the BlockInfo trait to new crate

* New crate `machine`
Contains code extracted from ethcore that defines `Machine`, `Externalities` and other execution related code.

* Use new machine and client-traits crates in ethcore

* Use new crates machine and client-traits instead of ethcore where appropriate

* Fix tests

* Don't re-export so many types from ethcore::client

* Fixing more fallout from removing re-export

* fix test

* More fallout from not re-exporting types

* Add some docs

* cleanup

* import the macro edition style

* Tweak docs

* Add missing import

* remove unused ethabi_derive imports

* Use latest ethabi-contract

* Move many traits from ethcore/client/traits to client-traits crate
Initial version of extracted Engine trait

* Move snapshot related traits to the engine crate (eew)

* Move a few snapshot related types to common_types
Cleanup Executed as exported from machine crate

* fix warning

* Gradually introduce new engine crate: snapshot

* ethcore typechecks with new engine crate

* Sort out types outside ethcore

* Add an EpochVerifier to ethash and use that in Engine.epoch_verifier()
Cleanup

* Document pub members

* Sort out tests
Sort out default impls for EpochVerifier

* Add test-helpers feature and move EngineSigner impl to the right place

* Sort out tests

* Sort out tests and refactor verification types

* Fix missing traits

* More missing traits
Fix Histogram

* Fix tests and cleanup

* cleanup

* Put back needed logger import

* Don't rexport common_types from ethcore/src/client
Don't export ethcore::client::*

* Remove files no longer used
Use types from the engine crate
Explicit exports from engine::engine

* Get rid of itertools

* Move a few more traits from ethcore to client-traits: BlockChainReset, ScheduleInfo, StateClient

* Move ProvingBlockChainClient to client-traits

* Don't re-export ForkChoice and Transition from ethcore

* Address grumbles: sort imports, remove commented out code

* Fix merge resolution error

* merge failure
  • Loading branch information
dvdplm authored Aug 15, 2019
1 parent 1ba4df0 commit 6a9de9b
Show file tree
Hide file tree
Showing 142 changed files with 1,852 additions and 1,483 deletions.
36 changes: 36 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jsonrpc-core = "12.0.0"
parity-bytes = "0.1"
client-traits = { path = "ethcore/client-traits" }
common-types = { path = "ethcore/types" }
engine = { path = "ethcore/engine" }
ethcore = { path = "ethcore", features = ["parity"] }
ethcore-accounts = { path = "accounts", optional = true }
ethcore-blockchain = { path = "ethcore/blockchain" }
Expand Down
2 changes: 1 addition & 1 deletion ethash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl EthashManager {
EthashManager {
cache_dir: cache_dir.to_path_buf(),
nodecache_builder: NodeCacheBuilder::new(optimize_for.into().unwrap_or_default(), progpow_transition),
progpow_transition: progpow_transition,
progpow_transition,
cache: Mutex::new(LightCache {
recent_epoch: None,
recent: None,
Expand Down
14 changes: 8 additions & 6 deletions ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
account-db = { path = "account-db" }
account-state = { path = "account-state" }
ansi_term = "0.11"
blooms-db = { path = "../util/blooms-db", optional = true }
client-traits = { path = "./client-traits" }
common-types = { path = "types" }
crossbeam-utils = "0.6"
engine = { path = "./engine" }
env_logger = { version = "0.5", optional = true }
ethabi = "8.0"
ethabi-contract = "8.0"
Expand All @@ -30,7 +32,6 @@ ethereum-types = "0.6.0"
ethjson = { path = "../json" }
ethkey = { path = "../accounts/ethkey" }
evm = { path = "evm" }
trie-vm-factories = { path = "trie-vm-factories" }
futures = "0.1"
hash-db = "0.15.0"
parity-util-mem = "0.2.0"
Expand All @@ -52,42 +53,43 @@ num_cpus = "1.2"
parity-bytes = "0.1"
parity-snappy = "0.1"
parking_lot = "0.8"
pod = { path = "pod" }
trie-db = "0.15.0"
patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" }
pod = { path = "pod" }
rand = "0.6"
rand_xorshift = "0.1.1"
rayon = "1.1"
rlp = "0.4.0"
rlp_derive = { path = "../util/rlp-derive" }
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
account-state = { path = "account-state" }
stats = { path = "../util/stats" }
state-db = { path = "state-db" }
stats = { path = "../util/stats" }
tempdir = { version = "0.3", optional = true }
time-utils = { path = "../util/time-utils" }
trace = { path = "trace" }
trace-time = "0.1"
trie-vm-factories = { path = "trie-vm-factories" }
triehash-ethereum = { version = "0.2", path = "../util/triehash-ethereum" }
unexpected = { path = "../util/unexpected" }
using_queue = { path = "../miner/using-queue" }
vm = { path = "vm" }
rand_xorshift = "0.1.1"

[dev-dependencies]
blooms-db = { path = "../util/blooms-db" }
criterion = "0.2"
engine = { path = "./engine", features = ["test-helpers"] }
env_logger = "0.5"
ethcore-accounts = { path = "../accounts" }
fetch = { path = "../util/fetch" }
kvdb-rocksdb = "0.1.3"
machine = { path = "./machine", features = ["test-helpers"] }
parity-runtime = { path = "../util/runtime" }
rlp_compress = { path = "../util/rlp-compress" }
serde_json = "1.0"
tempdir = "0.3"
trie-standardmap = "0.15.0"
machine = { path = "./machine", features = ["test-helpers"] }

[features]
parity = ["work-notify", "price-info", "stratum"]
Expand Down
13 changes: 11 additions & 2 deletions ethcore/client-traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ edition = "2018"
license = "GPL-3.0"

[dependencies]
ethereum-types = "0.6.0"
account-state = { path = "../account-state" }
blockchain = { package = "ethcore-blockchain", path = "../blockchain" }
bytes = { package = "parity-bytes", version = "0.1.0" }
call-contract = { package = "ethcore-call-contract", path = "../call-contract" }
common-types = { path = "../types" }

ethcore-db = { path = "../db" }
ethcore-miner = { path = "../../miner" }
ethereum-types = "0.6.0"
kvdb = "0.1.0"
stats = { path = "../../util/stats" }
trace = { path = "../trace" }
vm = { path = "../vm" }
Loading

0 comments on commit 6a9de9b

Please sign in to comment.