Compare commits

...

23 Commits

Author SHA1 Message Date
GitLab Build Bot
74b850e7fc js-precompiled 20170223-141159 2017-02-23 17:10:16 +01:00
Jaco Greeff
e4e25b771e [beta] Fix Geth account import (#4643)
* Fix Geth import - actually pass addresses through

* Fix geth accounts not displayed

* Port saving of returned addresses (master MobX, beta state)

* log result -> importGethAccounts
2017-02-23 15:05:03 +01:00
Denis S. Soldatov aka General-Beck
7fc3f4eda0 [ci skip] 2017-02-23 03:36:47 +04:00
Denis S. Soldatov aka General-Beck
b20ffbde8e [ci skip] 2017-02-23 03:32:25 +04:00
Arkadiy Paronyan
3fe38163f5 [beta] Backporting #4633 (#4640)
* Tweak some checks. (#4633)

* Tweak some checks.

* Fixed build and added a difficulty test

* v1.5.4
2017-02-22 19:17:02 +01:00
Denis S. Soldatov aka General-Beck
0d18436a3d [ci skip] typo fix in gitlab-ci 2017-02-20 22:08:53 +04:00
Denis S. Soldatov aka General-Beck
9ebfb14bb5 [ci skip] backport doker-build stage 2017-02-20 22:06:18 +04:00
arkpar
82e33fa033 Merge branch 'beta' of github.com:ethcore/parity into beta 2017-02-20 17:39:24 +01:00
arkpar
fa8eb22e79 Backported mac installer fix 2017-02-20 17:38:58 +01:00
Denis S. Soldatov aka General-Beck
55b51890dd [ci-skip] backport Dockerfile for hub 2017-02-20 20:08:07 +04:00
GitLab Build Bot
0f99b1e123 js-precompiled 20170220-130332 2017-02-20 15:18:20 +01:00
Arkadiy Paronyan
51e4c82337 v1.5.3 (#4611) 2017-02-20 13:48:38 +01:00
Jaco Greeff
7df702494d Handle invalid ABI retrieved from address_book gracefully (#4606) (#4610)
* Handle invalid ABI gracefully

* Also include failed abi in log
2017-02-20 13:48:23 +01:00
Arkadiy Paronyan
b5219bc723 Backporting to beta (#4602)
* Static link for snappy

* added 3 warpnodes for ropsten (#4289)

* added 3 warpnodes for ropsten

* Fixed indentation
2017-02-19 20:55:52 +01:00
Arkadiy Paronyan
27765a71dd Validate transaction before adding to the queue (#4600) 2017-02-19 17:55:55 +01:00
GitLab Build Bot
a1b9f03121 [ci skip] js-precompiled 20170216-173539 2017-02-16 17:42:25 +00:00
GitLab Build Bot
1c40421982 [ci skip] js-precompiled 20170216-171113 2017-02-16 17:18:45 +00:00
Tomasz Drwięga
07324795f1 Beta backports (#4569)
* Fixing evmbin compilation and added standard build. (#4561)

* Alias for personal_sendTransaction (#4554)

* Fix console dapp (#4544)

* Fixing linting issues. Better support for console as secure app

* Fixing linting issues

* Fix no data sent in TxQueue dapp (#4502)

* Fix wrong PropType req for Embedded Signer

* Fix wrong data for tx #4499
2017-02-16 17:46:25 +01:00
Jaco Greeff
19520442c1 Explicitly set seconds to 0 from selector (#4559) (#4571)
* Explicitly set seconds/milli to 0

* Use condition time & block setters consistently

* Fix failing test

* test for 0 ms & sec

* It cannot hurt, clone date before setting

* Prettier date test constants (OCD)
2017-02-16 17:46:18 +01:00
Denis S. Soldatov aka General-Beck
e0c5baece0 armv6 build -> only triggers
[ci-skip]
2017-02-16 20:45:27 +04:00
Nikolay Volf
f4f7b83d1f replace expect with an error (#4542) 2017-02-15 19:03:36 +01:00
GitLab Build Bot
30d7872226 [ci skip] js-precompiled 20170215-145227 2017-02-15 14:56:17 +00:00
Jaco Greeff
4d4821c577 [beta] Skip OOG check for simple transfers #4558 (#4560)
* Skip OOG check for simple transfers #4558

* Fix failing test
2017-02-15 15:45:52 +01:00
35 changed files with 880 additions and 573 deletions

View File

@@ -290,7 +290,7 @@ linux-armv6:
# - beta
# - tags
# - stable
# - triggers
- triggers
script:
- export CC=arm-linux-gnueabi-gcc
- export CXX=arm-linux-gnueabi-g++
@@ -379,6 +379,7 @@ darwin:
export PLATFORM=x86_64-apple-darwin
cargo build -j 8 --features final --release #$CARGOFLAGS
cargo build -j 8 --features final --release -p ethstore #$CARGOFLAGS
cargo build -j 8 --features final --release -p evmbin #$CARGOFLAGS
rm -rf parity.md5
md5sum target/release/parity > parity.md5
export SHA3=$(target/release/parity tools hash target/release/parity)
@@ -474,9 +475,9 @@ docker-build:
- docker info
script:
- cd docker/hub
- if [ "$CI_BUILD_REF_NAME" == "nightly" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi
- docker login -u $Docker_Hub_User -p $Docker_Hub_Pass
- docker build --tag ethcore/parity:$CI_BUILD_REF_NAME .
- docker push ethcore/parity:$CI_BUILD_REF_NAME
- scripts/docker-build.sh $DOCKER_TAG
tags:
- docker
test-darwin:
@@ -500,7 +501,7 @@ test-windows:
- git submodule update --init --recursive
script:
- set RUST_BACKTRACE=1
- echo cargo test --features json-tests -p rlp -p ethash -p ethcore -p ethcore-bigint -p ethcore-dapps -p ethcore-rpc -p ethcore-signer -p ethcore-util -p ethcore-network -p ethcore-io -p ethkey -p ethstore -p ethsync -p ethcore-ipc -p ethcore-ipc-tests -p ethcore-ipc-nano -p parity %CARGOFLAGS% --verbose --release
- echo cargo test --features json-tests -p rlp -p ethash -p ethcore -p ethcore-bigint -p ethcore-dapps -p ethcore-rpc -p ethcore-signer -p ethcore-util -p ethcore-network -p ethcore-io -p ethkey -p ethstore -p evmbin -p ethsync -p ethcore-ipc -p ethcore-ipc-tests -p ethcore-ipc-nano -p parity %CARGOFLAGS% --verbose --release
tags:
- rust-windows
allow_failure: true

53
Cargo.lock generated
View File

@@ -1,6 +1,6 @@
[root]
name = "parity"
version = "1.5.2"
version = "1.5.4"
dependencies = [
"ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -23,8 +23,9 @@ dependencies = [
"ethcore-rpc 1.5.0",
"ethcore-signer 1.5.0",
"ethcore-stratum 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"ethsync 1.5.0",
"evmbin 1.5.0",
"fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.9.14 (registry+https://github.com/rust-lang/crates.io-index)",
"isatty 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -372,7 +373,7 @@ dependencies = [
"ethcore-ipc 1.5.0",
"ethcore-ipc-codegen 1.5.0",
"ethcore-ipc-nano 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"ethjson 0.1.0",
"ethkey 0.2.0",
"ethstore 0.1.0",
@@ -420,7 +421,7 @@ dependencies = [
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-devtools 1.5.0",
"ethcore-rpc 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"fetch 0.1.0",
"futures 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.0-a.0 (git+https://github.com/ethcore/hyper)",
@@ -468,7 +469,7 @@ name = "ethcore-ipc"
version = "1.5.0"
dependencies = [
"ethcore-devtools 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"nanomsg 0.5.1 (git+https://github.com/ethcore/nanomsg.rs.git)",
"semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -515,7 +516,7 @@ dependencies = [
"ethcore-ipc 1.5.0",
"ethcore-ipc-codegen 1.5.0",
"ethcore-ipc-nano 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"nanomsg 0.5.1 (git+https://github.com/ethcore/nanomsg.rs.git)",
"semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -530,7 +531,7 @@ dependencies = [
"ethcore-ipc 1.5.0",
"ethcore-ipc-codegen 1.5.0",
"ethcore-network 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rlp 0.1.0",
"smallvec 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -542,7 +543,7 @@ name = "ethcore-logger"
version = "1.5.0"
dependencies = [
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"isatty 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -558,7 +559,7 @@ dependencies = [
"bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-devtools 1.5.0",
"ethcore-io 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"ethcrypto 0.1.0",
"ethkey 0.2.0",
"igd 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -585,7 +586,7 @@ dependencies = [
"ethcore-devtools 1.5.0",
"ethcore-io 1.5.0",
"ethcore-ipc 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"ethcrypto 0.1.0",
"ethjson 0.1.0",
"ethkey 0.2.0",
@@ -620,7 +621,7 @@ dependencies = [
"ethcore-devtools 1.5.0",
"ethcore-io 1.5.0",
"ethcore-rpc 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"jsonrpc-core 4.0.0 (git+https://github.com/ethcore/jsonrpc.git?branch=mio-old)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -639,7 +640,7 @@ dependencies = [
"ethcore-ipc 1.5.0",
"ethcore-ipc-codegen 1.5.0",
"ethcore-ipc-nano 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"jsonrpc-core 4.0.0 (git+https://github.com/ethcore/jsonrpc.git?branch=mio-old)",
"jsonrpc-tcp-server 0.1.0 (git+https://github.com/ethcore/jsonrpc.git?branch=mio-old)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -650,7 +651,7 @@ dependencies = [
[[package]]
name = "ethcore-util"
version = "1.5.2"
version = "1.5.4"
dependencies = [
"ansi_term 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -699,7 +700,7 @@ dependencies = [
name = "ethjson"
version = "0.1.0"
dependencies = [
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.8.19 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -755,7 +756,7 @@ dependencies = [
"ethcore-ipc-nano 1.5.0",
"ethcore-light 1.5.0",
"ethcore-network 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"ethkey 0.2.0",
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -766,6 +767,16 @@ dependencies = [
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "evmbin"
version = "1.5.0"
dependencies = [
"docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore 1.5.0",
"ethcore-util 1.5.4",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "evmjit"
version = "1.5.0"
@@ -964,7 +975,7 @@ version = "1.5.0"
dependencies = [
"ethcore-ipc 1.5.0",
"ethcore-ipc-codegen 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1489,7 +1500,7 @@ name = "parity-hash-fetch"
version = "1.5.0"
dependencies = [
"ethabi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"fetch 0.1.0",
"futures 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1514,7 +1525,7 @@ version = "1.4.0"
dependencies = [
"ethcore-rpc 1.5.0",
"ethcore-signer 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"futures 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 4.0.0 (git+https://github.com/ethcore/jsonrpc.git?branch=mio-old)",
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1547,7 +1558,7 @@ dependencies = [
[[package]]
name = "parity-ui-precompiled"
version = "1.4.0"
source = "git+https://github.com/ethcore/js-precompiled.git?branch=beta#3d9331084db85d1584040add67752cc5d2d3d059"
source = "git+https://github.com/ethcore/js-precompiled.git?branch=beta#b3da168e994536a54a17a166735ee3e4e9926e2c"
dependencies = [
"parity-dapps-glue 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1560,7 +1571,7 @@ dependencies = [
"ethcore 1.5.0",
"ethcore-ipc 1.5.0",
"ethcore-ipc-codegen 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"ethsync 1.5.0",
"ipc-common-types 1.5.0",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1840,7 +1851,7 @@ version = "1.4.0"
dependencies = [
"ethcore-bigint 0.1.2",
"ethcore-rpc 1.5.0",
"ethcore-util 1.5.2",
"ethcore-util 1.5.4",
"futures 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-rpc-client 1.4.0",
"rpassword 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@@ -1,7 +1,7 @@
[package]
description = "Parity Ethereum client"
name = "parity"
version = "1.5.2"
version = "1.5.4"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
@@ -47,6 +47,7 @@ ethcore-ipc-hypervisor = { path = "ipc/hypervisor" }
ethcore-logger = { path = "logger" }
ethcore-stratum = { path = "stratum" }
ethcore-dapps = { path = "dapps", optional = true }
evmbin = { path = "evmbin" }
rpc-cli = { path = "rpc_cli" }
parity-rpc-client = { path = "rpc_client" }
ethcore-light = { path = "ethcore/light" }

View File

@@ -312,7 +312,7 @@ impl Server {
let special = Arc::new({
let mut special = HashMap::new();
special.insert(router::SpecialEndpoint::Rpc, rpc::rpc(handler, panic_handler.clone()));
special.insert(router::SpecialEndpoint::Rpc, rpc::rpc(handler, cors_domains.clone(), panic_handler.clone()));
special.insert(router::SpecialEndpoint::Utils, apps::utils());
special.insert(
router::SpecialEndpoint::Api,

View File

@@ -21,11 +21,15 @@ use jsonrpc_core::{IoHandler, ResponseHandler, Request, Response};
use jsonrpc_http_server::{ServerHandler, PanicHandler, AccessControlAllowOrigin, RpcHandler};
use endpoint::{Endpoint, EndpointPath, Handler};
pub fn rpc(handler: Arc<IoHandler>, panic_handler: Arc<Mutex<Option<Box<Fn() -> () + Send>>>>) -> Box<Endpoint> {
pub fn rpc(
handler: Arc<IoHandler>,
cors_domains: Vec<String>,
panic_handler: Arc<Mutex<Option<Box<Fn() -> () + Send>>>>,
) -> Box<Endpoint> {
Box::new(RpcEndpoint {
handler: Arc::new(RpcMiddleware::new(handler)),
panic_handler: panic_handler,
cors_domain: None,
cors_domain: Some(cors_domains.into_iter().map(AccessControlAllowOrigin::Value).collect()),
// NOTE [ToDr] We don't need to do any hosts validation here. It's already done in router.
allowed_hosts: None,
})

View File

@@ -1,4 +1,5 @@
FROM ubuntu:14.04
MAINTAINER Parity Technologies <devops@parity.io>
WORKDIR /build
# install tools and dependencies
RUN apt-get update && \
@@ -19,48 +20,60 @@ RUN apt-get update && \
file \
openssl \
libssl-dev \
libudev-dev \
pkg-config \
dpkg-dev \
# evmjit dependencies
zlib1g-dev \
libedit-dev
# cmake and llvm ppas. then update ppas
RUN add-apt-repository -y "ppa:george-edison55/cmake-3.x" && \
libedit-dev \
libudev-dev &&\
# cmake and llvm ppa's. then update ppa's
add-apt-repository -y "ppa:george-edison55/cmake-3.x" && \
add-apt-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main" && \
apt-get update && \
apt-get install -y --force-yes cmake llvm-3.7-dev
apt-get install -y --force-yes cmake llvm-3.7-dev && \
# install evmjit
RUN git clone https://github.com/debris/evmjit && \
git clone https://github.com/debris/evmjit && \
cd evmjit && \
mkdir build && cd build && \
cmake .. && make && make install && cd
cmake .. && make && make install && cd && \
# install rustup
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
# rustup directory
ENV PATH /root/.cargo/bin:$PATH
PATH=/root/.cargo/bin:$PATH && \
# show backtraces
ENV RUST_BACKTRACE 1
# show tools
RUN rustc -vV && \
cargo -V && \
gcc -v &&\
g++ -v
RUST_BACKTRACE=1 && \
# build parity
RUN git clone https://github.com/ethcore/parity && \
cd /build&&git clone https://github.com/ethcore/parity && \
cd parity && \
git pull && \
cargo build --release --features final && \
ls /build/parity/target/release/parity && \
strip /build/parity/target/release/parity
RUN file /build/parity/target/release/parity
git pull&& \
git checkout $CI_BUILD_REF_NAME && \
cargo build --verbose --release --features final && \
#ls /build/parity/target/release/parity && \
strip /build/parity/target/release/parity && \
file /build/parity/target/release/parity&&mkdir -p /parity&& cp /build/parity/target/release/parity /parity&&\
#cleanup Docker image
rm -rf /root/.cargo&&rm -rf /root/.multirust&&rm -rf /root/.rustup&&rm -rf /build&&\
apt-get purge -y \
# make
build-essential \
# add-apt-repository
software-properties-common \
make \
curl \
wget \
git \
g++ \
gcc \
binutils \
file \
pkg-config \
dpkg-dev \
# evmjit dependencies
zlib1g-dev \
libedit-dev \
cmake llvm-3.7-dev&&\
rm -rf /var/lib/apt/lists/*
# setup ENTRYPOINT
EXPOSE 8080 8545 8180
ENTRYPOINT ["/build/parity/target/release/parity"]
ENTRYPOINT ["/parity/parity"]

View File

@@ -44,7 +44,10 @@
},
"nodes": [
"enode://a22f0977ce02653bf95e38730106356342df48b5222e2c2a1a6f9ef34769bf593bae9ca0a888cf60839edd52efc1b6e393c63a57d76f4c4fe14e641f1f9e637e@128.199.55.137:30303",
"enode://012239fccf3ff1d92b036983a430cb6705c6528c96c0354413f8854802138e5135c084ab36e7c54efb621c46728df8c3a6f4c1db9bb48a1330efe3f82f2dd7a6@52.169.94.142:30303"
"enode://012239fccf3ff1d92b036983a430cb6705c6528c96c0354413f8854802138e5135c084ab36e7c54efb621c46728df8c3a6f4c1db9bb48a1330efe3f82f2dd7a6@52.169.94.142:30303",
"enode://1462682e4b7ba2258346d55e25e5b9d264b0db40cee12bdfba4e72b1d7050350ea954c006e9106dd96a128e6e0bd6dffb17eed51f9f99bf7f9cdadfeaf8da4ff@51.15.61.253:30303",
"enode://98fbb020c799ae39a828bd75dc2bd5d4721539faf317076b275f91182a5c8900b592e8abfdddceae674a7c3bb40ea00a6ca9ccb7805ab58c4b7b29c61c8f7239@51.15.62.44:30303",
"enode://d801dd4e3d15a8bf785931add164bd9c313e3f6b5749d9302b311f2b48064cba5c86c32b1302c27cd983fc89ae07d4d306dd1197610835b8782e95dfb1b3f9ea@51.15.43.255:30303"
],
"accounts": {
"0000000000000000000000000000000000000001": { "balance": "1", "nonce": "0", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },

View File

@@ -850,4 +850,22 @@ mod tests {
ethash.populate_from_parent(&mut header, &parent, U256::from(150_000), U256::from(150_002));
assert_eq!(*header.gas_limit(), U256::from(150_002));
}
#[test]
fn difficulty_max_timestamp() {
let spec = new_homestead_test();
let ethparams = get_default_ethash_params();
let ethash = Ethash::new(spec.params, ethparams, BTreeMap::new());
let mut parent_header = Header::default();
parent_header.set_number(1000000);
parent_header.set_difficulty(U256::from_str("b69de81a22b").unwrap());
parent_header.set_timestamp(1455404053);
let mut header = Header::default();
header.set_number(parent_header.number() + 1);
header.set_timestamp(u64::max_value());
let difficulty = ethash.calculate_difficulty(&header, &parent_header);
assert_eq!(U256::from(12543204905719u64), difficulty);
}
}

View File

@@ -276,7 +276,7 @@ impl Decodable for Header {
number: r.val_at(8)?,
gas_limit: r.val_at(9)?,
gas_used: r.val_at(10)?,
timestamp: r.val_at(11)?,
timestamp: min(r.val_at::<U256>(11)?, u64::max_value().into()).as_u64(),
extra_data: r.val_at(12)?,
seal: vec![],
hash: RefCell::new(Some(r.as_raw().sha3())),

View File

@@ -594,6 +594,7 @@ impl Miner {
.map(|accounts| accounts.into_iter().collect::<HashSet<_>>());
let insertion_time = client.chain_info().best_block_number;
let best_header = client.best_block_header().decode();
transactions.into_iter()
.map(|tx| {
@@ -612,6 +613,8 @@ impl Miner {
// try to install service transaction checker before appending transactions
self.service_transaction_action.update_from_chain_client(client);
self.engine.verify_transaction_basic(&tx, &best_header)?;
let details_provider = TransactionDetailsProvider::new(client, &self.service_transaction_action);
match origin {
TransactionOrigin::Local | TransactionOrigin::RetractedBlock => {

View File

@@ -186,7 +186,7 @@ pub mod headers {
type Verified = Header;
fn create(input: Self::Input, engine: &Engine) -> Result<Self::Unverified, Error> {
verify_header_params(&input, engine).map(|_| input)
verify_header_params(&input, engine, true).map(|_| input)
}
fn verify(unverified: Self::Unverified, engine: &Engine, check_seal: bool) -> Result<Self::Verified, Error> {

View File

@@ -51,12 +51,12 @@ impl HeapSizeOf for PreverifiedBlock {
/// Phase 1 quick block verification. Only does checks that are cheap. Operates on a single block
pub fn verify_block_basic(header: &Header, bytes: &[u8], engine: &Engine) -> Result<(), Error> {
verify_header_params(&header, engine)?;
verify_header_params(&header, engine, true)?;
verify_block_integrity(bytes, &header.transactions_root(), &header.uncles_hash())?;
engine.verify_block_basic(&header, Some(bytes))?;
for u in UntrustedRlp::new(bytes).at(2)?.iter().map(|rlp| rlp.as_val::<Header>()) {
let u = u?;
verify_header_params(&u, engine)?;
verify_header_params(&u, engine, false)?;
engine.verify_block_basic(&u, None)?;
}
// Verify transactions.
@@ -195,7 +195,7 @@ pub fn verify_block_final(expected: &Header, got: &Header) -> Result<(), Error>
}
/// Check basic header parameters.
pub fn verify_header_params(header: &Header, engine: &Engine) -> Result<(), Error> {
pub fn verify_header_params(header: &Header, engine: &Engine, is_full: bool) -> Result<(), Error> {
if header.number() >= From::from(BlockNumber::max_value()) {
return Err(From::from(BlockError::RidiculousNumber(OutOfBounds { max: Some(From::from(BlockNumber::max_value())), min: None, found: header.number() })))
}
@@ -210,9 +210,11 @@ pub fn verify_header_params(header: &Header, engine: &Engine) -> Result<(), Erro
if header.number() != 0 && header.extra_data().len() > maximum_extra_data_size {
return Err(From::from(BlockError::ExtraDataOutOfBounds(OutOfBounds { min: None, max: Some(maximum_extra_data_size), found: header.extra_data().len() })));
}
let max_time = get_time().sec as u64 + 30;
if header.timestamp() > max_time {
return Err(From::from(BlockError::InvalidTimestamp(OutOfBounds { max: Some(max_time), min: None, found: header.timestamp() })))
if is_full {
let max_time = get_time().sec as u64 + 30;
if header.timestamp() > max_time {
return Err(From::from(BlockError::InvalidTimestamp(OutOfBounds { max: Some(max_time), min: None, found: header.timestamp() })))
}
}
Ok(())
}

View File

@@ -271,7 +271,9 @@ impl SimpleSecretStore for EthMultiStore {
// Remove from cache
let mut cache = self.cache.write();
let is_empty = {
let mut accounts = cache.get_mut(address).expect("Entry exists, because it was returned by `get`; qed");
let mut accounts = cache.get_mut(address)
.ok_or(Error::InvalidAccount)?;
if let Some(position) = accounts.iter().position(|acc| acc == &account) {
accounts.remove(position);
}

View File

@@ -1,7 +1,7 @@
[package]
name = "evm"
name = "evmbin"
description = "Parity's EVM implementation"
version = "0.1.0"
version = "1.5.0"
authors = ["Parity Technologies <admin@parity.io>"]
[lib]

View File

@@ -31,7 +31,7 @@ pub struct FakeExt {
impl Default for FakeExt {
fn default() -> Self {
FakeExt {
schedule: Schedule::new_homestead_gas_fix(),
schedule: Schedule::new_post_eip150(usize::max_value(), true, true, true),
store: HashMap::new(),
depth: 1,
}
@@ -51,8 +51,8 @@ impl Ext for FakeExt {
unimplemented!();
}
fn exists_and_not_null(&self, address: &Address) -> bool {
unimplemented!();
fn exists_and_not_null(&self, _address: &Address) -> bool {
unimplemented!();
}
fn origin_balance(&self) -> U256 {

View File

@@ -21,7 +21,6 @@
extern crate ethcore;
extern crate rustc_serialize;
extern crate docopt;
#[macro_use]
extern crate ethcore_util as util;
mod ext;

View File

@@ -174,7 +174,7 @@ export default class Parity {
importGethAccounts (accounts) {
return this._transport
.execute('parity_importGethAccounts', inAddresses)
.execute('parity_importGethAccounts', inAddresses(accounts))
.then(outAddresses);
}

View File

@@ -260,7 +260,7 @@ export class LocalTransaction extends BaseTransaction {
to: transaction.to,
nonce: transaction.nonce,
value: transaction.value,
data: transaction.data,
data: transaction.input,
gasPrice, gas
};

File diff suppressed because one or more lines are too long

View File

@@ -106,7 +106,7 @@ export default class NewGeth extends Component {
api.parity
.listGethAccounts()
.then((_addresses) => {
const addresses = (addresses || []).filter((address) => !accounts[address]);
const addresses = (_addresses || []).filter((address) => !accounts[address]);
return Promise
.all(addresses.map((address) => api.eth.getBalance(address)))

View File

@@ -139,7 +139,7 @@ export default class CreateAccount extends Component {
case 2:
if (createType === 'fromGeth') {
return (
<AccountDetailsGeth addresses={ this.state.gethAddresses } />
<AccountDetailsGeth addresses={ this.state.gethImported } />
);
}
@@ -310,10 +310,14 @@ export default class CreateAccount extends Component {
if (createType === 'fromGeth') {
return api.parity
.importGethAccounts(this.state.gethAddresses)
.then((result) => {
console.log('result', result);
.then((gethImported) => {
console.log('importGethAccounts', gethImported);
return Promise.all(this.state.gethAddresses.map((address) => {
this.setState({
gethImported
});
return Promise.all(gethImported.map((address) => {
return api.parity.setAccountName(address, 'Geth Import');
}));
})

View File

@@ -81,11 +81,11 @@ export default class GasPriceEditor {
switch (conditionType) {
case CONDITIONS.BLOCK:
this.condition = Object.assign({}, this.condition, { block: this.blockNumber || 1 });
this.setConditionBlockNumber(this.blockNumber || 1);
break;
case CONDITIONS.TIME:
this.condition = Object.assign({}, this.condition, { time: new Date() });
this.setConditionDateTime(new Date());
break;
case CONDITIONS.NONE:
@@ -103,7 +103,12 @@ export default class GasPriceEditor {
});
}
@action setConditionDateTime = (time) => {
@action setConditionDateTime = (_time) => {
const time = new Date(_time);
time.setMilliseconds(0); // ignored by/not passed to Parity
time.setSeconds(0); // current time selector doesn't allow seconds
this.condition = Object.assign({}, this.condition, { time });
}

View File

@@ -162,9 +162,17 @@ describe('ui/GasPriceEditor/Store', () => {
});
describe('setConditionDateTime', () => {
it('sets the datatime', () => {
store.setConditionDateTime('testingDateTime');
expect(store.condition.time).to.equal('testingDateTime');
const BASEDATE = '1973-06-11 07:52';
const ZEROTIME = new Date(BASEDATE).getTime();
it('sets the datetime', () => {
store.setConditionDateTime(new Date(`${BASEDATE}:00.000`));
expect(store.condition.time.getTime()).to.equal(ZEROTIME);
});
it('zeros both seconds and miliseconds', () => {
store.setConditionDateTime(new Date(`${BASEDATE}:12.345`));
expect(store.condition.time.getTime()).to.equal(ZEROTIME);
});
});

View File

@@ -55,9 +55,19 @@ export default class MethodDecodingStore {
}
loadFromAbi (_abi, contractAddress) {
const abi = new Abi(_abi);
let abi;
if (contractAddress && abi) {
try {
abi = new Abi(_abi);
} catch (error) {
console.warn('loadFromAbi', error, _abi);
}
if (!abi) {
return;
}
if (contractAddress) {
this._contractsAbi[contractAddress] = abi;
}

View File

@@ -1,4 +1,4 @@
// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
@@ -21,8 +21,10 @@ import { FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { txLink } from '~/3rdparty/etherscan/links';
import ShortenedHash from '../ShortenedHash';
import Warning from '~/ui/Warning';
import { DEFAULT_GAS } from '~/util/constants';
import ShortenedHash from '../ShortenedHash';
import styles from './txHash.css';
class TxHash extends Component {
@@ -43,8 +45,59 @@ class TxHash extends Component {
state = {
blockNumber: new BigNumber(0),
isRecipientContract: false,
subscriptionId: null,
transaction: null
transaction: null,
transactionReceipt: null
}
componentWillMount () {
this.fetchTransaction();
}
componentWillReceiveProps (nextProps) {
const prevHash = this.props.hash;
const nextHash = nextProps.hash;
if (prevHash !== nextHash) {
this.fetchTransaction(nextProps);
}
}
/**
* Get the sent transaction data
*/
fetchTransaction (props = this.props) {
const { hash } = props;
if (!hash) {
return;
}
this.context.api.eth
.getTransactionByHash(hash)
.then((transaction) => {
this.setState({ transaction });
return this.fetchRecipientCode(transaction);
});
}
fetchRecipientCode (transaction) {
if (!transaction || !transaction.to) {
return;
}
this.context.api.eth
.getCode(transaction.to)
.then((code) => {
const isRecipientContract = code && !/^(0x)?0*$/.test(code);
this.setState({ isRecipientContract });
})
.catch((error) => {
console.error('fetchRecipientCode', error);
});
}
componentDidMount () {
@@ -73,24 +126,58 @@ class TxHash extends Component {
return (
<div>
{ this.renderWarning() }
<p>{
summary
? hashLink
: <FormattedMessage
id='ui.txHash.posted'
defaultMessage='The transaction has been posted to the network with a hash of {hashLink}'
values={ { hashLink } } />
values={ { hashLink } }
/>
}</p>
{ this.renderConfirmations() }
</div>
);
}
renderWarning () {
const { isRecipientContract, transaction, transactionReceipt } = this.state;
if (!(transactionReceipt && transactionReceipt.blockNumber && transactionReceipt.blockNumber.gt(0))) {
return null;
}
const { gas, input } = transaction;
const { gasUsed = new BigNumber(0) } = transactionReceipt;
const isOog = gasUsed.gte(gas);
// Skip OOG check if a simple transaction to a non-contract account
// @see: https://github.com/ethcore/parity/issues/4550
const skipOogCheck = gasUsed.eq(DEFAULT_GAS) && (!input || input === '0x') && !isRecipientContract;
if (!isOog || skipOogCheck) {
return null;
}
return (
<Warning
warning={
<FormattedMessage
id='ui.txHash.oog'
defaultMessage='The transaction might have gone out of gas. Try again with more gas.'
/>
}
/>
);
}
renderConfirmations () {
const { maxConfirmations } = this.props;
const { blockNumber, transaction } = this.state;
const { blockNumber, transactionReceipt } = this.state;
if (!(transaction && transaction.blockNumber && transaction.blockNumber.gt(0))) {
if (!(transactionReceipt && transactionReceipt.blockNumber && transactionReceipt.blockNumber.gt(0))) {
return (
<div className={ styles.confirm }>
<LinearProgress
@@ -101,16 +188,18 @@ class TxHash extends Component {
<div className={ styles.progressinfo }>
<FormattedMessage
id='ui.txHash.waiting'
defaultMessage='waiting for confirmations' />
defaultMessage='waiting for confirmations'
/>
</div>
</div>
);
}
const confirmations = blockNumber.minus(transaction.blockNumber).plus(1);
const confirmations = blockNumber.minus(transactionReceipt.blockNumber).plus(1);
const value = Math.min(confirmations.toNumber(), maxConfirmations);
let count = confirmations.toFormat(0);
if (confirmations.lte(maxConfirmations)) {
count = `${count}/${maxConfirmations}`;
}
@@ -123,7 +212,8 @@ class TxHash extends Component {
max={ maxConfirmations }
value={ value }
color='white'
mode='determinate' />
mode='determinate'
/>
<div className={ styles.progressinfo }>
<abbr title={ `block #${blockNumber.toFormat(0)}` }>
<FormattedMessage
@@ -132,7 +222,8 @@ class TxHash extends Component {
values={ {
count,
value
} } />
} }
/>
</abbr>
</div>
</div>
@@ -143,21 +234,22 @@ class TxHash extends Component {
const { api } = this.context;
const { hash } = this.props;
const nextState = { blockNumber };
if (error || !hash || /^(0x)?0*$/.test(hash)) {
return;
return this.setState(nextState);
}
return api.eth
.getTransactionReceipt(hash)
.then((transaction) => {
this.setState({
blockNumber,
transaction
});
.then((transactionReceipt) => {
nextState.transactionReceipt = transactionReceipt;
})
.catch((error) => {
console.warn('onBlockNumber', error);
this.setState({ blockNumber });
console.error('onBlockNumber', error);
})
.then(() => {
this.setState(nextState);
});
}
}

View File

@@ -33,6 +33,7 @@ function createApi () {
blockNumber = new BigNumber(100);
api = {
eth: {
getTransactionByHash: sinon.stub().resolves({ gas: 21000 }),
getTransactionReceipt: (hash) => {
return Promise.resolve({
blockNumber: new BigNumber(100),

View File

@@ -14,54 +14,35 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import parity from '~/jsonrpc/interfaces/parity';
import signer from '~/jsonrpc/interfaces/signer';
import trace from '~/jsonrpc/interfaces/trace';
export default function web3extensions (web3) {
const { Method, formatters } = web3._extend;
const { Method } = web3._extend;
// TODO [ToDr] Consider output/input formatters.
const methods = (object, name) => {
return Object.keys(object).map(method => {
return new Method({
name: method,
call: `${name}_{method}`,
params: object[method].params.length
});
});
};
return [{
property: 'personal',
methods: [
new Method({
name: 'sendTransaction',
call: 'personal_sendTransaction',
params: 2,
inputFormatter: [formatters.inputTransactionFormatter, null]
}),
new Method({
name: 'signerEnabled',
call: 'personal_signerEnabled',
params: 0,
inputFormatter: []
})
],
property: 'parity',
methods: methods(parity, 'parity'),
properties: []
}, {
property: 'ethcore',
methods: [
new Method({
name: 'getNetPeers',
call: 'ethcore_netPeers',
params: 0,
outputFormatter: x => x
}),
new Method({
name: 'getNetChain',
call: 'ethcore_netChain',
params: 0,
outputFormatter: x => x
}),
new Method({
name: 'gasPriceStatistics',
call: 'ethcore_gasPriceStatistics',
params: 0,
outputFormatter: a => a.map(web3.toBigNumber)
}),
new Method({
name: 'unsignedTransactionsCount',
call: 'ethcore_unsignedTransactionsCount',
params: 0,
inputFormatter: []
})
],
property: 'signer',
methods: methods(signer, 'signer'),
properties: []
}, {
property: 'trace',
methods: methods(trace, 'trace'),
properties: []
}];
}

View File

@@ -431,7 +431,7 @@
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>../target/release/deps/ethstore</string>
<string>../target/release/ethstore</string>
<key>PATH_TYPE</key>
<integer>3</integer>
<key>PERMISSIONS</key>
@@ -578,7 +578,7 @@
<key>OVERWRITE_PERMISSIONS</key>
<false/>
<key>VERSION</key>
<string>1.5.2</string>
<string>1.5.4</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 5
!define VERSIONBUILD 2
!define VERSIONBUILD 4
!define ARGS "--warp"
!define FIRST_START_ARGS "ui --warp --mode=passive"

View File

@@ -117,4 +117,9 @@ impl<C: 'static, M: 'static> Personal for PersonalClient<C, M> where C: MiningBl
dispatch::SignWith::Password(password)
).map(|v| v.into_value().into())
}
fn sign_and_send_transaction(&self, request: TransactionRequest, password: String) -> Result<RpcH256, Error> {
warn!("Using deprecated personal_signAndSendTransaction, use personal_sendTransaction instead.");
self.send_transaction(request, password)
}
}

View File

@@ -112,16 +112,25 @@ fn sign_and_send_transaction_with_invalid_password() {
assert_eq!(tester.io.handle_request_sync(request.as_ref()), Some(response.into()));
}
#[test]
fn send_transaction() {
sign_and_send_test("personal_sendTransaction");
}
#[test]
fn sign_and_send_transaction() {
sign_and_send_test("personal_signAndSendTransaction");
}
fn sign_and_send_test(method: &str) {
let tester = setup();
let address = tester.accounts.new_account("password123").unwrap();
let request = r#"{
"jsonrpc": "2.0",
"method": "personal_sendTransaction",
"method": ""#.to_owned() + method + r#"",
"params": [{
"from": ""#.to_owned() + format!("0x{:?}", address).as_ref() + r#"",
"from": ""# + format!("0x{:?}", address).as_ref() + r#"",
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",

View File

@@ -38,5 +38,9 @@ build_rpc_trait! {
/// Sends transaction and signs it in single call. The account is not unlocked in such case.
#[rpc(name = "personal_sendTransaction")]
fn send_transaction(&self, TransactionRequest, String) -> Result<H256, Error>;
/// Deprecated alias for `personal_sendTransaction`.
#[rpc(name = "personal_signAndSendTransaction")]
fn sign_and_send_transaction(&self, TransactionRequest, String) -> Result<H256, Error>;
}
}

3
scripts/docker-build.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
docker build --no-cache=true --tag ethcore/parity:$1 .
docker push ethcore/parity:$1

View File

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

View File

@@ -23,7 +23,7 @@ const SNAPPY_OK: c_int = 0;
const SNAPPY_INVALID_INPUT: c_int = 1;
const SNAPPY_BUFFER_TOO_SMALL: c_int = 2;
#[link(name = "snappy")]
#[link(name = "snappy", kind = "static")]
extern {
fn snappy_compress(
input: *const c_char,
@@ -154,4 +154,4 @@ pub fn decompress_into(input: &[u8], output: &mut Vec<u8>) -> Result<usize, Inva
pub fn validate_compressed_buffer(input: &[u8]) -> bool {
let status = unsafe { snappy_validate_compressed_buffer(input.as_ptr() as *const c_char, input.len() as size_t )};
status == SNAPPY_OK
}
}