Merge pull request #468 from ethcore/ethcore_compiling
compiling ethcore on beta
This commit is contained in:
commit
d2349cdd8e
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -174,7 +174,7 @@ dependencies = [
|
|||||||
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ethash 0.9.99",
|
"ethash 0.9.99",
|
||||||
"ethcore-util 0.9.99",
|
"ethcore-util 0.9.99",
|
||||||
"heapsize 0.3.2 (git+https://github.com/nikvolf/heapsize)",
|
"heapsize 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -212,7 +212,7 @@ dependencies = [
|
|||||||
"elastic-array 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"elastic-array 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"env_logger 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"eth-secp256k1 0.5.4 (git+https://github.com/arkpar/rust-secp256k1.git)",
|
"eth-secp256k1 0.5.4 (git+https://github.com/arkpar/rust-secp256k1.git)",
|
||||||
"heapsize 0.3.2 (git+https://github.com/nikvolf/heapsize)",
|
"heapsize 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"igd 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"igd 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"itertools 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"itertools 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"json-tests 0.1.0",
|
"json-tests 0.1.0",
|
||||||
@ -264,7 +264,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "heapsize"
|
name = "heapsize"
|
||||||
version = "0.3.2"
|
version = "0.3.2"
|
||||||
source = "git+https://github.com/nikvolf/heapsize#a2d682fd4dcf11e2deeeb229ef2375354c15668b"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hpack"
|
name = "hpack"
|
||||||
|
@ -11,7 +11,7 @@ log = "0.3"
|
|||||||
env_logger = "0.3"
|
env_logger = "0.3"
|
||||||
rustc-serialize = "0.3"
|
rustc-serialize = "0.3"
|
||||||
rocksdb = "0.3"
|
rocksdb = "0.3"
|
||||||
heapsize = { git = "https://github.com/nikvolf/heapsize" }
|
heapsize = "0.3"
|
||||||
rust-crypto = "0.2.34"
|
rust-crypto = "0.2.34"
|
||||||
time = "0.1"
|
time = "0.1"
|
||||||
ethcore-util = { path = "../util" }
|
ethcore-util = { path = "../util" }
|
||||||
@ -25,7 +25,7 @@ lazy_static = "0.1"
|
|||||||
[features]
|
[features]
|
||||||
jit = ["evmjit"]
|
jit = ["evmjit"]
|
||||||
evm-debug = []
|
evm-debug = []
|
||||||
json-tests = [ "heapsize/nightly" ]
|
json-tests = []
|
||||||
test-heavy = []
|
test-heavy = []
|
||||||
dev = ["clippy"]
|
dev = ["clippy"]
|
||||||
default = [ "heapsize/nightly" ]
|
default = []
|
||||||
|
@ -267,7 +267,7 @@ impl<'x, 'y> OpenBlock<'x, 'y> {
|
|||||||
s.block.base.header.uncles_hash = uncle_bytes.sha3();
|
s.block.base.header.uncles_hash = uncle_bytes.sha3();
|
||||||
s.block.base.header.state_root = s.block.state.root().clone();
|
s.block.base.header.state_root = s.block.state.root().clone();
|
||||||
s.block.base.header.receipts_root = ordered_trie_root(s.block.receipts.iter().map(|ref r| r.rlp_bytes().to_vec()).collect());
|
s.block.base.header.receipts_root = ordered_trie_root(s.block.receipts.iter().map(|ref r| r.rlp_bytes().to_vec()).collect());
|
||||||
s.block.base.header.log_bloom = s.block.receipts.iter().fold(LogBloom::zero(), |mut b, r| {b |= &r.log_bloom; b});
|
s.block.base.header.log_bloom = s.block.receipts.iter().fold(LogBloom::zero(), |mut b, r| {b = &b | &r.log_bloom; b});
|
||||||
s.block.base.header.gas_used = s.block.receipts.last().map_or(U256::zero(), |r| r.gas_used);
|
s.block.base.header.gas_used = s.block.receipts.last().map_or(U256::zero(), |r| r.gas_used);
|
||||||
s.block.base.header.note_dirty();
|
s.block.base.header.note_dirty();
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ impl ClientReport {
|
|||||||
pub fn accrue_block(&mut self, block: &PreVerifiedBlock) {
|
pub fn accrue_block(&mut self, block: &PreVerifiedBlock) {
|
||||||
self.blocks_imported += 1;
|
self.blocks_imported += 1;
|
||||||
self.transactions_applied += block.transactions.len();
|
self.transactions_applied += block.transactions.len();
|
||||||
self.gas_processed += block.header.gas_used;
|
self.gas_processed = self.gas_processed + block.header.gas_used;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ impl evm::Evm for Interpreter {
|
|||||||
let (gas_cost, mem_size) = try!(self.get_gas_cost_mem(ext, instruction, &mut mem, &stack));
|
let (gas_cost, mem_size) = try!(self.get_gas_cost_mem(ext, instruction, &mut mem, &stack));
|
||||||
try!(self.verify_gas(¤t_gas, &gas_cost));
|
try!(self.verify_gas(¤t_gas, &gas_cost));
|
||||||
mem.expand(mem_size);
|
mem.expand(mem_size);
|
||||||
current_gas -= gas_cost;
|
current_gas = current_gas - gas_cost;
|
||||||
|
|
||||||
evm_debug!({
|
evm_debug!({
|
||||||
println!("[0x{:x}][{}(0x{:x}) Gas: {:x}\n Gas Before: {:x}",
|
println!("[0x{:x}][{}(0x{:x}) Gas: {:x}\n Gas Before: {:x}",
|
||||||
@ -320,7 +320,7 @@ impl evm::Evm for Interpreter {
|
|||||||
match result {
|
match result {
|
||||||
InstructionResult::Ok => {},
|
InstructionResult::Ok => {},
|
||||||
InstructionResult::UnusedGas(gas) => {
|
InstructionResult::UnusedGas(gas) => {
|
||||||
current_gas += gas;
|
current_gas = current_gas + gas;
|
||||||
},
|
},
|
||||||
InstructionResult::UseAllGas => {
|
InstructionResult::UseAllGas => {
|
||||||
current_gas = U256::zero();
|
current_gas = U256::zero();
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
// Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref.
|
// Keeps consistency (all lines with `.clone()`) and helpful when changing ref to non-ref.
|
||||||
#![allow(clone_on_copy)]
|
#![allow(clone_on_copy)]
|
||||||
|
|
||||||
|
|
||||||
//! Ethcore library
|
//! Ethcore library
|
||||||
//!
|
//!
|
||||||
//! ### Rust version:
|
//! ### Rust version:
|
||||||
|
@ -39,7 +39,7 @@ impl Receipt {
|
|||||||
Receipt {
|
Receipt {
|
||||||
state_root: state_root,
|
state_root: state_root,
|
||||||
gas_used: gas_used,
|
gas_used: gas_used,
|
||||||
log_bloom: logs.iter().fold(LogBloom::new(), |mut b, l| { b |= &l.bloom(); b }),
|
log_bloom: logs.iter().fold(LogBloom::new(), |mut b, l| { b = b | l.bloom(); b }),
|
||||||
logs: logs,
|
logs: logs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ impl State {
|
|||||||
|
|
||||||
/// Pull account `a` in our cache from the trie DB and return it.
|
/// Pull account `a` in our cache from the trie DB and return it.
|
||||||
/// `require_code` requires that the code be cached, too.
|
/// `require_code` requires that the code be cached, too.
|
||||||
fn get(&self, a: &Address, require_code: bool) -> Ref<Option<Account>> {
|
fn get<'a>(&'a self, a: &Address, require_code: bool) -> &'a Option<Account> {
|
||||||
let have_key = self.cache.borrow().contains_key(a);
|
let have_key = self.cache.borrow().contains_key(a);
|
||||||
if !have_key {
|
if !have_key {
|
||||||
self.insert_cache(a, SecTrieDB::new(&self.db, &self.root).get(&a).map(Account::from_rlp))
|
self.insert_cache(a, SecTrieDB::new(&self.db, &self.root).get(&a).map(Account::from_rlp))
|
||||||
@ -292,17 +292,17 @@ impl State {
|
|||||||
account.cache_code(&AccountDB::new(&self.db, a));
|
account.cache_code(&AccountDB::new(&self.db, a));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ref::map(self.cache.borrow(), |m| m.get(a).unwrap())
|
unsafe { ::std::mem::transmute(self.cache.borrow().get(a).unwrap()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Pull account `a` in our cache from the trie DB. `require_code` requires that the code be cached, too.
|
/// Pull account `a` in our cache from the trie DB. `require_code` requires that the code be cached, too.
|
||||||
fn require(&self, a: &Address, require_code: bool) -> RefMut<Account> {
|
fn require<'a>(&'a self, a: &Address, require_code: bool) -> &'a mut Account {
|
||||||
self.require_or_from(a, require_code, || Account::new_basic(U256::from(0u8), self.account_start_nonce), |_|{})
|
self.require_or_from(a, require_code, || Account::new_basic(U256::from(0u8), self.account_start_nonce), |_|{})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Pull account `a` in our cache from the trie DB. `require_code` requires that the code be cached, too.
|
/// Pull account `a` in our cache from the trie DB. `require_code` requires that the code be cached, too.
|
||||||
/// If it doesn't exist, make account equal the evaluation of `default`.
|
/// If it doesn't exist, make account equal the evaluation of `default`.
|
||||||
fn require_or_from<F: FnOnce() -> Account, G: FnOnce(&mut Account)>(&self, a: &Address, require_code: bool, default: F, not_default: G) -> RefMut<Account> {
|
fn require_or_from<'a, F: FnOnce() -> Account, G: FnOnce(&mut Account)>(&self, a: &Address, require_code: bool, default: F, not_default: G) -> &'a mut Account {
|
||||||
let have_key = self.cache.borrow().contains_key(a);
|
let have_key = self.cache.borrow().contains_key(a);
|
||||||
if !have_key {
|
if !have_key {
|
||||||
self.insert_cache(a, SecTrieDB::new(&self.db, &self.root).get(&a).map(Account::from_rlp))
|
self.insert_cache(a, SecTrieDB::new(&self.db, &self.root).get(&a).map(Account::from_rlp))
|
||||||
@ -316,13 +316,12 @@ impl State {
|
|||||||
not_default(self.cache.borrow_mut().get_mut(a).unwrap().as_mut().unwrap());
|
not_default(self.cache.borrow_mut().get_mut(a).unwrap().as_mut().unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
let b = self.cache.borrow_mut();
|
unsafe { ::std::mem::transmute(self.cache.borrow_mut().get_mut(a).unwrap().as_mut().map(|account| {
|
||||||
RefMut::map(b, |m| m.get_mut(a).unwrap().as_mut().map(|account| {
|
|
||||||
if require_code {
|
if require_code {
|
||||||
account.cache_code(&AccountDB::new(&self.db, a));
|
account.cache_code(&AccountDB::new(&self.db, a));
|
||||||
}
|
}
|
||||||
account
|
account
|
||||||
}).unwrap())
|
}).unwrap()) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ lazy_static = "0.1"
|
|||||||
eth-secp256k1 = { git = "https://github.com/arkpar/rust-secp256k1.git" }
|
eth-secp256k1 = { git = "https://github.com/arkpar/rust-secp256k1.git" }
|
||||||
rust-crypto = "0.2.34"
|
rust-crypto = "0.2.34"
|
||||||
elastic-array = "0.4"
|
elastic-array = "0.4"
|
||||||
heapsize = { git = "https://github.com/nikvolf/heapsize" }
|
heapsize = "0.3"
|
||||||
itertools = "0.4"
|
itertools = "0.4"
|
||||||
crossbeam = "0.2"
|
crossbeam = "0.2"
|
||||||
slab = { git = "https://github.com/arkpar/slab.git" }
|
slab = { git = "https://github.com/arkpar/slab.git" }
|
||||||
|
Loading…
Reference in New Issue
Block a user