removed redundant VMType enum with one variant (#11266)
This commit is contained in:
parent
82c3265858
commit
e0091c672a
@ -21,12 +21,10 @@ use vm::{Exec, Schedule};
|
|||||||
use ethereum_types::U256;
|
use ethereum_types::U256;
|
||||||
use super::vm::ActionParams;
|
use super::vm::ActionParams;
|
||||||
use super::interpreter::SharedCache;
|
use super::interpreter::SharedCache;
|
||||||
use super::vmtype::VMType;
|
|
||||||
|
|
||||||
/// Evm factory. Creates appropriate Evm.
|
/// Evm factory. Creates appropriate Evm.
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Factory {
|
pub struct Factory {
|
||||||
evm: VMType,
|
|
||||||
evm_cache: Arc<SharedCache>,
|
evm_cache: Arc<SharedCache>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,20 +32,17 @@ impl Factory {
|
|||||||
/// Create fresh instance of VM
|
/// Create fresh instance of VM
|
||||||
/// Might choose implementation depending on supplied gas.
|
/// Might choose implementation depending on supplied gas.
|
||||||
pub fn create(&self, params: ActionParams, schedule: &Schedule, depth: usize) -> Box<dyn Exec> {
|
pub fn create(&self, params: ActionParams, schedule: &Schedule, depth: usize) -> Box<dyn Exec> {
|
||||||
match self.evm {
|
if Self::can_fit_in_usize(¶ms.gas) {
|
||||||
VMType::Interpreter => if Self::can_fit_in_usize(¶ms.gas) {
|
Box::new(super::interpreter::Interpreter::<usize>::new(params, self.evm_cache.clone(), schedule, depth))
|
||||||
Box::new(super::interpreter::Interpreter::<usize>::new(params, self.evm_cache.clone(), schedule, depth))
|
} else {
|
||||||
} else {
|
Box::new(super::interpreter::Interpreter::<U256>::new(params, self.evm_cache.clone(), schedule, depth))
|
||||||
Box::new(super::interpreter::Interpreter::<U256>::new(params, self.evm_cache.clone(), schedule, depth))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create new instance of specific `VMType` factory, with a size in bytes
|
/// Create new instance of a factory, with a size in bytes
|
||||||
/// for caching jump destinations.
|
/// for caching jump destinations.
|
||||||
pub fn new(evm: VMType, cache_size: usize) -> Self {
|
pub fn new(cache_size: usize) -> Self {
|
||||||
Factory {
|
Factory {
|
||||||
evm,
|
|
||||||
evm_cache: Arc::new(SharedCache::new(cache_size)),
|
evm_cache: Arc::new(SharedCache::new(cache_size)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,7 +56,6 @@ impl Default for Factory {
|
|||||||
/// Returns native rust evm factory
|
/// Returns native rust evm factory
|
||||||
fn default() -> Factory {
|
fn default() -> Factory {
|
||||||
Factory {
|
Factory {
|
||||||
evm: VMType::Interpreter,
|
|
||||||
evm_cache: Arc::new(SharedCache::default()),
|
evm_cache: Arc::new(SharedCache::default()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,7 +79,7 @@ macro_rules! evm_test(
|
|||||||
($name_test: ident: $name_int: ident) => {
|
($name_test: ident: $name_int: ident) => {
|
||||||
#[test]
|
#[test]
|
||||||
fn $name_int() {
|
fn $name_int() {
|
||||||
$name_test(Factory::new(VMType::Interpreter, 1024 * 32));
|
$name_test(Factory::new(1024 * 32));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -98,7 +92,7 @@ macro_rules! evm_test_ignore(
|
|||||||
#[ignore]
|
#[ignore]
|
||||||
#[cfg(feature = "ignored-tests")]
|
#[cfg(feature = "ignored-tests")]
|
||||||
fn $name_int() {
|
fn $name_int() {
|
||||||
$name_test(Factory::new(VMType::Interpreter, 1024 * 32));
|
$name_test(Factory::new(1024 * 32));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -1213,14 +1213,13 @@ fn address_to_u256(value: Address) -> U256 {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use rustc_hex::FromHex;
|
use rustc_hex::FromHex;
|
||||||
use vmtype::VMType;
|
|
||||||
use factory::Factory;
|
use factory::Factory;
|
||||||
use vm::{self, Exec, ActionParams, ActionValue};
|
use vm::{self, Exec, ActionParams, ActionValue};
|
||||||
use vm::tests::{FakeExt, test_finalize};
|
use vm::tests::{FakeExt, test_finalize};
|
||||||
use ethereum_types::Address;
|
use ethereum_types::Address;
|
||||||
|
|
||||||
fn interpreter(params: ActionParams, ext: &dyn vm::Ext) -> Box<dyn Exec> {
|
fn interpreter(params: ActionParams, ext: &dyn vm::Ext) -> Box<dyn Exec> {
|
||||||
Factory::new(VMType::Interpreter, 1).create(params, ext.schedule(), ext.depth())
|
Factory::new(1).create(params, ext.schedule(), ext.depth())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -41,7 +41,6 @@ pub mod interpreter;
|
|||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod factory;
|
pub mod factory;
|
||||||
mod vmtype;
|
|
||||||
mod instructions;
|
mod instructions;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@ -54,5 +53,4 @@ pub use vm::{
|
|||||||
};
|
};
|
||||||
pub use self::evm::{Finalize, FinalizationResult, CostType};
|
pub use self::evm::{Finalize, FinalizationResult, CostType};
|
||||||
pub use self::instructions::{InstructionInfo, Instruction};
|
pub use self::instructions::{InstructionInfo, Instruction};
|
||||||
pub use self::vmtype::VMType;
|
|
||||||
pub use self::factory::Factory;
|
pub use self::factory::Factory;
|
||||||
|
@ -23,7 +23,6 @@ use ethereum_types::{U256, H256, Address};
|
|||||||
use vm::{self, ActionParams, ActionValue, Ext};
|
use vm::{self, ActionParams, ActionValue, Ext};
|
||||||
use vm::tests::{FakeExt, FakeCall, FakeCallType, test_finalize};
|
use vm::tests::{FakeExt, FakeCall, FakeCallType, test_finalize};
|
||||||
use factory::Factory;
|
use factory::Factory;
|
||||||
use vmtype::VMType;
|
|
||||||
use hex_literal::hex;
|
use hex_literal::hex;
|
||||||
|
|
||||||
evm_test!{test_add: test_add_int}
|
evm_test!{test_add: test_add_int}
|
||||||
@ -705,7 +704,7 @@ fn test_signextend(factory: super::Factory) {
|
|||||||
|
|
||||||
#[test] // JIT just returns out of gas
|
#[test] // JIT just returns out of gas
|
||||||
fn test_badinstruction_int() {
|
fn test_badinstruction_int() {
|
||||||
let factory = super::Factory::new(VMType::Interpreter, 1024 * 32);
|
let factory = super::Factory::new(1024 * 32);
|
||||||
let code = hex!("af").to_vec();
|
let code = hex!("af").to_vec();
|
||||||
|
|
||||||
let mut params = ActionParams::default();
|
let mut params = ActionParams::default();
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
|
||||||
// This file is part of Parity Ethereum.
|
|
||||||
|
|
||||||
// Parity Ethereum is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
|
|
||||||
// Parity Ethereum is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use std::fmt;
|
|
||||||
|
|
||||||
/// Type of EVM to use.
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
|
||||||
pub enum VMType {
|
|
||||||
/// RUST EVM
|
|
||||||
Interpreter
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Display for VMType {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
write!(f, "{}", match *self {
|
|
||||||
VMType::Interpreter => "INT"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for VMType {
|
|
||||||
fn default() -> Self {
|
|
||||||
VMType::Interpreter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl VMType {
|
|
||||||
/// Return all possible VMs (Interpreter)
|
|
||||||
pub fn all() -> Vec<VMType> {
|
|
||||||
vec![VMType::Interpreter]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1234,7 +1234,7 @@ mod tests {
|
|||||||
transaction::{Action, Transaction},
|
transaction::{Action, Transaction},
|
||||||
};
|
};
|
||||||
use parity_crypto::publickey::{Generator, Random};
|
use parity_crypto::publickey::{Generator, Random};
|
||||||
use evm::{Factory, VMType, evm_test, evm_test_ignore};
|
use evm::{Factory, evm_test, evm_test_ignore};
|
||||||
use macros::vec_into;
|
use macros::vec_into;
|
||||||
use vm::{ActionParams, ActionValue, CallType, EnvInfo, CreateContractAddress};
|
use vm::{ActionParams, ActionValue, CallType, EnvInfo, CreateContractAddress};
|
||||||
use ::trace::{
|
use ::trace::{
|
||||||
|
@ -725,7 +725,7 @@ impl Client {
|
|||||||
|
|
||||||
let trie_factory = TrieFactory::new(trie_spec, Layout);
|
let trie_factory = TrieFactory::new(trie_spec, Layout);
|
||||||
let factories = Factories {
|
let factories = Factories {
|
||||||
vm: VmFactory::new(config.vm_type.clone(), config.jump_table_size),
|
vm: VmFactory::new(config.jump_table_size),
|
||||||
trie: trie_factory,
|
trie: trie_factory,
|
||||||
accountdb: Default::default(),
|
accountdb: Default::default(),
|
||||||
};
|
};
|
||||||
|
@ -23,8 +23,6 @@ use trace::Config as TraceConfig;
|
|||||||
use types::client_types::Mode;
|
use types::client_types::Mode;
|
||||||
use verification::{VerifierType, QueueConfig};
|
use verification::{VerifierType, QueueConfig};
|
||||||
|
|
||||||
pub use evm::VMType;
|
|
||||||
|
|
||||||
/// Client state db compaction profile
|
/// Client state db compaction profile
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
pub enum DatabaseCompactionProfile {
|
pub enum DatabaseCompactionProfile {
|
||||||
@ -64,8 +62,6 @@ pub struct ClientConfig {
|
|||||||
pub blockchain: BlockChainConfig,
|
pub blockchain: BlockChainConfig,
|
||||||
/// Trace configuration.
|
/// Trace configuration.
|
||||||
pub tracing: TraceConfig,
|
pub tracing: TraceConfig,
|
||||||
/// VM type.
|
|
||||||
pub vm_type: VMType,
|
|
||||||
/// Fat DB enabled?
|
/// Fat DB enabled?
|
||||||
pub fat_db: bool,
|
pub fat_db: bool,
|
||||||
/// The JournalDB ("pruning") algorithm to use.
|
/// The JournalDB ("pruning") algorithm to use.
|
||||||
@ -107,7 +103,6 @@ impl Default for ClientConfig {
|
|||||||
queue: Default::default(),
|
queue: Default::default(),
|
||||||
blockchain: Default::default(),
|
blockchain: Default::default(),
|
||||||
tracing: Default::default(),
|
tracing: Default::default(),
|
||||||
vm_type: Default::default(),
|
|
||||||
fat_db: false,
|
fat_db: false,
|
||||||
pruning: journaldb::Algorithm::OverlayRecent,
|
pruning: journaldb::Algorithm::OverlayRecent,
|
||||||
name: "default".into(),
|
name: "default".into(),
|
||||||
|
@ -23,7 +23,7 @@ mod config;
|
|||||||
mod traits;
|
mod traits;
|
||||||
|
|
||||||
pub use self::client::Client;
|
pub use self::client::Client;
|
||||||
pub use self::config::{ClientConfig, DatabaseCompactionProfile, VMType};
|
pub use self::config::{ClientConfig, DatabaseCompactionProfile};
|
||||||
pub use self::traits::{
|
pub use self::traits::{
|
||||||
ReopenBlock, PrepareOpenBlock, ImportSealedBlock, BroadcastProposalBlock,
|
ReopenBlock, PrepareOpenBlock, ImportSealedBlock, BroadcastProposalBlock,
|
||||||
Call, EngineInfo, BlockProducer, SealedBlockImporter,
|
Call, EngineInfo, BlockProducer, SealedBlockImporter,
|
||||||
|
@ -18,7 +18,7 @@ use std::path::Path;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use super::test_common::*;
|
use super::test_common::*;
|
||||||
use account_state::{Backend as StateBackend, State};
|
use account_state::{Backend as StateBackend, State};
|
||||||
use evm::{VMType, Finalize};
|
use evm::Finalize;
|
||||||
use vm::{
|
use vm::{
|
||||||
self, ActionParams, CallType, Schedule, Ext,
|
self, ActionParams, CallType, Schedule, Ext,
|
||||||
ContractCreateResult, EnvInfo, MessageCallResult,
|
ContractCreateResult, EnvInfo, MessageCallResult,
|
||||||
@ -235,17 +235,8 @@ impl<'a, T: 'a, V: 'a, B: 'a> Ext for TestExt<'a, T, V, B>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_json_test<H: FnMut(&str, HookType)>(path: &Path, json_data: &[u8], h: &mut H) -> Vec<String> {
|
fn do_json_test<H: FnMut(&str, HookType)>(
|
||||||
let vms = VMType::all();
|
|
||||||
vms
|
|
||||||
.iter()
|
|
||||||
.flat_map(|vm| do_json_test_for(path, vm, json_data, h))
|
|
||||||
.collect()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn do_json_test_for<H: FnMut(&str, HookType)>(
|
|
||||||
path: &Path,
|
path: &Path,
|
||||||
vm_type: &VMType,
|
|
||||||
json_data: &[u8],
|
json_data: &[u8],
|
||||||
start_stop_hook: &mut H
|
start_stop_hook: &mut H
|
||||||
) -> Vec<String> {
|
) -> Vec<String> {
|
||||||
@ -254,13 +245,13 @@ fn do_json_test_for<H: FnMut(&str, HookType)>(
|
|||||||
let mut failed = Vec::new();
|
let mut failed = Vec::new();
|
||||||
|
|
||||||
for (name, vm) in tests.into_iter() {
|
for (name, vm) in tests.into_iter() {
|
||||||
start_stop_hook(&format!("{}-{}", name, vm_type), HookType::OnStart);
|
start_stop_hook(&format!("{}", name), HookType::OnStart);
|
||||||
|
|
||||||
info!(target: "jsontests", "name: {:?}", name);
|
info!(target: "jsontests", "name: {:?}", name);
|
||||||
let mut fail = false;
|
let mut fail = false;
|
||||||
|
|
||||||
let mut fail_unless = |cond: bool, s: &str | if !cond && !fail {
|
let mut fail_unless = |cond: bool, s: &str | if !cond && !fail {
|
||||||
failed.push(format!("[{}] {}: {}", vm_type, name, s));
|
failed.push(format!("{}: {}", name, s));
|
||||||
fail = true
|
fail = true
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -363,7 +354,7 @@ fn do_json_test_for<H: FnMut(&str, HookType)>(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
start_stop_hook(&format!("{}-{}", name, vm_type), HookType::OnStop);
|
start_stop_hook(&format!("{}", name), HookType::OnStop);
|
||||||
}
|
}
|
||||||
|
|
||||||
for f in &failed {
|
for f in &failed {
|
||||||
|
@ -31,7 +31,7 @@ use types::{
|
|||||||
};
|
};
|
||||||
use ethjson::spec::ForkSpec;
|
use ethjson::spec::ForkSpec;
|
||||||
use trie_vm_factories::Factories;
|
use trie_vm_factories::Factories;
|
||||||
use evm::{VMType, FinalizationResult};
|
use evm::FinalizationResult;
|
||||||
use vm::{self, ActionParams, CreateContractAddress};
|
use vm::{self, ActionParams, CreateContractAddress};
|
||||||
use ethtrie;
|
use ethtrie;
|
||||||
use account_state::{CleanupMode, State};
|
use account_state::{CleanupMode, State};
|
||||||
@ -158,7 +158,7 @@ impl<'a> EvmTestClient<'a> {
|
|||||||
|
|
||||||
fn factories(trie_spec: trie::TrieSpec) -> Factories {
|
fn factories(trie_spec: trie::TrieSpec) -> Factories {
|
||||||
Factories {
|
Factories {
|
||||||
vm: trie_vm_factories::VmFactory::new(VMType::Interpreter, 5 * 1024),
|
vm: trie_vm_factories::VmFactory::new(5 * 1024),
|
||||||
trie: trie::TrieFactory::new(trie_spec, ethtrie::Layout),
|
trie: trie::TrieFactory::new(trie_spec, ethtrie::Layout),
|
||||||
accountdb: Default::default(),
|
accountdb: Default::default(),
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use hash::keccak;
|
use hash::keccak;
|
||||||
use vm::{EnvInfo, ActionParams, ActionValue, CallType, ParamsType};
|
use vm::{EnvInfo, ActionParams, ActionValue, CallType, ParamsType};
|
||||||
use evm::{Factory, VMType};
|
use evm::Factory;
|
||||||
use machine::{
|
use machine::{
|
||||||
executive::Executive,
|
executive::Executive,
|
||||||
substate::Substate,
|
substate::Substate,
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
use trie_db::TrieFactory;
|
use trie_db::TrieFactory;
|
||||||
use ethtrie::Layout;
|
use ethtrie::Layout;
|
||||||
use account_db::Factory as AccountFactory;
|
use account_db::Factory as AccountFactory;
|
||||||
use evm::{Factory as EvmFactory, VMType};
|
use evm::{Factory as EvmFactory};
|
||||||
use vm::{Exec, ActionParams, VersionedSchedule, Schedule};
|
use vm::{Exec, ActionParams, VersionedSchedule, Schedule};
|
||||||
use wasm::WasmInterpreter;
|
use wasm::WasmInterpreter;
|
||||||
|
|
||||||
@ -49,14 +49,14 @@ impl VmFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(evm: VMType, cache_size: usize) -> Self {
|
pub fn new(cache_size: usize) -> Self {
|
||||||
VmFactory { evm: EvmFactory::new(evm, cache_size) }
|
VmFactory { evm: EvmFactory::new(cache_size) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<EvmFactory> for VmFactory {
|
impl From<EvmFactory> for VmFactory {
|
||||||
fn from(evm: EvmFactory) -> Self {
|
fn from(evm: EvmFactory) -> Self {
|
||||||
VmFactory { evm: evm }
|
VmFactory { evm }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ use bytes::ToPretty;
|
|||||||
use rlp::PayloadInfo;
|
use rlp::PayloadInfo;
|
||||||
use client_traits::{BlockChainReset, Nonce, Balance, BlockChainClient, ImportExportBlocks};
|
use client_traits::{BlockChainReset, Nonce, Balance, BlockChainClient, ImportExportBlocks};
|
||||||
use ethcore::{
|
use ethcore::{
|
||||||
client::{DatabaseCompactionProfile, VMType},
|
client::{DatabaseCompactionProfile},
|
||||||
miner::Miner,
|
miner::Miner,
|
||||||
};
|
};
|
||||||
use ethcore_service::ClientService;
|
use ethcore_service::ClientService;
|
||||||
@ -92,7 +92,6 @@ pub struct ImportBlockchain {
|
|||||||
pub compaction: DatabaseCompactionProfile,
|
pub compaction: DatabaseCompactionProfile,
|
||||||
pub tracing: Switch,
|
pub tracing: Switch,
|
||||||
pub fat_db: Switch,
|
pub fat_db: Switch,
|
||||||
pub vm_type: VMType,
|
|
||||||
pub check_seal: bool,
|
pub check_seal: bool,
|
||||||
pub with_color: bool,
|
pub with_color: bool,
|
||||||
pub verifier_settings: VerifierSettings,
|
pub verifier_settings: VerifierSettings,
|
||||||
@ -351,7 +350,6 @@ fn execute_import(cmd: ImportBlockchain) -> Result<(), String> {
|
|||||||
tracing,
|
tracing,
|
||||||
fat_db,
|
fat_db,
|
||||||
cmd.compaction,
|
cmd.compaction,
|
||||||
cmd.vm_type,
|
|
||||||
"".into(),
|
"".into(),
|
||||||
algorithm,
|
algorithm,
|
||||||
cmd.pruning_history,
|
cmd.pruning_history,
|
||||||
@ -488,7 +486,6 @@ fn start_client(
|
|||||||
tracing,
|
tracing,
|
||||||
fat_db,
|
fat_db,
|
||||||
compaction,
|
compaction,
|
||||||
VMType::default(),
|
|
||||||
"".into(),
|
"".into(),
|
||||||
algorithm,
|
algorithm,
|
||||||
pruning_history,
|
pruning_history,
|
||||||
|
@ -29,7 +29,6 @@ use bytes::Bytes;
|
|||||||
use ansi_term::Colour;
|
use ansi_term::Colour;
|
||||||
use sync::{NetworkConfiguration, validate_node_url, self};
|
use sync::{NetworkConfiguration, validate_node_url, self};
|
||||||
use parity_crypto::publickey::{Secret, Public};
|
use parity_crypto::publickey::{Secret, Public};
|
||||||
use ethcore::client::VMType;
|
|
||||||
use ethcore::miner::{stratum, MinerOptions};
|
use ethcore::miner::{stratum, MinerOptions};
|
||||||
use snapshot::SnapshotConfiguration;
|
use snapshot::SnapshotConfiguration;
|
||||||
use miner::pool;
|
use miner::pool;
|
||||||
@ -120,7 +119,6 @@ impl Configuration {
|
|||||||
let dirs = self.directories();
|
let dirs = self.directories();
|
||||||
let pruning = self.args.arg_pruning.parse()?;
|
let pruning = self.args.arg_pruning.parse()?;
|
||||||
let pruning_history = self.args.arg_pruning_history;
|
let pruning_history = self.args.arg_pruning_history;
|
||||||
let vm_type = self.vm_type()?;
|
|
||||||
let spec = self.chain()?;
|
let spec = self.chain()?;
|
||||||
let mode = match self.args.arg_mode.as_ref() {
|
let mode = match self.args.arg_mode.as_ref() {
|
||||||
"last" => None,
|
"last" => None,
|
||||||
@ -259,7 +257,6 @@ impl Configuration {
|
|||||||
compaction: compaction,
|
compaction: compaction,
|
||||||
tracing: tracing,
|
tracing: tracing,
|
||||||
fat_db: fat_db,
|
fat_db: fat_db,
|
||||||
vm_type: vm_type,
|
|
||||||
check_seal: !self.args.flag_no_seal_check,
|
check_seal: !self.args.flag_no_seal_check,
|
||||||
with_color: logger_config.color,
|
with_color: logger_config.color,
|
||||||
verifier_settings: self.verifier_settings(),
|
verifier_settings: self.verifier_settings(),
|
||||||
@ -394,7 +391,6 @@ impl Configuration {
|
|||||||
tracing,
|
tracing,
|
||||||
fat_db,
|
fat_db,
|
||||||
compaction,
|
compaction,
|
||||||
vm_type,
|
|
||||||
warp_sync,
|
warp_sync,
|
||||||
warp_barrier: self.args.arg_warp_barrier,
|
warp_barrier: self.args.arg_warp_barrier,
|
||||||
geth_compatibility,
|
geth_compatibility,
|
||||||
@ -430,10 +426,6 @@ impl Configuration {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn vm_type(&self) -> Result<VMType, String> {
|
|
||||||
Ok(VMType::Interpreter)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn miner_extras(&self) -> Result<MinerExtras, String> {
|
fn miner_extras(&self) -> Result<MinerExtras, String> {
|
||||||
let floor = to_u256(&self.args.arg_gas_floor_target)?;
|
let floor = to_u256(&self.args.arg_gas_floor_target)?;
|
||||||
let ceil = to_u256(&self.args.arg_gas_cap)?;
|
let ceil = to_u256(&self.args.arg_gas_cap)?;
|
||||||
@ -1200,7 +1192,6 @@ mod tests {
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use tempdir::TempDir;
|
use tempdir::TempDir;
|
||||||
use ethcore::client::VMType;
|
|
||||||
use ethcore::miner::MinerOptions;
|
use ethcore::miner::MinerOptions;
|
||||||
use miner::pool::PrioritizationStrategy;
|
use miner::pool::PrioritizationStrategy;
|
||||||
use parity_rpc::NetworkSettings;
|
use parity_rpc::NetworkSettings;
|
||||||
@ -1305,7 +1296,6 @@ mod tests {
|
|||||||
compaction: Default::default(),
|
compaction: Default::default(),
|
||||||
tracing: Default::default(),
|
tracing: Default::default(),
|
||||||
fat_db: Default::default(),
|
fat_db: Default::default(),
|
||||||
vm_type: VMType::Interpreter,
|
|
||||||
check_seal: true,
|
check_seal: true,
|
||||||
with_color: !cfg!(windows),
|
with_color: !cfg!(windows),
|
||||||
verifier_settings: Default::default(),
|
verifier_settings: Default::default(),
|
||||||
@ -1458,7 +1448,6 @@ mod tests {
|
|||||||
mode: Default::default(),
|
mode: Default::default(),
|
||||||
tracing: Default::default(),
|
tracing: Default::default(),
|
||||||
compaction: Default::default(),
|
compaction: Default::default(),
|
||||||
vm_type: Default::default(),
|
|
||||||
geth_compatibility: false,
|
geth_compatibility: false,
|
||||||
experimental_rpcs: false,
|
experimental_rpcs: false,
|
||||||
net_settings: Default::default(),
|
net_settings: Default::default(),
|
||||||
|
@ -21,7 +21,7 @@ use std::fs::File;
|
|||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use ethereum_types::{U256, Address};
|
use ethereum_types::{U256, Address};
|
||||||
use journaldb::Algorithm;
|
use journaldb::Algorithm;
|
||||||
use ethcore::client::{VMType, DatabaseCompactionProfile, ClientConfig};
|
use ethcore::client::{DatabaseCompactionProfile, ClientConfig};
|
||||||
use ethcore::miner::{PendingSet, Penalization};
|
use ethcore::miner::{PendingSet, Penalization};
|
||||||
use verification::VerifierType;
|
use verification::VerifierType;
|
||||||
use miner::pool::PrioritizationStrategy;
|
use miner::pool::PrioritizationStrategy;
|
||||||
@ -232,7 +232,6 @@ pub fn to_client_config(
|
|||||||
tracing: bool,
|
tracing: bool,
|
||||||
fat_db: bool,
|
fat_db: bool,
|
||||||
compaction: DatabaseCompactionProfile,
|
compaction: DatabaseCompactionProfile,
|
||||||
vm_type: VMType,
|
|
||||||
name: String,
|
name: String,
|
||||||
pruning: Algorithm,
|
pruning: Algorithm,
|
||||||
pruning_history: u64,
|
pruning_history: u64,
|
||||||
@ -268,7 +267,6 @@ pub fn to_client_config(
|
|||||||
client_config.pruning = pruning;
|
client_config.pruning = pruning;
|
||||||
client_config.history = pruning_history;
|
client_config.history = pruning_history;
|
||||||
client_config.db_compaction = compaction;
|
client_config.db_compaction = compaction;
|
||||||
client_config.vm_type = vm_type;
|
|
||||||
client_config.name = name;
|
client_config.name = name;
|
||||||
client_config.verifier_type = if check_seal { VerifierType::Canon } else { VerifierType::CanonNoSeal };
|
client_config.verifier_type = if check_seal { VerifierType::Canon } else { VerifierType::CanonNoSeal };
|
||||||
client_config.spec_name = spec_name;
|
client_config.spec_name = spec_name;
|
||||||
|
@ -21,7 +21,7 @@ use std::thread;
|
|||||||
|
|
||||||
use ansi_term::Colour;
|
use ansi_term::Colour;
|
||||||
use client_traits::{BlockInfo, BlockChainClient};
|
use client_traits::{BlockInfo, BlockChainClient};
|
||||||
use ethcore::client::{Client, DatabaseCompactionProfile, VMType};
|
use ethcore::client::{Client, DatabaseCompactionProfile};
|
||||||
use ethcore::miner::{self, stratum, Miner, MinerService, MinerOptions};
|
use ethcore::miner::{self, stratum, Miner, MinerService, MinerOptions};
|
||||||
use snapshot::{self, SnapshotConfiguration};
|
use snapshot::{self, SnapshotConfiguration};
|
||||||
use spec::SpecParams;
|
use spec::SpecParams;
|
||||||
@ -113,7 +113,6 @@ pub struct RunCmd {
|
|||||||
pub tracing: Switch,
|
pub tracing: Switch,
|
||||||
pub fat_db: Switch,
|
pub fat_db: Switch,
|
||||||
pub compaction: DatabaseCompactionProfile,
|
pub compaction: DatabaseCompactionProfile,
|
||||||
pub vm_type: VMType,
|
|
||||||
pub geth_compatibility: bool,
|
pub geth_compatibility: bool,
|
||||||
pub experimental_rpcs: bool,
|
pub experimental_rpcs: bool,
|
||||||
pub net_settings: NetworkSettings,
|
pub net_settings: NetworkSettings,
|
||||||
@ -531,7 +530,6 @@ fn execute_impl<Cr, Rr>(
|
|||||||
tracing,
|
tracing,
|
||||||
fat_db,
|
fat_db,
|
||||||
cmd.compaction,
|
cmd.compaction,
|
||||||
cmd.vm_type,
|
|
||||||
cmd.name,
|
cmd.name,
|
||||||
algorithm,
|
algorithm,
|
||||||
cmd.pruning_history,
|
cmd.pruning_history,
|
||||||
|
@ -24,7 +24,7 @@ use hash::keccak;
|
|||||||
use snapshot::{SnapshotConfiguration, SnapshotService as SS, SnapshotClient};
|
use snapshot::{SnapshotConfiguration, SnapshotService as SS, SnapshotClient};
|
||||||
use snapshot::io::{SnapshotReader, PackedReader, PackedWriter};
|
use snapshot::io::{SnapshotReader, PackedReader, PackedWriter};
|
||||||
use snapshot::service::Service as SnapshotService;
|
use snapshot::service::Service as SnapshotService;
|
||||||
use ethcore::client::{Client, DatabaseCompactionProfile, VMType};
|
use ethcore::client::{Client, DatabaseCompactionProfile};
|
||||||
use ethcore::miner::Miner;
|
use ethcore::miner::Miner;
|
||||||
use ethcore_service::ClientService;
|
use ethcore_service::ClientService;
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
@ -180,7 +180,6 @@ impl SnapshotCommand {
|
|||||||
tracing,
|
tracing,
|
||||||
fat_db,
|
fat_db,
|
||||||
self.compaction,
|
self.compaction,
|
||||||
VMType::default(),
|
|
||||||
"".into(),
|
"".into(),
|
||||||
algorithm,
|
algorithm,
|
||||||
self.pruning_history,
|
self.pruning_history,
|
||||||
|
Loading…
Reference in New Issue
Block a user