From c190092750b5b1a74a7390b7bf8d037bff994c4b Mon Sep 17 00:00:00 2001 From: Atkins Date: Sat, 7 Mar 2020 18:36:40 +0800 Subject: [PATCH 01/11] Warn if genesis constructor revert (#11550) --- ethcore/spec/src/spec.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ethcore/spec/src/spec.rs b/ethcore/spec/src/spec.rs index f261cff24c4..747c2c5467e 100644 --- a/ethcore/spec/src/spec.rs +++ b/ethcore/spec/src/spec.rs @@ -175,8 +175,22 @@ fn run_constructors( let schedule = machine.schedule(env_info.number); let mut exec = Executive::new(&mut state, &env_info, &machine, &schedule); // failing create is not a bug - if let Err(e) = exec.create(params, &mut substate, &mut NoopTracer, &mut NoopVMTracer) { - warn!(target: "spec", "Genesis constructor execution at {} failed: {}.", address, e); + match exec.create(params, &mut substate, &mut NoopTracer, &mut NoopVMTracer) { + Ok(r) if !r.apply_state => + warn!( + target: "spec", + "Genesis constructor execution at {} failed: {}.", + address, + vm::Error::Reverted + ), + Err(e) => + warn!( + target: "spec", + "Genesis constructor execution at {} failed: {}.", + address, + e + ), + _ => () } } From 10d82ef119468f04284addb050f147755df8cbc9 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 9 Mar 2020 15:07:15 +0100 Subject: [PATCH 02/11] initial cleanup (#11542) * cleanup * upbork * review grumble: rename client id prefix * rpc-tests: make one of the clients open-ethereum * fix doctest * README: mention clang version and that our wiki is old --- .github/CONTRIBUTING.md | 12 +- .github/ISSUE_TEMPLATE.md | 2 +- .gitlab-ci.yml | 356 ---------------------- Cargo.lock | 162 +++++----- Cargo.toml | 6 +- README.md | 141 ++++----- accounts/Cargo.toml | 3 +- accounts/ethkey/Cargo.toml | 2 +- accounts/ethkey/README.md | 18 +- accounts/ethkey/cli/Cargo.toml | 2 +- accounts/ethkey/cli/src/main.rs | 2 +- accounts/ethstore/Cargo.toml | 3 +- accounts/ethstore/README.md | 18 +- accounts/ethstore/cli/Cargo.toml | 2 +- accounts/ethstore/cli/src/main.rs | 2 +- chainspec/Cargo.toml | 2 +- cli-signer/Cargo.toml | 4 +- cli-signer/rpc-client/Cargo.toml | 4 +- ethash/Cargo.toml | 2 +- ethash/src/compute.rs | 2 +- ethcore/Cargo.toml | 4 +- ethcore/blockchain/Cargo.toml | 4 +- ethcore/call-contract/Cargo.toml | 2 +- ethcore/db/Cargo.toml | 2 +- ethcore/db/src/lib.rs | 2 +- ethcore/evm/Cargo.toml | 2 +- ethcore/light/Cargo.toml | 4 +- ethcore/node-filter/Cargo.toml | 2 +- ethcore/service/Cargo.toml | 2 +- ethcore/spec/src/chain.rs | 2 +- ethcore/sync/Cargo.toml | 2 +- ethcore/sync/src/chain/propagator.rs | 4 +- ethcore/trace/src/types/trace.rs | 2 +- ethcore/types/Cargo.toml | 2 +- ethcore/types/src/errors/mod.rs | 2 +- ethcore/types/src/lib.rs | 2 +- evmbin/README.md | 12 +- evmbin/src/main.rs | 4 +- json/Cargo.toml | 2 +- miner/Cargo.toml | 4 +- miner/price-info/Cargo.toml | 2 +- miner/stratum/src/lib.rs | 2 +- parity/account_utils.rs | 2 +- parity/cli/usage_header.txt | 2 +- parity/cli/version.txt | 2 +- parity/configuration.rs | 6 +- parity/logger/Cargo.toml | 2 +- parity/main.rs | 6 +- rpc/Cargo.toml | 2 +- rpc/src/lib.rs | 2 +- rpc/src/v1/helpers/errors.rs | 8 - rpc/src/v1/tests/helpers/sync_provider.rs | 2 +- rpc/src/v1/tests/mocked/parity.rs | 71 ++++- scripts/docker/README.md | 2 +- scripts/docker/centos/Dockerfile.build | 8 +- scripts/docker/centos/build.sh | 2 +- scripts/docker/hub/Dockerfile | 4 +- scripts/docker/hub/publish-docker.sh | 4 +- scripts/gitlab/build-linux.sh | 49 --- scripts/gitlab/build-windows.sh | 52 ---- scripts/gitlab/publish-onchain.sh | 33 -- scripts/gitlab/publish-snap.sh | 2 +- scripts/gitlab/safe-curl.sh | 19 -- scripts/gitlab/sign-win.cmd | 1 - scripts/gitlab/test-linux.sh | 24 -- scripts/gitlab/validate-chainspecs.sh | 29 -- scripts/parity.service | 2 +- scripts/snap/parity.desktop | 2 +- updater/hash-fetch/Cargo.toml | 2 +- util/fetch/Cargo.toml | 2 +- util/io/Cargo.toml | 2 +- util/len-caching-lock/Cargo.toml | 2 +- util/network-devp2p/Cargo.toml | 2 +- util/network-devp2p/src/discovery.rs | 2 +- util/network/Cargo.toml | 2 +- util/network/src/client_version.rs | 32 +- util/panic-hook/Cargo.toml | 2 +- util/version/Cargo.toml | 2 +- util/version/src/lib.rs | 4 +- 79 files changed, 340 insertions(+), 863 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100755 scripts/gitlab/build-linux.sh delete mode 100755 scripts/gitlab/build-windows.sh delete mode 100755 scripts/gitlab/publish-onchain.sh delete mode 100755 scripts/gitlab/safe-curl.sh delete mode 100755 scripts/gitlab/sign-win.cmd delete mode 100755 scripts/gitlab/test-linux.sh delete mode 100755 scripts/gitlab/validate-chainspecs.sh diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 62fbd39c4da..14dc3c85666 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -12,9 +12,9 @@ Do **not** open an issue on Github if you think your discovered bug could be a * Otherwise, just create a [new issue](https://github.com/OpenEthereum/open-ethereum/issues/new) in our repository and state: -- What's your Parity Ethereum version? +- What's your Open Ethereum version? - What's your operating system and version? -- How did you install Parity Ethereum? +- How did you install Open Ethereum? - Is your node fully synchronized? - Did you try turning it off and on again? @@ -22,7 +22,7 @@ Also, try to include **steps to reproduce** the issue and expand on the **actual ## Contribute! -If you would like to contribute to Parity Ethereum, please **fork it**, fix bugs or implement features, and [propose a pull request](https://github.com/OpenEthereum/open-ethereum/compare). +If you would like to contribute to Open Ethereum, please **fork it**, fix bugs or implement features, and [propose a pull request](https://github.com/OpenEthereum/open-ethereum/compare). ### Labels & Milestones @@ -39,7 +39,7 @@ There are a few basic ground-rules for contributors (including the maintainer(s) ### Recommendations -* **Non-master branch names** *should* be prefixed with a short name moniker, followed by the associated Github Issue ID (if any), and a brief description of the task using the format `--` (e.g. `gavin-123-readme`). The name moniker helps people to inquiry about their unfinished work, and the GitHub Issue ID helps your future self and other developers (particularly those who are onboarding) find out about and understand the original scope of the task, and where it fits into Parity Ethereum [Projects](https://github.com/OpenEthereum/open-ethereum/projects). +* **Non-master branch names** *should* be prefixed with a short name moniker, followed by the associated Github Issue ID (if any), and a brief description of the task using the format `--` (e.g. `gavin-123-readme`). The name moniker helps people to inquiry about their unfinished work, and the GitHub Issue ID helps your future self and other developers (particularly those who are onboarding) find out about and understand the original scope of the task, and where it fits into Open Ethereum [Projects](https://github.com/OpenEthereum/open-ethereum/projects). * **Remove stale branches periodically** ### Preparing Pull Requests @@ -63,6 +63,4 @@ When doing a review, make sure to look for any: ## License. -By contributing to Parity Ethereum, you agree that your contributions will be licensed under the [GPLv3 License](../LICENSE). - -Each contributor has to sign our Contributor License Agreement. The purpose of the CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen license. You can read and sign our full Contributor License Agreement at [cla.parity.io](https://cla.parity.io) before submitting a pull request. +By contributing to Open Ethereum, you agree that your contributions will be licensed under the [GPLv3 License](../LICENSE). \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 0484d1fd791..755d0451fb1 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,7 +4,7 @@ _If you think that your issue is an exploitable security vulnerability, please m _You can find mode info on the reporting process in [SECURITY.md](https://github.com/OpenEthereum/open-ethereum/blob/master/SECURITY.md)_ -- **Parity Ethereum version**: 0.0.0 +- **Open Ethereum version**: 0.0.0 - **Operating system**: Windows / MacOS / Linux - **Installation**: homebrew / one-line installer / built from source - **Fully synchronized**: no / yes diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 0f1ae9f821d..00000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,356 +0,0 @@ -stages: - - test - - build - - publish - - optional - -image: ${REGISTRY}/parity-ci-linux:latest - -variables: - GIT_STRATEGY: fetch - GIT_SUBMODULE_STRATEGY: recursive - GIT_DEPTH: 3 - CI_SERVER_NAME: "GitLab CI" - CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" - CARGO_TARGET: x86_64-unknown-linux-gnu - CARGO_INCREMENTAL: 0 - REGISTRY: registry.parity.io/parity/infrastructure/scripts - -.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries") - only: &releaseable_branches - - stable - - tags - - schedules - -.collect_artifacts: &collect_artifacts - artifacts: - name: "${CI_JOB_NAME}_${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" - when: on_success - expire_in: 1 mos - paths: - - artifacts/ - - tools/ - -.docker-cache-status: &docker-cache-status - dependencies: [] - interruptible: true - before_script: - - rustup show - - cargo --version - retry: - max: 2 - when: - - runner_system_failure - - unknown_failure - - api_failure - tags: - - linux-docker - -.build-on-linux: &build-on-linux - stage: build - <<: *docker-cache-status - <<: *collect_artifacts - script: - - scripts/gitlab/build-linux.sh - after_script: - - mkdir -p tools - - cp -r scripts/docker/hub/* ./tools - - cp scripts/gitlab/publish-snap.sh ./tools - - cp scripts/gitlab/publish-onchain.sh ./tools - - cp scripts/gitlab/safe-curl.sh ./tools - - echo v"$(sed -r -n '1,/^version/s/^version\s*=\s*"([^"]+)".*$/\1/p' Cargo.toml)" | - tee ./tools/VERSION - - echo "$(sed -r -n '1,/^track/s/^track\s*=\s*"([^"]+)".*$/\1/p' ./util/version/Cargo.toml)" | - tee ./tools/TRACK - - -cargo-check 0 3: - stage: test - <<: *docker-cache-status - script: - - time cargo check --target $CARGO_TARGET --locked --no-default-features --verbose --color=always - - sccache --show-stats - -cargo-check 1 3: - stage: test - <<: *docker-cache-status - script: - - time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --no-default-features --verbose --color=always - - sccache --show-stats - -cargo-check 2 3: - stage: test - <<: *docker-cache-status - script: - - time cargo check --target $CARGO_TARGET --locked --manifest-path util/io/Cargo.toml --features "mio" --verbose --color=always - - sccache --show-stats - -cargo-check-evmbin: - stage: test - <<: *docker-cache-status - script: - - time cargo check -p evmbin --target $CARGO_TARGET --locked --verbose --color=always - - sccache --show-stats - -cargo-check-benches: - stage: test - <<: *docker-cache-status - script: - - time cargo check --workspace --benches --target $CARGO_TARGET --locked --verbose --color=always --all-features - - sccache --show-stats - -cargo-audit: - stage: test - <<: *docker-cache-status - script: - - cargo audit - allow_failure: true # failed cargo audit shouldn't prevent a PR from being merged - -validate-chainspecs: - stage: test - <<: *docker-cache-status - script: - - ./scripts/gitlab/validate-chainspecs.sh - -test-linux: - stage: build - <<: *docker-cache-status - script: - - ./scripts/gitlab/test-linux.sh stable - -test-linux-beta: - stage: build - only: *releaseable_branches - <<: *docker-cache-status - script: - - ./scripts/gitlab/test-linux.sh beta - -test-linux-nightly: - stage: build - only: *releaseable_branches - <<: *docker-cache-status - script: - - ./scripts/gitlab/test-linux.sh nightly - allow_failure: true - -build-linux: - <<: *build-on-linux - only: *releaseable_branches - -build-linux-i386: - <<: *build-on-linux - only: *releaseable_branches - image: ${REGISTRY}/parity-ci-i386:latest - variables: - CARGO_TARGET: i686-unknown-linux-gnu - -build-linux-arm64: - <<: *build-on-linux - only: *releaseable_branches - image: ${REGISTRY}/parity-ci-arm64:latest - variables: - CARGO_TARGET: aarch64-unknown-linux-gnu - -build-linux-armhf: - <<: *build-on-linux - only: *releaseable_branches - image: ${REGISTRY}/parity-ci-armhf:latest - variables: - CARGO_TARGET: armv7-unknown-linux-gnueabihf - -build-darwin: - stage: build - <<: *collect_artifacts - only: *releaseable_branches - variables: - CARGO_TARGET: x86_64-apple-darwin - CARGO_HOME: "${CI_PROJECT_DIR}/.cargo" - script: - - scripts/gitlab/build-linux.sh - tags: - - rust-osx - -build-windows: - stage: build - <<: *collect_artifacts - only: *releaseable_branches - variables: - CARGO_TARGET: x86_64-pc-windows-msvc - CARGO_HOME: "C:/ci-cache/parity-ethereum/cargo/$CI_JOB_NAME" - GIT_SUBMODULE_STRATEGY: none - script: - - sh scripts/gitlab/build-windows.sh - tags: - - rust-windows - -publish-docker: - stage: publish - only: *releaseable_branches - except: - - nightly - when: manual - dependencies: - - build-linux - environment: - name: parity-build - cache: {} - image: docker:stable - services: - - docker:dind - variables: - GIT_STRATEGY: none - DOCKER_HOST: tcp://localhost:2375 - DOCKER_DRIVER: overlay2 - GIT_STRATEGY: none - # DOCKERFILE: tools/Dockerfile - # CONTAINER_IMAGE: parity/parity - script: - - ./tools/publish-docker.sh - tags: - - kubernetes-parity-build - -publish-snap-nightly: &publish-snap - stage: publish - only: - - nightly - image: snapcore/snapcraft - variables: - GIT_STRATEGY: none - BUILD_ARCH: amd64 - cache: {} - dependencies: - - build-linux - tags: - - linux-docker - script: - - ./tools/publish-snap.sh - -publish-snap-manually: - <<: *publish-snap - only: *releaseable_branches - when: manual - -publish-snap-i386-nightly: &publish-snap-i386 - <<: *publish-snap - variables: - BUILD_ARCH: i386 - CARGO_TARGET: i686-unknown-linux-gnu - dependencies: - - build-linux-i386 - -publish-snap-i386-manually: - <<: *publish-snap-i386 - only: *releaseable_branches - when: manual - -publish-snap-arm64-nightly: &publish-snap-arm64 - <<: *publish-snap - variables: - BUILD_ARCH: arm64 - CARGO_TARGET: aarch64-unknown-linux-gnu - dependencies: - - build-linux-arm64 - -publish-snap-arm64-manually: - <<: *publish-snap-arm64 - only: *releaseable_branches - when: manual - -publish-snap-armhf-nightly: &publish-snap-armhf - <<: *publish-snap - variables: - BUILD_ARCH: armhf - CARGO_TARGET: armv7-unknown-linux-gnueabihf - dependencies: - - build-linux-armhf - -publish-snap-armhf-manually: - <<: *publish-snap-armhf - only: *releaseable_branches - when: manual - -publish-onchain-nightly: &publish-onchain - stage: publish - only: - - nightly - cache: {} - variables: - GIT_STRATEGY: none - dependencies: - - build-linux - - build-darwin - - build-windows - script: - - ./tools/publish-onchain.sh - tags: - - linux-docker - -publish-onchain-manually: - <<: *publish-onchain - only: *releaseable_branches - when: manual - -publish-release-awss3-nightly: &publish-release-awss3 - image: ${REGISTRY}/awscli:latest - stage: publish - only: - - nightly - variables: - GIT_STRATEGY: none - cache: {} - dependencies: - - build-linux - - build-darwin - - build-windows - script: - - echo "__________Push binaries to AWS S3____________" - - case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in - (stable|nightly) - export BUCKET=releases.parity.io/ethereum; - ;; - (*) - export BUCKET=builds-parity; - ;; - esac - - aws s3 sync ./artifacts s3://${BUCKET}/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/ - - echo "__________Read from S3____________" - - aws s3 ls s3://${BUCKET}/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}} --recursive --human-readable --summarize - tags: - - linux-docker - -publish-release-awss3-manually: - <<: *publish-release-awss3 - only: *releaseable_branches - when: manual - -publish-docs: - stage: publish - image: ${REGISTRY}/parity-ci-docs:latest - only: - - tags - except: - - nightly - when: manual - cache: {} - dependencies: [] - script: - - scripts/gitlab/publish-docs.sh - tags: - - linux-docker - allow_failure: true - -publish-av-whitelist: - stage: publish - variables: - GIT_STRATEGY: none - only: *releaseable_branches - except: - - nightly - when: manual - cache: {} - dependencies: - - build-windows - script: - - scripts/gitlab/publish-av-whitelists.sh - tags: - - linux-docker diff --git a/Cargo.lock b/Cargo.lock index b6590f78482..246f9bfd376 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3129,6 +3129,87 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f5bb2e8e8dec81642920ccff6b61f1eb94fa3020c5a325c9851ff604152409" +[[package]] +name = "open-ethereum" +version = "2.8.0" +dependencies = [ + "ansi_term", + "atty", + "blooms-db", + "clap", + "cli-signer", + "client-traits", + "common-types", + "ctrlc", + "dir", + "docopt", + "engine", + "ethabi", + "ethcore", + "ethcore-accounts", + "ethcore-blockchain", + "ethcore-call-contract", + "ethcore-db", + "ethcore-io", + "ethcore-light", + "ethcore-logger", + "ethcore-miner", + "ethcore-network", + "ethcore-private-tx", + "ethcore-service", + "ethcore-sync", + "ethereum-types", + "ethkey", + "ethstore", + "fake-fetch", + "fdlimit", + "futures", + "ipnetwork", + "journaldb", + "jsonrpc-core", + "keccak-hash", + "kvdb", + "kvdb-rocksdb", + "log", + "migration-rocksdb", + "node-filter", + "num_cpus", + "number_prefix", + "panic_hook", + "parity-bytes", + "parity-crypto", + "parity-daemonize", + "parity-hash-fetch", + "parity-local-store", + "parity-path", + "parity-rpc", + "parity-runtime", + "parity-secretstore", + "parity-updater", + "parity-util-mem", + "parity-version", + "parking_lot 0.10.0", + "pretty_assertions", + "regex", + "registrar", + "rlp", + "rpassword", + "rustc-hex 2.1.0", + "rustc_version", + "semver", + "serde", + "serde_derive", + "serde_json", + "snapshot", + "spec", + "tempdir", + "term_size", + "textwrap 0.9.0", + "toml", + "verification", + "winapi 0.3.8", +] + [[package]] name = "openssl-probe" version = "0.1.2" @@ -3216,87 +3297,6 @@ dependencies = [ "mio", ] -[[package]] -name = "parity-ethereum" -version = "2.8.0" -dependencies = [ - "ansi_term", - "atty", - "blooms-db", - "clap", - "cli-signer", - "client-traits", - "common-types", - "ctrlc", - "dir", - "docopt", - "engine", - "ethabi", - "ethcore", - "ethcore-accounts", - "ethcore-blockchain", - "ethcore-call-contract", - "ethcore-db", - "ethcore-io", - "ethcore-light", - "ethcore-logger", - "ethcore-miner", - "ethcore-network", - "ethcore-private-tx", - "ethcore-service", - "ethcore-sync", - "ethereum-types", - "ethkey", - "ethstore", - "fake-fetch", - "fdlimit", - "futures", - "ipnetwork", - "journaldb", - "jsonrpc-core", - "keccak-hash", - "kvdb", - "kvdb-rocksdb", - "log", - "migration-rocksdb", - "node-filter", - "num_cpus", - "number_prefix", - "panic_hook", - "parity-bytes", - "parity-crypto", - "parity-daemonize", - "parity-hash-fetch", - "parity-local-store", - "parity-path", - "parity-rpc", - "parity-runtime", - "parity-secretstore", - "parity-updater", - "parity-util-mem", - "parity-version", - "parking_lot 0.10.0", - "pretty_assertions", - "regex", - "registrar", - "rlp", - "rpassword", - "rustc-hex 2.1.0", - "rustc_version", - "semver", - "serde", - "serde_derive", - "serde_json", - "snapshot", - "spec", - "tempdir", - "term_size", - "textwrap 0.9.0", - "toml", - "verification", - "winapi 0.3.8", -] - [[package]] name = "parity-hash-fetch" version = "1.12.0" diff --git a/Cargo.toml b/Cargo.toml index c9dc4b66176..c6398e07991 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] -description = "Parity Ethereum client" -name = "parity-ethereum" +description = "Open Ethereum client" +name = "open-ethereum" # NOTE Make sure to update util/version/Cargo.toml as well version = "2.8.0" license = "GPL-3.0" -authors = ["Parity Technologies "] +authors = ["Open Ethereum developers", "Parity Technologies "] [dependencies] ansi_term = "0.11" diff --git a/README.md b/README.md index 8f5989775ee..efe26897af7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -![Parity Ethereum](docs/logo-parity-ethereum.svg) +![Open Ethereum](docs/logo-parity-ethereum.svg)

The Fastest and most Advanced Ethereum Client.

» Download the latest release «

-

+

## Table of Contents @@ -14,8 +14,7 @@ 3. [Building](#chapter-003)
3.1 [Building Dependencies](#chapter-0031)
3.2 [Building from Source Code](#chapter-0032)
- 3.3 [Simple One-Line Installer for Mac and Linux](#chapter-0033)
- 3.4 [Starting Parity Ethereum](#chapter-0034) + 3.3 [Starting Open Ethereum](#chapter-0034) 4. [Testing](#chapter-004) 5. [Documentation](#chapter-005) 6. [Toolchain](#chapter-006) @@ -26,7 +25,7 @@ ## 1. Description -**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. +**Built for mission-critical use**: Miners, service providers, and exchanges need fast synchronisation and maximum uptime. Open Ethereum provides the core infrastructure essential for speedy and reliable services. - Clean, modular codebase for easy customisation - Advanced CLI-based client @@ -36,19 +35,19 @@ ## 2. Technical Overview -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. +Open Ethereum's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Open Ethereum using the sophisticated and cutting-edge **Rust programming language**. Open 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. +By default, Open 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. -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/OpenEthereum/open-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). +If you run into problems while using Open Ethereum, check out the [old wiki for documentation](https://wiki.parity.io/), feel free to [file an issue in this repository](https://github.com/OpenEthereum/open-ethereum/issues/new), or hop on our [Discord](https://discord.gg/FJUgGe) 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). -You can download Parity Ethereum's latest release at [the releases page](https://github.com/OpenEthereum/open-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. +You can download Open Ethereum's latest release at [the releases page](https://github.com/OpenEthereum/open-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. ## 3. Building ### 3.1 Build Dependencies -Parity Ethereum requires **latest stable Rust version** to build. +Open Ethereum requires **latest stable Rust version** 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: @@ -57,7 +56,7 @@ We recommend installing Rust through [rustup](https://www.rustup.rs/). If you do $ curl https://sh.rustup.rs -sSf | sh ``` - Parity Ethereum also requires `gcc`, `g++`, `pkg-config`, `file`, `make`, and `cmake` packages to be installed. + Open Ethereum also requires `clang` (>= 9.0), `clang++`, `pkg-config`, `file`, `make`, and `cmake` packages to be installed. - OSX: ```bash @@ -77,14 +76,14 @@ Once you have `rustup` installed, then you need to install: * [Perl](https://www.perl.org) * [Yasm](https://yasm.tortall.net) -Make sure that these binaries are in your `PATH`. After that, you should be able to build Parity Ethereum from source. +Make sure that these binaries are in your `PATH`. After that, you should be able to build Open Ethereum from source. ### 3.2 Build from Source Code ```bash -# download Parity Ethereum code +# download Open Ethereum code $ git clone https://github.com/OpenEthereum/open-ethereum -$ cd parity-ethereum +$ cd open-ethereum # build in release mode $ cargo build --release --features final @@ -110,32 +109,26 @@ This always compiles the latest nightly builds. If you want to build stable, do $ git checkout stable ``` -### 3.3 Simple One-Line Installer for Mac and Linux - -```bash -bash <(curl https://get.parity.io -L) -``` - -### 3.4 Starting Parity Ethereum +### 3.3 Starting Open Ethereum #### Manually -To start Parity Ethereum manually, just run +To start Open Ethereum manually, just run ```bash $ ./target/release/parity ``` -so Parity Ethereum begins syncing the Ethereum blockchain. +so Open Ethereum begins syncing the Ethereum blockchain. #### Using `systemd` service file -To start Parity Ethereum as a regular user using `systemd` init: +To start Open Ethereum as a regular user using `systemd` init: 1. Copy `./scripts/parity.service` to your `systemd` user directory (usually `~/.config/systemd/user`). 2. Copy release to bin folder, write `sudo install ./target/release/parity /usr/bin/parity` -3. 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. +3. To configure Open Ethereum, write a `/etc/parity/config.toml` config file, see [our old wiki](https://paritytech.github.io/wiki/Configuring-Parity) for details. ## 4. Testing @@ -157,13 +150,11 @@ You can show your logs in the test output by passing `--nocapture` (i.e. `cargo ## 5. Documentation -Official website: https://parity.io +Be sure to [check out our old wiki](https://wiki.parity.io) for more information. -Be sure to [check out our wiki](https://wiki.parity.io) for more information. +### Viewing documentation for Open Ethereum packages -### Viewing documentation for Parity Ethereum packages - -You can generate documentation for Parity Ethereum Rust packages that automatically opens in your web browser using [rustdoc with Cargo](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html#using-rustdoc-with-cargo) (of the The Rustdoc Book), by running the the following commands: +You can generate documentation for Open Ethereum Rust packages that automatically opens in your web browser using [rustdoc with Cargo](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html#using-rustdoc-with-cargo) (of the The Rustdoc Book), by running the the following commands: * **All** packages ``` @@ -177,135 +168,131 @@ You can generate documentation for Parity Ethereum Rust packages that automatica Use`--document-private-items` to also view private documentation and `--no-deps` to exclude building documentation for dependencies. -Replacing `` with one of the following from the details section below (i.e. `cargo doc --package parity-ethereum --open`): +Replacing `` with one of the following from the details section below (i.e. `cargo doc --package open-ethereum --open`): **Package List**

-* Parity Ethereum (EthCore) Client Application +* Open Ethereum (EthCore) Client Application ```bash - parity-ethereum + open-ethereum ``` -* Parity Ethereum Account Management, Key Management Tool, and Keys Generator +* Open Ethereum Account Management, Key Management Tool, and Keys Generator ```bash ethcore-accounts, ethkey-cli, ethstore, ethstore-cli ``` -* Parity Chain Specification +* Open Ethereum Chain Specification ```bash chainspec ``` -* Parity CLI Signer Tool & RPC Client +* Open Ethereum CLI Signer Tool & RPC Client ```bash cli-signer parity-rpc-client ``` -* Parity Ethereum Ethash & ProgPoW Implementations +* Open Ethereum Ethash & ProgPoW Implementations ```bash ethash ``` -* Parity (EthCore) Library +* EthCore Library ```bash ethcore ``` - * Parity Ethereum Blockchain Database, Test Generator, Configuration, + * Open Ethereum Blockchain Database, Test Generator, Configuration, Caching, Importing Blocks, and Block Information ```bash ethcore-blockchain ``` - * Parity Ethereum (EthCore) Contract Calls and Blockchain Service & Registry Information + * Open Ethereum (EthCore) Contract Calls and Blockchain Service & Registry Information ```bash ethcore-call-contract ``` - * Parity Ethereum (EthCore) Database Access & Utilities, Database Cache Manager + * Open Ethereum (EthCore) Database Access & Utilities, Database Cache Manager ```bash ethcore-db ``` - * Parity Ethereum Virtual Machine (EVM) Rust Implementation + * Open Ethereum Virtual Machine (EVM) Rust Implementation ```bash evm ``` - * Parity Ethereum (EthCore) Light Client Implementation + * Open Ethereum (EthCore) Light Client Implementation ```bash ethcore-light ``` - * Parity Smart Contract based Node Filter, Manage Permissions of Network Connections + * Smart Contract based Node Filter, Manage Permissions of Network Connections ```bash node-filter ``` - * Parity Private Transactions + * Private Transactions ```bash ethcore-private-tx ``` - * Parity Ethereum (EthCore) Client & Network Service Creation & Registration with the I/O Subsystem + * Open Ethereum (EthCore) Client & Network Service Creation & Registration with the I/O Subsystem ```bash ethcore-service ``` - * Parity Ethereum (EthCore) Blockchain Synchronization + * Open Ethereum (EthCore) Blockchain Synchronization ```bash ethcore-sync ``` - * Parity Ethereum Common Types + * Open Ethereum Common Types ```bash common-types ``` - * Parity Ethereum Virtual Machines (VM) Support Library + * Open Ethereum Virtual Machines (VM) Support Library ```bash vm ``` - * Parity Ethereum WASM Interpreter + * Open Ethereum WASM Interpreter ```bash wasm ``` - * Parity Ethereum WASM Test Runner + * Open Ethereum WASM Test Runner ```bash pwasm-run-test ``` - * Parity EVM Implementation + * Open Ethereum EVM Implementation ```bash evmbin ``` - * Parity Ethereum JSON Deserialization + * Open Ethereum JSON Deserialization ```bash ethjson ``` - * Parity Ethereum State Machine Generalization for Consensus Engines + * Open Ethereum State Machine Generalization for Consensus Engines ```bash parity-machine ``` -* Parity Ethereum (EthCore) Miner Interface +* Open Ethereum (EthCore) Miner Interface ```bash ethcore-miner parity-local-store price-info ethcore-stratum using_queue ``` -* Parity Ethereum (EthCore) Logger Implementation +* Open Ethereum (EthCore) Logger Implementation ```bash ethcore-logger ``` -* C bindings library for the Parity Ethereum client - ```bash - parity-clib - ``` -* Parity Ethereum JSON-RPC Servers +* Open Ethereum JSON-RPC Servers ```bash parity-rpc ``` -* Parity Updater Service +* Open Ethereum Updater Service ```bash parity-updater parity-hash-fetch ``` -* Parity Core Libraries (Parity Util) +* Open Ethereum Core Libraries (`util`) ```bash ethcore-bloom-journal blooms-db dir eip-712 fake-fetch fastmap fetch ethcore-io journaldb keccak-hasher len-caching-lock memory-cache memzero migration-rocksdb ethcore-network ethcore-network-devp2p panic_hook - patricia-trie-ethereum registrar rlp_compress parity-runtime stats + patricia-trie-ethereum registrar rlp_compress stats time-utils triehash-ethereum unexpected parity-version ```

-### Contributing to documentation for Parity Ethereum packages +### Contributing to documentation for Open Ethereum packages -[Document source code](https://doc.rust-lang.org/1.9.0/book/documentation.html) for Parity Ethereum packages by annotating the source code with documentation comments. +[Document source code](https://doc.rust-lang.org/1.9.0/book/documentation.html) for Open Ethereum packages by annotating the source code with documentation comments. Example (generic documentation comment): ```markdown @@ -331,28 +318,22 @@ Example (generic documentation comment): ## 6. Toolchain -In addition to the Parity Ethereum client, there are additional tools in this repository available: +In addition to the Open Ethereum client, there are additional tools in this repository available: -- [evmbin](./evmbin) - Parity Ethereum EVM Implementation. -- [ethstore](./accounts/ethstore) - Parity Ethereum Key Management. -- [ethkey](./accounts/ethkey) - Parity Ethereum Keys Generator. +- [evmbin](./evmbin) - Open Ethereum EVM Implementation. +- [ethstore](./accounts/ethstore) - Open Ethereum Key Management. +- [ethkey](./accounts/ethkey) - Open Ethereum Keys Generator. The following tool is available in a separate repository: -- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum Encoding of Function Calls. [Docs here](https://crates.io/crates/ethabi) -- [whisper](https://github.com/paritytech/whisper) - Parity Ethereum Whisper-v2 PoC Implementation. +- [ethabi](https://github.com/OpenEthereum/ethabi) - Open Ethereum Encoding of Function Calls. [Docs here](https://crates.io/crates/ethabi) +- [whisper](https://github.com/OpenEthereum/whisper) - Open Ethereum Whisper-v2 PoC Implementation. ## 7. Community ### 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) +Questions? Get in touch with us on Discord: +[![Discord: Open Ethereum](https://img.shields.io/discord/669192218728202270.svg?logo=discord)](https://discord.gg/FJUgGe) ## 8. Contributing diff --git a/accounts/Cargo.toml b/accounts/Cargo.toml index ea303c8a272..3317aeb5a9a 100644 --- a/accounts/Cargo.toml +++ b/accounts/Cargo.toml @@ -1,6 +1,5 @@ [package] -description = "Parity Ethereum Account Management" -homepage = "http://parity.io" +description = "Open Ethereum Account Management" license = "GPL-3.0" name = "ethcore-accounts" version = "0.1.0" diff --git a/accounts/ethkey/Cargo.toml b/accounts/ethkey/Cargo.toml index 9bf8afc449c..8bd71091485 100644 --- a/accounts/ethkey/Cargo.toml +++ b/accounts/ethkey/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum Keys Generator" +description = "Open Ethereum Keys Generator" name = "ethkey" version = "0.4.0" authors = ["Parity Technologies "] diff --git a/accounts/ethkey/README.md b/accounts/ethkey/README.md index 3b487a086c8..fb34045df9e 100644 --- a/accounts/ethkey/README.md +++ b/accounts/ethkey/README.md @@ -1,11 +1,11 @@ ## ethkey-cli -Parity Ethereum keys generator. +Open Ethereum keys generator. ### Usage ``` -Parity Ethereum Keys Generator. +Open Ethereum Keys Generator. Copyright 2015-2020 Parity Technologies (UK) Ltd. Usage: @@ -211,11 +211,11 @@ public: 4e19a5fdae82596e1485c69b687c9cc52b5078e5b0668ef3ce8543cd90e712cb00df822 address: 00cf3711cbd3a1512570639280758118ba0b2bcb ``` -## Parity Ethereum toolchain -_This project is a part of the Parity Ethereum toolchain._ +## Open Ethereum toolchain +_This project is a part of the Open Ethereum toolchain._ -- [evmbin](https://github.com/OpenEthereum/open-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum. -- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding. -- [ethstore](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management. -- [ethkey](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator. -- [whisper](https://github.com/paritytech/whisper) - Implementation of Whisper-v2 PoC. +- [evmbin](https://github.com/OpenEthereum/open-ethereum/blob/master/evmbin/) - EVM implementation for Open Ethereum. +- [ethabi](https://github.com/OpenEthereum/ethabi) - Open Ethereum function calls encoding. +- [ethstore](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethstore) - Open Ethereum key management. +- [ethkey](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethkey) - Open Ethereum keys generator. +- [whisper](https://github.com/OpenEthereum/whisper) - Implementation of Whisper-v2 PoC. diff --git a/accounts/ethkey/cli/Cargo.toml b/accounts/ethkey/cli/Cargo.toml index ca7f1e725b6..0cd5a48778a 100644 --- a/accounts/ethkey/cli/Cargo.toml +++ b/accounts/ethkey/cli/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum Keys Generator CLI" +description = "Open Ethereum Keys Generator CLI" name = "ethkey-cli" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/accounts/ethkey/cli/src/main.rs b/accounts/ethkey/cli/src/main.rs index 98b968359f5..19789f511ae 100644 --- a/accounts/ethkey/cli/src/main.rs +++ b/accounts/ethkey/cli/src/main.rs @@ -36,7 +36,7 @@ use parity_crypto::publickey::{KeyPair, Random, Error as EthkeyError, Generator, use rustc_hex::{FromHex, FromHexError}; const USAGE: &'static str = r#" -Parity Ethereum keys generator. +Open Ethereum keys generator. Copyright 2015-2020 Parity Technologies (UK) Ltd. Usage: diff --git a/accounts/ethstore/Cargo.toml b/accounts/ethstore/Cargo.toml index 9ebdaabca5b..fca16170303 100644 --- a/accounts/ethstore/Cargo.toml +++ b/accounts/ethstore/Cargo.toml @@ -1,8 +1,9 @@ [package] -description = "Parity Ethereum Key Management" +description = "Open Ethereum Key Management" name = "ethstore" version = "0.2.1" authors = ["Parity Technologies "] +repository = "https://github.com/OpenEthereum/open-ethereum" [dependencies] log = "0.4" diff --git a/accounts/ethstore/README.md b/accounts/ethstore/README.md index c0764fcadf5..fa62cb117f6 100644 --- a/accounts/ethstore/README.md +++ b/accounts/ethstore/README.md @@ -1,11 +1,11 @@ ## ethstore-cli -Parity Ethereum key management. +Open Ethereum key management. ### Usage ``` -Parity Ethereum key management tool. +Open Ethereum key management tool. Copyright 2015-2020 Parity Technologies (UK) Ltd. Usage: @@ -330,11 +330,11 @@ ethstore move-from-vault 00e63fdb87ceb815ec96ae185b8f7381a0b4a5ea vault1 vault1_ OK ``` -## Parity Ethereum toolchain -_This project is a part of the Parity Ethereum toolchain._ +## Open Ethereum toolchain +_This project is a part of the Open Ethereum toolchain._ -- [evmbin](https://github.com/OpenEthereum/open-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum. -- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding. -- [ethstore](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management. -- [ethkey](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator. -- [whisper](https://github.com/paritytech/whisper) - Implementation of Whisper-v2 PoC. +- [evmbin](https://github.com/OpenEthereum/open-ethereum/blob/master/evmbin/) - EVM implementation for Open Ethereum. +- [ethabi](https://github.com/OpenEthereum/ethabi) - Open Ethereum function calls encoding. +- [ethstore](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethstore) - Open Ethereum key management. +- [ethkey](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethkey) - Open Ethereum keys generator. +- [whisper](https://github.com/OpenEthereum/whisper) - Implementation of Whisper-v2 PoC. diff --git a/accounts/ethstore/cli/Cargo.toml b/accounts/ethstore/cli/Cargo.toml index 4d48900c3e2..4bc70ce16a2 100644 --- a/accounts/ethstore/cli/Cargo.toml +++ b/accounts/ethstore/cli/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum Key Management CLI" +description = "Open Ethereum Key Management CLI" name = "ethstore-cli" version = "0.1.1" authors = ["Parity Technologies "] diff --git a/accounts/ethstore/cli/src/main.rs b/accounts/ethstore/cli/src/main.rs index ee20fee5430..0df6a0a7fcc 100644 --- a/accounts/ethstore/cli/src/main.rs +++ b/accounts/ethstore/cli/src/main.rs @@ -43,7 +43,7 @@ use ethstore::{EthStore, SimpleSecretStore, SecretStore, import_accounts, Presal mod crack; pub const USAGE: &'static str = r#" -Parity Ethereum key management tool. +Open Ethereum key management tool. Copyright 2015-2020 Parity Technologies (UK) Ltd. Usage: diff --git a/chainspec/Cargo.toml b/chainspec/Cargo.toml index c0308edd320..dbcfdfa23db 100644 --- a/chainspec/Cargo.toml +++ b/chainspec/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum Chain Specification" +description = "Open Ethereum Chain Specification" name = "chainspec" version = "0.1.0" authors = ["Marek Kotewicz "] diff --git a/cli-signer/Cargo.toml b/cli-signer/Cargo.toml index 3fc0b332987..607f20042f9 100644 --- a/cli-signer/Cargo.toml +++ b/cli-signer/Cargo.toml @@ -1,6 +1,6 @@ [package] -description = "Parity Ethereum CLI Signer Tool" -homepage = "http://parity.io" +description = "Open Ethereum CLI Signer Tool" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "cli-signer" version = "1.4.0" diff --git a/cli-signer/rpc-client/Cargo.toml b/cli-signer/rpc-client/Cargo.toml index de47e256798..d9777f15af5 100644 --- a/cli-signer/rpc-client/Cargo.toml +++ b/cli-signer/rpc-client/Cargo.toml @@ -1,6 +1,6 @@ [package] -description = "Parity Ethereum RPC Client" -homepage = "http://parity.io" +description = "Open Ethereum RPC Client" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "parity-rpc-client" version = "1.4.0" diff --git a/ethash/Cargo.toml b/ethash/Cargo.toml index abf932f2dd2..b436e7c7fb1 100644 --- a/ethash/Cargo.toml +++ b/ethash/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum Ethash & ProgPoW Implementations" +description = "Open Ethereum Ethash & ProgPoW Implementations" name = "ethash" version = "1.12.0" authors = ["Parity Technologies "] diff --git a/ethash/src/compute.rs b/ethash/src/compute.rs index 7d72fd5e940..67ef0e589a2 100644 --- a/ethash/src/compute.rs +++ b/ethash/src/compute.rs @@ -264,7 +264,7 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) unsafe { make_const_array!(MIX_WORDS / 4, &mut buf.compress_bytes) }; #[cfg(target_endian = "big")] { - compile_error!("parity-ethereum currently only supports little-endian targets"); + compile_error!("open-ethereum currently only supports little-endian targets"); } // Compress mix diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index 9767a75cc27..c6d09a6ba9c 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -1,6 +1,6 @@ [package] -description = "Parity Ethereum (EthCore) Library" -homepage = "http://parity.io" +description = "Open Ethereum (EthCore) Library" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "ethcore" version = "1.12.0" diff --git a/ethcore/blockchain/Cargo.toml b/ethcore/blockchain/Cargo.toml index 9531d3664d4..b7f2357b49f 100644 --- a/ethcore/blockchain/Cargo.toml +++ b/ethcore/blockchain/Cargo.toml @@ -1,6 +1,6 @@ [package] -description = "Parity Ethereum Blockchain Database, Test Generator, Configuration, Caching, Importing Blocks, and Block Information" -homepage = "http://parity.io" +description = "Open Ethereum Blockchain Database, Test Generator, Configuration, Caching, Importing Blocks, and Block Information" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "ethcore-blockchain" version = "0.1.0" diff --git a/ethcore/call-contract/Cargo.toml b/ethcore/call-contract/Cargo.toml index 03bd32475e4..397a44ed03e 100644 --- a/ethcore/call-contract/Cargo.toml +++ b/ethcore/call-contract/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum (EthCore) Contract Calls and Blockchain Service & Registry Information" +description = "Open Ethereum (EthCore) Contract Calls and Blockchain Service & Registry Information" name = "ethcore-call-contract" version = "0.1.0" license = "GPL-3.0" diff --git a/ethcore/db/Cargo.toml b/ethcore/db/Cargo.toml index 47d71f859a3..9edf70c0412 100644 --- a/ethcore/db/Cargo.toml +++ b/ethcore/db/Cargo.toml @@ -1,6 +1,6 @@ [package] description = "Ethcore DB access utilities" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "ethcore-db" version = "0.1.0" diff --git a/ethcore/db/src/lib.rs b/ethcore/db/src/lib.rs index 84d52df0398..ea7045a1412 100644 --- a/ethcore/db/src/lib.rs +++ b/ethcore/db/src/lib.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Open Ethereum. If not, see . -//! Parity Ethereum database access utilities. +//! Open Ethereum database access utilities. #![warn(missing_docs)] diff --git a/ethcore/evm/Cargo.toml b/ethcore/evm/Cargo.toml index f4f8f2665b5..71fc08a02be 100644 --- a/ethcore/evm/Cargo.toml +++ b/ethcore/evm/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum Virtual Machine (EVM) Rust Implementation" +description = "Open Ethereum Virtual Machine (EVM) Rust Implementation" name = "evm" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/ethcore/light/Cargo.toml b/ethcore/light/Cargo.toml index 41efd17c4c7..3d93e53c9e1 100644 --- a/ethcore/light/Cargo.toml +++ b/ethcore/light/Cargo.toml @@ -1,6 +1,6 @@ [package] -description = "Parity Ethereum (EthCore) Light Client Implementation (Block Import IO Service, Blockchain Data Fetching, Light Client Header Chain Storage, Parity Light Protocol (PLP) Provider, Light Transaction Queue, CHT Definitions, Light Client Data Cache), Parity Light Protocol (PLP) Implementation, P2P Network I/O and Event Context Generalization, Peer Error Handling & Punishment, Request Load Timer & Distribution Manager, Pending Request Set Storage, Request Credit Management, Light Client Request Types, Request Chain Builder Utility, On-demand Chain Request Service over LES (for RPCs), ResponseGuard Implementation)" -homepage = "http://parity.io" +description = "Open Ethereum (EthCore) Light Client Implementation (Block Import IO Service, Blockchain Data Fetching, Light Client Header Chain Storage, Parity Light Protocol (PLP) Provider, Light Transaction Queue, CHT Definitions, Light Client Data Cache), Parity Light Protocol (PLP) Implementation, P2P Network I/O and Event Context Generalization, Peer Error Handling & Punishment, Request Load Timer & Distribution Manager, Pending Request Set Storage, Request Credit Management, Light Client Request Types, Request Chain Builder Utility, On-demand Chain Request Service over LES (for RPCs), ResponseGuard Implementation)" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "ethcore-light" version = "1.12.0" diff --git a/ethcore/node-filter/Cargo.toml b/ethcore/node-filter/Cargo.toml index c46b5e3996b..8a0cc7a2e2c 100644 --- a/ethcore/node-filter/Cargo.toml +++ b/ethcore/node-filter/Cargo.toml @@ -1,6 +1,6 @@ [package] description = "Parity Smart Contract based Node Filter, Manage Permissions of Network Connections" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "node-filter" version = "1.12.0" diff --git a/ethcore/service/Cargo.toml b/ethcore/service/Cargo.toml index 0dcedc972b9..d9b158682fc 100644 --- a/ethcore/service/Cargo.toml +++ b/ethcore/service/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum (EthCore) Client & Network Service Creation & Registration with the I/O Subsystem" +description = "Open Ethereum (EthCore) Client & Network Service Creation & Registration with the I/O Subsystem" name = "ethcore-service" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/ethcore/spec/src/chain.rs b/ethcore/spec/src/chain.rs index 355c1697445..d2e95efae80 100644 --- a/ethcore/spec/src/chain.rs +++ b/ethcore/spec/src/chain.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Open Ethereum. If not, see . -//! Load chain specifications for all chains supported by the parity-ethereum client. +//! Load chain specifications for all chains supported by the open-ethereum client. macro_rules! bundle_release_spec { ($($path: expr => $name: ident), *) => { diff --git a/ethcore/sync/Cargo.toml b/ethcore/sync/Cargo.toml index 58898303c60..ae970bf98a0 100644 --- a/ethcore/sync/Cargo.toml +++ b/ethcore/sync/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum (EthCore) Blockchain Synchronization (Strategy, Blockchain Downloader, Blockchain Synchronization Implementation of Ethereum Protocol, Propagating Data to Peers, Requesting Data from Peers, Supplying Data in Response to Peer Requests, Handling Peer Responses, Matching Packet IDs and Protocol, Light Client Synchronization of Header Chain, Header Download State Machine, Light Decoding & Verifying Header Responses, Private Transaction Handling, Synchronization Snapshot Service to Download & Verify Block Chunks, Peer Connection Management and Blockchain Client I/O Interface for Synchronization Handler, Transaction Statistics)" +description = "Open Ethereum (EthCore) Blockchain Synchronization (Strategy, Blockchain Downloader, Blockchain Synchronization Implementation of Ethereum Protocol, Propagating Data to Peers, Requesting Data from Peers, Supplying Data in Response to Peer Requests, Handling Peer Responses, Matching Packet IDs and Protocol, Light Client Synchronization of Header Chain, Header Download State Machine, Light Decoding & Verifying Header Responses, Private Transaction Handling, Synchronization Snapshot Service to Download & Verify Block Chunks, Peer Connection Management and Blockchain Client I/O Interface for Synchronization Handler, Transaction Statistics)" name = "ethcore-sync" version = "1.12.0" license = "GPL-3.0" diff --git a/ethcore/sync/src/chain/propagator.rs b/ethcore/sync/src/chain/propagator.rs index 943a21dfa40..9775d3c40a3 100644 --- a/ethcore/sync/src/chain/propagator.rs +++ b/ethcore/sync/src/chain/propagator.rs @@ -600,7 +600,7 @@ mod tests { io.peers_info.insert(2, "Parity-Ethereum/v2.6.0/linux/rustc".to_owned()); // and peer#3 is Parity, accepting service transactions insert_dummy_peer(&mut sync, 3, block_hash); - io.peers_info.insert(3, "Parity-Ethereum/ABCDEFGH/v2.7.3/linux/rustc".to_owned()); + io.peers_info.insert(3, "Open-Ethereum/ABCDEFGH/v2.7.3/linux/rustc".to_owned()); // and new service transaction is propagated to peers SyncPropagator::propagate_new_transactions(&mut sync, &mut io, || true); @@ -624,7 +624,7 @@ mod tests { // when peer#1 is Parity, accepting service transactions insert_dummy_peer(&mut sync, 1, block_hash); - io.peers_info.insert(1, "Parity-Ethereum/v2.6.0/linux/rustc".to_owned()); + io.peers_info.insert(1, "Open-Ethereum/v2.6.0/linux/rustc".to_owned()); // and service + non-service transactions are propagated to peers SyncPropagator::propagate_new_transactions(&mut sync, &mut io, || true); diff --git a/ethcore/trace/src/types/trace.rs b/ethcore/trace/src/types/trace.rs index f75a0d84fb9..f62e10f9c1e 100644 --- a/ethcore/trace/src/types/trace.rs +++ b/ethcore/trace/src/types/trace.rs @@ -147,7 +147,7 @@ pub struct Call { /// This is essentially an `Option`, but with a custom /// `rlp` en/de-coding which preserves backwards compatibility with -/// the older encodings used in parity-ethereum versions < 2.7 and 2.7.0. +/// the older encodings used in open-ethereum versions < 2.7 and 2.7.0. #[derive(Debug, Clone, Copy, PartialEq)] pub struct BackwardsCompatibleCallType(pub Option); diff --git a/ethcore/types/Cargo.toml b/ethcore/types/Cargo.toml index 5916d80ea3d..7006323ed07 100644 --- a/ethcore/types/Cargo.toml +++ b/ethcore/types/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum Common Types" +description = "Open Ethereum Common Types" name = "common-types" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/ethcore/types/src/errors/mod.rs b/ethcore/types/src/errors/mod.rs index 821af0f73f6..abf172631ab 100644 --- a/ethcore/types/src/errors/mod.rs +++ b/ethcore/types/src/errors/mod.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Open Ethereum. If not, see . -//! General error types for use in parity-ethereum. +//! General error types for use in open-ethereum. mod block_error; mod engine_error; diff --git a/ethcore/types/src/lib.rs b/ethcore/types/src/lib.rs index 7f25fdb3806..c6ad572ee58 100644 --- a/ethcore/types/src/lib.rs +++ b/ethcore/types/src/lib.rs @@ -25,7 +25,7 @@ //! structures from that crate. //! //! NOTE If you can specify your data type in the same crate as your trait, please do that. -//! Don't treat this crate as a bag for any types that we use in Parity Ethereum. +//! Don't treat this crate as a bag for any types that we use in Open Ethereum. //! This one is reserved for types that are shared heavily (like transactions), //! historically this contains types extracted from `ethcore` crate, if possible //! we should try to dissolve that crate in favour of more fine-grained crates, diff --git a/evmbin/README.md b/evmbin/README.md index 29886292432..1c17b4c88b5 100644 --- a/evmbin/README.md +++ b/evmbin/README.md @@ -45,10 +45,10 @@ Display result state dump in standardized JSON format. -h, --help Display this message and exit. ``` -## Parity Ethereum toolchain -_This project is a part of the Parity Ethereum toolchain._ +## Open Ethereum toolchain +_This project is a part of the Open Ethereum toolchain._ -- [evmbin](https://github.com/OpenEthereum/open-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum. -- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding. -- [ethstore](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management. -- [ethkey](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator. +- [evmbin](https://github.com/OpenEthereum/open-ethereum/blob/master/evmbin/) - EVM implementation for Open Ethereum +- [ethabi](https://github.com/paritytech/ethabi) - Open Ethereum function calls encoding. +- [ethstore](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethstore) - Open Ethereum key management. +- [ethkey](https://github.com/OpenEthereum/open-ethereum/blob/master/accounts/ethkey) - Open Ethereum keys generator. diff --git a/evmbin/src/main.rs b/evmbin/src/main.rs index cbf8af69491..20dbef6e61b 100644 --- a/evmbin/src/main.rs +++ b/evmbin/src/main.rs @@ -19,12 +19,12 @@ //! ## Overview //! //! The Parity EVM interpreter binary is a tool in the Parity -//! Ethereum toolchain. It is an EVM implementation for Parity Ethereum that +//! Ethereum toolchain. It is an EVM implementation for Open Ethereum that //! is used to run a standalone version of the EVM interpreter. //! //! ## Usage //! -//! The evmbin tool is not distributed with regular Parity Ethereum releases +//! The evmbin tool is not distributed with regular Open Ethereum releases //! so you need to build it from source and run it like so: //! //! ```bash diff --git a/json/Cargo.toml b/json/Cargo.toml index 0975632890c..5ab9ae4a8e7 100644 --- a/json/Cargo.toml +++ b/json/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum JSON Deserialization" +description = "Open Ethereum JSON Deserialization" name = "ethjson" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/miner/Cargo.toml b/miner/Cargo.toml index 91edeb1d712..3eb68b81e80 100644 --- a/miner/Cargo.toml +++ b/miner/Cargo.toml @@ -1,7 +1,7 @@ [package] -description = "Parity Ethereum Miner Interface." +description = "Open Ethereum Miner Interface." name = "ethcore-miner" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" version = "1.12.0" authors = ["Parity Technologies "] diff --git a/miner/price-info/Cargo.toml b/miner/price-info/Cargo.toml index fa3cd8aeec6..df5400716c9 100644 --- a/miner/price-info/Cargo.toml +++ b/miner/price-info/Cargo.toml @@ -1,6 +1,6 @@ [package] description = "Fetch current ETH price" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "price-info" version = "1.12.0" diff --git a/miner/stratum/src/lib.rs b/miner/stratum/src/lib.rs index 6c6067e564e..bfedecbec4f 100644 --- a/miner/stratum/src/lib.rs +++ b/miner/stratum/src/lib.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Open Ethereum. If not, see . -//! Stratum protocol implementation for parity ethereum/bitcoin clients +//! Stratum protocol implementation for Open Ethereum/bitcoin clients extern crate jsonrpc_tcp_server; extern crate jsonrpc_core; diff --git a/parity/account_utils.rs b/parity/account_utils.rs index 9f846bdd16f..e122ee98bbc 100644 --- a/parity/account_utils.rs +++ b/parity/account_utils.rs @@ -36,7 +36,7 @@ mod accounts { } pub fn prepare_account_provider(_spec: &SpecType, _dirs: &Directories, _data_dir: &str, _cfg: AccountsConfig, _passwords: &[Password]) -> Result { - warn!("Note: Your instance of Parity Ethereum is running without account support. Some CLI options are ignored."); + warn!("Note: Your instance of Open Ethereum is running without account support. Some CLI options are ignored."); Ok(AccountProvider) } diff --git a/parity/cli/usage_header.txt b/parity/cli/usage_header.txt index 77c64a702c2..92775d63b10 100644 --- a/parity/cli/usage_header.txt +++ b/parity/cli/usage_header.txt @@ -1,4 +1,4 @@ -Parity Ethereum Client. +Open Ethereum Client. By Wood/Paronyan/Kotewicz/Drwięga/Volf/Greeff Habermeier/Czaban/Gotchac/Redman/Nikolsky Schoedon/Tang/Adolfsson/Silva/Palm/Hirsz et al. diff --git a/parity/cli/version.txt b/parity/cli/version.txt index 8c4dffbe729..d68843e9489 100644 --- a/parity/cli/version.txt +++ b/parity/cli/version.txt @@ -1,4 +1,4 @@ -Parity Ethereum Client. +Open Ethereum Client. version {} Copyright 2015-2020 Parity Technologies (UK) Ltd. License GPLv3+: GNU GPL version 3 or later . diff --git a/parity/configuration.rs b/parity/configuration.rs index d139bf550b1..4fb797478a8 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -104,7 +104,7 @@ impl Configuration { /// # Example /// /// ``` - /// let _cfg = parity_ethereum::Configuration::parse_cli(&["--light", "--chain", "kovan"]).unwrap(); + /// let _cfg = open_ethereum::Configuration::parse_cli(&["--light", "--chain", "kovan"]).unwrap(); /// ``` pub fn parse_cli>(command: &[S]) -> Result { let config = Configuration { @@ -762,7 +762,7 @@ impl Configuration { ret.client_version = { let mut client_version = version(); if !self.args.arg_identity.is_empty() { - // Insert name after the "Parity-Ethereum/" at the beginning of version string. + // Insert name after the "Open-Ethereum/" at the beginning of version string. let idx = client_version.find('/').unwrap_or(client_version.len()); client_version.insert_str(idx, &format!("/{}", self.args.arg_identity)); } @@ -1748,7 +1748,7 @@ mod tests { match conf.into_command().unwrap().cmd { Cmd::Run(c) => { assert_eq!(c.name, "Somebody"); - assert!(c.net_conf.client_version.starts_with("Parity-Ethereum/Somebody/")); + assert!(c.net_conf.client_version.starts_with("Open-Ethereum/Somebody/")); } _ => panic!("Should be Cmd::Run"), } diff --git a/parity/logger/Cargo.toml b/parity/logger/Cargo.toml index 2bc163e4541..6b5713dfa2a 100644 --- a/parity/logger/Cargo.toml +++ b/parity/logger/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum Logger Implementation" +description = "Open Ethereum Logger Implementation" name = "ethcore-logger" version = "1.12.0" license = "GPL-3.0" diff --git a/parity/main.rs b/parity/main.rs index 7ffc9ff193a..9884a94829f 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -24,7 +24,7 @@ extern crate fdlimit; #[macro_use] extern crate log; extern crate panic_hook; -extern crate parity_ethereum; +extern crate open_ethereum; extern crate parking_lot; extern crate parity_daemonize; extern crate ansi_term; @@ -45,7 +45,7 @@ use ctrlc::CtrlC; use dir::default_hypervisor_path; use fdlimit::raise_fd_limit; use ethcore_logger::setup_log; -use parity_ethereum::{start, ExecutionAction}; +use open_ethereum::{start, ExecutionAction}; use parity_daemonize::AsHandle; use parking_lot::{Condvar, Mutex}; @@ -187,7 +187,7 @@ fn main_direct(force_can_restart: bool) -> i32 { let mut conf = { let args = std::env::args().collect::>(); - parity_ethereum::Configuration::parse_cli(&args).unwrap_or_else(|e| e.exit()) + open_ethereum::Configuration::parse_cli(&args).unwrap_or_else(|e| e.exit()) }; let logger = setup_log(&conf.logger_config()).unwrap_or_else(|e| { diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 3aeb5fa6878..1f55126deb6 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "Parity Ethereum JSON-RPC Servers (WS, HTTP, IPC)" +description = "Open Ethereum JSON-RPC Servers (WS, HTTP, IPC)" name = "parity-rpc" version = "1.12.0" license = "GPL-3.0" diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 0eb4b2ca3ac..1dfe69b08ba 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Open Ethereum. If not, see . -//! Parity Ethereum JSON-RPC Servers (WS, HTTP, IPC). +//! Open Ethereum JSON-RPC Servers (WS, HTTP, IPC). #![warn(missing_docs, unused_extern_crates)] #![cfg_attr(feature = "cargo-clippy", warn(clippy::all, clippy::pedantic))] diff --git a/rpc/src/v1/helpers/errors.rs b/rpc/src/v1/helpers/errors.rs index 4d8ce958355..a6cbe0e9005 100644 --- a/rpc/src/v1/helpers/errors.rs +++ b/rpc/src/v1/helpers/errors.rs @@ -347,14 +347,6 @@ pub fn encryption(error: T) -> Error { } } -pub fn encoding(error: T) -> Error { - Error { - code: ErrorCode::ServerError(codes::ENCODING_ERROR), - message: "Encoding error.".into(), - data: Some(Value::String(format!("{:?}", error))), - } -} - pub fn database(error: T) -> Error { Error { code: ErrorCode::ServerError(codes::DATABASE_ERROR), diff --git a/rpc/src/v1/tests/helpers/sync_provider.rs b/rpc/src/v1/tests/helpers/sync_provider.rs index 8578f653a97..3e6fb97703e 100644 --- a/rpc/src/v1/tests/helpers/sync_provider.rs +++ b/rpc/src/v1/tests/helpers/sync_provider.rs @@ -94,7 +94,7 @@ impl SyncProvider for TestSyncProvider { }, PeerInfo { id: None, - client_version: ClientVersion::from("Parity-Ethereum/2/v2.4.0/linux/rustc"), + client_version: ClientVersion::from("Open-Ethereum/2/v2.7.0/linux/rustc"), capabilities: vec!["eth/64".to_owned(), "eth/65".to_owned()], remote_address: "Handshake".to_owned(), local_address: "127.0.0.1:3333".to_owned(), diff --git a/rpc/src/v1/tests/mocked/parity.rs b/rpc/src/v1/tests/mocked/parity.rs index b20bd042cc7..b539e711227 100644 --- a/rpc/src/v1/tests/mocked/parity.rs +++ b/rpc/src/v1/tests/mocked/parity.rs @@ -255,7 +255,76 @@ fn rpc_parity_net_peers() { let io = deps.default_client(); let request = r#"{"jsonrpc": "2.0", "method": "parity_netPeers", "params":[], "id": 1}"#; - let response = r#"{"jsonrpc":"2.0","result":{"active":0,"connected":120,"max":50,"peers":[{"caps":["eth/63","eth/64"],"id":"node1","name":{"ParityClient":{"can_handle_large_requests":true,"compiler":"rustc","identity":"1","name":"Parity-Ethereum","os":"linux","semver":"2.4.0"}},"network":{"localAddress":"127.0.0.1:8888","remoteAddress":"127.0.0.1:7777"},"protocols":{"eth":{"difficulty":"0x28","head":"0000000000000000000000000000000000000000000000000000000000000032","version":63},"pip":null}},{"caps":["eth/64","eth/65"],"id":null,"name":{"ParityClient":{"can_handle_large_requests":true,"compiler":"rustc","identity":"2","name":"Parity-Ethereum","os":"linux","semver":"2.4.0"}},"network":{"localAddress":"127.0.0.1:3333","remoteAddress":"Handshake"},"protocols":{"eth":{"difficulty":null,"head":"000000000000000000000000000000000000000000000000000000000000003c","version":65},"pip":null}}]},"id":1}"#; + let response = r#" + { + "jsonrpc": "2.0", + "result": { + "active": 0, + "connected": 120, + "max": 50, + "peers": [ + { + "caps": [ + "eth/63", + "eth/64" + ], + "id": "node1", + "name": { + "ParityClient": { + "can_handle_large_requests": true, + "compiler": "rustc", + "identity": "1", + "name": "Parity-Ethereum", + "os": "linux", + "semver": "2.4.0" + } + }, + "network": { + "localAddress": "127.0.0.1:8888", + "remoteAddress": "127.0.0.1:7777" + }, + "protocols": { + "eth": { + "difficulty": "0x28", + "head": "0000000000000000000000000000000000000000000000000000000000000032", + "version": 63 + }, + "pip": null + } + }, + { + "caps": [ + "eth/64", + "eth/65" + ], + "id": null, + "name": { + "ParityClient": { + "can_handle_large_requests": true, + "compiler": "rustc", + "identity": "2", + "name": "Open-Ethereum", + "os": "linux", + "semver": "2.7.0" + } + }, + "network": { + "localAddress": "127.0.0.1:3333", + "remoteAddress": "Handshake" + }, + "protocols": { + "eth": { + "difficulty": null, + "head": "000000000000000000000000000000000000000000000000000000000000003c", + "version": 65 + }, + "pip": null + } + } + ] + }, + "id": 1 + }"#.replace(char::is_whitespace, ""); assert_eq!(io.handle_request_sync(request), Some(response.to_owned())); } diff --git a/scripts/docker/README.md b/scripts/docker/README.md index 2156c3d2ece..a4916deab90 100644 --- a/scripts/docker/README.md +++ b/scripts/docker/README.md @@ -7,7 +7,7 @@ Builds a lightweight non-root Parity docker image: ``` git clone https://github.com/OpenEthereum/open-ethereum.git -cd parity-ethereum +cd open-ethereum ./scripts/docker/centos/build.sh ``` diff --git a/scripts/docker/centos/Dockerfile.build b/scripts/docker/centos/Dockerfile.build index 454af403a03..6fbcbafc2e8 100644 --- a/scripts/docker/centos/Dockerfile.build +++ b/scripts/docker/centos/Dockerfile.build @@ -2,7 +2,7 @@ FROM centos:latest WORKDIR /build -ADD . /build/parity-ethereum +ADD . /build/open-ethereum RUN yum -y update && \ yum install -y systemd-devel git make gcc-c++ gcc file binutils && \ @@ -17,9 +17,9 @@ RUN yum -y update && \ gcc -v && \ g++ -v && \ cmake --version && \ - cd parity-ethereum && \ + cd open-ethereum && \ cargo build --verbose --release --features final && \ - strip /build/parity-ethereum/target/release/parity && \ - file /build/parity-ethereum/target/release/parity + strip /build/open-ethereum/target/release/parity && \ + file /build/open-ethereum/target/release/parity diff --git a/scripts/docker/centos/build.sh b/scripts/docker/centos/build.sh index df4796b9137..d251a26dcd3 100755 --- a/scripts/docker/centos/build.sh +++ b/scripts/docker/centos/build.sh @@ -13,7 +13,7 @@ docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_BUILDER_IMAGE_TAG-$(git lo 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 scripts/docker/centos/parity -docker cp extract:/build/parity-ethereum/target/release/parity scripts/docker/centos/parity +docker cp extract:/build/open-ethereum/target/release/parity scripts/docker/centos/parity echo Building $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG docker build --no-cache -t $PARITY_IMAGE_REPO:$PARITY_RUNNER_IMAGE_TAG scripts/docker/centos/ -f scripts/docker/centos/Dockerfile diff --git a/scripts/docker/hub/Dockerfile b/scripts/docker/hub/Dockerfile index 6ef3734b376..eb133441e5d 100644 --- a/scripts/docker/hub/Dockerfile +++ b/scripts/docker/hub/Dockerfile @@ -7,7 +7,7 @@ ARG BUILD_DATE LABEL io.parity.image.authors="devops-team@parity.io" \ io.parity.image.vendor="Parity Technologies" \ io.parity.image.title="parity/parity" \ - io.parity.image.description="Parity Ethereum. The Fastest and most Advanced Ethereum Client." \ + io.parity.image.description="Open Ethereum. The Fastest and most Advanced Ethereum Client." \ io.parity.image.source="https://github.com/OpenEthereum/open-ethereum/blob/${VCS_REF}/\ scripts/docker/hub/Dockerfile" \ io.parity.image.documentation="https://wiki.parity.io/Parity-Ethereum" \ @@ -33,7 +33,7 @@ RUN set -eux; \ WORKDIR /home/parity -# add parity-ethereum binary to docker image +# add open-ethereum binary to docker image COPY artifacts/x86_64-unknown-linux-gnu/parity /bin/parity COPY tools/check_sync.sh /check_sync.sh diff --git a/scripts/docker/hub/publish-docker.sh b/scripts/docker/hub/publish-docker.sh index a341ccc128a..5b7fefa38ad 100755 --- a/scripts/docker/hub/publish-docker.sh +++ b/scripts/docker/hub/publish-docker.sh @@ -4,8 +4,8 @@ set -e # fail on any error VERSION=$(cat ./tools/VERSION) TRACK=$(cat ./tools/TRACK) -echo "Parity Ethereum version = ${VERSION}" -echo "Parity Ethereum track = ${TRACK}" +echo "Open Ethereum version = ${VERSION}" +echo "Open Ethereum track = ${TRACK}" test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity" \ || ( echo "no docker credentials provided"; exit 1 ) diff --git a/scripts/gitlab/build-linux.sh b/scripts/gitlab/build-linux.sh deleted file mode 100755 index 1552d9ec433..00000000000 --- a/scripts/gitlab/build-linux.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -set -e # fail on any error -set -u # treat unset variables as error - -export CC="sccache "$CC -export CXX="sccache "$CXX -echo "__________Show ENVIROMENT__________" -echo "CARGO_TARGET: " $CARGO_TARGET -echo "CC: " $CC -echo "CXX: " $CXX -#strip ON -export RUSTFLAGS+=" -C link-arg=-s" - -echo "_____ Building target: "$CARGO_TARGET" _____" -if [ "${CARGO_TARGET}" = "x86_64-unknown-linux-gnu" ] || [ "${CARGO_TARGET}" = "x86_64-apple-darwin" ] -then - # NOTE: Enables the aes-ni instructions for RustCrypto dependency. - # If you change this please remember to also update .cargo/config - export RUSTFLAGS+=" -C target-feature=+aes,+sse2,+ssse3" -fi -time cargo build --target $CARGO_TARGET --verbose --color=always --release --features final -time cargo build --target $CARGO_TARGET --verbose --color=always --release -p evmbin -time cargo build --target $CARGO_TARGET --verbose --color=always --release -p ethstore-cli -time cargo build --target $CARGO_TARGET --verbose --color=always --release -p ethkey-cli - -echo "_____ Post-processing binaries _____" -rm -rf artifacts/* -mkdir -p artifacts/$CARGO_TARGET -cd artifacts/$CARGO_TARGET - -cp -v ../../target/$CARGO_TARGET/release/parity ./parity -cp -v ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm -cp -v ../../target/$CARGO_TARGET/release/ethstore ./ethstore -cp -v ../../target/$CARGO_TARGET/release/ethkey ./ethkey - -echo "_____ Calculating checksums _____" -for binary in $(ls) -do - rhash --sha256 $binary -o $binary.sha256 #do we still need this hash (SHA2)? - if [[ $CARGO_TARGET == *"x86_64"* ]]; - then - ./parity tools hash $binary > $binary.sha3 - else - echo ">[WARN] ${binary} cannot be hashed with cross-compiled binary (keccak256)" - fi -done -#show sccache statistics -sccache --show-stats diff --git a/scripts/gitlab/build-windows.sh b/scripts/gitlab/build-windows.sh deleted file mode 100755 index 477a8edde7a..00000000000 --- a/scripts/gitlab/build-windows.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/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" -sccache -s - -echo "__________Show ENVIROMENT__________" -echo "CI_SERVER_NAME: " $CI_SERVER_NAME -echo "CARGO_HOME: " $CARGO_HOME -echo "CARGO_TARGET: " $CARGO_TARGET -echo "RUSTC_WRAPPER: " $RUSTC_WRAPPER -echo "SCCACHE_DIR: " $SCCACHE_DIR - -echo "_____ Building target: "$CARGO_TARGET" _____" - # NOTE: Enables the aes-ni instructions for RustCrypto dependency. - # If you change this please remember to also update .cargo/config -export RUSTFLAGS=" -Ctarget-feature=+aes,+sse2,+ssse3 -Ctarget-feature=+crt-static" - -time cargo build --target $CARGO_TARGET --verbose --release --features final -time cargo build --target $CARGO_TARGET --verbose --release -p evmbin -time cargo build --target $CARGO_TARGET --verbose --release -p ethstore-cli -time cargo build --target $CARGO_TARGET --verbose --release -p ethkey-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 - -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 - -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 - -sccache -s diff --git a/scripts/gitlab/publish-onchain.sh b/scripts/gitlab/publish-onchain.sh deleted file mode 100755 index 9c2ac1dbbc1..00000000000 --- a/scripts/gitlab/publish-onchain.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/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" -./tools/safe-curl.sh $DATA "https://update.parity.io/push-release/${SCHEDULE_TAG:-${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" - ../../tools/safe-curl.sh $DATA "https://update.parity.io/push-build/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}/$DIR" - ;; - esac - cd .. -done diff --git a/scripts/gitlab/publish-snap.sh b/scripts/gitlab/publish-snap.sh index f33be15b65c..771b6fca7be 100755 --- a/scripts/gitlab/publish-snap.sh +++ b/scripts/gitlab/publish-snap.sh @@ -8,7 +8,7 @@ TRACK=$(cat ./tools/TRACK) echo "Track is: ${TRACK}" VERSION=$(cat ./tools/VERSION) SNAP_PACKAGE="parity_"$VERSION"_"$BUILD_ARCH".snap" -# Choose snap release channel based on parity ethereum version track +# Choose snap release channel based on Open Ethereum version track case ${TRACK} in nightly) export GRADE="devel" CHANNEL="edge";; stable) export GRADE="stable" CHANNEL="stable";; diff --git a/scripts/gitlab/safe-curl.sh b/scripts/gitlab/safe-curl.sh deleted file mode 100755 index f5bb2ee4ef5..00000000000 --- a/scripts/gitlab/safe-curl.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -DATA=$1 -ADDRESS=$2 - -CODE=$(curl -o out.txt -w '%{http_code}' --data $DATA $ADDRESS) -cat out.txt && rm out.txt -echo "\n" - -if [[ $CODE -eq 200 ]]; then - echo 'Pushed to updater service.'; -elif [[ $CODE -eq 202 ]]; then - echo 'Updater service ignored request.'; -else - echo 'Unable to push info to updater service.'; - exit 2 -fi diff --git a/scripts/gitlab/sign-win.cmd b/scripts/gitlab/sign-win.cmd deleted file mode 100755 index 2b014a0236c..00000000000 --- a/scripts/gitlab/sign-win.cmd +++ /dev/null @@ -1 +0,0 @@ -@signtool sign /f %1 /p %2 /tr http://timestamp.comodoca.com /du https://parity.io %3 diff --git a/scripts/gitlab/test-linux.sh b/scripts/gitlab/test-linux.sh deleted file mode 100755 index 5c52802333b..00000000000 --- a/scripts/gitlab/test-linux.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# ARGUMENT $1 Rust flavor to run test with (stable/beta/nightly) - -echo "________Running test-linux.sh________" -set -e # fail on any error -set -u # treat unset variables as error - -export CC="sccache "$CC -export CXX="sccache "$CXX -FEATURES="json-tests" - -OPTIONS="--release" -#use nproc `linux only -THREADS=$(nproc) - -rustup default $1 -rustup show - -echo "________Running Parity Full Test Suite________" -# Why are we using RUSTFLAGS? See https://github.com/OpenEthereum/open-ethereum/pull/10719 -CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=on -C debuginfo=2 -Ctarget-feature=+aes,+sse2,+ssse3" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=never -- --test-threads $THREADS - -#show sccache statistics -sccache --show-stats diff --git a/scripts/gitlab/validate-chainspecs.sh b/scripts/gitlab/validate-chainspecs.sh deleted file mode 100755 index fd0f73926ca..00000000000 --- a/scripts/gitlab/validate-chainspecs.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -set -e # fail on any error -set -u # treat unset variables as error -echo "________Running validate_chainspecs.sh________" - -ERR=0 - -echo "________Validate chainspecs________" -time cargo build --release -p chainspec --verbose --color=always - -for spec in ethcore/res/*.json; do - if ! ./target/release/chainspec "$spec"; then ERR=1; fi -done - -for spec in ethcore/res/ethereum/*.json; do - if ! ./target/release/chainspec "$spec"; then ERR=1; fi -done - -echo "________Mainnet contains Istanbul EIPs________" -for eip in $(grep --only-matching "eip.*Transition" ethcore/res/ethereum/istanbul_test.json); do - if ! grep -q $eip ethcore/res/ethereum/foundation.json; then - echo "ERROR: $eip is missing in the foundation json spec" - ERR=1 - fi -done - -#show sccache statistics -sccache --show-stats -exit $ERR diff --git a/scripts/parity.service b/scripts/parity.service index 24e14282bc4..5a32cd0f493 100644 --- a/scripts/parity.service +++ b/scripts/parity.service @@ -1,5 +1,5 @@ [Unit] -Description=Parity Ethereum Daemon +Description=Open Ethereum Daemon After=network.target [Service] diff --git a/scripts/snap/parity.desktop b/scripts/snap/parity.desktop index 1833865deab..140ed000368 100644 --- a/scripts/snap/parity.desktop +++ b/scripts/snap/parity.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Encoding=UTF-8 -Name=Parity Ethereum +Name=Open Ethereum Comment=The fastest and most advanced Ethereum client. Exec=parity Icon=/usr/share/pixmaps/icon.png diff --git a/updater/hash-fetch/Cargo.toml b/updater/hash-fetch/Cargo.toml index c3ea793a5f1..ac11fc58ee8 100644 --- a/updater/hash-fetch/Cargo.toml +++ b/updater/hash-fetch/Cargo.toml @@ -1,6 +1,6 @@ [package] description = "Fetching hash-addressed content." -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "parity-hash-fetch" version = "1.12.0" diff --git a/util/fetch/Cargo.toml b/util/fetch/Cargo.toml index 72039a1a4bc..eb9a44071b0 100644 --- a/util/fetch/Cargo.toml +++ b/util/fetch/Cargo.toml @@ -1,6 +1,6 @@ [package] description = "HTTP/HTTPS fetching library" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "fetch" version = "0.1.0" diff --git a/util/io/Cargo.toml b/util/io/Cargo.toml index 8705cb52a29..829b1a61c17 100644 --- a/util/io/Cargo.toml +++ b/util/io/Cargo.toml @@ -2,7 +2,7 @@ name = "ethcore-io" description = "Ethcore IO library" version = "1.12.0" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" authors = ["Parity Technologies "] edition = "2018" diff --git a/util/len-caching-lock/Cargo.toml b/util/len-caching-lock/Cargo.toml index 3e02dc1a299..c799cde107f 100644 --- a/util/len-caching-lock/Cargo.toml +++ b/util/len-caching-lock/Cargo.toml @@ -1,6 +1,6 @@ [package] description = "Atomically cached len(), for use with collections contained in parking_lot Mutex and RwLock" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "len-caching-lock" version = "0.1.1" diff --git a/util/network-devp2p/Cargo.toml b/util/network-devp2p/Cargo.toml index 541dc026578..409918fc403 100644 --- a/util/network-devp2p/Cargo.toml +++ b/util/network-devp2p/Cargo.toml @@ -1,6 +1,6 @@ [package] description = "DevP2P implementation of the ethcore network library" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "ethcore-network-devp2p" version = "1.12.0" diff --git a/util/network-devp2p/src/discovery.rs b/util/network-devp2p/src/discovery.rs index 49b5b6ec9ae..8bf78bf4784 100644 --- a/util/network-devp2p/src/discovery.rs +++ b/util/network-devp2p/src/discovery.rs @@ -584,7 +584,7 @@ impl<'a> Discovery<'a> { None } else { if request.deprecated_echo_hash == echo_hash { - trace!(target: "discovery", "Got Pong from an old parity-ethereum version."); + trace!(target: "discovery", "Got Pong from an old open-ethereum version."); } Some((request.node.clone(), request.reason.clone())) } diff --git a/util/network/Cargo.toml b/util/network/Cargo.toml index 81995fd908c..125601b0740 100644 --- a/util/network/Cargo.toml +++ b/util/network/Cargo.toml @@ -1,6 +1,6 @@ [package] description = "Ethcore network library" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "ethcore-network" version = "1.12.0" diff --git a/util/network/src/client_version.rs b/util/network/src/client_version.rs index 515925d0461..8088e0e6bbb 100644 --- a/util/network/src/client_version.rs +++ b/util/network/src/client_version.rs @@ -22,8 +22,8 @@ use semver::Version; use std::fmt; /// Parity client string prefix -const LEGACY_CLIENT_ID_PREFIX: &str = "Parity"; -const PARITY_CLIENT_ID_PREFIX: &str = "Parity-Ethereum"; +const LEGACY_CLIENT_ID_PREFIX: &str = "Parity-Ethereum"; +const CURRENT_CLIENT_ID_PREFIX: &str = "Open-Ethereum"; lazy_static! { /// Parity versions starting from this will accept block bodies requests @@ -153,7 +153,7 @@ impl ClientCapabilities for ClientVersion { } fn is_parity(client_id: &str) -> bool { - client_id.starts_with(LEGACY_CLIENT_ID_PREFIX) || client_id.starts_with(PARITY_CLIENT_ID_PREFIX) + client_id.starts_with(LEGACY_CLIENT_ID_PREFIX) || client_id.starts_with(CURRENT_CLIENT_ID_PREFIX) } /// Parse known parity formats. Recognizes either a short format with four fields @@ -260,7 +260,7 @@ pub mod tests { fn make_default_version_string() -> String { format!( "{}/v{}/{}/{}", - PARITY_CLIENT_ID_PREFIX, + CURRENT_CLIENT_ID_PREFIX, PARITY_CLIENT_SEMVER, PARITY_CLIENT_OS, PARITY_CLIENT_COMPILER @@ -270,7 +270,7 @@ pub mod tests { fn make_default_long_version_string() -> String { format!( "{}/{}/v{}/{}/{}", - PARITY_CLIENT_ID_PREFIX, + CURRENT_CLIENT_ID_PREFIX, PARITY_CLIENT_IDENTITY, PARITY_CLIENT_SEMVER, PARITY_CLIENT_OS, @@ -281,7 +281,7 @@ pub mod tests { fn make_multitoken_identity_long_version_string() -> String { format!( "{}/{}/v{}/{}/{}", - PARITY_CLIENT_ID_PREFIX, + CURRENT_CLIENT_ID_PREFIX, PARITY_CLIENT_MULTITOKEN_IDENTITY, PARITY_CLIENT_SEMVER, PARITY_CLIENT_OS, @@ -292,7 +292,7 @@ pub mod tests { fn make_old_semver_version_string() -> String { format!( "{}/v{}/{}/{}", - PARITY_CLIENT_ID_PREFIX, + CURRENT_CLIENT_ID_PREFIX, PARITY_CLIENT_OLD_SEMVER, PARITY_CLIENT_OS, PARITY_CLIENT_COMPILER @@ -318,7 +318,7 @@ pub mod tests { let client_version_string = make_default_version_string(); if let ClientVersion::ParityClient(client_version) = ClientVersion::from(client_version_string.as_str()) { - assert_eq!(client_version.name(), PARITY_CLIENT_ID_PREFIX); + assert_eq!(client_version.name(), CURRENT_CLIENT_ID_PREFIX); assert_eq!(*client_version.semver(), Version::parse(PARITY_CLIENT_SEMVER).unwrap()); assert_eq!(client_version.os(), PARITY_CLIENT_OS); assert_eq!(client_version.compiler(), PARITY_CLIENT_COMPILER); @@ -332,7 +332,7 @@ pub mod tests { let client_version_string = make_default_long_version_string(); if let ClientVersion::ParityClient(client_version) = ClientVersion::from(client_version_string.as_str()) { - assert_eq!(client_version.name(), PARITY_CLIENT_ID_PREFIX); + assert_eq!(client_version.name(), CURRENT_CLIENT_ID_PREFIX); assert_eq!(client_version.identity().unwrap(), PARITY_CLIENT_IDENTITY); assert_eq!(*client_version.semver(), Version::parse(PARITY_CLIENT_SEMVER).unwrap()); assert_eq!(client_version.os(), PARITY_CLIENT_OS); @@ -347,7 +347,7 @@ pub mod tests { let client_version_string = make_multitoken_identity_long_version_string(); if let ClientVersion::ParityClient(client_version) = ClientVersion::from(client_version_string.as_str()) { - assert_eq!(client_version.name(), PARITY_CLIENT_ID_PREFIX); + assert_eq!(client_version.name(), CURRENT_CLIENT_ID_PREFIX); assert_eq!(client_version.identity().unwrap(), PARITY_CLIENT_MULTITOKEN_IDENTITY); assert_eq!(*client_version.semver(), Version::parse(PARITY_CLIENT_SEMVER).unwrap()); assert_eq!(client_version.os(), PARITY_CLIENT_OS); @@ -362,7 +362,7 @@ pub mod tests { let client_version_string: String = make_default_version_string(); if let ClientVersion::ParityClient(client_version) = ClientVersion::from(client_version_string.as_str()) { - assert_eq!(client_version.name(), PARITY_CLIENT_ID_PREFIX); + assert_eq!(client_version.name(), CURRENT_CLIENT_ID_PREFIX); assert_eq!(*client_version.semver(), Version::parse(PARITY_CLIENT_SEMVER).unwrap()); assert_eq!(client_version.os(), PARITY_CLIENT_OS); assert_eq!(client_version.compiler(), PARITY_CLIENT_COMPILER); @@ -376,7 +376,7 @@ pub mod tests { // This is invalid because version has no leading 'v' let client_version_string = format!( "{}/{}/{}/{}", - PARITY_CLIENT_ID_PREFIX, + CURRENT_CLIENT_ID_PREFIX, PARITY_CLIENT_SEMVER, PARITY_CLIENT_OS, PARITY_CLIENT_COMPILER); @@ -392,7 +392,7 @@ pub mod tests { pub fn client_version_when_parity_format_without_identity_and_missing_compiler_field_then_equals_parity_unknown_client_version_string() { let client_version_string = format!( "{}/v{}/{}", - PARITY_CLIENT_ID_PREFIX, + CURRENT_CLIENT_ID_PREFIX, PARITY_CLIENT_SEMVER, PARITY_CLIENT_OS, ); @@ -408,7 +408,7 @@ pub mod tests { pub fn client_version_when_parity_format_with_identity_and_missing_compiler_field_then_equals_parity_unknown_client_version_string() { let client_version_string = format!( "{}/{}/v{}/{}", - PARITY_CLIENT_ID_PREFIX, + CURRENT_CLIENT_ID_PREFIX, PARITY_CLIENT_IDENTITY, PARITY_CLIENT_SEMVER, PARITY_CLIENT_OS, @@ -489,12 +489,12 @@ pub mod tests { fn client_version_accepts_service_transaction_for_different_versions() { assert!(!ClientVersion::from("Geth").accepts_service_transaction()); assert!(ClientVersion::from("Parity-Ethereum/v2.6.0/linux/rustc").accepts_service_transaction()); - assert!(ClientVersion::from("Parity-Ethereum/ABCDEFGH/v2.7.3/linux/rustc").accepts_service_transaction()); + assert!(ClientVersion::from("Open-Ethereum/ABCDEFGH/v2.7.3/linux/rustc").accepts_service_transaction()); } #[test] fn is_parity_when_parity_then_true() { - let client_id = format!("{}/", PARITY_CLIENT_ID_PREFIX); + let client_id = format!("{}/", CURRENT_CLIENT_ID_PREFIX); assert!(is_parity(&client_id)); } diff --git a/util/panic-hook/Cargo.toml b/util/panic-hook/Cargo.toml index 83b5920d21f..c9aa7321f9d 100644 --- a/util/panic-hook/Cargo.toml +++ b/util/panic-hook/Cargo.toml @@ -1,6 +1,6 @@ [package] description = "Parity custom panic hook" -homepage = "http://parity.io" +repository = "https://github.com/OpenEthereum/open-ethereum" license = "GPL-3.0" name = "panic_hook" version = "0.1.0" diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index cad11a3d255..925ba1d7fa2 100644 --- a/util/version/Cargo.toml +++ b/util/version/Cargo.toml @@ -2,7 +2,7 @@ # Make sure to update the service if it's moved or the structure is changed. [package] name = "parity-version" -# NOTE: this value is used for Parity Ethereum version string (via env CARGO_PKG_VERSION) +# NOTE: this value is used for Open Ethereum version string (via env CARGO_PKG_VERSION) version = "2.8.0" authors = ["Parity Technologies "] build = "build.rs" diff --git a/util/version/src/lib.rs b/util/version/src/lib.rs index d9fb8e20184..fd2261bf26e 100644 --- a/util/version/src/lib.rs +++ b/util/version/src/lib.rs @@ -45,7 +45,7 @@ pub fn platform() -> String { pub fn version() -> String { let commit_date = format!("{}", env!("VERGEN_COMMIT_DATE")).replace("-", ""); format!( - "Parity-Ethereum/v{}-{}-{}-{}/{}/rustc{}", + "Open-Ethereum/v{}-{}-{}-{}/{}/rustc{}", env!("CARGO_PKG_VERSION"), THIS_TRACK, env!("VERGEN_SHA_SHORT"), @@ -63,7 +63,7 @@ pub fn version_data() -> Bytes { (env!("CARGO_PKG_VERSION_MINOR").parse::().expect("Environment variables are known to be valid; qed") << 8) + env!("CARGO_PKG_VERSION_PATCH").parse::().expect("Environment variables are known to be valid; qed"); s.append(&v); - s.append(&"Parity-Ethereum"); + s.append(&"Open-Ethereum"); s.append(&generated::rustc_version()); s.append(&&Target::os()[0..2]); s.out() From 9e77e7e193c2681119dede0002b8cd55c411111e Mon Sep 17 00:00:00 2001 From: David Date: Mon, 9 Mar 2020 20:04:50 +0100 Subject: [PATCH 03/11] Code cleanup in the sync module (#11552) * Code cleanup `flush_queue()` is mostly used by tests remove some unused params avoid clones in a few places * Consistent params naming Consistent use of log calls * Fix todo It'a actually not trivial to find out the size of these collections, likely we keep blocks from all kinds of forks in the `self.blocks`/`self.parents` collections and there's no good way to anticipate how many blocks we're going to drain. Most of the time we end up draining 0 blocks and then we drain a whole bunch of them, up to 30 000. * Revert making flush_queue() test-only Address review grumbles * More review grumbles * fix build --- ethcore/client-traits/src/lib.rs | 4 +- ethcore/src/client/client.rs | 6 +- ethcore/sync/src/block_sync.rs | 10 +-- ethcore/sync/src/blocks.rs | 137 ++++++++++++++++--------------- 4 files changed, 82 insertions(+), 75 deletions(-) diff --git a/ethcore/client-traits/src/lib.rs b/ethcore/client-traits/src/lib.rs index 79d050ae2c5..ed0ad0dedc4 100644 --- a/ethcore/client-traits/src/lib.rs +++ b/ethcore/client-traits/src/lib.rs @@ -197,8 +197,8 @@ pub trait IoClient: Sync + Send { /// Queue transactions for importing. fn queue_transactions(&self, transactions: Vec, peer_id: usize); - /// Queue block import with transaction receipts. Does no sealing and transaction validation. - fn queue_ancient_block(&self, block_bytes: Unverified, receipts_bytes: Bytes) -> EthcoreResult; + /// Queue block import with transaction receipts. Does no sealing or transaction validation. + fn queue_ancient_block(&self, unverified: Unverified, receipts_bytes: Bytes) -> EthcoreResult; /// Queue consensus engine message. fn queue_consensus_message(&self, message: Bytes); diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index c51a13b09b7..4e6c24c45dc 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -178,7 +178,7 @@ struct Importer { } /// Blockchain database client backed by a persistent database. Owns and manages a blockchain and a block queue. -/// Call `import_block()` to import a block asynchronously; `flush_queue()` flushes the queue. +/// Call `import_block()` to import a block asynchronously. pub struct Client { /// Flag used to disable the client forever. Not to be confused with `liveness`. /// @@ -870,7 +870,7 @@ impl Client { *self.on_user_defaults_change.lock() = Some(Box::new(f)); } - /// Flush the block import queue. + /// Flush the block import queue. Used mostly for tests. pub fn flush_queue(&self) { self.importer.block_queue.flush(); while !self.importer.block_queue.is_empty() { @@ -1444,6 +1444,7 @@ impl ImportBlock for Client { return Err(EthcoreError::Block(BlockError::UnknownParent(unverified.parent_hash()))); } + // If the queue is empty we propagate the block in a `PriorityTask`. let raw = if self.importer.block_queue.is_empty() { Some((unverified.bytes.clone(), *unverified.header.difficulty())) } else { @@ -2729,6 +2730,7 @@ impl ImportExportBlocks for Client { } }; self.flush_queue(); + Ok(()) } } diff --git a/ethcore/sync/src/block_sync.rs b/ethcore/sync/src/block_sync.rs index 81f55aac880..2a65e7ba265 100644 --- a/ethcore/sync/src/block_sync.rs +++ b/ethcore/sync/src/block_sync.rs @@ -407,9 +407,9 @@ impl BlockDownloader { trace_sync!(self, "Error decoding block receipts RLP: {:?}", e); BlockDownloaderImportError::Invalid })?; - receipts.push(receipt.as_raw().to_vec()); + receipts.push(receipt.as_raw()); } - let hashes = self.blocks.insert_receipts(receipts); + let hashes = self.blocks.insert_receipts(&receipts); if hashes.len() != item_count { trace_sync!(self, "Deactivating peer for giving invalid block receipts"); return Err(BlockDownloaderImportError::Invalid); @@ -501,7 +501,7 @@ impl BlockDownloader { MAX_BODIES_TO_REQUEST_SMALL }; - let needed_bodies = self.blocks.needed_bodies(number_of_bodies_to_request, false); + let needed_bodies = self.blocks.needed_bodies(number_of_bodies_to_request); if !needed_bodies.is_empty() { return Some(BlockRequest::Bodies { hashes: needed_bodies, @@ -509,7 +509,7 @@ impl BlockDownloader { } if self.download_receipts { - let needed_receipts = self.blocks.needed_receipts(MAX_RECEPITS_TO_REQUEST, false); + let needed_receipts = self.blocks.needed_receipts(MAX_RECEPITS_TO_REQUEST); if !needed_receipts.is_empty() { return Some(BlockRequest::Receipts { hashes: needed_receipts, @@ -518,7 +518,7 @@ impl BlockDownloader { } // find subchain to download - if let Some((h, count)) = self.blocks.needed_headers(MAX_HEADERS_TO_REQUEST, false) { + if let Some((h, count)) = self.blocks.needed_headers(MAX_HEADERS_TO_REQUEST) { return Some(BlockRequest::Headers { start: h, count: count as u64, diff --git a/ethcore/sync/src/blocks.rs b/ethcore/sync/src/blocks.rs index 44c1697557b..c9ec3b513cc 100644 --- a/ethcore/sync/src/blocks.rs +++ b/ethcore/sync/src/blocks.rs @@ -19,7 +19,7 @@ use std::collections::{HashSet, HashMap, hash_map}; use bytes::Bytes; use ethereum_types::H256; use keccak_hash::{keccak, KECCAK_NULL_RLP, KECCAK_EMPTY_LIST_RLP}; -use log::{trace, warn}; +use log::{debug, trace, warn}; use parity_util_mem::MallocSizeOf; use rlp::{Rlp, RlpStream, DecoderError}; use triehash_ethereum::ordered_trie_root; @@ -103,7 +103,7 @@ fn unverified_from_sync(header: SyncHeader, body: Option) -> Unverifie header: header.header, transactions: body.transactions, uncles: body.uncles, - bytes: stream.out().to_vec(), + bytes: stream.out(), } } @@ -196,11 +196,11 @@ impl BlockCollection { } /// Insert a collection of block receipts for previously downloaded headers. - pub fn insert_receipts(&mut self, receipts: Vec) -> Vec> { + pub fn insert_receipts(&mut self, receipts: &[&[u8]]) -> Vec> { if !self.need_receipts { return Vec::new(); } - receipts.into_iter() + receipts.iter() .filter_map(|r| { self.insert_receipt(r) .map_err(|e| trace!(target: "sync", "Ignored invalid receipt: {:?}", e)) @@ -210,24 +210,28 @@ impl BlockCollection { } /// Returns a set of block hashes that require a body download. The returned set is marked as being downloaded. - pub fn needed_bodies(&mut self, count: usize, _ignore_downloading: bool) -> Vec { + pub fn needed_bodies(&mut self, count: usize) -> Vec { if self.head.is_none() { return Vec::new(); } - let mut needed_bodies: Vec = Vec::new(); + let mut needed_bodies: Vec = Vec::with_capacity(count); let mut head = self.head; - while head.is_some() && needed_bodies.len() < count { - head = self.parents.get(&head.unwrap()).cloned(); - if let Some(head) = head { - match self.blocks.get(&head) { - Some(block) if block.body.is_none() && !self.downloading_bodies.contains(&head) => { - self.downloading_bodies.insert(head.clone()); - needed_bodies.push(head.clone()); + while needed_bodies.len() < count { + head = match head { + Some(head) => { + match self.blocks.get(&head) { + Some(block) if block.body.is_none() && !self.downloading_bodies.contains(&head) => { + self.downloading_bodies.insert(head.clone()); + needed_bodies.push(head.clone()); + } + _ => (), } - _ => (), - } - } + self.parents.get(&head).copied() + }, + None => break + }; } + for h in self.header_ids.values() { if needed_bodies.len() >= count { break; @@ -241,25 +245,28 @@ impl BlockCollection { } /// Returns a set of block hashes that require a receipt download. The returned set is marked as being downloaded. - pub fn needed_receipts(&mut self, count: usize, _ignore_downloading: bool) -> Vec { + pub fn needed_receipts(&mut self, count: usize) -> Vec { if self.head.is_none() || !self.need_receipts { return Vec::new(); } - let mut needed_receipts: Vec = Vec::new(); + let mut needed_receipts: Vec = Vec::with_capacity(count); let mut head = self.head; - while head.is_some() && needed_receipts.len() < count { - head = self.parents.get(&head.unwrap()).cloned(); - if let Some(head) = head { - match self.blocks.get(&head) { - Some(block) => { - if block.receipts.is_none() && !self.downloading_receipts.contains(&block.receipts_root) { - self.downloading_receipts.insert(block.receipts_root); - needed_receipts.push(head.clone()); + while needed_receipts.len() < count { + head = match head { + Some(head) => { + match self.blocks.get(&head) { + Some(block) => { + if block.receipts.is_none() && !self.downloading_receipts.contains(&block.receipts_root) { + self.downloading_receipts.insert(block.receipts_root); + needed_receipts.push(head); + } } + _ => (), } - _ => (), - } - } + self.parents.get(&head).copied() + }, + None => break + }; } // If there are multiple blocks per receipt, only request one of them. for (root, h) in self.receipt_ids.iter().map(|(root, hashes)| (root, hashes[0])) { @@ -275,12 +282,12 @@ impl BlockCollection { } /// Returns a set of block hashes that require a header download. The returned set is marked as being downloaded. - pub fn needed_headers(&mut self, count: usize, ignore_downloading: bool) -> Option<(H256, usize)> { + pub fn needed_headers(&mut self, count: usize) -> Option<(H256, usize)> { // find subchain to download let mut download = None; { for h in &self.heads { - if ignore_downloading || !self.downloading_headers.contains(h) { + if !self.downloading_headers.contains(h) { self.downloading_headers.insert(h.clone()); download = Some(h.clone()); break; @@ -317,42 +324,40 @@ impl BlockCollection { return Vec::new(); } - let mut drained = Vec::new(); let mut hashes = Vec::new(); - { - let mut blocks = Vec::new(); - let mut head = self.head; - while let Some(h) = head { - head = self.parents.get(&h).cloned(); - if let Some(head) = head { - match self.blocks.remove(&head) { - Some(block) => { - if block.body.is_some() && (!self.need_receipts || block.receipts.is_some()) { - blocks.push(block); - hashes.push(head); - self.head = Some(head); - } else { - self.blocks.insert(head, block); - break; - } - }, - _ => { + let mut blocks = Vec::new(); + let mut head = self.head; + while let Some(h) = head { + head = self.parents.get(&h).copied(); + if let Some(head) = head { + match self.blocks.remove(&head) { + Some(block) => { + if block.body.is_some() && (!self.need_receipts || block.receipts.is_some()) { + blocks.push(block); + hashes.push(head); + self.head = Some(head); + } else { + self.blocks.insert(head, block); break; - }, - } + } + }, + _ => { + break; + }, } } + } - for block in blocks.into_iter() { - let unverified = unverified_from_sync(block.header, block.body); - drained.push(BlockAndReceipts { - block: unverified, - receipts: block.receipts.clone(), - }); - } + let mut drained = Vec::with_capacity(blocks.len()); + for block in blocks { + let unverified = unverified_from_sync(block.header, block.body); + drained.push(BlockAndReceipts { + block: unverified, + receipts: block.receipts, + }); } - trace!(target: "sync", "Drained {} blocks, new head :{:?}", drained.len(), self.head); + debug!(target: "sync", "Drained {} blocks, new head :{:?}", drained.len(), self.head); drained } @@ -409,7 +414,7 @@ impl BlockCollection { } } - fn insert_receipt(&mut self, r: Bytes) -> Result, network::Error> { + fn insert_receipt(&mut self, r: &[u8]) -> Result, network::Error> { let receipt_root = { let receipts = Rlp::new(&r); ordered_trie_root(receipts.iter().map(|r| r.as_raw())) @@ -422,7 +427,7 @@ impl BlockCollection { match self.blocks.get_mut(&h) { Some(ref mut block) => { trace!(target: "sync", "Got receipt {}", h); - block.receipts = Some(r.clone()); + block.receipts = Some(r.to_vec()); }, None => { warn!("Got receipt with no header {}", h); @@ -581,11 +586,11 @@ mod test { bc.reset_to(heads); assert!(!bc.is_empty()); assert_eq!(hashes[0], bc.heads[0]); - assert!(bc.needed_bodies(1, false).is_empty()); + assert!(bc.needed_bodies(1).is_empty()); assert!(!bc.contains(&hashes[0])); assert!(!bc.is_downloading(&hashes[0])); - let (h, n) = bc.needed_headers(6, false).unwrap(); + let (h, n) = bc.needed_headers(6).unwrap(); assert!(bc.is_downloading(&hashes[0])); assert_eq!(hashes[0], h); assert_eq!(n, 6); @@ -608,9 +613,9 @@ mod test { assert!(!bc.contains(&hashes[0])); assert_eq!(hashes[5], bc.head.unwrap()); - let (h, _) = bc.needed_headers(6, false).unwrap(); + let (h, _) = bc.needed_headers(6).unwrap(); assert_eq!(hashes[5], h); - let (h, _) = bc.needed_headers(6, false).unwrap(); + let (h, _) = bc.needed_headers(6).unwrap(); assert_eq!(hashes[20], h); bc.insert_headers(headers[10..16].into_iter().map(Clone::clone).collect()); assert!(bc.drain().is_empty()); From b7c97f90b6ce21b67fbf3670e0d6c2bb7ad5ddc2 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Tue, 10 Mar 2020 18:35:49 +0100 Subject: [PATCH 04/11] [devp2p discovery]: cleanup (#11547) * [devp2p discovery]: cleanup * [devp2p]: remove lifetime from Discovery This commit it removes the lifetime on type `Discovery` by making `request_backoff: &'static [Duration]` instead. * [devp2p discovery]: pass SockAddr by value * [devp2p discovery]: remove needless clones * [devp2p discovery]: take payload by value --- util/network-devp2p/src/discovery.rs | 91 +++++++++++++--------------- util/network-devp2p/src/host.rs | 2 +- 2 files changed, 43 insertions(+), 50 deletions(-) diff --git a/util/network-devp2p/src/discovery.rs b/util/network-devp2p/src/discovery.rs index 8bf78bf4784..2a9820dda6c 100644 --- a/util/network-devp2p/src/discovery.rs +++ b/util/network-devp2p/src/discovery.rs @@ -121,7 +121,7 @@ enum NodeValidity { #[derive(Debug)] enum BucketError { Ourselves, - NotInTheBucket{node_entry: NodeEntry, bucket_distance: usize}, + NotInTheBucket { node_entry: NodeEntry, bucket_distance: usize }, } struct PingRequest { @@ -137,22 +137,14 @@ struct PingRequest { reason: PingReason } -#[derive(Debug)] +#[derive(Debug, Default)] pub struct NodeBucket { nodes: VecDeque, //sorted by last active } -impl Default for NodeBucket { - fn default() -> Self { - NodeBucket::new() - } -} - impl NodeBucket { fn new() -> Self { - NodeBucket { - nodes: VecDeque::new() - } + Self::default() } } @@ -161,7 +153,7 @@ pub struct Datagram { pub address: SocketAddr, } -pub struct Discovery<'a> { +pub struct Discovery { id: NodeId, id_hash: H256, secret: Secret, @@ -182,7 +174,7 @@ pub struct Discovery<'a> { check_timestamps: bool, adding_nodes: Vec, ip_filter: IpFilter, - request_backoff: &'a [Duration], + request_backoff: &'static [Duration], } pub struct TableUpdates { @@ -190,8 +182,8 @@ pub struct TableUpdates { pub removed: HashSet, } -impl<'a> Discovery<'a> { - pub fn new(key: &KeyPair, public: NodeEndpoint, ip_filter: IpFilter) -> Discovery<'static> { +impl Discovery { + pub fn new(key: &KeyPair, public: NodeEndpoint, ip_filter: IpFilter) -> Discovery { Discovery { id: *key.public(), id_hash: keccak(key.public()), @@ -243,7 +235,8 @@ impl<'a> Discovery<'a> { }; let bucket = &mut self.node_buckets[dist]; bucket.nodes.iter_mut().find(|n| n.address.id == e.id) - .map_or(Err(BucketError::NotInTheBucket{node_entry: e.clone(), bucket_distance: dist}.into()), |entry| { + .ok_or_else(|| BucketError::NotInTheBucket { node_entry: e.clone(), bucket_distance: dist }) + .and_then(|entry| { entry.address = e; entry.last_seen = Instant::now(); entry.backoff_until = Instant::now(); @@ -389,14 +382,14 @@ impl<'a> Discovery<'a> { node.endpoint.to_rlp_list(&mut rlp); append_expiration(&mut rlp); let old_parity_hash = keccak(rlp.as_raw()); - let hash = self.send_packet(PACKET_PING, &node.endpoint.udp_address(), &rlp.drain())?; + let hash = self.send_packet(PACKET_PING, node.endpoint.udp_address(), rlp.drain())?; self.in_flight_pings.insert(node.id, PingRequest { sent_at: Instant::now(), node: node.clone(), echo_hash: hash, deprecated_echo_hash: old_parity_hash, - reason: reason + reason, }); trace!(target: "discovery", "Sent Ping to {:?} ; node_id={:#x}", &node.endpoint, node.id); @@ -407,7 +400,7 @@ impl<'a> Discovery<'a> { let mut rlp = RlpStream::new_list(2); rlp.append(target); append_expiration(&mut rlp); - self.send_packet(PACKET_FIND_NODE, &node.endpoint.udp_address(), &rlp.drain())?; + self.send_packet(PACKET_FIND_NODE, node.endpoint.udp_address(), rlp.drain())?; self.in_flight_find_nodes.insert(node.id, FindNodeRequest { sent_at: Instant::now(), @@ -419,10 +412,10 @@ impl<'a> Discovery<'a> { Ok(()) } - fn send_packet(&mut self, packet_id: u8, address: &SocketAddr, payload: &[u8]) -> Result { + fn send_packet(&mut self, packet_id: u8, address: SocketAddr, payload: Bytes) -> Result { let packet = assemble_packet(packet_id, payload, &self.secret)?; let hash = H256::from_slice(&packet[0..32]); - self.send_to(packet, address.clone()); + self.send_to(packet, address); Ok(hash) } @@ -498,10 +491,10 @@ impl<'a> Discovery<'a> { let packet_id = signed[0]; let rlp = Rlp::new(&signed[1..]); match packet_id { - PACKET_PING => self.on_ping(&rlp, &node_id, &from, hash_signed.as_bytes()), - PACKET_PONG => self.on_pong(&rlp, &node_id, &from), - PACKET_FIND_NODE => self.on_find_node(&rlp, &node_id, &from), - PACKET_NEIGHBOURS => self.on_neighbours(&rlp, &node_id, &from), + PACKET_PING => self.on_ping(&rlp, node_id, from, hash_signed.as_bytes()), + PACKET_PONG => self.on_pong(&rlp, node_id, from), + PACKET_FIND_NODE => self.on_find_node(&rlp, node_id, from), + PACKET_NEIGHBOURS => self.on_neighbours(&rlp, node_id, from), _ => { debug!(target: "discovery", "Unknown UDP packet: {}", packet_id); Ok(None) @@ -523,12 +516,12 @@ impl<'a> Discovery<'a> { entry.endpoint.is_allowed(&self.ip_filter) && entry.id != self.id } - fn on_ping(&mut self, rlp: &Rlp, node_id: &NodeId, from: &SocketAddr, echo_hash: &[u8]) -> Result, Error> { + fn on_ping(&mut self, rlp: &Rlp, node_id: NodeId, from: SocketAddr, echo_hash: &[u8]) -> Result, Error> { trace!(target: "discovery", "Got Ping from {:?}", &from); let ping_from = if let Ok(node_endpoint) = NodeEndpoint::from_rlp(&rlp.at(1)?) { node_endpoint } else { - let mut address = from.clone(); + let mut address = from; // address here is the node's tcp port. If we are unable to get the `NodeEndpoint` from the `ping_from` // rlp field then this is most likely a BootNode, set the tcp port to 0 because it can not be used for syncing. address.set_port(0); @@ -542,7 +535,7 @@ impl<'a> Discovery<'a> { self.check_timestamp(timestamp)?; let mut response = RlpStream::new_list(3); let pong_to = NodeEndpoint { - address: from.clone(), + address: from, udp_port: ping_from.udp_port }; // Here the PONG's `To` field should be the node we are @@ -555,27 +548,27 @@ impl<'a> Discovery<'a> { response.append(&echo_hash); append_expiration(&mut response); - self.send_packet(PACKET_PONG, from, &response.drain())?; + self.send_packet(PACKET_PONG, from, response.drain())?; - let entry = NodeEntry { id: *node_id, endpoint: pong_to.clone() }; + let entry = NodeEntry { id: node_id, endpoint: pong_to }; if !entry.endpoint.is_valid_discovery_node() { debug!(target: "discovery", "Got bad address: {:?}", entry); } else if !self.is_allowed(&entry) { debug!(target: "discovery", "Address not allowed: {:?}", entry); } else { - self.add_node(entry.clone()); + self.add_node(entry); } Ok(None) } - fn on_pong(&mut self, rlp: &Rlp, node_id: &NodeId, from: &SocketAddr) -> Result, Error> { + fn on_pong(&mut self, rlp: &Rlp, node_id: NodeId, from: SocketAddr) -> Result, Error> { trace!(target: "discovery", "Got Pong from {:?} ; node_id={:#x}", &from, node_id); let _pong_to = NodeEndpoint::from_rlp(&rlp.at(0)?)?; let echo_hash: H256 = rlp.val_at(1)?; let timestamp: u64 = rlp.val_at(2)?; self.check_timestamp(timestamp)?; - let expected_node = match self.in_flight_pings.entry(*node_id) { + let expected_node = match self.in_flight_pings.entry(node_id) { Entry::Occupied(entry) => { let expected_node = { let request = entry.get(); @@ -586,7 +579,7 @@ impl<'a> Discovery<'a> { if request.deprecated_echo_hash == echo_hash { trace!(target: "discovery", "Got Pong from an old open-ethereum version."); } - Some((request.node.clone(), request.reason.clone())) + Some((request.node.clone(), request.reason)) } }; @@ -629,16 +622,16 @@ impl<'a> Discovery<'a> { } } - fn on_find_node(&mut self, rlp: &Rlp, node_id: &NodeId, from: &SocketAddr) -> Result, Error> { + fn on_find_node(&mut self, rlp: &Rlp, node_id: NodeId, from: SocketAddr) -> Result, Error> { trace!(target: "discovery", "Got FindNode from {:?}", &from); let target: NodeId = rlp.val_at(0)?; let timestamp: u64 = rlp.val_at(1)?; self.check_timestamp(timestamp)?; let node = NodeEntry { - id: node_id.clone(), + id: node_id, endpoint: NodeEndpoint { - address: *from, + address: from, udp_port: from.port() } }; @@ -688,7 +681,7 @@ impl<'a> Discovery<'a> { } let mut packets = Discovery::prepare_neighbours_packets(&nearest); for p in packets.drain(..) { - self.send_packet(PACKET_NEIGHBOURS, &node.endpoint.address, &p)?; + self.send_packet(PACKET_NEIGHBOURS, node.endpoint.address, p)?; } trace!(target: "discovery", "Sent {} Neighbours to {:?}", nearest.len(), &node.endpoint); Ok(()) @@ -711,10 +704,10 @@ impl<'a> Discovery<'a> { packets.collect() } - fn on_neighbours(&mut self, rlp: &Rlp, node_id: &NodeId, from: &SocketAddr) -> Result, Error> { + fn on_neighbours(&mut self, rlp: &Rlp, node_id: NodeId, from: SocketAddr) -> Result, Error> { let results_count = rlp.at(0)?.item_count()?; - let is_expected = match self.in_flight_find_nodes.entry(*node_id) { + let is_expected = match self.in_flight_find_nodes.entry(node_id) { Entry::Occupied(mut entry) => { let expected = { let request = entry.get_mut(); @@ -862,11 +855,11 @@ fn append_expiration(rlp: &mut RlpStream) { rlp.append(×tamp); } -fn assemble_packet(packet_id: u8, bytes: &[u8], secret: &Secret) -> Result { - let mut packet = Bytes::with_capacity(bytes.len() + 32 + 65 + 1); +fn assemble_packet(packet_id: u8, payload: Bytes, secret: &Secret) -> Result { + let mut packet = Bytes::with_capacity(payload.len() + 32 + 65 + 1); packet.resize(32 + 65, 0); // Filled in below packet.push(packet_id); - packet.extend_from_slice(bytes); + packet.extend(payload); let hash = keccak(&packet[(32 + 65)..]); let signature = match sign(secret, &hash) { @@ -1043,7 +1036,7 @@ mod tests { let key = Random.generate(); discovery.send_find_node(&node_entries[100], key.public()).unwrap(); for payload in Discovery::prepare_neighbours_packets(&node_entries[101..116]) { - let packet = assemble_packet(PACKET_NEIGHBOURS, &payload, &key.secret()).unwrap(); + let packet = assemble_packet(PACKET_NEIGHBOURS, payload, &key.secret()).unwrap(); discovery.on_packet(&packet, from.clone()).unwrap(); } @@ -1055,7 +1048,7 @@ mod tests { // FIND_NODE does not time out because it receives k results. discovery.send_find_node(&node_entries[100], key.public()).unwrap(); for payload in Discovery::prepare_neighbours_packets(&node_entries[101..117]) { - let packet = assemble_packet(PACKET_NEIGHBOURS, &payload, &key.secret()).unwrap(); + let packet = assemble_packet(PACKET_NEIGHBOURS, payload, &key.secret()).unwrap(); discovery.on_packet(&packet, from.clone()).unwrap(); } @@ -1065,8 +1058,8 @@ mod tests { assert_eq!(removed, 0); // Test bucket evictions with retries. - let request_backoff = [Duration::new(0, 0); 2]; - let mut discovery = Discovery { request_backoff: &request_backoff, ..discovery }; + const TEST_REQUEST_BACKOFF: [Duration; 2] = [Duration::from_secs(0); 2]; + let mut discovery = Discovery { request_backoff: &TEST_REQUEST_BACKOFF, ..discovery }; for _ in 0..2 { discovery.ping(&node_entries[101], PingReason::Default).unwrap(); @@ -1289,7 +1282,7 @@ mod tests { incorrect_pong_rlp.append(&H256::zero()); append_expiration(&mut incorrect_pong_rlp); let incorrect_pong_data = assemble_packet( - PACKET_PONG, &incorrect_pong_rlp.drain(), &discovery2.secret + PACKET_PONG, incorrect_pong_rlp.drain(), &discovery2.secret ).unwrap(); if let Some(_) = discovery1.on_packet(&incorrect_pong_data, ep2.address.clone()).unwrap() { panic!("Expected no changes to discovery1's table because pong hash is incorrect"); @@ -1318,7 +1311,7 @@ mod tests { unexpected_pong_rlp.append(&H256::zero()); append_expiration(&mut unexpected_pong_rlp); let unexpected_pong = assemble_packet( - PACKET_PONG, &unexpected_pong_rlp.drain(), key3.secret() + PACKET_PONG, unexpected_pong_rlp.drain(), key3.secret() ).unwrap(); if let Some(_) = discovery1.on_packet(&unexpected_pong, ep3.address.clone()).unwrap() { panic!("Expected no changes to discovery1's table for unexpected pong"); diff --git a/util/network-devp2p/src/host.rs b/util/network-devp2p/src/host.rs index 0d4e422f081..170502fadc8 100644 --- a/util/network-devp2p/src/host.rs +++ b/util/network-devp2p/src/host.rs @@ -267,7 +267,7 @@ pub struct Host { udp_socket: Mutex>, tcp_listener: Mutex, sessions: Arc>>, - discovery: Mutex>>, + discovery: Mutex>, nodes: RwLock, handlers: RwLock>>, timers: RwLock>, From e88ac4dbcf5b93c74c720bee4650ede9b76d0d9d Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Tue, 10 Mar 2020 20:09:12 +0100 Subject: [PATCH 05/11] [secretstore]: don't sign message with only zeroes (#11561) --- parity/secretstore/server.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/parity/secretstore/server.rs b/parity/secretstore/server.rs index e300d42d1e0..ee2e25c20f4 100644 --- a/parity/secretstore/server.rs +++ b/parity/secretstore/server.rs @@ -18,16 +18,17 @@ use std::collections::BTreeMap; use std::sync::Arc; + use account_utils::AccountProvider; use dir::default_data_path; use dir::helpers::replace_home; use ethcore::client::Client; use ethcore::miner::Miner; +use ethereum_types::Address; use ethkey::Password; use parity_crypto::publickey::{Secret, Public}; -use sync::SyncProvider; -use ethereum_types::Address; use parity_runtime::Executor; +use sync::SyncProvider; /// This node secret key. #[derive(Debug, PartialEq, Clone)] @@ -123,14 +124,16 @@ mod server { #[cfg(feature = "secretstore")] mod server { use std::sync::Arc; - use parity_secretstore; use parity_crypto::publickey::KeyPair; use ansi_term::Colour::{Red, White}; + use ethereum_types::H256; use super::{Configuration, Dependencies, NodeSecretKey, ContractAddress, Executor}; use super::super::TrustedClient; #[cfg(feature = "accounts")] use super::super::KeyStoreNodeKeyPair; + const SECP_TEST_MESSAGE: H256 = H256([1_u8; 32]); + fn into_service_contract_address(address: ContractAddress) -> parity_secretstore::ContractAddress { match address { ContractAddress::Registry => parity_secretstore::ContractAddress::Registry, @@ -163,10 +166,10 @@ mod server { // Attempt to sign in the engine signer. let password = deps.accounts_passwords.iter() - .find(|p| deps.account_provider.sign(account.clone(), Some((*p).clone()), Default::default()).is_ok()) + .find(|p| deps.account_provider.sign(account.clone(), Some((*p).clone()), SECP_TEST_MESSAGE).is_ok()) .ok_or_else(|| format!("No valid password for the secret store node account {}", account))?; Arc::new(KeyStoreNodeKeyPair::new(deps.account_provider, account, password.clone()) - .map_err(|e| format!("{}", e))?) + .map_err(|e| e.to_string())?) }, None => return Err("self secret is required when using secretstore".into()), }; From 5be4924672e5d58399ee1701ade075569fb61a2e Mon Sep 17 00:00:00 2001 From: David Date: Tue, 10 Mar 2020 23:58:54 +0100 Subject: [PATCH 06/11] =?UTF-8?q?Misc=20docs=20and=20renames=20=E2=80=A6an?= =?UTF-8?q?d=20one=20less=20clone=20(#11556)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Misc docs and renames …and one less clone * unused import * Docs * Update ethcore/src/client/client.rs Co-Authored-By: Niklas Adolfsson Co-authored-by: Niklas Adolfsson --- ethcore/engine/src/engine.rs | 4 +++- ethcore/machine/src/machine.rs | 4 +++- ethcore/src/client/client.rs | 12 ++++++++---- ethcore/src/test_helpers/test_client.rs | 2 +- ethcore/sync/src/chain/handler.rs | 6 +++--- ethcore/sync/src/chain/mod.rs | 2 +- ethcore/sync/src/chain/requester.rs | 2 +- ethcore/sync/src/chain/supplier.rs | 2 +- ethcore/types/src/io_message.rs | 6 +++--- 9 files changed, 24 insertions(+), 16 deletions(-) diff --git a/ethcore/engine/src/engine.rs b/ethcore/engine/src/engine.rs index 39118089d2b..dadd223a88c 100644 --- a/ethcore/engine/src/engine.rs +++ b/ethcore/engine/src/engine.rs @@ -399,7 +399,9 @@ pub trait Engine: Sync + Send { self.machine().verify_transaction_basic(t, header) } - /// Performs pre-validation of RLP decoded transaction before other processing + /// Performs pre-validation of RLP encoded transaction before other + /// processing: check length against `max_transaction_size` and decode the + /// RLP. fn decode_transaction(&self, transaction: &[u8]) -> Result { self.machine().decode_transaction(transaction) } diff --git a/ethcore/machine/src/machine.rs b/ethcore/machine/src/machine.rs index 30ec44a5ab7..0f4e51f4f8b 100644 --- a/ethcore/machine/src/machine.rs +++ b/ethcore/machine/src/machine.rs @@ -364,7 +364,9 @@ impl Machine { Ok(()) } - /// Performs pre-validation of RLP decoded transaction before other processing + /// Performs pre-validation of RLP encoded transaction before other + /// processing: check length against `max_transaction_size` and decode the + /// RLP. pub fn decode_transaction(&self, transaction: &[u8]) -> Result { let rlp = Rlp::new(&transaction); if rlp.as_raw().len() > self.params().max_transaction_size { diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 4e6c24c45dc..06206dc1ddd 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -2186,7 +2186,7 @@ impl IoClient for Client { fn queue_transactions(&self, transactions: Vec, peer_id: usize) { trace_time!("queue_transactions"); let len = transactions.len(); - self.queue_transactions.queue(&self.io_channel.read(), len, move |client| { + self.queue_transactions.enqueue(&self.io_channel.read(), len, move |client| { trace_time!("import_queued_transactions"); let txs: Vec = transactions @@ -2231,7 +2231,7 @@ impl IoClient for Client { let queued = self.queued_ancient_blocks.clone(); let lock = self.ancient_blocks_import_lock.clone(); - self.queue_ancient_blocks.queue(&self.io_channel.read(), 1, move |client| { + self.queue_ancient_blocks.enqueue(&self.io_channel.read(), 1, move |client| { trace_time!("import_ancient_block"); // Make sure to hold the lock here to prevent importing out of order. // We use separate lock, cause we don't want to block queueing. @@ -2265,7 +2265,7 @@ impl IoClient for Client { } fn queue_consensus_message(&self, message: Bytes) { - match self.queue_consensus_message.queue(&self.io_channel.read(), 1, move |client| { + match self.queue_consensus_message.enqueue(&self.io_channel.read(), 1, move |client| { if let Err(e) = client.engine().handle_message(&message) { debug!(target: "poa", "Invalid message received: {}", e); } @@ -2798,7 +2798,11 @@ impl IoChannelQueue { } } - pub fn queue(&self, channel: &IoChannel>, count: usize, fun: F) -> EthcoreResult<()> where + /// Try to to add an item to the queue for deferred processing by the IO + /// client. Messages take the form of `Fn` closures that carry a `Client` + /// reference with them. Enqueuing a message can fail if the queue is full + /// or if the `send()` on the `IoChannel` fails. + pub fn enqueue(&self, channel: &IoChannel>, count: usize, fun: F) -> EthcoreResult<()> where F: Fn(&Client) + Send + Sync + 'static, { let queue_size = self.currently_queued.load(AtomicOrdering::Relaxed); diff --git a/ethcore/src/test_helpers/test_client.rs b/ethcore/src/test_helpers/test_client.rs index a3b2d638126..b1ad6cc27af 100644 --- a/ethcore/src/test_helpers/test_client.rs +++ b/ethcore/src/test_helpers/test_client.rs @@ -937,7 +937,7 @@ impl BlockChainClient for TestBlockChainClient { impl IoClient for TestBlockChainClient { fn queue_transactions(&self, transactions: Vec, _peer_id: usize) { // import right here - let txs = transactions.into_iter().filter_map(|bytes| Rlp::new(&bytes).as_val().ok()).collect(); + let txs = transactions.iter().filter_map(|bytes| Rlp::new(bytes).as_val().ok()).collect(); self.miner.import_external_transactions(self, txs); } diff --git a/ethcore/sync/src/chain/handler.rs b/ethcore/sync/src/chain/handler.rs index dcc8f56cb4c..21e82cfed47 100644 --- a/ethcore/sync/src/chain/handler.rs +++ b/ethcore/sync/src/chain/handler.rs @@ -675,7 +675,7 @@ impl SyncHandler { } /// Called when peer sends us new transactions - pub fn on_peer_transactions(sync: &ChainSync, io: &mut dyn SyncIo, peer_id: PeerId, r: &Rlp) -> Result<(), PacketDecodeError> { + pub fn on_peer_transactions(sync: &ChainSync, io: &mut dyn SyncIo, peer_id: PeerId, tx_rlp: Rlp) -> Result<(), PacketDecodeError> { // Accept transactions only when fully synced if !io.is_chain_queue_empty() || (sync.state != SyncState::Idle && sync.state != SyncState::NewBlocks) { trace!(target: "sync", "{} Ignoring transactions while syncing", peer_id); @@ -686,11 +686,11 @@ impl SyncHandler { return Ok(()); } - let item_count = r.item_count()?; + let item_count = tx_rlp.item_count()?; trace!(target: "sync", "{:02} -> Transactions ({} entries)", peer_id, item_count); let mut transactions = Vec::with_capacity(item_count); for i in 0 .. item_count { - let rlp = r.at(i)?; + let rlp = tx_rlp.at(i)?; let tx = rlp.as_raw().to_vec(); transactions.push(tx); } diff --git a/ethcore/sync/src/chain/mod.rs b/ethcore/sync/src/chain/mod.rs index e9bb3cae455..98627c4d1b5 100644 --- a/ethcore/sync/src/chain/mod.rs +++ b/ethcore/sync/src/chain/mod.rs @@ -762,7 +762,7 @@ impl ChainSync { self.transactions_stats.stats() } - /// Updates transactions were received by a peer + /// Updates the set of transactions recently sent to this peer to avoid spamming. pub fn transactions_received(&mut self, txs: &[UnverifiedTransaction], peer_id: PeerId) { if let Some(peer_info) = self.peers.get_mut(&peer_id) { peer_info.last_sent_transactions.extend(txs.iter().map(|tx| tx.hash())); diff --git a/ethcore/sync/src/chain/requester.rs b/ethcore/sync/src/chain/requester.rs index 9f95e613302..3b44a59e041 100644 --- a/ethcore/sync/src/chain/requester.rs +++ b/ethcore/sync/src/chain/requester.rs @@ -68,7 +68,7 @@ impl SyncRequester { let mut rlp = RlpStream::new_list(hashes.len()); trace!(target: "sync", "{} <- GetBlockBodies: {} entries starting from {:?}, set = {:?}", peer_id, hashes.len(), hashes.first(), set); for h in &hashes { - rlp.append(&h.clone()); + rlp.append(h); } SyncRequester::send_request(sync, io, peer_id, PeerAsking::BlockBodies, GetBlockBodiesPacket, rlp.out()); let peer = sync.peers.get_mut(&peer_id).expect("peer_id may originate either from on_packet, where it is already validated or from enumerating self.peers. qed"); diff --git a/ethcore/sync/src/chain/supplier.rs b/ethcore/sync/src/chain/supplier.rs index dbfb0ff1ecb..14651c99b13 100644 --- a/ethcore/sync/src/chain/supplier.rs +++ b/ethcore/sync/src/chain/supplier.rs @@ -128,7 +128,7 @@ impl SyncSupplier { TransactionsPacket => { let res = { let sync_ro = sync.read(); - SyncHandler::on_peer_transactions(&*sync_ro, io, peer, &rlp) + SyncHandler::on_peer_transactions(&*sync_ro, io, peer, rlp) }; if res.is_err() { // peer sent invalid data, disconnect. diff --git a/ethcore/types/src/io_message.rs b/ethcore/types/src/io_message.rs index a86901c9e25..db33feb4863 100644 --- a/ethcore/types/src/io_message.rs +++ b/ethcore/types/src/io_message.rs @@ -37,18 +37,18 @@ pub enum ClientIoMessage { FeedBlockChunk(H256, Bytes), /// Take a snapshot for the block with given number. TakeSnapshot(u64), - /// Execute wrapped closure + /// Execute wrapped Fn closure Execute(Callback), } impl ClientIoMessage { - /// Create new `ClientIoMessage` that executes given procedure. + /// Create new `ClientIoMessage` that can execute the wrapped Fn closure. pub fn execute(fun: F) -> Self { ClientIoMessage::Execute(Callback(Box::new(fun))) } } -/// A function to invoke in the client thread. +/// A wrapper around an Fn closure to invoke in the client thread. pub struct Callback(pub Box); impl fmt::Debug for Callback { From ba0a380df9074b860ed7cc9fc246c67b8d5410db Mon Sep 17 00:00:00 2001 From: /raw PONG _GHMoaCXLT <58883403+q9f@users.noreply.github.com> Date: Fri, 13 Mar 2020 10:59:50 +0100 Subject: [PATCH 07/11] ethcore/res: enable ecip-1088 phoenix upgrade for kotti and mordor testnets (#11529) * ethcore/res: enable ecip-1088 phoenix upgrade for classic * ethcore/res: fix eip-2200 config for the classic networks * ethcore/res: add fork block checkpoint for mordor classic * ethcore/res: fix whitespacing for mordor classic config * ethcore/res: fix mordor bootnode entries * ethcore/res: shuffle mordor bootnodes * ethcore/res: use hex prefix for classic specs * ethcore/res: revert classic spec to pre-phoenix Co-authored-by: q9f --- ethcore/res/ethereum/kotti.json | 20 ++- ethcore/res/ethereum/mordor.json | 294 +++++++++++++++++-------------- 2 files changed, 168 insertions(+), 146 deletions(-) diff --git a/ethcore/res/ethereum/kotti.json b/ethcore/res/ethereum/kotti.json index aeea86b08c3..960ee4c4ac2 100644 --- a/ethcore/res/ethereum/kotti.json +++ b/ethcore/res/ethereum/kotti.json @@ -24,11 +24,13 @@ "eip658Transition": "0xaef49", "eip1014Transition": "0x1a064d", "eip1052Transition": "0x1a064d", - "eip1283Transition": "0x1f67cf", - "eip1344Transition": "0x1f67cf", - "eip1706Transition": "0x1f67cf", - "eip2028Transition": "0x1f67cf", - "eip2200AdvanceTransition": "0x1f67cf", + "eip1283Transition": "0x0", + "eip1283DisableTransition": "0x0", + "eip1283ReenableTransition": "0x2191cd", + "eip1344Transition": "0x2191cd", + "eip1706Transition": "0x2191cd", + "eip1884Transition": "0x2191cd", + "eip2028Transition": "0x2191cd", "gasLimitBoundDivisor": "0x400", "maxCodeSize": "0x6000", "maxCodeSizeTransition": "0xaef49", @@ -129,7 +131,7 @@ "0xaef49": { "price": { "alt_bn128_const_operations": { "price": 500 }} }, - "0x1f67cf": { + "0x2191cd": { "info": "EIP 1108 transition", "price": { "alt_bn128_const_operations": { "price": 150 }} } @@ -144,7 +146,7 @@ "0xaef49": { "price": { "alt_bn128_const_operations": { "price": 40000 }} }, - "0x1f67cf": { + "0x2191cd": { "info": "EIP 1108 transition", "price": { "alt_bn128_const_operations": { "price": 6000 }} } @@ -159,7 +161,7 @@ "0xaef49": { "price": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 }} }, - "0x1f67cf": { + "0x2191cd": { "info": "EIP 1108 transition", "price": { "alt_bn128_pairing": { "base": 45000, "pair": 34000 }} } @@ -170,7 +172,7 @@ "balance": "0x1", "builtin": { "name": "blake2_f", - "activate_at": "0x1f67cf", + "activate_at": "0x2191cd", "pricing": { "blake2_f": { "gas_per_round": 1 diff --git a/ethcore/res/ethereum/mordor.json b/ethcore/res/ethereum/mordor.json index e33c14518f7..357648d2ddf 100644 --- a/ethcore/res/ethereum/mordor.json +++ b/ethcore/res/ethereum/mordor.json @@ -1,193 +1,213 @@ { - "name":"Mordor Classic Testnet", - "dataDir":"mordor", - "engine":{ - "Ethash":{ - "params":{ - "minimumDifficulty":"0x20000", - "difficultyBoundDivisor":"0x800", - "durationLimit":"0xd", - "blockReward":"0x4563918244F40000", - "homesteadTransition":"0x0", - "ecip1010PauseTransition":"0x0", - "ecip1010ContinueTransition":"0x0", - "ecip1017EraRounds":"0x1e8480", - "bombDefuseTransition":"0x0", - "eip100bTransition":"0x0" + "name": "Mordor Classic Testnet", + "dataDir": "mordor", + "engine": { + "Ethash": { + "params": { + "minimumDifficulty": "0x20000", + "difficultyBoundDivisor": "0x800", + "durationLimit": "0xd", + "blockReward": "0x4563918244F40000", + "homesteadTransition": "0x0", + "ecip1010PauseTransition": "0x0", + "ecip1010ContinueTransition": "0x0", + "ecip1017EraRounds": "0x1e8480", + "bombDefuseTransition": "0x0", + "eip100bTransition": "0x0" } } }, - "params":{ - "gasLimitBoundDivisor":"0x400", - "accountStartNonce":"0x0", - "maximumExtraDataSize":"0x20", - "minGasLimit":"0x1388", - "networkID":"0x7", - "chainID":"0x3f", - "eip150Transition":"0x0", - "eip160Transition":"0x0", - "eip161abcTransition":"0x0", - "eip161dTransition":"0x0", - "eip155Transition":"0x0", - "maxCodeSize":"0x6000", - "maxCodeSizeTransition":"0x0", - "eip140Transition":"0x0", - "eip211Transition":"0x0", - "eip214Transition":"0x0", - "eip658Transition":"0x0", - "eip145Transition":"0x498bb", - "eip1014Transition":"0x498bb", - "eip1052Transition":"0x498bb", - "eip1283Transition":"0xbe10b", - "eip1344Transition":"0xbe10b", - "eip1706Transition":"0xbe10b", - "eip2028Transition":"0xbe10b", - "eip2200AdvanceTransition": "0xbe10b" + "params": { + "gasLimitBoundDivisor": "0x400", + "accountStartNonce": "0x0", + "maximumExtraDataSize": "0x20", + "minGasLimit": "0x1388", + "networkID": "0x7", + "chainID": "0x3f", + "forkBlock": "0xcd16a", + "forkCanonHash": "0x7b4145006cddae9e88c13b47d6aeee2ab4c37d561b929cf688f6f35d58d1966b", + "eip150Transition": "0x0", + "eip160Transition": "0x0", + "eip161abcTransition": "0x0", + "eip161dTransition": "0x0", + "eip155Transition": "0x0", + "maxCodeSize": "0x6000", + "maxCodeSizeTransition": "0x0", + "eip140Transition": "0x0", + "eip211Transition": "0x0", + "eip214Transition": "0x0", + "eip658Transition": "0x0", + "eip145Transition": "0x498bb", + "eip1014Transition": "0x498bb", + "eip1052Transition": "0x498bb", + "eip1283Transition": "0x0", + "eip1283DisableTransition": "0x0", + "eip1283ReenableTransition": "0xf422f", + "eip1344Transition": "0xf422f", + "eip1706Transition": "0xf422f", + "eip1884Transition": "0xf422f", + "eip2028Transition": "0xf422f" }, - "genesis":{ - "seal":{ - "ethereum":{ - "nonce":"0x0000000000000000", - "mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000" + "genesis": { + "seal": { + "ethereum": { + "nonce": "0x0000000000000000", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000" } }, - "difficulty":"0x20000", - "author":"0x0000000000000000000000000000000000000000", - "timestamp":"0x5d9676db", - "parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000", - "extraData":"0x70686f656e697820636869636b656e206162737572642062616e616e61", - "gasLimit":"0x2fefd8" + "difficulty": "0x20000", + "author": "0x0000000000000000000000000000000000000000", + "timestamp": "0x5d9676db", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "extraData": "0x70686f656e697820636869636b656e206162737572642062616e616e61", + "gasLimit": "0x2fefd8" }, "nodes":[ - "enode://2b69a3926f36a7748c9021c34050be5e0b64346225e477fe7377070f6289bd363b2be73a06010fd516e6ea3ee90778dd0399bc007bb1281923a79374f842675a@51.15.116.226:30303", - "enode://a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd@51.158.191.43:38556", - "enode://5a1399e6ba3268721dd7656530cd81230dbeb950570c6e3ec2a45effc50c032f66633c5eaaa1a49c51ba1849db37a7bef6e402779ad12dc9943f117e058d7760@34.69.121.227:30303", + "enode://f50f52b5fe18fd281748905bf5dad5439471f32cc02d99fecf960a983c1f4eba701ffca96afd2f2a68dcf6f97c5d02b566bafce1f361b51717e1a03c1dd9a836@157.230.42.102:30303", "enode://03b133f731049e3f7be827339c3759be92778c05e54a1847d178c0fdb56fa168aa1e7e61fc77791a7afdd0328a00318f73c01212eb3f3bbe919f5ce8f5b4a314@192.227.105.4:32000", - "enode://621e28e529146fd501709194885f50540c494f1a2985d1fb4ec8769226b5cb0b0d1a11545926077821474c2767cdd87888ead8a2509a2c9069dd5584e4b1c3b8@10.28.223.8:30000", + "enode://859ed8c19ea04eaea41f1cf17c8d2710e2e0affb97328c8392a79f1764118edf2344f1941299f0d676772fa6054447e6f9b3af96444e350b417442bfd7cc832b@34.68.243.226:30303", + "enode://07fa944c83597d5e935a2abe6194ed40fc7239e86111c971a43537a33d0184d1cd1b3f1291b8dd3bcfaebfbb802de77c843465a00065b39120c338fdd877ca4a@35.238.126.60:51240", + "enode://642cf9650dd8869d42525dbf6858012e3b4d64f475e733847ab6f7742341a4397414865d953874e8f5ed91b0e4e1c533dee14ad1d6bb276a5459b2471460ff0d@157.230.152.87:30303", + "enode://06fdbeb591d26f53b2e7250025fe955ca013431ded930920cf1e3cd1f0c920e9a5e727949d209bc25a07288327b525279b11c5551315c50ff0db483e69fc159b@34.218.225.178:32000", + "enode://f840b007500f50c98ea6f9c9e56dabf4690bbbbb7036d43682c531204341aff8315013547e5bee54117eb22bd3603585ae6bf713d9fa710659533fcab65d5b84@34.69.50.155:42078", + "enode://07fa944c83597d5e935a2abe6194ed40fc7239e86111c971a43537a33d0184d1cd1b3f1291b8dd3bcfaebfbb802de77c843465a00065b39120c338fdd877ca4a@35.238.126.60:30000", "enode://2592745efd35b4be443b8ee25fd2099de132e037951f9f6d3e8805e0a78f213537f71264b973f1a83a57372f57bbe6acac8d6ae678f39393221c045ccbe3b18c@51.15.116.226:30304", - "enode://a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd@51.15.116.226:30303", + "enode://b45f008ab8ad73966d0c8c0c923c50f47c0ae50c37a9ea05cc28b00cb94802145a4158412a526fdadd7e539db5eaab72f06a9046a34576ecf5a68efc41ba9d01@34.68.40.145:30303", + "enode://617a2009783a09085ed0d5d5e7250e2e3c142f73448bf28200284bf4825c5926a80f3e9fb481edf38b89ade2aa0ad5a2f14cc935f3150e36e648eddda674fd70@35.225.5.185:51320", + "enode://534d18fd46c5cd5ba48a68250c47cea27a1376869755ed631c94b91386328039eb607cf10dd8d0aa173f5ec21e3fb45c5d7a7aa904f97bc2557e9cb4ccc703f1@51.158.190.99:30303", + "enode://15b6ae4e9e18772f297c90d83645b0fbdb56667ce2d747d6d575b21d7b60c2d3cd52b11dec24e418438caf80ddc433232b3685320ed5d0e768e3972596385bfc@51.158.191.43:41235", + "enode://a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd@51.158.191.43:38556", + "enode://014ebf612cd362d87215d8668bd34a6db6c009a5b77c01e05fe638948054ebe91684ce05f1baf384ae9964316b9ac0eaf87dc43edd7e63467fb0b34db0f2c1d7@51.158.190.99:34567", + "enode://5a1399e6ba3268721dd7656530cd81230dbeb950570c6e3ec2a45effc50c032f66633c5eaaa1a49c51ba1849db37a7bef6e402779ad12dc9943f117e058d7760@35.225.124.17:39306", + "enode://1f378945c9b2eeb292d910f461911fd99520a23beda1bc5c8aea12be09e249f8d92615aa3d4d75c938004db5281dabad4a9cf7a0f07ec7c1fc8e7721addc7c85@34.205.41.164:40218", + "enode://9b1bf9613d859ac2071d88509ab40a111b75c1cfc51f4ad78a1fdbb429ff2405de0dc5ea8ae75e6ac88e03e51a465f0b27b517e78517f7220ae163a2e0692991@51.158.190.99:30426", + "enode://2b69a3926f36a7748c9021c34050be5e0b64346225e477fe7377070f6289bd363b2be73a06010fd516e6ea3ee90778dd0399bc007bb1281923a79374f842675a@51.15.116.226:30303", + "enode://5a1399e6ba3268721dd7656530cd81230dbeb950570c6e3ec2a45effc50c032f66633c5eaaa1a49c51ba1849db37a7bef6e402779ad12dc9943f117e058d7760@34.69.121.227:30303", "enode://f840b007500f50c98ea6f9c9e56dabf4690bbbbb7036d43682c531204341aff8315013547e5bee54117eb22bd3603585ae6bf713d9fa710659533fcab65d5b84@35.238.101.58:30303", - "enode://1813e90a0afdd7c1e4892c5376960e3577a9e6c5a4f86fa405a405c7421a4a1608248d77cc90333842f13d8954d82113dec480cfb76b4fef8cb475157cf4d5f2@10.28.224.3:30000", - "enode://06fdbeb591d26f53b2e7250025fe955ca013431ded930920cf1e3cd1f0c920e9a5e727949d209bc25a07288327b525279b11c5551315c50ff0db483e69fc159b@34.218.225.178:32000" + "enode://0d70715514674189792de4ad294b658c96d0ec40fe517fbe9cb7949d3792f25f82357ec77d1bd8bed6ec719ca0c1d608bb34cc702bf3d4bb4507f7280f835452@154.5.137.161:61410", + "enode://4ca79bbff7491fed82221259e3f27492e27b95b600594e2f8d5f1fa011123ea267e71873a0db3993e5109845d519d8b849ba2c7e4b48b09bedebb99e1c2ce304@35.238.132.8:30303", + "enode://651b484b652c07c72adebfaaf8bc2bd95b420b16952ef3de76a9c00ef63f07cca02a20bd2363426f9e6fe372cef96a42b0fec3c747d118f79fd5e02f2a4ebd4e@51.158.190.99:45678", + "enode://c0afb552bfe932c72598caa245aef82d55c23555622c5ab946d4e49bb0ab694e46086dcff6793a606527f323ef94d0eb499d01ceb26aefb6fa3f8977105d7dd8@157.230.152.87:52138", + "enode://111bd28d5b2c1378d748383fd83ff59572967c317c3063a9f475a26ad3f1517642a164338fb5268d4e32ea1cc48e663bd627dec572f1d201c7198518e5a506b1@88.99.216.30:45834" ], - "accounts":{ - "0x0000000000000000000000000000000000000001":{ - "builtin":{ - "name":"ecrecover", - "pricing":{ - "linear":{ - "base":3000, - "word":0 + "accounts": { + "0x0000000000000000000000000000000000000001": { + "builtin": { + "name": "ecrecover", + "pricing": { + "linear": { + "base": 3000, + "word": 0 } } } }, - "0x0000000000000000000000000000000000000002":{ - "builtin":{ - "name":"sha256", - "pricing":{ - "linear":{ - "base":60, - "word":12 + "0x0000000000000000000000000000000000000002": { + "builtin": { + "name": "sha256", + "pricing": { + "linear": { + "base": 60, + "word": 12 } } } }, - "0x0000000000000000000000000000000000000003":{ - "builtin":{ - "name":"ripemd160", - "pricing":{ - "linear":{ - "base":600, - "word":120 + "0x0000000000000000000000000000000000000003": { + "builtin": { + "name": "ripemd160", + "pricing": { + "linear": { + "base": 600, + "word": 120 } } } }, - "0x0000000000000000000000000000000000000004":{ - "builtin":{ - "name":"identity", - "pricing":{ - "linear":{ - "base":15, - "word":3 + "0x0000000000000000000000000000000000000004": { + "builtin": { + "name": "identity", + "pricing": { + "linear": { + "base": 15, + "word": 3 } } } }, - "0x0000000000000000000000000000000000000005":{ - "builtin":{ - "activate_at":"0x0", - "name":"modexp", - "pricing":{ - "modexp":{ - "divisor":20 + "0x0000000000000000000000000000000000000005": { + "builtin": { + "activate_at": "0x0", + "name": "modexp", + "pricing": { + "modexp": { + "divisor": 20 } } } }, - "0x0000000000000000000000000000000000000006":{ - "builtin":{ - "name":"alt_bn128_add", - "pricing":{ - "0x0":{ - "price":{ - "alt_bn128_const_operations":{ - "price":500 + "0x0000000000000000000000000000000000000006": { + "builtin": { + "name": "alt_bn128_add", + "pricing": { + "0x0": { + "price": { + "alt_bn128_const_operations": { + "price": 500 } } }, - "0xbe10b":{ - "info":"EIP 1108 transition", - "price":{ - "alt_bn128_const_operations":{ - "price":150 + "0xf422f": { + "info": "EIP 1108 transition", + "price": { + "alt_bn128_const_operations": { + "price": 150 } } } } } }, - "0x0000000000000000000000000000000000000007":{ - "builtin":{ - "name":"alt_bn128_mul", - "pricing":{ - "0x0":{ - "price":{ - "alt_bn128_const_operations":{ - "price":40000 + "0x0000000000000000000000000000000000000007": { + "builtin": { + "name": "alt_bn128_mul", + "pricing": { + "0x0": { + "price": { + "alt_bn128_const_operations": { + "price": 40000 } } }, - "0xbe10b":{ - "info":"EIP 1108 transition", - "price":{ - "alt_bn128_const_operations":{ - "price":6000 + "0xf422f": { + "info": "EIP 1108 transition", + "price": { + "alt_bn128_const_operations": { + "price": 6000 } } } } } }, - "0x0000000000000000000000000000000000000008":{ - "builtin":{ - "name":"alt_bn128_pairing", - "pricing":{ - "0x0":{ - "price":{ - "alt_bn128_pairing":{ - "base":100000, - "pair":80000 + "0x0000000000000000000000000000000000000008": { + "builtin": { + "name": "alt_bn128_pairing", + "pricing": { + "0x0": { + "price": { + "alt_bn128_pairing": { + "base": 100000, + "pair": 80000 } } }, - "0xbe10b":{ - "info":"EIP 1108 transition", - "price":{ - "alt_bn128_pairing":{ - "base":45000, - "pair":34000 + "0xf422f": { + "info": "EIP 1108 transition", + "price": { + "alt_bn128_pairing": { + "base": 45000, + "pair": 34000 } } } @@ -197,7 +217,7 @@ "0x0000000000000000000000000000000000000009": { "builtin": { "name": "blake2_f", - "activate_at": "0xbe10b", + "activate_at": "0xf422f", "pricing": { "blake2_f": { "gas_per_round": 1 From 9da1304539d4182981673711fe7a8bcc20fbbcab Mon Sep 17 00:00:00 2001 From: Kirill Pimenov Date: Fri, 13 Mar 2020 14:41:41 +0100 Subject: [PATCH 08/11] Remove Parity's Security Policy (#11565) OpenEthereum is outside of the current scope for Parity's BugBounty program. Unfortunately, this means that this Security Policy needs to go. I urge other OpenEthereum stakeholders to come up with a replacement policy ASAP, and will glad to provide help in setting those processes up/sharing some templates and accumulated knowledge. --- SECURITY.md | 101 ---------------------------------------------------- 1 file changed, 101 deletions(-) delete mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index c5a3f35fddd..00000000000 --- a/SECURITY.md +++ /dev/null @@ -1,101 +0,0 @@ -# Security Policy - -Parity Technologies is committed to resolving security vulnerabilities in our software quickly and carefully. We take the necessary steps to minimize risk, provide timely information, and deliver vulnerability fixes and mitigations required to address security issues. - -## Reporting a Vulnerability - -Security vulnerabilities in Parity software should be reported by email to security@parity.io. If you think your report might be eligible for the Parity Bug Bounty Program, your email should be send to bugbounty@parity.io. - -Your report should include the following: - -- your name -- description of the vulnerability -- attack scenario (if any) -- components -- reproduction -- other details - -Try to include as much information in your report as you can, including a description of the vulnerability, its potential impact, and steps for reproducing it. Be sure to use a descriptive subject line. - -You'll receive a response to your email within two business days indicating the next steps in handling your report. We encourage finders to use encrypted communication channels to protect the confidentiality of vulnerability reports. You can encrypt your report using our public key. This key is [on MIT's key server](https://pgp.mit.edu/pks/lookup?op=get&search=0x5D0F03018D07DE73) server and reproduced below. - -After the initial reply to your report, our team will endeavor to keep you informed of the progress being made towards a fix. These updates will be sent at least every five business days. - -Thank you for taking the time to responsibly disclose any vulnerabilities you find. - -## Responsible Investigation and Reporting - -Responsible investigation and reporting includes, but isn't limited to, the following: - -- Don't violate the privacy of other users, destroy data, etc. -- Don’t defraud or harm Parity Technologies Ltd or its users during your research; you should make a good faith effort to not interrupt or degrade our services. -- Don't target our physical security measures, or attempt to use social engineering, spam, distributed denial of service (DDOS) attacks, etc. -- Initially report the bug only to us and not to anyone else. -- Give us a reasonable amount of time to fix the bug before disclosing it to anyone else, and give us adequate written warning before disclosing it to anyone else. -- In general, please investigate and report bugs in a way that makes a reasonable, good faith effort not to be disruptive or harmful to us or our users. Otherwise your actions might be interpreted as an attack rather than an effort to be helpful. - -## Bug Bounty Program - -Our Bug Bounty Program allows us to recognise and reward members of the Parity community for helping us find and address significant bugs, in accordance with the terms of the Parity Bug Bounty Program. A detailed description on eligibility, rewards, legal information and terms & conditions for contributors can be found on [our website](https://paritytech.io/bug-bounty.html). - - - - - - -## Plaintext PGP Key - -``` ------BEGIN PGP PUBLIC KEY BLOCK----- - -mQINBF0vHwQBEADKui4qAo4bzdzRhMm+uhUpYGf8jjjmET3zJ8kKQIpp6JTsV+HJ -6m1We0QYeMRXoOYH1xVHBf2zNCuHS0nSQdUCQA7SHWsPB05STa2hvlR7fSdQnCCp -gnLOJWXvvedlRDIAhvqI6cwLdUlXgVSKEwrwmrpiBhh4NxI3qX+LyIa+Ovkchu2S -d/YCnE4GqojSGRfJYiGwe2N+sF7OfaoKhQuTrtdDExHrMU4cWnTXW2wyxTr4xkj9 -jS2WeLVZWflvkDHT8JD9N6jNxBVEF/Qvjk83zI0kCOzkhek8x+YUgfLq3/rHOYbX -3pW21ccHYPacHjHWvKE+xRebjeEhJ4KxKHfCVjQcxybwDBqDka1AniZt4CQ7UORf -MU/ue2oSZ9nNg0uMdb/0AbQPZ04OlMcYPAPWzFL08nVPox9wT9uqlL6JtcOeC90h -oOeDmfgwmjMmdwWTRgt9qQjcbgXzVvuAzIGbzj1X3MdLspWdHs/d2+US4nji1TkN -oYIW7vE+xkd3aB+NZunIlm9Rwd/0mSgDg+DaNa5KceOLhq0/qKgcXC/RRU29I8II -tusRoR/oesGJGYTjh4k6PJkG+nvDPsoQrwYT44bhnniS1xYkxWYXF99JFI7LgMdD -e1SgKeIDVpvm873k82E6arp5655Wod1XOjaXBggCwFp84eKcEZEN+1qEWwARAQAB -tClQYXJpdHkgU2VjdXJpdHkgVGVhbSA8c2VjdXJpdHlAcGFyaXR5LmlvPokCVAQT -AQoAPhYhBJ1LK264+XFW0ZZpqf8IEtSRuWeYBQJdLx8EAhsDBQkDwmcABQsJCAcC -BhUKCQgLAgQWAgMBAh4BAheAAAoJEP8IEtSRuWeYL84QAI6NwnwS561DWYYRAd4y -ocGPr3CnwFSt1GjkSkRy3B+tMhzexBg1y7EbLRUefIrO4LwOlywtRk8tTRGgEI4i -5xRLHbOkeolfgCFSpOj5d8cMKCt5HEIv18hsv6dkrzlSYA5NLX/GRBEh3F/0sGny -vCXapfxa1cx72sU7631JBK7t2Tf+MfwxdfyFZ9TI9WdtP5AfVjgTkIVkEDFcZPTc -n3CYXqTYFIBCNUD8LP4iTi3xUt7pTGJQQoFT8l15nJCgzRYQ+tXpoTRlf+/LtXmw -6iidPV87E06jHdK9666rBouIabAtx7i0/4kwo+bSZ8DiSKRUaehiHGd212HSEmdF -jxquWE4pEzoUowYznhSIfR+WWIqRBHxEYarP4m98Hi+VXZ7Fw1ytzO8+BAKnLXnj -2W2+T9qJks5gqVEoaWNnqpvya6JA11QZvZ0w7Om2carDc2ILNm2Xx9J0mRUye8P0 -KxcgqJuKNGFtugebQAsXagkxOKsdKna1PlDlxEfTf6AgI3ST8qSiMAwaaIMB/REF -VKUapGoslQX4tOCjibI2pzEgE//D8NAaSVu2A9+BUcFERdZRxsI7fydIXNeZ2R46 -N2qfW+DP3YR/14QgdRxDItEavUoE1vByRXwIufKAkVemOZzIoFXKFsDeXwqTVW5i -6CXu6OddZ3QHDiT9TEbRny4QuQINBF0vKCwBEACnP5J7LEGbpxNBrPvGdxZUo0YA -U8RgeKDRPxJTvMo27V1IPZGaKRCRq8LBfg/eHhqZhQ7SLJBjBljd8kuT5dHDBTRe -jE1UIOhmnlSlrEJjAmpVO08irlGpq1o+8mGcvkBsR0poCVjeNeSnwYfRnR+c3GK5 -Er6/JRqfN4mJvnEC9/Pbm6C7ql6YLKxC3yqzF97JL5brbbuozrW7nixY/yAI8619 -VlBIMP7PAUbGcnSQyuV5b/Wr2Sgr6NJclnNSLjh2U9/Du6w/0tDGlMBts8HjRnWJ -BXbkTdQKCTaqgK68kTKSiN1/x+lynxHC2AavMpH/08Kopg2ZCzJowMKIgcB+4Z/I -DJKZWHWKumhaZMGXcWgzgcByog9IpamuROEZFJNEUAFf7YIncEckPSif4looiOdS -VurKZGvYXXaGSsZbGgHxI5CWu7ZxMdLBLvtOcCYmRQrG+g/h+PGU5BT0bNAfNTkm -V3/n1B/TWbpWRmB3AwT2emQivXHkaubGI0VivhaO43AuI9JWoqiMqFtxbuTeoxwD -xlu2Dzcp0v+AR4T5cIG9D5/+yiPc25aIY7cIKxuNFHIDL4td5fwSGC7vU6998PIG -2Y48TGBnw7zpEfDfMayqAeBjX0YU6PTNsvS5O6bP3j4ojTOUYD7Z8QdCvgISDID3 -WMGAdmSwmCRvsQ/OJwARAQABiQI8BBgBCgAmFiEEnUsrbrj5cVbRlmmp/wgS1JG5 -Z5gFAl0vKCwCGwwFCQB2pwAACgkQ/wgS1JG5Z5hdbw//ZqR+JcWm59NUIHjauETJ -sYDYhcAfa3txTacRn5uPz/TQiTd7wZ82+G8Et0ZnpEHy6eWyBqHpG0hiPhFBzxjY -nhjHl8jJeyo2mQIVJhzkL58BHBZk8WM2TlaU7VxZ6TYOmP2y3qf6FD6mCcrQ4Fml -E9f0lyVUoI/5Zs9oF0izRk8vkwaY3UvLM7XEY6nM8GnFG8kaiZMYmx26Zo7Uz31G -7EGGZFsrVDXfNhSJyz79Gyn+Lx9jOTdoR0sH/THYIIosE83awMGE6jKeuDYTbVWu -+ZtHQef+pRteki3wvNLJK+kC1y3BtHqDJS9Lqx0s8SCiVozlC+fZfC9hCtU7bXJK -0UJZ4qjSvj6whzfaNgOZAqJpmwgOnd8W/3YJk1DwUeX98FcU38MR23SOkx2EDdDE -77Kdu62vTs/tLmOTuyKBvYPaHaYulYjQTxurG+o8vhHtaL87ARvuq+83dj+nO5z3 -5O9vkcVJYWjOEnJe7ZvCTxeLJehpCmHIbyUuDx5P24MWVbyXOxIlxNxTqlub5GlW -rQF6Qsa/0k9TRk7Htbct6fAA0/VahJS0g096MrTH8AxBXDNE8lIoNeGikVlaxK9Z -S+aannlWYIJymZ4FygIPPaRlzhAoXBuJd8OaR5giC7dS1xquxKOiQEXTGsLeGFaI -BZYiIhW7GG4ozvKDqyNm4eg= -=yKcB ------END PGP PUBLIC KEY BLOCK----- -``` From 2bcc31928eae46914cdf06e93a145a7da40210d6 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Mon, 16 Mar 2020 19:53:47 +0100 Subject: [PATCH 09/11] [secretstore] create db_version file when database doesn't exist (#11570) Fixes: https://github.com/openethereum/openethereum/issues/11569 --- parity/secretstore/server.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/parity/secretstore/server.rs b/parity/secretstore/server.rs index ee2e25c20f4..4c556adbc92 100644 --- a/parity/secretstore/server.rs +++ b/parity/secretstore/server.rs @@ -134,6 +134,11 @@ mod server { const SECP_TEST_MESSAGE: H256 = H256([1_u8; 32]); + /// Version of the secret store database + const SECRET_STORE_DB_VERSION: &str = "4"; + /// Version file name + const SECRET_STORE_DB_VERSION_FILE_NAME: &str = "db_version"; + fn into_service_contract_address(address: ContractAddress) -> parity_secretstore::ContractAddress { match address { ContractAddress::Registry => parity_secretstore::ContractAddress::Registry, @@ -210,6 +215,13 @@ mod server { cconf.cluster_config.nodes.insert(self_secret.public().clone(), cconf.cluster_config.listener_address.clone()); + // Create a file containing the version of the database of the SecretStore + // when no database exists yet + if std::fs::read_dir(&conf.data_path).map_or(false, |mut list| list.next().is_none ()) { + std::fs::write(std::path::Path::new(&conf.data_path).join(SECRET_STORE_DB_VERSION_FILE_NAME), SECRET_STORE_DB_VERSION) + .map_err(|e| format!("Error creating SecretStore database version file: {}", e))?; + } + let db = parity_secretstore::open_secretstore_db(&conf.data_path)?; let trusted_client = TrustedClient::new(self_secret.clone(), deps.client, deps.sync, deps.miner); let key_server = parity_secretstore::start(trusted_client, self_secret, cconf, db, executor) From 3231454bb1be364c246544c2d26439c52a7daa65 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Tue, 17 Mar 2020 16:43:48 +0100 Subject: [PATCH 10/11] [devp2p discovery]: remove `deprecated_echo_hash` (#11564) Removes support for `deprecated_echo_hash` ping/pong in devp2p-discovery. It will not work with nodes prior to `stable 2.0.5` (#9526) --- util/network-devp2p/src/discovery.rs | 56 ++++++++-------------------- 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/util/network-devp2p/src/discovery.rs b/util/network-devp2p/src/discovery.rs index 2a9820dda6c..987eded7e92 100644 --- a/util/network-devp2p/src/discovery.rs +++ b/util/network-devp2p/src/discovery.rs @@ -131,9 +131,6 @@ struct PingRequest { node: NodeEntry, // The hash sent in the Ping request echo_hash: H256, - // The hash Parity used to respond with (until rev 01f825b0e1f1c4c420197b51fc801cbe89284b29) - #[deprecated()] - deprecated_echo_hash: H256, reason: PingReason } @@ -255,23 +252,17 @@ impl Discovery { }.and_then(|(node_entry, bucket_distance)| { trace!(target: "discovery", "Adding a new node {:?} into our bucket {}", &node_entry, bucket_distance); - let mut added = HashMap::with_capacity(1); - added.insert(node_entry.id, node_entry.clone()); - - let node_to_ping = { - let bucket = &mut self.node_buckets[bucket_distance]; - bucket.nodes.push_front(BucketEntry::new(node_entry.clone())); - if bucket.nodes.len() > BUCKET_SIZE { - select_bucket_ping(bucket.nodes.iter()) - } else { - None + let bucket = &mut self.node_buckets[bucket_distance]; + bucket.nodes.push_front(BucketEntry::new(node_entry.clone())); + if bucket.nodes.len() > BUCKET_SIZE { + if let Some(node) = select_bucket_ping(bucket.nodes.iter()) { + self.try_ping(node, PingReason::Default); } - }; - if let Some(node) = node_to_ping { - self.try_ping(node, PingReason::Default); - }; + } if node_entry.endpoint.is_valid_sync_node() { + let mut added = HashMap::with_capacity(1); + added.insert(node_entry.id, node_entry); Some(TableUpdates { added, removed: HashSet::new() }) } else { None @@ -381,14 +372,12 @@ impl Discovery { self.public_endpoint.to_rlp_list(&mut rlp); node.endpoint.to_rlp_list(&mut rlp); append_expiration(&mut rlp); - let old_parity_hash = keccak(rlp.as_raw()); let hash = self.send_packet(PACKET_PING, node.endpoint.udp_address(), rlp.drain())?; self.in_flight_pings.insert(node.id, PingRequest { sent_at: Instant::now(), node: node.clone(), echo_hash: hash, - deprecated_echo_hash: old_parity_hash, reason, }); @@ -569,28 +558,15 @@ impl Discovery { self.check_timestamp(timestamp)?; let expected_node = match self.in_flight_pings.entry(node_id) { - Entry::Occupied(entry) => { - let expected_node = { - let request = entry.get(); - if request.echo_hash != echo_hash && request.deprecated_echo_hash != echo_hash { - debug!(target: "discovery", "Got unexpected Pong from {:?} ; packet_hash={:#x} ; expected_hash={:#x}", &from, request.echo_hash, echo_hash); - None - } else { - if request.deprecated_echo_hash == echo_hash { - trace!(target: "discovery", "Got Pong from an old open-ethereum version."); - } - Some((request.node.clone(), request.reason)) - } - }; - - if expected_node.is_some() { - entry.remove(); - } - expected_node - }, - Entry::Vacant(_) => { + Entry::Occupied(entry) if entry.get().echo_hash != echo_hash => { + debug!(target: "discovery", "Got unexpected Pong from {:?} ; packet_hash={:#x} ; expected_hash={:#x}", &from, entry.get().echo_hash, echo_hash); None }, + Entry::Occupied(entry) => { + let request = entry.remove(); + Some((request.node, request.reason)) + }, + Entry::Vacant(_) => None, }; if let Some((node, ping_reason)) = expected_node { @@ -606,7 +582,7 @@ impl Discovery { debug!(target: "discovery", "Error occured when processing ping from a bucket node: {:?}", &error); }); }, - NodeValidity::UnknownNode | NodeValidity::ExpiredNode(NodeCategory::Observed) | NodeValidity::ValidNode(NodeCategory::Observed)=> { + NodeValidity::UnknownNode | NodeValidity::ExpiredNode(NodeCategory::Observed) | NodeValidity::ValidNode(NodeCategory::Observed) => { trace!(target: "discovery", "Updating node {:?} in the list of other_observed_nodes", &node); self.other_observed_nodes.insert(node.id, (node.endpoint, Instant::now())); }, From 70c4ed7fa0e97022ff9037e5e80f9fa2c046bb1e Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 17 Mar 2020 16:44:27 +0100 Subject: [PATCH 11/11] informant: display I/O stats (#11523) * informant: collect I/O stats for state_db * informat: debug i/o log * informat: remove unused cache hit ratio * Cargo.lock: cargo update -p librocksdb-sys * [deps]: upgrade kvdb-rocksdb to 0.6 * Update ethcore/types/src/client_types.rs Co-Authored-By: David Co-authored-by: David --- Cargo.lock | 100 +++++++++++++++------ Cargo.toml | 2 +- ethcore/Cargo.toml | 4 +- ethcore/service/Cargo.toml | 2 +- ethcore/snapshot/Cargo.toml | 2 +- ethcore/snapshot/snapshot-tests/Cargo.toml | 2 +- ethcore/src/client/client.rs | 16 +++- ethcore/types/src/client_types.rs | 21 +++++ ethcore/verification/src/queue/mod.rs | 2 +- parity/informant.rs | 8 ++ util/journaldb/src/archivedb.rs | 4 + util/journaldb/src/earlymergedb.rs | 4 + util/journaldb/src/lib.rs | 3 + util/journaldb/src/overlayrecentdb.rs | 4 + util/journaldb/src/refcounteddb.rs | 4 + util/migration-rocksdb/Cargo.toml | 2 +- 16 files changed, 144 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 246f9bfd376..743e8f8c7b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -313,23 +313,24 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.49.2" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "846a1fba6535362a01487ef6b10f0275faa12e5c5d835c5c1c627aabc46ccbd6" +checksum = "6bb26d6a69a335b8cb0e7c7e9775cd5666611dc50a37177c3f2cedcfc040e8c8" dependencies = [ "bitflags", "cexpr", "cfg-if", "clang-sys", "clap", - "env_logger 0.6.2", - "fxhash", + "env_logger 0.7.1", "lazy_static", + "lazycell", "log", "peeking_take_while", - "proc-macro2 0.4.20", - "quote 0.6.8", + "proc-macro2 1.0.8", + "quote 1.0.2", "regex", + "rustc-hash", "shlex", "which", ] @@ -534,11 +535,11 @@ dependencies = [ [[package]] name = "cexpr" -version = "0.3.6" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" +checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" dependencies = [ - "nom", + "nom 5.1.1", ] [[package]] @@ -568,9 +569,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "0.28.1" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" +checksum = "f92986241798376849e1a007827041fed9bb36195822c2049d18e174420e0534" dependencies = [ "glob", "libc", @@ -1089,6 +1090,19 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + [[package]] name = "error-chain" version = "0.12.0" @@ -1217,7 +1231,7 @@ dependencies = [ "keccak-hash", "kvdb", "kvdb-memorydb", - "kvdb-rocksdb", + "kvdb-rocksdb 0.6.0", "lazy_static", "log", "machine", @@ -1583,7 +1597,7 @@ dependencies = [ "ethcore-sync", "ethereum-types", "kvdb", - "kvdb-rocksdb", + "kvdb-rocksdb 0.6.0", "log", "snapshot", "spec", @@ -2166,9 +2180,9 @@ checksum = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" [[package]] name = "humantime" -version = "1.1.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" dependencies = [ "quick-error", ] @@ -2599,6 +2613,25 @@ dependencies = [ "smallvec 1.2.0", ] +[[package]] +name = "kvdb-rocksdb" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fecd50b14a534125228d7039951f92aaff742aff151c04546347aba4d3b4fbc" +dependencies = [ + "fs-swap", + "interleaved-ordered", + "kvdb", + "log", + "num_cpus", + "owning_ref 0.4.0", + "parity-util-mem", + "parking_lot 0.10.0", + "regex", + "rocksdb", + "smallvec 1.2.0", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -2636,9 +2669,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "6.2.4" +version = "6.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0785e816e1e11e7599388a492c61ef80ddc2afc91e313e61662cce537809be" +checksum = "4e3b727e2dd20ec2fb7ed93f23d9fd5328a0871185485ebdaff007b47d3e27e4" dependencies = [ "bindgen", "cc", @@ -2855,7 +2888,7 @@ name = "migration-rocksdb" version = "0.1.0" dependencies = [ "kvdb", - "kvdb-rocksdb", + "kvdb-rocksdb 0.6.0", "log", "maplit", "tempdir", @@ -3019,6 +3052,16 @@ dependencies = [ "version_check 0.1.5", ] +[[package]] +name = "nom" +version = "5.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b471253da97532da4b61552249c521e01e736071f71c1a4f7ebbfbf0a06aad6" +dependencies = [ + "memchr", + "version_check 0.9.1", +] + [[package]] name = "null-engine" version = "0.1.0" @@ -3169,7 +3212,7 @@ dependencies = [ "jsonrpc-core", "keccak-hash", "kvdb", - "kvdb-rocksdb", + "kvdb-rocksdb 0.6.0", "log", "migration-rocksdb", "node-filter", @@ -3468,7 +3511,7 @@ dependencies = [ "jsonrpc-server-utils", "keccak-hash", "kvdb", - "kvdb-rocksdb", + "kvdb-rocksdb 0.5.0", "lazy_static", "libsecp256k1", "log", @@ -4321,6 +4364,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hex" version = "1.0.0" @@ -4631,7 +4680,7 @@ dependencies = [ "keccak-hash", "keccak-hasher 0.1.1", "kvdb", - "kvdb-rocksdb", + "kvdb-rocksdb 0.6.0", "lazy_static", "log", "num_cpus", @@ -4677,7 +4726,7 @@ dependencies = [ "keccak-hash", "keccak-hasher 0.1.1", "kvdb", - "kvdb-rocksdb", + "kvdb-rocksdb 0.6.0", "lazy_static", "log", "parity-bytes", @@ -5783,16 +5832,15 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bb43f70885151e629e2a19ce9e50bd730fd436cfd4b666894c9ce4de9141164" dependencies = [ - "nom", + "nom 4.2.3", ] [[package]] name = "which" -version = "2.0.1" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164" +checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" dependencies = [ - "failure", "libc", ] diff --git a/Cargo.toml b/Cargo.toml index c6398e07991..37388ad3e5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ journaldb = { path = "util/journaldb" } jsonrpc-core = "14.0.3" keccak-hash = "0.4.0" kvdb = "0.4.0" -kvdb-rocksdb = "0.5.0" +kvdb-rocksdb = "0.6.0" log = "0.4" migration-rocksdb = { path = "util/migration-rocksdb" } node-filter = { path = "ethcore/node-filter" } diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index c6d09a6ba9c..d11a6df2d69 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -33,7 +33,7 @@ journaldb = { path = "../util/journaldb" } keccak-hash = "0.4.0" kvdb = "0.4.0" kvdb-memorydb = { version = "0.4.0", optional = true } -kvdb-rocksdb = { version = "0.5.0", optional = true } +kvdb-rocksdb = { version = "0.6.0", optional = true } lazy_static = { version = "1.3", optional = true } log = "0.4" machine = { path = "./machine" } @@ -78,7 +78,7 @@ ethjson = { path = "../json", features = ["test-helpers"] } parity-crypto = { version = "0.5.0", features = ["publickey"] } fetch = { path = "../util/fetch" } kvdb-memorydb = "0.4.0" -kvdb-rocksdb = "0.5.0" +kvdb-rocksdb = "0.6.0" lazy_static = "1.3" machine = { path = "./machine", features = ["test-helpers"] } parity-runtime = "0.1.1" diff --git a/ethcore/service/Cargo.toml b/ethcore/service/Cargo.toml index d9b158682fc..5e8c0c789b2 100644 --- a/ethcore/service/Cargo.toml +++ b/ethcore/service/Cargo.toml @@ -23,5 +23,5 @@ trace-time = "0.1" [dev-dependencies] ethcore = { path = "..", features = ["test-helpers"] } ethcore-db = { path = "../db" } -kvdb-rocksdb = "0.5.0" +kvdb-rocksdb = "0.6.0" tempdir = "0.3" diff --git a/ethcore/snapshot/Cargo.toml b/ethcore/snapshot/Cargo.toml index 6e132b5259c..c9ac9e045d3 100644 --- a/ethcore/snapshot/Cargo.toml +++ b/ethcore/snapshot/Cargo.toml @@ -53,7 +53,7 @@ ethabi-contract = "9.0.0" ethabi-derive = "9.0.1" ethcore = { path = "..", features = ["test-helpers"] } ethkey = { path = "../../accounts/ethkey" } -kvdb-rocksdb = "0.5.0" +kvdb-rocksdb = "0.6.0" lazy_static = { version = "1.3" } spec = { path = "../spec" } tempdir = "0.3" diff --git a/ethcore/snapshot/snapshot-tests/Cargo.toml b/ethcore/snapshot/snapshot-tests/Cargo.toml index 2761a815892..56be57d4379 100644 --- a/ethcore/snapshot/snapshot-tests/Cargo.toml +++ b/ethcore/snapshot/snapshot-tests/Cargo.toml @@ -24,7 +24,7 @@ journaldb = { path = "../../../util/journaldb" } keccak-hash = "0.4.0" keccak-hasher = { path = "../../../util/keccak-hasher" } kvdb = "0.4.0" -kvdb-rocksdb = "0.5.0" +kvdb-rocksdb = "0.6.0" log = "0.4.8" parking_lot = "0.10.0" parity-crypto = { version = "0.5.0", features = ["publickey"] } diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 06206dc1ddd..5303b8582fb 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -109,7 +109,7 @@ use types::{ BlockNumber, call_analytics::CallAnalytics, chain_notify::{ChainMessageType, ChainRoute, NewBlocks}, - client_types::{ClientReport, Mode, StateResult}, + client_types::{ClientReport, IoStats, Mode, StateResult}, encoded, engines::{ epoch::{PendingTransition, Transition as EpochTransition}, @@ -1096,7 +1096,19 @@ impl Client { /// Get the report. pub fn report(&self) -> ClientReport { let mut report = self.report.read().clone(); - report.state_db_mem = self.state_db.read().mem_used(); + let state_db = self.state_db.read(); + report.state_db_mem = state_db.mem_used(); + let io_stats = state_db.journal_db().io_stats(); + report.io_stats = IoStats { + transactions: io_stats.transactions, + reads: io_stats.reads, + cache_reads: io_stats.cache_reads, + writes: io_stats.writes, + bytes_read: io_stats.bytes_read, + cache_read_bytes: io_stats.cache_read_bytes, + bytes_written: io_stats.bytes_written, + }; + report } diff --git a/ethcore/types/src/client_types.rs b/ethcore/types/src/client_types.rs index 0d5f68dc8f9..9a163f4bc5a 100644 --- a/ethcore/types/src/client_types.rs +++ b/ethcore/types/src/client_types.rs @@ -62,6 +62,27 @@ pub struct ClientReport { pub gas_processed: U256, /// Memory used by state DB pub state_db_mem: usize, + /// I/O statistics for the state DB. + pub io_stats: IoStats, +} + +/// I/O statistics. +#[derive(Default, Debug, Clone, Eq, PartialEq)] +pub struct IoStats { + /// Number of transaction. + pub transactions: u64, + /// Number of read operations. + pub reads: u64, + /// Number of reads resulted in a read from cache. + pub cache_reads: u64, + /// Number of write operations. + pub writes: u64, + /// Number of bytes read. + pub bytes_read: u64, + /// Number of bytes read from cache. + pub cache_read_bytes: u64, + /// Number of bytes write. + pub bytes_written: u64, } impl ClientReport { diff --git a/ethcore/verification/src/queue/mod.rs b/ethcore/verification/src/queue/mod.rs index 341682172cc..194311c1fae 100644 --- a/ethcore/verification/src/queue/mod.rs +++ b/ethcore/verification/src/queue/mod.rs @@ -234,7 +234,7 @@ impl VerificationQueue { let number_of_threads = if scale_verifiers { max_verifiers } else { - cmp::min(default_amount, max_verifiers) + default_amount }; let state = Arc::new((Mutex::new(State::Work(default_amount)), Condvar::new())); diff --git a/parity/informant.rs b/parity/informant.rs index 8710803093f..d4e81deda2d 100644 --- a/parity/informant.rs +++ b/parity/informant.rs @@ -257,6 +257,14 @@ impl Informant { (diffed, full_report) }; + debug!( + target: "io_stats", + "{} reads, {} writes, {} transactions", + client_report.io_stats.reads, + client_report.io_stats.writes, + client_report.io_stats.transactions, + ); + let Report { importing, chain_info, diff --git a/util/journaldb/src/archivedb.rs b/util/journaldb/src/archivedb.rs index 0da2dac0c49..1b68e32f6fc 100644 --- a/util/journaldb/src/archivedb.rs +++ b/util/journaldb/src/archivedb.rs @@ -102,6 +102,10 @@ impl JournalDB for ArchiveDB { Box::new(self.clone()) } + fn io_stats(&self) -> kvdb::IoStats { + self.backing.io_stats(kvdb::IoStatsKind::SincePrevious) + } + fn mem_used(&self) -> usize { self.overlay.malloc_size_of() } diff --git a/util/journaldb/src/earlymergedb.rs b/util/journaldb/src/earlymergedb.rs index 9fc873db1c2..0f2a6130657 100644 --- a/util/journaldb/src/earlymergedb.rs +++ b/util/journaldb/src/earlymergedb.rs @@ -322,6 +322,10 @@ impl JournalDB for EarlyMergeDB { Box::new(self.clone()) } + fn io_stats(&self) -> kvdb::IoStats { + self.backing.io_stats(kvdb::IoStatsKind::SincePrevious) + } + fn is_empty(&self) -> bool { self.backing.get(self.column, &LATEST_ERA_KEY).expect("Low level database error").is_none() } diff --git a/util/journaldb/src/lib.rs b/util/journaldb/src/lib.rs index b2dea0b205c..e18e94646f6 100644 --- a/util/journaldb/src/lib.rs +++ b/util/journaldb/src/lib.rs @@ -45,6 +45,9 @@ pub trait JournalDB: HashDB { /// Returns heap memory size used fn mem_used(&self) -> usize; + /// Returns the I/O statistics. + fn io_stats(&self) -> kvdb::IoStats; + /// Returns the size of journalled state in memory. /// This function has a considerable speed requirement -- /// it must be fast enough to call several times per block imported. diff --git a/util/journaldb/src/overlayrecentdb.rs b/util/journaldb/src/overlayrecentdb.rs index 11643fdac2b..62e7d43e8e0 100644 --- a/util/journaldb/src/overlayrecentdb.rs +++ b/util/journaldb/src/overlayrecentdb.rs @@ -244,6 +244,10 @@ impl JournalDB for OverlayRecentDB { Box::new(self.clone()) } + fn io_stats(&self) -> kvdb::IoStats { + self.backing.io_stats(kvdb::IoStatsKind::SincePrevious) + } + fn mem_used(&self) -> usize { let mut ops = new_malloc_size_ops(); let mut mem = self.transaction_overlay.size_of(&mut ops); diff --git a/util/journaldb/src/refcounteddb.rs b/util/journaldb/src/refcounteddb.rs index 891c3c5860d..ea278a6ac18 100644 --- a/util/journaldb/src/refcounteddb.rs +++ b/util/journaldb/src/refcounteddb.rs @@ -98,6 +98,10 @@ impl JournalDB for RefCountedDB { Box::new(self.clone()) } + fn io_stats(&self) -> kvdb::IoStats { + self.backing.io_stats(kvdb::IoStatsKind::SincePrevious) + } + fn mem_used(&self) -> usize { let mut ops = new_malloc_size_ops(); self.inserts.size_of(&mut ops) + self.removes.size_of(&mut ops) diff --git a/util/migration-rocksdb/Cargo.toml b/util/migration-rocksdb/Cargo.toml index 1748b4b1586..5d5cd40d8ca 100644 --- a/util/migration-rocksdb/Cargo.toml +++ b/util/migration-rocksdb/Cargo.toml @@ -8,7 +8,7 @@ license = "GPL-3.0" [dependencies] log = "0.4" kvdb = "0.4.0" -kvdb-rocksdb = "0.5.0" +kvdb-rocksdb = "0.6.0" [dev-dependencies] tempdir = "0.3"