From 93b25d5242e3a791c71400498b7d6d63a94e3e10 Mon Sep 17 00:00:00 2001 From: Afri Schoedon <5chdn@users.noreply.github.com> Date: Wed, 10 Oct 2018 17:33:03 +0200 Subject: [PATCH] Backports for stable 2.0.7 (#9648) * parity-version: bump stable to 2.0.7 * HF in POA Sokol (2018-09-19) (#9607) https://github.com/poanetwork/poa-chain-spec/pull/86 * fix failing node-table tests on mac os, closes #9632 (#9633) * fix(light_fetch): avoid race with BlockNumber::Latest (#9665) * CI: Remove unnecessary pipes (#9681) * ci: reduce gitlab pipelines significantly * ci: build pipeline for PR * ci: remove dead weight * ci: remove github release script * ci: remove forever broken aura tests * ci: add random stuff to the end of the pipes * ci: add wind and mac to the end of the pipe * ci: remove snap artifacts * ci: (re)move dockerfiles * ci: clarify job names * ci: add cargo audit job * ci: make audit script executable * ci: ignore snap and docker files for rust check * ci: simplify audit script * ci: rename misc to optional * ci: add publish script to releaseable branches * ci: more verbose cp command for windows build * ci: fix weird binary checksum logic in push script * ci: fix regex in push script for windows * ci: simplify gitlab caching * docs: align README with ci changes * ci: specify default cargo target dir * ci: print verbose environment * ci: proper naming of scripts * ci: restore docker files * ci: use docker hub file * ci: use cargo home instead of cargo target dir * ci: touch random rust file to trigger real builds * ci: set cargo target dir for audit script * ci: remove temp file * ci: don't export the cargo target dir in the audit script * ci: fix windows unbound variable * docs: fix gitlab badge path * rename deprecated gitlab ci variables https://docs.gitlab.com/ee/ci/variables/#9-0-renaming * ci: fix git compare for nightly builds * test: skip c++ example for all platforms but linux * ci: add random rust file to trigger tests * ci: remove random rust file * disable cpp lib test for mac, win and beta (#9686) * cleanup ci merge * parity: bump clib * ci: fix tests * ci: disable c++ example * Docker: run as parity user (#9689) * CI: Skip docs job for nightly (#9693) * ci: force-tag wiki changes * ci: force-tag wiki changes * ci: skip docs job for master and nightly * ci: revert docs job checking for nightly tag * ci: exclude docs job from nightly builds in gitlab script * fix (light/provider) : Make `read_only executions` read-only (#9591) * `ExecutionsRequest` from light-clients as read-only This changes so all `ExecutionRequests` from light-clients are executed as read-only which the `virtual``flag == true ensures. This boost up the current transaction to always succeed Note, this only affects `eth_estimateGas` and `eth_call` AFAIK. * grumbles(revert renaming) : TransactionProof * grumbles(trace) : remove incorrect trace * grumbles(state/prove_tx) : explicit `virt` Remove the boolean flag to determine that a `state::prove_transaction` whether it should be executed in a virtual context or not. Because of that also rename the function to `state::prove_transction_virtual` to make more clear * ethcore: fix detection of major import (#9552) * sync: set state to idle after sync is completed * sync: refactor sync reset * parity: revert clib bump and fix tests * Fix path to parity.h (#9274) * Fix path to parity.h * Fix other paths as well * ethcore-io retries failed work steal (#9651) * ethcore-io uses newer version of crossbeam && retries failed work steal * ethcore-io non-mio service uses newer crossbeam --- .gitlab-ci.yml | 357 ++++++++---------- Cargo.lock | 78 ++-- Cargo.toml | 2 +- README.md | 175 ++++----- docker/README.md | 3 - docker/alpine/Dockerfile | 29 -- docker/android/Dockerfile | 61 --- docker/android/cargo-config.toml | 9 - docker/android/libudev.patch | 216 ----------- docker/centos/Dockerfile | 36 -- docker/hub/Dockerfile | 65 ---- docker/ubuntu/Dockerfile | 42 --- ethcore/res/ethereum/poasokol.json | 7 +- ethcore/src/client/client.rs | 3 +- ethcore/src/engines/tendermint/mod.rs | 1 - ethcore/src/spec/spec.rs | 3 +- ethcore/src/state/mod.rs | 7 +- ethcore/sync/src/chain/mod.rs | 11 +- parity-clib-examples/cpp/CMakeLists.txt | 6 +- rpc/src/v1/helpers/light_fetch.rs | 23 +- rpc/src/v1/impls/light/eth.rs | 4 +- scripts/aura-test.sh | 12 - scripts/cov.sh | 31 -- scripts/docker-build.sh | 11 - scripts/docker/README.md | 40 ++ scripts/docker/alpine/Dockerfile | 43 +++ scripts/docker/centos/Dockerfile | 28 ++ scripts/docker/centos/Dockerfile.build | 25 ++ scripts/docker/centos/build.sh | 29 ++ scripts/docker/hub/Dockerfile | 36 ++ .../docker}/ubuntu-aarch64/Dockerfile | 2 +- .../docker}/ubuntu-arm/Dockerfile | 2 +- scripts/gitlab-build.sh | 234 ------------ scripts/gitlab-push-release.sh | 12 - scripts/gitlab-test.sh | 47 --- scripts/gitlab/build-unix.sh | 46 +++ scripts/gitlab/build-windows.sh | 50 +++ scripts/gitlab/cargo-audit.sh | 7 + .../docs-jsonrpc.sh} | 25 +- scripts/gitlab/publish-awss3.sh | 49 +++ scripts/gitlab/publish-docker.sh | 22 ++ scripts/{safe_curl.sh => gitlab/safe-curl.sh} | 0 scripts/gitlab/sign-win.cmd | 1 + scripts/gitlab/test-all.sh | 35 ++ scripts/parity.service | 2 +- snap/gui/icon.png | Bin 10671 -> 0 bytes snap/gui/parity.desktop | 8 - snap/snapcraft.yaml | 39 -- test.sh | 89 +++-- util/io/Cargo.toml | 2 +- util/io/src/lib.rs | 2 +- util/io/src/service_mio.rs | 14 +- util/io/src/service_non_mio.rs | 22 +- util/io/src/worker.rs | 14 +- util/network-devp2p/src/node_table.rs | 22 +- util/version/Cargo.toml | 2 +- 56 files changed, 856 insertions(+), 1285 deletions(-) delete mode 100644 docker/README.md delete mode 100644 docker/alpine/Dockerfile delete mode 100644 docker/android/Dockerfile delete mode 100644 docker/android/cargo-config.toml delete mode 100644 docker/android/libudev.patch delete mode 100644 docker/centos/Dockerfile delete mode 100644 docker/hub/Dockerfile delete mode 100644 docker/ubuntu/Dockerfile delete mode 100755 scripts/aura-test.sh delete mode 100755 scripts/cov.sh delete mode 100755 scripts/docker-build.sh create mode 100644 scripts/docker/README.md create mode 100644 scripts/docker/alpine/Dockerfile create mode 100644 scripts/docker/centos/Dockerfile create mode 100644 scripts/docker/centos/Dockerfile.build create mode 100755 scripts/docker/centos/build.sh create mode 100644 scripts/docker/hub/Dockerfile rename {docker => scripts/docker}/ubuntu-aarch64/Dockerfile (96%) rename {docker => scripts/docker}/ubuntu-arm/Dockerfile (95%) delete mode 100755 scripts/gitlab-build.sh delete mode 100755 scripts/gitlab-push-release.sh delete mode 100755 scripts/gitlab-test.sh create mode 100755 scripts/gitlab/build-unix.sh create mode 100755 scripts/gitlab/build-windows.sh create mode 100755 scripts/gitlab/cargo-audit.sh rename scripts/{gitlab-rpc-docs.sh => gitlab/docs-jsonrpc.sh} (65%) create mode 100755 scripts/gitlab/publish-awss3.sh create mode 100755 scripts/gitlab/publish-docker.sh rename scripts/{safe_curl.sh => gitlab/safe-curl.sh} (100%) create mode 100755 scripts/gitlab/sign-win.cmd create mode 100755 scripts/gitlab/test-all.sh delete mode 100644 snap/gui/icon.png delete mode 100644 snap/gui/parity.desktop delete mode 100644 snap/snapcraft.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d58a238d..f80245bb0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,243 +1,180 @@ stages: - test - - push-release - build - - docs + - publish + - optional + +image: parity/rust:gitlab-ci + variables: - RUST_BACKTRACE: "1" - RUSTFLAGS: "" - CARGOFLAGS: "" - CI_SERVER_NAME: "GitLab CI" + CI_SERVER_NAME: "GitLab CI" + CARGO_HOME: "${CI_PROJECT_DIR}/.cargo" + BUILD_TARGET: ubuntu + BUILD_ARCH: amd64 + CARGO_TARGET: x86_64-unknown-linux-gnu + cache: - key: "$CI_BUILD_STAGE-$CI_BUILD_REF_NAME" + key: "${CI_JOB_NAME}" paths: - - target/ - untracked: true -linux-amd64: - stage: build - image: parity/rust:gitlab-ci - only: + - ./target + - ./.cargo + +.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries") + only: &releaseable_branches + - stable - beta - tags - - stable - - triggers + +.collect_artifacts: &collect_artifacts + artifacts: + name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" + when: on_success + expire_in: 1 mos + paths: + - artifacts/ + +.determine_version: &determine_version + - VERSION="$(sed -r -n '1,/^version/s/^version = "([^"]+)".*$/\1/p' Cargo.toml)" + - DATE_STR="$(date +%Y%m%d)" + - ID_SHORT="$(echo ${CI_COMMIT_SHA} | cut -c 1-7)" + - test "${CI_COMMIT_REF_NAME}" = "nightly" && VERSION="${VERSION}-${ID_SHORT}-${DATE_STR}" + - export VERSION + - echo "Version = ${VERSION}" + +test-linux: + stage: test + variables: + RUN_TESTS: cargo script: - - rustup default stable - # ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags 6. binary identifier - - scripts/gitlab-build.sh x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu amd64 gcc g++ linux + - scripts/gitlab/test-all.sh stable tags: - rust-stable - artifacts: - paths: - - parity.zip - name: "stable-x86_64-unknown-linux-gnu_parity" -linux-i686: - stage: build - image: parity/rust-i686:gitlab-ci - only: - - beta - - tags - - stable - - triggers + +build-linux: + stage: build + only: *releaseable_branches + variables: + CARGO_TARGET: x86_64-unknown-linux-gnu script: - - scripts/gitlab-build.sh i686-unknown-linux-gnu i686-unknown-linux-gnu i386 gcc g++ linux - tags: - - rust-i686 - artifacts: - paths: - - parity.zip - name: "i686-unknown-linux-gnu" - allow_failure: true -linux-armv7: - stage: build - image: parity/rust-armv7:gitlab-ci - only: - - beta - - tags - - stable - - triggers - script: - - scripts/gitlab-build.sh armv7-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ linux - tags: - - rust-arm - artifacts: - paths: - - parity.zip - name: "armv7_unknown_linux_gnueabihf_parity" - allow_failure: true -linux-armhf: - stage: build - image: parity/rust-arm:gitlab-ci - only: - - beta - - tags - - stable - - triggers - script: - - scripts/gitlab-build.sh arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabihf armhf arm-linux-gnueabihf-gcc arm-linux-gnueabihf-g++ linux - tags: - - rust-arm - artifacts: - paths: - - parity.zip - name: "arm-unknown-linux-gnueabihf_parity" - allow_failure: true -linux-aarch64: - stage: build - image: parity/rust-arm64:gitlab-ci - only: - - beta - - tags - - stable - - triggers - script: - - scripts/gitlab-build.sh aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu arm64 aarch64-linux-gnu-gcc aarch64-linux-gnu-g++ linux - tags: - - rust-arm - artifacts: - paths: - - parity.zip - name: "aarch64-unknown-linux-gnu_parity" -linux-snap: - stage: build - image: parity/snapcraft:gitlab-ci - only: - - stable - - beta - - tags - - triggers - script: - - scripts/gitlab-build.sh x86_64-unknown-snap-gnu x86_64-unknown-linux-gnu amd64 gcc g++ snap + - scripts/gitlab/build-unix.sh + <<: *collect_artifacts tags: - rust-stable - artifacts: - paths: - - parity.zip - name: "stable-x86_64-unknown-snap-gnu_parity" -darwin: - stage: build - only: - - beta - - tags - - stable - - triggers + +build-darwin: + stage: build + only: *releaseable_branches + variables: + CARGO_TARGET: x86_64-apple-darwin + CC: gcc + CXX: g++ script: - - scripts/gitlab-build.sh x86_64-apple-darwin x86_64-apple-darwin macos gcc g++ macos + - scripts/gitlab/build-unix.sh tags: - - osx - artifacts: - paths: - - parity.zip - name: "x86_64-apple-darwin_parity" -windows: - cache: - key: "%CI_BUILD_STAGE%-%CI_BUILD_REF_NAME%" - untracked: true - stage: build - only: - - beta - - tags - - stable - - triggers + - rust-osx + <<: *collect_artifacts + +build-windows: + stage: build + only: *releaseable_branches + variables: + CARGO_TARGET: x86_64-pc-windows-msvc script: - - sh scripts/gitlab-build.sh x86_64-pc-windows-msvc x86_64-pc-windows-msvc amd64 "" "" windows + - sh scripts/gitlab/build-windows.sh tags: - rust-windows - artifacts: - paths: - - parity.zip - name: "x86_64-pc-windows-msvc_parity" -android-armv7: - stage: build - image: parity/parity-android:latest - only: - - beta - - tags - - stable - - triggers - script: - - cargo build --target=armv7-linux-androideabi + <<: *collect_artifacts + +publish-docker: + stage: publish + only: *releaseable_branches + cache: {} + dependencies: + - build-linux tags: - - rust-arm - allow_failure: true - artifacts: - paths: - - parity.zip - name: "armv7-linux-androideabi_parity" -docker-build: - stage: build + - shell + script: + - scripts/gitlab/publish-docker.sh parity + +publish-awss3: + stage: publish + only: *releaseable_branches + cache: {} + dependencies: + - build-linux + - build-darwin + - build-windows + before_script: *determine_version + script: + - scripts/gitlab/publish-awss3.sh + tags: + - shell + +docs-jsonrpc: + stage: optional only: - tags - - master - - beta - - stable - - triggers - before_script: - - docker info + except: + - nightly + cache: {} script: - - if [ "$CI_BUILD_REF_NAME" == "master" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi - - echo "Tag:" $DOCKER_TAG - - docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity - - scripts/docker-build.sh $DOCKER_TAG - - docker logout + - scripts/gitlab/docs-jsonrpc.sh tags: - - docker -test-coverage: - stage: test - only: - - master + - shell + +cargo-audit: + stage: optional script: - - scripts/gitlab-test.sh test-coverage - tags: - - kcov - allow_failure: true -test-rust-stable: - stage: test - image: parity/rust:gitlab-ci - script: - - scripts/gitlab-test.sh stable + - scripts/gitlab/cargo-audit.sh tags: - rust-stable -test-rust-beta: - stage: test - only: - - triggers - - master - image: parity/rust:gitlab-ci + +test-android: + stage: optional + image: parity/rust-android:gitlab-ci + variables: + CARGO_TARGET: armv7-linux-androideabi script: - - scripts/gitlab-test.sh beta + - scripts/gitlab/test-all.sh stable + tags: + - rust-arm + +test-darwin: + stage: optional + variables: + CARGO_TARGET: x86_64-apple-darwin + CC: gcc + CXX: g++ + RUN_TESTS: cargo + script: + - scripts/gitlab/test-all.sh stable + tags: + - rust-osx + +test-windows: + stage: optional + variables: + CARGO_TARGET: x86_64-pc-windows-msvc + RUN_TESTS: cargo + script: + - sh scripts/gitlab/test-all.sh stable + tags: + - rust-windows + +test-beta: + stage: optional + variables: + RUN_TESTS: cargo + script: + - scripts/gitlab/test-all.sh beta tags: - rust-beta - allow_failure: true -test-rust-nightly: - stage: test - only: - - triggers - - master - image: parity/rust:gitlab-ci + +test-nightly: + stage: optional + variables: + RUN_TESTS: all script: - - scripts/gitlab-test.sh nightly + - scripts/gitlab/test-all.sh nightly tags: - - rust - rust-nightly - allow_failure: true -json-rpc-docs: - stage: docs - only: - - tags - image: parity/rust:gitlab-ci - script: - - scripts/gitlab-rpc-docs.sh - tags: - - docs - cache: {} -push-release: - stage: push-release - only: - - tags - - triggers - image: parity/rust:gitlab-ci - script: - - scripts/gitlab-push-release.sh - tags: - - curl diff --git a/Cargo.lock b/Cargo.lock index 8c2dad7df..920c8c8a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,6 +271,15 @@ dependencies = [ "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-deque" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam-epoch" version = "0.3.1" @@ -298,6 +307,19 @@ dependencies = [ "scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-epoch" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam-utils" version = "0.2.2" @@ -314,6 +336,11 @@ dependencies = [ "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-utils" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "crunchy" version = "0.1.6" @@ -472,7 +499,7 @@ dependencies = [ "either 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ethereum-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hash 0.1.2 (git+https://github.com/paritytech/parity-common)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "primal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -576,7 +603,7 @@ version = "1.12.0" name = "ethcore-io" version = "1.12.0" dependencies = [ - "crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1062,7 +1089,7 @@ dependencies = [ "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.24 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-rustls 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1227,7 +1254,7 @@ dependencies = [ "httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1585,12 +1612,12 @@ name = "log" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" -version = "0.4.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1705,7 +1732,7 @@ dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1717,7 +1744,7 @@ name = "mio-named-pipes" version = "0.1.5" source = "git+https://github.com/alexcrichton/mio-named-pipes#6ad80e67fe7993423b281bc13d307785ade05d37" dependencies = [ - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1828,7 +1855,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1930,7 +1957,7 @@ source = "git+https://github.com/paritytech/parity-common#0045887fecd2fec39e56c9 name = "parity-clib" version = "1.12.0" dependencies = [ - "parity-ethereum 2.0.6", + "parity-ethereum 2.0.7", ] [[package]] @@ -1947,7 +1974,7 @@ dependencies = [ [[package]] name = "parity-ethereum" -version = "2.0.6" +version = "2.0.7" dependencies = [ "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1996,7 +2023,7 @@ dependencies = [ "parity-rpc 1.12.0", "parity-rpc-client 1.4.0", "parity-updater 1.12.0", - "parity-version 2.0.6", + "parity-version 2.0.7", "parity-whisper 0.1.0", "parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "path 0.1.1 (git+https://github.com/paritytech/parity-common)", @@ -2135,7 +2162,7 @@ dependencies = [ "parity-crypto 0.1.0 (git+https://github.com/paritytech/parity-common)", "parity-reactor 0.1.0", "parity-updater 1.12.0", - "parity-version 2.0.6", + "parity-version 2.0.7", "parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "patricia-trie 0.2.1 (git+https://github.com/paritytech/parity-common)", "plain_hasher 0.1.0 (git+https://github.com/paritytech/parity-common)", @@ -2180,7 +2207,7 @@ source = "git+https://github.com/nikvolf/parity-tokio-ipc#2af3e5b6b746552d818106 dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio-named-pipes 0.1.5 (git+https://github.com/alexcrichton/mio-named-pipes)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2206,7 +2233,7 @@ dependencies = [ "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-bytes 0.1.0 (git+https://github.com/paritytech/parity-common)", "parity-hash-fetch 1.12.0", - "parity-version 2.0.6", + "parity-version 2.0.7", "parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "path 0.1.1 (git+https://github.com/paritytech/parity-common)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2217,7 +2244,7 @@ dependencies = [ [[package]] name = "parity-version" -version = "2.0.6" +version = "2.0.7" dependencies = [ "parity-bytes 0.1.0 (git+https://github.com/paritytech/parity-common)", "rlp 0.2.1 (git+https://github.com/paritytech/parity-common)", @@ -2494,7 +2521,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2565,7 +2592,7 @@ dependencies = [ "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3092,7 +3119,7 @@ dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3117,7 +3144,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3155,7 +3182,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3212,7 +3239,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3243,7 +3270,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-reactor 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3645,10 +3672,13 @@ dependencies = [ "checksum crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "24ce9782d4d5c53674646a6a4c1863a21a8fc0cb649b3c94dfc16e45071dea19" "checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" "checksum crossbeam-deque 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c1bdc73742c36f7f35ebcda81dbb33a7e0d33757d03a06d9ddca762712ec5ea2" +"checksum crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3486aefc4c0487b9cb52372c97df0a48b8c249514af1ee99703bf70d2f2ceda1" "checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" "checksum crossbeam-epoch 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9b4e2817eb773f770dcb294127c011e22771899c21d18fce7dd739c0b9832e81" +"checksum crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9" "checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" "checksum crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d636a8b3bcc1b409d7ffd3facef8f21dcb4009626adbd0c5e6c4305c07253c7b" +"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015" "checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" "checksum crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c240f247c278fa08a6d4820a6a222bfc6e0d999e51ba67be94f44c905b2161f2" "checksum ct-logs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "61cd11fb222fecf889f4531855c614548e92e8bd2eb178e35296885df5ee9a7c" @@ -3725,7 +3755,7 @@ dependencies = [ "checksum local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1ceb20f39ff7ae42f3ff9795f3986b1daad821caaa1e1732a0944103a5a1a66" "checksum lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" +"checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" "checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21" "checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" diff --git a/Cargo.toml b/Cargo.toml index 646f63599..6f2559cd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ description = "Parity Ethereum client" name = "parity-ethereum" # NOTE Make sure to update util/version/Cargo.toml as well -version = "2.0.6" +version = "2.0.7" license = "GPL-3.0" authors = ["Parity Technologies "] diff --git a/README.md b/README.md index 95e5ba2ed..d72e5bc3e 100644 --- a/README.md +++ b/README.md @@ -1,111 +1,75 @@ -# Parity - fast, light, and robust Ethereum client +![Parity Ethereum](docs/logo-parity-ethereum.svg) -## [» Download the latest release «](https://github.com/paritytech/parity/releases/latest) +## The fastest and most advanced Ethereum client. -[![build status](https://gitlab.parity.io/parity/parity/badges/master/build.svg)](https://gitlab.parity.io/parity/parity/commits/master) -[![codecov](https://codecov.io/gh/paritytech/parity/branch/master/graph/badge.svg)](https://codecov.io/gh/paritytech/parity) -[![Snap Status](https://build.snapcraft.io/badge/paritytech/parity.svg)](https://build.snapcraft.io/user/paritytech/parity) -[![GPLv3](https://img.shields.io/badge/license-GPL%20v3-green.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html) +

» Download the latest release «

+

+

-### Join the chat! +**Built for mission-critical use**: Miners, service providers, and exchanges need fast synchronisation and maximum uptime. Parity Ethereum provides the core infrastructure essential for speedy and reliable services. -Get in touch with us on Gitter: -[![Gitter: Parity](https://img.shields.io/badge/gitter-parity-4AB495.svg)](https://gitter.im/paritytech/parity) -[![Gitter: Parity.js](https://img.shields.io/badge/gitter-parity.js-4AB495.svg)](https://gitter.im/paritytech/parity.js) -[![Gitter: Parity/Miners](https://img.shields.io/badge/gitter-parity/miners-4AB495.svg)](https://gitter.im/paritytech/parity/miners) -[![Gitter: Parity-PoA](https://img.shields.io/badge/gitter-parity--poa-4AB495.svg)](https://gitter.im/paritytech/parity-poa) +- Clean, modular codebase for easy customisation +- Advanced CLI-based client +- Minimal memory and storage footprint +- Synchronise in hours, not days with Warp Sync +- Modular for light integration into your service or product -Or join our community on Matrix: -[![Riot: +Parity](https://img.shields.io/badge/riot-%2Bparity%3Amatrix.parity.io-orange.svg)](https://riot.im/app/#/group/+parity:matrix.parity.io) +## Technical Overview -Official website: https://parity.io | Be sure to check out [our wiki](https://wiki.parity.io) for more information. +Parity Ethereum's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity Ethereum using the sophisticated and cutting-edge **Rust programming language**. Parity Ethereum is licensed under the GPLv3 and can be used for all your Ethereum needs. ----- +By default, Parity Ethereum runs a JSON-RPC HTTP server on port `:8545` and a Web-Sockets server on port `:8546`. This is fully configurable and supports a number of APIs. -## About Parity +If you run into problems while using Parity Ethereum, check out the [wiki for documentation](https://wiki.parity.io/), feel free to [file an issue in this repository](https://github.com/paritytech/parity-ethereum/issues/new), or hop on our [Gitter](https://gitter.im/paritytech/parity) or [Riot](https://riot.im/app/#/group/+parity:matrix.parity.io) chat room to ask a question. We are glad to help! **For security-critical issues**, please refer to the security policy outlined in [SECURITY.md](SECURITY.md). -Parity's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity using the sophisticated and cutting-edge Rust programming language. Parity is licensed under the GPLv3, and can be used for all your Ethereum needs. +Parity Ethereum's current beta-release is 2.1. You can download it at [the releases page](https://github.com/paritytech/parity-ethereum/releases) or follow the instructions below to build from source. Please, mind the [CHANGELOG.md](CHANGELOG.md) for a list of all changes between different versions. -From Parity Ethereum client version 1.10.0, the User Interface (UI) is accessible in a separate application called Parity UI. To keep using the UI in the browser (deprecated), [follow these steps](https://wiki.parity.io/FAQ-Basic-Operations,-Configuration,-and-Synchronization#the-parity-ui-application-isnt-working-the-way-i-want). +## Build Dependencies -By default, Parity will also run a JSONRPC server on `127.0.0.1:8545` and a websockets server on `127.0.0.1:8546`. This is fully configurable and supports a number of APIs. +Parity Ethereum requires **Rust version 1.29.x** to build. -If you run into an issue while using Parity, feel free to file one in this repository or hop on our [Gitter](https://gitter.im/paritytech/parity) or [Riot](https://riot.im/app/#/group/+parity:matrix.parity.io) chat room to ask a question. We are glad to help! **For security-critical issues**, please refer to the security policy outlined in [SECURITY.MD](SECURITY.md). - -Parity's current beta-release is 1.11. You can download it at https://github.com/paritytech/parity/releases or follow the instructions below to build from source. - ----- - -## Build dependencies - -**Parity requires Rust version 1.26.0 to build** - -We recommend installing Rust through [rustup](https://www.rustup.rs/). If you don't already have rustup, you can install it like this: +We recommend installing Rust through [rustup](https://www.rustup.rs/). If you don't already have `rustup`, you can install it like this: - Linux: - ```bash - $ curl https://sh.rustup.rs -sSf | sh - ``` - - Parity also requires `gcc`, `g++`, `libssl-dev`/`openssl`, `libudev-dev`, `pkg-config`, `file` and `make` packages to be installed. - -- OSX: - ```bash - $ curl https://sh.rustup.rs -sSf | sh - ``` - - `clang` is required. It comes with Xcode command line tools or can be installed with homebrew. - -- Windows - Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the rustup installer from - https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the msvc toolchain: ```bash - $ rustup default stable-x86_64-pc-windows-msvc + $ curl https://sh.rustup.rs -sSf | sh ``` -Once you have rustup installed, then you need to install: + Parity Ethereum also requires `gcc`, `g++`, `libudev-dev`, `pkg-config`, `file`, `make`, and `cmake` packages to be installed. + +- OSX: + ```bash + $ curl https://sh.rustup.rs -sSf | sh + ``` + + `clang` is required. It comes with Xcode command line tools or can be installed with homebrew. + +- Windows + Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the `rustup` installer from + https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the `msvc` toolchain: + ```bash + $ rustup default stable-x86_64-pc-windows-msvc + ``` + +Once you have `rustup` installed, then you need to install: * [Perl](https://www.perl.org) -* [Yasm](http://yasm.tortall.net) +* [Yasm](https://yasm.tortall.net) -Make sure that these binaries are in your `PATH`. After that you should be able to build parity from source. +Make sure that these binaries are in your `PATH`. After that, you should be able to build Parity Ethereum from source. ----- - -## Install from the snap store - -In any of the [supported Linux distros](https://snapcraft.io/docs/core/install): +## Build from Source Code ```bash -sudo snap install parity -``` - -Or, if you want to contribute testing the upcoming release: - -```bash -sudo snap install parity --beta -``` - -And to test the latest code landed into the master branch: - -```bash -sudo snap install parity --edge -``` - ----- - -## Build from source - -```bash -# download Parity code -$ git clone https://github.com/paritytech/parity -$ cd parity +# download Parity Ethereum code +$ git clone https://github.com/paritytech/parity-ethereum +$ cd parity-ethereum # build in release mode -$ cargo build --release +$ cargo build --release --features final ``` -This will produce an executable in the `./target/release` subdirectory. +This produces an executable in the `./target/release` subdirectory. Note: if cargo fails to parse manifest try: @@ -119,7 +83,7 @@ Note, when compiling a crate and you receive errors, it's in most cases your out $ cargo clean ``` -This will always compile the latest nightly builds. If you want to build stable or beta, do a +This always compiles the latest nightly builds. If you want to build stable or beta, do a ```bash $ git checkout stable @@ -131,11 +95,7 @@ or $ git checkout beta ``` -first. - ----- - -## Simple one-line installer for Mac and Ubuntu +## Simple One-Line Installer for Mac and Linux ```bash bash <(curl https://get.parity.io -L) @@ -147,22 +107,49 @@ The one-line installer always defaults to the latest beta release. To install a bash <(curl https://get.parity.io -L) -r stable ``` -## Start Parity +## Start Parity Ethereum ### Manually -To start Parity manually, just run +To start Parity Ethereum manually, just run ```bash $ ./target/release/parity ``` -and Parity will begin syncing the Ethereum blockchain. +so Parity Ethereum begins syncing the Ethereum blockchain. -### Using systemd service file +### Using `systemd` service file -To start Parity as a regular user using systemd init: +To start Parity Ethereum as a regular user using `systemd` init: 1. Copy `./scripts/parity.service` to your -systemd user directory (usually `~/.config/systemd/user`). -2. To configure Parity, write a `/etc/parity/config.toml` config file, see [Configuring Parity](https://paritytech.github.io/wiki/Configuring-Parity) for details. +`systemd` user directory (usually `~/.config/systemd/user`). +2. To configure Parity Ethereum, write a `/etc/parity/config.toml` config file, see [Configuring Parity Ethereum](https://paritytech.github.io/wiki/Configuring-Parity) for details. + +## Parity Ethereum toolchain + +In addition to the Parity Ethereum client, there are additional tools in this repository available: + +- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum. +- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding. +- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/ethstore/) - Parity Ethereum key management. +- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/ethkey/) - Parity Ethereum keys generator. +- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC. + +## Join the chat! + +Questions? Get in touch with us on Gitter: +[![Gitter: Parity](https://img.shields.io/badge/gitter-parity-4AB495.svg)](https://gitter.im/paritytech/parity) +[![Gitter: Parity.js](https://img.shields.io/badge/gitter-parity.js-4AB495.svg)](https://gitter.im/paritytech/parity.js) +[![Gitter: Parity/Miners](https://img.shields.io/badge/gitter-parity/miners-4AB495.svg)](https://gitter.im/paritytech/parity/miners) +[![Gitter: Parity-PoA](https://img.shields.io/badge/gitter-parity--poa-4AB495.svg)](https://gitter.im/paritytech/parity-poa) + +Alternatively, join our community on Matrix: +[![Riot: +Parity](https://img.shields.io/badge/riot-%2Bparity%3Amatrix.parity.io-orange.svg)](https://riot.im/app/#/group/+parity:matrix.parity.io) + +## Documentation + +Official website: https://parity.io + +Be sure to [check out our wiki](https://wiki.parity.io) for more information. diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 3b79e8dd7..000000000 --- a/docker/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Usage - -```docker build -f docker/ubuntu/Dockerfile --tag ethcore/parity:branch_or_tag_name .``` diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile deleted file mode 100644 index ad375e5a9..000000000 --- a/docker/alpine/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM alpine:edge - -WORKDIR /build - -# install tools and dependencies -RUN apk add --no-cache gcc musl-dev pkgconfig g++ make curl \ - eudev-dev rust cargo git file binutils \ - libusb-dev linux-headers perl cmake - -# show backtraces -ENV RUST_BACKTRACE 1 - -# show tools -RUN rustc -vV && \ -cargo -V && \ -gcc -v &&\ -g++ -v - -# build parity -ADD . /build/parity -RUN cd parity && \ - cargo build --release --verbose && \ - ls /build/parity/target/release/parity && \ - strip /build/parity/target/release/parity - -RUN file /build/parity/target/release/parity - -EXPOSE 8080 8545 8180 -ENTRYPOINT ["/build/parity/target/release/parity"] diff --git a/docker/android/Dockerfile b/docker/android/Dockerfile deleted file mode 100644 index 1dbf15fac..000000000 --- a/docker/android/Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -FROM ubuntu:xenial -LABEL maintainer="Parity Technologies " - -RUN apt-get update && \ - apt-get install -yq sudo curl file build-essential wget git g++ cmake pkg-config bison flex \ - unzip lib32stdc++6 lib32z1 python autotools-dev automake autoconf libtool \ - gperf xsltproc docbook-xsl - -# Rust & Cargo -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y -ENV PATH /root/.cargo/bin:$PATH -RUN rustup toolchain install stable -RUN rustup target add --toolchain stable arm-linux-androideabi -RUN rustup target add --toolchain stable armv7-linux-androideabi - -# Android NDK and toolchain -RUN cd /usr/local && \ - wget -q https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip && \ - unzip -q android-ndk-r16b-linux-x86_64.zip && \ - rm android-ndk-r16b-linux-x86_64.zip -ENV NDK_HOME /usr/local/android-ndk-r16b -RUN /usr/local/android-ndk-r16b/build/tools/make-standalone-toolchain.sh \ - --arch=arm --install-dir=/opt/ndk-standalone --stl=libc++ --platform=android-26 -ENV PATH $PATH:/opt/ndk-standalone/bin - -# Compiling libudev for Android -# This is the most hacky part of the process, as we need to apply a patch and pass specific -# options that the compiler environment doesn't define. -RUN cd /root && \ - git clone https://github.com/gentoo/eudev.git -ADD libudev.patch /root -RUN cd /root/eudev && \ - git checkout 83d918449f22720d84a341a05e24b6d109e6d3ae && \ - ./autogen.sh && \ - ./configure --disable-introspection --disable-programs --disable-hwdb \ - --host=arm-linux-androideabi --prefix=/opt/ndk-standalone/sysroot/usr/ \ - --enable-shared=false CC=arm-linux-androideabi-clang \ - CFLAGS="-D LINE_MAX=2048 -D RLIMIT_NLIMITS=15 -D IPTOS_LOWCOST=2 -std=gnu99" \ - CXX=arm-linux-androideabi-clang++ && \ - git apply - < /root/libudev.patch && \ - make && \ - make install -RUN rm -rf /root/eudev -RUN rm /root/libudev.patch - -# Rust-related configuration -ADD cargo-config.toml /root/.cargo/config -ENV ARM_LINUX_ANDROIDEABI_OPENSSL_DIR /opt/ndk-standalone/sysroot/usr -ENV ARMV7_LINUX_ANDROIDEABI_OPENSSL_DIR /opt/ndk-standalone/sysroot/usr -ENV CC_arm_linux_androideabi arm-linux-androideabi-clang -ENV CC_armv7_linux_androideabi arm-linux-androideabi-clang -ENV CXX_arm_linux_androideabi arm-linux-androideabi-clang++ -ENV CXX_armv7_linux_androideabi arm-linux-androideabi-clang++ -ENV AR_arm_linux_androideabi arm-linux-androideabi-ar -ENV AR_armv7_linux_androideabi arm-linux-androideabi-ar -ENV CFLAGS_arm_linux_androideabi -std=gnu11 -fPIC -D OS_ANDROID -ENV CFLAGS_armv7_linux_androideabi -std=gnu11 -fPIC -D OS_ANDROID -ENV CXXFLAGS_arm_linux_androideabi -std=gnu++11 -fPIC -fexceptions -frtti -static-libstdc++ -D OS_ANDROID -ENV CXXFLAGS_armv7_linux_androideabi -std=gnu++11 -fPIC -fexceptions -frtti -static-libstdc++ -D OS_ANDROID -ENV CXXSTDLIB_arm_linux_androideabi "" -ENV CXXSTDLIB_armv7_linux_androideabi "" diff --git a/docker/android/cargo-config.toml b/docker/android/cargo-config.toml deleted file mode 100644 index 7373a7e14..000000000 --- a/docker/android/cargo-config.toml +++ /dev/null @@ -1,9 +0,0 @@ -[target.armv7-linux-androideabi] -linker = "arm-linux-androideabi-clang" -ar = "arm-linux-androideabi-ar" -rustflags = ["-C", "link-arg=-lc++_static", "-C", "link-arg=-lc++abi", "-C", "link-arg=-landroid_support"] - -[target.arm-linux-androideabi] -linker = "arm-linux-androideabi-clang" -ar = "arm-linux-androideabi-ar" -rustflags = ["-C", "link-arg=-lc++_static", "-C", "link-arg=-lc++abi", "-C", "link-arg=-landroid_support"] diff --git a/docker/android/libudev.patch b/docker/android/libudev.patch deleted file mode 100644 index ba7e849b2..000000000 --- a/docker/android/libudev.patch +++ /dev/null @@ -1,216 +0,0 @@ -diff --git a/src/collect/collect.c b/src/collect/collect.c -index 2cf1f00..b24f26b 100644 ---- a/src/collect/collect.c -+++ b/src/collect/collect.c -@@ -84,7 +84,7 @@ static void usage(void) - " invoked for each ID in ) collect returns 0, the\n" - " number of missing IDs otherwise.\n" - " On error a negative number is returned.\n\n" -- , program_invocation_short_name); -+ , "parity"); - } - - /* -diff --git a/src/scsi_id/scsi_id.c b/src/scsi_id/scsi_id.c -index 8b76d87..7bf3948 100644 ---- a/src/scsi_id/scsi_id.c -+++ b/src/scsi_id/scsi_id.c -@@ -321,7 +321,7 @@ static void help(void) { - " -u --replace-whitespace Replace all whitespace by underscores\n" - " -v --verbose Verbose logging\n" - " -x --export Print values as environment keys\n" -- , program_invocation_short_name); -+ , "parity"); - - } - -diff --git a/src/shared/hashmap.h b/src/shared/hashmap.h -index a03ee58..a7c2005 100644 ---- a/src/shared/hashmap.h -+++ b/src/shared/hashmap.h -@@ -98,10 +98,7 @@ extern const struct hash_ops uint64_hash_ops; - #if SIZEOF_DEV_T != 8 - unsigned long devt_hash_func(const void *p, const uint8_t hash_key[HASH_KEY_SIZE]) _pure_; - int devt_compare_func(const void *a, const void *b) _pure_; --extern const struct hash_ops devt_hash_ops = { -- .hash = devt_hash_func, -- .compare = devt_compare_func --}; -+extern const struct hash_ops devt_hash_ops; - #else - #define devt_hash_func uint64_hash_func - #define devt_compare_func uint64_compare_func -diff --git a/src/shared/log.c b/src/shared/log.c -index 4a40996..1496984 100644 ---- a/src/shared/log.c -+++ b/src/shared/log.c -@@ -335,7 +335,7 @@ static int write_to_syslog( - - IOVEC_SET_STRING(iovec[0], header_priority); - IOVEC_SET_STRING(iovec[1], header_time); -- IOVEC_SET_STRING(iovec[2], program_invocation_short_name); -+ IOVEC_SET_STRING(iovec[2], "parity"); - IOVEC_SET_STRING(iovec[3], header_pid); - IOVEC_SET_STRING(iovec[4], buffer); - -@@ -383,7 +383,7 @@ static int write_to_kmsg( - char_array_0(header_pid); - - IOVEC_SET_STRING(iovec[0], header_priority); -- IOVEC_SET_STRING(iovec[1], program_invocation_short_name); -+ IOVEC_SET_STRING(iovec[1], "parity"); - IOVEC_SET_STRING(iovec[2], header_pid); - IOVEC_SET_STRING(iovec[3], buffer); - IOVEC_SET_STRING(iovec[4], "\n"); -diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c -index 6af7163..3271e56 100644 ---- a/src/udev/udevadm-control.c -+++ b/src/udev/udevadm-control.c -@@ -41,7 +41,7 @@ static void print_help(void) { - " -p --property=KEY=VALUE Set a global property for all events\n" - " -m --children-max=N Maximum number of children\n" - " --timeout=SECONDS Maximum time to block for a reply\n" -- , program_invocation_short_name); -+ , "parity"); - } - - static int adm_control(struct udev *udev, int argc, char *argv[]) { -diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c -index 0aec976..a31ac02 100644 ---- a/src/udev/udevadm-info.c -+++ b/src/udev/udevadm-info.c -@@ -279,7 +279,7 @@ static void help(void) { - " -P --export-prefix Export the key name with a prefix\n" - " -e --export-db Export the content of the udev database\n" - " -c --cleanup-db Clean up the udev database\n" -- , program_invocation_short_name); -+ , "parity"); - } - - static int uinfo(struct udev *udev, int argc, char *argv[]) { -diff --git a/src/udev/udevadm-monitor.c b/src/udev/udevadm-monitor.c -index 15ded09..b58dd08 100644 ---- a/src/udev/udevadm-monitor.c -+++ b/src/udev/udevadm-monitor.c -@@ -73,7 +73,7 @@ static void help(void) { - " -u --udev Print udev events\n" - " -s --subsystem-match=SUBSYSTEM[/DEVTYPE] Filter events by subsystem\n" - " -t --tag-match=TAG Filter events by tag\n" -- , program_invocation_short_name); -+ , "parity"); - } - - static int adm_monitor(struct udev *udev, int argc, char *argv[]) { -diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c -index 33597bc..b36a504 100644 ---- a/src/udev/udevadm-settle.c -+++ b/src/udev/udevadm-settle.c -@@ -43,7 +43,7 @@ static void help(void) { - " --version Show package version\n" - " -t --timeout=SECONDS Maximum time to wait for events\n" - " -E --exit-if-exists=FILE Stop waiting if file exists\n" -- , program_invocation_short_name); -+ , "parity"); - } - - static int adm_settle(struct udev *udev, int argc, char *argv[]) { -diff --git a/src/udev/udevadm-test-builtin.c b/src/udev/udevadm-test-builtin.c -index baaeca9..50ed812 100644 ---- a/src/udev/udevadm-test-builtin.c -+++ b/src/udev/udevadm-test-builtin.c -@@ -39,7 +39,7 @@ static void help(struct udev *udev) { - " -h --help Print this message\n" - " --version Print version of the program\n\n" - "Commands:\n" -- , program_invocation_short_name); -+ , "parity"); - - udev_builtin_list(udev); - } -diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c -index 47fd924..a855412 100644 ---- a/src/udev/udevadm-test.c -+++ b/src/udev/udevadm-test.c -@@ -39,7 +39,7 @@ static void help(void) { - " --version Show package version\n" - " -a --action=ACTION Set action string\n" - " -N --resolve-names=early|late|never When to resolve names\n" -- , program_invocation_short_name); -+ , "parity"); - } - - static int adm_test(struct udev *udev, int argc, char *argv[]) { -diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c -index 4dc756a..67787d3 100644 ---- a/src/udev/udevadm-trigger.c -+++ b/src/udev/udevadm-trigger.c -@@ -92,7 +92,7 @@ static void help(void) { - " -y --sysname-match=NAME Trigger devices with this /sys path\n" - " --name-match=NAME Trigger devices with this /dev name\n" - " -b --parent-match=NAME Trigger devices with that parent device\n" -- , program_invocation_short_name); -+ , "parity"); - } - - static int adm_trigger(struct udev *udev, int argc, char *argv[]) { -diff --git a/src/udev/udevadm.c b/src/udev/udevadm.c -index 3e57cf6..b03dfaa 100644 ---- a/src/udev/udevadm.c -+++ b/src/udev/udevadm.c -@@ -62,7 +62,7 @@ static int adm_help(struct udev *udev, int argc, char *argv[]) { - printf("%s [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n\n" - "Send control commands or test the device manager.\n\n" - "Commands:\n" -- , program_invocation_short_name); -+ , "parity"); - - for (i = 0; i < ELEMENTSOF(udevadm_cmds); i++) - if (udevadm_cmds[i]->help != NULL) -@@ -128,7 +128,7 @@ int main(int argc, char *argv[]) { - goto out; - } - -- fprintf(stderr, "%s: missing or unknown command\n", program_invocation_short_name); -+ fprintf(stderr, "%s: missing or unknown command\n", "parity"); - rc = 2; - out: - mac_selinux_finish(); -diff --git a/src/udev/udevd.c b/src/udev/udevd.c -index cf826c6..4eec0af 100644 ---- a/src/udev/udevd.c -+++ b/src/udev/udevd.c -@@ -1041,7 +1041,7 @@ static void help(void) { - " -t --event-timeout=SECONDS Seconds to wait before terminating an event\n" - " -N --resolve-names=early|late|never\n" - " When to resolve users and groups\n" -- , program_invocation_short_name); -+ , "parity"); - } - - static int parse_argv(int argc, char *argv[]) { -diff --git a/src/v4l_id/v4l_id.c b/src/v4l_id/v4l_id.c -index 1dce0d5..f65badf 100644 ---- a/src/v4l_id/v4l_id.c -+++ b/src/v4l_id/v4l_id.c -@@ -49,7 +49,7 @@ int main(int argc, char *argv[]) { - printf("%s [-h,--help] \n\n" - "Video4Linux device identification.\n\n" - " -h Print this message\n" -- , program_invocation_short_name); -+ , "parity"); - return 0; - case '?': - return -EINVAL; -diff --git a/src/shared/path-util.c b/src/shared/path-util.c -index 0744563..7151356 100644 ---- a/src/shared/path-util.c -+++ b/src/shared/path-util.c -@@ -109,7 +109,7 @@ char *path_make_absolute_cwd(const char *p) { - if (path_is_absolute(p)) - return strdup(p); - -- cwd = get_current_dir_name(); -+ cwd = getcwd(malloc(128), 128); - if (!cwd) - return NULL; - diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile deleted file mode 100644 index 7c944001e..000000000 --- a/docker/centos/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM centos:latest -WORKDIR /build - -# install tools and dependencies -RUN yum -y update&& \ - yum install -y git make gcc-c++ gcc file binutils cmake - -# install rustup -RUN curl -sSf https://static.rust-lang.org/rustup.sh -o rustup.sh &&\ -ls&&\ - sh rustup.sh --disable-sudo - -# show backtraces -ENV RUST_BACKTRACE 1 - -# set compiler -ENV CXX g++ -ENV CC gcc - -# show tools -RUN rustc -vV && \ -cargo -V && \ -gcc -v &&\ -g++ -v - -# build parity -ADD . /build/parity -RUN cd parity&&\ - cargo build --release --verbose && \ - ls /build/parity/target/release/parity && \ - strip /build/parity/target/release/parity - -RUN file /build/parity/target/release/parity - -EXPOSE 8080 8545 8180 -ENTRYPOINT ["/build/parity/target/release/parity"] diff --git a/docker/hub/Dockerfile b/docker/hub/Dockerfile deleted file mode 100644 index f95d406f0..000000000 --- a/docker/hub/Dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -FROM ubuntu:xenial -MAINTAINER Parity Technologies -WORKDIR /build -#ENV for build TAG -ARG BUILD_TAG -ENV BUILD_TAG ${BUILD_TAG:-master} -RUN echo "Build tag:" $BUILD_TAG -# install tools and dependencies -RUN apt-get update && \ - apt-get install -y --force-yes --no-install-recommends \ - # make - build-essential \ - # add-apt-repository - software-properties-common \ - make \ - cmake \ - curl \ - wget \ - git \ - g++ \ - gcc \ - libc6 \ - libc6-dev \ - binutils \ - file \ - libudev-dev \ - pkg-config \ - dpkg-dev \ - libudev-dev &&\ -# install rustup - curl https://sh.rustup.rs -sSf | sh -s -- -y && \ -# rustup directory - PATH=/root/.cargo/bin:$PATH && \ -# show backtraces - RUST_BACKTRACE=1 && \ -# build parity -cd /build&&git clone https://github.com/paritytech/parity-ethereum && \ - cd parity-ethereum && \ - git pull&& \ - git checkout $BUILD_TAG && \ - cargo build --verbose --release --features final && \ - strip /build/parity-ethereum/target/release/parity && \ - file /build/parity-ethereum/target/release/parity&&mkdir -p /parity&& cp /build/parity-ethereum/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 \ - cmake \ - curl \ - wget \ - git \ - g++ \ - gcc \ - binutils \ - file \ - pkg-config \ - dpkg-dev &&\ - rm -rf /var/lib/apt/lists/* -# setup ENTRYPOINT -EXPOSE 8080 8545 8180 -ENTRYPOINT ["/parity/parity"] diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile deleted file mode 100644 index 574ff64eb..000000000 --- a/docker/ubuntu/Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -FROM ubuntu:14.04 -WORKDIR /build - -# install tools and dependencies -RUN apt-get update && \ - apt-get install -y \ - g++ \ - build-essential \ - cmake \ - curl \ - git \ - file \ - binutils \ - pkg-config \ - libudev-dev - -# install rustup -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y - -# rustup directory -ENV PATH /root/.cargo/bin:$PATH - -# show backtraces -ENV RUST_BACKTRACE 1 - -# show tools -RUN rustc -vV && \ -cargo -V && \ -gcc -v &&\ -g++ -v - -# build parity -ADD . /build/parity -RUN cd parity && \ - cargo build --release --verbose && \ - ls /build/parity/target/release/parity && \ - strip /build/parity/target/release/parity - -RUN file /build/parity/target/release/parity - -EXPOSE 8080 8545 8180 -ENTRYPOINT ["/build/parity/target/release/parity"] diff --git a/ethcore/res/ethereum/poasokol.json b/ethcore/res/ethereum/poasokol.json index 443ebbed0..c6d51a9c8 100644 --- a/ethcore/res/ethereum/poasokol.json +++ b/ethcore/res/ethereum/poasokol.json @@ -18,9 +18,14 @@ }, "509355": { "safeContract": "0x03048F666359CFD3C74a1A5b9a97848BF71d5038" + }, + "4622420": { + "safeContract": "0x4c6a159659CCcb033F4b2e2Be0C16ACC62b89DDB" } } - } + }, + "blockRewardContractAddress": "0x3145197AD50D7083D0222DE4fCCf67d9BD05C30D", + "blockRewardContractTransition": 4639000 } } }, diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 9e72eb36b..aa5a3019c 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -2315,14 +2315,13 @@ impl ProvingBlockChainClient for Client { env_info.gas_limit = transaction.gas.clone(); let mut jdb = self.state_db.read().journal_db().boxed_clone(); - state::prove_transaction( + state::prove_transaction_virtual( jdb.as_hashdb_mut(), header.state_root().clone(), &transaction, self.engine.machine(), &env_info, self.factories.clone(), - false, ) } diff --git a/ethcore/src/engines/tendermint/mod.rs b/ethcore/src/engines/tendermint/mod.rs index c95d61aa7..219810f26 100644 --- a/ethcore/src/engines/tendermint/mod.rs +++ b/ethcore/src/engines/tendermint/mod.rs @@ -693,7 +693,6 @@ impl Engine for Tendermint { } fn stop(&self) { - self.step_service.stop() } fn is_proposal(&self, header: &Header) -> bool { diff --git a/ethcore/src/spec/spec.rs b/ethcore/src/spec/spec.rs index d88bdb833..f0243be73 100644 --- a/ethcore/src/spec/spec.rs +++ b/ethcore/src/spec/spec.rs @@ -829,14 +829,13 @@ impl Spec { data: d, }.fake_sign(from); - let res = ::state::prove_transaction( + let res = ::state::prove_transaction_virtual( db.as_hashdb_mut(), *genesis.state_root(), &tx, self.engine.machine(), &env_info, factories.clone(), - true, ); res.map(|(out, proof)| { diff --git a/ethcore/src/state/mod.rs b/ethcore/src/state/mod.rs index 0da614254..0118f4d85 100644 --- a/ethcore/src/state/mod.rs +++ b/ethcore/src/state/mod.rs @@ -222,17 +222,16 @@ pub fn check_proof( } } -/// Prove a transaction on the given state. +/// Prove a `virtual` transaction on the given state. /// Returns `None` when the transacion could not be proved, /// and a proof otherwise. -pub fn prove_transaction + Send + Sync>( +pub fn prove_transaction_virtual + Send + Sync>( db: H, root: H256, transaction: &SignedTransaction, machine: &Machine, env_info: &EnvInfo, factories: Factories, - virt: bool, ) -> Option<(Bytes, Vec)> { use self::backend::Proving; @@ -250,7 +249,7 @@ pub fn prove_transaction + Send + Sync>( }; let options = TransactOptions::with_no_tracing().dont_check_nonce().save_output_from_contract(); - match state.execute(env_info, machine, transaction, options, virt) { + match state.execute(env_info, machine, transaction, options, true) { Err(ExecutionError::Internal(_)) => None, Err(e) => { trace!(target: "state", "Proved call failed: {}", e); diff --git a/ethcore/sync/src/chain/mod.rs b/ethcore/sync/src/chain/mod.rs index 520226a9c..00d5ef124 100644 --- a/ethcore/sync/src/chain/mod.rs +++ b/ethcore/sync/src/chain/mod.rs @@ -500,8 +500,9 @@ impl ChainSync { self.peers.clear(); } - /// Reset sync. Clear all downloaded data but keep the queue - fn reset(&mut self, io: &mut SyncIo) { + /// Reset sync. Clear all downloaded data but keep the queue. + /// Set sync state to the given state or to the initial state if `None` is provided. + fn reset(&mut self, io: &mut SyncIo, state: Option) { self.new_blocks.reset(); let chain_info = io.chain().chain_info(); for (_, ref mut p) in &mut self.peers { @@ -513,7 +514,7 @@ impl ChainSync { } } } - self.state = ChainSync::get_init_state(self.warp_sync, io.chain()); + self.state = state.unwrap_or_else(|| ChainSync::get_init_state(self.warp_sync, io.chain())); // Reactivate peers only if some progress has been made // since the last sync round of if starting fresh. self.active_peers = self.peers.keys().cloned().collect(); @@ -527,7 +528,7 @@ impl ChainSync { io.snapshot_service().abort_restore(); } self.snapshot.clear(); - self.reset(io); + self.reset(io, None); self.continue_sync(io); } @@ -692,7 +693,7 @@ impl ChainSync { /// Called after all blocks have been downloaded fn complete_sync(&mut self, io: &mut SyncIo) { trace!(target: "sync", "Sync complete"); - self.reset(io); + self.reset(io, Some(SyncState::Idle)); } /// Enter waiting state diff --git a/parity-clib-examples/cpp/CMakeLists.txt b/parity-clib-examples/cpp/CMakeLists.txt index 143d014e3..ed6229061 100644 --- a/parity-clib-examples/cpp/CMakeLists.txt +++ b/parity-clib-examples/cpp/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.5) include(ExternalProject) -include_directories("${CMAKE_SOURCE_DIR}/../parity-clib") +include_directories("${CMAKE_SOURCE_DIR}/../../parity-clib") add_executable(parity-example main.cpp) @@ -11,9 +11,9 @@ ExternalProject_Add( CONFIGURE_COMMAND "" BUILD_COMMAND "" COMMAND cargo build -p parity-clib # Note: use --release in a real project - BINARY_DIR "${CMAKE_SOURCE_DIR}/../target" + BINARY_DIR "${CMAKE_SOURCE_DIR}/../../target" INSTALL_COMMAND "" LOG_BUILD ON) add_dependencies(parity-example libparity) -target_link_libraries(parity-example "${CMAKE_SOURCE_DIR}/../target/debug/libparity.so") +target_link_libraries(parity-example "${CMAKE_SOURCE_DIR}/../../target/debug/libparity.so") diff --git a/rpc/src/v1/helpers/light_fetch.rs b/rpc/src/v1/helpers/light_fetch.rs index edceda693..2ec3af631 100644 --- a/rpc/src/v1/helpers/light_fetch.rs +++ b/rpc/src/v1/helpers/light_fetch.rs @@ -188,7 +188,7 @@ impl LightFetch { } /// Helper for getting proved execution. - pub fn proved_execution(&self, req: CallRequest, num: Trailing) -> impl Future + Send { + pub fn proved_read_only_execution(&self, req: CallRequest, num: Trailing) -> impl Future + Send { const DEFAULT_GAS_PRICE: u64 = 21_000; // starting gas when gas not provided. const START_GAS: u64 = 50_000; @@ -247,19 +247,20 @@ impl LightFetch { }).join(header_fut).and_then(move |((gas_known, tx), hdr)| { // then request proved execution. // TODO: get last-hashes from network. - let env_info = match client.env_info(id) { + let hash = hdr.hash(); + let env_info = match client.env_info(BlockId::Hash(hash)) { Some(env_info) => env_info, _ => return Either::A(future::err(errors::unknown_block())), }; - Either::B(execute_tx(gas_known, ExecuteParams { - from: from, - tx: tx, - hdr: hdr, - env_info: env_info, + Either::B(execute_read_only_tx(gas_known, ExecuteParams { + from, + tx, + hdr, + env_info, engine: client.engine().clone(), - on_demand: on_demand, - sync: sync, + on_demand, + sync, })) })) } @@ -598,10 +599,10 @@ struct ExecuteParams { // has a peer execute the transaction with given params. If `gas_known` is false, // this will double the gas on each `OutOfGas` error. -fn execute_tx(gas_known: bool, params: ExecuteParams) -> impl Future + Send { +fn execute_read_only_tx(gas_known: bool, params: ExecuteParams) -> impl Future + Send { if !gas_known { Box::new(future::loop_fn(params, |mut params| { - execute_tx(true, params.clone()).and_then(move |res| { + execute_read_only_tx(true, params.clone()).and_then(move |res| { match res { Ok(executed) => { // TODO: how to distinguish between actual OOG and diff --git a/rpc/src/v1/impls/light/eth.rs b/rpc/src/v1/impls/light/eth.rs index 1f6a54da1..d90deb648 100644 --- a/rpc/src/v1/impls/light/eth.rs +++ b/rpc/src/v1/impls/light/eth.rs @@ -399,7 +399,7 @@ impl Eth for EthClient { } fn call(&self, req: CallRequest, num: Trailing) -> BoxFuture { - Box::new(self.fetcher().proved_execution(req, num).and_then(|res| { + Box::new(self.fetcher().proved_read_only_execution(req, num).and_then(|res| { match res { Ok(exec) => Ok(exec.output.into()), Err(e) => Err(errors::execution(e)), @@ -409,7 +409,7 @@ impl Eth for EthClient { fn estimate_gas(&self, req: CallRequest, num: Trailing) -> BoxFuture { // TODO: binary chop for more accurate estimates. - Box::new(self.fetcher().proved_execution(req, num).and_then(|res| { + Box::new(self.fetcher().proved_read_only_execution(req, num).and_then(|res| { match res { Ok(exec) => Ok((exec.refunded + exec.gas_used).into()), Err(e) => Err(errors::execution(e)), diff --git a/scripts/aura-test.sh b/scripts/aura-test.sh deleted file mode 100755 index 0c39e12f4..000000000 --- a/scripts/aura-test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -set -e # fail on any error -set -u # treat unset variables as error - -cargo build -j $(nproc) --release --features final $CARGOFLAGS -git clone https://github.com/paritytech/parity-import-tests -cp target/release/parity parity-import-tests/aura/parity -cd parity-import-tests/aura -echo "Start Aura test" -./parity import blocks.rlp --chain chain.json -./parity restore snap --chain chain.json -echo "Aura test complete" diff --git a/scripts/cov.sh b/scripts/cov.sh deleted file mode 100755 index b6d25c692..000000000 --- a/scripts/cov.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# Installing KCOV under ubuntu -# https://users.rust-lang.org/t/tutorial-how-to-collect-test-coverages-for-rust-project/650# -### Install deps -# $ sudo apt-get install libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev -# -### Compile kcov -# $ wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xf master.tar.gz -# $ cd kcov-master && mkdir build && cd build -# $ cmake .. && make && sudo make install - -### Running coverage - -set -x -RUSTFLAGS="-C link-dead-code" cargo test --all --no-run || exit $? -KCOV_TARGET="target/cov" -KCOV_FLAGS="--verify" -mkdir -p $KCOV_TARGET -echo "Cover RUST" -for FILE in `find target/debug/deps ! -name "*.*"` -do - timeout --signal=SIGKILL 5m kcov --include-path=$(pwd) --exclude-path=$(pwd)/target $KCOV_FLAGS $KCOV_TARGET $FILE -done -timeout --signal=SIGKILL 5m kcov --include-path=$(pwd) --exclude-path=$(pwd)/target $KCOV_FLAGS $KCOV_TARGET target/debug/parity-* -echo "Cover JS" -cd js -npm install&&npm run test:coverage -cd .. -bash <(curl -s https://codecov.io/bash)&& - echo "Uploaded code coverage" -exit 0 diff --git a/scripts/docker-build.sh b/scripts/docker-build.sh deleted file mode 100755 index b880d33b7..000000000 --- a/scripts/docker-build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -cd docker/hub -DOCKER_BUILD_TAG=$1 -echo "Docker build tag: " $DOCKER_BUILD_TAG -if [[ "$DOCKER_BUILD_TAG" = "latest" ]]; then - docker build --build-arg BUILD_TAG="master" --no-cache=true --tag parity/parity:$DOCKER_BUILD_TAG . -else - docker build --build-arg BUILD_TAG=$DOCKER_BUILD_TAG --no-cache=true --tag parity/parity:$DOCKER_BUILD_TAG . -fi -docker run -it parity/parity:$DOCKER_BUILD_TAG -v -docker push parity/parity:$DOCKER_BUILD_TAG diff --git a/scripts/docker/README.md b/scripts/docker/README.md new file mode 100644 index 000000000..86b2fcb6a --- /dev/null +++ b/scripts/docker/README.md @@ -0,0 +1,40 @@ +## Usage + +```docker build -f docker/ubuntu/Dockerfile --tag ethcore/parity:branch_or_tag_name .``` + +## Usage - CentOS + +Builds a lightweight non-root Parity docker image: +``` +git clone https://github.com/paritytech/parity-ethereum.git +cd parity-ethereum +./docker/centos/build.sh +``` + +Fully customised build: +``` +PARITY_IMAGE_REPO=my-personal/parity \ +PARITY_BUILDER_IMAGE_TAG=build-latest \ +PARITY_RUNNER_IMAGE_TAG=centos-parity-experimental \ +./docker/centos/build.sh +``` + +Default values: +``` +# The image name +PARITY_IMAGE_REPO - parity/parity + +# The tag to be used for builder image, git commit sha will be appended +PARITY_BUILDER_IMAGE_TAG - build + +# The tag to be used for runner image +PARITY_RUNNER_IMAGE_TAG - latest +``` + +All default ports you might use will be exposed: +``` +# secret +# ipfs store ui rpc ws listener discovery +# ↓ ↓ ↓ ↓ ↓ ↓ ↓ +EXPOSE 5001 8082 8083 8180 8545 8546 30303/tcp 30303/udp +``` diff --git a/scripts/docker/alpine/Dockerfile b/scripts/docker/alpine/Dockerfile new file mode 100644 index 000000000..47b37372e --- /dev/null +++ b/scripts/docker/alpine/Dockerfile @@ -0,0 +1,43 @@ +FROM alpine:edge AS builder + +# show backtraces +ENV RUST_BACKTRACE 1 + +RUN apk add --no-cache \ + build-base \ + cargo \ + cmake \ + eudev-dev \ + linux-headers \ + perl \ + rust + +WORKDIR /parity +COPY . /parity +RUN cargo build --release --target x86_64-alpine-linux-musl --verbose +RUN strip target/x86_64-alpine-linux-musl/release/parity + + +FROM alpine:edge + +# show backtraces +ENV RUST_BACKTRACE 1 + +RUN apk add --no-cache \ + libstdc++ \ + eudev-libs \ + libgcc + +RUN addgroup -g 1000 parity \ + && adduser -u 1000 -G parity -s /bin/sh -D parity + +USER parity + +EXPOSE 8080 8545 8180 + +WORKDIR /home/parity + +RUN mkdir -p /home/parity/.local/share/io.parity.ethereum/ +COPY --chown=parity:parity --from=builder /parity/target/x86_64-alpine-linux-musl/release/parity ./ + +ENTRYPOINT ["./parity"] diff --git a/scripts/docker/centos/Dockerfile b/scripts/docker/centos/Dockerfile new file mode 100644 index 000000000..22a98c003 --- /dev/null +++ b/scripts/docker/centos/Dockerfile @@ -0,0 +1,28 @@ +FROM centos:latest + +RUN mkdir -p /opt/parity/data && \ + chmod g+rwX /opt/parity/data && \ + mkdir -p /opt/parity/release + +COPY parity/parity /opt/parity/release + +WORKDIR /opt/parity/data + +# exposing default ports +# +# secret +# ipfs store ui rpc ws listener discovery +# ↓ ↓ ↓ ↓ ↓ ↓ ↓ +EXPOSE 5001 8082 8083 8180 8545 8546 30303/tcp 30303/udp + +# switch to non-root user +USER 1001 + +#if no base path provided, assume it's current workdir +CMD ["--base-path","."] +ENTRYPOINT ["/opt/parity/release/parity"] + + + + + diff --git a/scripts/docker/centos/Dockerfile.build b/scripts/docker/centos/Dockerfile.build new file mode 100644 index 000000000..454af403a --- /dev/null +++ b/scripts/docker/centos/Dockerfile.build @@ -0,0 +1,25 @@ +FROM centos:latest + +WORKDIR /build + +ADD . /build/parity-ethereum + +RUN yum -y update && \ + yum install -y systemd-devel git make gcc-c++ gcc file binutils && \ + curl -L "https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.tar.gz" -o cmake.tar.gz && \ + tar -xzf cmake.tar.gz && \ + cp -r cmake-3.12.0-Linux-x86_64/* /usr/ && \ + curl https://sh.rustup.rs -sSf | sh -s -- -y && \ + PATH=/root/.cargo/bin:$PATH && \ + RUST_BACKTRACE=1 && \ + rustc -vV && \ + cargo -V && \ + gcc -v && \ + g++ -v && \ + cmake --version && \ + cd parity-ethereum && \ + cargo build --verbose --release --features final && \ + strip /build/parity-ethereum/target/release/parity && \ + file /build/parity-ethereum/target/release/parity + + diff --git a/scripts/docker/centos/build.sh b/scripts/docker/centos/build.sh new file mode 100755 index 000000000..7215e745f --- /dev/null +++ b/scripts/docker/centos/build.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env sh + +# The image name +PARITY_IMAGE_REPO=${PARITY_IMAGE_REPO:-parity/parity} +# The tag to be used for builder image +PARITY_BUILDER_IMAGE_TAG=${PARITY_BUILDER_IMAGE_TAG:-build} +# The tag to be used for runner image +PARITY_RUNNER_IMAGE_TAG=${PARITY_RUNNER_IMAGE_TAG:-latest} + +echo Building $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") +docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") . -f docker/centos/Dockerfile.build + +echo Creating $PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H"), extracting binary +docker create --name extract $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") +mkdir docker/centos/parity +docker cp extract:/build/parity-ethereum/target/release/parity docker/centos/parity + +echo Building $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG +docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG docker/centos/ -f docker/centos/Dockerfile + +echo Cleaning up ... +rm -rf docker/centos/parity +docker rm -f extract +docker rmi -f $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git log -1 --format="%H") + +echo Echoing Parity version: +docker run $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG --version + +echo Done. diff --git a/scripts/docker/hub/Dockerfile b/scripts/docker/hub/Dockerfile new file mode 100644 index 000000000..53fa092ef --- /dev/null +++ b/scripts/docker/hub/Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:xenial +MAINTAINER Parity Technologies +#set ENVIROMENT +ARG TARGET +ENV TARGET ${TARGET} + +# install tools and dependencies +RUN apt update && apt install -y --no-install-recommends openssl libudev-dev file + +# show backtraces +ENV RUST_BACKTRACE 1 + +#cleanup Docker image +RUN apt autoremove -y +RUN apt clean -y +RUN rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* + +RUN groupadd -g 1000 parity \ + && useradd -m -u 1000 -g parity -s /bin/sh parity + +USER parity + +WORKDIR /home/parity + +ENV PATH "~/bin:${PATH}" + +#add TARGET to docker image +COPY artifacts/x86_64-unknown-linux-gnu/$TARGET ./bin/$TARGET + +# Build a shell script because the ENTRYPOINT command doesn't like using ENV +RUN echo "#!/bin/bash \n ${TARGET} \$@" > ./entrypoint.sh +RUN chmod +x ./entrypoint.sh + +# setup ENTRYPOINT +EXPOSE 5001 8080 8082 8083 8545 8546 8180 30303/tcp 30303/udp +ENTRYPOINT ["./entrypoint.sh"] diff --git a/docker/ubuntu-aarch64/Dockerfile b/scripts/docker/ubuntu-aarch64/Dockerfile similarity index 96% rename from docker/ubuntu-aarch64/Dockerfile rename to scripts/docker/ubuntu-aarch64/Dockerfile index 5eefe3dbd..cd8320530 100644 --- a/docker/ubuntu-aarch64/Dockerfile +++ b/scripts/docker/ubuntu-aarch64/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get -y update && \ apt-get install -y --force-yes --no-install-recommends \ curl git make g++ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \ libc6-arm64-cross libc6-dev-arm64-cross wget file ca-certificates \ - binutils-aarch64-linux-gnu cmake \ + binutils-aarch64-linux-gnu cmake3 libudev-dev \ && \ apt-get clean diff --git a/docker/ubuntu-arm/Dockerfile b/scripts/docker/ubuntu-arm/Dockerfile similarity index 95% rename from docker/ubuntu-arm/Dockerfile rename to scripts/docker/ubuntu-arm/Dockerfile index d924a20f5..bbdc280d5 100644 --- a/docker/ubuntu-arm/Dockerfile +++ b/scripts/docker/ubuntu-arm/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get -y update && \ apt-get install -y --force-yes --no-install-recommends \ curl git make g++ gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \ libc6-dev-armhf-cross wget file ca-certificates \ - binutils-arm-linux-gnueabihf cmake \ + binutils-arm-linux-gnueabihf cmake3 libudev-dev \ && \ apt-get clean diff --git a/scripts/gitlab-build.sh b/scripts/gitlab-build.sh deleted file mode 100755 index 014cab8e6..000000000 --- a/scripts/gitlab-build.sh +++ /dev/null @@ -1,234 +0,0 @@ -#!/usr/bin/env bash - -set -e # fail on any error -set -u # treat unset variables as error -#ARGUMENTS: 1. BUILD_PLATFORM (target for binaries) 2. PLATFORM (target for cargo) 3. ARC (architecture) 4. & 5. CC & CXX flags 6. binary identifier -BUILD_PLATFORM=$1 -PLATFORM=$2 -ARC=$3 -CC=$4 -CXX=$5 -IDENT=$6 -VER="$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")" -S3WIN="" -echo "--------------------" -echo "Build for platform: " $BUILD_PLATFORM -echo "Build identifier: " $IDENT -echo "Cargo target: " $PLATFORM -echo "CC&CXX flags: " $CC ", " $CXX -echo "Architecture: " $ARC -echo "Parity version: " $VER -echo "Branch: " $CI_BUILD_REF_NAME -echo "--------------------" - -# NOTE for sha256 we want to display filename as well -# hence we use --* instead of -p * -SHA256_BIN="rhash --sha256" - -set_env () { - echo "Set ENVIROMENT" - export HOST_CC=gcc - export HOST_CXX=g++ - rm -rf .cargo - mkdir -p .cargo - echo "[target.$PLATFORM]" >> .cargo/config - echo "linker= \"$CC\"" >> .cargo/config - cat .cargo/config -} -set_env_win () { - set PLATFORM=x86_64-pc-windows-msvc - set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" - set LIB="C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" - set RUST_BACKTRACE=1 - #export RUSTFLAGS=$RUSTFLAGS - rustup default stable-x86_64-pc-windows-msvc - echo "@ signtool sign /f "\%"1 /p "\%"2 /tr http://timestamp.comodoca.com /du https://parity.io "\%"3" > sign.cmd -} -build () { - if [[ "windows" = $IDENT ]] - then - # This is a nasty hack till we figure out the proper cargo caching strategy - echo "Remove index" - rm -rf cargo/registry/index/*. - fi - echo "Build parity:" - cargo build --target $PLATFORM --features final --release - echo "Build evmbin:" - cargo build --target $PLATFORM --release -p evmbin - echo "Build ethstore-cli:" - cargo build --target $PLATFORM --release -p ethstore-cli - echo "Build ethkey-cli:" - cargo build --target $PLATFORM --release -p ethkey-cli - echo "Build whisper-cli:" - cargo build --target $PLATFORM --release -p whisper-cli -} -strip_binaries () { - echo "Strip binaries:" - $STRIP_BIN -v target/$PLATFORM/release/parity - $STRIP_BIN -v target/$PLATFORM/release/parity-evm - $STRIP_BIN -v target/$PLATFORM/release/ethstore - $STRIP_BIN -v target/$PLATFORM/release/ethkey - $STRIP_BIN -v target/$PLATFORM/release/whisper; -} -calculate_checksums () { - echo "Checksum calculation:" - rhash --version - - rm -rf *.sha256 - - BIN="target/$PLATFORM/release/parity$S3WIN" - export SHA3="$($BIN tools hash $BIN)" - - echo "Parity file SHA3: $SHA3" - $SHA256_BIN target/$PLATFORM/release/parity$S3WIN > parity$S3WIN.sha256 - $SHA256_BIN target/$PLATFORM/release/parity-evm$S3WIN > parity-evm$S3WIN.sha256 - $SHA256_BIN target/$PLATFORM/release/ethstore$S3WIN > ethstore$S3WIN.sha256 - $SHA256_BIN target/$PLATFORM/release/ethkey$S3WIN > ethkey$S3WIN.sha256 - $SHA256_BIN target/$PLATFORM/release/whisper$S3WIN > whisper$S3WIN.sha256 -} -sign_exe () { - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/parity.exe" - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/parity-evm.exe" - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/ethstore.exe" - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/ethkey.exe" - ./sign.cmd $keyfile $certpass "target/$PLATFORM/release/whisper.exe" -} -push_binaries () { - echo "Push binaries to AWS S3" - aws configure set aws_access_key_id $s3_key - aws configure set aws_secret_access_key $s3_secret - if [[ "$CI_BUILD_REF_NAME" = "beta" || "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "nightly" ]]; - then - export S3_BUCKET=builds-parity-published; - else - export S3_BUCKET=builds-parity; - fi - aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$BUILD_PLATFORM - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN --body target/$PLATFORM/release/parity$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity$S3WIN.sha256 --body parity$S3WIN.sha256 - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN --body target/$PLATFORM/release/parity-evm$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/parity-evm$S3WIN.sha256 --body parity-evm$S3WIN.sha256 - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN --body target/$PLATFORM/release/ethstore$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethstore$S3WIN.sha256 --body ethstore$S3WIN.sha256 - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN --body target/$PLATFORM/release/ethkey$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/ethkey$S3WIN.sha256 --body ethkey$S3WIN.sha256 - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/whisper$S3WIN --body target/$PLATFORM/release/whisper$S3WIN - aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$BUILD_PLATFORM/whisper$S3WIN.sha256 --body whisper$S3WIN.sha256 -} - -make_archive () { - echo "add artifacts to archive" - rm -rf parity.zip - zip -r parity.zip target/$PLATFORM/release/parity$S3WIN target/$PLATFORM/release/parity-evm$S3WIN target/$PLATFORM/release/ethstore$S3WIN target/$PLATFORM/release/ethkey$S3WIN target/$PLATFORM/release/whisper$S3WIN parity$S3WIN.sha256 parity-evm$S3WIN.sha256 ethstore$S3WIN.sha256 ethkey$S3WIN.sha256 whisper$S3WIN.sha256 -} - -updater_push_release () { - echo "push release" - - DATA="commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity$S3WIN&secret=$RELEASES_SECRET" - # Mainnet - source scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM" - # Kovan - source scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$BUILD_PLATFORM" -} - -case $BUILD_PLATFORM in - x86_64-unknown-linux-gnu) - #set strip bin - STRIP_BIN="strip" - #package extention - build - strip_binaries - calculate_checksums - make_archive - push_binaries - updater_push_release - ;; - i686-unknown-linux-gnu) - STRIP_BIN="strip" - set_env - build - strip_binaries - calculate_checksums - make_archive - push_binaries - ;; - armv7-unknown-linux-gnueabihf) - STRIP_BIN="arm-linux-gnueabihf-strip" - set_env - build - strip_binaries - calculate_checksums - make_archive - push_binaries - ;; - arm-unknown-linux-gnueabihf) - STRIP_BIN="arm-linux-gnueabihf-strip" - set_env - build - strip_binaries - calculate_checksums - make_archive - push_binaries - ;; - aarch64-unknown-linux-gnu) - STRIP_BIN="aarch64-linux-gnu-strip" - set_env - build - strip_binaries - calculate_checksums - make_archive - push_binaries - ;; - x86_64-apple-darwin) - STRIP_BIN="strip" - PLATFORM="x86_64-apple-darwin" - build - strip_binaries - calculate_checksums - make_archive - push_binaries - updater_push_release - ;; - x86_64-unknown-snap-gnu) - ARC="amd64" - EXT="snap" - apt update - apt install -y expect zip rhash - snapcraft clean - echo "Prepare snapcraft.yaml for build on Gitlab CI in Docker image" - sed -i 's/git/'"$VER"'/g' snap/snapcraft.yaml - if [[ "$CI_BUILD_REF_NAME" = "stable" || "$CI_BUILD_REF_NAME" = "beta" || "$VER" == *1.11* || "$VER" == *2.0* ]]; - then - sed -i -e 's/grade: devel/grade: stable/' snap/snapcraft.yaml; - fi - mv -f snap/snapcraft.yaml snapcraft.yaml - snapcraft -d - snapcraft_login=$(expect -c " - spawn snapcraft login - expect \"Email:\" - send \"$SNAP_EMAIL\n\" - expect \"Password:\" - send \"$SNAP_PASS\n\" - expect \"\$\" - ") - echo "$snapcraft_login" - snapcraft push "parity_"$VER"_amd64.snap" - snapcraft status parity - snapcraft logout - $SHA256_BIN "parity_"$VER"_amd64.snap" > "parity_"$VER"_amd64.snap.sha256" - echo "add artifacts to archive" - rm -rf parity.zip - zip -r parity.zip "parity_"$VER"_amd64.snap" "parity_"$VER"_amd64.snap.sha256" - ;; - x86_64-pc-windows-msvc) - set_env_win - EXT="exe" - S3WIN=".exe" - build - sign_exe - calculate_checksums - make_archive - push_binaries - updater_push_release -esac diff --git a/scripts/gitlab-push-release.sh b/scripts/gitlab-push-release.sh deleted file mode 100755 index 207d66c11..000000000 --- a/scripts/gitlab-push-release.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e # fail on any error -set -u # treat unset variables as error - -DATA="secret=$RELEASES_SECRET" - -echo "Pushing release to Mainnet" -./scripts/safe_curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" - -echo "Pushing release to Kovan" -./scripts/safe_curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF" diff --git a/scripts/gitlab-test.sh b/scripts/gitlab-test.sh deleted file mode 100755 index fbd93167a..000000000 --- a/scripts/gitlab-test.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash -#ARGUMENT test for RUST and COVERAGE -set -e # fail on any error -set -u # treat unset variables as error -if [[ "$CI_COMMIT_REF_NAME" = "master" || "$CI_COMMIT_REF_NAME" = "beta" || "$CI_COMMIT_REF_NAME" = "stable" ]]; then - export GIT_COMPARE=$CI_COMMIT_REF_NAME~; -else - export GIT_COMPARE=master; -fi -git fetch -a -export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e ^mac/ -e ^nsis/ -e ^docs/ | wc -l)" -echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED" -TEST_SWITCH=$1 -rust_test () { - git submodule update --init --recursive - rustup show - if [[ "${RUST_FILES_MODIFIED}" == "0" ]]; - then echo "Skipping Rust tests since no Rust files modified."; - else ./test.sh || exit $?; - fi - # if [[ "$CI_COMMIT_REF_NAME" == "nightly" ]]; - # ### @TODO re-enable fail after https://github.com/paritytech/parity-import-tests/issues/3 - # then sh scripts/aura-test.sh; # || exit $?; - # fi -} -coverage_test () { - git submodule update --init --recursive - rm -rf target/* - scripts/cov.sh -} -case $TEST_SWITCH in - stable ) - rustup default stable - rust_test - ;; - beta) - rustup default beta - rust_test - ;; - nightly) - rustup default nightly - rust_test - ;; - test-coverage) - coverage_test - ;; -esac diff --git a/scripts/gitlab/build-unix.sh b/scripts/gitlab/build-unix.sh new file mode 100755 index 000000000..00933f1ee --- /dev/null +++ b/scripts/gitlab/build-unix.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -e # fail on any error +set -u # treat unset variables as error + +echo "__________Show ENVIROMENT__________" +echo "CI_SERVER_NAME: " $CI_SERVER_NAME +echo "CARGO_HOME: " $CARGO_HOME +echo "BUILD_TARGET: " $BUILD_TARGET +echo "BUILD_ARCH: " $BUILD_ARCH +echo "CARGO_TARGET: " $CARGO_TARGET +echo "CC: " $CC +echo "CXX: " $CXX + +echo "__________CARGO CONFIG__________" +mkdir -p .cargo +rm -f .cargo/config +echo "[target.$CARGO_TARGET]" >> .cargo/config +echo "linker= \"$CC\"" >> .cargo/config +cat .cargo/config + +echo "_____ Building target: "$CARGO_TARGET" _____" +time cargo build --target $CARGO_TARGET --release --features final +time cargo build --target $CARGO_TARGET --release -p evmbin +time cargo build --target $CARGO_TARGET --release -p ethstore-cli +time cargo build --target $CARGO_TARGET --release -p ethkey-cli +time cargo build --target $CARGO_TARGET --release -p whisper-cli + +echo "_____ Post-processing binaries _____" +rm -rf artifacts +mkdir -p artifacts +cd artifacts +mkdir -p $CARGO_TARGET +cd $CARGO_TARGET +cp ../../target/$CARGO_TARGET/release/parity ./parity +cp ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm +cp ../../target/$CARGO_TARGET/release/ethstore ./ethstore +cp ../../target/$CARGO_TARGET/release/ethkey ./ethkey +cp ../../target/$CARGO_TARGET/release/whisper ./whisper +strip -v ./* +echo "_____ Calculating checksums _____" +for binary in $(ls) +do + rhash --sha256 $binary -o $binary.sha256 + ./parity tools hash $binary > $binary.sha3 +done diff --git a/scripts/gitlab/build-windows.sh b/scripts/gitlab/build-windows.sh new file mode 100755 index 000000000..b0570b917 --- /dev/null +++ b/scripts/gitlab/build-windows.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -e # fail on any error +set -u # treat unset variables as error + +set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" +set LIB="C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" + +rustup default stable-x86_64-pc-windows-msvc + +echo "__________Show ENVIROMENT__________" +echo "CI_SERVER_NAME: " $CI_SERVER_NAME +echo "CARGO_HOME: " $CARGO_HOME +echo "BUILD_TARGET: " $BUILD_TARGET +echo "BUILD_ARCH: " $BUILD_ARCH +echo "CARGO_TARGET: " $CARGO_TARGET + +echo "_____ Building target: "$CARGO_TARGET" _____" +time cargo build --target $CARGO_TARGET --release --features final +time cargo build --target $CARGO_TARGET --release -p evmbin +time cargo build --target $CARGO_TARGET --release -p ethstore-cli +time cargo build --target $CARGO_TARGET --release -p ethkey-cli +time cargo build --target $CARGO_TARGET --release -p whisper-cli + +echo "__________Sign binaries__________" +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity.exe +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/parity-evm.exe +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethstore.exe +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/ethkey.exe +scripts/gitlab/sign-win.cmd $keyfile $certpass target/$CARGO_TARGET/release/whisper.exe + +echo "_____ Post-processing binaries _____" +rm -rf artifacts +mkdir -p artifacts +cd artifacts +mkdir -p $CARGO_TARGET +cd $CARGO_TARGET +cp --verbose ../../target/$CARGO_TARGET/release/parity.exe ./parity.exe +cp --verbose ../../target/$CARGO_TARGET/release/parity-evm.exe ./parity-evm.exe +cp --verbose ../../target/$CARGO_TARGET/release/ethstore.exe ./ethstore.exe +cp --verbose ../../target/$CARGO_TARGET/release/ethkey.exe ./ethkey.exe +cp --verbose ../../target/$CARGO_TARGET/release/whisper.exe ./whisper.exe + +echo "_____ Calculating checksums _____" +for binary in $(ls) +do + rhash --sha256 $binary -o $binary.sha256 + ./parity.exe tools hash $binary > $binary.sha3 +done +cp parity.exe.sha256 parity.sha256 +cp parity.exe.sha3 parity.sha3 diff --git a/scripts/gitlab/cargo-audit.sh b/scripts/gitlab/cargo-audit.sh new file mode 100755 index 000000000..3677204d6 --- /dev/null +++ b/scripts/gitlab/cargo-audit.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e # fail on any error +set -u # treat unset variables as error + +CARGO_TARGET_DIR=./target cargo +stable install cargo-audit +cargo +stable audit diff --git a/scripts/gitlab-rpc-docs.sh b/scripts/gitlab/docs-jsonrpc.sh similarity index 65% rename from scripts/gitlab-rpc-docs.sh rename to scripts/gitlab/docs-jsonrpc.sh index 13d494371..3c00fe4ea 100755 --- a/scripts/gitlab-rpc-docs.sh +++ b/scripts/gitlab/docs-jsonrpc.sh @@ -1,43 +1,48 @@ -#!/usr/bin/env bash - -set -e # fail on errors - +#!/bin/bash +set -e # fail on any error +set -u # treat unset variables as error clone_repos() { + echo "__________Clone repos__________" git clone https://github.com/parity-js/jsonrpc.git jsonrpc git clone https://github.com/paritytech/wiki.git wiki } build_docs() { + echo "__________Build docs__________" npm install npm run build:markdown } update_wiki_docs() { + echo "__________Update WIKI docs__________" for file in $(ls jsonrpc/docs); do module_name=${file:0:-3} mv jsonrpc/docs/$file wiki/JSONRPC-$module_name-module.md done } +setup_git() { + echo "__________Set github__________" + git config user.email "devops@parity.com" + git config user.name "Devops Parity" +} + set_remote_wiki() { git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/wiki.git" } -setup_git() { - git config --global user.email "devops@parity.com" - git config --global user.name "Devops Parity" -} - commit_files() { + echo "__________Commit files__________" git checkout -b rpcdoc-update-${CI_COMMIT_REF_NAME} git add . git commit -m "Update docs to ${CI_COMMIT_REF_NAME}" - git tag -a "${CI_COMMIT_REF_NAME}" -m "Updated to ${CI_COMMIT_REF_NAME}" + git tag -a "${CI_COMMIT_REF_NAME}" -m "Update RPC docs to ${CI_COMMIT_REF_NAME}" } upload_files() { + echo "__________Upload files__________" git push origin HEAD git push --tags } diff --git a/scripts/gitlab/publish-awss3.sh b/scripts/gitlab/publish-awss3.sh new file mode 100755 index 000000000..9ef0435f5 --- /dev/null +++ b/scripts/gitlab/publish-awss3.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e # fail on any error +set -u # treat unset variables as error + +echo "__________Register Release__________" +DATA="secret=$RELEASES_SECRET" + +echo "Pushing release to Mainnet" +./scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1337/push-release/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHA" + +echo "Pushing release to Kovan" +./scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1338/push-release/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHA" + +cd artifacts +ls -l | sort -k9 +filetest=( * ) +echo ${filetest[*]} +for DIR in "${filetest[@]}"; +do + cd $DIR + if [[ $DIR =~ "windows" ]]; + then + WIN=".exe"; + else + WIN=""; + fi + sha3=$(cat parity.sha3 | awk '{print $1}') + case $DIR in + x86_64* ) + DATA="commit=$CI_COMMIT_SHA&sha3=$sha3&filename=parity$WIN&secret=$RELEASES_SECRET" + ../../scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1337/push-build/$CI_COMMIT_REF_NAME/$DIR" + # Kovan + ../../scripts/gitlab/safe-curl.sh $DATA "http://update.parity.io:1338/push-build/$CI_COMMIT_REF_NAME/$DIR" + ;; + esac + cd .. +done + +echo "__________Push binaries to AWS S3____________" +aws configure set aws_access_key_id $s3_key +aws configure set aws_secret_access_key $s3_secret +if [[ "$CI_COMMIT_REF_NAME" = "beta" || "$CI_COMMIT_REF_NAME" = "stable" || "$CI_COMMIT_REF_NAME" = "nightly" ]]; + then + export S3_BUCKET=builds-parity-published; + else + export S3_BUCKET=builds-parity; +fi +aws s3 sync ./ s3://$S3_BUCKET/$CI_COMMIT_REF_NAME/ diff --git a/scripts/gitlab/publish-docker.sh b/scripts/gitlab/publish-docker.sh new file mode 100755 index 000000000..e4d2007b9 --- /dev/null +++ b/scripts/gitlab/publish-docker.sh @@ -0,0 +1,22 @@ +#!/bin/bash +##ARGUMENTS: 1. Docker target +set -e # fail on any error +set -u # treat unset variables as error + +if [ "$CI_COMMIT_REF_NAME" == "master" ]; + then export DOCKER_BUILD_TAG="latest"; + else export DOCKER_BUILD_TAG=$CI_COMMIT_REF_NAME; +fi +docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity + +echo "__________Docker TAG__________" +echo $DOCKER_BUILD_TAG + +echo "__________Docker target__________" +export DOCKER_TARGET=$1 +echo $DOCKER_TARGET + +echo "__________Docker build and push__________" +docker build --build-arg TARGET=$DOCKER_TARGET --no-cache=true --tag parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG -f scripts/docker/hub/Dockerfile . +docker push parity/$DOCKER_TARGET:$DOCKER_BUILD_TAG +docker logout diff --git a/scripts/safe_curl.sh b/scripts/gitlab/safe-curl.sh similarity index 100% rename from scripts/safe_curl.sh rename to scripts/gitlab/safe-curl.sh diff --git a/scripts/gitlab/sign-win.cmd b/scripts/gitlab/sign-win.cmd new file mode 100755 index 000000000..2b014a023 --- /dev/null +++ b/scripts/gitlab/sign-win.cmd @@ -0,0 +1 @@ +@signtool sign /f %1 /p %2 /tr http://timestamp.comodoca.com /du https://parity.io %3 diff --git a/scripts/gitlab/test-all.sh b/scripts/gitlab/test-all.sh new file mode 100755 index 000000000..fa4dc6595 --- /dev/null +++ b/scripts/gitlab/test-all.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# ARGUMENT $1 Rust flavor to test with (stable/beta/nightly) + +set -e # fail on any error +set -u # treat unset variables as error + +git log --graph --oneline --all --decorate=short -n 10 + +case $CI_COMMIT_REF_NAME in + (beta|stable) + export GIT_COMPARE=$CI_COMMIT_REF_NAME~ + ;; + (master|nightly) + export GIT_COMPARE=master~ + ;; + (*) + export GIT_COMPARE=master + ;; +esac + +export RUST_FILES_MODIFIED="$(git --no-pager diff --name-only $GIT_COMPARE...$CI_COMMIT_SHA | grep -v -e ^\\. -e ^LICENSE -e ^README.md -e ^CHANGELOG.md -e ^test.sh -e ^scripts/ -e ^docs/ -e ^docker/ -e ^snap/ | wc -l | tr -d ' ')" +echo "RUST_FILES_MODIFIED: $RUST_FILES_MODIFIED" + +if [ "${RUST_FILES_MODIFIED}" = "0" ] +then + echo "__________Skipping Rust tests since no Rust files modified__________"; + exit 0 +fi + +rustup default $1 + +git submodule update --init --recursive +rustup show + +exec ./test.sh diff --git a/scripts/parity.service b/scripts/parity.service index 3d1f4a3da..24e14282b 100644 --- a/scripts/parity.service +++ b/scripts/parity.service @@ -1,5 +1,5 @@ [Unit] -Description=Parity Daemon +Description=Parity Ethereum Daemon After=network.target [Service] diff --git a/snap/gui/icon.png b/snap/gui/icon.png deleted file mode 100644 index 35238121adfd1fdb130497498b1a33f74bceff92..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10671 zcmY*~Ju{kS; zkW=VDMRTfQa)|Z2=l%Kq@q2i9nBDh%UH5feufy~8e7<5#jP>{Ni1C0x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ktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Type=Application -Encoding=UTF-8 -Name=parity -Comment=Fast, light, robust Ethereum implementation -Exec=parity -Icon=/usr/share/pixmaps/icon.png -Terminal=true diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml deleted file mode 100644 index 3235c7aa3..000000000 --- a/snap/snapcraft.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: parity -version: git -summary: Fast, light, robust Ethereum implementation -description: | - Parity's goal is to be the fastest, lightest, and most secure Ethereum - client. We are developing Parity using the sophisticated and cutting-edge - Rust programming language. Parity is licensed under the GPLv3, and can be - used for all your Ethereum needs. - -grade: devel -confinement: strict - -apps: - parity: - command: parity - plugs: [home, network, network-bind, mount-observe, x11, unity7, desktop, desktop-legacy, wayland] - desktop: usr/share/applications/parity.desktop - -icon: snap/gui/icon.png - -parts: - desktop-icon: - source: ./snap - plugin: nil - override-build: | - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/applications - mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps - cp -v gui/parity.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/ - cp -v gui/icon.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/ - parity: - source: . - plugin: rust - build-attributes: [no-system-libraries] - build-packages: [g++, libudev-dev, make, pkg-config, cmake] - stage-packages: [libc6, libudev1, libstdc++6] - df: - plugin: nil - stage-packages: [coreutils] - stage: [bin/df] diff --git a/test.sh b/test.sh index 82e05d954..63ea22d77 100755 --- a/test.sh +++ b/test.sh @@ -4,6 +4,7 @@ FEATURES="json-tests" OPTIONS="--release" VALIDATE=1 +THREADS=8 case $1 in --no-json) @@ -29,32 +30,72 @@ esac set -e -if [ "$VALIDATE" -eq "1" ]; then -# Validate --no-default-features build -echo "________Validate build________" -cargo check --no-default-features -cargo check --manifest-path util/io/Cargo.toml --no-default-features -cargo check --manifest-path util/io/Cargo.toml --features "mio" -# Validate chainspecs -echo "________Validate chainspecs________" -./scripts/validate_chainspecs.sh +validate () { + if [ "$VALIDATE" -eq "1" ] + then + echo "________Validate build________" + time cargo check $@ --no-default-features + time cargo check $@ --manifest-path util/io/Cargo.toml --no-default-features + time cargo check $@ --manifest-path util/io/Cargo.toml --features "mio" + + # Validate chainspecs + echo "________Validate chainspecs________" + time ./scripts/validate_chainspecs.sh + else + echo "# not validating due to \$VALIDATE!=1" + fi +} + +cpp_test () { + case $CARGO_TARGET in + (x86_64-unknown-linux-gnu) + # Running the C++ example + echo "________Running the C++ example________" + cd parity-clib-examples/cpp && \ + mkdir -p build && \ + cd build && \ + cmake .. && \ + make -j $THREADS && \ + ./parity-example && \ + cd .. && \ + rm -rf build && \ + cd ../.. + ;; + (*) + echo "________Skipping the C++ example________" + ;; + esac +} + +cargo_test () { + echo "________Running Parity Full Test Suite________" + git submodule update --init --recursive + time cargo test $OPTIONS --features "$FEATURES" --all $@ -- --test-threads $THREADS +} + + +if [ "$CARGO_TARGET" ] +then + validate --target $CARGO_TARGET +else + validate fi +test "${RUN_TESTS}" = "all" && cpp_test -# Running the C++ example -echo "________Running the C++ example________" -cd parity-clib-examples/cpp && \ - mkdir -p build && \ - cd build && \ - cmake .. && \ - make && \ - ./parity-example && \ - cd .. && \ - rm -rf build && \ - cd ../.. +if [ "$CARGO_TARGET" ] +then + + case "${RUN_TESTS}" in + (cargo|all) + cargo_test --target $CARGO_TARGET $@ + ;; + ('') + cargo_test --no-run --target $CARGO_TARGET $@ + ;; + esac +else + cargo_test $@ +fi -# Running tests -echo "________Running Parity Full Test Suite________" -git submodule update --init --recursive -cargo test -j 8 $OPTIONS --features "$FEATURES" --all $1 diff --git a/util/io/Cargo.toml b/util/io/Cargo.toml index 0e1dfbbc1..0bb53dc72 100644 --- a/util/io/Cargo.toml +++ b/util/io/Cargo.toml @@ -9,7 +9,7 @@ authors = ["Parity Technologies "] [dependencies] fnv = "1.0" mio = { version = "0.6.8", optional = true } -crossbeam = "0.3" +crossbeam-deque = "0.6" parking_lot = "0.6" log = "0.3" slab = "0.4" diff --git a/util/io/src/lib.rs b/util/io/src/lib.rs index 02dbf223b..3aa51fbdf 100644 --- a/util/io/src/lib.rs +++ b/util/io/src/lib.rs @@ -74,7 +74,7 @@ extern crate mio; #[macro_use] extern crate log as rlog; extern crate slab; -extern crate crossbeam; +extern crate crossbeam_deque as deque; extern crate parking_lot; extern crate num_cpus; extern crate timer; diff --git a/util/io/src/service_mio.rs b/util/io/src/service_mio.rs index 089d54cc4..775a014dc 100644 --- a/util/io/src/service_mio.rs +++ b/util/io/src/service_mio.rs @@ -20,7 +20,7 @@ use std::collections::HashMap; use mio::*; use mio::timer::{Timeout}; use mio::deprecated::{EventLoop, Handler, Sender, EventLoopBuilder}; -use crossbeam::sync::chase_lev; +use deque; use slab::Slab; use {IoError, IoHandler}; use worker::{Worker, Work, WorkType}; @@ -185,7 +185,7 @@ pub struct IoManager where Message: Send + Sync { timers: Arc>>, handlers: Arc>>>>, workers: Vec, - worker_channel: chase_lev::Worker>, + worker_channel: deque::Worker>, work_ready: Arc, } @@ -195,7 +195,7 @@ impl IoManager where Message: Send + Sync + 'static { event_loop: &mut EventLoop>, handlers: Arc>>>> ) -> Result<(), IoError> { - let (worker, stealer) = chase_lev::deque(); + let (worker, stealer) = deque::fifo(); let num_workers = 4; let work_ready_mutex = Arc::new(SMutex::new(())); let work_ready = Arc::new(SCondvar::new()); @@ -431,7 +431,7 @@ impl IoChannel where Message: Send + Sync + 'static { /// General IO Service. Starts an event loop and dispatches IO requests. /// 'Message' is a notification message type pub struct IoService where Message: Send + Sync + 'static { - thread: Mutex>>, + thread: Option>, host_channel: Mutex>>, handlers: Arc>>>>, } @@ -449,19 +449,19 @@ impl IoService where Message: Send + Sync + 'static { IoManager::::start(&mut event_loop, h).expect("Error starting IO service"); }); Ok(IoService { - thread: Mutex::new(Some(thread)), + thread: Some(thread), host_channel: Mutex::new(channel), handlers: handlers, }) } - pub fn stop(&self) { + pub fn stop(&mut self) { trace!(target: "shutdown", "[IoService] Closing..."); // Clear handlers so that shared pointers are not stuck on stack // in Channel::send_sync self.handlers.write().clear(); self.host_channel.lock().send(IoMessage::Shutdown).unwrap_or_else(|e| warn!("Error on IO service shutdown: {:?}", e)); - if let Some(thread) = self.thread.lock().take() { + if let Some(thread) = self.thread.take() { thread.join().unwrap_or_else(|e| { debug!(target: "shutdown", "Error joining IO service event loop thread: {:?}", e); }); diff --git a/util/io/src/service_non_mio.rs b/util/io/src/service_non_mio.rs index 315f84c4d..30839f9e9 100644 --- a/util/io/src/service_non_mio.rs +++ b/util/io/src/service_non_mio.rs @@ -16,7 +16,7 @@ use std::sync::{Arc, Weak}; use std::thread; -use crossbeam::sync::chase_lev; +use deque; use slab::Slab; use fnv::FnvHashMap; use {IoError, IoHandler}; @@ -198,7 +198,7 @@ struct Shared where Message: Send + Sync + 'static { // necessary. timers: Mutex>, // Channel used to send work to the worker threads. - channel: Mutex>>>, + channel: Mutex>>>, } // Messages used to communicate with the event loop from other threads. @@ -224,7 +224,7 @@ impl Clone for WorkTask where Message: Send + Sized { impl IoService where Message: Send + Sync + 'static { /// Starts IO event loop pub fn start() -> Result, IoError> { - let (tx, rx) = chase_lev::deque(); + let (tx, rx) = deque::fifo(); let shared = Arc::new(Shared { handlers: RwLock::new(Slab::with_capacity(MAX_HANDLERS)), @@ -251,7 +251,7 @@ impl IoService where Message: Send + Sync + 'static { } /// Stops the IO service. - pub fn stop(&self) { + pub fn stop(&mut self) { trace!(target: "shutdown", "[IoService] Closing..."); // Clear handlers so that shared pointers are not stuck on stack // in Channel::send_sync @@ -307,15 +307,15 @@ impl Drop for IoService where Message: Send + Sync { } } -fn do_work(shared: &Arc>, rx: chase_lev::Stealer>) - where Message: Send + Sync + 'static +fn do_work(shared: &Arc>, rx: deque::Stealer>) + where Message: Send + Sync + 'static { loop { match rx.steal() { - chase_lev::Steal::Abort => continue, - chase_lev::Steal::Empty => thread::park(), - chase_lev::Steal::Data(WorkTask::Shutdown) => break, - chase_lev::Steal::Data(WorkTask::UserMessage(message)) => { + deque::Steal::Retry => continue, + deque::Steal::Empty => thread::park(), + deque::Steal::Data(WorkTask::Shutdown) => break, + deque::Steal::Data(WorkTask::UserMessage(message)) => { for id in 0 .. MAX_HANDLERS { if let Some(handler) = shared.handlers.read().get(id) { let ctxt = IoContext { handler: id, shared: shared.clone() }; @@ -323,7 +323,7 @@ fn do_work(shared: &Arc>, rx: chase_lev::Stealer { + deque::Steal::Data(WorkTask::TimerTrigger { handler_id, token }) => { if let Some(handler) = shared.handlers.read().get(handler_id) { let ctxt = IoContext { handler: handler_id, shared: shared.clone() }; handler.timeout(&ctxt, token); diff --git a/util/io/src/worker.rs b/util/io/src/worker.rs index da144afea..13e91a79f 100644 --- a/util/io/src/worker.rs +++ b/util/io/src/worker.rs @@ -17,7 +17,7 @@ use std::sync::Arc; use std::thread::{JoinHandle, self}; use std::sync::atomic::{AtomicBool, Ordering as AtomicOrdering}; -use crossbeam::sync::chase_lev; +use deque; use service_mio::{HandlerId, IoChannel, IoContext}; use IoHandler; use LOCAL_STACK_SIZE; @@ -53,7 +53,7 @@ pub struct Worker { impl Worker { /// Creates a new worker instance. pub fn new(index: usize, - stealer: chase_lev::Stealer>, + stealer: deque::Stealer>, channel: IoChannel, wait: Arc, wait_mutex: Arc>, @@ -75,8 +75,9 @@ impl Worker { worker } - fn work_loop(stealer: chase_lev::Stealer>, - channel: IoChannel, wait: Arc, + fn work_loop(stealer: deque::Stealer>, + channel: IoChannel, + wait: Arc, wait_mutex: Arc>, deleting: Arc) where Message: Send + Sync + 'static { @@ -91,8 +92,9 @@ impl Worker { while !deleting.load(AtomicOrdering::Acquire) { match stealer.steal() { - chase_lev::Steal::Data(work) => Worker::do_work(work, channel.clone()), - _ => break, + deque::Steal::Data(work) => Worker::do_work(work, channel.clone()), + deque::Steal::Retry => {}, + deque::Steal::Empty => break, } } } diff --git a/util/network-devp2p/src/node_table.rs b/util/network-devp2p/src/node_table.rs index 6dd75a00d..9fa8e5eec 100644 --- a/util/network-devp2p/src/node_table.rs +++ b/util/network-devp2p/src/node_table.rs @@ -625,19 +625,29 @@ mod tests { // unknown - node 6 + // nodes are also ordered according to their addition time + // + // nanosecond precision lost since mac os x high sierra update so let's not compare their order + // https://github.com/paritytech/parity-ethereum/issues/9632 let r = table.nodes(&IpFilter::default()); - assert_eq!(r[0][..], id4[..]); // most recent success - assert_eq!(r[1][..], id3[..]); + // most recent success + assert!( + (r[0] == id4 && r[1] == id3) || + (r[0] == id3 && r[1] == id4) + ); // unknown (old contacts and new nodes), randomly shuffled assert!( - r[2][..] == id5[..] && r[3][..] == id6[..] || - r[2][..] == id6[..] && r[3][..] == id5[..] + (r[2] == id5 && r[3] == id6) || + (r[2] == id6 && r[3] == id5) ); - assert_eq!(r[4][..], id1[..]); // oldest failure - assert_eq!(r[5][..], id2[..]); + // oldest failure + assert!( + (r[4] == id1 && r[5] == id2) || + (r[4] == id2 && r[5] == id1) + ); } #[test] diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index 293274c1d..a9ff10cd6 100644 --- a/util/version/Cargo.toml +++ b/util/version/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "parity-version" # NOTE: this value is used for Parity version string (via env CARGO_PKG_VERSION) -version = "2.0.6" +version = "2.0.7" authors = ["Parity Technologies "] build = "build.rs"