Merge remote-tracking branch 'origin/ui-2' into ui-2

This commit is contained in:
kaikun213 2017-07-24 16:14:02 +02:00
commit a562f2c434
1879 changed files with 2446 additions and 778 deletions

View File

@ -561,11 +561,9 @@ docker-build:
- docker info - docker info
script: script:
- if [ "$CI_BUILD_REF_NAME" == "beta-release" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi - if [ "$CI_BUILD_REF_NAME" == "beta-release" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi
- docker login -u $Docker_Hub_User -p $Docker_Hub_Pass - echo "Tag:" $DOCKER_TAG
- sh scripts/docker-build.sh $DOCKER_TAG ethcore
- docker logout
- docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity - docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity
- sh scripts/docker-build.sh $DOCKER_TAG parity - sh scripts/docker-build.sh $DOCKER_TAG
- docker logout - docker logout
tags: tags:
- docker - docker
@ -613,11 +611,12 @@ test-rust-stable:
image: parity/rust:gitlab-ci image: parity/rust:gitlab-ci
before_script: before_script:
- git submodule update --init --recursive - git submodule update --init --recursive
- export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^appveyor.yml -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l) - export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l)
script: script:
- rustup show - rustup show
- export RUST_BACKTRACE=1 - export RUST_BACKTRACE=1
- if [ $RUST_FILES_MODIFIED -eq 0 ]; then echo "Skipping Rust tests since no Rust files modified."; else ./test.sh $CARGOFLAGS; fi - if [ $RUST_FILES_MODIFIED -eq 0 ]; then echo "Skipping Rust tests since no Rust files modified."; else ./test.sh $CARGOFLAGS; fi
- if [ "$CI_BUILD_REF_NAME" == "nightly" ]; then sh scripts/aura-test.sh; fi
tags: tags:
- rust - rust
- rust-stable - rust-stable

28
Cargo.lock generated
View File

@ -81,6 +81,20 @@ dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "backtrace"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "backtrace-sys" name = "backtrace-sys"
version = "0.1.11" version = "0.1.11"
@ -783,6 +797,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ethkey 0.2.0", "ethkey 0.2.0",
"panic_hook 0.1.0",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
@ -818,6 +833,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ethstore 0.1.0", "ethstore 0.1.0",
"panic_hook 0.1.0",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
@ -875,6 +891,7 @@ dependencies = [
"ethcore 1.8.0", "ethcore 1.8.0",
"ethcore-util 1.8.0", "ethcore-util 1.8.0",
"evm 0.1.0", "evm 0.1.0",
"panic_hook 0.1.0",
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1713,6 +1730,13 @@ dependencies = [
"stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "panic_hook"
version = "0.1.0"
dependencies = [
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "parity" name = "parity"
version = "1.7.0" version = "1.7.0"
@ -1746,6 +1770,7 @@ dependencies = [
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"number_prefix 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "number_prefix 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"panic_hook 0.1.0",
"parity-dapps 1.8.0", "parity-dapps 1.8.0",
"parity-hash-fetch 1.8.0", "parity-hash-fetch 1.8.0",
"parity-ipfs-api 1.8.0", "parity-ipfs-api 1.8.0",
@ -1978,7 +2003,7 @@ dependencies = [
[[package]] [[package]]
name = "parity-ui-precompiled" name = "parity-ui-precompiled"
version = "1.4.0" version = "1.4.0"
source = "git+https://github.com/paritytech/js-precompiled.git#26873a9ae6fca50fbf523f201325a20792db3e23" source = "git+https://github.com/paritytech/js-precompiled.git#b4c17fb0478fc9655ca373637816ee6e325da0d7"
dependencies = [ dependencies = [
"parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -3126,6 +3151,7 @@ dependencies = [
"checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0"
"checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159" "checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159"
"checksum backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "346d7644f0b5f9bc73082d3b2236b69a05fd35cce0cfa3724e184e6a5c9e2a2f" "checksum backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "346d7644f0b5f9bc73082d3b2236b69a05fd35cce0cfa3724e184e6a5c9e2a2f"
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76"
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" "checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff"
"checksum base-x 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f59103b47307f76e03bef1633aec7fa9e29bfb5aa6daf5a334f94233c71f6c1" "checksum base-x 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f59103b47307f76e03bef1633aec7fa9e29bfb5aa6daf5a334f94233c71f6c1"
"checksum base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9605ba46d61df0410d8ac686b0007add8172eba90e8e909c347856fe794d8c" "checksum base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9605ba46d61df0410d8ac686b0007add8172eba90e8e909c347856fe794d8c"

View File

@ -53,6 +53,7 @@ parity-rpc-client = { path = "rpc_client" }
parity-updater = { path = "updater" } parity-updater = { path = "updater" }
parity-whisper = { path = "whisper" } parity-whisper = { path = "whisper" }
path = { path = "util/path" } path = { path = "util/path" }
panic_hook = { path = "panic_hook" }
parity-dapps = { path = "dapps", optional = true } parity-dapps = { path = "dapps", optional = true }
clippy = { version = "0.0.103", optional = true} clippy = { version = "0.0.103", optional = true}

View File

@ -4,7 +4,7 @@ WORKDIR /build
#ENV for build TAG #ENV for build TAG
ARG BUILD_TAG ARG BUILD_TAG
ENV BUILD_TAG ${BUILD_TAG:-master} ENV BUILD_TAG ${BUILD_TAG:-master}
RUN echo $BUILD_TAG RUN echo "Build tag:" $BUILD_TAG
# install tools and dependencies # install tools and dependencies
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --force-yes --no-install-recommends \ apt-get install -y --force-yes --no-install-recommends \

View File

@ -211,6 +211,7 @@ impl<Cost: CostType> Interpreter<Cost> {
if (instruction == instructions::DELEGATECALL && !schedule.have_delegate_call) || if (instruction == instructions::DELEGATECALL && !schedule.have_delegate_call) ||
(instruction == instructions::CREATE2 && !schedule.have_create2) || (instruction == instructions::CREATE2 && !schedule.have_create2) ||
(instruction == instructions::STATICCALL && !schedule.have_static_call) || (instruction == instructions::STATICCALL && !schedule.have_static_call) ||
((instruction == instructions::RETURNDATACOPY || instruction == instructions::RETURNDATASIZE) && !schedule.have_return_data) ||
(instruction == instructions::REVERT && !schedule.have_revert) { (instruction == instructions::REVERT && !schedule.have_revert) {
return Err(evm::Error::BadInstruction { return Err(evm::Error::BadInstruction {

View File

@ -107,6 +107,8 @@ pub struct Schedule {
pub blockhash_gas: usize, pub blockhash_gas: usize,
/// Static Call opcode enabled. /// Static Call opcode enabled.
pub have_static_call: bool, pub have_static_call: bool,
/// RETURNDATA and RETURNDATASIZE opcodes enabled.
pub have_return_data: bool,
/// Kill basic accounts below this balance if touched. /// Kill basic accounts below this balance if touched.
pub kill_dust: CleanDustMode, pub kill_dust: CleanDustMode,
} }
@ -140,6 +142,7 @@ impl Schedule {
have_delegate_call: true, have_delegate_call: true,
have_create2: false, have_create2: false,
have_revert: false, have_revert: false,
have_return_data: false,
stack_limit: 1024, stack_limit: 1024,
max_depth: 1024, max_depth: 1024,
tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0], tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0],
@ -190,6 +193,7 @@ impl Schedule {
schedule.have_create2 = true; schedule.have_create2 = true;
schedule.have_revert = true; schedule.have_revert = true;
schedule.have_static_call = true; schedule.have_static_call = true;
schedule.have_return_data = true;
schedule.blockhash_gas = 350; schedule.blockhash_gas = 350;
schedule schedule
} }
@ -200,6 +204,7 @@ impl Schedule {
have_delegate_call: hdc, have_delegate_call: hdc,
have_create2: false, have_create2: false,
have_revert: false, have_revert: false,
have_return_data: false,
stack_limit: 1024, stack_limit: 1024,
max_depth: 1024, max_depth: 1024,
tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0], tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0],

@ -1 +1 @@
Subproject commit 4e8b9be3fba16ec32e0cdf50b8f9329826283aaa Subproject commit ef191fdc61cf76cdb9cdc147465fb447304b0ed2

View File

@ -558,9 +558,9 @@ impl SnapshotService for Service {
self.reader.read().as_ref().map(|r| r.manifest().clone()) self.reader.read().as_ref().map(|r| r.manifest().clone())
} }
fn min_supported_version(&self) -> Option<u64> { fn supported_versions(&self) -> Option<(u64, u64)> {
self.engine.snapshot_components() self.engine.snapshot_components()
.map(|c| c.min_supported_version()) .map(|c| (c.min_supported_version(), c.current_version()))
} }
fn chunk(&self, hash: H256) -> Option<Bytes> { fn chunk(&self, hash: H256) -> Option<Bytes> {

View File

@ -27,9 +27,9 @@ pub trait SnapshotService : Sync + Send {
/// Query the most recent manifest data. /// Query the most recent manifest data.
fn manifest(&self) -> Option<ManifestData>; fn manifest(&self) -> Option<ManifestData>;
/// Get the minimum supported snapshot version number. /// Get the supported range of snapshot version numbers.
/// `None` indicates warp sync isn't supported by the consensus engine. /// `None` indicates warp sync isn't supported by the consensus engine.
fn min_supported_version(&self) -> Option<u64>; fn supported_versions(&self) -> Option<(u64, u64)>;
/// Get raw chunk for a given hash. /// Get raw chunk for a given hash.
fn chunk(&self, hash: H256) -> Option<Bytes>; fn chunk(&self, hash: H256) -> Option<Bytes>;

View File

@ -100,6 +100,7 @@ impl CommonParams {
schedule.have_create2 = block_number >= self.eip86_transition; schedule.have_create2 = block_number >= self.eip86_transition;
schedule.have_revert = block_number >= self.eip140_transition; schedule.have_revert = block_number >= self.eip140_transition;
schedule.have_static_call = block_number >= self.eip214_transition; schedule.have_static_call = block_number >= self.eip214_transition;
schedule.have_return_data = block_number >= self.eip211_transition;
if block_number >= self.eip210_transition { if block_number >= self.eip210_transition {
schedule.blockhash_gas = 350; schedule.blockhash_gas = 350;
} }

View File

@ -9,6 +9,7 @@ serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
rustc-hex = "1.0" rustc-hex = "1.0"
docopt = "0.8" docopt = "0.8"
panic_hook = { path = "../../panic_hook" }
[[bin]] [[bin]]
name = "ethkey" name = "ethkey"

View File

@ -20,12 +20,14 @@ extern crate serde;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
extern crate ethkey; extern crate ethkey;
extern crate panic_hook;
use std::{env, fmt, process}; use std::{env, fmt, process};
use std::num::ParseIntError; use std::num::ParseIntError;
use docopt::Docopt; use docopt::Docopt;
use rustc_hex::{FromHex, FromHexError}; use rustc_hex::{FromHex, FromHexError};
use ethkey::{KeyPair, Random, Brain, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address}; use ethkey::{KeyPair, Random, Brain, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address};
use std::io;
pub const USAGE: &'static str = r#" pub const USAGE: &'static str = r#"
Ethereum keys generator. Ethereum keys generator.
@ -87,6 +89,7 @@ enum Error {
FromHex(FromHexError), FromHex(FromHexError),
ParseInt(ParseIntError), ParseInt(ParseIntError),
Docopt(docopt::Error), Docopt(docopt::Error),
Io(io::Error),
} }
impl From<EthkeyError> for Error { impl From<EthkeyError> for Error {
@ -113,6 +116,12 @@ impl From<docopt::Error> for Error {
} }
} }
impl From<io::Error> for Error {
fn from(err: io::Error) -> Self {
Error::Io(err)
}
}
impl fmt::Display for Error { impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match *self { match *self {
@ -120,6 +129,7 @@ impl fmt::Display for Error {
Error::FromHex(ref e) => write!(f, "{}", e), Error::FromHex(ref e) => write!(f, "{}", e),
Error::ParseInt(ref e) => write!(f, "{}", e), Error::ParseInt(ref e) => write!(f, "{}", e),
Error::Docopt(ref e) => write!(f, "{}", e), Error::Docopt(ref e) => write!(f, "{}", e),
Error::Io(ref e) => write!(f, "{}", e),
} }
} }
} }
@ -146,6 +156,8 @@ impl DisplayMode {
} }
fn main() { fn main() {
panic_hook::set();
match execute(env::args()) { match execute(env::args()) {
Ok(ok) => println!("{}", ok), Ok(ok) => println!("{}", ok),
Err(err) => { Err(err) => {
@ -176,17 +188,17 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
} else if args.cmd_generate { } else if args.cmd_generate {
let display_mode = DisplayMode::new(&args); let display_mode = DisplayMode::new(&args);
let keypair = if args.cmd_random { let keypair = if args.cmd_random {
Random.generate() Random.generate()?
} else if args.cmd_prefix { } else if args.cmd_prefix {
let prefix = args.arg_prefix.from_hex()?; let prefix = args.arg_prefix.from_hex()?;
let iterations = usize::from_str_radix(&args.arg_iterations, 10)?; let iterations = usize::from_str_radix(&args.arg_iterations, 10)?;
Prefix::new(prefix, iterations).generate() Prefix::new(prefix, iterations).generate()?
} else if args.cmd_brain { } else if args.cmd_brain {
Brain::new(args.arg_seed).generate() Brain::new(args.arg_seed).generate().expect("Brain wallet generator is infallible; qed")
} else { } else {
unreachable!(); unreachable!();
}; };
Ok(display(keypair?, display_mode)) Ok(display(keypair, display_mode))
} else if args.cmd_sign { } else if args.cmd_sign {
let secret = args.arg_secret.parse().map_err(|_| EthkeyError::InvalidSecret)?; let secret = args.arg_secret.parse().map_err(|_| EthkeyError::InvalidSecret)?;
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?; let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;

View File

@ -9,6 +9,7 @@ serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
docopt = "0.8" docopt = "0.8"
ethstore = { path = "../" } ethstore = { path = "../" }
panic_hook = { path = "../../panic_hook" }
[[bin]] [[bin]]
name = "ethstore" name = "ethstore"

View File

@ -20,6 +20,7 @@ extern crate serde;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
extern crate ethstore; extern crate ethstore;
extern crate panic_hook;
use std::{env, process, fs, fmt}; use std::{env, process, fs, fmt};
use std::io::Read; use std::io::Read;
@ -134,6 +135,8 @@ impl fmt::Display for Error {
} }
fn main() { fn main() {
panic_hook::set();
match execute(env::args()) { match execute(env::args()) {
Ok(result) => println!("{}", result), Ok(result) => println!("{}", result),
Err(err) => { Err(err) => {

View File

@ -16,6 +16,7 @@ serde_derive = "1.0"
ethcore = { path = "../ethcore" } ethcore = { path = "../ethcore" }
ethcore-util = { path = "../util" } ethcore-util = { path = "../util" }
evm = { path = "../ethcore/evm" } evm = { path = "../ethcore/evm" }
panic_hook = { path = "../panic_hook" }
[features] [features]
evm-debug = ["ethcore/evm-debug-tests"] evm-debug = ["ethcore/evm-debug-tests"]

View File

@ -26,6 +26,7 @@ extern crate serde_derive;
extern crate docopt; extern crate docopt;
extern crate ethcore_util as util; extern crate ethcore_util as util;
extern crate evm; extern crate evm;
extern crate panic_hook;
use std::sync::Arc; use std::sync::Arc;
use std::{fmt, fs}; use std::{fmt, fs};
@ -63,6 +64,8 @@ General options:
fn main() { fn main() {
panic_hook::set();
let args: Args = Docopt::new(USAGE).and_then(|d| d.deserialize()).unwrap_or_else(|e| e.exit()); let args: Args = Docopt::new(USAGE).and_then(|d| d.deserialize()).unwrap_or_else(|e| e.exit());
if args.flag_json { if args.flag_json {

Some files were not shown because too many files have changed in this diff Show More