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

Extract Machine from ethcore #10949

Merged
merged 19 commits into from
Aug 13, 2019
Merged

Extract Machine from ethcore #10949

merged 19 commits into from
Aug 13, 2019

Conversation

dvdplm
Copy link
Collaborator

@dvdplm dvdplm commented Aug 6, 2019

In the pursuit of a slimmer ethcore crate, this PR moves the Machine and related types/code to a new machine crate, ~3kloc of Rust.
I am not entirely sure that my choice of what to move where is the best possible way of slicing things up, but I have made a few failed attempts to disentangle Machine from Engine and at the end of the day I think that Machine is the lower level type here and so easier to move.

The end goal, other than a slimmer ethcore crate ofc, is to be able to move the Engine trait outside of ethcore which in turn would enable us to move the engine impls to own crates as well. I believe that would be beneficial both for maintaining existing code and for external contributors to work on new/tweaked engines.

The PR is noisy and for that I apologise. There is no new logic added or changed, other than some slight refactoring of the way tests instantiate Machines. The ethcore::client module re-exports plenty of types for no apparent reason and removing those led to significant fallout in other places, contributing to the noise. I do believe that re-exports of that kind creates more confusion than convenience.

The most relevant changes of this PR is the addition of the machine crate and a new client-traits crate (which for now is tiny, but could grow if/when we extract more traits from ethcore::client::traits). Extracting the machine crate implies moving plenty of other code as well: Executive, Externalities, Substate and TxFilter.

@dvdplm dvdplm self-assigned this Aug 6, 2019
@dvdplm dvdplm added the A0-pleasereview 🤓 Pull request needs code review. label Aug 6, 2019
@dvdplm dvdplm marked this pull request as ready for review August 6, 2019 23:19
* master:
  Allow default block parameter to be blockHash (#10932)
  Enable sealing when engine is ready (#10938)
  Fix some warnings and typos. (#10941)
@dvdplm dvdplm requested a review from debris August 6, 2019 23:33
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.

those changes lgtm! please fix remaining todos and let's get it in!

ethcore/light/src/on_demand/mod.rs Outdated Show resolved Hide resolved
ethcore/machine/src/test_helpers.rs Show resolved Hide resolved
ethcore/machine/src/tx_filter.rs Outdated Show resolved Hide resolved
ethcore/src/client/mod.rs Show resolved Hide resolved
ethcore/src/lib.rs Outdated Show resolved Hide resolved
ethcore/machine/src/lib.rs Outdated Show resolved Hide resolved
@dvdplm dvdplm requested a review from debris August 9, 2019 13:56
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

@debris debris added A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust. and removed A0-pleasereview 🤓 Pull request needs code review. labels Aug 10, 2019
@ordian ordian added this to the 2.7 milestone Aug 13, 2019
@dvdplm dvdplm merged commit 73f4564 into master Aug 13, 2019
dvdplm added a commit that referenced this pull request Aug 13, 2019
* master:
  Extract Machine from ethcore (#10949)
  removed redundant state_root function from spec, improve spec error types (#10955)
  Add support for Energy Web Foundation's new chains (#10957)
  [evmbin] add more tests to main.rs (#10956)
@debris debris deleted the dp/chore/move-machine-to-own-crate branch August 13, 2019 14:01
ordian added a commit that referenced this pull request Aug 15, 2019
* master:
  [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)
  Extract Machine from ethcore (#10949)
  removed redundant state_root function from spec, improve spec error types (#10955)
  Add support for Energy Web Foundation's new chains (#10957)
  [evmbin] add more tests to main.rs (#10956)
  Fix compiler warnings in util/io and upgrade to edition 2018 Upgrade mio to latest (#10953)
  unify loading spec && further spec cleanups (#10948)
  refactor: Refactor evmbin CLI (#10742)
  journaldb changes (#10929)
  Allow default block parameter to be blockHash (#10932)
  Enable sealing when engine is ready (#10938)
  Fix some warnings and typos. (#10941)
  Updated security@parity.io key (#10939)
  Change the return type of step_inner function. (#10940)
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. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants