Compare commits

..

25 Commits

Author SHA1 Message Date
5chdn
99bca182d3 Fix Cargo.lock 2018-04-21 12:43:36 +02:00
5chdn
743d392cf7 Revert Cargo lock update from master 2018-04-21 11:48:06 +02:00
Sergey Pepyakin
f439d3a4d1 Update wasmi (#8452) 2018-04-21 11:37:15 +02:00
Afri Schoedon
fe819e90d3 Allow 32 bit pipelines to fail (#8454)
* Disable 32bit tragets for gitlab

* Rename linux pipelines
2018-04-21 11:25:35 +02:00
5chdn
0d89093c49 Update Parity stable to 1.9.7 2018-04-20 18:13:08 +02:00
GitLab Build Bot
c48a69684f [ci skip] js-precompiled 20180420-150741 2018-04-20 15:08:32 +00:00
GitLab Build Bot
ca436e87a7 [ci skip] js-precompiled 20180420-134106 2018-04-20 13:43:33 +00:00
Wei Tang
014d0ac160 [stable] Backports (#8449)
* Use forked app_dirs crate for reverted Windows dir behavior  (#8438)

* Remove unused appdirs dependency in CLI

* Use forked app_dirs crate for reverted Windows dir behavior

* remove Tendermint extra_info due to seal inconsistencies (#8367)

* Improve VM executor stack size estimation rules (#8439)

* Improve VM executor stack size estimation rules

* typo: docs add "(Debug build)" comment

* Fix an off by one typo and set minimal stack size

This avoids the case if `depth_threshold == max_depth`. Usually setting stack size to zero will just rebound it to
platform minimal stack size, but we set it here just in case.

* Use saturating_sub to avoid potential overflow

* Upgrade crossbeam to 0.3
2018-04-20 15:21:40 +02:00
GitLab Build Bot
302dbd5f05 [ci skip] js-precompiled 20180416-122027 2018-04-16 12:21:21 +00:00
GitLab Build Bot
57746382d3 [ci skip] js-precompiled 20180416-111448 2018-04-16 11:15:49 +00:00
5chdn
df9297762d Revert "Do a meaningful commit that does not contain the words "ci" or "skip"" 2018-04-16 12:50:58 +02:00
GitLab Build Bot
651cb39797 [ci skip] js-precompiled 20180410-152015 2018-04-10 15:21:11 +00:00
GitLab Build Bot
440e4aea51 [ci skip] js-precompiled 20180410-141227 2018-04-10 14:13:44 +00:00
Marek Kotewicz
8767799394 bump app_dirs, fixes #8315 (#8355) 2018-04-10 15:58:26 +02:00
GitLab Build Bot
024b00cc3a [ci skip] js-precompiled 20180410-124550 2018-04-10 12:46:39 +00:00
GitLab Build Bot
c790d07200 [ci skip] js-precompiled 20180410-121113 2018-04-10 12:12:00 +00:00
5chdn
e4c174cec3 Fix Cargo lock 2018-04-10 14:00:57 +02:00
Tomasz Drwięga
fdacb9b649 [stable] Backports (#8352)
* Update musicoin spec in line with gmc v2.6.2 (#8242)

* Supress TemporaryInvalid verification failures. (#8256)

* Include suicided accounts in state diff (#8297)

* Include suicided accounts in state diff

* Shorten form match -> if let

* Test suicide trace diff in State

* replace_home for password_files, reserved_peers and log_file (#8324)

* replace_home for password_files, reserved_peers and log_file

* typo: arg_log_file is Option

* Bump version in util/version
2018-04-10 12:35:08 +02:00
Rando
e6273039c8 Bump stable to 1.9.6 (#8348) 2018-04-10 12:20:08 +02:00
GitLab Build Bot
f1530394b8 [ci skip] js-precompiled 20180326-103315 2018-03-26 10:34:34 +00:00
Nikolay Volf
fc53f27c86 Stable backports (WASM libraries bump) (#8219)
* bump wasm libs (#8171)

* bump wasmi version (#8209)
2018-03-26 12:25:55 +02:00
GitLab Build Bot
4a67b1b8f7 [ci skip] js-precompiled 20180323-134513 2018-03-23 13:46:11 +00:00
Kirill Pimenov
d40d9e1c8c Updated jsonrpc to include latest backports (1.9) (#8182)
* Updated jsonrpc to include latest backports (1.9)

* Update dependencies.

- `jsonrpc` PR #244 required `hyper >= 0.11.20` which in turn required
updating `tokio-core`, `mio` and `iovec`.

- `jsonrpc` PR #246 required updating `https://github.com/tomusdrw/ws-rs`.
2018-03-23 14:32:14 +01:00
GitLab Build Bot
d05c8b2de4 [ci skip] js-precompiled 20180321-092434 2018-03-21 09:25:33 +00:00
GitLab Build Bot
b60cda6cf8 [ci skip] js-precompiled 20180321-085629 2018-03-21 08:57:33 +00:00
21 changed files with 308 additions and 217 deletions

View File

@@ -14,7 +14,7 @@ cache:
paths:
- target/
untracked: true
linux-stable:
linux-ubuntu:
stage: build
image: parity/rust:gitlab-ci
only:
@@ -32,7 +32,7 @@ linux-stable:
paths:
- parity.zip
name: "stable-x86_64-unknown-linux-gnu_parity"
linux-stable-debian:
linux-debian:
stage: build
image: parity/rust-debian:gitlab-ci
only:
@@ -81,6 +81,7 @@ linux-i686:
paths:
- parity.zip
name: "i686-unknown-linux-gnu"
allow_failure: true
linux-armv7:
stage: build
image: parity/rust-armv7:gitlab-ci
@@ -97,6 +98,7 @@ linux-armv7:
paths:
- parity.zip
name: "armv7_unknown_linux_gnueabihf_parity"
allow_failure: true
linux-arm:
stage: build
image: parity/rust-arm:gitlab-ci
@@ -113,6 +115,7 @@ linux-arm:
paths:
- parity.zip
name: "arm-unknown-linux-gnueabihf_parity"
allow_failure: true
linux-aarch64:
stage: build
image: parity/rust-arm64:gitlab-ci

352
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
[package]
description = "Parity Ethereum client"
name = "parity"
version = "1.9.5"
version = "1.9.7"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
@@ -27,7 +27,6 @@ toml = "0.4"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
app_dirs = "1.1.1"
futures = "0.1"
futures-cpupool = "0.1"
fdlimit = "0.1"

View File

@@ -1,4 +1,4 @@
# [Parity](https://parity.io/) - fast, light, and robust Ethereum client
# [Parity](https://parity.io/) - fast, light, and robust Ethereum client
[![build status](https://gitlab.parity.io/parity/parity/badges/master/build.svg)](https://gitlab.parity.io/parity/parity/commits/master)
[![Snap Status](https://build.snapcraft.io/badge/paritytech/parity.svg)](https://build.snapcraft.io/user/paritytech/parity)

View File

@@ -12,7 +12,7 @@ bloomchain = { path = "../util/bloomchain" }
bn = { git = "https://github.com/paritytech/bn" }
byteorder = "1.0"
common-types = { path = "types" }
crossbeam = "0.2.9"
crossbeam = "0.3"
ethash = { path = "../ethash" }
ethcore-bloom-journal = { path = "../util/bloom" }
ethcore-bytes = { path = "../util/bytes" }

View File

@@ -10,9 +10,9 @@
"homesteadTransition":"0x118c30",
"eip100bTransition":"0x21e88e",
"eip150Transition":"0x21e88e",
"eip160Transition":"0x7fffffffffffff",
"eip161abcTransition":"0x7fffffffffffff",
"eip161dTransition":"0x7fffffffffffff",
"eip160Transition":"0x21e88e",
"eip161abcTransition":"0x21e88e",
"eip161dTransition":"0x21e88e",
"eip649Transition":"0x21e88e",
"blockReward":"0x1105a0185b50a80000",
"mcip3Transition":"0x124f81",
@@ -40,8 +40,7 @@
"eip211Transition":"0x21e88e",
"eip214Transition":"0x21e88e",
"eip658Transition":"0x21e88e",
"maxCodeSize":"0x6000",
"maxCodeSizeTransition": "0x7fffffffffffff"
"maxCodeSize":"0x6000"
},
"genesis":{
"seal":{

View File

@@ -27,7 +27,7 @@ mod params;
use std::sync::{Weak, Arc};
use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering};
use std::collections::{HashSet, BTreeMap};
use std::collections::HashSet;
use hash::keccak;
use bigint::prelude::{U128, U256};
use bigint::hash::{H256, H520};
@@ -454,17 +454,6 @@ impl Engine<EthereumMachine> for Tendermint {
fn maximum_uncle_age(&self) -> usize { 0 }
/// Additional engine-specific information for the user/developer concerning `header`.
fn extra_info(&self, header: &Header) -> BTreeMap<String, String> {
let message = ConsensusMessage::new_proposal(header).expect("Invalid header.");
map![
"signature".into() => message.signature.to_string(),
"height".into() => message.vote_step.height.to_string(),
"view".into() => message.vote_step.view.to_string(),
"block_hash".into() => message.block_hash.as_ref().map(ToString::to_string).unwrap_or("".into())
]
}
fn populate_from_parent(&self, header: &mut Header, parent: &Header) {
// Chain scoring: total weight is sqrt(U256::max_value())*height - view
let new_difficulty = U256::from(U128::max_value())

View File

@@ -36,10 +36,21 @@ use transaction::{Action, SignedTransaction};
use crossbeam;
pub use executed::{Executed, ExecutionResult};
/// Roughly estimate what stack size each level of evm depth will use
/// TODO [todr] We probably need some more sophisticated calculations here (limit on my machine 132)
/// Maybe something like here: `https://github.com/ethereum/libethereum/blob/4db169b8504f2b87f7d5a481819cfb959fc65f6c/libethereum/ExtVM.cpp`
const STACK_SIZE_PER_DEPTH: usize = 24*1024;
#[cfg(debug_assertions)]
/// Roughly estimate what stack size each level of evm depth will use. (Debug build)
const STACK_SIZE_PER_DEPTH: usize = 128 * 1024;
#[cfg(not(debug_assertions))]
/// Roughly estimate what stack size each level of evm depth will use.
const STACK_SIZE_PER_DEPTH: usize = 24 * 1024;
#[cfg(debug_assertions)]
/// Entry stack overhead prior to execution. (Debug build)
const STACK_SIZE_ENTRY_OVERHEAD: usize = 100 * 1024;
#[cfg(not(debug_assertions))]
/// Entry stack overhead prior to execution.
const STACK_SIZE_ENTRY_OVERHEAD: usize = 20 * 1024;
/// Returns new address created from address, nonce, and code hash
pub fn contract_address(address_scheme: CreateContractAddress, sender: &Address, nonce: &U256, code: &[u8]) -> (Address, Option<H256>) {
@@ -334,12 +345,12 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
tracer: &mut T,
vm_tracer: &mut V
) -> vm::Result<FinalizationResult> where T: Tracer, V: VMTracer {
let depth_threshold = ::io::LOCAL_STACK_SIZE.with(|sz| sz.get() / STACK_SIZE_PER_DEPTH);
let local_stack_size = ::io::LOCAL_STACK_SIZE.with(|sz| sz.get());
let depth_threshold = local_stack_size.saturating_sub(STACK_SIZE_ENTRY_OVERHEAD) / STACK_SIZE_PER_DEPTH;
let static_call = params.call_type == CallType::StaticCall;
// Ordinary execution - keep VM in same thread
if (self.depth + 1) % depth_threshold != 0 {
if self.depth != depth_threshold {
let vm_factory = self.state.vm_factory();
let mut ext = self.as_externalities(OriginInfo::from(&params), unconfirmed_substate, output_policy, tracer, vm_tracer, static_call);
trace!(target: "executive", "ext.schedule.have_delegate_call: {}", ext.schedule().have_delegate_call);
@@ -347,17 +358,15 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
return vm.exec(params, &mut ext).finalize(ext);
}
// Start in new thread to reset stack
// TODO [todr] No thread builder yet, so we need to reset once for a while
// https://github.com/aturon/crossbeam/issues/16
// Start in new thread with stack size needed up to max depth
crossbeam::scope(|scope| {
let vm_factory = self.state.vm_factory();
let mut ext = self.as_externalities(OriginInfo::from(&params), unconfirmed_substate, output_policy, tracer, vm_tracer, static_call);
scope.spawn(move || {
scope.builder().stack_size(::std::cmp::max(schedule.max_depth.saturating_sub(depth_threshold) * STACK_SIZE_PER_DEPTH, local_stack_size)).spawn(move || {
let mut vm = vm_factory.create(&params, &schedule);
vm.exec(params, &mut ext).finalize(ext)
})
}).expect("Sub-thread creation cannot fail; the host might run out of resources; qed")
}).join()
}

View File

@@ -833,16 +833,26 @@ impl<B: Backend> State<B> {
}))
}
fn query_pod(&mut self, query: &PodState) -> trie::Result<()> {
for (address, pod_account) in query.get() {
// Return a list of all touched addresses in cache.
fn touched_addresses(&self) -> Vec<Address> {
assert!(self.checkpoints.borrow().is_empty());
self.cache.borrow().iter().map(|(add, _)| *add).collect()
}
fn query_pod(&mut self, query: &PodState, touched_addresses: &[Address]) -> trie::Result<()> {
let pod = query.get();
for address in touched_addresses {
if !self.ensure_cached(address, RequireCache::Code, true, |a| a.is_some())? {
continue
}
// needs to be split into two parts for the refcell code here
// to work.
for key in pod_account.storage.keys() {
self.storage_at(address, key)?;
if let Some(pod_account) = pod.get(address) {
// needs to be split into two parts for the refcell code here
// to work.
for key in pod_account.storage.keys() {
self.storage_at(address, key)?;
}
}
}
@@ -852,9 +862,10 @@ impl<B: Backend> State<B> {
/// Returns a `StateDiff` describing the difference from `orig` to `self`.
/// Consumes self.
pub fn diff_from<X: Backend>(&self, orig: State<X>) -> trie::Result<StateDiff> {
let addresses_post = self.touched_addresses();
let pod_state_post = self.to_pod();
let mut state_pre = orig;
state_pre.query_pod(&pod_state_post)?;
state_pre.query_pod(&pod_state_post, &addresses_post)?;
Ok(pod_state::diff_pod(&state_pre.to_pod(), &pod_state_post))
}
@@ -2182,4 +2193,37 @@ mod tests {
assert!(state.exists(&d).unwrap());
assert!(!state.exists(&e).unwrap());
}
#[test]
fn should_trace_diff_suicided_accounts() {
use pod_account;
let a = 10.into();
let db = get_temp_state_db();
let (root, db) = {
let mut state = State::new(db, U256::from(0), Default::default());
state.add_balance(&a, &100.into(), CleanupMode::ForceCreate).unwrap();
state.commit().unwrap();
state.drop()
};
let mut state = State::from_existing(db, root, U256::from(0u8), Default::default()).unwrap();
let original = state.clone();
state.kill_account(&a);
assert_eq!(original.touched_addresses(), vec![]);
assert_eq!(state.touched_addresses(), vec![a]);
let diff = state.diff_from(original).unwrap();
let diff_map = diff.get();
assert_eq!(diff_map.len(), 1);
assert!(diff_map.get(&a).is_some());
assert_eq!(diff_map.get(&a),
pod_account::diff_pod(Some(&PodAccount {
balance: U256::from(100),
nonce: U256::zero(),
code: Some(Default::default()),
storage: Default::default()
}), None).as_ref());
}
}

View File

@@ -70,7 +70,7 @@ pub mod blocks {
use super::{Kind, BlockLike};
use engines::EthEngine;
use error::Error;
use error::{Error, BlockError};
use header::Header;
use verification::{PreverifiedBlock, verify_block_basic, verify_block_unordered};
@@ -90,6 +90,10 @@ pub mod blocks {
fn create(input: Self::Input, engine: &EthEngine) -> Result<Self::Unverified, Error> {
match verify_block_basic(&input.header, &input.bytes, engine) {
Ok(()) => Ok(input),
Err(Error::Block(BlockError::TemporarilyInvalid(oob))) => {
debug!(target: "client", "Block received too early {}: {:?}", input.hash(), oob);
Err(BlockError::TemporarilyInvalid(oob).into())
},
Err(e) => {
warn!(target: "client", "Stage 1 block verification failed for {}: {:?}", input.hash(), e);
Err(e)

View File

@@ -10,7 +10,7 @@ ethcore-bigint = { path = "../../util/bigint" }
log = "0.3"
parity-wasm = "0.27"
libc = "0.2"
wasm-utils = { git = "https://github.com/paritytech/wasm-utils" }
pwasm-utils = "0.1"
vm = { path = "../vm" }
ethcore-logger = { path = "../../logger" }
wasmi = { git = "https://github.com/paritytech/wasmi" }
wasmi = { version = "0.1.3", features = ["opt-in-32bit"] }

View File

@@ -130,7 +130,7 @@ pub fn run_fixture(fixture: &Fixture) -> Vec<Fail> {
Err(e) => { return Fail::load(e); },
};
let mut ext = FakeExt::new();
let mut ext = FakeExt::new().with_wasm();
params.code = Some(Arc::new(
if let Source::Constructor { ref arguments, ref sender, ref at, .. } = fixture.source {
match construct(&mut ext, source, arguments.clone().into(), sender.clone().into(), at.clone().into()) {

View File

@@ -24,7 +24,7 @@ extern crate ethcore_bigint as bigint;
extern crate libc;
extern crate parity_wasm;
extern crate vm;
extern crate wasm_utils;
extern crate pwasm_utils as wasm_utils;
extern crate wasmi;
mod runtime;

View File

@@ -462,7 +462,7 @@
<key>OVERWRITE_PERMISSIONS</key>
<false/>
<key>VERSION</key>
<string>1.9.5</string>
<string>1.9.7</string>
</dict>
<key>UUID</key>
<string>2DCD5B81-7BAF-4DA1-9251-6274B089FD36</string>

View File

@@ -10,7 +10,7 @@
!define DESCRIPTION "Fast, light, robust Ethereum implementation"
!define VERSIONMAJOR 1
!define VERSIONMINOR 9
!define VERSIONBUILD 5
!define VERSIONBUILD 7
!define ARGS ""
!define FIRST_START_ARGS "--mode=passive ui"

View File

@@ -145,7 +145,7 @@ impl Configuration {
if self.args.cmd_signer_new_token {
Cmd::SignerToken(ws_conf, ui_conf, logger_config.clone())
} else if self.args.cmd_signer_sign {
let pwfile = self.args.arg_password.first().map(|pwfile| {
let pwfile = self.accounts_config()?.password_files.first().map(|pwfile| {
PathBuf::from(pwfile)
});
Cmd::SignerSign {
@@ -182,7 +182,7 @@ impl Configuration {
iterations: self.args.arg_keys_iterations,
path: dirs.keys,
spec: spec,
password_file: self.args.arg_password.first().map(|x| x.to_owned()),
password_file: self.accounts_config()?.password_files.first().map(|x| x.to_owned()),
};
AccountCmd::New(new_acc)
} else if self.args.cmd_account_list {
@@ -216,8 +216,8 @@ impl Configuration {
iterations: self.args.arg_keys_iterations,
path: dirs.keys,
spec: spec,
wallet_path: self.args.arg_wallet_import_path.unwrap().clone(),
password_file: self.args.arg_password.first().map(|x| x.to_owned()),
wallet_path: self.args.arg_wallet_import_path.clone().unwrap(),
password_file: self.accounts_config()?.password_files.first().map(|x| x.to_owned()),
};
Cmd::ImportPresaleWallet(presale_cmd)
} else if self.args.cmd_import {
@@ -440,7 +440,7 @@ impl Configuration {
LogConfig {
mode: self.args.arg_logging.clone(),
color: !self.args.flag_no_color && !cfg!(windows),
file: self.args.arg_log_file.clone(),
file: self.args.arg_log_file.as_ref().map(|log_file| replace_home(&self.directories().base, log_file)),
}
}
@@ -489,7 +489,7 @@ impl Configuration {
iterations: self.args.arg_keys_iterations,
refresh_time: self.args.arg_accounts_refresh,
testnet: self.args.flag_testnet,
password_files: self.args.arg_password.clone(),
password_files: self.args.arg_password.iter().map(|s| replace_home(&self.directories().base, s)).collect(),
unlocked_accounts: to_addresses(&self.args.arg_unlock)?,
enable_hardware_wallets: !self.args.flag_no_hardware_wallets,
enable_fast_unlock: self.args.flag_fast_unlock,
@@ -704,8 +704,10 @@ impl Configuration {
match self.args.arg_reserved_peers {
Some(ref path) => {
let path = replace_home(&self.directories().base, path);
let mut buffer = String::new();
let mut node_file = File::open(path).map_err(|e| format!("Error opening reserved nodes file: {}", e))?;
let mut node_file = File::open(&path).map_err(|e| format!("Error opening reserved nodes file: {}", e))?;
node_file.read_to_string(&mut buffer).map_err(|_| "Error reading reserved node file")?;
let lines = buffer.lines().map(|s| s.trim().to_owned()).filter(|s| !s.is_empty() && !s.starts_with("#")).collect::<Vec<_>>();

View File

@@ -19,7 +19,6 @@
#![warn(missing_docs)]
extern crate ansi_term;
extern crate app_dirs;
extern crate ctrlc;
extern crate docopt;
#[macro_use]

View File

@@ -3,7 +3,7 @@ description = "Ethcore utility library"
homepage = "http://parity.io"
license = "GPL-3.0"
name = "ethcore-util"
version = "1.9.5"
version = "1.9.7"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]

View File

@@ -6,4 +6,4 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
ethcore-bigint = { path = "../bigint" }
journaldb = { path = "../journaldb" }
app_dirs = "1.1.1"
app_dirs = { git = "https://github.com/paritytech/app-dirs-rs" }

View File

@@ -8,8 +8,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
mio = "0.6.8"
crossbeam = "0.2"
crossbeam = "0.3"
parking_lot = "0.4"
log = "0.3"
slab = "0.2"

View File

@@ -3,7 +3,7 @@
[package]
name = "parity-version"
# NOTE: this value is used for Parity version string.
version = "1.9.5"
version = "1.9.7"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
@@ -13,7 +13,7 @@ build = "build.rs"
track = "stable"
# Indicates a critical release in this track (i.e. consensus issue)
critical = true
critical = false
# Latest supported fork blocks for various networks. Used ONLY by auto-updater.
[package.metadata.forks]