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

Move more types out of ethcore #10880

Merged
merged 124 commits into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
f144f88
WIP move errors, pod_account and state account to own crates
dvdplm Jul 3, 2019
c8bf87f
Sort out dependencies, fix broken code and tests
dvdplm Jul 4, 2019
47bc6fb
remove template line
dvdplm Jul 4, 2019
f8756bb
fix review feedback
dvdplm Jul 4, 2019
d54ebab
Remove test-only AccountDBMut::new
dvdplm Jul 4, 2019
7792810
Extract AccountDB to account-db
dvdplm Jul 4, 2019
a55ca1e
Move Substate to state-account – wip
dvdplm Jul 4, 2019
201dac7
Add lib.rs
dvdplm Jul 4, 2019
e23acad
cleanup
dvdplm Jul 4, 2019
b7c7aae
Merge branch 'master' into dp/chore/extricate-account-db-into-own-crate
dvdplm Jul 4, 2019
e0701e4
test failure
dvdplm Jul 4, 2019
b42d16a
test failure 2
dvdplm Jul 4, 2019
e45d13f
third time's the charm
dvdplm Jul 4, 2019
9553c8c
Merge branch 'dp/chore/extricate-account-db-into-own-crate' into dp/c…
dvdplm Jul 4, 2019
9b60a57
Merge branch 'master' into dp/chore/extricate-state-backend
dvdplm Jul 4, 2019
c55e6b1
Merge branch 'master' into dp/chore/extricate-state-backend
dvdplm Jul 4, 2019
1c0722b
Add factories crate
dvdplm Jul 4, 2019
2114c12
Use new factories crate
dvdplm Jul 4, 2019
80ededa
Use factories crate
dvdplm Jul 4, 2019
d9ceaa6
Extract trace
dvdplm Jul 4, 2019
9f3aa73
Fix tests
dvdplm Jul 4, 2019
a6a25ba
Sort out parity-util-mem and parking_lot
dvdplm Jul 4, 2019
44a0904
cleanup
dvdplm Jul 4, 2019
ce3a211
WIP port over the rest of state from ethcore
dvdplm Jul 4, 2019
9ed1d47
Collect all impls for Machine
dvdplm Jul 5, 2019
67332d7
some notes
dvdplm Jul 5, 2019
0a42ea8
Rename pod-account to pod
dvdplm Jul 5, 2019
d9ce43d
Move PodState to pod crate
dvdplm Jul 5, 2019
aebee1d
Use PodState from pod crate
dvdplm Jul 5, 2019
6344f9d
Fix use clause for json tests
dvdplm Jul 5, 2019
63564de
Sort out evmbin
dvdplm Jul 5, 2019
147bde5
Add missing code and use PodState
dvdplm Jul 5, 2019
ceda5f8
Move code that depends on Machine and Executive to own module
dvdplm Jul 5, 2019
fefd892
Sort out cloning errors, fix ethcore to use new state crate
dvdplm Jul 5, 2019
d41f5d4
Do without funky From impls
dvdplm Jul 5, 2019
ffec0b0
Fix ethcore tests
dvdplm Jul 5, 2019
849c73f
Fixes around the project to use new state crate
dvdplm Jul 5, 2019
c772639
Add back the more specific impls of StateOrBlock From conversions
dvdplm Jul 5, 2019
ffda775
Move execute to freestanding function and remove it from trait
dvdplm Jul 5, 2019
2f9526b
cleanup
dvdplm Jul 5, 2019
6f8a1a7
Fix "error: enum variants on type aliases are experimental"
dvdplm Jul 5, 2019
b11e078
Bring back the state tests
dvdplm Jul 5, 2019
06a37ba
remove ethcore/state/mod.rs
dvdplm Jul 5, 2019
10ab382
cleanup
dvdplm Jul 5, 2019
cff4280
cleanup
dvdplm Jul 5, 2019
cf4d8d5
Cleanup state-account errors
dvdplm Jul 5, 2019
e4a5176
Fix more todos
dvdplm Jul 5, 2019
618276d
Add error.rs
dvdplm Jul 5, 2019
4be6fe0
Merge branch 'master' into dp/chore/extricate-state-backend
dvdplm Jul 5, 2019
3a0db5e
Fixup Cargo.lock
dvdplm Jul 5, 2019
a61f135
Smaller ethcore API is fine
dvdplm Jul 5, 2019
14e475f
Add `to-pod-full` feature to state-account
dvdplm Jul 5, 2019
6d0df41
Fix a few more test failures
dvdplm Jul 5, 2019
5363b45
Fix RPC test build
dvdplm Jul 6, 2019
234e986
Baptize the new trait
dvdplm Jul 6, 2019
7eb04e0
Remove resolved TODOs
dvdplm Jul 6, 2019
0cab314
Rename state-account to account-state
dvdplm Jul 6, 2019
a42720b
Do not re-export the trace crate
dvdplm Jul 6, 2019
515abdf
Don't export state_db from ethcore
dvdplm Jul 6, 2019
e3d98b7
Merge branch 'master' into dp/chore/extricate-state-backend
dvdplm Jul 6, 2019
081e678
Let private-tx use StateDB. :(
dvdplm Jul 6, 2019
659440a
Remove ethcore/src/pod_state.rs
dvdplm Jul 6, 2019
2f839f8
Inner type does not need to be pub/pub(crate)
dvdplm Jul 7, 2019
df23dcc
optimise imports
dvdplm Jul 7, 2019
e23cb6a
Revert "Inner type does not need to be pub/pub(crate)"
dvdplm Jul 7, 2019
de2aa80
Move DatabaseExtras to ethcore-blockchain
dvdplm Jul 7, 2019
b4ea86a
Add database_extra module to ethcore-blockchain
dvdplm Jul 7, 2019
1cf8254
Merge branch 'master' into dp/chore/extricate-state-backend
dvdplm Jul 7, 2019
a57517c
Remove to-pod-full feature
dvdplm Jul 7, 2019
5a28340
cosmetics
dvdplm Jul 8, 2019
40aef44
New crate: state-db
dvdplm Jul 8, 2019
0b1a692
Add new crate
dvdplm Jul 8, 2019
90de4d2
Move PreverifiedBlock and BlockError to types
dvdplm Jul 8, 2019
75efc47
Merge branch 'master' into dp/chore/extricate-state-backend
dvdplm Jul 8, 2019
994424e
Sort out the merge
dvdplm Jul 8, 2019
cd9167e
Merge branch 'dp/chore/extricate-state-backend' into dp/chore/extract…
dvdplm Jul 8, 2019
f30f63b
Merge branch 'dp/chore/extract-state-db' into dp/chore/extract-verifi…
dvdplm Jul 8, 2019
4fe6f55
Add missing `license` meta data keys
dvdplm Jul 8, 2019
a3f08ca
wip
dvdplm Jul 8, 2019
eb57f24
wip client-traits
dvdplm Jul 8, 2019
2c86e2b
Merge branch 'master' into dp/chore/extract-verification
dvdplm Jul 9, 2019
cdbab8c
merge conflict
dvdplm Jul 9, 2019
62dcb77
verification crate type checks
dvdplm Jul 9, 2019
8d86b85
Move impls for CommonParams to common_types
dvdplm Jul 9, 2019
e7c32fc
Fix tests
dvdplm Jul 9, 2019
e022516
Implement VerifyingEngine for all engines except Ethash
dvdplm Jul 9, 2019
3037cbc
Split Engine in two and move code around
dvdplm Jul 9, 2019
183e6e1
cleanup
dvdplm Jul 9, 2019
196605f
verification: don't rexport common_types
dvdplm Jul 10, 2019
28f282a
Use error from common_types
dvdplm Jul 10, 2019
7cadd54
Consolidate error types
dvdplm Jul 10, 2019
0c09315
VerifyingEngine use Errors from common_types
dvdplm Jul 10, 2019
35037f8
verification: Use error type from common_types
dvdplm Jul 10, 2019
0305525
SnapshotError moved to common_types
dvdplm Jul 10, 2019
55f0b73
Move more code from Engne to VerifyingEngine
dvdplm Jul 10, 2019
2157d81
Add MAX_UNCLE_AGE const
dvdplm Jul 10, 2019
74b48fd
Port over remaining code from ethcore/verification
dvdplm Jul 10, 2019
fcd75fc
Use errors from common_types
dvdplm Jul 10, 2019
27d4a6a
Fix the confusing "io" naming
dvdplm Jul 10, 2019
ddc886c
Move more types into common_types
dvdplm Jul 12, 2019
abc1b93
Add todos
dvdplm Jul 12, 2019
3e2aa7c
Experiment with Engine trait outside ethcore
dvdplm Jul 12, 2019
3173158
Hook up types from common_types in ethcore
dvdplm Jul 12, 2019
6e63dd8
Revert to impl Engine for Arc<Ethash> and add note to explain why
dvdplm Jul 12, 2019
3960477
Remove ClientIoMessage from common_types
dvdplm Jul 12, 2019
3828559
Cleanup
dvdplm Jul 12, 2019
1c4dbac
More cleanup
dvdplm Jul 12, 2019
a4cf484
Sort error handling changes in the rest of parity
dvdplm Jul 12, 2019
5283aaf
Remove unused code
dvdplm Jul 12, 2019
21add4b
Remove WIP types
dvdplm Jul 12, 2019
e58f366
Cleanup todos not tackled here
dvdplm Jul 12, 2019
8a0d3db
remove cruft
dvdplm Jul 12, 2019
8e88f2e
Merge branch 'master' into dp/chore/move-more-types-out-of-ethcore
dvdplm Jul 12, 2019
3cda700
Fix some whitespace and a merge error
dvdplm Jul 12, 2019
4febb27
ethcore tests
dvdplm Jul 12, 2019
1f97b2c
test failures
dvdplm Jul 12, 2019
30a5d86
Restore Engine impls to master to make review a bit easier
dvdplm Jul 12, 2019
7c46f23
cleanup
dvdplm Jul 12, 2019
6a99771
whitespace
dvdplm Jul 12, 2019
ef3cced
Merge branch 'master' into dp/chore/move-more-types-out-of-ethcore
debris Jul 16, 2019
588a85e
applied review suggestions
debris Jul 16, 2019
e9da9ed
types does not depend on rustc-hex
debris Jul 16, 2019
ca86b89
ethash engine moved to engine module
debris Jul 16, 2019
4ea83e6
applied review suggestion
debris Jul 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ansi_term = "0.11"
blooms-db = { path = "../util/blooms-db", optional = true }
common-types = { path = "types" }
crossbeam-utils = "0.6"
derive_more = "0.14.0"
env_logger = { version = "0.5", optional = true }
ethabi = "8.0"
ethabi-contract = "8.0"
Expand Down
5 changes: 3 additions & 2 deletions ethcore/account-db/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
description = "DB backend wrapper for Account trie"
name = "account-db"
version = "0.1.0"
description = "DB backend wrapper for Account trie"
authors = ["Parity Technologies <admin@parity.io>"]
license = "GPL-3.0"
version = "0.1.0"
edition = "2018"

[dependencies]
Expand Down
5 changes: 3 additions & 2 deletions ethcore/account-state/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
description = "Ethereum accounts, keeps track of changes to the code and storage"
name = "account-state"
version = "0.1.0"
description = "Ethereum accounts, keeps track of changes to the code and storage"
authors = ["Parity Technologies <admin@parity.io>"]
license = "GPL-3.0"
version = "0.1.0"
edition = "2018"

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion ethcore/account-state/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use lru_cache::LruCache;
use parity_bytes::{Bytes, ToPretty};
use rlp::{DecoderError, encode};
use trie_db::{Recorder, Trie};

use common_types::basic_account::BasicAccount;
use ethtrie::{Result as TrieResult, SecTrieDB, TrieDB, TrieFactory};
use keccak_hasher::KeccakHasher;
Expand Down
3 changes: 1 addition & 2 deletions ethcore/account-state/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use hash_db::{AsHashDB, EMPTY_PREFIX, HashDB, Prefix};
use kvdb::DBValue;
use memory_db::{HashKey, MemoryDB};
use parking_lot::Mutex;

use journaldb::AsKeyedHashDB;
use keccak_hasher::KeccakHasher;

Expand Down Expand Up @@ -222,7 +221,7 @@ impl<H: AsHashDB<KeccakHasher, DBValue>> Proving<H> {
/// This will store all values ever fetched from that base.
pub fn new(base: H) -> Self {
Proving {
base: base,
base,
changed: journaldb::new_memory_db(),
proof: Mutex::new(HashSet::new()),
}
Expand Down
2 changes: 0 additions & 2 deletions ethcore/account-state/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@
pub mod account;
pub mod backend;
pub mod state;
pub mod error;

pub use {
account::Account,
backend::Backend,
error::Error,
state::{State, CleanupMode},
};
2 changes: 1 addition & 1 deletion ethcore/account-state/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use std::{
use common_types::{
state_diff::StateDiff,
basic_account::BasicAccount,
errors::EthcoreError as Error,
};
use ethereum_types::{Address, H256, U256};
use ethtrie::{TrieDB, Result as TrieResult};
Expand All @@ -46,7 +47,6 @@ use pod::{self, PodAccount, PodState};
use trie_db::{Trie, TrieError, Recorder};

use crate::{
Error,
account::Account,
backend::Backend,
};
Expand Down
1 change: 0 additions & 1 deletion ethcore/light/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ itertools = "0.5"
bincode = "1.1"
serde = "1.0"
serde_derive = "1.0"
account-state = { path = "../account-state" }
parking_lot = "0.8"
stats = { path = "../../util/stats" }
keccak-hash = "0.2.0"
Expand Down
12 changes: 7 additions & 5 deletions ethcore/light/src/client/header_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ use std::sync::Arc;

use cache::Cache;
use cht;
use common_types::block_status::BlockStatus;
use common_types::encoded;
use common_types::header::Header;
use common_types::ids::BlockId;
use common_types::{
block_status::BlockStatus,
encoded,
errors::{EthcoreError as Error, BlockError, EthcoreResult},
header::Header,
ids::BlockId,
};
use ethcore::engines::epoch::{Transition as EpochTransition, PendingTransition as PendingEpochTransition};
use ethcore::error::{Error, EthcoreResult, BlockError};
use ethcore::spec::{Spec, SpecHardcodedSync};
use ethereum_types::{H256, H264, U256};
use parity_util_mem::{MallocSizeOf, MallocSizeOfOps};
Expand Down
22 changes: 12 additions & 10 deletions ethcore/light/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,23 @@ use std::sync::{Weak, Arc};

use ethcore::client::{ClientReport, EnvInfo, ClientIoMessage};
use ethcore::engines::{epoch, Engine, EpochChange, EpochTransition, Proof};
use ethcore::error::{Error, EthcoreResult};
use ethcore::verification::queue::{self, HeaderQueue};
use ethcore::spec::{Spec, SpecHardcodedSync};
use io::IoChannel;
use parking_lot::{Mutex, RwLock};
use ethereum_types::{H256, U256};
use futures::{IntoFuture, Future};
use common_types::BlockNumber;
use common_types::block_status::BlockStatus;
use common_types::blockchain_info::BlockChainInfo;
use common_types::encoded;
use common_types::header::Header;
use common_types::ids::BlockId;
use common_types::verification_queue_info::VerificationQueueInfo as BlockQueueInfo;

use common_types::{
BlockNumber,
block_status::BlockStatus,
blockchain_info::BlockChainInfo,
encoded,
errors::EthcoreError as Error,
errors::EthcoreResult,
header::Header,
ids::BlockId,
verification_queue_info::VerificationQueueInfo as BlockQueueInfo,
};
use kvdb::KeyValueDB;

use self::fetch::ChainDataFetcher;
Expand Down Expand Up @@ -468,7 +470,7 @@ impl<T: ChainDataFetcher> Client<T> {
}

fn check_epoch_signal(&self, verified_header: &Header) -> Result<Option<Proof>, T::Error> {
use ethcore::machine::{AuxiliaryRequest, AuxiliaryData};
use common_types::engines::machine::{AuxiliaryRequest, AuxiliaryData};

let mut block: Option<Vec<u8>> = None;
let mut receipts: Option<Vec<_>> = None;
Expand Down
2 changes: 1 addition & 1 deletion ethcore/light/src/client/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
use std::fmt;
use std::sync::Arc;

use common_types::errors::EthcoreError as CoreError;
use ethcore_db as db;
use ethcore_blockchain::BlockChainDB;
use ethcore::client::ClientIoMessage;
use ethcore::error::Error as CoreError;
use ethcore::spec::Spec;
use io::{IoContext, IoError, IoHandler, IoService};

Expand Down
1 change: 0 additions & 1 deletion ethcore/light/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ extern crate triehash_ethereum as triehash;
extern crate kvdb;
extern crate memory_cache;
extern crate derive_more;
extern crate account_state;

#[cfg(test)]
extern crate kvdb_memorydb;
Expand Down
1 change: 0 additions & 1 deletion ethcore/light/src/on_demand/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use common_types::receipt::Receipt;
use common_types::transaction::SignedTransaction;
use ethcore::engines::{Engine, StateDependentProof};
use ethcore::executive_state::{ProvedExecution, self};
use account_state;
use ethereum_types::{H256, U256, Address};
use ethtrie::{TrieError, TrieDB};
use hash::{KECCAK_NULL_RLP, KECCAK_EMPTY, KECCAK_EMPTY_LIST_RLP, keccak};
Expand Down
5 changes: 3 additions & 2 deletions ethcore/pod/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
description = "State/Account system expressed in Plain Old Data."
name = "pod"
version = "0.1.0"
description = "State/Account system expressed in Plain Old Data."
authors = ["Parity Technologies <admin@parity.io>"]
license = "GPL-3.0"
version = "0.1.0"
edition = "2018"

[dependencies]
Expand Down
6 changes: 4 additions & 2 deletions ethcore/private-tx/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ use derive_more::Display;
use ethereum_types::Address;
use rlp::DecoderError;
use ethtrie::TrieError;
use ethcore::error::{Error as EthcoreError, ExecutionError};
use types::transaction::Error as TransactionError;
use types::{
errors::{EthcoreError, ExecutionError},
transaction::Error as TransactionError,
};
use ethkey::Error as KeyError;
use ethkey::crypto::Error as CryptoError;
use txpool::VerifiedTransaction;
Expand Down
1 change: 1 addition & 0 deletions ethcore/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
ansi_term = "0.11"
common-types = { path = "../types" }
ethcore = { path = ".." }
ethcore-blockchain = { path = "../blockchain" }
ethcore-io = { path = "../../util/io" }
Expand Down
1 change: 1 addition & 0 deletions ethcore/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.

extern crate ansi_term;
extern crate common_types;
extern crate ethcore;
extern crate ethcore_blockchain as blockchain;
extern crate ethcore_io as io;
Expand Down
Loading