Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6c55469c9 | ||
|
|
94164e1ca5 | ||
|
|
9bb75d8dda | ||
|
|
e78a9872c0 | ||
|
|
76d4064a4c | ||
|
|
a03cf2ed43 | ||
|
|
b6a764deb2 | ||
|
|
8f6911af20 | ||
|
|
d30610621f | ||
|
|
33860c3f32 | ||
|
|
e1c1ecf0a5 | ||
|
|
72c8b79035 | ||
|
|
c7d8ee1dd7 | ||
|
|
ce9f4c65d3 | ||
|
|
ab0ad1925b |
37
.github/CONTRIBUTING.md
vendored
37
.github/CONTRIBUTING.md
vendored
@@ -24,42 +24,7 @@ Also, try to include **steps to reproduce** the issue and expand on the **actual
|
||||
|
||||
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/paritytech/parity-ethereum/compare).
|
||||
|
||||
### Labels & Milestones
|
||||
|
||||
We use [labels](https://github.com/paritytech/parity-ethereum/labels) to manage PRs and issues and communicate the state of a PR. Please familiarize yourself with them. Furthermore we are organizing issues in [milestones](https://github.com/paritytech/parity-ethereum/milestones). Best way to get started is to a pick a ticket from the current milestone tagged [`easy`](https://github.com/paritytech/parity-ethereum/labels/Q2-easy%20%F0%9F%92%83) and get going, or [`mentor`](https://github.com/paritytech/parity-ethereum/labels/Q1-mentor%20%F0%9F%95%BA) and get in contact with the mentor offering their support on that larger task.
|
||||
|
||||
### Rules
|
||||
|
||||
There are a few basic ground-rules for contributors (including the maintainer(s) of the project):
|
||||
|
||||
* **No pushing directly to the master branch**.
|
||||
* **All modifications** must be made in a **pull-request** to solicit feedback from other contributors.
|
||||
* Pull-requests cannot be merged before CI runs green and two reviewers have given their approval.
|
||||
* Contributors should adhere to the [Parity Ethereum Style Guide](https://wiki.parity.io/Parity-Ethereum-Style-Guide).
|
||||
|
||||
### 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 `<GITHUB_USERNAME>-<ISSUE_ID>-<BRIEF_DESCRIPTION>` (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/paritytech/parity-ethereum/projects).
|
||||
* **Remove stale branches periodically**
|
||||
|
||||
### Preparing Pull Requests
|
||||
|
||||
* If your PR does not alter any logic (e.g. comments, dependencies, docs), then it may be tagged [`insubstantial`](https://github.com/paritytech/parity-ethereum/pulls?q=is%3Aopen+is%3Apr+label%3A%22A2-insubstantial+%F0%9F%91%B6%22).
|
||||
|
||||
* Once a PR is ready for review please add the [`pleasereview`](https://github.com/paritytech/parity-ethereum/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+label%3A%22A0-pleasereview+%F0%9F%A4%93%22+) label.
|
||||
|
||||
### Reviewing Pull Requests*:
|
||||
|
||||
* At least two reviewers are required to review PRs (even for PRs tagged [`insubstantial`](https://github.com/paritytech/parity-ethereum/pulls?q=is%3Aopen+is%3Apr+label%3A%22A2-insubstantial+%F0%9F%91%B6%22)).
|
||||
|
||||
When doing a review, make sure to look for any:
|
||||
|
||||
* Buggy behavior.
|
||||
* Undue maintenance burden.
|
||||
* Breaking with house coding style.
|
||||
* Pessimization (i.e. reduction of speed as measured in the projects benchmarks).
|
||||
* Breaking changes should be carefuly reviewed and tagged as such so they end up in the [changelog](../CHANGELOG.md).
|
||||
* Uselessness (i.e. it does not strictly add a feature or fix a known issue).
|
||||
Please, refer to the [Coding Guide](https://wiki.parity.io/Coding-guide) in our wiki for more details about hacking on Parity.
|
||||
|
||||
## License.
|
||||
|
||||
|
||||
107
.gitlab-ci.yml
107
.gitlab-ci.yml
@@ -13,6 +13,10 @@ variables:
|
||||
SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache"
|
||||
CARGO_TARGET: x86_64-unknown-linux-gnu
|
||||
|
||||
.no_git: &no_git # disable git strategy
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
GIT_SUBMODULE_STRATEGY: none
|
||||
|
||||
.releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries")
|
||||
only: &releaseable_branches
|
||||
@@ -42,7 +46,7 @@ variables:
|
||||
sccache --start-server
|
||||
- sccache -s
|
||||
after_script:
|
||||
# sccache debug info
|
||||
# sccache debug info
|
||||
- if test -e sccache_debug.log;
|
||||
then
|
||||
echo "_____All crate-types:_____";
|
||||
@@ -143,32 +147,32 @@ test-linux-nightly:
|
||||
|
||||
build-android:
|
||||
<<: *build-on-linux
|
||||
image: parity/parity-ci-android:stretch
|
||||
image: parity/rust-parity-ethereum-android-build:stretch
|
||||
variables:
|
||||
CARGO_TARGET: armv7-linux-androideabi
|
||||
|
||||
build-linux:
|
||||
<<: *build-on-linux
|
||||
# only: *releaseable_branches
|
||||
only: *releaseable_branches
|
||||
|
||||
build-linux-i386:
|
||||
<<: *build-on-linux
|
||||
only: *releaseable_branches
|
||||
image: parity/parity-ci-i386:latest
|
||||
image: parity/rust-parity-ethereum-build:i386
|
||||
variables:
|
||||
CARGO_TARGET: i686-unknown-linux-gnu
|
||||
|
||||
build-linux-arm64:
|
||||
<<: *build-on-linux
|
||||
only: *releaseable_branches
|
||||
image: parity/parity-ci-arm64:latest
|
||||
image: parity/rust-parity-ethereum-build:arm64
|
||||
variables:
|
||||
CARGO_TARGET: aarch64-unknown-linux-gnu
|
||||
|
||||
build-linux-armhf:
|
||||
<<: *build-on-linux
|
||||
only: *releaseable_branches
|
||||
image: parity/parity-ci-armhf:latest
|
||||
image: parity/rust-parity-ethereum-build:armhf
|
||||
variables:
|
||||
CARGO_TARGET: armv7-unknown-linux-gnueabihf
|
||||
|
||||
@@ -201,10 +205,11 @@ build-windows:
|
||||
|
||||
publish-docker:
|
||||
stage: publish
|
||||
<<: *no_git
|
||||
only: *releaseable_branches
|
||||
except:
|
||||
- nightly
|
||||
when: manual
|
||||
variables:
|
||||
- $SCHEDULE_TAG == "nightly"
|
||||
dependencies:
|
||||
- build-linux
|
||||
environment:
|
||||
@@ -214,24 +219,23 @@ publish-docker:
|
||||
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:
|
||||
# we stopped pushing nightlies to dockerhub, will push to own registry prb.
|
||||
- ./tools/publish-docker.sh
|
||||
tags:
|
||||
- kubernetes-parity-build
|
||||
|
||||
publish-snap-nightly: &publish-snap
|
||||
publish-snap: &publish-snap
|
||||
stage: publish
|
||||
only:
|
||||
- nightly
|
||||
<<: *no_git
|
||||
only: *releaseable_branches
|
||||
image: snapcore/snapcraft
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
BUILD_ARCH: amd64
|
||||
cache: {}
|
||||
dependencies:
|
||||
@@ -241,12 +245,7 @@ publish-snap-nightly: &publish-snap
|
||||
script:
|
||||
- ./tools/publish-snap.sh
|
||||
|
||||
publish-snap-manually:
|
||||
<<: *publish-snap
|
||||
only: *releaseable_branches
|
||||
when: manual
|
||||
|
||||
publish-snap-i386-nightly: &publish-snap-i386
|
||||
publish-snap-i386:
|
||||
<<: *publish-snap
|
||||
variables:
|
||||
BUILD_ARCH: i386
|
||||
@@ -254,12 +253,7 @@ publish-snap-i386-nightly: &publish-snap-i386
|
||||
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-arm64:
|
||||
<<: *publish-snap
|
||||
variables:
|
||||
BUILD_ARCH: arm64
|
||||
@@ -267,12 +261,7 @@ publish-snap-arm64-nightly: &publish-snap-arm64
|
||||
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-armhf:
|
||||
<<: *publish-snap
|
||||
variables:
|
||||
BUILD_ARCH: armhf
|
||||
@@ -280,18 +269,11 @@ publish-snap-armhf-nightly: &publish-snap-armhf
|
||||
dependencies:
|
||||
- build-linux-armhf
|
||||
|
||||
publish-snap-armhf-manually:
|
||||
<<: *publish-snap-armhf
|
||||
only: *releaseable_branches
|
||||
when: manual
|
||||
|
||||
publish-onchain-nightly: &publish-onchain
|
||||
publish-onchain:
|
||||
stage: publish
|
||||
only:
|
||||
- nightly
|
||||
<<: *no_git
|
||||
only: *releaseable_branches
|
||||
cache: {}
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
dependencies:
|
||||
- build-linux
|
||||
- build-darwin
|
||||
@@ -301,18 +283,11 @@ publish-onchain-nightly: &publish-onchain
|
||||
tags:
|
||||
- linux-docker
|
||||
|
||||
publish-onchain-manually:
|
||||
<<: *publish-onchain
|
||||
only: *releaseable_branches
|
||||
when: manual
|
||||
|
||||
publish-release-awss3-nightly: &publish-release-awss3
|
||||
publish-awss3-release:
|
||||
image: parity/awscli:latest
|
||||
stage: publish
|
||||
only:
|
||||
- nightly
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
only: *releaseable_branches
|
||||
<<: *no_git
|
||||
cache: {}
|
||||
dependencies:
|
||||
- build-linux
|
||||
@@ -334,39 +309,17 @@ publish-release-awss3-nightly: &publish-release-awss3
|
||||
tags:
|
||||
- linux-docker
|
||||
|
||||
publish-release-awss3-manually:
|
||||
<<: *publish-release-awss3
|
||||
only: *releaseable_branches
|
||||
when: manual
|
||||
|
||||
publish-docs:
|
||||
stage: publish
|
||||
image: parity/parity-ci-docs:latest
|
||||
stage: publish
|
||||
image: parity/rust-parity-ethereum-docs:xenial
|
||||
only:
|
||||
- tags
|
||||
except:
|
||||
- nightly
|
||||
when: manual
|
||||
cache: {}
|
||||
dependencies: []
|
||||
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
|
||||
|
||||
290
CHANGELOG.md
290
CHANGELOG.md
@@ -1,130 +1,174 @@
|
||||
## Parity-Ethereum [v2.5.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.8)
|
||||
## Parity-Ethereum [v2.3.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.0) (2019-01-16)
|
||||
|
||||
Parity Ethereum v2.5.8-stable is a patch release that improves security, stability and performance.
|
||||
Parity-Ethereum 2.3.0-beta is a consensus-relevant security release that reverts Constantinople on the Ethereum network. Upgrading is mandatory for Ethereum, and strongly recommended for other networks.
|
||||
|
||||
* The most noteworthy improvement in this release is incorporating all the EIPs required for the Istanbul hard fork.
|
||||
* This release also fixes certain security and performance issues, one of which was suspected to be consensus-threatening but turned out to be benign. Thanks to Martin Holst Swende and Felix Lange from the Ethereum Foundation for bringing the suspicious issue to our attention.
|
||||
- **Consensus** - Ethereum Network: Pull Constantinople protocol upgrade on Ethereum (#10189)
|
||||
- Read more: [Security Alert: Ethereum Constantinople Postponement](https://blog.ethereum.org/2019/01/15/security-alert-ethereum-constantinople-postponement/)
|
||||
- **Networking** - All networks: Ping nodes from discovery (#10167)
|
||||
- **Wasm** - Kovan Network: Update pwasm-utils to 0.6.1 (#10134)
|
||||
|
||||
Other notable changes:
|
||||
|
||||
- Existing blocks in the database are now kept when restoring a Snapshot. (#8643)
|
||||
- Block and transaction propagation is improved significantly. (#9954)
|
||||
- The ERC-191 Signed Data Standard is now supported by `personal_sign191`. (#9701)
|
||||
- Add support for ERC-191/712 `eth_signTypedData` as a standard for machine-verifiable and human-readable typed data signing with Ethereum keys. (#9631)
|
||||
- Add support for ERC-1186 `eth_getProof` (#9001)
|
||||
- Add experimental RPCs flag to enable ERC-191, ERC-712, and ERC-1186 APIs via `--jsonrpc-experimental` (#9928)
|
||||
- Make `CALLCODE` to trace value to be the code address. (#9881)
|
||||
|
||||
Configuration changes:
|
||||
|
||||
- The EIP-98 transition is now disabled by default. If you previously had no `eip98transition` specified in your chain specification, you would enable this now manually on block `0x0`. (#9955)
|
||||
- Also, unknown fields in chain specs are now rejected. (#9972)
|
||||
- The Tendermint engine was removed from Parity Ethereum and is no longer available and maintained. (#9980)
|
||||
- Ropsten testnet data and keys moved from `test/` to `ropsten/` subdir. To reuse your old keys and data either copy or symlink them to the new location. (#10123)
|
||||
- Strict empty steps validation (#10041)
|
||||
- If you have a chain with`empty_steps` already running, some blocks most likely contain non-strict entries (unordered or duplicated empty steps). In this release `strict_empty_steps_transition` is enabled by default at block `0x0` for any chain with `empty_steps`.
|
||||
- If your network uses `empty_steps` you **must** (A) plan a hard fork and change `strict_empty_steps_transition` to the desired fork block and (B) update the clients of the whole network to 2.2.7-stable / 2.3.0-beta. If for some reason you don't want to do this please set`strict_empty_steps_transition` to `0xfffffffff` to disable it.
|
||||
|
||||
_Note:_ This release marks Parity 2.3 as _beta_. All versions of Parity 2.2 are now considered _stable_.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* add more tx tests (#11038)
|
||||
* Fix parallel transactions race-condition (#10995)
|
||||
* Add blake2_f precompile (#11017)
|
||||
* [trace] introduce trace failed to Ext (#11019)
|
||||
* Edit publish-onchain.sh to use https (#11016)
|
||||
* Fix deadlock in network-devp2p (#11013)
|
||||
* EIP 1108: Reduce alt_bn128 precompile gas costs (#11008)
|
||||
* xDai chain support and nodes list update (#10989)
|
||||
* EIP 2028: transaction gas lowered from 68 to 16 (#10987)
|
||||
* EIP-1344 Add CHAINID op-code (#10983)
|
||||
* manual publish jobs for releases, no changes for nightlies (#10977)
|
||||
* [blooms-db] Fix benchmarks (#10974)
|
||||
* Verify transaction against its block during import (#10954)
|
||||
* Better error message for rpc gas price errors (#10931)
|
||||
* tx-pool: accept local tx with higher gas price when pool full (#10901)
|
||||
* Fix fork choice (#10837)
|
||||
* Cleanup unused vm dependencies (#10787)
|
||||
* Fix compilation on recent nightlies (#10991)
|
||||
* Don't build rpc with ethcore test-helpers (#11048)
|
||||
* EIP 1884 Re-pricing of trie-size dependent operations (#10992)
|
||||
* Implement EIP-1283 reenable transition, EIP-1706 and EIP-2200 (#10191)
|
||||
- Backports for 2.3.0 beta ([#10164](https://github.com/paritytech/parity-ethereum/pull/10164))
|
||||
- Snap: fix path in script ([#10157](https://github.com/paritytech/parity-ethereum/pull/10157))
|
||||
- Make sure parent block is not in importing queue when importing ancient blocks ([#10138](https://github.com/paritytech/parity-ethereum/pull/10138))
|
||||
- Ci: re-enable snap publishing ([#10142](https://github.com/paritytech/parity-ethereum/pull/10142))
|
||||
- Hf in POA Core (2019-01-18) - Constantinople ([#10155](https://github.com/paritytech/parity-ethereum/pull/10155))
|
||||
- Update EWF's tobalaba chainspec ([#10152](https://github.com/paritytech/parity-ethereum/pull/10152))
|
||||
- Replace ethcore-logger with env-logger. ([#10102](https://github.com/paritytech/parity-ethereum/pull/10102))
|
||||
- Finality: dont require chain head to be in the chain ([#10054](https://github.com/paritytech/parity-ethereum/pull/10054))
|
||||
- Remove caching for node connections ([#10143](https://github.com/paritytech/parity-ethereum/pull/10143))
|
||||
- Blooms file iterator empty on out of range position. ([#10145](https://github.com/paritytech/parity-ethereum/pull/10145))
|
||||
- Autogen docs for the "Configuring Parity Ethereum" wiki page. ([#10067](https://github.com/paritytech/parity-ethereum/pull/10067))
|
||||
- Misc: bump license header to 2019 ([#10135](https://github.com/paritytech/parity-ethereum/pull/10135))
|
||||
- Hide most of the logs from cpp example. ([#10139](https://github.com/paritytech/parity-ethereum/pull/10139))
|
||||
- Don't try to send oversized packets ([#10042](https://github.com/paritytech/parity-ethereum/pull/10042))
|
||||
- Private tx enabled flag added into STATUS packet ([#9999](https://github.com/paritytech/parity-ethereum/pull/9999))
|
||||
- Update pwasm-utils to 0.6.1 ([#10134](https://github.com/paritytech/parity-ethereum/pull/10134))
|
||||
- Extract blockchain from ethcore ([#10114](https://github.com/paritytech/parity-ethereum/pull/10114))
|
||||
- Ethcore: update hardcoded headers ([#10123](https://github.com/paritytech/parity-ethereum/pull/10123))
|
||||
- Identity fix ([#10128](https://github.com/paritytech/parity-ethereum/pull/10128))
|
||||
- Use LenCachingMutex to optimize verification. ([#10117](https://github.com/paritytech/parity-ethereum/pull/10117))
|
||||
- Pyethereum keystore support ([#9710](https://github.com/paritytech/parity-ethereum/pull/9710))
|
||||
- Bump rocksdb-sys to 0.5.5 ([#10124](https://github.com/paritytech/parity-ethereum/pull/10124))
|
||||
- Parity-clib: `async C bindings to RPC requests` + `subscribe/unsubscribe to websocket events` ([#9920](https://github.com/paritytech/parity-ethereum/pull/9920))
|
||||
- Refactor (hardware wallet) : reduce the number of threads ([#9644](https://github.com/paritytech/parity-ethereum/pull/9644))
|
||||
- Hf in POA Sokol (2019-01-04) ([#10077](https://github.com/paritytech/parity-ethereum/pull/10077))
|
||||
- Fix broken links ([#10119](https://github.com/paritytech/parity-ethereum/pull/10119))
|
||||
- Follow-up to [#10105](https://github.com/paritytech/parity-ethereum/issues/10105) ([#10107](https://github.com/paritytech/parity-ethereum/pull/10107))
|
||||
- Move EIP-712 crate back to parity-ethereum ([#10106](https://github.com/paritytech/parity-ethereum/pull/10106))
|
||||
- Move a bunch of stuff around ([#10101](https://github.com/paritytech/parity-ethereum/pull/10101))
|
||||
- Revert "Add --frozen when running cargo ([#10081](https://github.com/paritytech/parity-ethereum/pull/10081))" ([#10105](https://github.com/paritytech/parity-ethereum/pull/10105))
|
||||
- Fix left over small grumbles on whitespaces ([#10084](https://github.com/paritytech/parity-ethereum/pull/10084))
|
||||
- Add --frozen when running cargo ([#10081](https://github.com/paritytech/parity-ethereum/pull/10081))
|
||||
- Fix pubsub new_blocks notifications to include all blocks ([#9987](https://github.com/paritytech/parity-ethereum/pull/9987))
|
||||
- Update some dependencies for compilation with pc-windows-gnu ([#10082](https://github.com/paritytech/parity-ethereum/pull/10082))
|
||||
- Fill transaction hash on ethGetLog of light client. ([#9938](https://github.com/paritytech/parity-ethereum/pull/9938))
|
||||
- Update changelog update for 2.2.5-beta and 2.1.10-stable ([#10064](https://github.com/paritytech/parity-ethereum/pull/10064))
|
||||
- Implement len caching for parking_lot RwLock ([#10032](https://github.com/paritytech/parity-ethereum/pull/10032))
|
||||
- Update parking_lot to 0.7 ([#10050](https://github.com/paritytech/parity-ethereum/pull/10050))
|
||||
- Bump crossbeam. ([#10048](https://github.com/paritytech/parity-ethereum/pull/10048))
|
||||
- Ethcore: enable constantinople on ethereum ([#10031](https://github.com/paritytech/parity-ethereum/pull/10031))
|
||||
- Strict empty steps validation ([#10041](https://github.com/paritytech/parity-ethereum/pull/10041))
|
||||
- Center the Subtitle, use some CAPS ([#10034](https://github.com/paritytech/parity-ethereum/pull/10034))
|
||||
- Change test miner max memory to malloc reports. ([#10024](https://github.com/paritytech/parity-ethereum/pull/10024))
|
||||
- Sort the storage for private state ([#10018](https://github.com/paritytech/parity-ethereum/pull/10018))
|
||||
- Fix: test corpus_inaccessible panic ([#10019](https://github.com/paritytech/parity-ethereum/pull/10019))
|
||||
- Ci: move future releases to ethereum subdir on s3 ([#10017](https://github.com/paritytech/parity-ethereum/pull/10017))
|
||||
- Light(on_demand): decrease default time window to 10 secs ([#10016](https://github.com/paritytech/parity-ethereum/pull/10016))
|
||||
- Light client : failsafe crate (circuit breaker) ([#9790](https://github.com/paritytech/parity-ethereum/pull/9790))
|
||||
- Lencachingmutex ([#9988](https://github.com/paritytech/parity-ethereum/pull/9988))
|
||||
- Version and notification for private contract wrapper added ([#9761](https://github.com/paritytech/parity-ethereum/pull/9761))
|
||||
- Handle failing case for update account cache in require ([#9989](https://github.com/paritytech/parity-ethereum/pull/9989))
|
||||
- Add tokio runtime to ethcore io worker ([#9979](https://github.com/paritytech/parity-ethereum/pull/9979))
|
||||
- Move daemonize before creating account provider ([#10003](https://github.com/paritytech/parity-ethereum/pull/10003))
|
||||
- Docs: update changelogs ([#9990](https://github.com/paritytech/parity-ethereum/pull/9990))
|
||||
- Fix daemonize ([#10000](https://github.com/paritytech/parity-ethereum/pull/10000))
|
||||
- Fix Bloom migration ([#9992](https://github.com/paritytech/parity-ethereum/pull/9992))
|
||||
- Remove tendermint engine support ([#9980](https://github.com/paritytech/parity-ethereum/pull/9980))
|
||||
- Calculate gas for deployment transaction ([#9840](https://github.com/paritytech/parity-ethereum/pull/9840))
|
||||
- Fix unstable peers and slowness in sync ([#9967](https://github.com/paritytech/parity-ethereum/pull/9967))
|
||||
- Adds parity_verifySignature RPC method ([#9507](https://github.com/paritytech/parity-ethereum/pull/9507))
|
||||
- Improve block and transaction propagation ([#9954](https://github.com/paritytech/parity-ethereum/pull/9954))
|
||||
- Deny unknown fields for chainspec ([#9972](https://github.com/paritytech/parity-ethereum/pull/9972))
|
||||
- Fix docker build ([#9971](https://github.com/paritytech/parity-ethereum/pull/9971))
|
||||
- Ci: rearrange pipeline by logic ([#9970](https://github.com/paritytech/parity-ethereum/pull/9970))
|
||||
- Add changelogs for 2.0.9, 2.1.4, 2.1.6, and 2.2.1 ([#9963](https://github.com/paritytech/parity-ethereum/pull/9963))
|
||||
- Add Error message when sync is still in progress. ([#9475](https://github.com/paritytech/parity-ethereum/pull/9475))
|
||||
- Make CALLCODE to trace value to be the code address ([#9881](https://github.com/paritytech/parity-ethereum/pull/9881))
|
||||
- Fix light client informant while syncing ([#9932](https://github.com/paritytech/parity-ethereum/pull/9932))
|
||||
- Add a optional json dump state to evm-bin ([#9706](https://github.com/paritytech/parity-ethereum/pull/9706))
|
||||
- Disable EIP-98 transition by default ([#9955](https://github.com/paritytech/parity-ethereum/pull/9955))
|
||||
- Remove secret_store runtimes. ([#9888](https://github.com/paritytech/parity-ethereum/pull/9888))
|
||||
- Fix a deadlock ([#9952](https://github.com/paritytech/parity-ethereum/pull/9952))
|
||||
- Chore(eip712): remove unused `failure-derive` ([#9958](https://github.com/paritytech/parity-ethereum/pull/9958))
|
||||
- Do not use the home directory as the working dir in docker ([#9834](https://github.com/paritytech/parity-ethereum/pull/9834))
|
||||
- Prevent silent errors in daemon mode, closes [#9367](https://github.com/paritytech/parity-ethereum/issues/9367) ([#9946](https://github.com/paritytech/parity-ethereum/pull/9946))
|
||||
- Fix empty steps ([#9939](https://github.com/paritytech/parity-ethereum/pull/9939))
|
||||
- Adjust requests costs for light client ([#9925](https://github.com/paritytech/parity-ethereum/pull/9925))
|
||||
- Eip-1186: add `eth_getProof` RPC-Method ([#9001](https://github.com/paritytech/parity-ethereum/pull/9001))
|
||||
- Missing blocks in filter_changes RPC ([#9947](https://github.com/paritytech/parity-ethereum/pull/9947))
|
||||
- Allow rust-nightly builds fail in nightly builds ([#9944](https://github.com/paritytech/parity-ethereum/pull/9944))
|
||||
- Update eth-secp256k1 to include fix for BSDs ([#9935](https://github.com/paritytech/parity-ethereum/pull/9935))
|
||||
- Unbreak build on rust -stable ([#9934](https://github.com/paritytech/parity-ethereum/pull/9934))
|
||||
- Keep existing blocks when restoring a Snapshot ([#8643](https://github.com/paritytech/parity-ethereum/pull/8643))
|
||||
- Add experimental RPCs flag ([#9928](https://github.com/paritytech/parity-ethereum/pull/9928))
|
||||
- Clarify poll lifetime ([#9922](https://github.com/paritytech/parity-ethereum/pull/9922))
|
||||
- Docs(require rust 1.30) ([#9923](https://github.com/paritytech/parity-ethereum/pull/9923))
|
||||
- Use block header for building finality ([#9914](https://github.com/paritytech/parity-ethereum/pull/9914))
|
||||
- Simplify cargo audit ([#9918](https://github.com/paritytech/parity-ethereum/pull/9918))
|
||||
- Light-fetch: Differentiate between out-of-gas/manual throw and use required gas from response on failure ([#9824](https://github.com/paritytech/parity-ethereum/pull/9824))
|
||||
- Eip 191 ([#9701](https://github.com/paritytech/parity-ethereum/pull/9701))
|
||||
- Fix(logger): `reqwest` no longer a dependency ([#9908](https://github.com/paritytech/parity-ethereum/pull/9908))
|
||||
- Remove rust-toolchain file ([#9906](https://github.com/paritytech/parity-ethereum/pull/9906))
|
||||
- Foundation: 6692865, ropsten: 4417537, kovan: 9363457 ([#9907](https://github.com/paritytech/parity-ethereum/pull/9907))
|
||||
- Ethcore: use Machine::verify_transaction on parent block ([#9900](https://github.com/paritytech/parity-ethereum/pull/9900))
|
||||
- Chore(rpc-tests): remove unused rand ([#9896](https://github.com/paritytech/parity-ethereum/pull/9896))
|
||||
- Fix: Intermittent failing CI due to addr in use ([#9885](https://github.com/paritytech/parity-ethereum/pull/9885))
|
||||
- Chore(bump docopt): 0.8 -> 1.0 ([#9889](https://github.com/paritytech/parity-ethereum/pull/9889))
|
||||
- Use expect ([#9883](https://github.com/paritytech/parity-ethereum/pull/9883))
|
||||
- Use Weak reference in PubSubClient ([#9886](https://github.com/paritytech/parity-ethereum/pull/9886))
|
||||
- Ci: nuke the gitlab caches ([#9855](https://github.com/paritytech/parity-ethereum/pull/9855))
|
||||
- Remove unused code ([#9884](https://github.com/paritytech/parity-ethereum/pull/9884))
|
||||
- Fix json tracer overflow ([#9873](https://github.com/paritytech/parity-ethereum/pull/9873))
|
||||
- Allow to seal work on latest block ([#9876](https://github.com/paritytech/parity-ethereum/pull/9876))
|
||||
- Fix docker script ([#9854](https://github.com/paritytech/parity-ethereum/pull/9854))
|
||||
- Health endpoint ([#9847](https://github.com/paritytech/parity-ethereum/pull/9847))
|
||||
- Gitlab-ci: make android release build succeed ([#9743](https://github.com/paritytech/parity-ethereum/pull/9743))
|
||||
- Clean up existing benchmarks ([#9839](https://github.com/paritytech/parity-ethereum/pull/9839))
|
||||
- Update Callisto block reward code to support HF1 ([#9811](https://github.com/paritytech/parity-ethereum/pull/9811))
|
||||
- Option to disable keep alive for JSON-RPC http transport ([#9848](https://github.com/paritytech/parity-ethereum/pull/9848))
|
||||
- Classic.json Bootnode Update ([#9828](https://github.com/paritytech/parity-ethereum/pull/9828))
|
||||
- Support MIX. ([#9767](https://github.com/paritytech/parity-ethereum/pull/9767))
|
||||
- Ci: remove failing tests for android, windows, and macos ([#9788](https://github.com/paritytech/parity-ethereum/pull/9788))
|
||||
- Implement NoProof for json tests and update tests reference (replaces [#9744](https://github.com/paritytech/parity-ethereum/issues/9744)) ([#9814](https://github.com/paritytech/parity-ethereum/pull/9814))
|
||||
- Chore(bump regex) ([#9842](https://github.com/paritytech/parity-ethereum/pull/9842))
|
||||
- Ignore global cache for patched accounts ([#9752](https://github.com/paritytech/parity-ethereum/pull/9752))
|
||||
- Move state root verification before gas used ([#9841](https://github.com/paritytech/parity-ethereum/pull/9841))
|
||||
- Fix(docker-aarch64) : cross-compile config ([#9798](https://github.com/paritytech/parity-ethereum/pull/9798))
|
||||
- Version: bump nightly to 2.3.0 ([#9819](https://github.com/paritytech/parity-ethereum/pull/9819))
|
||||
- Tests modification for windows CI ([#9671](https://github.com/paritytech/parity-ethereum/pull/9671))
|
||||
- Eip-712 implementation ([#9631](https://github.com/paritytech/parity-ethereum/pull/9631))
|
||||
- Fix typo ([#9826](https://github.com/paritytech/parity-ethereum/pull/9826))
|
||||
- Clean up serde rename and use rename_all = camelCase when possible ([#9823](https://github.com/paritytech/parity-ethereum/pull/9823))
|
||||
|
||||
## Parity-Ethereum [v2.5.7](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.7)
|
||||
|
||||
Parity Ethereum v2.5.7-stable is a bugfix release that fixes a potential DoS attack in the trace_call RPC method. This is a critical upgrade for anyone running Parity nodes with RPC exposed to the public internet (and highly recommended for anyone else). For details see this blog post.
|
||||
|
||||
## Parity-Ethereum [v2.5.6](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.6)
|
||||
|
||||
Parity-Ethereum v2.5.6-stable is a bugfix release that improves stability.
|
||||
|
||||
* Allow specifying hostnames for node URLs
|
||||
* Fix a bug where archive nodes were losing peers
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* Kaspersky AV whitelisting (#10919)
|
||||
* Avast whitelist script (#10900)
|
||||
* Docker images renaming (#10863)
|
||||
* Remove excessive warning (#10831)
|
||||
* Allow --nat extip:your.host.here.org (#10830)
|
||||
* When updating the client or when called from RPC, sleep should mean sleep (#10814)
|
||||
* added new ropsten-bootnode and removed old one (#10794)
|
||||
* ethkey no longer uses byteorder (#10786)
|
||||
* Do not drop the peer with None difficulty (#10772)
|
||||
* docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions (#10652)
|
||||
|
||||
## Parity-Ethereum [v2.5.5](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.5)
|
||||
|
||||
Parity-Ethereum v2.5.5-stable is a minor release that improves performance and stability.
|
||||
This release stabilises the 2.5 branch.
|
||||
|
||||
As of today, Parity-Ethereum 2.4 reaches end of life and everyone is
|
||||
encouraged to upgrade.
|
||||
|
||||
## Parity-Ethereum [v2.5.4](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.4)
|
||||
|
||||
Parity Ethereum v2.5.4-beta is a security update that addresses servo/rust-smallvec#148
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* cargo update -p smallvec ([#10822](https://github.com/paritytech/parity-ethereum/pull/10822))
|
||||
|
||||
## Parity-Ethereum [v2.5.3](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.3)
|
||||
|
||||
Parity-Ethereum 2.5.3-beta is a bugfix release that improves performance and stability.
|
||||
|
||||
* EthereumClassic: activate the Atlantis Hardfork
|
||||
* Clique: fix time overflow
|
||||
* State tests: treat empty accounts the same as non-existant accounts (EIP 1052)
|
||||
* Networking: support discovery-only peers (geth bootnodes)
|
||||
* Snapshotting: fix unclean shutdown while snappshotting is under way
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* ethcore/res: activate atlantis classic hf on block 8772000 ([#10766](https://github.com/paritytech/parity-ethereum/pull/10766))
|
||||
* fix docker tags for publishing ([#10741](https://github.com/paritytech/parity-ethereum/pull/10741))
|
||||
* fix: aura don't add `SystemTime::now()` ([#10720](https://github.com/paritytech/parity-ethereum/pull/10720))
|
||||
* Treat empty account the same as non-exist accounts in EIP-1052 ([#10775](https://github.com/paritytech/parity-ethereum/pull/10775))
|
||||
* DevP2p: Get node IP address and udp port from Socket, if not included in PING packet ([#10705](https://github.com/paritytech/parity-ethereum/pull/10705))
|
||||
* Add a way to signal shutdown to snapshotting threads ([#10744](https://github.com/paritytech/parity-ethereum/pull/10744))
|
||||
|
||||
## Parity-Ethereum [v2.5.2](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.2)
|
||||
|
||||
Parity-Ethereum 2.5.2-beta is a bugfix release that improves performance and stability.
|
||||
|
||||
Among others, it enables the _Atlantis_ hardfork on **Morden** and **Kotti** Classic networks.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* [CI] allow cargo audit to fail ([#10676](https://github.com/paritytech/parity-ethereum/pull/10676))
|
||||
* Reset blockchain properly ([#10669](https://github.com/paritytech/parity-ethereum/pull/10669))
|
||||
* new image ([#10673](https://github.com/paritytech/parity-ethereum/pull/10673))
|
||||
* Update publishing ([#10644](https://github.com/paritytech/parity-ethereum/pull/10644))
|
||||
* enable lto for release builds ([#10717](https://github.com/paritytech/parity-ethereum/pull/10717))
|
||||
* Use RUSTFLAGS to set the optimization level ([#10719](https://github.com/paritytech/parity-ethereum/pull/10719))
|
||||
* ethcore: enable ECIP-1054 for classic ([#10731](https://github.com/paritytech/parity-ethereum/pull/10731))
|
||||
|
||||
## Parity-Ethereum [v2.5.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.1)
|
||||
|
||||
Parity-Ethereum 2.5.1-beta is a bugfix release that improves performance and stability.
|
||||
|
||||
Among others, it enables the Petersburg hardfork on **Rinkeby** and **POA-Core** Network, as well as the **Kovan** Network community hardfork.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* ci: publish docs debug ([#10638](https://github.com/paritytech/parity-ethereum/pull/10638))
|
||||
|
||||
## Parity-Ethereum [v2.5.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.5.0)
|
||||
|
||||
Parity-Ethereum 2.5.0-beta is a minor release that improves performance and stabilizes the 2.5 branch by marking it as beta release.
|
||||
|
||||
- This release adds support for the Clique consensus engine ([#9981](https://github.com/paritytech/parity-ethereum/pull/9981))
|
||||
- This enables Parity-Ethereum users to use the Görli, the Kotti Classic, and the legacy Rinkeby testnet. To get started try `parity --chain goerli`; note that light client support is currently not yet fully functional.
|
||||
- This release removes the dead chain configs for Easthub and Ethereum Social ([#10531](https://github.com/paritytech/parity-ethereum/pull/10531))
|
||||
|
||||
As of today, Parity-Ethereum 2.3 reaches end of life and everyone is encouraged to upgrade.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* fix(light cull): poll light cull instead of timer ([#10559](https://github.com/paritytech/parity-ethereum/pull/10559))
|
||||
## Previous releases
|
||||
|
||||
- [CHANGELOG-2.2](docs/CHANGELOG-2.2.md) (_stable_)
|
||||
- [CHANGELOG-2.1](docs/CHANGELOG-2.1.md) (EOL: 2019-01-16)
|
||||
- [CHANGELOG-2.0](docs/CHANGELOG-2.0.md) (EOL: 2018-11-15)
|
||||
- [CHANGELOG-1.11](docs/CHANGELOG-1.11.md) (EOL: 2018-09-19)
|
||||
- [CHANGELOG-1.10](docs/CHANGELOG-1.10.md) (EOL: 2018-07-18)
|
||||
- [CHANGELOG-1.9](docs/CHANGELOG-1.9.md) (EOL: 2018-05-09)
|
||||
- [CHANGELOG-1.8](docs/CHANGELOG-1.8.md) (EOL: 2018-03-22)
|
||||
- [CHANGELOG-1.7](docs/CHANGELOG-1.7.md) (EOL: 2018-01-25)
|
||||
- [CHANGELOG-1.6](docs/CHANGELOG-1.6.md) (EOL: 2017-10-15)
|
||||
- [CHANGELOG-1.5](docs/CHANGELOG-1.5.md) (EOL: 2017-07-28)
|
||||
- [CHANGELOG-1.4](docs/CHANGELOG-1.4.md) (EOL: 2017-03-13)
|
||||
- [CHANGELOG-1.3](docs/CHANGELOG-1.3.md) (EOL: 2017-01-19)
|
||||
- [CHANGELOG-1.2](docs/CHANGELOG-1.2.md) (EOL: 2016-11-07)
|
||||
- [CHANGELOG-1.1](docs/CHANGELOG-1.1.md) (EOL: 2016-08-12)
|
||||
- [CHANGELOG-1.0](docs/CHANGELOG-1.0.md) (EOL: 2016-06-24)
|
||||
- [CHANGELOG-0.9](docs/CHANGELOG-0.9.md) (EOL: 2016-05-02)
|
||||
|
||||
325
Cargo.lock
generated
325
Cargo.lock
generated
@@ -306,6 +306,7 @@ dependencies = [
|
||||
"heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)",
|
||||
"keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-machine 0.1.0",
|
||||
"rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp_derive 0.1.0",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -358,33 +359,101 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-deque"
|
||||
version = "0.6.3"
|
||||
name = "crossbeam"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-deque 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.2.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-deque"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-deque"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-deque"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.7.2"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-queue"
|
||||
version = "0.1.2"
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -394,11 +463,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.6.6"
|
||||
version = "0.6.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -497,13 +565,6 @@ name = "edit-distance"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "eip-152"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "eip-712"
|
||||
version = "0.1.0"
|
||||
@@ -649,8 +710,7 @@ dependencies = [
|
||||
"byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"common-types 0.1.0",
|
||||
"criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"eip-152 0.1.0",
|
||||
"crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethabi 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -672,7 +732,6 @@ dependencies = [
|
||||
"fetch 0.1.0",
|
||||
"hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)",
|
||||
"hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"journaldb 0.2.0",
|
||||
"keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -683,7 +742,7 @@ dependencies = [
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"len-caching-lock 0.1.1",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"macros 0.1.0",
|
||||
"memory-cache 0.1.0",
|
||||
"memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -691,12 +750,13 @@ dependencies = [
|
||||
"num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-machine 0.1.0",
|
||||
"parity-runtime 0.1.0",
|
||||
"parity-snappy 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"patricia-trie-ethereum 0.1.0",
|
||||
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp_compress 0.1.0",
|
||||
"rlp_derive 0.1.0",
|
||||
@@ -738,7 +798,7 @@ dependencies = [
|
||||
name = "ethcore-blockchain"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blooms-db 0.1.0",
|
||||
"common-types 0.1.0",
|
||||
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -753,14 +813,12 @@ dependencies = [
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp_compress 0.1.0",
|
||||
"rlp_derive 0.1.0",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"triehash-ethereum 0.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -796,7 +854,7 @@ dependencies = [
|
||||
name = "ethcore-io"
|
||||
version = "1.12.0"
|
||||
dependencies = [
|
||||
"crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -844,7 +902,7 @@ dependencies = [
|
||||
"rlp_derive 0.1.0",
|
||||
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"stats 0.1.0",
|
||||
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -895,7 +953,7 @@ dependencies = [
|
||||
"rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transaction-pool 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transaction-pool 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -937,7 +995,7 @@ dependencies = [
|
||||
"keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -990,7 +1048,7 @@ dependencies = [
|
||||
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transaction-pool 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transaction-pool 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -1139,6 +1197,7 @@ dependencies = [
|
||||
name = "ethkey"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"edit-distance 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"eth-secp256k1 0.5.7 (git+https://github.com/paritytech/rust-secp256k1)",
|
||||
"ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1146,7 +1205,7 @@ dependencies = [
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memzero 0.1.0",
|
||||
"parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-wordlist 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1163,7 +1222,7 @@ dependencies = [
|
||||
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethkey 0.3.0",
|
||||
"panic_hook 0.1.0",
|
||||
"parity-wordlist 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1183,14 +1242,14 @@ dependencies = [
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-wordlist 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1221,7 +1280,6 @@ dependencies = [
|
||||
"criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)",
|
||||
"hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1523,23 +1581,6 @@ name = "hex"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "hex-literal"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"hex-literal-impl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hex-literal-impl"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hidapi"
|
||||
version = "0.3.1"
|
||||
@@ -1760,7 +1801,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jni"
|
||||
version = "0.11.0"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cesu8 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2014,6 +2055,11 @@ dependencies = [
|
||||
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "linked-hash-map"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "linked-hash-map"
|
||||
version = "0.5.1"
|
||||
@@ -2056,10 +2102,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lru-cache"
|
||||
version = "0.1.2"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2100,18 +2146,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "memoffset"
|
||||
version = "0.5.1"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "memory-cache"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)",
|
||||
"lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2279,7 +2322,7 @@ dependencies = [
|
||||
"ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -2419,9 +2462,9 @@ name = "parity-clib"
|
||||
version = "1.12.0"
|
||||
dependencies = [
|
||||
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jni 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jni 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"panic_hook 0.1.0",
|
||||
"parity-ethereum 2.5.8",
|
||||
"parity-ethereum 2.4.7",
|
||||
"tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-current-thread 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -2451,7 +2494,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "parity-ethereum"
|
||||
version = "2.5.8"
|
||||
version = "2.4.7"
|
||||
dependencies = [
|
||||
"ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2504,7 +2547,7 @@ dependencies = [
|
||||
"parity-rpc 1.12.0",
|
||||
"parity-runtime 0.1.0",
|
||||
"parity-updater 1.12.0",
|
||||
"parity-version 2.5.8",
|
||||
"parity-version 2.4.7",
|
||||
"parity-whisper 0.1.0",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2579,6 +2622,13 @@ dependencies = [
|
||||
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parity-machine"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parity-path"
|
||||
version = "0.1.1"
|
||||
@@ -2639,6 +2689,7 @@ dependencies = [
|
||||
"jsonrpc-pubsub 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kvdb-memorydb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"macros 0.1.0",
|
||||
"multihash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2647,7 +2698,7 @@ dependencies = [
|
||||
"parity-crypto 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-runtime 0.1.0",
|
||||
"parity-updater 1.12.0",
|
||||
"parity-version 2.5.8",
|
||||
"parity-version 2.4.7",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2661,8 +2712,9 @@ dependencies = [
|
||||
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transaction-pool 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transaction-pool 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transient-hashmap 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vm 0.1.0",
|
||||
]
|
||||
|
||||
@@ -2745,7 +2797,7 @@ dependencies = [
|
||||
"parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-hash-fetch 1.12.0",
|
||||
"parity-path 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-version 2.5.8",
|
||||
"parity-version 2.4.7",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2755,7 +2807,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "parity-version"
|
||||
version = "2.5.8"
|
||||
version = "2.4.7"
|
||||
dependencies = [
|
||||
"parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -2797,18 +2849,19 @@ dependencies = [
|
||||
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time-utils 0.1.0",
|
||||
"tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parity-wordlist"
|
||||
version = "1.3.0"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2854,7 +2907,7 @@ dependencies = [
|
||||
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -2868,7 +2921,7 @@ dependencies = [
|
||||
"petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"thread-id 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -3021,17 +3074,7 @@ dependencies = [
|
||||
"hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"primal-bit 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-hack"
|
||||
version = "0.5.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3042,14 +3085,6 @@ dependencies = [
|
||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "protobuf"
|
||||
version = "1.7.5"
|
||||
@@ -3107,14 +3142,6 @@ dependencies = [
|
||||
"proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.3.22"
|
||||
@@ -3222,23 +3249,22 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rayon"
|
||||
version = "1.1.0"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rayon-core 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rayon-core"
|
||||
version = "1.5.0"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -3470,11 +3496,6 @@ name = "scopeguard"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "sct"
|
||||
version = "0.5.0"
|
||||
@@ -3599,8 +3620,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "0.6.10"
|
||||
version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
@@ -3655,16 +3679,6 @@ dependencies = [
|
||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "synom"
|
||||
version = "0.11.3"
|
||||
@@ -3975,7 +3989,7 @@ name = "tokio-threadpool"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -4060,11 +4074,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "transaction-pool"
|
||||
version = "2.0.1"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@@ -4205,11 +4219,6 @@ name = "unicode-xid"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "unreachable"
|
||||
version = "1.0.0"
|
||||
@@ -4293,12 +4302,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
name = "vm"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethereum-types 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethjson 0.1.0",
|
||||
"keccak-hash 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-bytes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"patricia-trie-ethereum 0.1.0",
|
||||
"rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4388,14 +4400,12 @@ dependencies = [
|
||||
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore-network 1.12.0",
|
||||
"ethcore-network-devp2p 1.12.0",
|
||||
"ethkey 0.3.0",
|
||||
"jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-http-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-pubsub 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"panic_hook 0.1.0",
|
||||
"parity-whisper 0.1.0",
|
||||
"rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -4515,11 +4525,17 @@ dependencies = [
|
||||
"checksum criterion 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c47d2b548c5647e1a436dc0cb78d4ebf51b6bf7ab101ed76662828bdd4d3a24a"
|
||||
"checksum criterion-plot 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6e649d6aacdbbdb94ec659561a309a71336fc5655ed408f3afd28df2fc0c4f4f"
|
||||
"checksum criterion-stats 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ff43cac80562f91ead0b617c1be74edf350adfaa195809d355de98dfc8f9237d"
|
||||
"checksum crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13"
|
||||
"checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9"
|
||||
"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b"
|
||||
"checksum crossbeam 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7408247b1b87f480890f28b670c5f8d9a8a4274833433fe74dc0dfd46d33650"
|
||||
"checksum crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b85741761b7f160bc5e7e0c14986ef685b7f8bf9b7ad081c60c604bb4649827"
|
||||
"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3"
|
||||
"checksum crossbeam-deque 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7792c4a9b5a4222f654e3728a3dd945aacc24d2c3a1a096ed265d80e4929cb9a"
|
||||
"checksum crossbeam-deque 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3486aefc4c0487b9cb52372c97df0a48b8c249514af1ee99703bf70d2f2ceda1"
|
||||
"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150"
|
||||
"checksum crossbeam-epoch 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30fecfcac6abfef8771151f8be4abc9e4edc112c2bcb233314cafde2680536e9"
|
||||
"checksum crossbeam-epoch 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2449aaa4ec7ef96e5fb24db16024b935df718e9ae1cec0a1e68feeca2efca7b8"
|
||||
"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9"
|
||||
"checksum crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "677d453a17e8bd2b913fa38e8b9cf04bcdbb5be790aa294f2389661d72036015"
|
||||
"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
|
||||
"checksum crossbeam-utils 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e07fc155212827475223f0bcfae57e945e694fc90950ddf3f6695bbfd5555c72"
|
||||
"checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda"
|
||||
"checksum crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c240f247c278fa08a6d4820a6a222bfc6e0d999e51ba67be94f44c905b2161f2"
|
||||
"checksum csv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d54f6b0fd69128a2894b1a3e57af5849a0963c1cc77b165d30b896e40296452"
|
||||
@@ -4569,8 +4585,6 @@ dependencies = [
|
||||
"checksum heapsize 0.4.2 (git+https://github.com/cheme/heapsize.git?branch=ec-macfix)" = "<none>"
|
||||
"checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82"
|
||||
"checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa"
|
||||
"checksum hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0"
|
||||
"checksum hex-literal-impl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9d4c5c844e2fee0bf673d54c2c177f1713b3d2af2ff6e666b49cb7572e6cf42d"
|
||||
"checksum hidapi 0.3.1 (git+https://github.com/paritytech/hidapi-rs)" = "<none>"
|
||||
"checksum home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "80dff82fb58cfbbc617fb9a9184b010be0529201553cda50ad04372bc2333aff"
|
||||
"checksum http 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "1a10e5b573b9a0146545010f50772b9e8b1dd0a256564cc4307694c68832a2f5"
|
||||
@@ -4593,7 +4607,7 @@ dependencies = [
|
||||
"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
|
||||
"checksum jemalloc-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "bfc62c8e50e381768ce8ee0428ee53741929f7ebd73e4d83f669bcf7693e00ae"
|
||||
"checksum jemallocator 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9f0cd42ac65f758063fea55126b0148b1ce0a6354ff78e07a4d6806bc65c4ab3"
|
||||
"checksum jni 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "294eca097d1dc0bf59de5ab9f7eafa5f77129e9f6464c957ed3ddeb705fb4292"
|
||||
"checksum jni 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1ecfa3b81afc64d9a6539c4eece96ac9a93c551c713a313800dade8e33d7b5c1"
|
||||
"checksum jni-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
|
||||
"checksum jsonrpc-core 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a5152c3fda235dfd68341b3edf4121bc4428642c93acbd6de88c26bf95fc5d7"
|
||||
"checksum jsonrpc-derive 10.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c14be84e86c75935be83a34c6765bf31f97ed6c9163bb0b83007190e9703940a"
|
||||
@@ -4615,17 +4629,18 @@ dependencies = [
|
||||
"checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2"
|
||||
"checksum libusb 0.3.0 (git+https://github.com/paritytech/libusb-rs)" = "<none>"
|
||||
"checksum libusb-sys 0.2.4 (git+https://github.com/paritytech/libusb-sys)" = "<none>"
|
||||
"checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939"
|
||||
"checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e"
|
||||
"checksum local-encoding 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1ceb20f39ff7ae42f3ff9795f3986b1daad821caaa1e1732a0944103a5a1a66"
|
||||
"checksum lock_api 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775751a3e69bde4df9b38dd00a1b5d6ac13791e4223d4a0506577f0dd27cfb7a"
|
||||
"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
|
||||
"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
|
||||
"checksum lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c"
|
||||
"checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21"
|
||||
"checksum lunarity-lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a1670671f305792567116d4660e6e5bd785d6fa973e817c3445c0a7a54cecb6"
|
||||
"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
|
||||
"checksum memchr 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b3629fe9fdbff6daa6c33b90f7c08355c1aca05a3d01fa8063b822fcf185f3b"
|
||||
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
|
||||
"checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f"
|
||||
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
|
||||
"checksum memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94da53143d45f6bad3753f532e56ad57a6a26c0ca6881794583310c7cb4c885f"
|
||||
"checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882"
|
||||
"checksum mime 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "0a907b83e7b9e987032439a387e187119cddafc92d5c2aaeb1d92580a793f630"
|
||||
@@ -4665,7 +4680,7 @@ dependencies = [
|
||||
"checksum parity-snappy-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1a413d51e5e1927320c9de992998e4a279dffb8c8a7363570198bd8383e66f1b"
|
||||
"checksum parity-tokio-ipc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eb002c2d3539ccd3b82bd915ec060028d4ab350ad203dbffa20028c1e483af5b"
|
||||
"checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc"
|
||||
"checksum parity-wordlist 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "573d08f0d3bc8a6ffcdac1de2725b5daeed8db26345a9c12d91648e2d6457f3e"
|
||||
"checksum parity-wordlist 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf13102febd98f4ad416a526b42deb82daf482626ba6ab10d0ebf8f45327514c"
|
||||
"checksum parity-ws 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2fec5048fba72a2e01baeb0d08089db79aead4b57e2443df172fb1840075a233"
|
||||
"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5"
|
||||
"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337"
|
||||
@@ -4686,16 +4701,13 @@ dependencies = [
|
||||
"checksum primal-check 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e65f96c0a171f887198c274392c99a116ef65aa7f53f3b6d4902f493965c2d1"
|
||||
"checksum primal-estimate 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56ea4531dde757b56906493c8604641da14607bf9cdaa80fb9c9cabd2429f8d5"
|
||||
"checksum primal-sieve 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "da2d6ed369bb4b0273aeeb43f07c105c0117717cbae827b20719438eb2eb798c"
|
||||
"checksum proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e688f31d92ffd7c1ddc57a1b4e6d773c0f2a14ee437a4b0a4f5a69c80eb221c8"
|
||||
"checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee"
|
||||
"checksum proc-macro2 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e98a83a9f9b331f54b924e68a66acb1bb35cb01fb0a23645139967abefb697e8"
|
||||
"checksum protobuf 1.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e14ccd6b79ec748412d4f2dfde1a80fa363a67def4062969f8aed3d790a30f28"
|
||||
"checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07"
|
||||
"checksum pwasm-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e9135bed7b452e20dbb395a2d519abaf0c46d60e7ecc02daeeab447d29bada1"
|
||||
"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
|
||||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
|
||||
"checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5"
|
||||
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
|
||||
"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1"
|
||||
"checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
|
||||
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
|
||||
@@ -4707,8 +4719,8 @@ dependencies = [
|
||||
"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
|
||||
"checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05"
|
||||
"checksum rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effa3fcaa47e18db002bdde6060944b6d2f9cfd8db471c30e873448ad9187be3"
|
||||
"checksum rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4b0186e22767d5b9738a05eab7c6ac90b15db17e5b5f9bd87976dd7d89a10a4"
|
||||
"checksum rayon-core 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbe0df8435ac0c397d467b6cad6d25543d06e8a019ef3f6af3c384597515bd2"
|
||||
"checksum rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "df7a791f788cb4c516f0e091301a29c2b71ef680db5e644a7d68835c8ae6dbfa"
|
||||
"checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356"
|
||||
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
|
||||
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
|
||||
"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384"
|
||||
@@ -4734,7 +4746,6 @@ dependencies = [
|
||||
"checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c"
|
||||
"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
|
||||
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
|
||||
"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d"
|
||||
"checksum sct 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f5adf8fbd58e1b1b52699dc8bed2630faecb6d8c7bee77d009d6bbe4af569b9"
|
||||
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||
@@ -4752,14 +4763,13 @@ dependencies = [
|
||||
"checksum slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6dbdd334bd28d328dad1c41b0ea662517883d8880d8533895ef96c8003dec9c4"
|
||||
"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
|
||||
"checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d"
|
||||
"checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7"
|
||||
"checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d"
|
||||
"checksum socket2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7"
|
||||
"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
|
||||
"checksum string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970"
|
||||
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
|
||||
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
|
||||
"checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9"
|
||||
"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf"
|
||||
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
|
||||
"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
|
||||
"checksum target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63f48baada5c52e65a29eef93ab4f8982681b67f9e8d29c7b05abcfec2b9ffe"
|
||||
@@ -4798,7 +4808,7 @@ dependencies = [
|
||||
"checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f"
|
||||
"checksum toolshed 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "450441e131c7663af72e63a33c02a6a1fbaaa8601dc652ed6757813bb55aeec7"
|
||||
"checksum trace-time 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe82f2f0bf1991e163e757baf044282823155dd326e70f44ce2186c3c320cc9"
|
||||
"checksum transaction-pool 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "454adc482e32785c3beab9415dd0f3c689f29cc2d16717eb62f6a784d53544b4"
|
||||
"checksum transaction-pool 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d8bd3123931aa6e49dd03bc8a2400490e14701d779458d1f1fff1f04c6f666"
|
||||
"checksum transient-hashmap 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aeb4b191d033a35edfce392a38cdcf9790b6cebcb30fa690c312c29da4dc433e"
|
||||
"checksum trezor-sys 1.0.0 (git+https://github.com/paritytech/trezor-sys)" = "<none>"
|
||||
"checksum trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788"
|
||||
@@ -4817,7 +4827,6 @@ dependencies = [
|
||||
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
|
||||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
|
||||
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
|
||||
"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
|
||||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
|
||||
"checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f"
|
||||
"checksum url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2a321979c09843d272956e73700d12c4e7d3d92b2ee112b31548aef0d4efc5a6"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
description = "Parity Ethereum client"
|
||||
name = "parity-ethereum"
|
||||
# NOTE Make sure to update util/version/Cargo.toml as well
|
||||
version = "2.5.8"
|
||||
version = "2.4.7"
|
||||
license = "GPL-3.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
|
||||
246
README.md
246
README.md
@@ -7,24 +7,6 @@
|
||||
<p align="center"><a href="https://gitlab.parity.io/parity/parity-ethereum/commits/master" target="_blank"><img src="https://gitlab.parity.io/parity/parity-ethereum/badges/master/build.svg" /></a>
|
||||
<a href="https://www.gnu.org/licenses/gpl-3.0.en.html" target="_blank"><img src="https://img.shields.io/badge/license-GPL%20v3-green.svg" /></a></p>
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Description](#chapter-001)
|
||||
2. [Technical Overview](#chapter-002)
|
||||
3. [Building](#chapter-003)<br>
|
||||
3.1 [Building Dependencies](#chapter-0031)<br>
|
||||
3.2 [Building from Source Code](#chapter-0032)<br>
|
||||
3.3 [Simple One-Line Installer for Mac and Linux](#chapter-0033)<br>
|
||||
3.4 [Starting Parity Ethereum](#chapter-0034)
|
||||
4. [Documentation](#chapter-004)
|
||||
5. [Toolchain](#chapter-005)
|
||||
6. [Community](#chapter-006)
|
||||
7. [Contributing](#chapter-007)
|
||||
8. [License](#chapter-008)
|
||||
|
||||
|
||||
## 1. Description <a id="chapter-001"></a>
|
||||
|
||||
**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.
|
||||
|
||||
- Clean, modular codebase for easy customisation
|
||||
@@ -33,7 +15,7 @@
|
||||
- Synchronise in hours, not days with Warp Sync
|
||||
- Modular for light integration into your service or product
|
||||
|
||||
## 2. Technical Overview <a id="chapter-002"></a>
|
||||
## 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.
|
||||
|
||||
@@ -43,9 +25,7 @@ If you run into problems while using Parity Ethereum, check out the [wiki for do
|
||||
|
||||
Parity Ethereum's current beta-release is 2.1. You can download it at [the releases page](https://github.com/paritytech/parity-ethereum/releases) or follow the instructions below to build from source. Please, mind the [CHANGELOG.md](CHANGELOG.md) for a list of all changes between different versions.
|
||||
|
||||
## 3. Building <a id="chapter-003"></a>
|
||||
|
||||
### 3.1 Build Dependencies <a id="chapter-0031"></a>
|
||||
## Build Dependencies
|
||||
|
||||
Parity Ethereum requires **latest stable Rust version** to build.
|
||||
|
||||
@@ -78,7 +58,7 @@ Once you have `rustup` installed, then you need to install:
|
||||
|
||||
Make sure that these binaries are in your `PATH`. After that, you should be able to build Parity Ethereum from source.
|
||||
|
||||
### 3.2 Build from Source Code <a id="chapter-0032"></a>
|
||||
## Build from Source Code
|
||||
|
||||
```bash
|
||||
# download Parity Ethereum code
|
||||
@@ -115,7 +95,7 @@ or
|
||||
$ git checkout beta
|
||||
```
|
||||
|
||||
### 3.3 Simple One-Line Installer for Mac and Linux <a id="chapter-0033"></a>
|
||||
## Simple One-Line Installer for Mac and Linux
|
||||
|
||||
```bash
|
||||
bash <(curl https://get.parity.io -L)
|
||||
@@ -127,9 +107,9 @@ The one-line installer always defaults to the latest beta release. To install a
|
||||
bash <(curl https://get.parity.io -L) -r stable
|
||||
```
|
||||
|
||||
### 3.4 Starting Parity Ethereum <a id="chapter-0034"></a>
|
||||
## Start Parity Ethereum
|
||||
|
||||
#### Manually
|
||||
### Manually
|
||||
|
||||
To start Parity Ethereum manually, just run
|
||||
|
||||
@@ -139,7 +119,7 @@ $ ./target/release/parity
|
||||
|
||||
so Parity Ethereum begins syncing the Ethereum blockchain.
|
||||
|
||||
#### Using `systemd` service file
|
||||
### Using `systemd` service file
|
||||
|
||||
To start Parity Ethereum as a regular user using `systemd` init:
|
||||
|
||||
@@ -148,203 +128,17 @@ To start Parity Ethereum as a regular user using `systemd` init:
|
||||
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.
|
||||
|
||||
## 4. Documentation <a id="chapter-004"></a>
|
||||
|
||||
Official website: https://parity.io
|
||||
|
||||
Be sure to [check out our wiki](https://wiki.parity.io) for more information.
|
||||
|
||||
### 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:
|
||||
|
||||
* **All** packages
|
||||
```
|
||||
cargo doc --open
|
||||
```
|
||||
|
||||
* Specific package
|
||||
```
|
||||
cargo doc --package <spec> --open
|
||||
```
|
||||
|
||||
Replacing `<spec>` with one of the following from the details section below (i.e. `cargo doc --package parity-ethereum --open`):
|
||||
|
||||
<details><p>
|
||||
|
||||
* Parity Ethereum (EthCore) Client Application
|
||||
```bash
|
||||
parity-ethereum
|
||||
```
|
||||
* Parity Ethereum Account Management, Key Management Tool, and Keys Generator
|
||||
```bash
|
||||
ethcore-accounts, ethkey-cli, ethstore, ethstore-cli
|
||||
```
|
||||
* Parity Chain Specification
|
||||
```bash
|
||||
chainspec
|
||||
```
|
||||
* Parity CLI Signer Tool & RPC Client
|
||||
```bash
|
||||
cli-signer parity-rpc-client
|
||||
```
|
||||
* Parity Ethereum Ethash & ProgPoW Implementations
|
||||
```bash
|
||||
ethash
|
||||
```
|
||||
* Parity (EthCore) Library
|
||||
```bash
|
||||
ethcore
|
||||
```
|
||||
* Parity 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
|
||||
```bash
|
||||
ethcore-call-contract
|
||||
```
|
||||
* Parity Ethereum (EthCore) Database Access & Utilities, Database Cache Manager
|
||||
```bash
|
||||
ethcore-db
|
||||
```
|
||||
* Parity Ethereum Virtual Machine (EVM) Rust Implementation
|
||||
```bash
|
||||
evm
|
||||
```
|
||||
* Parity Ethereum (EthCore) Light Client Implementation
|
||||
```bash
|
||||
ethcore-light
|
||||
```
|
||||
* Parity Smart Contract based Node Filter, Manage Permissions of Network Connections
|
||||
```bash
|
||||
node-filter
|
||||
```
|
||||
* Parity Private Transactions
|
||||
```bash
|
||||
ethcore-private-tx
|
||||
```
|
||||
* Parity Ethereum (EthCore) Client & Network Service Creation & Registration with the I/O Subsystem
|
||||
```bash
|
||||
ethcore-service
|
||||
```
|
||||
* Parity Ethereum (EthCore) Blockchain Synchronization
|
||||
```bash
|
||||
ethcore-sync
|
||||
```
|
||||
* Parity Ethereum Common Types
|
||||
```bash
|
||||
common-types
|
||||
```
|
||||
* Parity Ethereum Virtual Machines (VM) Support Library
|
||||
```bash
|
||||
vm
|
||||
```
|
||||
* Parity Ethereum WASM Interpreter
|
||||
```bash
|
||||
wasm
|
||||
```
|
||||
* Parity Ethereum WASM Test Runner
|
||||
```bash
|
||||
pwasm-run-test
|
||||
```
|
||||
* Parity EVM Implementation
|
||||
```bash
|
||||
evmbin
|
||||
```
|
||||
* Parity Ethereum IPFS-compatible API
|
||||
```bash
|
||||
parity-ipfs-api
|
||||
```
|
||||
* Parity Ethereum JSON Deserialization
|
||||
```bash
|
||||
ethjson
|
||||
```
|
||||
* Parity Ethereum State Machine Generalization for Consensus Engines
|
||||
```bash
|
||||
parity-machine
|
||||
```
|
||||
* Parity Ethereum (EthCore) Miner Interface
|
||||
```bash
|
||||
ethcore-miner parity-local-store price-info ethcore-stratum using_queue
|
||||
```
|
||||
* Parity Ethereum (EthCore) Logger Implementation
|
||||
```bash
|
||||
ethcore-logger
|
||||
```
|
||||
* C bindings library for the Parity Ethereum client
|
||||
```bash
|
||||
parity-clib
|
||||
```
|
||||
* Parity Ethereum JSON-RPC Servers
|
||||
```bash
|
||||
parity-rpc
|
||||
```
|
||||
* Parity Ethereum (EthCore) Secret Store
|
||||
```bash
|
||||
ethcore-secretstore
|
||||
```
|
||||
* Parity Updater Service
|
||||
```bash
|
||||
parity-updater parity-hash-fetch
|
||||
```
|
||||
* Parity Core Libraries (Parity Util)
|
||||
```bash
|
||||
ethcore-bloom-journal blooms-db dir eip-712 fake-fetch fastmap fetch ethcore-io
|
||||
journaldb keccak-hasher len-caching-lock macros memory-cache memzero
|
||||
migration-rocksdb ethcore-network ethcore-network-devp2p panic_hook
|
||||
patricia-trie-ethereum registrar rlp_compress rlp_derive parity-runtime stats
|
||||
time-utils triehash-ethereum unexpected parity-version
|
||||
```
|
||||
* Parity Whisper Protocol Implementation
|
||||
```bash
|
||||
parity-whisper whisper-cli
|
||||
```
|
||||
|
||||
</p></details>
|
||||
|
||||
### Contributing to documentation for Parity 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.
|
||||
|
||||
Example (generic documentation comment):
|
||||
```markdown
|
||||
/// Summary
|
||||
///
|
||||
/// Description
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Summary of Example 1
|
||||
///
|
||||
/// ```rust
|
||||
/// // insert example 1 code here for use with documentation as tests
|
||||
/// ```
|
||||
///
|
||||
```
|
||||
|
||||
## 5. Toolchain <a id="chapter-005"></a>
|
||||
## Parity Ethereum toolchain
|
||||
|
||||
In addition to the Parity 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.
|
||||
- [whisper](./whisper) - Parity Ethereum Whisper-v2 PoC Implementation.
|
||||
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
|
||||
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
|
||||
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management.
|
||||
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator.
|
||||
- [whisper](https://github.com/paritytech/parity-ethereum/blob/master/whisper/) - Implementation of Whisper-v2 PoC.
|
||||
|
||||
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)
|
||||
|
||||
## 6. Community <a id="chapter-006"></a>
|
||||
|
||||
### Join the chat!
|
||||
## Join the chat!
|
||||
|
||||
Questions? Get in touch with us on Gitter:
|
||||
[](https://gitter.im/paritytech/parity)
|
||||
@@ -355,14 +149,8 @@ Questions? Get in touch with us on Gitter:
|
||||
Alternatively, join our community on Matrix:
|
||||
[](https://riot.im/app/#/group/+parity:matrix.parity.io)
|
||||
|
||||
## 7. Contributing <a id="chapter-007"></a>
|
||||
## Documentation
|
||||
|
||||
An introduction has been provided in the ["So You Want to be a Core Developer" presentation slides by Hernando Castano](http://tiny.cc/contrib-to-parity-eth). Additional guidelines are provided in [CONTRIBUTING](./.github/CONTRIBUTING.md).
|
||||
Official website: https://parity.io
|
||||
|
||||
### Contributor Code of Conduct
|
||||
|
||||
[CODE_OF_CONDUCT](./.github/CODE_OF_CONDUCT.md)
|
||||
|
||||
## 8. License <a id="chapter-008"></a>
|
||||
|
||||
[LICENSE](./LICENSE)
|
||||
Be sure to [check out our wiki](https://wiki.parity.io) for more information.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
description = "Parity Ethereum Account Management"
|
||||
description = "Account management for Parity Ethereum"
|
||||
homepage = "http://parity.io"
|
||||
license = "GPL-3.0"
|
||||
name = "ethcore-accounts"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
description = "Parity Ethereum Keys Generator"
|
||||
name = "ethkey"
|
||||
version = "0.3.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
[dependencies]
|
||||
byteorder = "1.0"
|
||||
edit-distance = "2.0"
|
||||
parity-crypto = "0.3.0"
|
||||
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
|
||||
@@ -12,7 +12,7 @@ ethereum-types = "0.4"
|
||||
lazy_static = "1.0"
|
||||
log = "0.4"
|
||||
memzero = { path = "../../util/memzero" }
|
||||
parity-wordlist = "1.3"
|
||||
parity-wordlist = "1.2"
|
||||
quick-error = "1.2.2"
|
||||
rand = "0.4"
|
||||
rustc-hex = "1.0"
|
||||
|
||||
@@ -5,7 +5,7 @@ Parity Ethereum keys generator.
|
||||
### Usage
|
||||
|
||||
```
|
||||
Parity Ethereum Keys Generator.
|
||||
Parity Ethereum keys generator.
|
||||
Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||
|
||||
Usage:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[package]
|
||||
description = "Parity Ethereum Keys Generator CLI"
|
||||
name = "ethkey-cli"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
@@ -9,7 +8,7 @@ docopt = "1.0"
|
||||
env_logger = "0.5"
|
||||
ethkey = { path = "../" }
|
||||
panic_hook = { path = "../../../util/panic-hook" }
|
||||
parity-wordlist="1.3"
|
||||
parity-wordlist="1.2"
|
||||
rustc-hex = "1.0"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
|
||||
@@ -35,8 +35,9 @@ impl Label for u32 {
|
||||
fn len() -> usize { 4 }
|
||||
|
||||
fn store(&self, target: &mut [u8]) {
|
||||
let bytes = self.to_be_bytes();
|
||||
target[0..4].copy_from_slice(&bytes);
|
||||
use byteorder::{BigEndian, ByteOrder};
|
||||
|
||||
BigEndian::write_u32(&mut target[0..4], *self);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
// #![warn(missing_docs)]
|
||||
|
||||
extern crate byteorder;
|
||||
extern crate edit_distance;
|
||||
extern crate parity_crypto;
|
||||
extern crate ethereum_types;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[package]
|
||||
description = "Parity Ethereum Key Management"
|
||||
name = "ethstore"
|
||||
version = "0.2.1"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
@@ -21,7 +20,7 @@ parity-crypto = "0.3.0"
|
||||
ethereum-types = "0.4"
|
||||
dir = { path = "../../util/dir" }
|
||||
smallvec = "0.6"
|
||||
parity-wordlist = "1.3"
|
||||
parity-wordlist = "1.0"
|
||||
tempdir = "0.3"
|
||||
lazy_static = "1.2.0"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[package]
|
||||
description = "Parity Ethereum Key Management CLI"
|
||||
name = "ethstore-cli"
|
||||
version = "0.1.1"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[package]
|
||||
description = "Parity Ethereum Chain Specification"
|
||||
name = "chainspec"
|
||||
version = "0.1.0"
|
||||
authors = ["Marek Kotewicz <marek@parity.io>"]
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
description = "Parity Ethereum CLI Signer Tool"
|
||||
authors = ["Parity <admin@parity.io>"]
|
||||
description = "Parity Cli Tool"
|
||||
homepage = "http://parity.io"
|
||||
license = "GPL-3.0"
|
||||
name = "cli-signer"
|
||||
version = "1.4.0"
|
||||
authors = ["Parity <admin@parity.io>"]
|
||||
|
||||
[dependencies]
|
||||
ethereum-types = "0.4"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
description = "Parity Ethereum RPC Client"
|
||||
authors = ["Parity <admin@parity.io>"]
|
||||
description = "Parity Rpc Client"
|
||||
homepage = "http://parity.io"
|
||||
license = "GPL-3.0"
|
||||
name = "parity-rpc-client"
|
||||
version = "1.4.0"
|
||||
authors = ["Parity <admin@parity.io>"]
|
||||
|
||||
[dependencies]
|
||||
ethereum-types = "0.4"
|
||||
|
||||
@@ -1,78 +1,3 @@
|
||||
Note: Parity Ethereum 2.2 reached End-of-Life on 2019-02-25 (EOL).
|
||||
|
||||
## Parity-Ethereum [v2.2.11](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.11) (2019-02-21)
|
||||
|
||||
Parity-Ethereum 2.2.11-stable is a maintenance release that fixes snap and docker installations.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
- Stable: snap: release untagged versions from branches to the candidate ([#10357](https://github.com/paritytech/parity-ethereum/pull/10357)) ([#10372](https://github.com/paritytech/parity-ethereum/pull/10372))
|
||||
- Snap: release untagged versions from branches to the candidate snap channel ([#10357](https://github.com/paritytech/parity-ethereum/pull/10357))
|
||||
- Snap: add the removable-media plug ([#10377](https://github.com/paritytech/parity-ethereum/pull/10377))
|
||||
- Exchanged old(azure) bootnodes with new(ovh) ones ([#10309](https://github.com/paritytech/parity-ethereum/pull/10309))
|
||||
- Stable Backports ([#10353](https://github.com/paritytech/parity-ethereum/pull/10353))
|
||||
- Version: bump stable to 2.2.11
|
||||
- Snap: prefix version and populate candidate channel ([#10343](https://github.com/paritytech/parity-ethereum/pull/10343))
|
||||
- Snap: populate candidate releases with beta snaps to avoid stale channel
|
||||
- Snap: prefix version with v*
|
||||
- No volumes are needed, just run -v volume:/path/in/the/container ([#10345](https://github.com/paritytech/parity-ethereum/pull/10345))
|
||||
|
||||
## Parity-Ethereum [v2.2.10](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.10) (2019-02-13)
|
||||
|
||||
Parity-Ethereum 2.2.10-stable is a security-relevant release. A bug in the JSONRPC-deserialization module can cause crashes of all versions of Parity Ethereum nodes if an attacker is able to submit a specially-crafted RPC to certain publicly available endpoints.
|
||||
|
||||
- https://www.parity.io/new-parity-ethereum-update-fixes-several-rpc-vulnerabilities/
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
- Additional error for invalid gas ([#10327](https://github.com/paritytech/parity-ethereum/pull/10327)) ([#10329](https://github.com/paritytech/parity-ethereum/pull/10329))
|
||||
- Backports for Stable 2.2.10 ([#10332](https://github.com/paritytech/parity-ethereum/pull/10332))
|
||||
- fix(docker-aarch64) : cross-compile config ([#9798](https://github.com/paritytech/parity-ethereum/pull/9798))
|
||||
- import rpc transactions sequentially ([#10051](https://github.com/paritytech/parity-ethereum/pull/10051))
|
||||
- fix(docker): fix not receives SIGINT ([#10059](https://github.com/paritytech/parity-ethereum/pull/10059))
|
||||
- snap: official image / test ([#10168](https://github.com/paritytech/parity-ethereum/pull/10168))
|
||||
- perform stripping during build ([#10208](https://github.com/paritytech/parity-ethereum/pull/10208))
|
||||
- Additional tests for uint/hash/bytes deserialization. ([#10279](https://github.com/paritytech/parity-ethereum/pull/10279))
|
||||
- Don't run the CPP example on CI ([#10285](https://github.com/paritytech/parity-ethereum/pull/10285))
|
||||
- CI optimizations ([#10297](https://github.com/paritytech/parity-ethereum/pull/10297))
|
||||
- fix publish job ([#10317](https://github.com/paritytech/parity-ethereum/pull/10317))
|
||||
- Add Statetest support for Constantinople Fix ([#10323](https://github.com/paritytech/parity-ethereum/pull/10323))
|
||||
- Add helper for Timestamp overflows ([#10330](https://github.com/paritytech/parity-ethereum/pull/10330))
|
||||
- Don't add discovery initiators to the node table ([#10305](https://github.com/paritytech/parity-ethereum/pull/10305))
|
||||
- change docker image based on debian instead of ubuntu due to the chan ([#10336](https://github.com/paritytech/parity-ethereum/pull/10336))
|
||||
- role back docker build image and docker deploy image to ubuntu:xenial based ([#10338](https://github.com/paritytech/parity-ethereum/pull/10338))
|
||||
|
||||
## Parity-Ethereum [v2.2.9](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.9) (2019-02-03)
|
||||
|
||||
Parity-Ethereum 2.2.9-stable is a security-relevant release. A bug in the JSONRPC-deserialization module can cause crashes of all versions of Parity Ethereum nodes if an attacker is able to submit a specially-crafted RPC to certain publicly available endpoints.
|
||||
|
||||
- https://www.parity.io/security-alert-parity-ethereum-03-02/
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
- Additional tests for uint deserialization. ([#10279](https://github.com/paritytech/parity-ethereum/pull/10279)) ([#10281](https://github.com/paritytech/parity-ethereum/pull/10281))
|
||||
- Version: bump stable to 2.2.9 ([#10282](https://github.com/paritytech/parity-ethereum/pull/10282))
|
||||
|
||||
## Parity-Ethereum [v2.2.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.8) (2019-02-01)
|
||||
|
||||
Parity-Ethereum 2.2.8-stable is a consensus-relevant release that enables _St. Petersfork_ on:
|
||||
|
||||
- Ethereum Block `7280000` (along with Constantinople)
|
||||
- Kovan Block `10255201`
|
||||
- Ropsten Block `4939394`
|
||||
- POA Sokol Block `7026400`
|
||||
|
||||
In addition to this, Constantinople is cancelled for the POA Core network. Upgrading is mandatory for clients on any of these chains.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
- Backports for stable 2.2.8 ([#10224](https://github.com/paritytech/parity-ethereum/pull/10224))
|
||||
- Update for Android cross-compilation. ([#10180](https://github.com/paritytech/parity-ethereum/pull/10180))
|
||||
- Cancel Constantinople HF on POA Core ([#10198](https://github.com/paritytech/parity-ethereum/pull/10198))
|
||||
- Add EIP-1283 disable transition ([#10214](https://github.com/paritytech/parity-ethereum/pull/10214))
|
||||
- Enable St-Peters-Fork ("Constantinople Fix") ([#10223](https://github.com/paritytech/parity-ethereum/pull/10223))
|
||||
- Stable: Macos heapsize force jemalloc ([#10234](https://github.com/paritytech/parity-ethereum/pull/10234)) ([#10258](https://github.com/paritytech/parity-ethereum/pull/10258))
|
||||
|
||||
## Parity-Ethereum [v2.2.7](https://github.com/paritytech/parity-ethereum/releases/tag/v2.2.7) (2019-01-15)
|
||||
|
||||
Parity-Ethereum 2.2.7-stable is a consensus-relevant security release that reverts Constantinople on the Ethereum network. Upgrading is mandatory for Ethereum, and strongly recommended for other networks.
|
||||
|
||||
@@ -1,288 +0,0 @@
|
||||
## Parity-Ethereum [v2.3.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.8) (2019-03-22)
|
||||
|
||||
Parity-Ethereum 2.3.8-stable is a bugfix release that improves performance and stability. This patch release contains a critical bug fix where serving light clients previously led to client crashes. Upgrading is highly recommended.
|
||||
|
||||
The full list of included changes:
|
||||
- 2.3.8 stable backports ([#10507](https://github.com/paritytech/parity-ethereum/pull/10507))
|
||||
- Version: bump stable
|
||||
- Add additional request tests ([#10503](https://github.com/paritytech/parity-ethereum/pull/10503))
|
||||
|
||||
## Parity-Ethereum [v2.3.7](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.7) (2019-03-20)
|
||||
|
||||
Parity-Ethereum 2.3.7-stable is a bugfix release that improves performance and stability.
|
||||
|
||||
The full list of included changes:
|
||||
- 2.3.7 stable backports ([#10487](https://github.com/paritytech/parity-ethereum/pull/10487))
|
||||
- Version: bump stable
|
||||
- Сaching through docker volume ([#10477](https://github.com/paritytech/parity-ethereum/pull/10477))
|
||||
- fix win&mac build ([#10486](https://github.com/paritytech/parity-ethereum/pull/10486))
|
||||
- fix(extract `timestamp_checked_add` as lib) ([#10383](https://github.com/paritytech/parity-ethereum/pull/10383))
|
||||
|
||||
## Parity-Ethereum [v2.3.6](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.6) (2019-03-19)
|
||||
|
||||
Parity-Ethereum 2.3.6-stable is a bugfix release that improves performance and stability.
|
||||
|
||||
The full list of included changes:
|
||||
- 2.3.6 stable backports ([#10470](https://github.com/paritytech/parity-ethereum/pull/10470))
|
||||
- Version: bump stable
|
||||
- CI publish to aws ([#10446](https://github.com/paritytech/parity-ethereum/pull/10446))
|
||||
- Ensure static validator set changes are recognized ([#10467](https://github.com/paritytech/parity-ethereum/pull/10467))
|
||||
- CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))
|
||||
- Revert "CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))" ([#10456](https://github.com/paritytech/parity-ethereum/pull/10456))
|
||||
- Tests parallelized ([#10452](https://github.com/paritytech/parity-ethereum/pull/10452))
|
||||
|
||||
## Parity-Ethereum [v2.3.5](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.5) (2019-02-25)
|
||||
|
||||
Parity-Ethereum 2.3.5-stable is a bugfix release that improves performance and stability.
|
||||
|
||||
Note, all 2.2 releases and older are now unsupported and upgrading is recommended.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
- More Backports for Stable 2.3.5 ([#10430](https://github.com/paritytech/parity-ethereum/pull/10430))
|
||||
- Revert some changes, could be buggy ([#10399](https://github.com/paritytech/parity-ethereum/pull/10399))
|
||||
- Ci: clean up gitlab-ci.yml leftovers from previous merge ([#10429](https://github.com/paritytech/parity-ethereum/pull/10429))
|
||||
- 10000 > 5000 ([#10422](https://github.com/paritytech/parity-ethereum/pull/10422))
|
||||
- Fix underflow in pip, closes [#10419](https://github.com/paritytech/parity-ethereum/pull/10419) ([#10423](https://github.com/paritytech/parity-ethereum/pull/10423))
|
||||
- Fix panic when logging directory does not exist, closes [#10420](https://github.com/paritytech/parity-ethereum/pull/10420) ([#10424](https://github.com/paritytech/parity-ethereum/pull/10424))
|
||||
- Update hardcoded headers for Foundation, Ropsten, Kovan and Classic ([#10417](https://github.com/paritytech/parity-ethereum/pull/10417))
|
||||
- Backports for Stable 2.3.5 ([#10414](https://github.com/paritytech/parity-ethereum/pull/10414))
|
||||
- No-git for publish jobs, empty artifacts dir ([#10393](https://github.com/paritytech/parity-ethereum/pull/10393))
|
||||
- Snap: reenable i386, arm64, armhf architecture publishing ([#10386](https://github.com/paritytech/parity-ethereum/pull/10386))
|
||||
- Tx pool: always accept local transactions ([#10375](https://github.com/paritytech/parity-ethereum/pull/10375))
|
||||
- Fix to_pod storage trie value decoding ([#10368)](https://github.com/paritytech/parity-ethereum/pull/10368))
|
||||
- Version: mark 2.3.5 as stable
|
||||
|
||||
## Parity-Ethereum [v2.3.4](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.4) (2019-02-21)
|
||||
|
||||
Parity-Ethereum 2.3.4-beta is a maintenance release that fixes snap and docker installations.
|
||||
|
||||
The full list of included changes:
|
||||
- Beta: snap: release untagged versions from branches to the candidate ([#10357](https://github.com/paritytech/parity-ethereum/pull/10357)) ([#10373](https://github.com/paritytech/parity-ethereum/pull/10373))
|
||||
- Snap: release untagged versions from branches to the candidate snap channel ([#10357](https://github.com/paritytech/parity-ethereum/pull/10357))
|
||||
- Snap: add the removable-media plug ([#10377](https://github.com/paritytech/parity-ethereum/pull/10377))
|
||||
- Exchanged old(azure) bootnodes with new(ovh) ones ([#10309](https://github.com/paritytech/parity-ethereum/pull/10309))
|
||||
- Beta Backports ([#10354](https://github.com/paritytech/parity-ethereum/pull/10354))
|
||||
- Version: bump beta to 2.3.4
|
||||
- Snap: prefix version and populate candidate channel ([#10343](https://github.com/paritytech/parity-ethereum/pull/10343))
|
||||
- Snap: populate candidate releases with beta snaps to avoid stale channel
|
||||
- Snap: prefix version with v*
|
||||
- No volumes are needed, just run -v volume:/path/in/the/container ([#10345](https://github.com/paritytech/parity-ethereum/pull/10345))
|
||||
|
||||
## Parity-Ethereum [v2.3.3](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.3) (2019-02-13)
|
||||
|
||||
Parity-Ethereum 2.3.3-beta is a security-relevant release. A bug in the JSONRPC-deserialization module can cause crashes of all versions of Parity Ethereum nodes if an attacker is able to submit a specially-crafted RPC to certain publicly available endpoints.
|
||||
|
||||
- https://www.parity.io/new-parity-ethereum-update-fixes-several-rpc-vulnerabilities/
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
- Additional error for invalid gas ([#10327](https://github.com/paritytech/parity-ethereum/pull/10327)) ([#10328](https://github.com/paritytech/parity-ethereum/pull/10328))
|
||||
- Backports for Beta 2.3.3 ([#10333](https://github.com/paritytech/parity-ethereum/pull/10333))
|
||||
- Properly handle check_epoch_end_signal errors ([#10015](https://github.com/paritytech/parity-ethereum/pull/10015))
|
||||
- import rpc transactions sequentially ([#10051](https://github.com/paritytech/parity-ethereum/pull/10051))
|
||||
- fix(docker): fix not receives SIGINT ([#10059](https://github.com/paritytech/parity-ethereum/pull/10059))
|
||||
- snap: official image / test ([#10168](https://github.com/paritytech/parity-ethereum/pull/10168))
|
||||
- Extract CallContract and RegistryInfo traits into their own crate ([#10178](https://github.com/paritytech/parity-ethereum/pull/10178))
|
||||
- perform stripping during build ([#10208](https://github.com/paritytech/parity-ethereum/pull/10208))
|
||||
- Remove CallContract and RegistryInfo re-exports from `ethcore/client` ([#10205](https://github.com/paritytech/parity-ethereum/pull/10205))
|
||||
- fixed: types::transaction::SignedTransaction; ([#10229](https://github.com/paritytech/parity-ethereum/pull/10229))
|
||||
- Additional tests for uint/hash/bytes deserialization. ([#10279](https://github.com/paritytech/parity-ethereum/pull/10279))
|
||||
- Fix Windows build ([#10284](https://github.com/paritytech/parity-ethereum/pull/10284))
|
||||
- Don't run the CPP example on CI ([#10285](https://github.com/paritytech/parity-ethereum/pull/10285))
|
||||
- CI optimizations ([#10297](https://github.com/paritytech/parity-ethereum/pull/10297))
|
||||
- fix publish job ([#10317](https://github.com/paritytech/parity-ethereum/pull/10317))
|
||||
- Add Statetest support for Constantinople Fix ([#10323](https://github.com/paritytech/parity-ethereum/pull/10323))
|
||||
- Add helper for Timestamp overflows ([#10330](https://github.com/paritytech/parity-ethereum/pull/10330))
|
||||
- Don't add discovery initiators to the node table ([#10305](https://github.com/paritytech/parity-ethereum/pull/10305))
|
||||
- change docker image based on debian instead of ubuntu due to the chan ([#10336](https://github.com/paritytech/parity-ethereum/pull/10336))
|
||||
- role back docker build image and docker deploy image to ubuntu:xenial based ([#10338](https://github.com/paritytech/parity-ethereum/pull/10338))
|
||||
|
||||
## Parity-Ethereum [v2.3.2](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.2) (2019-02-03)
|
||||
|
||||
Parity-Ethereum 2.3.2-stable is a security-relevant release. A bug in the JSONRPC-deserialization module can cause crashes of all versions of Parity Ethereum nodes if an attacker is able to submit a specially-crafted RPC to certain publicly available endpoints.
|
||||
|
||||
- https://www.parity.io/security-alert-parity-ethereum-03-02/
|
||||
|
||||
The full list of included changes:
|
||||
- Version: bump beta to 2.3.2 ([#10283](https://github.com/paritytech/parity-ethereum/pull/10283))
|
||||
- Additional tests for uint deserialization. ([#10279](https://github.com/paritytech/parity-ethereum/pull/10279)) ([#10280](https://github.com/paritytech/parity-ethereum/pull/10280))
|
||||
- Backport [#10285](https://github.com/paritytech/parity-ethereum/pull/10285) to beta ([#10286](https://github.com/paritytech/parity-ethereum/pull/10286))
|
||||
|
||||
## Parity-Ethereum [v2.3.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.1) (2019-02-01)
|
||||
|
||||
Parity-Ethereum 2.3.1-beta is a consensus-relevant release that enables _St. Petersfork_ on:
|
||||
|
||||
- Ethereum Block `7280000` (along with Constantinople)
|
||||
- Kovan Block `10255201`
|
||||
- Ropsten Block `4939394`
|
||||
- POA Sokol Block `7026400`
|
||||
|
||||
In addition to this, Constantinople is cancelled for the POA Core network. Upgrading is mandatory for clients on any of these chains.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
- Backports for beta 2.3.1 ([#10225](https://github.com/paritytech/parity-ethereum/pull/10225))
|
||||
- Fix _cannot recursively call into `Core`_ issue ([#10144](https://github.com/paritytech/parity-ethereum/pull/10144))
|
||||
- Update for Android cross-compilation. ([#10180](https://github.com/paritytech/parity-ethereum/pull/10180))
|
||||
- Fix _cannot recursively call into `Core`_ - Part 2 ([#10195](https://github.com/paritytech/parity-ethereum/pull/10195))
|
||||
- Cancel Constantinople HF on POA Core ([#10198](https://github.com/paritytech/parity-ethereum/pull/10198))
|
||||
- Add EIP-1283 disable transition ([#10214](https://github.com/paritytech/parity-ethereum/pull/10214))
|
||||
- Enable St-Peters-Fork ("Constantinople Fix") ([#10223](https://github.com/paritytech/parity-ethereum/pull/10223))
|
||||
- Beta: Macos heapsize force jemalloc ([#10234](https://github.com/paritytech/parity-ethereum/pull/10234)) ([#10259](https://github.com/paritytech/parity-ethereum/pull/10259))
|
||||
|
||||
## Parity-Ethereum [v2.3.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.3.0) (2019-01-16)
|
||||
|
||||
Parity-Ethereum 2.3.0-beta is a consensus-relevant security release that reverts Constantinople on the Ethereum network. Upgrading is mandatory for Ethereum, and strongly recommended for other networks.
|
||||
|
||||
- **Consensus** - Ethereum Network: Pull Constantinople protocol upgrade on Ethereum ([#10189](https://github.com/paritytech/parity-ethereum/pull/10189))
|
||||
- Read more: [Security Alert: Ethereum Constantinople Postponement](https://blog.ethereum.org/2019/01/15/security-alert-ethereum-constantinople-postponement/)
|
||||
- **Networking** - All networks: Ping nodes from discovery ([#10167](https://github.com/paritytech/parity-ethereum/pull/10167))
|
||||
- **Wasm** - Kovan Network: Update pwasm-utils to 0.6.1 ([#10134](https://github.com/paritytech/parity-ethereum/pull/10134))
|
||||
|
||||
Other notable changes:
|
||||
|
||||
- Existing blocks in the database are now kept when restoring a Snapshot. ([#8643](https://github.com/paritytech/parity-ethereum/pull/8643))
|
||||
- Block and transaction propagation is improved significantly. ([#9954](https://github.com/paritytech/parity-ethereum/pull/9954))
|
||||
- The ERC-191 Signed Data Standard is now supported by `personal_sign191`. ([#9701](https://github.com/paritytech/parity-ethereum/pull/9701))
|
||||
- Add support for ERC-191/712 `eth_signTypedData` as a standard for machine-verifiable and human-readable typed data signing with Ethereum keys. ([#9631](https://github.com/paritytech/parity-ethereum/pull/9631))
|
||||
- Add support for ERC-1186 `eth_getProof` ([#9001](https://github.com/paritytech/parity-ethereum/pull/9001))
|
||||
- Add experimental RPCs flag to enable ERC-191, ERC-712, and ERC-1186 APIs via `--jsonrpc-experimental` ([#9928](https://github.com/paritytech/parity-ethereum/pull/9928))
|
||||
- Make `CALLCODE` to trace value to be the code address. ([#9881](https://github.com/paritytech/parity-ethereum/pull/9881))
|
||||
|
||||
Configuration changes:
|
||||
|
||||
- The EIP-98 transition is now disabled by default. If you previously had no `eip98transition` specified in your chain specification, you would enable this now manually on block `0x0`. ([#9955](https://github.com/paritytech/parity-ethereum/pull/9955))
|
||||
- Also, unknown fields in chain specs are now rejected. ([#9972](https://github.com/paritytech/parity-ethereum/pull/9972))
|
||||
- The Tendermint engine was removed from Parity Ethereum and is no longer available and maintained. ([#9980](https://github.com/paritytech/parity-ethereum/pull/9980))
|
||||
- Ropsten testnet data and keys moved from `test/` to `ropsten/` subdir. To reuse your old keys and data either copy or symlink them to the new location. ([#10123](https://github.com/paritytech/parity-ethereum/pull/10123))
|
||||
- Strict empty steps validation ([#10041](https://github.com/paritytech/parity-ethereum/pull/10041))
|
||||
- If you have a chain with`empty_steps` already running, some blocks most likely contain non-strict entries (unordered or duplicated empty steps). In this release `strict_empty_steps_transition` is enabled by default at block `0x0` for any chain with `empty_steps`.
|
||||
- If your network uses `empty_steps` you **must** (A) plan a hard fork and change `strict_empty_steps_transition` to the desired fork block and (B) update the clients of the whole network to 2.2.7-stable / 2.3.0-beta. If for some reason you don't want to do this please set`strict_empty_steps_transition` to `0xfffffffff` to disable it.
|
||||
|
||||
_Note:_ This release marks Parity 2.3 as _beta_. All versions of Parity 2.2 are now considered _stable_.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
- Backports for 2.3.0 beta ([#10164](https://github.com/paritytech/parity-ethereum/pull/10164))
|
||||
- Snap: fix path in script ([#10157](https://github.com/paritytech/parity-ethereum/pull/10157))
|
||||
- Make sure parent block is not in importing queue when importing ancient blocks ([#10138](https://github.com/paritytech/parity-ethereum/pull/10138))
|
||||
- Ci: re-enable snap publishing ([#10142](https://github.com/paritytech/parity-ethereum/pull/10142))
|
||||
- Hf in POA Core (2019-01-18) - Constantinople ([#10155](https://github.com/paritytech/parity-ethereum/pull/10155))
|
||||
- Update EWF's tobalaba chainspec ([#10152](https://github.com/paritytech/parity-ethereum/pull/10152))
|
||||
- Replace ethcore-logger with env-logger. ([#10102](https://github.com/paritytech/parity-ethereum/pull/10102))
|
||||
- Finality: dont require chain head to be in the chain ([#10054](https://github.com/paritytech/parity-ethereum/pull/10054))
|
||||
- Remove caching for node connections ([#10143](https://github.com/paritytech/parity-ethereum/pull/10143))
|
||||
- Blooms file iterator empty on out of range position. ([#10145](https://github.com/paritytech/parity-ethereum/pull/10145))
|
||||
- Autogen docs for the "Configuring Parity Ethereum" wiki page. ([#10067](https://github.com/paritytech/parity-ethereum/pull/10067))
|
||||
- Misc: bump license header to 2019 ([#10135](https://github.com/paritytech/parity-ethereum/pull/10135))
|
||||
- Hide most of the logs from cpp example. ([#10139](https://github.com/paritytech/parity-ethereum/pull/10139))
|
||||
- Don't try to send oversized packets ([#10042](https://github.com/paritytech/parity-ethereum/pull/10042))
|
||||
- Private tx enabled flag added into STATUS packet ([#9999](https://github.com/paritytech/parity-ethereum/pull/9999))
|
||||
- Update pwasm-utils to 0.6.1 ([#10134](https://github.com/paritytech/parity-ethereum/pull/10134))
|
||||
- Extract blockchain from ethcore ([#10114](https://github.com/paritytech/parity-ethereum/pull/10114))
|
||||
- Ethcore: update hardcoded headers ([#10123](https://github.com/paritytech/parity-ethereum/pull/10123))
|
||||
- Identity fix ([#10128](https://github.com/paritytech/parity-ethereum/pull/10128))
|
||||
- Use LenCachingMutex to optimize verification. ([#10117](https://github.com/paritytech/parity-ethereum/pull/10117))
|
||||
- Pyethereum keystore support ([#9710](https://github.com/paritytech/parity-ethereum/pull/9710))
|
||||
- Bump rocksdb-sys to 0.5.5 ([#10124](https://github.com/paritytech/parity-ethereum/pull/10124))
|
||||
- Parity-clib: `async C bindings to RPC requests` + `subscribe/unsubscribe to websocket events` ([#9920](https://github.com/paritytech/parity-ethereum/pull/9920))
|
||||
- Refactor (hardware wallet) : reduce the number of threads ([#9644](https://github.com/paritytech/parity-ethereum/pull/9644))
|
||||
- Hf in POA Sokol (2019-01-04) ([#10077](https://github.com/paritytech/parity-ethereum/pull/10077))
|
||||
- Fix broken links ([#10119](https://github.com/paritytech/parity-ethereum/pull/10119))
|
||||
- Follow-up to [#10105](https://github.com/paritytech/parity-ethereum/issues/10105) ([#10107](https://github.com/paritytech/parity-ethereum/pull/10107))
|
||||
- Move EIP-712 crate back to parity-ethereum ([#10106](https://github.com/paritytech/parity-ethereum/pull/10106))
|
||||
- Move a bunch of stuff around ([#10101](https://github.com/paritytech/parity-ethereum/pull/10101))
|
||||
- Revert "Add --frozen when running cargo ([#10081](https://github.com/paritytech/parity-ethereum/pull/10081))" ([#10105](https://github.com/paritytech/parity-ethereum/pull/10105))
|
||||
- Fix left over small grumbles on whitespaces ([#10084](https://github.com/paritytech/parity-ethereum/pull/10084))
|
||||
- Add --frozen when running cargo ([#10081](https://github.com/paritytech/parity-ethereum/pull/10081))
|
||||
- Fix pubsub new_blocks notifications to include all blocks ([#9987](https://github.com/paritytech/parity-ethereum/pull/9987))
|
||||
- Update some dependencies for compilation with pc-windows-gnu ([#10082](https://github.com/paritytech/parity-ethereum/pull/10082))
|
||||
- Fill transaction hash on ethGetLog of light client. ([#9938](https://github.com/paritytech/parity-ethereum/pull/9938))
|
||||
- Update changelog update for 2.2.5-beta and 2.1.10-stable ([#10064](https://github.com/paritytech/parity-ethereum/pull/10064))
|
||||
- Implement len caching for parking_lot RwLock ([#10032](https://github.com/paritytech/parity-ethereum/pull/10032))
|
||||
- Update parking_lot to 0.7 ([#10050](https://github.com/paritytech/parity-ethereum/pull/10050))
|
||||
- Bump crossbeam. ([#10048](https://github.com/paritytech/parity-ethereum/pull/10048))
|
||||
- Ethcore: enable constantinople on ethereum ([#10031](https://github.com/paritytech/parity-ethereum/pull/10031))
|
||||
- Strict empty steps validation ([#10041](https://github.com/paritytech/parity-ethereum/pull/10041))
|
||||
- Center the Subtitle, use some CAPS ([#10034](https://github.com/paritytech/parity-ethereum/pull/10034))
|
||||
- Change test miner max memory to malloc reports. ([#10024](https://github.com/paritytech/parity-ethereum/pull/10024))
|
||||
- Sort the storage for private state ([#10018](https://github.com/paritytech/parity-ethereum/pull/10018))
|
||||
- Fix: test corpus_inaccessible panic ([#10019](https://github.com/paritytech/parity-ethereum/pull/10019))
|
||||
- Ci: move future releases to ethereum subdir on s3 ([#10017](https://github.com/paritytech/parity-ethereum/pull/10017))
|
||||
- Light(on_demand): decrease default time window to 10 secs ([#10016](https://github.com/paritytech/parity-ethereum/pull/10016))
|
||||
- Light client : failsafe crate (circuit breaker) ([#9790](https://github.com/paritytech/parity-ethereum/pull/9790))
|
||||
- Lencachingmutex ([#9988](https://github.com/paritytech/parity-ethereum/pull/9988))
|
||||
- Version and notification for private contract wrapper added ([#9761](https://github.com/paritytech/parity-ethereum/pull/9761))
|
||||
- Handle failing case for update account cache in require ([#9989](https://github.com/paritytech/parity-ethereum/pull/9989))
|
||||
- Add tokio runtime to ethcore io worker ([#9979](https://github.com/paritytech/parity-ethereum/pull/9979))
|
||||
- Move daemonize before creating account provider ([#10003](https://github.com/paritytech/parity-ethereum/pull/10003))
|
||||
- Docs: update changelogs ([#9990](https://github.com/paritytech/parity-ethereum/pull/9990))
|
||||
- Fix daemonize ([#10000](https://github.com/paritytech/parity-ethereum/pull/10000))
|
||||
- Fix Bloom migration ([#9992](https://github.com/paritytech/parity-ethereum/pull/9992))
|
||||
- Remove tendermint engine support ([#9980](https://github.com/paritytech/parity-ethereum/pull/9980))
|
||||
- Calculate gas for deployment transaction ([#9840](https://github.com/paritytech/parity-ethereum/pull/9840))
|
||||
- Fix unstable peers and slowness in sync ([#9967](https://github.com/paritytech/parity-ethereum/pull/9967))
|
||||
- Adds parity_verifySignature RPC method ([#9507](https://github.com/paritytech/parity-ethereum/pull/9507))
|
||||
- Improve block and transaction propagation ([#9954](https://github.com/paritytech/parity-ethereum/pull/9954))
|
||||
- Deny unknown fields for chainspec ([#9972](https://github.com/paritytech/parity-ethereum/pull/9972))
|
||||
- Fix docker build ([#9971](https://github.com/paritytech/parity-ethereum/pull/9971))
|
||||
- Ci: rearrange pipeline by logic ([#9970](https://github.com/paritytech/parity-ethereum/pull/9970))
|
||||
- Add changelogs for 2.0.9, 2.1.4, 2.1.6, and 2.2.1 ([#9963](https://github.com/paritytech/parity-ethereum/pull/9963))
|
||||
- Add Error message when sync is still in progress. ([#9475](https://github.com/paritytech/parity-ethereum/pull/9475))
|
||||
- Make CALLCODE to trace value to be the code address ([#9881](https://github.com/paritytech/parity-ethereum/pull/9881))
|
||||
- Fix light client informant while syncing ([#9932](https://github.com/paritytech/parity-ethereum/pull/9932))
|
||||
- Add a optional json dump state to evm-bin ([#9706](https://github.com/paritytech/parity-ethereum/pull/9706))
|
||||
- Disable EIP-98 transition by default ([#9955](https://github.com/paritytech/parity-ethereum/pull/9955))
|
||||
- Remove secret_store runtimes. ([#9888](https://github.com/paritytech/parity-ethereum/pull/9888))
|
||||
- Fix a deadlock ([#9952](https://github.com/paritytech/parity-ethereum/pull/9952))
|
||||
- Chore(eip712): remove unused `failure-derive` ([#9958](https://github.com/paritytech/parity-ethereum/pull/9958))
|
||||
- Do not use the home directory as the working dir in docker ([#9834](https://github.com/paritytech/parity-ethereum/pull/9834))
|
||||
- Prevent silent errors in daemon mode, closes [#9367](https://github.com/paritytech/parity-ethereum/issues/9367) ([#9946](https://github.com/paritytech/parity-ethereum/pull/9946))
|
||||
- Fix empty steps ([#9939](https://github.com/paritytech/parity-ethereum/pull/9939))
|
||||
- Adjust requests costs for light client ([#9925](https://github.com/paritytech/parity-ethereum/pull/9925))
|
||||
- Eip-1186: add `eth_getProof` RPC-Method ([#9001](https://github.com/paritytech/parity-ethereum/pull/9001))
|
||||
- Missing blocks in filter_changes RPC ([#9947](https://github.com/paritytech/parity-ethereum/pull/9947))
|
||||
- Allow rust-nightly builds fail in nightly builds ([#9944](https://github.com/paritytech/parity-ethereum/pull/9944))
|
||||
- Update eth-secp256k1 to include fix for BSDs ([#9935](https://github.com/paritytech/parity-ethereum/pull/9935))
|
||||
- Unbreak build on rust -stable ([#9934](https://github.com/paritytech/parity-ethereum/pull/9934))
|
||||
- Keep existing blocks when restoring a Snapshot ([#8643](https://github.com/paritytech/parity-ethereum/pull/8643))
|
||||
- Add experimental RPCs flag ([#9928](https://github.com/paritytech/parity-ethereum/pull/9928))
|
||||
- Clarify poll lifetime ([#9922](https://github.com/paritytech/parity-ethereum/pull/9922))
|
||||
- Docs(require rust 1.30) ([#9923](https://github.com/paritytech/parity-ethereum/pull/9923))
|
||||
- Use block header for building finality ([#9914](https://github.com/paritytech/parity-ethereum/pull/9914))
|
||||
- Simplify cargo audit ([#9918](https://github.com/paritytech/parity-ethereum/pull/9918))
|
||||
- Light-fetch: Differentiate between out-of-gas/manual throw and use required gas from response on failure ([#9824](https://github.com/paritytech/parity-ethereum/pull/9824))
|
||||
- Eip 191 ([#9701](https://github.com/paritytech/parity-ethereum/pull/9701))
|
||||
- Fix(logger): `reqwest` no longer a dependency ([#9908](https://github.com/paritytech/parity-ethereum/pull/9908))
|
||||
- Remove rust-toolchain file ([#9906](https://github.com/paritytech/parity-ethereum/pull/9906))
|
||||
- Foundation: 6692865, ropsten: 4417537, kovan: 9363457 ([#9907](https://github.com/paritytech/parity-ethereum/pull/9907))
|
||||
- Ethcore: use Machine::verify_transaction on parent block ([#9900](https://github.com/paritytech/parity-ethereum/pull/9900))
|
||||
- Chore(rpc-tests): remove unused rand ([#9896](https://github.com/paritytech/parity-ethereum/pull/9896))
|
||||
- Fix: Intermittent failing CI due to addr in use ([#9885](https://github.com/paritytech/parity-ethereum/pull/9885))
|
||||
- Chore(bump docopt): 0.8 -> 1.0 ([#9889](https://github.com/paritytech/parity-ethereum/pull/9889))
|
||||
- Use expect ([#9883](https://github.com/paritytech/parity-ethereum/pull/9883))
|
||||
- Use Weak reference in PubSubClient ([#9886](https://github.com/paritytech/parity-ethereum/pull/9886))
|
||||
- Ci: nuke the gitlab caches ([#9855](https://github.com/paritytech/parity-ethereum/pull/9855))
|
||||
- Remove unused code ([#9884](https://github.com/paritytech/parity-ethereum/pull/9884))
|
||||
- Fix json tracer overflow ([#9873](https://github.com/paritytech/parity-ethereum/pull/9873))
|
||||
- Allow to seal work on latest block ([#9876](https://github.com/paritytech/parity-ethereum/pull/9876))
|
||||
- Fix docker script ([#9854](https://github.com/paritytech/parity-ethereum/pull/9854))
|
||||
- Health endpoint ([#9847](https://github.com/paritytech/parity-ethereum/pull/9847))
|
||||
- Gitlab-ci: make android release build succeed ([#9743](https://github.com/paritytech/parity-ethereum/pull/9743))
|
||||
- Clean up existing benchmarks ([#9839](https://github.com/paritytech/parity-ethereum/pull/9839))
|
||||
- Update Callisto block reward code to support HF1 ([#9811](https://github.com/paritytech/parity-ethereum/pull/9811))
|
||||
- Option to disable keep alive for JSON-RPC http transport ([#9848](https://github.com/paritytech/parity-ethereum/pull/9848))
|
||||
- Classic.json Bootnode Update ([#9828](https://github.com/paritytech/parity-ethereum/pull/9828))
|
||||
- Support MIX. ([#9767](https://github.com/paritytech/parity-ethereum/pull/9767))
|
||||
- Ci: remove failing tests for android, windows, and macos ([#9788](https://github.com/paritytech/parity-ethereum/pull/9788))
|
||||
- Implement NoProof for json tests and update tests reference (replaces [#9744](https://github.com/paritytech/parity-ethereum/issues/9744)) ([#9814](https://github.com/paritytech/parity-ethereum/pull/9814))
|
||||
- Chore(bump regex) ([#9842](https://github.com/paritytech/parity-ethereum/pull/9842))
|
||||
- Ignore global cache for patched accounts ([#9752](https://github.com/paritytech/parity-ethereum/pull/9752))
|
||||
- Move state root verification before gas used ([#9841](https://github.com/paritytech/parity-ethereum/pull/9841))
|
||||
- Fix(docker-aarch64) : cross-compile config ([#9798](https://github.com/paritytech/parity-ethereum/pull/9798))
|
||||
- Version: bump nightly to 2.3.0 ([#9819](https://github.com/paritytech/parity-ethereum/pull/9819))
|
||||
- Tests modification for windows CI ([#9671](https://github.com/paritytech/parity-ethereum/pull/9671))
|
||||
- Eip-712 implementation ([#9631](https://github.com/paritytech/parity-ethereum/pull/9631))
|
||||
- Fix typo ([#9826](https://github.com/paritytech/parity-ethereum/pull/9826))
|
||||
- Clean up serde rename and use rename_all = camelCase when possible ([#9823](https://github.com/paritytech/parity-ethereum/pull/9823))
|
||||
@@ -1,128 +0,0 @@
|
||||
## Parity-Ethereum [v2.4.9](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.9)
|
||||
|
||||
Parity Ethereum v2.4.9-stable is a security update which addresses servo/rust-smallvec#148
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* cargo update -p smallvec ([#10822](https://github.com/paritytech/parity-ethereum/pull/10822))
|
||||
|
||||
## Parity-Ethereum [v2.4.8](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.8)
|
||||
|
||||
Parity-Ethereum 2.4.8-stable is a bugfix release that improves performance and stability.
|
||||
|
||||
* Blockchain: fix reset chain
|
||||
* State tests: treat empty accounts the same as non-existant accounts (EIP 1052)
|
||||
* Aura: fix Timestamp Overflow
|
||||
* Networking: support discovery-only peers (geth bootnodes)
|
||||
* Snapshotting: fix unclean shutdown while snappshotting is under way
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* ethcore/res: activate atlantis classic hf on block 8772000 ([#10766](https://github.com/paritytech/parity-ethereum/pull/10766))
|
||||
* fix docker tags for publishing ([#10741](https://github.com/paritytech/parity-ethereum/pull/10741))
|
||||
* Reset blockchain properly ([#10669](https://github.com/paritytech/parity-ethereum/pull/10669))
|
||||
* adds rpc error message for --no-ancient-blocks ([#10608](https://github.com/paritytech/parity-ethereum/pull/10608))
|
||||
* Treat empty account the same as non-exist accounts in EIP-1052 ([#10775](https://github.com/paritytech/parity-ethereum/pull/10775))
|
||||
* fix: aura don't add `SystemTime::now()` ([#10720](https://github.com/paritytech/parity-ethereum/pull/10720))
|
||||
* DevP2p: Get node IP address and udp port from Socket, if not included in PING packet ([#10705](https://github.com/paritytech/parity-ethereum/pull/10705))
|
||||
* Revert "fix: aura don't add `SystemTime::now()` ([#10720](https://github.com/paritytech/parity-ethereum/pull/10720))"
|
||||
* Add a way to signal shutdown to snapshotting threads ([#10744](https://github.com/paritytech/parity-ethereum/pull/10744))
|
||||
|
||||
## Parity-Ethereum [v2.4.7](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.7)
|
||||
|
||||
Parity-Ethereum 2.4.7-stable is a bugfix release that improves performance and stability.
|
||||
|
||||
Among others, it enables the _Atlantis_ hardfork on **Morden** and **Kotti** Classic networks.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* [CI] allow cargo audit to fail ([#10676](https://github.com/paritytech/parity-ethereum/pull/10676))
|
||||
* new image ([#10673](https://github.com/paritytech/parity-ethereum/pull/10673))
|
||||
* Update publishing ([#10644](https://github.com/paritytech/parity-ethereum/pull/10644))
|
||||
* enable lto for release builds ([#10717](https://github.com/paritytech/parity-ethereum/pull/10717))
|
||||
* Use RUSTFLAGS to set the optimization level ([#10719](https://github.com/paritytech/parity-ethereum/pull/10719))
|
||||
* ethcore: enable ECIP-1054 for classic ([#10731](https://github.com/paritytech/parity-ethereum/pull/10731))
|
||||
|
||||
## Parity-Ethereum [v2.4.6](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.6)
|
||||
|
||||
Parity-Ethereum 2.4.6-stable is a bugfix release that improves performance and stability.
|
||||
|
||||
Among others, it enables the Petersburg hardfork on **Rinkeby** and **POA-Core** Network, as well as the **Kovan** Network community hardfork.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* ci: publish docs debug ([#10638](https://github.com/paritytech/parity-ethereum/pull/10638))
|
||||
|
||||
## Parity-Ethereum [v2.4.5](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.5)
|
||||
|
||||
Parity-Ethereum 2.4.5-stable is a bugfix release that improves performance and stability. This release improves memory optimizations around timestamp handling and stabilizes the 2.4 release branch.
|
||||
|
||||
As of today, Parity-Ethereum 2.3 reaches end of life and everyone is encouraged to upgrade.
|
||||
|
||||
## Parity-Ethereum [v2.4.4](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.4)
|
||||
|
||||
Parity-Ethereum 2.4.4-beta is a bugfix release that improves performance and stability. This patch release removes the dead chain configs for Easthub and Ethereum Social.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* fix(rpc-types): replace uint and hash with `ethereum_types v0.4` ([#10217](https://github.com/paritytech/parity-ethereum/pull/10217))
|
||||
* chore(bump ethereum-types) ([#10396](https://github.com/paritytech/parity-ethereum/pull/10396))
|
||||
* fix(light eth_gasPrice): ask network if not in cache ([#10535](https://github.com/paritytech/parity-ethereum/pull/10535))
|
||||
* fix(light account response): update `tx_queue` ([#10545](https://github.com/paritytech/parity-ethereum/pull/10545))
|
||||
* fix(bump dependencies) ([#10540](https://github.com/paritytech/parity-ethereum/pull/10540))
|
||||
* tx-pool: check transaction readiness before replacing ([#10526](https://github.com/paritytech/parity-ethereum/pull/10526))
|
||||
* fix #10390 ([#10391](https://github.com/paritytech/parity-ethereum/pull/10391))
|
||||
* private-tx: replace error_chain ([#10510](https://github.com/paritytech/parity-ethereum/pull/10510))
|
||||
|
||||
## Parity-Ethereum [v2.4.3](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.3)
|
||||
|
||||
Parity-Ethereum 2.4.3-beta is a bugfix release that improves performance and stability. This patch release contains a critical bug fix where serving light clients previously led to client crashes. Upgrading is highly recommended.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* Add additional request tests ([#10503](https://github.com/paritytech/parity-ethereum/pull/10503))
|
||||
|
||||
## Parity-Ethereum [v2.4.2](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.2)
|
||||
|
||||
Parity-Ethereum 2.4.2-beta is a bugfix release that improves performance and stability.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* Сaching through docker volume ([#10477](https://github.com/paritytech/parity-ethereum/pull/10477))
|
||||
* fix win&mac build ([#10486](https://github.com/paritytech/parity-ethereum/pull/10486))
|
||||
* fix(extract `timestamp_checked_add` as lib) ([#10383](https://github.com/paritytech/parity-ethereum/pull/10383))
|
||||
|
||||
## Parity-Ethereum [v2.4.1](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.1)
|
||||
|
||||
Parity-Ethereum 2.4.1-beta is a bugfix release that improves performance and stability.
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* Implement parity_versionInfo & parity_setChain on LC; fix parity_setChain ([#10312](https://github.com/paritytech/parity-ethereum/pull/10312))
|
||||
* CI publish to aws ([#10446](https://github.com/paritytech/parity-ethereum/pull/10446))
|
||||
* CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))
|
||||
* Revert "CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))" (#10456)
|
||||
* Revert "CI aws git checkout ([#10451](https://github.com/paritytech/parity-ethereum/pull/10451))"
|
||||
* Tests parallelized ([#10452](https://github.com/paritytech/parity-ethereum/pull/10452))
|
||||
* Ensure static validator set changes are recognized ([#10467](https://github.com/paritytech/parity-ethereum/pull/10467))
|
||||
|
||||
## Parity-Ethereum [v2.4.0](https://github.com/paritytech/parity-ethereum/releases/tag/v2.4.0)
|
||||
|
||||
Parity-Ethereum 2.4.0-beta is our trifortnightly minor version release coming with a lot of new features as well as bugfixes and performance improvements.
|
||||
|
||||
Notable changes:
|
||||
- Account management is now deprecated ([#10213](https://github.com/paritytech/parity-ethereum/pull/10213))
|
||||
- Local accounts can now be specified via CLI ([#9960](https://github.com/paritytech/parity-ethereum/pull/9960))
|
||||
- Chains can now be reset to a particular block via CLI ([#9782](https://github.com/paritytech/parity-ethereum/pull/9782))
|
||||
- Ethash now additionally implements ProgPoW ([#9762](https://github.com/paritytech/parity-ethereum/pull/9762))
|
||||
- The `eip1283DisableTransition` flag was added to revert EIP-1283 ([#10214](https://github.com/paritytech/parity-ethereum/pull/10214))
|
||||
|
||||
The full list of included changes:
|
||||
|
||||
* revert some changes, could be buggy ([#10399](https://github.com/paritytech/parity-ethereum/pull/10399))
|
||||
* 10000 > 5000 ([#10422](https://github.com/paritytech/parity-ethereum/pull/10422))
|
||||
* fix panic when logging directory does not exist, closes #10420 ([#10424](https://github.com/paritytech/parity-ethereum/pull/10424))
|
||||
* fix underflow in pip, closes #10419 ([#10423](https://github.com/paritytech/parity-ethereum/pull/10423))
|
||||
* ci: clean up gitlab-ci.yml leftovers from previous merge ([#10429](https://github.com/paritytech/parity-ethereum/pull/10429))
|
||||
* Update hardcoded headers for Foundation, Ropsten, Kovan and Classic ([#10417](https://github.com/paritytech/parity-ethereum/pull/10417))
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[package]
|
||||
description = "Parity Ethereum Ethash & ProgPoW Implementations"
|
||||
name = "ethash"
|
||||
version = "1.12.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
description = "Parity Ethereum (EthCore) Library"
|
||||
description = "Ethcore library"
|
||||
homepage = "http://parity.io"
|
||||
license = "GPL-3.0"
|
||||
name = "ethcore"
|
||||
@@ -12,8 +12,7 @@ blooms-db = { path = "../util/blooms-db", optional = true }
|
||||
bn = { git = "https://github.com/paritytech/bn", default-features = false }
|
||||
byteorder = "1.0"
|
||||
common-types = { path = "types" }
|
||||
crossbeam-utils = "0.6"
|
||||
eip-152 = { version = "0.1", path = "../util/EIP-152" }
|
||||
crossbeam = "0.4"
|
||||
env_logger = { version = "0.5", optional = true }
|
||||
error-chain = { version = "0.12", default-features = false }
|
||||
ethabi = "6.0"
|
||||
@@ -40,7 +39,7 @@ keccak-hasher = { path = "../util/keccak-hasher" }
|
||||
kvdb = "0.1"
|
||||
kvdb-memorydb = "0.1"
|
||||
kvdb-rocksdb = { version = "0.1.3", optional = true }
|
||||
lazy_static = "1.2.0"
|
||||
lazy_static = "1.0"
|
||||
len-caching-lock = { path = "../util/len-caching-lock" }
|
||||
log = "0.4"
|
||||
lru-cache = "0.1"
|
||||
@@ -51,12 +50,13 @@ num = { version = "0.1", default-features = false, features = ["bigint"] }
|
||||
num_cpus = "1.2"
|
||||
parity-bytes = "0.1"
|
||||
parity-crypto = "0.3.0"
|
||||
parity-machine = { path = "../machine" }
|
||||
parity-snappy = "0.1"
|
||||
parking_lot = "0.7"
|
||||
trie-db = "0.11.0"
|
||||
patricia-trie-ethereum = { path = "../util/patricia-trie-ethereum" }
|
||||
rand = "0.4"
|
||||
rayon = "1.1"
|
||||
rayon = "1.0"
|
||||
rlp = { version = "0.3.0", features = ["ethereum"] }
|
||||
rlp_derive = { path = "../util/rlp-derive" }
|
||||
rustc-hex = "1.0"
|
||||
@@ -78,7 +78,6 @@ criterion = "0.2"
|
||||
env_logger = "0.5"
|
||||
ethcore-accounts = { path = "../accounts" }
|
||||
fetch = { path = "../util/fetch" }
|
||||
hex-literal = "0.2.1"
|
||||
kvdb-rocksdb = "0.1.3"
|
||||
parity-runtime = { path = "../util/runtime" }
|
||||
rlp_compress = { path = "../util/rlp-compress" }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
description = "Parity Ethereum Blockchain Database, Test Generator, Configuration, Caching, Importing Blocks, and Block Information"
|
||||
description = "Ethcore blockchain database"
|
||||
homepage = "http://parity.io"
|
||||
license = "GPL-3.0"
|
||||
name = "ethcore-blockchain"
|
||||
@@ -8,28 +8,26 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
ansi_term = "0.11"
|
||||
ansi_term = "0.10"
|
||||
blooms-db = { path = "../../util/blooms-db" }
|
||||
common-types = { path = "../types" }
|
||||
ethcore-db = { path = "../db" }
|
||||
ethereum-types = "0.4"
|
||||
heapsize = "0.4"
|
||||
itertools = "0.5"
|
||||
keccak-hash = "0.1"
|
||||
kvdb = "0.1"
|
||||
log = "0.4"
|
||||
parity-bytes = "0.1"
|
||||
parking_lot = "0.7"
|
||||
rand = "0.6"
|
||||
rayon = "1.1"
|
||||
rayon = "1.0"
|
||||
rlp = { version = "0.3.0", features = ["ethereum"] }
|
||||
rlp_compress = { path = "../../util/rlp-compress" }
|
||||
rlp_derive = { path = "../../util/rlp-derive" }
|
||||
triehash-ethereum = { version = "0.2", path = "../../util/triehash-ethereum" }
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.5"
|
||||
ethkey = { path = "../../accounts/ethkey" }
|
||||
keccak-hash = "0.1"
|
||||
rustc-hex = "1.0"
|
||||
tempdir = "0.3"
|
||||
kvdb-memorydb = "0.1"
|
||||
|
||||
@@ -668,6 +668,21 @@ impl BlockChain {
|
||||
self.db.key_value().read_with_cache(db::COL_EXTRA, &self.block_details, parent).map_or(false, |d| d.children.contains(hash))
|
||||
}
|
||||
|
||||
/// fetches the list of blocks from best block to n, and n's parent hash
|
||||
/// where n > 0
|
||||
pub fn block_headers_from_best_block(&self, n: u32) -> Option<(Vec<encoded::Header>, H256)> {
|
||||
let mut blocks = Vec::with_capacity(n as usize);
|
||||
let mut hash = self.best_block_hash();
|
||||
|
||||
for _ in 0..n {
|
||||
let current_hash = self.block_header_data(&hash)?;
|
||||
hash = current_hash.parent_hash();
|
||||
blocks.push(current_hash);
|
||||
}
|
||||
|
||||
Some((blocks, hash))
|
||||
}
|
||||
|
||||
/// Returns a tree route between `from` and `to`, which is a tuple of:
|
||||
///
|
||||
/// - a vector of hashes of all blocks, ordered from `from` to `to`.
|
||||
@@ -713,10 +728,6 @@ impl BlockChain {
|
||||
///
|
||||
/// If the tree route verges into pruned or unknown blocks,
|
||||
/// `None` is returned.
|
||||
///
|
||||
/// `is_from_route_finalized` returns whether the `from` part of the
|
||||
/// route contains a finalized block. This only holds if the two parts (from
|
||||
/// and to) are on different branches, ie. on 2 different forks.
|
||||
pub fn tree_route(&self, from: H256, to: H256) -> Option<TreeRoute> {
|
||||
let mut from_branch = vec![];
|
||||
let mut is_from_route_finalized = false;
|
||||
@@ -730,9 +741,9 @@ impl BlockChain {
|
||||
// reset from && to to the same level
|
||||
while from_details.number > to_details.number {
|
||||
from_branch.push(current_from);
|
||||
is_from_route_finalized = is_from_route_finalized || from_details.is_finalized;
|
||||
current_from = from_details.parent.clone();
|
||||
from_details = self.block_details(&from_details.parent)?;
|
||||
is_from_route_finalized = is_from_route_finalized || from_details.is_finalized;
|
||||
}
|
||||
|
||||
while to_details.number > from_details.number {
|
||||
@@ -746,9 +757,9 @@ impl BlockChain {
|
||||
// move to shared parent
|
||||
while current_from != current_to {
|
||||
from_branch.push(current_from);
|
||||
is_from_route_finalized = is_from_route_finalized || from_details.is_finalized;
|
||||
current_from = from_details.parent.clone();
|
||||
from_details = self.block_details(&from_details.parent)?;
|
||||
is_from_route_finalized = is_from_route_finalized || from_details.is_finalized;
|
||||
|
||||
to_branch.push(current_to);
|
||||
current_to = to_details.parent.clone();
|
||||
@@ -858,14 +869,6 @@ impl BlockChain {
|
||||
}
|
||||
}
|
||||
|
||||
/// clears all caches for testing purposes
|
||||
pub fn clear_cache(&self) {
|
||||
self.block_bodies.write().clear();
|
||||
self.block_details.write().clear();
|
||||
self.block_hashes.write().clear();
|
||||
self.block_headers.write().clear();
|
||||
}
|
||||
|
||||
/// Update the best ancient block to the given hash, after checking that
|
||||
/// it's directly linked to the currently known best ancient block
|
||||
pub fn update_best_ancient_block(&self, hash: &H256) {
|
||||
@@ -2495,74 +2498,4 @@ mod tests {
|
||||
assert_eq!(bc.epoch_transition_for(fork_hash).unwrap().block_number, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tree_rout_with_finalization() {
|
||||
let genesis = BlockBuilder::genesis();
|
||||
let a = genesis.add_block();
|
||||
// First branch
|
||||
let a1 = a.add_block_with_random_transactions();
|
||||
let a2 = a1.add_block_with_random_transactions();
|
||||
let a3 = a2.add_block_with_random_transactions();
|
||||
// Second branch
|
||||
let b1 = a.add_block_with_random_transactions();
|
||||
let b2 = b1.add_block_with_random_transactions();
|
||||
|
||||
let a_hash = a.last().hash();
|
||||
let a1_hash = a1.last().hash();
|
||||
let a2_hash = a2.last().hash();
|
||||
let a3_hash = a3.last().hash();
|
||||
let b2_hash = b2.last().hash();
|
||||
|
||||
let bootstrap_chain = |blocks: Vec<&BlockBuilder>| {
|
||||
let db = new_db();
|
||||
let bc = new_chain(genesis.last().encoded(), db.clone());
|
||||
let mut batch = db.key_value().transaction();
|
||||
for block in blocks {
|
||||
insert_block_batch(&mut batch, &bc, block.last().encoded(), vec![]);
|
||||
bc.commit();
|
||||
}
|
||||
db.key_value().write(batch).unwrap();
|
||||
(db, bc)
|
||||
};
|
||||
|
||||
let mark_finalized = |block_hash: H256, db: &Arc<dyn BlockChainDB>, bc: &BlockChain| {
|
||||
let mut batch = db.key_value().transaction();
|
||||
bc.mark_finalized(&mut batch, block_hash).unwrap();
|
||||
bc.commit();
|
||||
db.key_value().write(batch).unwrap();
|
||||
};
|
||||
|
||||
// Case 1: fork, with finalized common ancestor
|
||||
{
|
||||
let (db, bc) = bootstrap_chain(vec![&a, &a1, &a2, &a3, &b1, &b2]);
|
||||
assert_eq!(bc.best_block_hash(), a3_hash);
|
||||
assert_eq!(bc.block_hash(2).unwrap(), a1_hash);
|
||||
|
||||
mark_finalized(a_hash, &db, &bc);
|
||||
assert!(!bc.tree_route(a3_hash, b2_hash).unwrap().is_from_route_finalized);
|
||||
assert!(!bc.tree_route(b2_hash, a3_hash).unwrap().is_from_route_finalized);
|
||||
}
|
||||
|
||||
// Case 2: fork with a finalized block on a branch
|
||||
{
|
||||
let (db, bc) = bootstrap_chain(vec![&a, &a1, &a2, &a3, &b1, &b2]);
|
||||
assert_eq!(bc.best_block_hash(), a3_hash);
|
||||
assert_eq!(bc.block_hash(2).unwrap(), a1_hash);
|
||||
|
||||
mark_finalized(a2_hash, &db, &bc);
|
||||
assert!(bc.tree_route(a3_hash, b2_hash).unwrap().is_from_route_finalized);
|
||||
assert!(!bc.tree_route(b2_hash, a3_hash).unwrap().is_from_route_finalized);
|
||||
}
|
||||
|
||||
// Case 3: no-fork, with a finalized block
|
||||
{
|
||||
let (db, bc) = bootstrap_chain(vec![&a, &a1, &a2]);
|
||||
assert_eq!(bc.best_block_hash(), a2_hash);
|
||||
|
||||
mark_finalized(a1_hash, &db, &bc);
|
||||
assert!(!bc.tree_route(a1_hash, a2_hash).unwrap().is_from_route_finalized);
|
||||
assert!(!bc.tree_route(a2_hash, a1_hash).unwrap().is_from_route_finalized);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,11 @@ use ethereum_types::{U256, H256, Bloom};
|
||||
|
||||
use common_types::encoded;
|
||||
use common_types::header::Header;
|
||||
use common_types::transaction::{SignedTransaction, Transaction, Action};
|
||||
use common_types::transaction::SignedTransaction;
|
||||
use common_types::view;
|
||||
use common_types::views::BlockView;
|
||||
use keccak_hash::keccak;
|
||||
use rlp::encode;
|
||||
use rlp_derive::RlpEncodable;
|
||||
use triehash_ethereum::ordered_trie_root;
|
||||
|
||||
/// Helper structure, used for encoding blocks.
|
||||
#[derive(Default, Clone, RlpEncodable)]
|
||||
@@ -138,29 +136,6 @@ impl BlockBuilder {
|
||||
})
|
||||
}
|
||||
|
||||
/// Add a block with randomly generated transactions.
|
||||
#[inline]
|
||||
pub fn add_block_with_random_transactions(&self) -> Self {
|
||||
// Maximum of ~50 transactions
|
||||
let count = rand::random::<u8>() as usize / 5;
|
||||
let transactions = std::iter::repeat_with(|| {
|
||||
let data_len = rand::random::<u8>();
|
||||
let data = std::iter::repeat_with(|| rand::random::<u8>())
|
||||
.take(data_len as usize)
|
||||
.collect::<Vec<_>>();
|
||||
Transaction {
|
||||
nonce: 0.into(),
|
||||
gas_price: 0.into(),
|
||||
gas: 100_000.into(),
|
||||
action: Action::Create,
|
||||
value: 100.into(),
|
||||
data,
|
||||
}.sign(&keccak("").into(), None)
|
||||
}).take(count);
|
||||
|
||||
self.add_block_with_transactions(transactions)
|
||||
}
|
||||
|
||||
/// Add a block with given transactions.
|
||||
#[inline]
|
||||
pub fn add_block_with_transactions<T>(&self, transactions: T) -> Self
|
||||
@@ -191,15 +166,11 @@ impl BlockBuilder {
|
||||
let mut block = Block::default();
|
||||
let metadata = get_metadata();
|
||||
let block_number = parent_number + 1;
|
||||
let transactions = metadata.transactions;
|
||||
let transactions_root = ordered_trie_root(transactions.iter().map(rlp::encode));
|
||||
|
||||
block.header.set_parent_hash(parent_hash);
|
||||
block.header.set_number(block_number);
|
||||
block.header.set_log_bloom(metadata.bloom);
|
||||
block.header.set_difficulty(metadata.difficulty);
|
||||
block.header.set_transactions_root(transactions_root);
|
||||
block.transactions = transactions;
|
||||
block.transactions = metadata.transactions;
|
||||
|
||||
parent_hash = block.hash();
|
||||
parent_number = block_number;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[package]
|
||||
description = "Parity Ethereum (EthCore) Contract Calls and Blockchain Service & Registry Information"
|
||||
name = "ethcore-call-contract"
|
||||
version = "0.1.0"
|
||||
license = "GPL-3.0"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[package]
|
||||
description = "Parity Ethereum Virtual Machine (EVM) Rust Implementation"
|
||||
name = "evm"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
@@ -20,7 +19,6 @@ num-bigint = "0.2"
|
||||
[dev-dependencies]
|
||||
rustc-hex = "1.0"
|
||||
criterion = "0.2"
|
||||
hex-literal = "0.2.0"
|
||||
|
||||
[features]
|
||||
evm-debug = []
|
||||
|
||||
@@ -44,18 +44,12 @@ pub trait Finalize {
|
||||
impl Finalize for Result<GasLeft> {
|
||||
fn finalize<E: Ext>(self, ext: E) -> Result<FinalizationResult> {
|
||||
match self {
|
||||
Ok(GasLeft::Known(gas_left)) => {
|
||||
Ok(FinalizationResult {
|
||||
gas_left,
|
||||
apply_state: true,
|
||||
return_data: ReturnData::empty()
|
||||
})
|
||||
},
|
||||
Ok(GasLeft::NeedsReturn { gas_left, data, apply_state }) => {
|
||||
ext.ret(&gas_left, &data, apply_state).map(|gas_left|
|
||||
FinalizationResult { gas_left, apply_state, return_data: data }
|
||||
)
|
||||
},
|
||||
Ok(GasLeft::Known(gas_left)) => Ok(FinalizationResult { gas_left: gas_left, apply_state: true, return_data: ReturnData::empty() }),
|
||||
Ok(GasLeft::NeedsReturn { gas_left, data, apply_state }) => ext.ret(&gas_left, &data, apply_state).map(|gas_left| FinalizationResult {
|
||||
gas_left: gas_left,
|
||||
apply_state: apply_state,
|
||||
return_data: data,
|
||||
}),
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ impl Factory {
|
||||
/// for caching jump destinations.
|
||||
pub fn new(evm: VMType, cache_size: usize) -> Self {
|
||||
Factory {
|
||||
evm,
|
||||
evm: evm,
|
||||
evm_cache: Arc::new(SharedCache::new(cache_size)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,10 +149,6 @@ enum_with_from_u8! {
|
||||
DIFFICULTY = 0x44,
|
||||
#[doc = "get the block's gas limit"]
|
||||
GASLIMIT = 0x45,
|
||||
#[doc = "get chain ID"]
|
||||
CHAINID = 0x46,
|
||||
#[doc = "get balance of own account"]
|
||||
SELFBALANCE = 0x47,
|
||||
|
||||
#[doc = "remove item from stack"]
|
||||
POP = 0x50,
|
||||
@@ -446,7 +442,12 @@ pub struct InstructionInfo {
|
||||
impl InstructionInfo {
|
||||
/// Create new instruction info.
|
||||
pub fn new(name: &'static str, args: usize, ret: usize, tier: GasPriceTier) -> Self {
|
||||
InstructionInfo { name, args, ret, tier }
|
||||
InstructionInfo {
|
||||
name: name,
|
||||
args: args,
|
||||
ret: ret,
|
||||
tier: tier
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,8 +504,6 @@ lazy_static! {
|
||||
arr[NUMBER as usize] = Some(InstructionInfo::new("NUMBER", 0, 1, GasPriceTier::Base));
|
||||
arr[DIFFICULTY as usize] = Some(InstructionInfo::new("DIFFICULTY", 0, 1, GasPriceTier::Base));
|
||||
arr[GASLIMIT as usize] = Some(InstructionInfo::new("GASLIMIT", 0, 1, GasPriceTier::Base));
|
||||
arr[CHAINID as usize] = Some(InstructionInfo::new("CHAINID", 0, 1, GasPriceTier::Base));
|
||||
arr[SELFBALANCE as usize] = Some(InstructionInfo::new("SELFBALANCE", 0, 1, GasPriceTier::Low));
|
||||
arr[POP as usize] = Some(InstructionInfo::new("POP", 1, 0, GasPriceTier::Base));
|
||||
arr[MLOAD as usize] = Some(InstructionInfo::new("MLOAD", 1, 1, GasPriceTier::VeryLow));
|
||||
arr[MSTORE as usize] = Some(InstructionInfo::new("MSTORE", 2, 0, GasPriceTier::VeryLow));
|
||||
|
||||
@@ -121,9 +121,6 @@ impl<Gas: evm::CostType> Gasometer<Gas> {
|
||||
Request::Gas(Gas::from(1))
|
||||
},
|
||||
instructions::SSTORE => {
|
||||
if schedule.eip1706 && self.current_gas <= Gas::from(schedule.call_stipend) {
|
||||
return Err(vm::Error::OutOfGas);
|
||||
}
|
||||
let address = H256::from(stack.peek(0));
|
||||
let newval = stack.peek(1);
|
||||
let val = U256::from(&*ext.storage_at(&address)?);
|
||||
|
||||
@@ -119,6 +119,8 @@ enum InstructionResult<Gas> {
|
||||
Trap(TrapKind),
|
||||
}
|
||||
|
||||
enum Never {}
|
||||
|
||||
/// ActionParams without code, so that it can be feed into CodeReader.
|
||||
#[derive(Debug)]
|
||||
struct InterpreterParams {
|
||||
@@ -176,6 +178,12 @@ pub enum InterpreterResult {
|
||||
Trap(TrapKind),
|
||||
}
|
||||
|
||||
impl From<vm::Error> for InterpreterResult {
|
||||
fn from(error: vm::Error) -> InterpreterResult {
|
||||
InterpreterResult::Done(Err(error))
|
||||
}
|
||||
}
|
||||
|
||||
/// Intepreter EVM implementation
|
||||
pub struct Interpreter<Cost: CostType> {
|
||||
mem: Vec<u8>,
|
||||
@@ -286,8 +294,6 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
cache, params, reader, informant,
|
||||
valid_jump_destinations, gasometer, stack,
|
||||
done: false,
|
||||
// Overridden in `step_inner` based on
|
||||
// the result of `ext.trace_next_instruction`.
|
||||
do_trace: true,
|
||||
mem: Vec::new(),
|
||||
return_data: ReturnData::empty(),
|
||||
@@ -308,26 +314,21 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
let result = if self.gasometer.is_none() {
|
||||
InterpreterResult::Done(Err(vm::Error::OutOfGas))
|
||||
} else if self.reader.len() == 0 {
|
||||
let current_gas = self.gasometer
|
||||
.as_ref()
|
||||
.expect("Gasometer None case is checked above; qed")
|
||||
.current_gas
|
||||
.as_u256();
|
||||
InterpreterResult::Done(Ok(GasLeft::Known(current_gas)))
|
||||
InterpreterResult::Done(Ok(GasLeft::Known(self.gasometer.as_ref().expect("Gasometer None case is checked above; qed").current_gas.as_u256())))
|
||||
} else {
|
||||
self.step_inner(ext)
|
||||
self.step_inner(ext).err().expect("step_inner never returns Ok(()); qed")
|
||||
};
|
||||
|
||||
if let &InterpreterResult::Done(_) = &result {
|
||||
self.done = true;
|
||||
self.informant.done();
|
||||
}
|
||||
result
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Inner helper function for step.
|
||||
#[inline(always)]
|
||||
fn step_inner(&mut self, ext: &mut dyn vm::Ext) -> InterpreterResult {
|
||||
fn step_inner(&mut self, ext: &mut vm::Ext) -> Result<Never, InterpreterResult> {
|
||||
let result = match self.resume_result.take() {
|
||||
Some(result) => result,
|
||||
None => {
|
||||
@@ -342,31 +343,22 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
|
||||
let instruction = match instruction {
|
||||
Some(i) => i,
|
||||
None => return InterpreterResult::Done(Err(vm::Error::BadInstruction {
|
||||
None => return Err(InterpreterResult::Done(Err(vm::Error::BadInstruction {
|
||||
instruction: opcode
|
||||
})),
|
||||
}))),
|
||||
};
|
||||
|
||||
let info = instruction.info();
|
||||
self.last_stack_ret_len = info.ret;
|
||||
if let Err(e) = self.verify_instruction(ext, instruction, info) {
|
||||
return InterpreterResult::Done(Err(e));
|
||||
};
|
||||
self.verify_instruction(ext, instruction, info)?;
|
||||
|
||||
// Calculate gas cost
|
||||
let requirements = match self.gasometer.as_mut().expect(GASOMETER_PROOF).requirements(ext, instruction, info, &self.stack, self.mem.size()) {
|
||||
Ok(t) => t,
|
||||
Err(e) => return InterpreterResult::Done(Err(e)),
|
||||
};
|
||||
let requirements = self.gasometer.as_mut().expect(GASOMETER_PROOF).requirements(ext, instruction, info, &self.stack, self.mem.size())?;
|
||||
if self.do_trace {
|
||||
ext.trace_prepare_execute(self.reader.position - 1, opcode, requirements.gas_cost.as_u256(), Self::mem_written(instruction, &self.stack), Self::store_written(instruction, &self.stack));
|
||||
}
|
||||
if let Err(e) = self.gasometer.as_mut().expect(GASOMETER_PROOF).verify_gas(&requirements.gas_cost) {
|
||||
if self.do_trace {
|
||||
ext.trace_failed();
|
||||
}
|
||||
return InterpreterResult::Done(Err(e));
|
||||
}
|
||||
|
||||
self.gasometer.as_mut().expect(GASOMETER_PROOF).verify_gas(&requirements.gas_cost)?;
|
||||
self.mem.expand(requirements.memory_required_size);
|
||||
self.gasometer.as_mut().expect(GASOMETER_PROOF).current_mem_gas = requirements.memory_total_gas;
|
||||
self.gasometer.as_mut().expect(GASOMETER_PROOF).current_gas = self.gasometer.as_mut().expect(GASOMETER_PROOF).current_gas - requirements.gas_cost;
|
||||
@@ -375,24 +367,18 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
|
||||
// Execute instruction
|
||||
let current_gas = self.gasometer.as_mut().expect(GASOMETER_PROOF).current_gas;
|
||||
let result = match self.exec_instruction(
|
||||
let result = self.exec_instruction(
|
||||
current_gas, ext, instruction, requirements.provide_gas
|
||||
) {
|
||||
Err(x) => {
|
||||
if self.do_trace {
|
||||
ext.trace_failed();
|
||||
}
|
||||
return InterpreterResult::Done(Err(x));
|
||||
},
|
||||
Ok(x) => x,
|
||||
};
|
||||
)?;
|
||||
|
||||
evm_debug!({ self.informant.after_instruction(instruction) });
|
||||
|
||||
result
|
||||
},
|
||||
};
|
||||
|
||||
if let InstructionResult::Trap(trap) = result {
|
||||
return InterpreterResult::Trap(trap);
|
||||
return Err(InterpreterResult::Trap(trap));
|
||||
}
|
||||
|
||||
if let InstructionResult::UnusedGas(ref gas) = result {
|
||||
@@ -414,31 +400,28 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
self.valid_jump_destinations = Some(self.cache.jump_destinations(&self.params.code_hash, &self.reader.code));
|
||||
}
|
||||
let jump_destinations = self.valid_jump_destinations.as_ref().expect("jump_destinations are initialized on first jump; qed");
|
||||
let pos = match self.verify_jump(position, jump_destinations) {
|
||||
Ok(x) => x,
|
||||
Err(e) => return InterpreterResult::Done(Err(e))
|
||||
};
|
||||
let pos = self.verify_jump(position, jump_destinations)?;
|
||||
self.reader.position = pos;
|
||||
},
|
||||
InstructionResult::StopExecutionNeedsReturn {gas, init_off, init_size, apply} => {
|
||||
let mem = mem::replace(&mut self.mem, Vec::new());
|
||||
return InterpreterResult::Done(Ok(GasLeft::NeedsReturn {
|
||||
return Err(InterpreterResult::Done(Ok(GasLeft::NeedsReturn {
|
||||
gas_left: gas.as_u256(),
|
||||
data: mem.into_return_data(init_off, init_size),
|
||||
apply_state: apply
|
||||
}));
|
||||
})));
|
||||
},
|
||||
InstructionResult::StopExecution => {
|
||||
return InterpreterResult::Done(Ok(GasLeft::Known(self.gasometer.as_mut().expect(GASOMETER_PROOF).current_gas.as_u256())));
|
||||
return Err(InterpreterResult::Done(Ok(GasLeft::Known(self.gasometer.as_mut().expect(GASOMETER_PROOF).current_gas.as_u256()))));
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
if self.reader.position >= self.reader.len() {
|
||||
return InterpreterResult::Done(Ok(GasLeft::Known(self.gasometer.as_mut().expect(GASOMETER_PROOF).current_gas.as_u256())));
|
||||
return Err(InterpreterResult::Done(Ok(GasLeft::Known(self.gasometer.as_mut().expect(GASOMETER_PROOF).current_gas.as_u256()))));
|
||||
}
|
||||
|
||||
InterpreterResult::Continue
|
||||
Err(InterpreterResult::Continue)
|
||||
}
|
||||
|
||||
fn verify_instruction(&self, ext: &vm::Ext, instruction: Instruction, info: &InstructionInfo) -> vm::Result<()> {
|
||||
@@ -450,9 +433,7 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
((instruction == instructions::RETURNDATACOPY || instruction == instructions::RETURNDATASIZE) && !schedule.have_return_data) ||
|
||||
(instruction == instructions::REVERT && !schedule.have_revert) ||
|
||||
((instruction == instructions::SHL || instruction == instructions::SHR || instruction == instructions::SAR) && !schedule.have_bitwise_shifting) ||
|
||||
(instruction == instructions::EXTCODEHASH && !schedule.have_extcodehash) ||
|
||||
(instruction == instructions::CHAINID && !schedule.have_chain_id) ||
|
||||
(instruction == instructions::SELFBALANCE && !schedule.have_selfbalance)
|
||||
(instruction == instructions::EXTCODEHASH && !schedule.have_extcodehash)
|
||||
{
|
||||
return Err(vm::Error::BadInstruction {
|
||||
instruction: instruction as u8
|
||||
@@ -867,12 +848,6 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
instructions::GASLIMIT => {
|
||||
self.stack.push(ext.env_info().gas_limit.clone());
|
||||
},
|
||||
instructions::CHAINID => {
|
||||
self.stack.push(ext.chain_id().into())
|
||||
},
|
||||
instructions::SELFBALANCE => {
|
||||
self.stack.push(ext.balance(&self.params.address)?);
|
||||
}
|
||||
|
||||
// Stack instructions
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@ extern crate log;
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate rustc_hex;
|
||||
#[cfg(test)]
|
||||
extern crate hex_literal;
|
||||
|
||||
pub mod evm;
|
||||
pub mod interpreter;
|
||||
|
||||
@@ -25,7 +25,6 @@ use vm::{self, ActionParams, ActionValue, Ext};
|
||||
use vm::tests::{FakeExt, FakeCall, FakeCallType, test_finalize};
|
||||
use factory::Factory;
|
||||
use vmtype::VMType;
|
||||
use hex_literal::hex;
|
||||
|
||||
evm_test!{test_add: test_add_int}
|
||||
fn test_add(factory: super::Factory) {
|
||||
@@ -109,32 +108,6 @@ fn test_origin(factory: super::Factory) {
|
||||
assert_store(&ext, 0, "000000000000000000000000cd1722f2947def4cf144679da39c4c32bdc35681");
|
||||
}
|
||||
|
||||
evm_test!{test_selfbalance: test_selfbalance_int}
|
||||
fn test_selfbalance(factory: super::Factory) {
|
||||
let own_addr = Address::from_str("1337000000000000000000000000000000000000").unwrap();
|
||||
// 47 SELFBALANCE
|
||||
// 60 ff PUSH ff
|
||||
// 55 SSTORE
|
||||
let code = hex!("47 60 ff 55").to_vec();
|
||||
|
||||
let mut params = ActionParams::default();
|
||||
params.address = own_addr.clone();
|
||||
params.gas = U256::from(100_000);
|
||||
params.code = Some(Arc::new(code));
|
||||
let mut ext = FakeExt::new_istanbul();
|
||||
ext.balances = {
|
||||
let mut x = HashMap::new();
|
||||
x.insert(own_addr, U256::from(1_025)); // 0x401
|
||||
x
|
||||
};
|
||||
let gas_left = {
|
||||
let vm = factory.create(params, ext.schedule(), ext.depth());
|
||||
test_finalize(vm.exec(&mut ext).ok().unwrap()).unwrap()
|
||||
};
|
||||
assert_eq!(gas_left, U256::from(79_992)); // TODO[dvdplm]: do the sums here, SELFBALANCE-5 + PUSH1-3 + ONEBYTE-4 + SSTORE-?? = 100_000 - 79_992
|
||||
assert_store(&ext, 0xff, "0000000000000000000000000000000000000000000000000000000000000401");
|
||||
}
|
||||
|
||||
evm_test!{test_sender: test_sender_int}
|
||||
fn test_sender(factory: super::Factory) {
|
||||
let address = Address::from_str("0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6").unwrap();
|
||||
@@ -157,27 +130,6 @@ fn test_sender(factory: super::Factory) {
|
||||
assert_store(&ext, 0, "000000000000000000000000cd1722f2947def4cf144679da39c4c32bdc35681");
|
||||
}
|
||||
|
||||
evm_test!{test_chain_id: test_chain_id_int}
|
||||
fn test_chain_id(factory: super::Factory) {
|
||||
// 46 CHAINID
|
||||
// 60 00 PUSH 0
|
||||
// 55 SSTORE
|
||||
let code = hex!("46 60 00 55").to_vec();
|
||||
|
||||
let mut params = ActionParams::default();
|
||||
params.gas = U256::from(100_000);
|
||||
params.code = Some(Arc::new(code));
|
||||
let mut ext = FakeExt::new_istanbul().with_chain_id(9);
|
||||
|
||||
let gas_left = {
|
||||
let vm = factory.create(params, ext.schedule(), ext.depth());
|
||||
test_finalize(vm.exec(&mut ext).ok().unwrap()).unwrap()
|
||||
};
|
||||
|
||||
assert_eq!(gas_left, U256::from(79_995));
|
||||
assert_store(&ext, 0, "0000000000000000000000000000000000000000000000000000000000000009");
|
||||
}
|
||||
|
||||
evm_test!{test_extcodecopy: test_extcodecopy_int}
|
||||
fn test_extcodecopy(factory: super::Factory) {
|
||||
// 33 - sender
|
||||
@@ -310,6 +262,7 @@ fn test_calldataload(factory: super::Factory) {
|
||||
|
||||
assert_eq!(gas_left, U256::from(79_991));
|
||||
assert_store(&ext, 0, "23ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff23");
|
||||
|
||||
}
|
||||
|
||||
evm_test!{test_author: test_author_int}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[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)"
|
||||
description = "Parity Light Client Implementation"
|
||||
homepage = "http://parity.io"
|
||||
license = "GPL-3.0"
|
||||
name = "ethcore-light"
|
||||
|
||||
@@ -24,6 +24,7 @@ use std::marker::PhantomData;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use ethcore::executed::{Executed, ExecutionError};
|
||||
use futures::{Poll, Future, Async};
|
||||
use futures::sync::oneshot::{self, Receiver};
|
||||
use network::PeerId;
|
||||
@@ -40,10 +41,10 @@ use cache::Cache;
|
||||
use request::{self as basic_request, Request as NetworkRequest};
|
||||
use self::request::CheckedRequest;
|
||||
|
||||
pub use ethcore::executed::ExecutionResult;
|
||||
pub use self::request::{Request, Response, HeaderRef, Error as ValidityError};
|
||||
pub use self::request_guard::{RequestGuard, Error as RequestError};
|
||||
pub use self::response_guard::{ResponseGuard, Error as ResponseGuardError, Inner as ResponseGuardInner};
|
||||
|
||||
pub use types::request::ResponseError;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -53,6 +54,9 @@ pub mod request;
|
||||
mod request_guard;
|
||||
mod response_guard;
|
||||
|
||||
/// The result of execution
|
||||
pub type ExecutionResult = Result<Executed, ExecutionError>;
|
||||
|
||||
/// The initial backoff interval for OnDemand queries
|
||||
pub const DEFAULT_REQUEST_MIN_BACKOFF_DURATION: Duration = Duration::from_secs(10);
|
||||
/// The maximum request interval for OnDemand queries
|
||||
@@ -66,10 +70,6 @@ pub const DEFAULT_NUM_CONSECUTIVE_FAILED_REQUESTS: usize = 1;
|
||||
|
||||
/// OnDemand related errors
|
||||
pub mod error {
|
||||
// Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting`
|
||||
// https://github.com/paritytech/parity-ethereum/issues/10302
|
||||
#![allow(deprecated)]
|
||||
|
||||
use futures::sync::oneshot::Canceled;
|
||||
|
||||
error_chain! {
|
||||
@@ -94,24 +94,6 @@ pub mod error {
|
||||
}
|
||||
}
|
||||
|
||||
/// Public interface for performing network requests `OnDemand`
|
||||
pub trait OnDemandRequester: Send + Sync {
|
||||
/// Submit a strongly-typed batch of requests.
|
||||
///
|
||||
/// Fails if back-reference are not coherent.
|
||||
fn request<T>(&self, ctx: &BasicContext, requests: T) -> Result<OnResponses<T>, basic_request::NoSuchOutput>
|
||||
where
|
||||
T: request::RequestAdapter;
|
||||
|
||||
/// Submit a vector of requests to be processed together.
|
||||
///
|
||||
/// Fails if back-references are not coherent.
|
||||
/// The returned vector of responses will correspond to the requests exactly.
|
||||
fn request_raw(&self, ctx: &BasicContext, requests: Vec<Request>)
|
||||
-> Result<Receiver<PendingResponse>, basic_request::NoSuchOutput>;
|
||||
}
|
||||
|
||||
|
||||
// relevant peer info.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
struct Peer {
|
||||
@@ -373,74 +355,6 @@ pub struct OnDemand {
|
||||
request_number_of_consecutive_errors: usize
|
||||
}
|
||||
|
||||
impl OnDemandRequester for OnDemand {
|
||||
fn request_raw(&self, ctx: &BasicContext, requests: Vec<Request>)
|
||||
-> Result<Receiver<PendingResponse>, basic_request::NoSuchOutput>
|
||||
{
|
||||
let (sender, receiver) = oneshot::channel();
|
||||
if requests.is_empty() {
|
||||
assert!(sender.send(Ok(Vec::new())).is_ok(), "receiver still in scope; qed");
|
||||
return Ok(receiver);
|
||||
}
|
||||
|
||||
let mut builder = basic_request::Builder::default();
|
||||
|
||||
let responses = Vec::with_capacity(requests.len());
|
||||
|
||||
let mut header_producers = HashMap::new();
|
||||
for (i, request) in requests.into_iter().enumerate() {
|
||||
let request = CheckedRequest::from(request);
|
||||
|
||||
// ensure that all requests needing headers will get them.
|
||||
if let Some((idx, field)) = request.needs_header() {
|
||||
// a request chain with a header back-reference is valid only if it both
|
||||
// points to a request that returns a header and has the same back-reference
|
||||
// for the block hash.
|
||||
match header_producers.get(&idx) {
|
||||
Some(ref f) if &field == *f => {}
|
||||
_ => return Err(basic_request::NoSuchOutput),
|
||||
}
|
||||
}
|
||||
if let CheckedRequest::HeaderByHash(ref req, _) = request {
|
||||
header_producers.insert(i, req.0);
|
||||
}
|
||||
|
||||
builder.push(request)?;
|
||||
}
|
||||
|
||||
let requests = builder.build();
|
||||
let net_requests = requests.clone().map_requests(|req| req.into_net_request());
|
||||
let capabilities = guess_capabilities(requests.requests());
|
||||
|
||||
self.submit_pending(ctx, Pending {
|
||||
requests,
|
||||
net_requests,
|
||||
required_capabilities: capabilities,
|
||||
responses,
|
||||
sender,
|
||||
request_guard: RequestGuard::new(
|
||||
self.request_number_of_consecutive_errors as u32,
|
||||
self.request_backoff_rounds_max,
|
||||
self.request_backoff_start,
|
||||
self.request_backoff_max,
|
||||
),
|
||||
response_guard: ResponseGuard::new(self.response_time_window),
|
||||
});
|
||||
|
||||
Ok(receiver)
|
||||
}
|
||||
|
||||
fn request<T>(&self, ctx: &BasicContext, requests: T) -> Result<OnResponses<T>, basic_request::NoSuchOutput>
|
||||
where T: request::RequestAdapter
|
||||
{
|
||||
self.request_raw(ctx, requests.make_requests()).map(|recv| OnResponses {
|
||||
receiver: recv,
|
||||
_marker: PhantomData,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl OnDemand {
|
||||
|
||||
/// Create a new `OnDemand` service with the given cache.
|
||||
@@ -501,6 +415,77 @@ impl OnDemand {
|
||||
me
|
||||
}
|
||||
|
||||
/// Submit a vector of requests to be processed together.
|
||||
///
|
||||
/// Fails if back-references are not coherent.
|
||||
/// The returned vector of responses will correspond to the requests exactly.
|
||||
pub fn request_raw(&self, ctx: &BasicContext, requests: Vec<Request>)
|
||||
-> Result<Receiver<PendingResponse>, basic_request::NoSuchOutput>
|
||||
{
|
||||
let (sender, receiver) = oneshot::channel();
|
||||
if requests.is_empty() {
|
||||
assert!(sender.send(Ok(Vec::new())).is_ok(), "receiver still in scope; qed");
|
||||
return Ok(receiver);
|
||||
}
|
||||
|
||||
let mut builder = basic_request::Builder::default();
|
||||
|
||||
let responses = Vec::with_capacity(requests.len());
|
||||
|
||||
let mut header_producers = HashMap::new();
|
||||
for (i, request) in requests.into_iter().enumerate() {
|
||||
let request = CheckedRequest::from(request);
|
||||
|
||||
// ensure that all requests needing headers will get them.
|
||||
if let Some((idx, field)) = request.needs_header() {
|
||||
// a request chain with a header back-reference is valid only if it both
|
||||
// points to a request that returns a header and has the same back-reference
|
||||
// for the block hash.
|
||||
match header_producers.get(&idx) {
|
||||
Some(ref f) if &field == *f => {}
|
||||
_ => return Err(basic_request::NoSuchOutput),
|
||||
}
|
||||
}
|
||||
if let CheckedRequest::HeaderByHash(ref req, _) = request {
|
||||
header_producers.insert(i, req.0);
|
||||
}
|
||||
|
||||
builder.push(request)?;
|
||||
}
|
||||
|
||||
let requests = builder.build();
|
||||
let net_requests = requests.clone().map_requests(|req| req.into_net_request());
|
||||
let capabilities = guess_capabilities(requests.requests());
|
||||
|
||||
self.submit_pending(ctx, Pending {
|
||||
requests,
|
||||
net_requests,
|
||||
required_capabilities: capabilities,
|
||||
responses,
|
||||
sender,
|
||||
request_guard: RequestGuard::new(
|
||||
self.request_number_of_consecutive_errors as u32,
|
||||
self.request_backoff_rounds_max,
|
||||
self.request_backoff_start,
|
||||
self.request_backoff_max,
|
||||
),
|
||||
response_guard: ResponseGuard::new(self.response_time_window),
|
||||
});
|
||||
|
||||
Ok(receiver)
|
||||
}
|
||||
|
||||
/// Submit a strongly-typed batch of requests.
|
||||
///
|
||||
/// Fails if back-reference are not coherent.
|
||||
pub fn request<T>(&self, ctx: &BasicContext, requests: T) -> Result<OnResponses<T>, basic_request::NoSuchOutput>
|
||||
where T: request::RequestAdapter
|
||||
{
|
||||
self.request_raw(ctx, requests.make_requests()).map(|recv| OnResponses {
|
||||
receiver: recv,
|
||||
_marker: PhantomData,
|
||||
})
|
||||
}
|
||||
|
||||
// maybe dispatch pending requests.
|
||||
// sometimes
|
||||
|
||||
@@ -29,7 +29,7 @@ use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
use std::thread;
|
||||
|
||||
use super::{request, OnDemand, OnDemandRequester, Peer, HeaderRef};
|
||||
use super::{request, OnDemand, Peer, HeaderRef};
|
||||
|
||||
// useful contexts to give the service.
|
||||
enum Context {
|
||||
|
||||
@@ -275,7 +275,8 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn batch_tx_index_backreference_public_api() {
|
||||
#[should_panic]
|
||||
fn batch_tx_index_backreference_wrong_output() {
|
||||
let mut builder = Builder::default();
|
||||
builder.push(Request::HeaderProof(IncompleteHeaderProofRequest {
|
||||
num: 100.into(), // header proof puts hash at output 0.
|
||||
@@ -285,16 +286,11 @@ mod tests {
|
||||
})).unwrap();
|
||||
|
||||
let mut batch = builder.build();
|
||||
batch.requests[1].fill(|_req_idx, _out_idx| Ok(Output::Number(42)));
|
||||
|
||||
assert!(batch.next_complete().is_some());
|
||||
let hdr_proof_res = header_proof::Response {
|
||||
proof: vec![],
|
||||
hash: 12.into(),
|
||||
td: 21.into(),
|
||||
};
|
||||
batch.supply_response_unchecked(&hdr_proof_res);
|
||||
|
||||
assert!(batch.next_complete().is_some());
|
||||
batch.next_complete();
|
||||
batch.answered += 1;
|
||||
batch.next_complete();
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -314,4 +310,23 @@ mod tests {
|
||||
batch.answered += 1;
|
||||
assert!(batch.next_complete().is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn batch_receipts_backreference_wrong_output() {
|
||||
let mut builder = Builder::default();
|
||||
builder.push(Request::HeaderProof(IncompleteHeaderProofRequest {
|
||||
num: 100.into(), // header proof puts hash at output 0.
|
||||
})).unwrap();
|
||||
builder.push(Request::Receipts(IncompleteReceiptsRequest {
|
||||
hash: Field::BackReference(0, 0),
|
||||
})).unwrap();
|
||||
|
||||
let mut batch = builder.build();
|
||||
batch.requests[1].fill(|_req_idx, _out_idx| Ok(Output::Number(42)));
|
||||
|
||||
batch.next_complete();
|
||||
batch.answered += 1;
|
||||
batch.next_complete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
description = "Parity Smart Contract based Node Filter, Manage Permissions of Network Connections"
|
||||
description = "Parity smart network connections"
|
||||
homepage = "http://parity.io"
|
||||
license = "GPL-3.0"
|
||||
name = "node-filter"
|
||||
|
||||
@@ -36,7 +36,7 @@ serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
tiny-keccak = "1.4"
|
||||
transaction-pool = "2.0.1"
|
||||
transaction-pool = "2.0"
|
||||
url = "1"
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -60,7 +60,7 @@ pub trait Encryptor: Send + Sync + 'static {
|
||||
) -> Result<Bytes, Error>;
|
||||
}
|
||||
|
||||
/// Configuration for key server encryptor
|
||||
/// Configurtion for key server encryptor
|
||||
#[derive(Default, PartialEq, Debug, Clone)]
|
||||
pub struct EncryptorConfig {
|
||||
/// URL to key server
|
||||
|
||||
@@ -277,12 +277,13 @@ impl Provider {
|
||||
|
||||
fn pool_client<'a>(&'a self, nonce_cache: &'a NonceCache, local_accounts: &'a HashSet<Address>) -> miner::pool_client::PoolClient<'a, Client> {
|
||||
let engine = self.client.engine();
|
||||
let refuse_service_transactions = true;
|
||||
miner::pool_client::PoolClient::new(
|
||||
&*self.client,
|
||||
nonce_cache,
|
||||
engine,
|
||||
local_accounts,
|
||||
None, // refuse_service_transactions = true
|
||||
refuse_service_transactions,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -46,50 +46,9 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "balance": "1", "builtin": { "name": "modexp", "activate_at": 0, "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "balance": "1", "builtin": { "name": "alt_bn128_add", "activate_at": 0, "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "balance": "1", "builtin": { "name": "alt_bn128_mul", "activate_at": 0, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "balance": "1", "builtin": { "name": "alt_bn128_pairing", "activate_at": 0, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
"9cce34f7ab185c7aba1b7c8140d620b4bda941d6": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,50 +49,9 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "balance": "1", "builtin": { "name": "modexp", "activate_at": 0, "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "balance": "1", "builtin": { "name": "alt_bn128_add", "activate_at": 0, "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "balance": "1", "builtin": { "name": "alt_bn128_mul", "activate_at": 0, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "balance": "1", "builtin": { "name": "alt_bn128_pairing", "activate_at": 0, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
"9cce34f7ab185c7aba1b7c8140d620b4bda941d6": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" },
|
||||
"0000000000000000000000000000000000000042": {
|
||||
"balance": "1",
|
||||
|
||||
@@ -38,50 +38,9 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "balance": "1", "builtin": { "name": "modexp", "activate_at": 0, "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "balance": "1", "builtin": { "name": "alt_bn128_add", "activate_at": 0, "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "balance": "1", "builtin": { "name": "alt_bn128_mul", "activate_at": 0, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "balance": "1", "builtin": { "name": "alt_bn128_pairing", "activate_at": 0, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
"9cce34f7ab185c7aba1b7c8140d620b4bda941d6": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,50 +34,9 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "balance": "1", "builtin": { "name": "modexp", "activate_at": 0, "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "balance": "1", "builtin": { "name": "alt_bn128_add", "activate_at": 0, "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "balance": "1", "builtin": { "name": "alt_bn128_mul", "activate_at": 0, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "balance": "1", "builtin": { "name": "alt_bn128_pairing", "activate_at": 0, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
"0000000000000000000000000000000000001337": { "balance": "1", "constructor": "60606040526000805460ff19166001179055346000575b6075806100246000396000f300606060405263ffffffff60e060020a60003504166394b91deb81146022575b6000565b34600057602c6040565b604080519115158252519081900360200190f35b60005460ff16815600a165627a7a723058207882eb60ebce23178b3fa06d4cd8e5adc17711937ccddacb18a04abca2a2c9ee0029" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,46 +54,8 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "0x00", "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": "0x00", "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": "0x00", "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": "0x00", "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,50 +72,9 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "balance": "1", "builtin": { "name": "modexp", "activate_at": 20, "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": 20,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": 20,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": 20,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "balance": "1", "builtin": { "name": "alt_bn128_add", "activate_at": 20, "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "balance": "1", "builtin": { "name": "alt_bn128_mul", "activate_at": 20, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "balance": "1", "builtin": { "name": "alt_bn128_pairing", "activate_at": 20, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
"183394f52b2c8c034835edba3bcececa6f60b5a8": {
|
||||
"balance": "100491852286952719463755404"
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"ecip1010PauseTransition": "0x2dc6c0",
|
||||
"ecip1010ContinueTransition": "0x4c4b40",
|
||||
"ecip1017EraRounds": "0x4c4b40",
|
||||
"eip100bTransition": "0x85d9a0",
|
||||
"eip100bTransition": "0x7fffffffffffffff",
|
||||
"bombDefuseTransition": "0x5a06e0"
|
||||
}
|
||||
}
|
||||
@@ -29,15 +29,15 @@
|
||||
"forkCanonHash": "0x94365e3a8c0b35089c1d1195081fe7489b528a84b22199c916180db8b28ade7f",
|
||||
"eip150Transition": "0x2625a0",
|
||||
"eip160Transition": "0x2dc6c0",
|
||||
"eip161abcTransition": "0x85d9a0",
|
||||
"eip161dTransition": "0x85d9a0",
|
||||
"eip161abcTransition": "0x7fffffffffffffff",
|
||||
"eip161dTransition": "0x7fffffffffffffff",
|
||||
"eip155Transition": "0x2dc6c0",
|
||||
"maxCodeSize": "0x6000",
|
||||
"maxCodeSizeTransition": "0x85d9a0",
|
||||
"eip140Transition": "0x85d9a0",
|
||||
"eip211Transition": "0x85d9a0",
|
||||
"eip214Transition": "0x85d9a0",
|
||||
"eip658Transition": "0x85d9a0"
|
||||
"maxCodeSizeTransition": "0x7fffffffffffffff",
|
||||
"eip140Transition": "0x7fffffffffffffff",
|
||||
"eip211Transition": "0x7fffffffffffffff",
|
||||
"eip214Transition": "0x7fffffffffffffff",
|
||||
"eip658Transition": "0x7fffffffffffffff"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
@@ -3905,7 +3905,7 @@
|
||||
"0x0000000000000000000000000000000000000005": {
|
||||
"builtin": {
|
||||
"name": "modexp",
|
||||
"activate_at": "0x85d9a0",
|
||||
"activate_at": "0x7fffffffffffffff",
|
||||
"pricing": {
|
||||
"modexp": {
|
||||
"divisor": 20
|
||||
@@ -3916,12 +3916,11 @@
|
||||
"0x0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x85d9a0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"activate_at": "0x7fffffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
"linear": {
|
||||
"base": 500,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3929,12 +3928,11 @@
|
||||
"0x0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x85d9a0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"activate_at": "0x7fffffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
"linear": {
|
||||
"base": 40000,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3942,14 +3940,11 @@
|
||||
"0x0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x85d9a0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"activate_at": "0x7fffffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
"pair": 80000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,46 +58,8 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "0x00", "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": "0x00", "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": "0x00", "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": "0x00", "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,46 +46,8 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "0x00", "pricing": { "modexp": { "divisor": 100 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": "0x00", "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": "0x00", "pricing": { "linear": { "base": 2000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": "0x00", "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,46 +66,8 @@
|
||||
"0000000000000000000000000000000000000003": { "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": 2000000, "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": 2000000,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": 2000000,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": 2000000,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": 2000000, "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": 2000000, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": 2000000, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } }
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -76,47 +76,9 @@
|
||||
"0000000000000000000000000000000000000003": { "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "0xC3500", "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0xC3500",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0xC3500",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0xC3500",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": "0xC3500", "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": "0xC3500", "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": "0xC3500", "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
"bb94f0ceb32257275b2a7a9c094c13e469b4563e": {
|
||||
"balance": "10000000000000000000000000"
|
||||
},
|
||||
|
||||
@@ -3921,11 +3921,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x42ae50",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
"linear": {
|
||||
"base": 500,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3934,11 +3933,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x42ae50",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
"linear": {
|
||||
"base": 40000,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3947,13 +3945,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x42ae50",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
"pair": 80000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,922 +0,0 @@
|
||||
{
|
||||
"name": "Görli Testnet",
|
||||
"dataDir": "goerli",
|
||||
"engine": {
|
||||
"clique": {
|
||||
"params": {
|
||||
"period": 15,
|
||||
"epoch": 30000
|
||||
}
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"accountStartNonce": "0x0",
|
||||
"chainID": "0x5",
|
||||
"eip140Transition": "0x0",
|
||||
"eip145Transition": "0x0",
|
||||
"eip150Transition": "0x0",
|
||||
"eip155Transition": "0x0",
|
||||
"eip160Transition": "0x0",
|
||||
"eip161abcTransition": "0x0",
|
||||
"eip161dTransition": "0x0",
|
||||
"eip211Transition": "0x0",
|
||||
"eip214Transition": "0x0",
|
||||
"eip658Transition": "0x0",
|
||||
"eip1014Transition": "0x0",
|
||||
"eip1052Transition": "0x0",
|
||||
"eip1283Transition": "0x0",
|
||||
"eip1283DisableTransition": "0x0",
|
||||
"gasLimitBoundDivisor": "0x400",
|
||||
"maxCodeSize": "0x6000",
|
||||
"maxCodeSizeTransition": "0x0",
|
||||
"maximumExtraDataSize": "0xffff",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID": "0x5"
|
||||
},
|
||||
"genesis": {
|
||||
"author": "0x0000000000000000000000000000000000000000",
|
||||
"difficulty": "0x1",
|
||||
"extraData": "0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"gasLimit": "0xa00000",
|
||||
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"seal": {
|
||||
"ethereum": {
|
||||
"nonce": "0x0000000000000000",
|
||||
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
},
|
||||
"timestamp": "0x5c51a607"
|
||||
},
|
||||
"nodes": [
|
||||
"enode://06333009fc9ef3c9e174768e495722a7f98fe7afd4660542e983005f85e556028410fd03278944f44cfe5437b1750b5e6bd1738f700fe7da3626d52010d2954c@51.141.15.254:30303",
|
||||
"enode://176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b@13.93.54.137:30303",
|
||||
"enode://573b6607cd59f241e30e4c4943fd50e99e2b6f42f9bd5ca111659d309c06741247f4f1e93843ad3e8c8c18b6e2d94c161b7ef67479b3938780a97134b618b5ce@52.56.136.200:30303",
|
||||
"enode://67913271d14f445689e8310270c304d42f268428f2de7a4ac0275bea97690e021df6f549f462503ff4c7a81d9dd27288867bbfa2271477d0911378b8944fae55@157.230.239.163:30303",
|
||||
"enode://a87685902a0622e9cf18c68e73a0ea45156ec53e857ef049b185a9db2296ca04d776417bf1901c0b4eacb5b26271d8694e88e3f17c20d49eb77e1a41ab26b5b3@51.141.78.53:30303",
|
||||
"enode://ae8658da8d255d1992c3ec6e62e11d6e1c5899aa1566504bc1ff96a0c9c8bd44838372be643342553817f5cc7d78f1c83a8093dee13d77b3b0a583c050c81940@18.232.185.151:30303",
|
||||
"enode://ae8658da8d255d1992c3ec6e62e11d6e1c5899aa1566504bc1ff96a0c9c8bd44838372be643342553817f5cc7d78f1c83a8093dee13d77b3b0a583c050c81940@18.232.185.151:30303",
|
||||
"enode://b477ca6d507a3f57070783eb62ba838847635f8b1a0cbffb8b7f8173f5894cf550f0225a5c279341e2d862a606e778b57180a4f1db3db78c51eadcfa4fdc6963@40.68.240.160:30303"
|
||||
],
|
||||
"accounts": {
|
||||
"0x0000000000000000000000000000000000000000": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000001": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "ecrecover",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 3000,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000002": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "sha256",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 60,
|
||||
"word": 12
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000003": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "ripemd160",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 600,
|
||||
"word": 120
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000004": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "identity",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 15,
|
||||
"word": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000005": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "modexp",
|
||||
"activate_at": "0x0",
|
||||
"pricing": {
|
||||
"modexp": {
|
||||
"divisor": 20
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000006": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000007": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000008": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x00",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000009": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000010": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000011": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000012": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000013": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000014": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000015": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000016": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000017": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000018": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000019": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000020": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000021": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000022": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000023": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000024": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000025": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000026": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000027": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000028": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000029": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000030": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000031": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000032": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000033": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000034": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000035": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000036": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000037": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000038": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000039": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000040": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000041": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000042": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000043": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000044": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000045": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000046": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000047": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000048": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000049": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000050": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000051": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000052": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000053": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000054": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000055": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000056": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000057": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000058": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000059": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000060": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000061": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000062": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000063": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000064": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000065": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000066": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000067": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000068": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000069": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000070": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000071": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000072": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000073": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000074": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000075": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000076": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000077": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000078": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000079": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000080": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000081": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000082": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000083": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000084": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000085": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000086": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000087": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000088": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000089": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000090": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000091": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000092": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000093": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000094": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000095": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000096": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000097": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000098": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000099": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000aa": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ab": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ac": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ad": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ae": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000af": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ba": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000be": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bf": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ca": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ce": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cf": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000da": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000db": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000dc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000dd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000de": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000df": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ea": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000eb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ec": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ed": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ee": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ef": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fa": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fe": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ff": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x4c2ae482593505f0163cdefc073e81c63cda4107": {
|
||||
"balance": "0x152d02c7e14af6800000"
|
||||
},
|
||||
"0xa8e8f14732658e4b51e8711931053a8a69baf2b1": {
|
||||
"balance": "0x152d02c7e14af6800000"
|
||||
},
|
||||
"0xd9a5179f091d85051d3c982785efd1455cec8699": {
|
||||
"balance": "0x84595161401484a000000"
|
||||
},
|
||||
"0xe0a2bd4258d2768837baa26a28fe71dc079f84c7": {
|
||||
"balance": "0x4a47e3c12448f4ad000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,907 +0,0 @@
|
||||
{
|
||||
"name": "Kotti Testnet",
|
||||
"dataDir": "kotti",
|
||||
"engine": {
|
||||
"clique": {
|
||||
"params": {
|
||||
"period": 15,
|
||||
"epoch": 30000
|
||||
}
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"accountStartNonce": "0x0",
|
||||
"chainID": "0x6",
|
||||
"eip140Transition": "0xaef49",
|
||||
"eip150Transition": "0x0",
|
||||
"eip155Transition": "0x0",
|
||||
"eip160Transition": "0x0",
|
||||
"eip161abcTransition": "0xaef49",
|
||||
"eip161dTransition": "0xaef49",
|
||||
"eip211Transition": "0xaef49",
|
||||
"eip214Transition": "0xaef49",
|
||||
"eip658Transition": "0xaef49",
|
||||
"gasLimitBoundDivisor": "0x400",
|
||||
"maxCodeSize": "0x6000",
|
||||
"maxCodeSizeTransition": "0xaef49",
|
||||
"maximumExtraDataSize": "0xffff",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID": "0x6"
|
||||
},
|
||||
"genesis": {
|
||||
"author": "0x0000000000000000000000000000000000000000",
|
||||
"difficulty": "0x1",
|
||||
"extraData": "0x000000000000000000000000000000000000000000000000000000000000000025b7955e43adf9c2a01a9475908702cce67f302a6aaf8cba3c9255a2b863415d4db7bae4f4bbca020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"gasLimit": "0xa00000",
|
||||
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"seal": {
|
||||
"ethereum": {
|
||||
"nonce": "0x0000000000000000",
|
||||
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
},
|
||||
"timestamp": "0x5c2d2287"
|
||||
},
|
||||
"nodes": [
|
||||
"enode://06333009fc9ef3c9e174768e495722a7f98fe7afd4660542e983005f85e556028410fd03278944f44cfe5437b1750b5e6bd1738f700fe7da3626d52010d2954c@51.141.15.254:30303",
|
||||
"enode://93c94e999be5dd854c5d82a7cf5c14822973b5d9badb56ad4974586ec4d4f1995c815af795c20bb6e0a6226d3ee55808435c4dc89baf94ee581141b064d19dfc@80.187.116.161:25720",
|
||||
"enode://ae8658da8d255d1992c3ec6e62e11d6e1c5899aa1566504bc1ff96a0c9c8bd44838372be643342553817f5cc7d78f1c83a8093dee13d77b3b0a583c050c81940@18.232.185.151:30303",
|
||||
"enode://b477ca6d507a3f57070783eb62ba838847635f8b1a0cbffb8b7f8173f5894cf550f0225a5c279341e2d862a606e778b57180a4f1db3db78c51eadcfa4fdc6963@40.68.240.160:30303"
|
||||
],
|
||||
"accounts": {
|
||||
"0x0000000000000000000000000000000000000000": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000001": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "ecrecover",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 3000,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000002": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "sha256",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 60,
|
||||
"word": 12
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000003": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "ripemd160",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 600,
|
||||
"word": 120
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000004": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "identity",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 15,
|
||||
"word": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000005": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "modexp",
|
||||
"activate_at": "0xaef49",
|
||||
"pricing": {
|
||||
"modexp": {
|
||||
"divisor": 20
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000006": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0xaef49",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000007": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0xaef49",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000008": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0xaef49",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000009": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000010": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000011": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000012": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000013": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000014": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000015": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000016": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000017": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000018": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000019": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000020": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000021": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000022": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000023": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000024": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000025": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000026": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000027": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000028": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000029": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000030": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000031": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000032": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000033": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000034": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000035": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000036": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000037": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000038": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000039": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000040": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000041": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000042": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000043": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000044": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000045": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000046": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000047": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000048": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000049": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000050": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000051": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000052": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000053": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000054": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000055": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000056": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000057": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000058": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000059": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000060": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000061": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000062": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000063": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000064": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000065": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000066": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000067": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000068": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000069": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000070": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000071": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000072": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000073": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000074": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000075": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000076": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000077": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000078": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000079": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000080": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000081": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000082": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000083": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000084": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000085": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000086": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000087": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000088": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000089": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000090": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000091": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000092": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000093": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000094": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000095": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000096": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000097": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000098": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000099": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000aa": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ab": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ac": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ad": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ae": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000af": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ba": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000be": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bf": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ca": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ce": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cf": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000da": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000db": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000dc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000dd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000de": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000df": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ea": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000eb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ec": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ed": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ee": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ef": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fa": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fe": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ff": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x25b7955e43adf9c2a01a9475908702cce67f302a": {
|
||||
"balance": "0x84595161401484a000000"
|
||||
},
|
||||
"0x6aaf8cba3c9255a2b863415d4db7bae4f4bbca02": {
|
||||
"balance": "0x4a723dc6b40b8a9a000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5344,11 +5344,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x4d50f8",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
"linear": {
|
||||
"base": 500,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5357,11 +5356,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x4d50f8",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
"linear": {
|
||||
"base": 40000,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5370,13 +5368,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x4d50f8",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
"pair": 80000
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5387,8 +5382,6 @@
|
||||
},
|
||||
"nodes": [
|
||||
"enode://f6e37b943bad3a78cb8589b1798d30d210ffd39cfcd2c8f2de4f098467fd49c667980100d919da7ca46cd50505d30989abda87f0b9339377de13d6592c22caf8@34.198.49.72:30303",
|
||||
"enode://16898006ba2cd4fa8bf9a3dfe32684c178fa861df144bfc21fe800dc4838a03e342056951fa9fd533dcb0be1219e306106442ff2cf1f7e9f8faa5f2fc1a3aa45@116.203.116.241:30303",
|
||||
"enode://2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0@3.217.96.11:30303",
|
||||
"enode://56abaf065581a5985b8c5f4f88bd202526482761ba10be9bfdcd14846dd01f652ec33fde0f8c0fd1db19b59a4c04465681fcef50e11380ca88d25996191c52de@40.71.221.215:30303",
|
||||
"enode://d07827483dc47b368eaf88454fb04b41b7452cf454e194e2bd4c14f98a3278fed5d819dbecd0d010407fc7688d941ee1e58d4f9c6354d3da3be92f55c17d7ce3@52.166.117.77:30303",
|
||||
"enode://38e6e7fd416293ed120d567a2675fe078c0205ab0671abf16982ce969823bd1f3443d590c18b321dfae7dcbe1f6ba98ef8702f255c3c9822a188abb82c53adca@51.77.66.187:30303",
|
||||
|
||||
@@ -60,47 +60,9 @@
|
||||
"0x0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0x0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0x0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": 5067000, "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0x0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": 5067000,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": 5067000,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": 5067000,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": 5067000, "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0x0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": 5067000, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0x0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": 5067000, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
"0x00521965e7bd230323c423d96c657db5b79d099f": { "balance": "1606938044258990275541962092341162602522202993782792835301376" }
|
||||
},
|
||||
"nodes": [
|
||||
|
||||
@@ -120,43 +120,38 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"0000000000000000000000000000000000000006":{
|
||||
"builtin":{
|
||||
"name":"alt_bn128_add",
|
||||
"activate_at":"0x7fffffffffffff",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
"pricing":{
|
||||
"linear":{
|
||||
"base":500,
|
||||
"word":0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"0000000000000000000000000000000000000007":{
|
||||
"builtin":{
|
||||
"name":"alt_bn128_mul",
|
||||
"activate_at":"0x7fffffffffffff",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
"pricing":{
|
||||
"linear":{
|
||||
"base":40000,
|
||||
"word":0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"0000000000000000000000000000000000000008":{
|
||||
"builtin":{
|
||||
"name":"alt_bn128_pairing",
|
||||
"activate_at":"0x7fffffffffffff",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
"pricing":{
|
||||
"alt_bn128_pairing":{
|
||||
"base":100000,
|
||||
"pair":80000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,47 +62,9 @@
|
||||
"0000000000000000000000000000000000000003": { "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": 3000000, "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": 3000000,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": 3000000,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": 3000000,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": 3000000, "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": 3000000, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": 3000000, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
"97c7f4f8f0bbf384578a9f5754ae73f37ff49ec2": { "balance": "55000000000000000000000000" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,11 +90,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x4829ba",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
"linear": {
|
||||
"base": 500,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,11 +102,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x4829ba",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
"linear": {
|
||||
"base": 40000,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,13 +114,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x4829ba",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
"pair": 80000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,43 +128,38 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"0000000000000000000000000000000000000006":{
|
||||
"builtin":{
|
||||
"name":"alt_bn128_add",
|
||||
"activate_at":"0x21e88e",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
"pricing":{
|
||||
"linear":{
|
||||
"base":500,
|
||||
"word":0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"0000000000000000000000000000000000000007":{
|
||||
"builtin":{
|
||||
"name":"alt_bn128_mul",
|
||||
"activate_at":"0x21e88e",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
"pricing":{
|
||||
"linear":{
|
||||
"base":40000,
|
||||
"word":0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"0000000000000000000000000000000000000008":{
|
||||
"builtin":{
|
||||
"name":"alt_bn128_pairing",
|
||||
"activate_at":"0x21e88e",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
"pricing":{
|
||||
"alt_bn128_pairing":{
|
||||
"base":100000,
|
||||
"pair":80000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
},
|
||||
"nodes": [
|
||||
"enode://6e3d1b39cbd2a9c4f053a27e68fd90d0bac83691dfdc4a13c59f2555078a71e63c5daaee5a82aa6db500512760a5456f86076bf8bbe8011c27c82ed7d6f5fb26@45.77.140.210:30303",
|
||||
"enode://f4698ad485a027497e1cc992bb5f7cecee2b32a44c47202738d8d0eecfab719541988d0cbcbc5ea94c6c959e5cddeb85fc6ae75fb63dc3bf87cdbe9e6f615e9d@206.156.242.64:30303",
|
||||
"enode://31dffed97f8fed1f34fe66453280a89cbeeda60cf28f6fbb212ebbefd7c7566a02c1c7d5c00bbbb49b9fa8a49f157e0f786f379ca9bcbf2fea24de70d70a22b6@206.156.242.61:30303",
|
||||
"enode://6bdc7553ab2e4914cb47774c1e6d8c8f47ac7c3981891f85f65d06f208ea1bc4d3bf982b330950e0a0cd127efd7145c4df7113159a1d4a06ed722e6c16d0ac6c@45.32.215.190:30303",
|
||||
"enode://872d82a24144bc007658fb6fac0dcdfb9b63aeb05ef563a06d0186f2d1e5ffbfc5c4f1244891a8a86ef70682b9d24382e654b305224883698862e2df647a4d23@45.76.236.247:30303",
|
||||
@@ -59,47 +60,10 @@
|
||||
],
|
||||
"accounts": {
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "0x0", "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": "0x0", "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": "0x0", "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": "0x0", "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
|
||||
"0x0000000000000000000000000000000000000001": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
|
||||
@@ -58,54 +58,16 @@
|
||||
"enode://8e0af07c86ec36590bb6368e7ad0c45b6dc658f5fb66ec68889a614affddda5e021bd513bcf4fb2fae4a3bbe08cf0de84f037cd58478a89665dfce1ded2595c7@34.236.37.74:30303",
|
||||
"enode://f1a5100a81cb73163ae450c584d06b1f644aa4fad4486c6aeb4c384b343c54bb66c744aa5f133af66ea1b25f0f4a454f04878f3e96ee4cd2390c047396d6357b@209.97.158.4:30303",
|
||||
"enode://0d1e0372f63a3f0b82d66635ea101ecc0f6797788a078805cc933dd93e6a22f7c9fa51ab4e2d21da02d04480ef19f3bbb9a2b41dd1c262085d295a354bb8b0f9@18.217.47.209:30303",
|
||||
"enode://875e1bd1b98019a5d6d588c23f68534b75462dd6ecbb3dd058221dbf7aa923f0ab782ab93bb82d42edc9996f7f0816a318bdc761e55c02b95e1169cef66f7edc@159.203.24.35:30303",
|
||||
"enode://ab083db73da15b3995ac9c68035cdb32901835a823cb848fccb672e43dd21f14428706118d6fe5b921d8e741f122f35aad0255bc86807b1d17bcfa1e86e40a14@165.227.37.104:30303",
|
||||
"enode://8e0af07c86ec36590bb6368e7ad0c45b6dc658f5fb66ec68889a614affddda5e021bd513bcf4fb2fae4a3bbe08cf0de84f037cd58478a89665dfce1ded2595c7@34.236.37.74:30303",
|
||||
"enode://182ee200ca134dc4d6390f3d5aadbcd80df0f7f24335830335d142573eacce4eeb919d30e82c5df588034e167e6ba6dd11187502ac9264a71005127f6b146a99@159.203.95.241:30303",
|
||||
"enode://b022ff70b5fcaf9596ae5efed99a8198b4ae0578ee9d17b733609d803a75cef95d3a2a18e50dca9a7c3b26139f158c59eaf8b5fb8d1d331c9a46934a78acabe8@206.189.76.128:30303"
|
||||
],
|
||||
"accounts": {
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "0x0", "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": "0x0", "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": "0x0", "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": "0x0", "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
|
||||
"0x0000000000000000000000000000000000000001": {
|
||||
"balance": "1",
|
||||
|
||||
@@ -1,905 +0,0 @@
|
||||
{
|
||||
"name": "Rinkeby",
|
||||
"dataDir": "rinkeby",
|
||||
"engine": {
|
||||
"clique": {
|
||||
"params": {
|
||||
"period": 15,
|
||||
"epoch": 30000
|
||||
}
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"accountStartNonce": "0x0",
|
||||
"chainID": "0x4",
|
||||
"eip140Transition": "0xfcc25",
|
||||
"eip145Transition": "0x37db77",
|
||||
"eip150Transition": "0x2",
|
||||
"eip155Transition": "0x3",
|
||||
"eip160Transition": "0x0",
|
||||
"eip161abcTransition": "0x0",
|
||||
"eip161dTransition": "0x0",
|
||||
"eip211Transition": "0xfcc25",
|
||||
"eip214Transition": "0xfcc25",
|
||||
"eip658Transition": "0xfcc25",
|
||||
"eip1014Transition": "0x37db77",
|
||||
"eip1052Transition": "0x37db77",
|
||||
"eip1283Transition": "0x37db77",
|
||||
"eip1283DisableTransition": "0x41efd2",
|
||||
"gasLimitBoundDivisor": "0x400",
|
||||
"maxCodeSize": "0x6000",
|
||||
"maxCodeSizeTransition": "0x0",
|
||||
"maximumExtraDataSize": "0xffff",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID": "0x4"
|
||||
},
|
||||
"genesis": {
|
||||
"author": "0x0000000000000000000000000000000000000000",
|
||||
"difficulty": "0x1",
|
||||
"extraData": "0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
||||
"gasLimit": "0x47b760",
|
||||
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"seal": {
|
||||
"ethereum": {
|
||||
"nonce": "0x0000000000000000",
|
||||
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
},
|
||||
"timestamp": "0x58ee40ba"
|
||||
},
|
||||
"nodes": [
|
||||
"enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303",
|
||||
"enode://343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8@52.3.158.184:30303",
|
||||
"enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303"
|
||||
],
|
||||
"accounts": {
|
||||
"0x0000000000000000000000000000000000000000": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000001": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "ecrecover",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 3000,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000002": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "sha256",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 60,
|
||||
"word": 12
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000003": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "ripemd160",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 600,
|
||||
"word": 120
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000004": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "identity",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 15,
|
||||
"word": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000005": {
|
||||
"balance": "0x1",
|
||||
"builtin": {
|
||||
"name": "modexp",
|
||||
"activate_at": "0xfcc25",
|
||||
"pricing": {
|
||||
"modexp": {
|
||||
"divisor": 20
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0xfcc25",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0xfcc25",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0xfcc25",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000009": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000000f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000010": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000011": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000012": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000013": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000014": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000015": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000016": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000017": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000018": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000019": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000001f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000020": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000021": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000022": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000023": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000024": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000025": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000026": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000027": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000028": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000029": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000002f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000030": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000031": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000032": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000033": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000034": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000035": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000036": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000037": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000038": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000039": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000003f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000040": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000041": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000042": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000043": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000044": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000045": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000046": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000047": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000048": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000049": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000004f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000050": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000051": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000052": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000053": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000054": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000055": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000056": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000057": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000058": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000059": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000005f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000060": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000061": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000062": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000063": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000064": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000065": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000066": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000067": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000068": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000069": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000006f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000070": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000071": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000072": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000073": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000074": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000075": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000076": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000077": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000078": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000079": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000007f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000080": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000081": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000082": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000083": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000084": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000085": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000086": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000087": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000088": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000089": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000008f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000090": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000091": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000092": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000093": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000094": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000095": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000096": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000097": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000098": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x0000000000000000000000000000000000000099": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009a": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009b": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009c": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009d": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009e": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x000000000000000000000000000000000000009f": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000a9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000aa": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ab": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ac": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ad": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ae": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000af": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000b9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ba": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000be": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000bf": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000c9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ca": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ce": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000cf": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000d9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000da": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000db": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000dc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000dd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000de": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000df": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000e9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ea": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000eb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ec": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ed": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ee": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ef": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f0": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f1": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f2": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f3": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f4": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f5": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f6": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f7": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f8": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000f9": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fa": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fb": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fc": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fd": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000fe": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x00000000000000000000000000000000000000ff": {
|
||||
"balance": "0x1"
|
||||
},
|
||||
"0x31b98d14007bdee637298086988a0bbd31184523": {
|
||||
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2654,7 +2654,7 @@
|
||||
]
|
||||
},
|
||||
"nodes": [
|
||||
"enode://d6cb8cba18828397e22e8852324af7e970b57cadbbd94aba6124790d1895728311b1f274e45d44a7a22b4276726903130a11ac2de19af5bc9294998f948eaad4@144.217.72.209:30303",
|
||||
"enode://6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f@52.232.243.152:30303",
|
||||
"enode://94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09@192.81.208.223:30303",
|
||||
"enode://30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606@52.176.7.10:30303",
|
||||
"enode://865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c@52.176.100.77:30303",
|
||||
@@ -2735,11 +2735,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x19f0a0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
"linear": {
|
||||
"base": 500,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2750,11 +2749,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x19f0a0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
"linear": {
|
||||
"base": 40000,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2765,13 +2763,10 @@
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x19f0a0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
"pair": 80000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,46 +58,8 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "0x00", "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": "0x00", "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": "0x00", "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": "0x00", "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } }
|
||||
}
|
||||
}
|
||||
|
||||
80
ethcore/res/ethereum/tobalaba.json
Normal file
80
ethcore/res/ethereum/tobalaba.json
Normal file
File diff suppressed because one or more lines are too long
@@ -57,46 +57,9 @@
|
||||
"0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "5",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "5",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "5",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"0000000000000000000000000000000000000005": { "builtin": { "name": "modexp", "activate_at": "5", "pricing": { "modexp": { "divisor": 100 } } } },
|
||||
"0000000000000000000000000000000000000006": { "builtin": { "name": "alt_bn128_add", "activate_at": "5", "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "builtin": { "name": "alt_bn128_mul", "activate_at": "5", "pricing": { "linear": { "base": 2000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "builtin": { "name": "alt_bn128_pairing", "activate_at": "5", "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } }
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,157 +0,0 @@
|
||||
{
|
||||
"name": "xDai Chain",
|
||||
"dataDir": "xdai",
|
||||
"engine": {
|
||||
"authorityRound": {
|
||||
"params": {
|
||||
"stepDuration": 5,
|
||||
"blockReward": "0x0",
|
||||
"maximumUncleCountTransition": 0,
|
||||
"maximumUncleCount": 0,
|
||||
"validators": {
|
||||
"multi": {
|
||||
"0": {
|
||||
"list": ["0xcace5b3c29211740e595850e80478416ee77ca21"]
|
||||
},
|
||||
"1300": {
|
||||
"safeContract": "0x22e1229a2c5b95a60983b5577f745a603284f535"
|
||||
}
|
||||
}
|
||||
},
|
||||
"blockRewardContractAddress": "0x867305d19606aadba405ce534e303d0e225f9556",
|
||||
"blockRewardContractTransition": 1310
|
||||
}
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x400",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID": "100",
|
||||
"eip140Transition": "0x0",
|
||||
"eip211Transition": "0x0",
|
||||
"eip214Transition": "0x0",
|
||||
"eip658Transition": "0x0",
|
||||
"eip145Transition": 1604400,
|
||||
"eip1014Transition": 1604400,
|
||||
"eip1052Transition": 1604400,
|
||||
"eip1283Transition": 1604400,
|
||||
"eip1283DisableTransition": 2508800,
|
||||
"registrar": "0x1ec97dc137f5168af053c24460a1200502e1a9d2"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
"authorityRound": {
|
||||
"step": "0x0",
|
||||
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
|
||||
}
|
||||
},
|
||||
"difficulty": "0x20000",
|
||||
"gasLimit": "0x989680"
|
||||
},
|
||||
"accounts": {
|
||||
"0000000000000000000000000000000000000005": {
|
||||
"builtin": {
|
||||
"name": "modexp",
|
||||
"activate_at": "0x0",
|
||||
"pricing": {
|
||||
"modexp": {
|
||||
"divisor": 20
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": "0x0",
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000001": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "ecrecover",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 3000,
|
||||
"word": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000002": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "sha256",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 60,
|
||||
"word": 12
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000003": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "ripemd160",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 600,
|
||||
"word": 120
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0x0000000000000000000000000000000000000004": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "identity",
|
||||
"pricing": {
|
||||
"linear": {
|
||||
"base": 15,
|
||||
"word": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"nodes": [
|
||||
"enode://66786c15390cb4fef3743571e12ec54ca343e7f119018136d68b670edd93604eedf74e5013dc5c2439f89e0e05593e29c409a97e155ea4165c6b832de131ef1e@3.214.113.185:30303"
|
||||
]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -36,50 +36,9 @@
|
||||
"0000000000000000000000000000000000000003": { "balance": "1", "nonce": "0", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
|
||||
"0000000000000000000000000000000000000004": { "balance": "1", "nonce": "0", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
|
||||
"0000000000000000000000000000000000000005": { "balance": "1", "builtin": { "name": "modexp", "activate_at": 0, "pricing": { "modexp": { "divisor": 20 } } } },
|
||||
"0000000000000000000000000000000000000006": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_add",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 500,
|
||||
"eip1108_transition_price": 150
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000007": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_mul",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_const_operations": {
|
||||
"price": 40000,
|
||||
"eip1108_transition_price": 6000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000008": {
|
||||
"balance": "1",
|
||||
"builtin": {
|
||||
"name": "alt_bn128_pairing",
|
||||
"activate_at": 0,
|
||||
"eip1108_transition": "0x7fffffffffffff",
|
||||
"pricing": {
|
||||
"alt_bn128_pairing": {
|
||||
"base": 100000,
|
||||
"pair": 80000,
|
||||
"eip1108_transition_base": 45000,
|
||||
"eip1108_transition_pair": 34000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"0000000000000000000000000000000000000006": { "balance": "1", "builtin": { "name": "alt_bn128_add", "activate_at": 0, "pricing": { "linear": { "base": 500, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000007": { "balance": "1", "builtin": { "name": "alt_bn128_mul", "activate_at": 0, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
|
||||
"0000000000000000000000000000000000000008": { "balance": "1", "builtin": { "name": "alt_bn128_pairing", "activate_at": 0, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
|
||||
"9cce34f7ab185c7aba1b7c8140d620b4bda941d6": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "0" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
[package]
|
||||
description = "Parity Ethereum (EthCore) Client & Network Service Creation & Registration with the I/O Subsystem"
|
||||
name = "ethcore-service"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting`
|
||||
// https://github.com/paritytech/parity-ethereum/issues/10302
|
||||
#![allow(deprecated)]
|
||||
|
||||
use ethcore;
|
||||
use io;
|
||||
use ethcore_private_tx;
|
||||
|
||||
@@ -30,10 +30,8 @@ use blockchain::{BlockChainDB, BlockChainDBHandler};
|
||||
use ethcore::client::{Client, ClientConfig, ChainNotify, ClientIoMessage};
|
||||
use ethcore::miner::Miner;
|
||||
use ethcore::snapshot::service::{Service as SnapshotService, ServiceParams as SnapServiceParams};
|
||||
use ethcore::snapshot::{SnapshotService as _SnapshotService, RestorationStatus, Error as SnapshotError};
|
||||
use ethcore::snapshot::{SnapshotService as _SnapshotService, RestorationStatus};
|
||||
use ethcore::spec::Spec;
|
||||
use ethcore::error::{Error as EthcoreError, ErrorKind};
|
||||
|
||||
|
||||
use ethcore_private_tx::{self, Importer, Signer};
|
||||
use Error;
|
||||
@@ -199,7 +197,6 @@ impl ClientService {
|
||||
|
||||
/// Shutdown the Client Service
|
||||
pub fn shutdown(&self) {
|
||||
trace!(target: "shutdown", "Shutting down Client Service");
|
||||
self.snapshot.shutdown();
|
||||
}
|
||||
}
|
||||
@@ -260,11 +257,7 @@ impl IoHandler<ClientIoMessage> for ClientIoHandler {
|
||||
|
||||
let res = thread::Builder::new().name("Periodic Snapshot".into()).spawn(move || {
|
||||
if let Err(e) = snapshot.take_snapshot(&*client, num) {
|
||||
match e {
|
||||
EthcoreError(ErrorKind::Snapshot(SnapshotError::SnapshotAborted), _) => info!("Snapshot aborted"),
|
||||
_ => warn!("Failed to take snapshot at block #{}: {}", num, e),
|
||||
}
|
||||
|
||||
warn!("Failed to take snapshot at block #{}: {}", num, e);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
//! `ExecutedBlock` is an underlaying data structure used by all structs above to store block
|
||||
//! related info.
|
||||
|
||||
use std::{cmp, ops};
|
||||
use std::cmp;
|
||||
use std::collections::HashSet;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -52,6 +52,7 @@ use vm::{EnvInfo, LastHashes};
|
||||
use hash::keccak;
|
||||
use rlp::{RlpStream, Encodable, encode_list};
|
||||
use types::transaction::{SignedTransaction, Error as TransactionError};
|
||||
use types::block::Block;
|
||||
use types::header::{Header, ExtendedHeader};
|
||||
use types::receipt::{Receipt, TransactionOutcome};
|
||||
|
||||
@@ -154,15 +155,69 @@ impl ExecutedBlock {
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for a object that is a `ExecutedBlock`.
|
||||
pub trait IsBlock {
|
||||
/// Get the `ExecutedBlock` associated with this object.
|
||||
fn block(&self) -> &ExecutedBlock;
|
||||
|
||||
/// Get the base `Block` object associated with this.
|
||||
fn to_base(&self) -> Block {
|
||||
Block {
|
||||
header: self.header().clone(),
|
||||
transactions: self.transactions().iter().cloned().map(Into::into).collect(),
|
||||
uncles: self.uncles().to_vec(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the header associated with this object's block.
|
||||
fn header(&self) -> &Header { &self.block().header }
|
||||
|
||||
/// Get the final state associated with this object's block.
|
||||
fn state(&self) -> &State<StateDB> { &self.block().state }
|
||||
|
||||
/// Get all information on transactions in this block.
|
||||
fn transactions(&self) -> &[SignedTransaction] { &self.block().transactions }
|
||||
|
||||
/// Get all information on receipts in this block.
|
||||
fn receipts(&self) -> &[Receipt] { &self.block().receipts }
|
||||
|
||||
/// Get all uncles in this block.
|
||||
fn uncles(&self) -> &[Header] { &self.block().uncles }
|
||||
}
|
||||
|
||||
/// Trait for an object that owns an `ExecutedBlock`
|
||||
pub trait Drain {
|
||||
/// Returns `ExecutedBlock`
|
||||
fn drain(self) -> ExecutedBlock;
|
||||
}
|
||||
|
||||
impl IsBlock for ExecutedBlock {
|
||||
fn block(&self) -> &ExecutedBlock { self }
|
||||
}
|
||||
|
||||
impl ::parity_machine::LiveBlock for ExecutedBlock {
|
||||
type Header = Header;
|
||||
|
||||
fn header(&self) -> &Header {
|
||||
&self.header
|
||||
}
|
||||
|
||||
fn uncles(&self) -> &[Header] {
|
||||
&self.uncles
|
||||
}
|
||||
}
|
||||
|
||||
impl ::parity_machine::Transactions for ExecutedBlock {
|
||||
type Transaction = SignedTransaction;
|
||||
|
||||
fn transactions(&self) -> &[SignedTransaction] {
|
||||
&self.transactions
|
||||
}
|
||||
}
|
||||
|
||||
impl<'x> OpenBlock<'x> {
|
||||
/// Create a new `OpenBlock` ready for transaction pushing.
|
||||
pub fn new<'a, I: IntoIterator<Item = ExtendedHeader>>(
|
||||
pub fn new<'a>(
|
||||
engine: &'x EthEngine,
|
||||
factories: Factories,
|
||||
tracing: bool,
|
||||
@@ -173,7 +228,7 @@ impl<'x> OpenBlock<'x> {
|
||||
gas_range_target: (U256, U256),
|
||||
extra_data: Bytes,
|
||||
is_epoch_begin: bool,
|
||||
ancestry: I,
|
||||
ancestry: &mut Iterator<Item=ExtendedHeader>,
|
||||
) -> Result<Self, Error> {
|
||||
let number = parent.number() + 1;
|
||||
let state = State::from_existing(db, parent.state_root().clone(), engine.account_start_nonce(number), factories)?;
|
||||
@@ -195,7 +250,7 @@ impl<'x> OpenBlock<'x> {
|
||||
engine.populate_from_parent(&mut r.block.header, parent);
|
||||
|
||||
engine.machine().on_new_block(&mut r.block)?;
|
||||
engine.on_new_block(&mut r.block, is_epoch_begin, &mut ancestry.into_iter())?;
|
||||
engine.on_new_block(&mut r.block, is_epoch_begin, ancestry)?;
|
||||
|
||||
Ok(r)
|
||||
}
|
||||
@@ -215,7 +270,7 @@ impl<'x> OpenBlock<'x> {
|
||||
/// NOTE Will check chain constraints and the uncle number but will NOT check
|
||||
/// that the header itself is actually valid.
|
||||
pub fn push_uncle(&mut self, valid_uncle_header: Header) -> Result<(), BlockError> {
|
||||
let max_uncles = self.engine.maximum_uncle_count(self.block.header.number());
|
||||
let max_uncles = self.engine.maximum_uncle_count(self.block.header().number());
|
||||
if self.block.uncles.len() + 1 > max_uncles {
|
||||
return Err(BlockError::TooManyUncles(OutOfBounds{
|
||||
min: None,
|
||||
@@ -229,6 +284,11 @@ impl<'x> OpenBlock<'x> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get the environment info concerning this block.
|
||||
pub fn env_info(&self) -> EnvInfo {
|
||||
self.block.env_info()
|
||||
}
|
||||
|
||||
/// Push a transaction into the block.
|
||||
///
|
||||
/// If valid, it will be executed, and archived together with the receipt.
|
||||
@@ -237,7 +297,7 @@ impl<'x> OpenBlock<'x> {
|
||||
return Err(TransactionError::AlreadyImported.into());
|
||||
}
|
||||
|
||||
let env_info = self.block.env_info();
|
||||
let env_info = self.env_info();
|
||||
let outcome = self.block.state.apply(&env_info, self.engine.machine(), &t, self.block.traces.is_enabled())?;
|
||||
|
||||
self.block.transactions_set.insert(h.unwrap_or_else(||t.hash()));
|
||||
@@ -284,6 +344,7 @@ impl<'x> OpenBlock<'x> {
|
||||
self.block.header.set_difficulty(*header.difficulty());
|
||||
self.block.header.set_gas_limit(*header.gas_limit());
|
||||
self.block.header.set_timestamp(header.timestamp());
|
||||
self.block.header.set_author(*header.author());
|
||||
self.block.header.set_uncles_hash(*header.uncles_hash());
|
||||
self.block.header.set_transactions_root(*header.transactions_root());
|
||||
// TODO: that's horrible. set only for backwards compatibility
|
||||
@@ -333,39 +394,22 @@ impl<'x> OpenBlock<'x> {
|
||||
pub fn block_mut(&mut self) -> &mut ExecutedBlock { &mut self.block }
|
||||
}
|
||||
|
||||
impl<'a> ops::Deref for OpenBlock<'a> {
|
||||
type Target = ExecutedBlock;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.block
|
||||
}
|
||||
impl<'x> IsBlock for OpenBlock<'x> {
|
||||
fn block(&self) -> &ExecutedBlock { &self.block }
|
||||
}
|
||||
|
||||
impl ops::Deref for ClosedBlock {
|
||||
type Target = ExecutedBlock;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.block
|
||||
}
|
||||
impl IsBlock for ClosedBlock {
|
||||
fn block(&self) -> &ExecutedBlock { &self.block }
|
||||
}
|
||||
|
||||
impl ops::Deref for LockedBlock {
|
||||
type Target = ExecutedBlock;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.block
|
||||
}
|
||||
}
|
||||
|
||||
impl ops::Deref for SealedBlock {
|
||||
type Target = ExecutedBlock;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.block
|
||||
}
|
||||
impl IsBlock for LockedBlock {
|
||||
fn block(&self) -> &ExecutedBlock { &self.block }
|
||||
}
|
||||
|
||||
impl ClosedBlock {
|
||||
/// Get the hash of the header without seal arguments.
|
||||
pub fn hash(&self) -> H256 { self.header().bare_hash() }
|
||||
|
||||
/// Turn this into a `LockedBlock`, unable to be reopened again.
|
||||
pub fn lock(self) -> LockedBlock {
|
||||
LockedBlock {
|
||||
@@ -399,25 +443,25 @@ impl LockedBlock {
|
||||
self.block.header.set_receipts_root(
|
||||
ordered_trie_root(self.block.receipts.iter().map(|r| r.rlp_bytes()))
|
||||
);
|
||||
// compute hash and cache it.
|
||||
self.block.header.compute_hash();
|
||||
}
|
||||
|
||||
/// Get the hash of the header without seal arguments.
|
||||
pub fn hash(&self) -> H256 { self.header().bare_hash() }
|
||||
|
||||
/// Provide a valid seal in order to turn this into a `SealedBlock`.
|
||||
///
|
||||
/// NOTE: This does not check the validity of `seal` with the engine.
|
||||
pub fn seal(self, engine: &EthEngine, seal: Vec<Bytes>) -> Result<SealedBlock, Error> {
|
||||
let expected_seal_fields = engine.seal_fields(&self.header);
|
||||
pub fn seal(self, engine: &EthEngine, seal: Vec<Bytes>) -> Result<SealedBlock, BlockError> {
|
||||
let expected_seal_fields = engine.seal_fields(self.header());
|
||||
let mut s = self;
|
||||
if seal.len() != expected_seal_fields {
|
||||
Err(BlockError::InvalidSealArity(Mismatch {
|
||||
expected: expected_seal_fields,
|
||||
found: seal.len()
|
||||
}))?;
|
||||
return Err(BlockError::InvalidSealArity(
|
||||
Mismatch { expected: expected_seal_fields, found: seal.len() }));
|
||||
}
|
||||
|
||||
s.block.header.set_seal(seal);
|
||||
engine.on_seal_block(&mut s.block)?;
|
||||
s.block.header.compute_hash();
|
||||
|
||||
Ok(SealedBlock {
|
||||
block: s.block
|
||||
})
|
||||
@@ -426,7 +470,6 @@ impl LockedBlock {
|
||||
/// Provide a valid seal in order to turn this into a `SealedBlock`.
|
||||
/// This does check the validity of `seal` with the engine.
|
||||
/// Returns the `ClosedBlock` back again if the seal is no good.
|
||||
/// TODO(https://github.com/paritytech/parity-ethereum/issues/10407): This is currently only used in POW chain call paths, we should really merge it with seal() above.
|
||||
pub fn try_seal(
|
||||
self,
|
||||
engine: &EthEngine,
|
||||
@@ -467,8 +510,12 @@ impl Drain for SealedBlock {
|
||||
}
|
||||
}
|
||||
|
||||
impl IsBlock for SealedBlock {
|
||||
fn block(&self) -> &ExecutedBlock { &self.block }
|
||||
}
|
||||
|
||||
/// Enact the block given by block header, transactions and uncles
|
||||
pub(crate) fn enact(
|
||||
fn enact(
|
||||
header: Header,
|
||||
transactions: Vec<SignedTransaction>,
|
||||
uncles: Vec<Header>,
|
||||
@@ -481,12 +528,13 @@ pub(crate) fn enact(
|
||||
is_epoch_begin: bool,
|
||||
ancestry: &mut Iterator<Item=ExtendedHeader>,
|
||||
) -> Result<LockedBlock, Error> {
|
||||
// For trace log
|
||||
let trace_state = if log_enabled!(target: "enact", ::log::Level::Trace) {
|
||||
Some(State::from_existing(db.boxed_clone(), parent.state_root().clone(), engine.account_start_nonce(parent.number() + 1), factories.clone())?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
{
|
||||
if ::log::max_level() >= ::log::Level::Trace {
|
||||
let s = State::from_existing(db.boxed_clone(), parent.state_root().clone(), engine.account_start_nonce(parent.number() + 1), factories.clone())?;
|
||||
trace!(target: "enact", "num={}, root={}, author={}, author_balance={}\n",
|
||||
header.number(), s.root(), header.author(), s.balance(&header.author())?);
|
||||
}
|
||||
}
|
||||
|
||||
let mut b = OpenBlock::new(
|
||||
engine,
|
||||
@@ -495,23 +543,13 @@ pub(crate) fn enact(
|
||||
db,
|
||||
parent,
|
||||
last_hashes,
|
||||
// Engine such as Clique will calculate author from extra_data.
|
||||
// this is only important for executing contracts as the 'executive_author'.
|
||||
engine.executive_author(&header)?,
|
||||
Address::new(),
|
||||
(3141562.into(), 31415620.into()),
|
||||
vec![],
|
||||
is_epoch_begin,
|
||||
ancestry,
|
||||
)?;
|
||||
|
||||
if let Some(ref s) = trace_state {
|
||||
let env = b.env_info();
|
||||
let root = s.root();
|
||||
let author_balance = s.balance(&env.author)?;
|
||||
trace!(target: "enact", "num={}, root={}, author={}, author_balance={}\n",
|
||||
b.block.header.number(), root, env.author, author_balance);
|
||||
}
|
||||
|
||||
b.populate_from(&header);
|
||||
b.push_transactions(transactions)?;
|
||||
|
||||
@@ -577,7 +615,6 @@ mod tests {
|
||||
last_hashes: Arc<LastHashes>,
|
||||
factories: Factories,
|
||||
) -> Result<LockedBlock, Error> {
|
||||
|
||||
let block = Unverified::from_rlp(block_bytes)?;
|
||||
let header = block.header;
|
||||
let transactions: Result<Vec<_>, Error> = block
|
||||
@@ -607,7 +644,7 @@ mod tests {
|
||||
(3141562.into(), 31415620.into()),
|
||||
vec![],
|
||||
false,
|
||||
None,
|
||||
&mut Vec::new().into_iter(),
|
||||
)?;
|
||||
|
||||
b.populate_from(&header);
|
||||
@@ -632,7 +669,7 @@ mod tests {
|
||||
) -> Result<SealedBlock, Error> {
|
||||
let header = Unverified::from_rlp(block_bytes.clone())?.header;
|
||||
Ok(enact_bytes(block_bytes, engine, tracing, db, parent, last_hashes, factories)?
|
||||
.seal(engine, header.seal().to_vec())?)
|
||||
.seal(engine, header.seal().to_vec())?)
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -642,7 +679,7 @@ mod tests {
|
||||
let genesis_header = spec.genesis_header();
|
||||
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
let b = OpenBlock::new(&*spec.engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b = OpenBlock::new(&*spec.engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b = b.close_and_lock().unwrap();
|
||||
let _ = b.seal(&*spec.engine, vec![]);
|
||||
}
|
||||
@@ -656,7 +693,7 @@ mod tests {
|
||||
|
||||
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes.clone(), Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap()
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes.clone(), Address::zero(), (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap()
|
||||
.close_and_lock().unwrap().seal(engine, vec![]).unwrap();
|
||||
let orig_bytes = b.rlp_bytes();
|
||||
let orig_db = b.drain().state.drop().1;
|
||||
@@ -680,7 +717,7 @@ mod tests {
|
||||
|
||||
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
let mut open_block = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes.clone(), Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let mut open_block = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes.clone(), Address::zero(), (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let mut uncle1_header = Header::new();
|
||||
uncle1_header.set_extra_data(b"uncle1".to_vec());
|
||||
let mut uncle2_header = Header::new();
|
||||
|
||||
@@ -16,26 +16,21 @@
|
||||
|
||||
//! Standard built-in contracts.
|
||||
|
||||
use std::{
|
||||
cmp::{max, min},
|
||||
io::{self, Read, Cursor},
|
||||
mem::size_of,
|
||||
};
|
||||
use std::cmp::{max, min};
|
||||
use std::io::{self, Read};
|
||||
|
||||
use bn;
|
||||
use byteorder::{BigEndian, LittleEndian, ByteOrder, ReadBytesExt};
|
||||
use ethereum_types::{H256, U256};
|
||||
use ethjson;
|
||||
use ethkey::{Signature, recover as ec_recover};
|
||||
use hash::keccak;
|
||||
use log::{warn, trace};
|
||||
use num::{BigUint, Zero, One};
|
||||
use bytes::BytesRef;
|
||||
use byteorder::{ByteOrder, BigEndian};
|
||||
use parity_crypto::digest;
|
||||
use eip_152::compress;
|
||||
use num::{BigUint, Zero, One};
|
||||
|
||||
use hash::keccak;
|
||||
use ethereum_types::{H256, U256};
|
||||
use bytes::BytesRef;
|
||||
use ethkey::{Signature, recover as ec_recover};
|
||||
use ethjson;
|
||||
|
||||
/// Execution error.
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug)]
|
||||
pub struct Error(pub &'static str);
|
||||
|
||||
impl From<&'static str> for Error {
|
||||
@@ -57,27 +52,9 @@ pub trait Impl: Send + Sync {
|
||||
}
|
||||
|
||||
/// A gas pricing scheme for built-in contracts.
|
||||
// TODO: refactor this trait, see https://github.com/paritytech/parity-ethereum/issues/11014
|
||||
trait Pricer: Send + Sync {
|
||||
/// The gas cost of running this built-in for the given input data at block number `at`
|
||||
fn cost(&self, input: &[u8], at: u64) -> U256;
|
||||
}
|
||||
|
||||
/// Pricing for the Blake2 compression function (aka "F").
|
||||
/// Computes the price as a fixed cost per round where the number of rounds is part of the input
|
||||
/// byte slice.
|
||||
pub type Blake2FPricer = u64;
|
||||
|
||||
impl Pricer for Blake2FPricer {
|
||||
fn cost(&self, input: &[u8], _at: u64) -> U256 {
|
||||
use std::convert::TryInto;
|
||||
let (rounds_bytes, _) = input.split_at(std::mem::size_of::<u32>());
|
||||
// Returning zero if the conversion fails is fine because `execute()` will check the length
|
||||
// and bail with the appropriate error.
|
||||
let rounds = u32::from_be_bytes(rounds_bytes.try_into().unwrap_or([0u8; 4]));
|
||||
// U256::from(*self as u128 * rounds as u128)
|
||||
U256::from(*self as u64 * rounds as u64)
|
||||
}
|
||||
pub trait Pricer: Send + Sync {
|
||||
/// The gas cost of running this built-in for the given input data.
|
||||
fn cost(&self, input: &[u8]) -> U256;
|
||||
}
|
||||
|
||||
/// A linear pricing model. This computes a price using a base cost and a cost per-word.
|
||||
@@ -92,56 +69,26 @@ struct ModexpPricer {
|
||||
}
|
||||
|
||||
impl Pricer for Linear {
|
||||
fn cost(&self, input: &[u8], _at: u64) -> U256 {
|
||||
fn cost(&self, input: &[u8]) -> U256 {
|
||||
U256::from(self.base) + U256::from(self.word) * U256::from((input.len() + 31) / 32)
|
||||
}
|
||||
}
|
||||
|
||||
/// alt_bn128 constant operations (add and mul) pricing model.
|
||||
struct AltBn128ConstOperations {
|
||||
price: usize,
|
||||
eip1108_transition_at: u64,
|
||||
eip1108_transition_price: usize,
|
||||
}
|
||||
|
||||
impl Pricer for AltBn128ConstOperations {
|
||||
fn cost(&self, _input: &[u8], at: u64) -> U256 {
|
||||
if at >= self.eip1108_transition_at {
|
||||
self.eip1108_transition_price.into()
|
||||
} else {
|
||||
self.price.into()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// alt_bn128 pairing price
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
struct AltBn128PairingPrice {
|
||||
/// A alt_bn128_parinig pricing model. This computes a price using a base cost and a cost per pair.
|
||||
struct AltBn128PairingPricer {
|
||||
base: usize,
|
||||
pair: usize,
|
||||
}
|
||||
|
||||
/// alt_bn128_pairing pricing model. This computes a price using a base cost and a cost per pair.
|
||||
struct AltBn128PairingPricer {
|
||||
price: AltBn128PairingPrice,
|
||||
eip1108_transition_at: u64,
|
||||
eip1108_transition_price: AltBn128PairingPrice,
|
||||
}
|
||||
|
||||
impl Pricer for AltBn128PairingPricer {
|
||||
fn cost(&self, input: &[u8], at: u64) -> U256 {
|
||||
let price = if at >= self.eip1108_transition_at {
|
||||
self.eip1108_transition_price
|
||||
} else {
|
||||
self.price
|
||||
};
|
||||
|
||||
U256::from(price.base) + U256::from(price.pair) * U256::from(input.len() / 192)
|
||||
fn cost(&self, input: &[u8]) -> U256 {
|
||||
let cost = U256::from(self.base) + U256::from(self.pair) * U256::from(input.len() / 192);
|
||||
cost
|
||||
}
|
||||
}
|
||||
|
||||
impl Pricer for ModexpPricer {
|
||||
fn cost(&self, input: &[u8], _at: u64) -> U256 {
|
||||
fn cost(&self, input: &[u8]) -> U256 {
|
||||
let mut reader = input.chain(io::repeat(0));
|
||||
let mut buf = [0; 32];
|
||||
|
||||
@@ -210,16 +157,14 @@ impl ModexpPricer {
|
||||
///
|
||||
/// Unless `is_active` is true,
|
||||
pub struct Builtin {
|
||||
pricer: Box<dyn Pricer>,
|
||||
native: Box<dyn Impl>,
|
||||
pricer: Box<Pricer>,
|
||||
native: Box<Impl>,
|
||||
activate_at: u64,
|
||||
}
|
||||
|
||||
impl Builtin {
|
||||
/// Simple forwarder for cost.
|
||||
pub fn cost(&self, input: &[u8], at: u64) -> U256 {
|
||||
self.pricer.cost(input, at)
|
||||
}
|
||||
pub fn cost(&self, input: &[u8]) -> U256 { self.pricer.cost(input) }
|
||||
|
||||
/// Simple forwarder for execute.
|
||||
pub fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), Error> {
|
||||
@@ -227,17 +172,12 @@ impl Builtin {
|
||||
}
|
||||
|
||||
/// Whether the builtin is activated at the given block number.
|
||||
pub fn is_active(&self, at: u64) -> bool {
|
||||
at >= self.activate_at
|
||||
}
|
||||
pub fn is_active(&self, at: u64) -> bool { at >= self.activate_at }
|
||||
}
|
||||
|
||||
impl From<ethjson::spec::Builtin> for Builtin {
|
||||
fn from(b: ethjson::spec::Builtin) -> Self {
|
||||
let pricer: Box<dyn Pricer> = match b.pricing {
|
||||
ethjson::spec::Pricing::Blake2F(cost_per_round) => {
|
||||
Box::new(cost_per_round)
|
||||
},
|
||||
let pricer: Box<Pricer> = match b.pricing {
|
||||
ethjson::spec::Pricing::Linear(linear) => {
|
||||
Box::new(Linear {
|
||||
base: linear.base,
|
||||
@@ -247,7 +187,7 @@ impl From<ethjson::spec::Builtin> for Builtin {
|
||||
ethjson::spec::Pricing::Modexp(exp) => {
|
||||
Box::new(ModexpPricer {
|
||||
divisor: if exp.divisor == 0 {
|
||||
warn!(target: "builtin", "Zero modexp divisor specified. Falling back to default.");
|
||||
warn!("Zero modexp divisor specified. Falling back to default.");
|
||||
10
|
||||
} else {
|
||||
exp.divisor
|
||||
@@ -256,46 +196,31 @@ impl From<ethjson::spec::Builtin> for Builtin {
|
||||
}
|
||||
ethjson::spec::Pricing::AltBn128Pairing(pricer) => {
|
||||
Box::new(AltBn128PairingPricer {
|
||||
price: AltBn128PairingPrice {
|
||||
base: pricer.base,
|
||||
pair: pricer.pair,
|
||||
},
|
||||
eip1108_transition_at: b.eip1108_transition.map_or(u64::max_value(), Into::into),
|
||||
eip1108_transition_price: AltBn128PairingPrice {
|
||||
base: pricer.eip1108_transition_base,
|
||||
pair: pricer.eip1108_transition_pair,
|
||||
},
|
||||
})
|
||||
}
|
||||
ethjson::spec::Pricing::AltBn128ConstOperations(pricer) => {
|
||||
Box::new(AltBn128ConstOperations {
|
||||
price: pricer.price,
|
||||
eip1108_transition_price: pricer.eip1108_transition_price,
|
||||
eip1108_transition_at: b.eip1108_transition.map_or(u64::max_value(), Into::into)
|
||||
base: pricer.base,
|
||||
pair: pricer.pair,
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
Builtin {
|
||||
pricer,
|
||||
pricer: pricer,
|
||||
native: ethereum_builtin(&b.name),
|
||||
activate_at: b.activate_at.map_or(0, Into::into),
|
||||
activate_at: b.activate_at.map(Into::into).unwrap_or(0),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Ethereum built-in factory.
|
||||
pub fn ethereum_builtin(name: &str) -> Box<dyn Impl> {
|
||||
pub fn ethereum_builtin(name: &str) -> Box<Impl> {
|
||||
match name {
|
||||
"identity" => Box::new(Identity) as Box<dyn Impl>,
|
||||
"ecrecover" => Box::new(EcRecover) as Box<dyn Impl>,
|
||||
"sha256" => Box::new(Sha256) as Box<dyn Impl>,
|
||||
"ripemd160" => Box::new(Ripemd160) as Box<dyn Impl>,
|
||||
"modexp" => Box::new(ModexpImpl) as Box<dyn Impl>,
|
||||
"alt_bn128_add" => Box::new(Bn128AddImpl) as Box<dyn Impl>,
|
||||
"alt_bn128_mul" => Box::new(Bn128MulImpl) as Box<dyn Impl>,
|
||||
"alt_bn128_pairing" => Box::new(Bn128PairingImpl) as Box<dyn Impl>,
|
||||
"blake2_f" => Box::new(Blake2F) as Box<dyn Impl>,
|
||||
"identity" => Box::new(Identity) as Box<Impl>,
|
||||
"ecrecover" => Box::new(EcRecover) as Box<Impl>,
|
||||
"sha256" => Box::new(Sha256) as Box<Impl>,
|
||||
"ripemd160" => Box::new(Ripemd160) as Box<Impl>,
|
||||
"modexp" => Box::new(ModexpImpl) as Box<Impl>,
|
||||
"alt_bn128_add" => Box::new(Bn128AddImpl) as Box<Impl>,
|
||||
"alt_bn128_mul" => Box::new(Bn128MulImpl) as Box<Impl>,
|
||||
"alt_bn128_pairing" => Box::new(Bn128PairingImpl) as Box<Impl>,
|
||||
_ => panic!("invalid builtin name: {}", name),
|
||||
}
|
||||
}
|
||||
@@ -307,10 +232,6 @@ pub fn ethereum_builtin(name: &str) -> Box<dyn Impl> {
|
||||
// - sha256
|
||||
// - ripemd160
|
||||
// - modexp (EIP198)
|
||||
// - alt_bn128_add
|
||||
// - alt_bn128_mul
|
||||
// - alt_bn128_pairing
|
||||
// - blake2_f (The Blake2 compression function F, EIP-152)
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Identity;
|
||||
@@ -336,11 +257,8 @@ struct Bn128MulImpl;
|
||||
#[derive(Debug)]
|
||||
struct Bn128PairingImpl;
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Blake2F;
|
||||
|
||||
impl Impl for Identity {
|
||||
fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), Error> {
|
||||
fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), Error> {
|
||||
output.write(0, input);
|
||||
Ok(())
|
||||
}
|
||||
@@ -384,60 +302,6 @@ impl Impl for Sha256 {
|
||||
}
|
||||
}
|
||||
|
||||
impl Impl for Blake2F {
|
||||
/// Format of `input`:
|
||||
/// [4 bytes for rounds][64 bytes for h][128 bytes for m][8 bytes for t_0][8 bytes for t_1][1 byte for f]
|
||||
fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), Error> {
|
||||
const BLAKE2_F_ARG_LEN: usize = 213;
|
||||
const PROOF: &str = "Checked the length of the input above; qed";
|
||||
|
||||
if input.len() != BLAKE2_F_ARG_LEN {
|
||||
trace!(target: "builtin", "input length for Blake2 F precompile should be exactly 213 bytes, was {}", input.len());
|
||||
return Err("input length for Blake2 F precompile should be exactly 213 bytes".into())
|
||||
}
|
||||
|
||||
let mut cursor = Cursor::new(input);
|
||||
let rounds = cursor.read_u32::<BigEndian>().expect(PROOF);
|
||||
|
||||
// state vector, h
|
||||
let mut h = [0u64; 8];
|
||||
for state_word in h.iter_mut() {
|
||||
*state_word = cursor.read_u64::<LittleEndian>().expect(PROOF);
|
||||
}
|
||||
|
||||
// message block vector, m
|
||||
let mut m = [0u64; 16];
|
||||
for msg_word in m.iter_mut() {
|
||||
*msg_word = cursor.read_u64::<LittleEndian>().expect(PROOF);
|
||||
}
|
||||
|
||||
// 2w-bit offset counter, t
|
||||
let t = [
|
||||
cursor.read_u64::<LittleEndian>().expect(PROOF),
|
||||
cursor.read_u64::<LittleEndian>().expect(PROOF),
|
||||
];
|
||||
|
||||
// final block indicator flag, "f"
|
||||
let f = match input.last() {
|
||||
Some(1) => true,
|
||||
Some(0) => false,
|
||||
_ => {
|
||||
trace!(target: "builtin", "incorrect final block indicator flag, was: {:?}", input.last());
|
||||
return Err("incorrect final block indicator flag".into())
|
||||
}
|
||||
};
|
||||
|
||||
compress(&mut h, m, t, f, rounds as usize);
|
||||
|
||||
let mut output_buf = [0u8; 8 * size_of::<u64>()];
|
||||
for (i, state_word) in h.iter().enumerate() {
|
||||
output_buf[i*8..(i+1)*8].copy_from_slice(&state_word.to_le_bytes());
|
||||
}
|
||||
output.write(0, &output_buf[..]);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl Impl for Ripemd160 {
|
||||
fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), Error> {
|
||||
let hash = digest::ripemd160(input);
|
||||
@@ -586,7 +450,7 @@ impl Impl for Bn128AddImpl {
|
||||
if let Some(sum) = AffineG1::from_jacobian(p1 + p2) {
|
||||
// point not at infinity
|
||||
sum.x().to_big_endian(&mut write_buf[0..32]).expect("Cannot fail since 0..32 is 32-byte length");
|
||||
sum.y().to_big_endian(&mut write_buf[32..64]).expect("Cannot fail since 32..64 is 32-byte length");
|
||||
sum.y().to_big_endian(&mut write_buf[32..64]).expect("Cannot fail since 32..64 is 32-byte length");;
|
||||
}
|
||||
output.write(0, &write_buf);
|
||||
|
||||
@@ -607,7 +471,7 @@ impl Impl for Bn128MulImpl {
|
||||
if let Some(sum) = AffineG1::from_jacobian(p * fr) {
|
||||
// point not at infinity
|
||||
sum.x().to_big_endian(&mut write_buf[0..32]).expect("Cannot fail since 0..32 is 32-byte length");
|
||||
sum.y().to_big_endian(&mut write_buf[32..64]).expect("Cannot fail since 32..64 is 32-byte length");
|
||||
sum.y().to_big_endian(&mut write_buf[32..64]).expect("Cannot fail since 32..64 is 32-byte length");;
|
||||
}
|
||||
output.write(0, &write_buf);
|
||||
Ok(())
|
||||
@@ -625,7 +489,7 @@ impl Impl for Bn128PairingImpl {
|
||||
}
|
||||
|
||||
if let Err(err) = self.execute_with_error(input, output) {
|
||||
trace!(target: "builtin", "Pairing error: {:?}", err);
|
||||
trace!("Pairining error: {:?}", err);
|
||||
return Err(err)
|
||||
}
|
||||
Ok(())
|
||||
@@ -694,120 +558,12 @@ impl Bn128PairingImpl {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ethereum_types::U256;
|
||||
use ethjson::uint::Uint;
|
||||
use num::{BigUint, Zero, One};
|
||||
use bytes::BytesRef;
|
||||
use hex_literal::hex;
|
||||
use super::{Builtin, Linear, ethereum_builtin, Pricer, ModexpPricer, modexp as me};
|
||||
|
||||
#[test]
|
||||
fn blake2f_cost() {
|
||||
let f = Builtin {
|
||||
pricer: Box::new(123),
|
||||
native: ethereum_builtin("blake2_f"),
|
||||
activate_at: 0,
|
||||
};
|
||||
// 5 rounds
|
||||
let input = hex!("0000000548c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001");
|
||||
let mut output = [0u8; 64];
|
||||
f.execute(&input[..], &mut BytesRef::Fixed(&mut output[..])).unwrap();
|
||||
|
||||
assert_eq!(f.cost(&input[..], 0), U256::from(123*5));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blake2_f_is_err_on_invalid_length() {
|
||||
let blake2 = ethereum_builtin("blake2_f");
|
||||
// Test vector 1 and expected output from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-152.md#test-vector-1
|
||||
let input = hex!("00000c48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001");
|
||||
let mut out = [0u8; 64];
|
||||
|
||||
let result = blake2.execute(&input[..], &mut BytesRef::Fixed(&mut out[..]));
|
||||
assert!(result.is_err());
|
||||
assert_eq!(result.unwrap_err(), "input length for Blake2 F precompile should be exactly 213 bytes".into());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blake2_f_is_err_on_invalid_length_2() {
|
||||
let blake2 = ethereum_builtin("blake2_f");
|
||||
// Test vector 2 and expected output from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-152.md#test-vector-2
|
||||
let input = hex!("000000000c48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001");
|
||||
let mut out = [0u8; 64];
|
||||
|
||||
let result = blake2.execute(&input[..], &mut BytesRef::Fixed(&mut out[..]));
|
||||
assert!(result.is_err());
|
||||
assert_eq!(result.unwrap_err(), "input length for Blake2 F precompile should be exactly 213 bytes".into());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blake2_f_is_err_on_bad_finalization_flag() {
|
||||
let blake2 = ethereum_builtin("blake2_f");
|
||||
// Test vector 3 and expected output from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-152.md#test-vector-3
|
||||
let input = hex!("0000000c48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000002");
|
||||
let mut out = [0u8; 64];
|
||||
|
||||
let result = blake2.execute(&input[..], &mut BytesRef::Fixed(&mut out[..]));
|
||||
assert!(result.is_err());
|
||||
assert_eq!(result.unwrap_err(), "incorrect final block indicator flag".into());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blake2_f_zero_rounds_is_ok_test_vector_4() {
|
||||
let blake2 = ethereum_builtin("blake2_f");
|
||||
// Test vector 4 and expected output from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-152.md#test-vector-4
|
||||
let input = hex!("0000000048c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001");
|
||||
let expected = hex!("08c9bcf367e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d282e6ad7f520e511f6c3e2b8c68059b9442be0454267ce079217e1319cde05b");
|
||||
let mut output = [0u8; 64];
|
||||
blake2.execute(&input[..], &mut BytesRef::Fixed(&mut output[..])).unwrap();
|
||||
assert_eq!(&output[..], &expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blake2_f_test_vector_5() {
|
||||
let blake2 = ethereum_builtin("blake2_f");
|
||||
// Test vector 5 and expected output from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-152.md#test-vector-5
|
||||
let input = hex!("0000000c48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001");
|
||||
let expected = hex!("ba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d17d87c5392aab792dc252d5de4533cc9518d38aa8dbf1925ab92386edd4009923");
|
||||
let mut out = [0u8; 64];
|
||||
blake2.execute(&input[..], &mut BytesRef::Fixed(&mut out[..])).unwrap();
|
||||
assert_eq!(&out[..], &expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blake2_f_test_vector_6() {
|
||||
let blake2 = ethereum_builtin("blake2_f");
|
||||
// Test vector 6 and expected output from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-152.md#test-vector-6
|
||||
let input = hex!("0000000c48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000");
|
||||
let expected = hex!("75ab69d3190a562c51aef8d88f1c2775876944407270c42c9844252c26d2875298743e7f6d5ea2f2d3e8d226039cd31b4e426ac4f2d3d666a610c2116fde4735");
|
||||
let mut out = [0u8; 64];
|
||||
blake2.execute(&input[..], &mut BytesRef::Fixed(&mut out[..])).unwrap();
|
||||
assert_eq!(&out[..], &expected[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blake2_f_test_vector_7() {
|
||||
let blake2 = ethereum_builtin("blake2_f");
|
||||
// Test vector 7 and expected output from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-152.md#test-vector-7
|
||||
let input = hex!("0000000148c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001");
|
||||
let expected = hex!("b63a380cb2897d521994a85234ee2c181b5f844d2c624c002677e9703449d2fba551b3a8333bcdf5f2f7e08993d53923de3d64fcc68c034e717b9293fed7a421");
|
||||
let mut out = [0u8; 64];
|
||||
blake2.execute(&input[..], &mut BytesRef::Fixed(&mut out[..])).unwrap();
|
||||
assert_eq!(&out[..], &expected[..]);
|
||||
}
|
||||
|
||||
#[ignore]
|
||||
#[test]
|
||||
fn blake2_f_test_vector_8() {
|
||||
let blake2 = ethereum_builtin("blake2_f");
|
||||
// Test vector 8 and expected output from https://github.com/ethereum/EIPs/blob/master/EIPS/eip-152.md#test-vector-8
|
||||
// Note this test is slow, 4294967295/0xffffffff rounds take a while.
|
||||
let input = hex!("ffffffff48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000001");
|
||||
let expected = hex!("fc59093aafa9ab43daae0e914c57635c5402d8e3d2130eb9b3cc181de7f0ecf9b22bf99a7815ce16419e200e01846e6b5df8cc7703041bbceb571de6631d2615");
|
||||
let mut out = [0u8; 64];
|
||||
blake2.execute(&input[..], &mut BytesRef::Fixed(&mut out[..])).unwrap();
|
||||
assert_eq!(&out[..], &expected[..]);
|
||||
}
|
||||
use ethjson;
|
||||
use ethereum_types::U256;
|
||||
use bytes::BytesRef;
|
||||
use rustc_hex::FromHex;
|
||||
use num::{BigUint, Zero, One};
|
||||
|
||||
#[test]
|
||||
fn modexp_func() {
|
||||
@@ -870,19 +626,19 @@ use hex_literal::hex;
|
||||
|
||||
let mut o = [255u8; 32];
|
||||
f.execute(&i[..], &mut BytesRef::Fixed(&mut o[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o[..], hex!("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"));
|
||||
assert_eq!(&o[..], &(FromHex::from_hex("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855").unwrap())[..]);
|
||||
|
||||
let mut o8 = [255u8; 8];
|
||||
f.execute(&i[..], &mut BytesRef::Fixed(&mut o8[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o8[..], hex!("e3b0c44298fc1c14"));
|
||||
assert_eq!(&o8[..], &(FromHex::from_hex("e3b0c44298fc1c14").unwrap())[..]);
|
||||
|
||||
let mut o34 = [255u8; 34];
|
||||
f.execute(&i[..], &mut BytesRef::Fixed(&mut o34[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o34[..], &hex!("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855ffff")[..]);
|
||||
assert_eq!(&o34[..], &(FromHex::from_hex("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855ffff").unwrap())[..]);
|
||||
|
||||
let mut ov = vec![];
|
||||
f.execute(&i[..], &mut BytesRef::Flexible(&mut ov)).expect("Builtin should not fail");
|
||||
assert_eq!(&ov[..], &hex!("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")[..]);
|
||||
assert_eq!(&ov[..], &(FromHex::from_hex("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855").unwrap())[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -893,59 +649,59 @@ use hex_literal::hex;
|
||||
|
||||
let mut o = [255u8; 32];
|
||||
f.execute(&i[..], &mut BytesRef::Fixed(&mut o[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o[..], &hex!("0000000000000000000000009c1185a5c5e9fc54612808977ee8f548b2258d31")[..]);
|
||||
assert_eq!(&o[..], &(FromHex::from_hex("0000000000000000000000009c1185a5c5e9fc54612808977ee8f548b2258d31").unwrap())[..]);
|
||||
|
||||
let mut o8 = [255u8; 8];
|
||||
f.execute(&i[..], &mut BytesRef::Fixed(&mut o8[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o8[..], &hex!("0000000000000000")[..]);
|
||||
assert_eq!(&o8[..], &(FromHex::from_hex("0000000000000000").unwrap())[..]);
|
||||
|
||||
let mut o34 = [255u8; 34];
|
||||
f.execute(&i[..], &mut BytesRef::Fixed(&mut o34[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o34[..], &hex!("0000000000000000000000009c1185a5c5e9fc54612808977ee8f548b2258d31ffff")[..]);
|
||||
assert_eq!(&o34[..], &(FromHex::from_hex("0000000000000000000000009c1185a5c5e9fc54612808977ee8f548b2258d31ffff").unwrap())[..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ecrecover() {
|
||||
let f = ethereum_builtin("ecrecover");
|
||||
|
||||
let i = hex!("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b650acf9d3f5f0a2c799776a1254355d5f4061762a237396a99a0e0e3fc2bcd6729514a0dacb2e623ac4abd157cb18163ff942280db4d5caad66ddf941ba12e03");
|
||||
let i = FromHex::from_hex("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b650acf9d3f5f0a2c799776a1254355d5f4061762a237396a99a0e0e3fc2bcd6729514a0dacb2e623ac4abd157cb18163ff942280db4d5caad66ddf941ba12e03").unwrap();
|
||||
|
||||
let mut o = [255u8; 32];
|
||||
f.execute(&i[..], &mut BytesRef::Fixed(&mut o[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o[..], &hex!("000000000000000000000000c08b5542d177ac6686946920409741463a15dddb")[..]);
|
||||
assert_eq!(&o[..], &(FromHex::from_hex("000000000000000000000000c08b5542d177ac6686946920409741463a15dddb").unwrap())[..]);
|
||||
|
||||
let mut o8 = [255u8; 8];
|
||||
f.execute(&i[..], &mut BytesRef::Fixed(&mut o8[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o8[..], &hex!("0000000000000000")[..]);
|
||||
assert_eq!(&o8[..], &(FromHex::from_hex("0000000000000000").unwrap())[..]);
|
||||
|
||||
let mut o34 = [255u8; 34];
|
||||
f.execute(&i[..], &mut BytesRef::Fixed(&mut o34[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o34[..], &hex!("000000000000000000000000c08b5542d177ac6686946920409741463a15dddbffff")[..]);
|
||||
assert_eq!(&o34[..], &(FromHex::from_hex("000000000000000000000000c08b5542d177ac6686946920409741463a15dddbffff").unwrap())[..]);
|
||||
|
||||
let i_bad = hex!("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001a650acf9d3f5f0a2c799776a1254355d5f4061762a237396a99a0e0e3fc2bcd6729514a0dacb2e623ac4abd157cb18163ff942280db4d5caad66ddf941ba12e03");
|
||||
let i_bad = FromHex::from_hex("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001a650acf9d3f5f0a2c799776a1254355d5f4061762a237396a99a0e0e3fc2bcd6729514a0dacb2e623ac4abd157cb18163ff942280db4d5caad66ddf941ba12e03").unwrap();
|
||||
let mut o = [255u8; 32];
|
||||
f.execute(&i_bad[..], &mut BytesRef::Fixed(&mut o[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o[..], &hex!("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[..]);
|
||||
assert_eq!(&o[..], &(FromHex::from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap())[..]);
|
||||
|
||||
let i_bad = hex!("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001b0000000000000000000000000000000000000000000000000000000000000000");
|
||||
let i_bad = FromHex::from_hex("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001b0000000000000000000000000000000000000000000000000000000000000000").unwrap();
|
||||
let mut o = [255u8; 32];
|
||||
f.execute(&i_bad[..], &mut BytesRef::Fixed(&mut o[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o[..], &hex!("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[..]);
|
||||
assert_eq!(&o[..], &(FromHex::from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap())[..]);
|
||||
|
||||
let i_bad = hex!("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b");
|
||||
let i_bad = FromHex::from_hex("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b").unwrap();
|
||||
let mut o = [255u8; 32];
|
||||
f.execute(&i_bad[..], &mut BytesRef::Fixed(&mut o[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o[..], &hex!("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[..]);
|
||||
assert_eq!(&o[..], &(FromHex::from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap())[..]);
|
||||
|
||||
let i_bad = hex!("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000001b");
|
||||
let i_bad = FromHex::from_hex("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000001b").unwrap();
|
||||
let mut o = [255u8; 32];
|
||||
f.execute(&i_bad[..], &mut BytesRef::Fixed(&mut o[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o[..], &hex!("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[..]);
|
||||
assert_eq!(&o[..], &(FromHex::from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap())[..]);
|
||||
|
||||
let i_bad = hex!("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
||||
let i_bad = FromHex::from_hex("47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001bffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap();
|
||||
let mut o = [255u8; 32];
|
||||
f.execute(&i_bad[..], &mut BytesRef::Fixed(&mut o[..])).expect("Builtin should not fail");
|
||||
assert_eq!(&o[..], &hex!("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[..]);
|
||||
assert_eq!(&o[..], &(FromHex::from_hex("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap())[..]);
|
||||
|
||||
// TODO: Should this (corrupted version of the above) fail rather than returning some address?
|
||||
/* let i_bad = FromHex::from_hex("48173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad000000000000000000000000000000000000000000000000000000000000001b650acf9d3f5f0a2c799776a1254355d5f4061762a237396a99a0e0e3fc2bcd6729514a0dacb2e623ac4abd157cb18163ff942280db4d5caad66ddf941ba12e03").unwrap();
|
||||
@@ -965,103 +721,103 @@ use hex_literal::hex;
|
||||
|
||||
// test for potential gas cost multiplication overflow
|
||||
{
|
||||
let input = hex!("0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000003b27bafd00000000000000000000000000000000000000000000000000000000503c8ac3");
|
||||
let input = FromHex::from_hex("0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000003b27bafd00000000000000000000000000000000000000000000000000000000503c8ac3").unwrap();
|
||||
let expected_cost = U256::max_value();
|
||||
assert_eq!(f.cost(&input[..], 0), expected_cost.into());
|
||||
assert_eq!(f.cost(&input[..]), expected_cost.into());
|
||||
}
|
||||
|
||||
// test for potential exp len overflow
|
||||
{
|
||||
let input = hex!("
|
||||
00000000000000000000000000000000000000000000000000000000000000ff
|
||||
2a1e530000000000000000000000000000000000000000000000000000000000
|
||||
let input = FromHex::from_hex("\
|
||||
00000000000000000000000000000000000000000000000000000000000000ff\
|
||||
2a1e530000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000000000000000000000000000000000000000000000000000000000"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
let mut output = vec![0u8; 32];
|
||||
let expected = hex!("0000000000000000000000000000000000000000000000000000000000000000");
|
||||
let expected = FromHex::from_hex("0000000000000000000000000000000000000000000000000000000000000000").unwrap();
|
||||
let expected_cost = U256::max_value();
|
||||
|
||||
f.execute(&input[..], &mut BytesRef::Fixed(&mut output[..])).expect("Builtin should fail");
|
||||
assert_eq!(output, expected);
|
||||
assert_eq!(f.cost(&input[..], 0), expected_cost.into());
|
||||
assert_eq!(f.cost(&input[..]), expected_cost.into());
|
||||
}
|
||||
|
||||
// fermat's little theorem example.
|
||||
{
|
||||
let input = hex!("
|
||||
0000000000000000000000000000000000000000000000000000000000000001
|
||||
0000000000000000000000000000000000000000000000000000000000000020
|
||||
0000000000000000000000000000000000000000000000000000000000000020
|
||||
03
|
||||
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e
|
||||
let input = FromHex::from_hex("\
|
||||
0000000000000000000000000000000000000000000000000000000000000001\
|
||||
0000000000000000000000000000000000000000000000000000000000000020\
|
||||
0000000000000000000000000000000000000000000000000000000000000020\
|
||||
03\
|
||||
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e\
|
||||
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
let mut output = vec![0u8; 32];
|
||||
let expected = hex!("0000000000000000000000000000000000000000000000000000000000000001");
|
||||
let expected = FromHex::from_hex("0000000000000000000000000000000000000000000000000000000000000001").unwrap();
|
||||
let expected_cost = 13056;
|
||||
|
||||
f.execute(&input[..], &mut BytesRef::Fixed(&mut output[..])).expect("Builtin should not fail");
|
||||
assert_eq!(output, expected);
|
||||
assert_eq!(f.cost(&input[..], 0), expected_cost.into());
|
||||
assert_eq!(f.cost(&input[..]), expected_cost.into());
|
||||
}
|
||||
|
||||
// second example from EIP: zero base.
|
||||
{
|
||||
let input = hex!("
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000020
|
||||
0000000000000000000000000000000000000000000000000000000000000020
|
||||
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e
|
||||
let input = FromHex::from_hex("\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000000000000000000000000000000000000000000000000000000020\
|
||||
0000000000000000000000000000000000000000000000000000000000000020\
|
||||
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e\
|
||||
fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
let mut output = vec![0u8; 32];
|
||||
let expected = hex!("0000000000000000000000000000000000000000000000000000000000000000");
|
||||
let expected = FromHex::from_hex("0000000000000000000000000000000000000000000000000000000000000000").unwrap();
|
||||
let expected_cost = 13056;
|
||||
|
||||
f.execute(&input[..], &mut BytesRef::Fixed(&mut output[..])).expect("Builtin should not fail");
|
||||
assert_eq!(output, expected);
|
||||
assert_eq!(f.cost(&input[..], 0), expected_cost.into());
|
||||
assert_eq!(f.cost(&input[..]), expected_cost.into());
|
||||
}
|
||||
|
||||
// another example from EIP: zero-padding
|
||||
{
|
||||
let input = hex!("
|
||||
0000000000000000000000000000000000000000000000000000000000000001
|
||||
0000000000000000000000000000000000000000000000000000000000000002
|
||||
0000000000000000000000000000000000000000000000000000000000000020
|
||||
03
|
||||
ffff
|
||||
let input = FromHex::from_hex("\
|
||||
0000000000000000000000000000000000000000000000000000000000000001\
|
||||
0000000000000000000000000000000000000000000000000000000000000002\
|
||||
0000000000000000000000000000000000000000000000000000000000000020\
|
||||
03\
|
||||
ffff\
|
||||
80"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
let mut output = vec![0u8; 32];
|
||||
let expected = hex!("3b01b01ac41f2d6e917c6d6a221ce793802469026d9ab7578fa2e79e4da6aaab");
|
||||
let expected = FromHex::from_hex("3b01b01ac41f2d6e917c6d6a221ce793802469026d9ab7578fa2e79e4da6aaab").unwrap();
|
||||
let expected_cost = 768;
|
||||
|
||||
f.execute(&input[..], &mut BytesRef::Fixed(&mut output[..])).expect("Builtin should not fail");
|
||||
assert_eq!(output, expected);
|
||||
assert_eq!(f.cost(&input[..], 0), expected_cost.into());
|
||||
assert_eq!(f.cost(&input[..]), expected_cost.into());
|
||||
}
|
||||
|
||||
// zero-length modulus.
|
||||
{
|
||||
let input = hex!("
|
||||
0000000000000000000000000000000000000000000000000000000000000001
|
||||
0000000000000000000000000000000000000000000000000000000000000002
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
03
|
||||
let input = FromHex::from_hex("\
|
||||
0000000000000000000000000000000000000000000000000000000000000001\
|
||||
0000000000000000000000000000000000000000000000000000000000000002\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
03\
|
||||
ffff"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
let mut output = vec![];
|
||||
let expected_cost = 0;
|
||||
|
||||
f.execute(&input[..], &mut BytesRef::Flexible(&mut output)).expect("Builtin should not fail");
|
||||
assert_eq!(output.len(), 0); // shouldn't have written any output.
|
||||
assert_eq!(f.cost(&input[..], 0), expected_cost.into());
|
||||
assert_eq!(f.cost(&input[..]), expected_cost.into());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1076,21 +832,21 @@ use hex_literal::hex;
|
||||
|
||||
// zero-points additions
|
||||
{
|
||||
let input = hex!("
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
let input = FromHex::from_hex("\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000000000000000000000000000000000000000000000000000000000"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
let mut output = vec![0u8; 64];
|
||||
let expected = hex!("
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
let expected = FromHex::from_hex("\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000000000000000000000000000000000000000000000000000000000"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
f.execute(&input[..], &mut BytesRef::Fixed(&mut output[..])).expect("Builtin should not fail");
|
||||
assert_eq!(output, &expected[..]);
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
|
||||
// no input, should not fail
|
||||
@@ -1099,23 +855,23 @@ use hex_literal::hex;
|
||||
let input = BytesRef::Fixed(&mut empty);
|
||||
|
||||
let mut output = vec![0u8; 64];
|
||||
let expected = hex!("
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
let expected = FromHex::from_hex("\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000000000000000000000000000000000000000000000000000000000"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
f.execute(&input[..], &mut BytesRef::Fixed(&mut output[..])).expect("Builtin should not fail");
|
||||
assert_eq!(output, &expected[..]);
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
|
||||
// should fail - point not on curve
|
||||
{
|
||||
let input = hex!("
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
let input = FromHex::from_hex("\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
let mut output = vec![0u8; 64];
|
||||
|
||||
@@ -1135,29 +891,29 @@ use hex_literal::hex;
|
||||
|
||||
// zero-point multiplication
|
||||
{
|
||||
let input = hex!("
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
let input = FromHex::from_hex("\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
0200000000000000000000000000000000000000000000000000000000000000"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
let mut output = vec![0u8; 64];
|
||||
let expected = hex!("
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
let expected = FromHex::from_hex("\
|
||||
0000000000000000000000000000000000000000000000000000000000000000\
|
||||
0000000000000000000000000000000000000000000000000000000000000000"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
f.execute(&input[..], &mut BytesRef::Fixed(&mut output[..])).expect("Builtin should not fail");
|
||||
assert_eq!(output, &expected[..]);
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
|
||||
// should fail - point not on curve
|
||||
{
|
||||
let input = hex!("
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
let input = FromHex::from_hex("\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
0f00000000000000000000000000000000000000000000000000000000000000"
|
||||
);
|
||||
).unwrap();
|
||||
|
||||
let mut output = vec![0u8; 64];
|
||||
|
||||
@@ -1198,12 +954,16 @@ use hex_literal::hex;
|
||||
}
|
||||
}
|
||||
|
||||
fn bytes(s: &'static str) -> Vec<u8> {
|
||||
FromHex::from_hex(s).expect("static str should contain valid hex bytes")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bn128_pairing_empty() {
|
||||
// should not fail, because empty input is a valid input of 0 elements
|
||||
empty_test(
|
||||
builtin_pairing(),
|
||||
hex!("0000000000000000000000000000000000000000000000000000000000000001").to_vec(),
|
||||
bytes("0000000000000000000000000000000000000000000000000000000000000001"),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1212,12 +972,12 @@ use hex_literal::hex;
|
||||
// should fail - point not on curve
|
||||
error_test(
|
||||
builtin_pairing(),
|
||||
&hex!("
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
&bytes("\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111"
|
||||
),
|
||||
Some("not on curve"),
|
||||
@@ -1229,9 +989,9 @@ use hex_literal::hex;
|
||||
// should fail - input length is invalid
|
||||
error_test(
|
||||
builtin_pairing(),
|
||||
&hex!("
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
1111111111111111111111111111111111111111111111111111111111111111
|
||||
&bytes("\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
1111111111111111111111111111111111111111111111111111111111111111\
|
||||
111111111111111111111111111111"
|
||||
),
|
||||
Some("Invalid input length"),
|
||||
@@ -1248,7 +1008,7 @@ use hex_literal::hex;
|
||||
fn is_active() {
|
||||
let pricer = Box::new(Linear { base: 10, word: 20} );
|
||||
let b = Builtin {
|
||||
pricer: pricer as Box<dyn Pricer>,
|
||||
pricer: pricer as Box<Pricer>,
|
||||
native: ethereum_builtin("identity"),
|
||||
activate_at: 100_000,
|
||||
};
|
||||
@@ -1262,15 +1022,15 @@ use hex_literal::hex;
|
||||
fn from_named_linear() {
|
||||
let pricer = Box::new(Linear { base: 10, word: 20 });
|
||||
let b = Builtin {
|
||||
pricer: pricer as Box<dyn Pricer>,
|
||||
pricer: pricer as Box<Pricer>,
|
||||
native: ethereum_builtin("identity"),
|
||||
activate_at: 1,
|
||||
};
|
||||
|
||||
assert_eq!(b.cost(&[0; 0], 0), U256::from(10));
|
||||
assert_eq!(b.cost(&[0; 1], 0), U256::from(30));
|
||||
assert_eq!(b.cost(&[0; 32], 0), U256::from(30));
|
||||
assert_eq!(b.cost(&[0; 33], 0), U256::from(50));
|
||||
assert_eq!(b.cost(&[0; 0]), U256::from(10));
|
||||
assert_eq!(b.cost(&[0; 1]), U256::from(30));
|
||||
assert_eq!(b.cost(&[0; 32]), U256::from(30));
|
||||
assert_eq!(b.cost(&[0; 33]), U256::from(50));
|
||||
|
||||
let i = [0u8, 1, 2, 3];
|
||||
let mut o = [255u8; 4];
|
||||
@@ -1287,67 +1047,16 @@ use hex_literal::hex;
|
||||
word: 20,
|
||||
}),
|
||||
activate_at: None,
|
||||
eip1108_transition: None,
|
||||
});
|
||||
|
||||
assert_eq!(b.cost(&[0; 0], 0), U256::from(10));
|
||||
assert_eq!(b.cost(&[0; 1], 0), U256::from(30));
|
||||
assert_eq!(b.cost(&[0; 32], 0), U256::from(30));
|
||||
assert_eq!(b.cost(&[0; 33], 0), U256::from(50));
|
||||
assert_eq!(b.cost(&[0; 0]), U256::from(10));
|
||||
assert_eq!(b.cost(&[0; 1]), U256::from(30));
|
||||
assert_eq!(b.cost(&[0; 32]), U256::from(30));
|
||||
assert_eq!(b.cost(&[0; 33]), U256::from(50));
|
||||
|
||||
let i = [0u8, 1, 2, 3];
|
||||
let mut o = [255u8; 4];
|
||||
b.execute(&i[..], &mut BytesRef::Fixed(&mut o[..])).expect("Builtin should not fail");
|
||||
assert_eq!(i, o);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bn128_pairing_eip1108_transition() {
|
||||
let b = Builtin::from(ethjson::spec::Builtin {
|
||||
name: "alt_bn128_pairing".to_owned(),
|
||||
pricing: ethjson::spec::Pricing::AltBn128Pairing(ethjson::spec::builtin::AltBn128Pairing {
|
||||
base: 100_000,
|
||||
pair: 80_000,
|
||||
eip1108_transition_base: 45_000,
|
||||
eip1108_transition_pair: 34_000,
|
||||
}),
|
||||
activate_at: Some(Uint(U256::from(10))),
|
||||
eip1108_transition: Some(Uint(U256::from(20))),
|
||||
});
|
||||
|
||||
assert_eq!(b.cost(&[0; 192 * 3], 10), U256::from(340_000), "80 000 * 3 + 100 000 == 340 000");
|
||||
assert_eq!(b.cost(&[0; 192 * 7], 20), U256::from(283_000), "34 000 * 7 + 45 000 == 283 000");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bn128_add_eip1108_transition() {
|
||||
let b = Builtin::from(ethjson::spec::Builtin {
|
||||
name: "alt_bn128_add".to_owned(),
|
||||
pricing: ethjson::spec::Pricing::AltBn128ConstOperations(ethjson::spec::builtin::AltBn128ConstOperations {
|
||||
price: 500,
|
||||
eip1108_transition_price: 150,
|
||||
}),
|
||||
activate_at: Some(Uint(U256::from(10))),
|
||||
eip1108_transition: Some(Uint(U256::from(20))),
|
||||
});
|
||||
|
||||
assert_eq!(b.cost(&[0; 192], 10), U256::from(500));
|
||||
assert_eq!(b.cost(&[0; 10], 20), U256::from(150), "after istanbul hardfork gas cost for add should be 150");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bn128_mul_eip1108_transition() {
|
||||
let b = Builtin::from(ethjson::spec::Builtin {
|
||||
name: "alt_bn128_mul".to_owned(),
|
||||
pricing: ethjson::spec::Pricing::AltBn128ConstOperations(ethjson::spec::builtin::AltBn128ConstOperations {
|
||||
price: 40_000,
|
||||
eip1108_transition_price: 6000,
|
||||
}),
|
||||
activate_at: Some(Uint(U256::from(10))),
|
||||
eip1108_transition: Some(Uint(U256::from(20))),
|
||||
});
|
||||
|
||||
assert_eq!(b.cost(&[0; 192], 10), U256::from(40_000));
|
||||
assert_eq!(b.cost(&[0; 10], 20), U256::from(6_000), "after istanbul hardfork gas cost for mul should be 6 000");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ use blockchain::{BlockReceipts, BlockChain, BlockChainDB, BlockProvider, TreeRou
|
||||
use bytes::Bytes;
|
||||
use call_contract::{CallContract, RegistryInfo};
|
||||
use ethcore_miner::pool::VerifiedTransaction;
|
||||
use ethereum_types::{H256, H264, Address, U256};
|
||||
use ethcore_miner::service_transaction_checker::ServiceTransactionChecker;
|
||||
use ethereum_types::{H256, Address, U256};
|
||||
use evm::Schedule;
|
||||
use hash::keccak;
|
||||
use io::IoChannel;
|
||||
@@ -44,7 +45,7 @@ use types::receipt::{Receipt, LocalizedReceipt};
|
||||
use types::{BlockNumber, header::{Header, ExtendedHeader}};
|
||||
use vm::{EnvInfo, LastHashes};
|
||||
|
||||
use block::{LockedBlock, Drain, ClosedBlock, OpenBlock, enact_verified, SealedBlock};
|
||||
use block::{IsBlock, LockedBlock, Drain, ClosedBlock, OpenBlock, enact_verified, SealedBlock};
|
||||
use client::ancient_import::AncientVerifier;
|
||||
use client::{
|
||||
Nonce, Balance, ChainInfo, BlockInfo, TransactionInfo,
|
||||
@@ -60,7 +61,7 @@ use client::{
|
||||
IoClient, BadBlocks,
|
||||
};
|
||||
use client::bad_blocks;
|
||||
use engines::{MAX_UNCLE_AGE, EthEngine, EpochTransition, ForkChoice, EngineError};
|
||||
use engines::{EthEngine, EpochTransition, ForkChoice, EngineError};
|
||||
use engines::epoch::PendingTransition;
|
||||
use error::{
|
||||
ImportErrorKind, ExecutionError, CallError, BlockError,
|
||||
@@ -86,7 +87,7 @@ pub use types::blockchain_info::BlockChainInfo;
|
||||
pub use types::block_status::BlockStatus;
|
||||
pub use blockchain::CacheSize as BlockChainCacheSize;
|
||||
pub use verification::QueueInfo as BlockQueueInfo;
|
||||
use db::{Writable, Readable, keys::BlockDetails};
|
||||
use db::Writable;
|
||||
|
||||
use_contract!(registry, "res/contracts/registrar.json");
|
||||
|
||||
@@ -297,11 +298,19 @@ impl Importer {
|
||||
|
||||
match self.check_and_lock_block(&bytes, block, client) {
|
||||
Ok((closed_block, pending)) => {
|
||||
imported_blocks.push(hash);
|
||||
let transactions_len = closed_block.transactions.len();
|
||||
let route = self.commit_block(closed_block, &header, encoded::Block::new(bytes), pending, client);
|
||||
import_results.push(route);
|
||||
client.report.write().accrue_block(&header, transactions_len);
|
||||
if self.engine.is_proposal(&header) {
|
||||
self.block_queue.mark_as_good(&[hash]);
|
||||
proposed_blocks.push(bytes);
|
||||
} else {
|
||||
imported_blocks.push(hash);
|
||||
|
||||
let transactions_len = closed_block.transactions().len();
|
||||
|
||||
let route = self.commit_block(closed_block, &header, encoded::Block::new(bytes), pending, client);
|
||||
import_results.push(route);
|
||||
|
||||
client.report.write().accrue_block(&header, transactions_len);
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
self.bad_blocks.report(bytes, format!("{:?}", err));
|
||||
@@ -398,7 +407,6 @@ impl Importer {
|
||||
let db = client.state_db.read().boxed_clone_canon(header.parent_hash());
|
||||
|
||||
let is_epoch_begin = chain.epoch_transition(parent.number(), *header.parent_hash()).is_some();
|
||||
|
||||
let enact_result = enact_verified(
|
||||
block,
|
||||
engine,
|
||||
@@ -423,13 +431,13 @@ impl Importer {
|
||||
// if the expected receipts root header does not match.
|
||||
// (i.e. allow inconsistency in receipts outcome before the transition block)
|
||||
if header.number() < engine.params().validate_receipts_transition
|
||||
&& header.receipts_root() != locked_block.header.receipts_root()
|
||||
&& header.receipts_root() != locked_block.block().header().receipts_root()
|
||||
{
|
||||
locked_block.strip_receipts_outcomes();
|
||||
}
|
||||
|
||||
// Final Verification
|
||||
if let Err(e) = self.verifier.verify_block_final(&header, &locked_block.header) {
|
||||
if let Err(e) = self.verifier.verify_block_final(&header, locked_block.block().header()) {
|
||||
warn!(target: "client", "Stage 5 block verification failed for #{} ({})\nError: {:?}", header.number(), header.hash(), e);
|
||||
bail!(e);
|
||||
}
|
||||
@@ -437,8 +445,8 @@ impl Importer {
|
||||
let pending = self.check_epoch_end_signal(
|
||||
&header,
|
||||
bytes,
|
||||
&locked_block.receipts,
|
||||
locked_block.state.db(),
|
||||
locked_block.receipts(),
|
||||
locked_block.state().db(),
|
||||
client
|
||||
)?;
|
||||
|
||||
@@ -764,8 +772,8 @@ impl Client {
|
||||
liveness: AtomicBool::new(awake),
|
||||
mode: Mutex::new(config.mode.clone()),
|
||||
chain: RwLock::new(chain),
|
||||
tracedb,
|
||||
engine,
|
||||
tracedb: tracedb,
|
||||
engine: engine,
|
||||
pruning: config.pruning.clone(),
|
||||
db: RwLock::new(db.clone()),
|
||||
state_db: RwLock::new(state_db),
|
||||
@@ -778,8 +786,8 @@ impl Client {
|
||||
ancient_blocks_import_lock: Default::default(),
|
||||
queue_consensus_message: IoChannelQueue::new(usize::max_value()),
|
||||
last_hashes: RwLock::new(VecDeque::new()),
|
||||
factories,
|
||||
history,
|
||||
factories: factories,
|
||||
history: history,
|
||||
on_user_defaults_change: Mutex::new(None),
|
||||
registrar_address,
|
||||
exit_handler: Mutex::new(None),
|
||||
@@ -1109,7 +1117,7 @@ impl Client {
|
||||
let mut ss = self.sleep_state.lock();
|
||||
if let Some(t) = ss.last_activity {
|
||||
if Instant::now() > t + timeout {
|
||||
self.sleep(false);
|
||||
self.sleep();
|
||||
ss.last_activity = None;
|
||||
}
|
||||
}
|
||||
@@ -1119,7 +1127,7 @@ impl Client {
|
||||
let now = Instant::now();
|
||||
if let Some(t) = ss.last_activity {
|
||||
if now > t + timeout {
|
||||
self.sleep(false);
|
||||
self.sleep();
|
||||
ss.last_activity = None;
|
||||
ss.last_autosleep = Some(now);
|
||||
}
|
||||
@@ -1138,15 +1146,10 @@ impl Client {
|
||||
|
||||
/// Take a snapshot at the given block.
|
||||
/// If the ID given is "latest", this will default to 1000 blocks behind.
|
||||
pub fn take_snapshot<W: snapshot_io::SnapshotWriter + Send>(
|
||||
&self,
|
||||
writer: W,
|
||||
at: BlockId,
|
||||
p: &snapshot::Progress,
|
||||
) -> Result<(), EthcoreError> {
|
||||
pub fn take_snapshot<W: snapshot_io::SnapshotWriter + Send>(&self, writer: W, at: BlockId, p: &snapshot::Progress) -> Result<(), EthcoreError> {
|
||||
let db = self.state_db.read().journal_db().boxed_clone();
|
||||
let best_block_number = self.chain_info().best_block_number;
|
||||
let block_number = self.block_number(at).ok_or_else(|| snapshot::Error::InvalidStartingBlock(at))?;
|
||||
let block_number = self.block_number(at).ok_or(snapshot::Error::InvalidStartingBlock(at))?;
|
||||
|
||||
if db.is_pruned() && self.pruning_info().earliest_state > block_number {
|
||||
return Err(snapshot::Error::OldBlockPrunedDB.into());
|
||||
@@ -1173,16 +1176,8 @@ impl Client {
|
||||
};
|
||||
|
||||
let processing_threads = self.config.snapshot.processing_threads;
|
||||
let chunker = self.engine.snapshot_components().ok_or(snapshot::Error::SnapshotsUnsupported)?;
|
||||
snapshot::take_snapshot(
|
||||
chunker,
|
||||
&self.chain.read(),
|
||||
start_hash,
|
||||
db.as_hash_db(),
|
||||
writer,
|
||||
p,
|
||||
processing_threads,
|
||||
)?;
|
||||
snapshot::take_snapshot(&*self.engine, &self.chain.read(), start_hash, db.as_hash_db(), writer, p, processing_threads)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1218,10 +1213,10 @@ impl Client {
|
||||
}
|
||||
}
|
||||
|
||||
fn sleep(&self, force: bool) {
|
||||
fn sleep(&self) {
|
||||
if self.liveness.load(AtomicOrdering::Relaxed) {
|
||||
// only sleep if the import queue is mostly empty.
|
||||
if force || (self.queue_info().total_queue_size() <= MAX_QUEUE_SIZE_TO_SLEEP_ON) {
|
||||
if self.queue_info().total_queue_size() <= MAX_QUEUE_SIZE_TO_SLEEP_ON {
|
||||
self.liveness.store(false, AtomicOrdering::Relaxed);
|
||||
self.notify(|n| n.stop());
|
||||
info!(target: "mode", "sleep: Sleeping.");
|
||||
@@ -1340,60 +1335,37 @@ impl BlockChainReset for Client {
|
||||
fn reset(&self, num: u32) -> Result<(), String> {
|
||||
if num as u64 > self.pruning_history() {
|
||||
return Err("Attempting to reset to block with pruned state".into())
|
||||
} else if num == 0 {
|
||||
return Err("invalid number of blocks to reset".into())
|
||||
}
|
||||
|
||||
let mut blocks_to_delete = Vec::with_capacity(num as usize);
|
||||
let mut best_block_hash = self.chain.read().best_block_hash();
|
||||
let mut batch = DBTransaction::with_capacity(blocks_to_delete.len());
|
||||
let (blocks_to_delete, best_block_hash) = self.chain.read()
|
||||
.block_headers_from_best_block(num)
|
||||
.ok_or("Attempted to reset past genesis block")?;
|
||||
|
||||
for _ in 0..num {
|
||||
let current_header = self.chain.read().block_header_data(&best_block_hash)
|
||||
.expect("best_block_hash was fetched from db; block_header_data should exist in db; qed");
|
||||
best_block_hash = current_header.parent_hash();
|
||||
let mut db_transaction = DBTransaction::with_capacity((num + 1) as usize);
|
||||
|
||||
let (number, hash) = (current_header.number(), current_header.hash());
|
||||
batch.delete(::db::COL_HEADERS, &hash);
|
||||
batch.delete(::db::COL_BODIES, &hash);
|
||||
Writable::delete::<BlockDetails, H264>
|
||||
(&mut batch, ::db::COL_EXTRA, &hash);
|
||||
for hash in &blocks_to_delete {
|
||||
db_transaction.delete(::db::COL_HEADERS, &hash.hash());
|
||||
db_transaction.delete(::db::COL_BODIES, &hash.hash());
|
||||
db_transaction.delete(::db::COL_EXTRA, &hash.hash());
|
||||
Writable::delete::<H256, BlockNumberKey>
|
||||
(&mut batch, ::db::COL_EXTRA, &number);
|
||||
|
||||
blocks_to_delete.push((number, hash));
|
||||
(&mut db_transaction, ::db::COL_EXTRA, &hash.number());
|
||||
}
|
||||
|
||||
let hashes = blocks_to_delete.iter().map(|(_, hash)| hash).collect::<Vec<_>>();
|
||||
info!("Deleting block hashes {}",
|
||||
Colour::Red
|
||||
.bold()
|
||||
.paint(format!("{:#?}", hashes))
|
||||
);
|
||||
|
||||
let mut best_block_details = Readable::read::<BlockDetails, H264>(
|
||||
&**self.db.read().key_value(),
|
||||
::db::COL_EXTRA,
|
||||
&best_block_hash
|
||||
).expect("block was previously imported; best_block_details should exist; qed");
|
||||
|
||||
let (_, last_hash) = blocks_to_delete.last()
|
||||
.expect("num is > 0; blocks_to_delete can't be empty; qed");
|
||||
// remove the last block as a child so that it can be re-imported
|
||||
// ethcore/blockchain/src/blockchain.rs/Blockchain::is_known_child()
|
||||
best_block_details.children.retain(|h| *h != *last_hash);
|
||||
batch.write(
|
||||
::db::COL_EXTRA,
|
||||
&best_block_hash,
|
||||
&best_block_details
|
||||
);
|
||||
// update the new best block hash
|
||||
batch.put(::db::COL_EXTRA, b"best", &best_block_hash);
|
||||
db_transaction.put(::db::COL_EXTRA, b"best", &*best_block_hash);
|
||||
|
||||
self.db.read()
|
||||
.key_value()
|
||||
.write(batch)
|
||||
.map_err(|err| format!("could not delete blocks; io error occurred: {}", err))?;
|
||||
.write(db_transaction)
|
||||
.map_err(|err| format!("could not complete reset operation; io error occured: {}", err))?;
|
||||
|
||||
let hashes = blocks_to_delete.iter().map(|b| b.hash()).collect::<Vec<_>>();
|
||||
|
||||
info!("Deleting block hashes {}",
|
||||
Colour::Red
|
||||
.bold()
|
||||
.paint(format!("{:#?}", hashes))
|
||||
);
|
||||
|
||||
info!("New best block hash {}", Colour::Green.bold().paint(format!("{:?}", best_block_hash)));
|
||||
|
||||
@@ -1606,27 +1578,22 @@ impl Call for Client {
|
||||
let schedule = machine.schedule(env_info.number);
|
||||
Executive::new(&mut clone, &env_info, &machine, &schedule)
|
||||
.transact_virtual(&tx, options())
|
||||
.ok()
|
||||
.map(|r| r.exception.is_none())
|
||||
};
|
||||
|
||||
let cond = |gas| {
|
||||
exec(gas)
|
||||
.ok()
|
||||
.map_or(false, |r| r.exception.is_none())
|
||||
};
|
||||
let cond = |gas| exec(gas).unwrap_or(false);
|
||||
|
||||
if !cond(upper) {
|
||||
upper = max_upper;
|
||||
match exec(upper) {
|
||||
Ok(v) => {
|
||||
if let Some(exception) = v.exception {
|
||||
return Err(CallError::Exceptional(exception))
|
||||
}
|
||||
},
|
||||
Err(_e) => {
|
||||
Some(false) => return Err(CallError::Exceptional),
|
||||
None => {
|
||||
trace!(target: "estimate_gas", "estimate_gas failed with {}", upper);
|
||||
let err = ExecutionError::Internal(format!("Requires higher than upper limit of {}", upper));
|
||||
return Err(err.into())
|
||||
}
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
let lower = t.gas_required(&self.engine.schedule(env_info.number)).into();
|
||||
@@ -1730,7 +1697,7 @@ impl BlockChainClient for Client {
|
||||
}
|
||||
match new_mode {
|
||||
Mode::Active => self.wake_up(),
|
||||
Mode::Off => self.sleep(true),
|
||||
Mode::Off => self.sleep(),
|
||||
_ => {(*self.sleep_state.lock()).last_activity = Some(Instant::now()); }
|
||||
}
|
||||
}
|
||||
@@ -1959,7 +1926,7 @@ impl BlockChainClient for Client {
|
||||
}
|
||||
|
||||
fn find_uncles(&self, hash: &H256) -> Option<Vec<H256>> {
|
||||
self.chain.read().find_uncle_hashes(hash, MAX_UNCLE_AGE)
|
||||
self.chain.read().find_uncle_hashes(hash, self.engine.maximum_uncle_age())
|
||||
}
|
||||
|
||||
fn state_data(&self, hash: &H256) -> Option<Bytes> {
|
||||
@@ -2192,14 +2159,10 @@ impl BlockChainClient for Client {
|
||||
|
||||
fn transact_contract(&self, address: Address, data: Bytes) -> Result<(), transaction::Error> {
|
||||
let authoring_params = self.importer.miner.authoring_params();
|
||||
let service_transaction_checker = self.importer.miner.service_transaction_checker();
|
||||
let gas_price = if let Some(checker) = service_transaction_checker {
|
||||
match checker.check_address(self, authoring_params.author) {
|
||||
Ok(true) => U256::zero(),
|
||||
_ => self.importer.miner.sensible_gas_price(),
|
||||
}
|
||||
} else {
|
||||
self.importer.miner.sensible_gas_price()
|
||||
let service_transaction_checker = ServiceTransactionChecker::default();
|
||||
let gas_price = match service_transaction_checker.check_address(self, authoring_params.author) {
|
||||
Ok(true) => U256::zero(),
|
||||
_ => self.importer.miner.sensible_gas_price(),
|
||||
};
|
||||
let transaction = transaction::Transaction {
|
||||
nonce: self.latest_nonce(&authoring_params.author),
|
||||
@@ -2321,24 +2284,24 @@ impl ReopenBlock for Client {
|
||||
fn reopen_block(&self, block: ClosedBlock) -> OpenBlock {
|
||||
let engine = &*self.engine;
|
||||
let mut block = block.reopen(engine);
|
||||
let max_uncles = engine.maximum_uncle_count(block.header.number());
|
||||
if block.uncles.len() < max_uncles {
|
||||
let max_uncles = engine.maximum_uncle_count(block.header().number());
|
||||
if block.uncles().len() < max_uncles {
|
||||
let chain = self.chain.read();
|
||||
let h = chain.best_block_hash();
|
||||
// Add new uncles
|
||||
let uncles = chain
|
||||
.find_uncle_hashes(&h, MAX_UNCLE_AGE)
|
||||
.find_uncle_hashes(&h, engine.maximum_uncle_age())
|
||||
.unwrap_or_else(Vec::new);
|
||||
|
||||
for h in uncles {
|
||||
if !block.uncles.iter().any(|header| header.hash() == h) {
|
||||
if !block.uncles().iter().any(|header| header.hash() == h) {
|
||||
let uncle = chain.block_header_data(&h).expect("find_uncle_hashes only returns hashes for existing headers; qed");
|
||||
let uncle = uncle.decode().expect("decoding failure");
|
||||
block.push_uncle(uncle).expect("pushing up to maximum_uncle_count;
|
||||
push_uncle is not ok only if more than maximum_uncle_count is pushed;
|
||||
so all push_uncle are Ok;
|
||||
qed");
|
||||
if block.uncles.len() >= max_uncles { break }
|
||||
if block.uncles().len() >= max_uncles { break }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2366,15 +2329,15 @@ impl PrepareOpenBlock for Client {
|
||||
gas_range_target,
|
||||
extra_data,
|
||||
is_epoch_begin,
|
||||
chain.ancestry_with_metadata_iter(best_header.hash()),
|
||||
&mut chain.ancestry_with_metadata_iter(best_header.hash()),
|
||||
)?;
|
||||
|
||||
// Add uncles
|
||||
chain
|
||||
.find_uncle_headers(&h, MAX_UNCLE_AGE)
|
||||
.find_uncle_headers(&h, engine.maximum_uncle_age())
|
||||
.unwrap_or_else(Vec::new)
|
||||
.into_iter()
|
||||
.take(engine.maximum_uncle_count(open_block.header.number()))
|
||||
.take(engine.maximum_uncle_count(open_block.header().number()))
|
||||
.foreach(|h| {
|
||||
open_block.push_uncle(h.decode().expect("decoding failure")).expect("pushing maximum_uncle_count;
|
||||
open_block was just created;
|
||||
@@ -2399,7 +2362,7 @@ impl ImportSealedBlock for Client {
|
||||
fn import_sealed_block(&self, block: SealedBlock) -> EthcoreResult<H256> {
|
||||
let start = Instant::now();
|
||||
let raw = block.rlp_bytes();
|
||||
let header = block.header.clone();
|
||||
let header = block.header().clone();
|
||||
let hash = header.hash();
|
||||
self.notify(|n| n.block_pre_import(&raw, &hash, header.difficulty()));
|
||||
|
||||
@@ -2422,8 +2385,8 @@ impl ImportSealedBlock for Client {
|
||||
let pending = self.importer.check_epoch_end_signal(
|
||||
&header,
|
||||
&block_data,
|
||||
&block.receipts,
|
||||
block.state.db(),
|
||||
block.receipts(),
|
||||
block.state().db(),
|
||||
self
|
||||
)?;
|
||||
let route = self.importer.commit_block(
|
||||
@@ -2560,11 +2523,7 @@ impl SnapshotClient for Client {}
|
||||
|
||||
impl Drop for Client {
|
||||
fn drop(&mut self) {
|
||||
if let Some(c) = Arc::get_mut(&mut self.engine) {
|
||||
c.stop()
|
||||
} else {
|
||||
warn!(target: "shutdown", "unable to get mut ref for engine for shutdown.");
|
||||
}
|
||||
self.engine.stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -241,17 +241,16 @@ impl<'a> EvmTestClient<'a> {
|
||||
transaction: transaction::SignedTransaction,
|
||||
tracer: T,
|
||||
vm_tracer: V,
|
||||
) -> std::result::Result<TransactSuccess<T::Output, V::Output>, TransactErr> {
|
||||
) -> TransactResult<T::Output, V::Output> {
|
||||
let initial_gas = transaction.gas;
|
||||
// Verify transaction
|
||||
let is_ok = transaction.verify_basic(true, None, false);
|
||||
if let Err(error) = is_ok {
|
||||
return Err(
|
||||
TransactErr{
|
||||
state_root: *self.state.root(),
|
||||
error: error.into(),
|
||||
end_state: (self.dump_state)(&self.state),
|
||||
});
|
||||
return TransactResult::Err {
|
||||
state_root: *self.state.root(),
|
||||
error: error.into(),
|
||||
end_state: (self.dump_state)(&self.state),
|
||||
};
|
||||
}
|
||||
|
||||
// Apply transaction
|
||||
@@ -284,7 +283,7 @@ impl<'a> EvmTestClient<'a> {
|
||||
|
||||
match result {
|
||||
Ok(result) => {
|
||||
Ok(TransactSuccess {
|
||||
TransactResult::Ok {
|
||||
state_root,
|
||||
gas_left: initial_gas - result.receipt.gas_used,
|
||||
outcome: result.receipt.outcome,
|
||||
@@ -299,48 +298,47 @@ impl<'a> EvmTestClient<'a> {
|
||||
},
|
||||
end_state,
|
||||
}
|
||||
)},
|
||||
Err(error) => Err(TransactErr {
|
||||
},
|
||||
Err(error) => TransactResult::Err {
|
||||
state_root,
|
||||
error,
|
||||
end_state,
|
||||
}),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// To be returned inside a std::result::Result::Ok after a successful
|
||||
/// transaction completed.
|
||||
#[allow(dead_code)]
|
||||
pub struct TransactSuccess<T, V> {
|
||||
/// State root
|
||||
pub state_root: H256,
|
||||
/// Amount of gas left
|
||||
pub gas_left: U256,
|
||||
/// Output
|
||||
pub output: Vec<u8>,
|
||||
/// Traces
|
||||
pub trace: Vec<T>,
|
||||
/// VM Traces
|
||||
pub vm_trace: Option<V>,
|
||||
/// Created contract address (if any)
|
||||
pub contract_address: Option<H160>,
|
||||
/// Generated logs
|
||||
pub logs: Vec<log_entry::LogEntry>,
|
||||
/// outcome
|
||||
pub outcome: receipt::TransactionOutcome,
|
||||
/// end state if needed
|
||||
pub end_state: Option<pod_state::PodState>,
|
||||
}
|
||||
|
||||
/// To be returned inside a std::result::Result::Err after a failed
|
||||
/// transaction.
|
||||
#[allow(dead_code)]
|
||||
pub struct TransactErr {
|
||||
/// State root
|
||||
pub state_root: H256,
|
||||
/// Execution error
|
||||
pub error: ::error::Error,
|
||||
/// end state if needed
|
||||
pub end_state: Option<pod_state::PodState>,
|
||||
/// A result of applying transaction to the state.
|
||||
#[derive(Debug)]
|
||||
pub enum TransactResult<T, V> {
|
||||
/// Successful execution
|
||||
Ok {
|
||||
/// State root
|
||||
state_root: H256,
|
||||
/// Amount of gas left
|
||||
gas_left: U256,
|
||||
/// Output
|
||||
output: Vec<u8>,
|
||||
/// Traces
|
||||
trace: Vec<T>,
|
||||
/// VM Traces
|
||||
vm_trace: Option<V>,
|
||||
/// Created contract address (if any)
|
||||
contract_address: Option<H160>,
|
||||
/// Generated logs
|
||||
logs: Vec<log_entry::LogEntry>,
|
||||
/// outcome
|
||||
outcome: receipt::TransactionOutcome,
|
||||
/// end state if needed
|
||||
end_state: Option<pod_state::PodState>,
|
||||
},
|
||||
/// Transaction failed to run
|
||||
Err {
|
||||
/// State root
|
||||
state_root: H256,
|
||||
/// Execution error
|
||||
error: ::error::Error,
|
||||
/// end state if needed
|
||||
end_state: Option<pod_state::PodState>,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ mod trace;
|
||||
pub use self::client::*;
|
||||
pub use self::config::{Mode, ClientConfig, DatabaseCompactionProfile, BlockChainConfig, VMType};
|
||||
#[cfg(any(test, feature = "test-helpers"))]
|
||||
pub use self::evm_test_client::{EvmTestClient, EvmTestError, TransactErr, TransactSuccess};
|
||||
pub use self::evm_test_client::{EvmTestClient, EvmTestError, TransactResult};
|
||||
pub use self::io_message::ClientIoMessage;
|
||||
#[cfg(any(test, feature = "test-helpers"))]
|
||||
pub use self::test_client::{TestBlockChainClient, EachBlockWith};
|
||||
@@ -54,7 +54,7 @@ pub use vm::{LastHashes, EnvInfo};
|
||||
pub use error::TransactionImportError;
|
||||
pub use verification::VerifierType;
|
||||
|
||||
pub mod traits;
|
||||
mod traits;
|
||||
|
||||
mod chain_notify;
|
||||
mod private_notify;
|
||||
|
||||
@@ -416,7 +416,7 @@ impl PrepareOpenBlock for TestBlockChainClient {
|
||||
gas_range_target,
|
||||
extra_data,
|
||||
false,
|
||||
None,
|
||||
&mut Vec::new().into_iter(),
|
||||
)?;
|
||||
// TODO [todr] Override timestamp for predictability
|
||||
open_block.set_timestamp(*self.latest_block_timestamp.read());
|
||||
|
||||
@@ -22,7 +22,7 @@ use std::iter::FromIterator;
|
||||
use std::ops::Deref;
|
||||
use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering as AtomicOrdering};
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::time::{UNIX_EPOCH, Duration};
|
||||
use std::time::{UNIX_EPOCH, SystemTime, Duration};
|
||||
|
||||
use block::*;
|
||||
use client::EngineClient;
|
||||
@@ -42,12 +42,14 @@ use itertools::{self, Itertools};
|
||||
use rlp::{encode, Decodable, DecoderError, Encodable, RlpStream, Rlp};
|
||||
use ethereum_types::{H256, H520, Address, U128, U256};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use time_utils::CheckedSystemTime;
|
||||
use types::BlockNumber;
|
||||
use types::header::{Header, ExtendedHeader};
|
||||
use types::ancestry_action::AncestryAction;
|
||||
use unexpected::{Mismatch, OutOfBounds};
|
||||
|
||||
#[cfg(not(time_checked_add))]
|
||||
use time_utils::CheckedSystemTime;
|
||||
|
||||
mod finality;
|
||||
|
||||
/// `AuthorityRound` params.
|
||||
@@ -513,19 +515,15 @@ fn header_expected_seal_fields(header: &Header, empty_steps_transition: u64) ->
|
||||
}
|
||||
|
||||
fn header_step(header: &Header, empty_steps_transition: u64) -> Result<u64, ::rlp::DecoderError> {
|
||||
Rlp::new(&header.seal().get(0).unwrap_or_else(||
|
||||
panic!("was either checked with verify_block_basic or is genesis; has {} fields; qed (Make sure the spec
|
||||
file has a correct genesis seal)", header_expected_seal_fields(header, empty_steps_transition))
|
||||
))
|
||||
.as_val()
|
||||
let expected_seal_fields = header_expected_seal_fields(header, empty_steps_transition);
|
||||
Rlp::new(&header.seal().get(0).expect(
|
||||
&format!("was either checked with verify_block_basic or is genesis; has {} fields; qed (Make sure the spec file has a correct genesis seal)", expected_seal_fields))).as_val()
|
||||
}
|
||||
|
||||
fn header_signature(header: &Header, empty_steps_transition: u64) -> Result<Signature, ::rlp::DecoderError> {
|
||||
Rlp::new(&header.seal().get(1).unwrap_or_else(||
|
||||
panic!("was checked with verify_block_basic; has {} fields; qed",
|
||||
header_expected_seal_fields(header, empty_steps_transition))
|
||||
))
|
||||
.as_val::<H520>().map(Into::into)
|
||||
let expected_seal_fields = header_expected_seal_fields(header, empty_steps_transition);
|
||||
Rlp::new(&header.seal().get(1).expect(
|
||||
&format!("was checked with verify_block_basic; has {} fields; qed", expected_seal_fields))).as_val::<H520>().map(Into::into)
|
||||
}
|
||||
|
||||
// extracts the raw empty steps vec from the header seal. should only be called when there are 3 fields in the seal
|
||||
@@ -576,10 +574,10 @@ fn verify_timestamp(step: &Step, header_step: u64) -> Result<(), BlockError> {
|
||||
// Returning it further won't recover the sync process.
|
||||
trace!(target: "engine", "verify_timestamp: block too early");
|
||||
|
||||
let found = CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(oob.found))
|
||||
.ok_or(BlockError::TimestampOverflow)?;
|
||||
let max = oob.max.and_then(|m| CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(m)));
|
||||
let min = oob.min.and_then(|m| CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(m)));
|
||||
let now = SystemTime::now();
|
||||
let found = now.checked_add(Duration::from_secs(oob.found)).ok_or(BlockError::TimestampOverflow)?;
|
||||
let max = oob.max.and_then(|m| now.checked_add(Duration::from_secs(m)));
|
||||
let min = oob.min.and_then(|m| now.checked_add(Duration::from_secs(m)));
|
||||
|
||||
let new_oob = OutOfBounds { min, max, found };
|
||||
|
||||
@@ -947,12 +945,8 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
||||
return BTreeMap::default();
|
||||
}
|
||||
|
||||
let step = header_step(header, self.empty_steps_transition).as_ref()
|
||||
.map(ToString::to_string)
|
||||
.unwrap_or_default();
|
||||
let signature = header_signature(header, self.empty_steps_transition).as_ref()
|
||||
.map(ToString::to_string)
|
||||
.unwrap_or_default();
|
||||
let step = header_step(header, self.empty_steps_transition).as_ref().map(ToString::to_string).unwrap_or("".into());
|
||||
let signature = header_signature(header, self.empty_steps_transition).as_ref().map(ToString::to_string).unwrap_or("".into());
|
||||
|
||||
let mut info = map![
|
||||
"step".into() => step,
|
||||
@@ -1039,7 +1033,7 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
||||
return Seal::None;
|
||||
}
|
||||
|
||||
let header = &block.header;
|
||||
let header = block.header();
|
||||
let parent_step = header_step(parent, self.empty_steps_transition)
|
||||
.expect("Header has been verified; qed");
|
||||
|
||||
@@ -1085,7 +1079,7 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
||||
// `EmptyStep(step, parent_hash)` message. If we exceed the maximum amount of `empty_step` rounds we proceed
|
||||
// with the seal.
|
||||
if header.number() >= self.empty_steps_transition &&
|
||||
block.transactions.is_empty() &&
|
||||
block.transactions().is_empty() &&
|
||||
empty_steps.len() < self.maximum_empty_steps {
|
||||
|
||||
if self.step.can_propose.compare_and_swap(true, false, AtomicOrdering::SeqCst) {
|
||||
@@ -1155,7 +1149,7 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
||||
if self.immediate_transitions || !epoch_begin { return Ok(()) }
|
||||
|
||||
// genesis is never a new block, but might as well check.
|
||||
let header = block.header.clone();
|
||||
let header = block.header().clone();
|
||||
let first = header.number() == 0;
|
||||
|
||||
let mut call = |to, data| {
|
||||
@@ -1175,8 +1169,8 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
||||
/// Apply the block reward on finalisation of the block.
|
||||
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error> {
|
||||
let mut beneficiaries = Vec::new();
|
||||
if block.header.number() >= self.empty_steps_transition {
|
||||
let empty_steps = if block.header.seal().is_empty() {
|
||||
if block.header().number() >= self.empty_steps_transition {
|
||||
let empty_steps = if block.header().seal().is_empty() {
|
||||
// this is a new block, calculate rewards based on the empty steps messages we have accumulated
|
||||
let client = match self.client.read().as_ref().and_then(|weak| weak.upgrade()) {
|
||||
Some(client) => client,
|
||||
@@ -1186,7 +1180,7 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
||||
},
|
||||
};
|
||||
|
||||
let parent = client.block_header(::client::BlockId::Hash(*block.header.parent_hash()))
|
||||
let parent = client.block_header(::client::BlockId::Hash(*block.header().parent_hash()))
|
||||
.expect("hash is from parent; parent header must exist; qed")
|
||||
.decode()?;
|
||||
|
||||
@@ -1195,7 +1189,7 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
||||
self.empty_steps(parent_step.into(), current_step.into(), parent.hash())
|
||||
} else {
|
||||
// we're verifying a block, extract empty steps from the seal
|
||||
header_empty_steps(&block.header)?
|
||||
header_empty_steps(block.header())?
|
||||
};
|
||||
|
||||
for empty_step in empty_steps {
|
||||
@@ -1204,11 +1198,11 @@ impl Engine<EthereumMachine> for AuthorityRound {
|
||||
}
|
||||
}
|
||||
|
||||
let author = *block.header.author();
|
||||
let author = *block.header().author();
|
||||
beneficiaries.push((author, RewardKind::Author));
|
||||
|
||||
let rewards: Vec<_> = match self.block_reward_contract {
|
||||
Some(ref c) if block.header.number() >= self.block_reward_contract_transition => {
|
||||
Some(ref c) if block.header().number() >= self.block_reward_contract_transition => {
|
||||
let mut call = super::default_system_or_code_call(&self.machine, block);
|
||||
|
||||
let rewards = c.reward(&beneficiaries, &mut call)?;
|
||||
@@ -1637,23 +1631,23 @@ mod tests {
|
||||
let db1 = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let db2 = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b1 = b1.close_and_lock().unwrap();
|
||||
let b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes, addr2, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes, addr2, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b2 = b2.close_and_lock().unwrap();
|
||||
|
||||
engine.set_signer(Box::new((tap.clone(), addr1, "1".into())));
|
||||
if let Seal::Regular(seal) = engine.generate_seal(&b1, &genesis_header) {
|
||||
if let Seal::Regular(seal) = engine.generate_seal(b1.block(), &genesis_header) {
|
||||
assert!(b1.clone().try_seal(engine, seal).is_ok());
|
||||
// Second proposal is forbidden.
|
||||
assert!(engine.generate_seal(&b1, &genesis_header) == Seal::None);
|
||||
assert!(engine.generate_seal(b1.block(), &genesis_header) == Seal::None);
|
||||
}
|
||||
|
||||
engine.set_signer(Box::new((tap, addr2, "2".into())));
|
||||
if let Seal::Regular(seal) = engine.generate_seal(&b2, &genesis_header) {
|
||||
if let Seal::Regular(seal) = engine.generate_seal(b2.block(), &genesis_header) {
|
||||
assert!(b2.clone().try_seal(engine, seal).is_ok());
|
||||
// Second proposal is forbidden.
|
||||
assert!(engine.generate_seal(&b2, &genesis_header) == Seal::None);
|
||||
assert!(engine.generate_seal(b2.block(), &genesis_header) == Seal::None);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1671,19 +1665,19 @@ mod tests {
|
||||
let db2 = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b1 = b1.close_and_lock().unwrap();
|
||||
let b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes, addr2, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes, addr2, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b2 = b2.close_and_lock().unwrap();
|
||||
|
||||
engine.set_signer(Box::new((tap.clone(), addr1, "1".into())));
|
||||
match engine.generate_seal(&b1, &genesis_header) {
|
||||
match engine.generate_seal(b1.block(), &genesis_header) {
|
||||
Seal::None | Seal::Proposal(_) => panic!("wrong seal"),
|
||||
Seal::Regular(_) => {
|
||||
engine.step();
|
||||
|
||||
engine.set_signer(Box::new((tap.clone(), addr2, "0".into())));
|
||||
match engine.generate_seal(&b2, &genesis_header) {
|
||||
match engine.generate_seal(b2.block(), &genesis_header) {
|
||||
Seal::Regular(_) | Seal::Proposal(_) => panic!("sealed despite wrong difficulty"),
|
||||
Seal::None => {}
|
||||
}
|
||||
@@ -1907,11 +1901,11 @@ mod tests {
|
||||
|
||||
engine.set_signer(Box::new((tap.clone(), addr1, "1".into())));
|
||||
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b1 = b1.close_and_lock().unwrap();
|
||||
|
||||
// the block is empty so we don't seal and instead broadcast an empty step message
|
||||
assert_eq!(engine.generate_seal(&b1, &genesis_header), Seal::None);
|
||||
assert_eq!(engine.generate_seal(b1.block(), &genesis_header), Seal::None);
|
||||
|
||||
// spec starts with step 2
|
||||
let empty_step_rlp = encode(&empty_step(engine, 2, &genesis_header.hash()));
|
||||
@@ -1921,7 +1915,7 @@ mod tests {
|
||||
let len = notify.messages.read().len();
|
||||
|
||||
// make sure that we don't generate empty step for the second time
|
||||
assert_eq!(engine.generate_seal(&b1, &genesis_header), Seal::None);
|
||||
assert_eq!(engine.generate_seal(b1.block(), &genesis_header), Seal::None);
|
||||
assert_eq!(len, notify.messages.read().len());
|
||||
}
|
||||
|
||||
@@ -1945,16 +1939,16 @@ mod tests {
|
||||
engine.register_client(Arc::downgrade(&client) as _);
|
||||
|
||||
// step 2
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b1 = b1.close_and_lock().unwrap();
|
||||
|
||||
// since the block is empty it isn't sealed and we generate empty steps
|
||||
engine.set_signer(Box::new((tap.clone(), addr1, "1".into())));
|
||||
assert_eq!(engine.generate_seal(&b1, &genesis_header), Seal::None);
|
||||
assert_eq!(engine.generate_seal(b1.block(), &genesis_header), Seal::None);
|
||||
engine.step();
|
||||
|
||||
// step 3
|
||||
let mut b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes.clone(), addr2, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let mut b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes.clone(), addr2, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
b2.push_transaction(Transaction {
|
||||
action: Action::Create,
|
||||
nonce: U256::from(0),
|
||||
@@ -1967,7 +1961,7 @@ mod tests {
|
||||
|
||||
// we will now seal a block with 1tx and include the accumulated empty step message
|
||||
engine.set_signer(Box::new((tap.clone(), addr2, "0".into())));
|
||||
if let Seal::Regular(seal) = engine.generate_seal(&b2, &genesis_header) {
|
||||
if let Seal::Regular(seal) = engine.generate_seal(b2.block(), &genesis_header) {
|
||||
engine.set_signer(Box::new((tap.clone(), addr1, "1".into())));
|
||||
let empty_step2 = sealed_empty_step(engine, 2, &genesis_header.hash());
|
||||
let empty_steps = ::rlp::encode_list(&vec![empty_step2]);
|
||||
@@ -1998,28 +1992,28 @@ mod tests {
|
||||
engine.register_client(Arc::downgrade(&client) as _);
|
||||
|
||||
// step 2
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b1 = b1.close_and_lock().unwrap();
|
||||
|
||||
// since the block is empty it isn't sealed and we generate empty steps
|
||||
engine.set_signer(Box::new((tap.clone(), addr1, "1".into())));
|
||||
assert_eq!(engine.generate_seal(&b1, &genesis_header), Seal::None);
|
||||
assert_eq!(engine.generate_seal(b1.block(), &genesis_header), Seal::None);
|
||||
engine.step();
|
||||
|
||||
// step 3
|
||||
let b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes.clone(), addr2, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes.clone(), addr2, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b2 = b2.close_and_lock().unwrap();
|
||||
engine.set_signer(Box::new((tap.clone(), addr2, "0".into())));
|
||||
assert_eq!(engine.generate_seal(&b2, &genesis_header), Seal::None);
|
||||
assert_eq!(engine.generate_seal(b2.block(), &genesis_header), Seal::None);
|
||||
engine.step();
|
||||
|
||||
// step 4
|
||||
// the spec sets the maximum_empty_steps to 2 so we will now seal an empty block and include the empty step messages
|
||||
let b3 = OpenBlock::new(engine, Default::default(), false, db3, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b3 = OpenBlock::new(engine, Default::default(), false, db3, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b3 = b3.close_and_lock().unwrap();
|
||||
|
||||
engine.set_signer(Box::new((tap.clone(), addr1, "1".into())));
|
||||
if let Seal::Regular(seal) = engine.generate_seal(&b3, &genesis_header) {
|
||||
if let Seal::Regular(seal) = engine.generate_seal(b3.block(), &genesis_header) {
|
||||
let empty_step2 = sealed_empty_step(engine, 2, &genesis_header.hash());
|
||||
engine.set_signer(Box::new((tap.clone(), addr2, "0".into())));
|
||||
let empty_step3 = sealed_empty_step(engine, 3, &genesis_header.hash());
|
||||
@@ -2048,24 +2042,24 @@ mod tests {
|
||||
engine.register_client(Arc::downgrade(&client) as _);
|
||||
|
||||
// step 2
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b1 = OpenBlock::new(engine, Default::default(), false, db1, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b1 = b1.close_and_lock().unwrap();
|
||||
|
||||
// since the block is empty it isn't sealed and we generate empty steps
|
||||
engine.set_signer(Box::new((tap.clone(), addr1, "1".into())));
|
||||
assert_eq!(engine.generate_seal(&b1, &genesis_header), Seal::None);
|
||||
assert_eq!(engine.generate_seal(b1.block(), &genesis_header), Seal::None);
|
||||
engine.step();
|
||||
|
||||
// step 3
|
||||
// the signer of the accumulated empty step message should be rewarded
|
||||
let b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let addr1_balance = b2.state.balance(&addr1).unwrap();
|
||||
let b2 = OpenBlock::new(engine, Default::default(), false, db2, &genesis_header, last_hashes.clone(), addr1, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let addr1_balance = b2.block().state().balance(&addr1).unwrap();
|
||||
|
||||
// after closing the block `addr1` should be reward twice, one for the included empty step message and another for block creation
|
||||
let b2 = b2.close_and_lock().unwrap();
|
||||
|
||||
// the spec sets the block reward to 10
|
||||
assert_eq!(b2.state.balance(&addr1).unwrap(), addr1_balance + (10 * 2))
|
||||
assert_eq!(b2.block().state().balance(&addr1).unwrap(), addr1_balance + (10 * 2))
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -2158,13 +2152,13 @@ mod tests {
|
||||
(3141562.into(), 31415620.into()),
|
||||
vec![],
|
||||
false,
|
||||
None,
|
||||
&mut Vec::new().into_iter(),
|
||||
).unwrap();
|
||||
let b1 = b1.close_and_lock().unwrap();
|
||||
|
||||
// since the block is empty it isn't sealed and we generate empty steps
|
||||
engine.set_signer(Box::new((tap.clone(), addr1, "1".into())));
|
||||
assert_eq!(engine.generate_seal(&b1, &genesis_header), Seal::None);
|
||||
assert_eq!(engine.generate_seal(b1.block(), &genesis_header), Seal::None);
|
||||
engine.step();
|
||||
|
||||
// step 3
|
||||
@@ -2180,9 +2174,9 @@ mod tests {
|
||||
(3141562.into(), 31415620.into()),
|
||||
vec![],
|
||||
false,
|
||||
None,
|
||||
&mut Vec::new().into_iter(),
|
||||
).unwrap();
|
||||
let addr1_balance = b2.state.balance(&addr1).unwrap();
|
||||
let addr1_balance = b2.block().state().balance(&addr1).unwrap();
|
||||
|
||||
// after closing the block `addr1` should be reward twice, one for the included empty step
|
||||
// message and another for block creation
|
||||
@@ -2190,7 +2184,7 @@ mod tests {
|
||||
|
||||
// the contract rewards (1000 + kind) for each benefactor/reward kind
|
||||
assert_eq!(
|
||||
b2.state.balance(&addr1).unwrap(),
|
||||
b2.block().state().balance(&addr1).unwrap(),
|
||||
addr1_balance + (1000 + 0) + (1000 + 2),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ impl Engine<EthereumMachine> for BasicAuthority {
|
||||
|
||||
/// Attempt to seal the block internally.
|
||||
fn generate_seal(&self, block: &ExecutedBlock, _parent: &Header) -> Seal {
|
||||
let header = &block.header;
|
||||
let header = block.header();
|
||||
let author = header.author();
|
||||
if self.validators.contains(header.parent_hash(), author) {
|
||||
// account should be pernamently unlocked, otherwise sealing will fail
|
||||
@@ -264,9 +264,9 @@ mod tests {
|
||||
let genesis_header = spec.genesis_header();
|
||||
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, addr, (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, addr, (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b = b.close_and_lock().unwrap();
|
||||
if let Seal::Regular(seal) = engine.generate_seal(&b, &genesis_header) {
|
||||
if let Seal::Regular(seal) = engine.generate_seal(b.block(), &genesis_header) {
|
||||
assert!(b.try_seal(engine, seal).is_ok());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,11 @@ use ethereum_types::{H160, Address, U256};
|
||||
use std::sync::Arc;
|
||||
use hash::keccak;
|
||||
use error::Error;
|
||||
use machine::Machine;
|
||||
use machine::WithRewards;
|
||||
use parity_machine::Machine;
|
||||
use trace;
|
||||
use types::BlockNumber;
|
||||
use super::{SystemOrCodeCall, SystemOrCodeCallKind};
|
||||
use trace::{Tracer, ExecutiveTracer, Tracing};
|
||||
use block::ExecutedBlock;
|
||||
|
||||
use_contract!(block_reward_contract, "res/contracts/block_reward.json");
|
||||
|
||||
@@ -153,26 +152,17 @@ impl BlockRewardContract {
|
||||
|
||||
/// Applies the given block rewards, i.e. adds the given balance to each beneficiary' address.
|
||||
/// If tracing is enabled the operations are recorded.
|
||||
pub fn apply_block_rewards<M: Machine>(
|
||||
pub fn apply_block_rewards<M: Machine + WithRewards>(
|
||||
rewards: &[(Address, RewardKind, U256)],
|
||||
block: &mut ExecutedBlock,
|
||||
block: &mut M::LiveBlock,
|
||||
machine: &M,
|
||||
) -> Result<(), M::Error> {
|
||||
for &(ref author, _, ref block_reward) in rewards {
|
||||
machine.add_balance(block, author, block_reward)?;
|
||||
}
|
||||
|
||||
if let Tracing::Enabled(ref mut traces) = *block.traces_mut() {
|
||||
let mut tracer = ExecutiveTracer::default();
|
||||
|
||||
for &(address, reward_kind, amount) in rewards {
|
||||
tracer.trace_reward(address, amount, reward_kind.into());
|
||||
}
|
||||
|
||||
traces.push(tracer.drain().into());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
let rewards: Vec<_> = rewards.into_iter().map(|&(a, k, r)| (a, k.into(), r)).collect();
|
||||
machine.note_rewards(block, &rewards)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -1,367 +0,0 @@
|
||||
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Ethereum.
|
||||
|
||||
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::collections::{HashMap, BTreeSet, VecDeque};
|
||||
use std::fmt;
|
||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||
|
||||
use engines::EngineError;
|
||||
use engines::clique::util::{extract_signers, recover_creator};
|
||||
use engines::clique::{VoteType, DIFF_INTURN, DIFF_NOTURN, NULL_AUTHOR, SIGNING_DELAY_NOTURN_MS};
|
||||
use error::{Error, BlockError};
|
||||
use ethereum_types::{Address, H64};
|
||||
use rand::Rng;
|
||||
use time_utils::CheckedSystemTime;
|
||||
use types::BlockNumber;
|
||||
use types::header::Header;
|
||||
use unexpected::Mismatch;
|
||||
|
||||
/// Type that keeps track of the state for a given vote
|
||||
// Votes that go against the proposal aren't counted since it's equivalent to not voting
|
||||
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
|
||||
pub struct VoteState {
|
||||
kind: VoteType,
|
||||
votes: u64,
|
||||
}
|
||||
|
||||
/// Type that represent a vote
|
||||
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
|
||||
pub struct Vote {
|
||||
block_number: BlockNumber,
|
||||
beneficiary: Address,
|
||||
kind: VoteType,
|
||||
signer: Address,
|
||||
reverted: bool,
|
||||
}
|
||||
|
||||
/// Type that represent a pending vote
|
||||
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd)]
|
||||
pub struct PendingVote {
|
||||
signer: Address,
|
||||
beneficiary: Address,
|
||||
}
|
||||
|
||||
/// Clique state for each block.
|
||||
#[cfg(not(test))]
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct CliqueBlockState {
|
||||
/// Current votes for a beneficiary
|
||||
votes: HashMap<PendingVote, VoteState>,
|
||||
/// A list of all votes for the given epoch
|
||||
votes_history: Vec<Vote>,
|
||||
/// a list of all valid signer, sorted by ascending order.
|
||||
signers: BTreeSet<Address>,
|
||||
/// a deque of recent signer, new entry should be pushed front, apply() modifies this.
|
||||
recent_signers: VecDeque<Address>,
|
||||
/// inturn signing should wait until this time
|
||||
pub next_timestamp_inturn: Option<SystemTime>,
|
||||
/// noturn signing should wait until this time
|
||||
pub next_timestamp_noturn: Option<SystemTime>,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct CliqueBlockState {
|
||||
/// All recorded votes for a given signer, `Vec<PendingVote>` is a stack of votes
|
||||
pub votes: HashMap<PendingVote, VoteState>,
|
||||
/// A list of all votes for the given epoch
|
||||
pub votes_history: Vec<Vote>,
|
||||
/// a list of all valid signer, sorted by ascending order.
|
||||
pub signers: BTreeSet<Address>,
|
||||
/// a deque of recent signer, new entry should be pushed front, apply() modifies this.
|
||||
pub recent_signers: VecDeque<Address>,
|
||||
/// inturn signing should wait until this time
|
||||
pub next_timestamp_inturn: Option<SystemTime>,
|
||||
/// noturn signing should wait until this time
|
||||
pub next_timestamp_noturn: Option<SystemTime>,
|
||||
}
|
||||
|
||||
impl fmt::Display for CliqueBlockState {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let signers: Vec<String> = self.signers.iter()
|
||||
.map(|s|
|
||||
format!("{} {:?}",
|
||||
s,
|
||||
self.votes.iter().map(|(v, s)| format!("[beneficiary {}, votes: {}]", v.beneficiary, s.votes))
|
||||
.collect::<Vec<_>>()
|
||||
)
|
||||
)
|
||||
.collect();
|
||||
|
||||
let recent_signers: Vec<String> = self.recent_signers.iter().map(|s| format!("{}", s)).collect();
|
||||
let num_votes = self.votes_history.len();
|
||||
let add_votes = self.votes_history.iter().filter(|v| v.kind == VoteType::Add).count();
|
||||
let rm_votes = self.votes_history.iter().filter(|v| v.kind == VoteType::Remove).count();
|
||||
let reverted_votes = self.votes_history.iter().filter(|v| v.reverted).count();
|
||||
|
||||
write!(f,
|
||||
"Votes {{ \n signers: {:?} \n recent_signers: {:?} \n number of votes: {} \n number of add votes {}
|
||||
\r number of remove votes {} \n number of reverted votes: {}}}",
|
||||
signers, recent_signers, num_votes, add_votes, rm_votes, reverted_votes)
|
||||
}
|
||||
}
|
||||
|
||||
impl CliqueBlockState {
|
||||
/// Create new state with given information, this is used creating new state from Checkpoint block.
|
||||
pub fn new(signers: BTreeSet<Address>) -> Self {
|
||||
CliqueBlockState {
|
||||
signers,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
// see https://github.com/ethereum/go-ethereum/blob/master/consensus/clique/clique.go#L474
|
||||
fn verify(&self, header: &Header) -> Result<Address, Error> {
|
||||
let creator = recover_creator(header)?.clone();
|
||||
|
||||
// The signer is not authorized
|
||||
if !self.signers.contains(&creator) {
|
||||
trace!(target: "engine", "current state: {}", self);
|
||||
Err(EngineError::NotAuthorized(creator))?
|
||||
}
|
||||
|
||||
// The signer has signed a block too recently
|
||||
if self.recent_signers.contains(&creator) {
|
||||
trace!(target: "engine", "current state: {}", self);
|
||||
Err(EngineError::CliqueTooRecentlySigned(creator))?
|
||||
}
|
||||
|
||||
// Wrong difficulty
|
||||
let inturn = self.is_inturn(header.number(), &creator);
|
||||
|
||||
if inturn && *header.difficulty() != DIFF_INTURN {
|
||||
Err(BlockError::InvalidDifficulty(Mismatch {
|
||||
expected: DIFF_INTURN,
|
||||
found: *header.difficulty(),
|
||||
}))?
|
||||
}
|
||||
|
||||
if !inturn && *header.difficulty() != DIFF_NOTURN {
|
||||
Err(BlockError::InvalidDifficulty(Mismatch {
|
||||
expected: DIFF_NOTURN,
|
||||
found: *header.difficulty(),
|
||||
}))?
|
||||
}
|
||||
|
||||
Ok(creator)
|
||||
}
|
||||
|
||||
/// Verify and apply a new header to current state
|
||||
pub fn apply(&mut self, header: &Header, is_checkpoint: bool) -> Result<Address, Error> {
|
||||
let creator = self.verify(header)?;
|
||||
self.recent_signers.push_front(creator);
|
||||
self.rotate_recent_signers();
|
||||
|
||||
if is_checkpoint {
|
||||
// checkpoint block should not affect previous tallying, so we check that.
|
||||
let signers = extract_signers(header)?;
|
||||
if self.signers != signers {
|
||||
let invalid_signers: Vec<String> = signers.into_iter()
|
||||
.filter(|s| !self.signers.contains(s))
|
||||
.map(|s| format!("{}", s))
|
||||
.collect();
|
||||
Err(EngineError::CliqueFaultyRecoveredSigners(invalid_signers))?
|
||||
};
|
||||
|
||||
// TODO(niklasad1): I'm not sure if we should shrink here because it is likely that next epoch
|
||||
// will need some memory and might be better for allocation algorithm to decide whether to shrink or not
|
||||
// (typically doubles or halves the allocted memory when necessary)
|
||||
self.votes.clear();
|
||||
self.votes_history.clear();
|
||||
self.votes.shrink_to_fit();
|
||||
self.votes_history.shrink_to_fit();
|
||||
}
|
||||
|
||||
// Contains vote
|
||||
if *header.author() != NULL_AUTHOR {
|
||||
let decoded_seal = header.decode_seal::<Vec<_>>()?;
|
||||
if decoded_seal.len() != 2 {
|
||||
Err(BlockError::InvalidSealArity(Mismatch { expected: 2, found: decoded_seal.len() }))?
|
||||
}
|
||||
|
||||
let nonce: H64 = decoded_seal[1].into();
|
||||
self.update_signers_on_vote(VoteType::from_nonce(nonce)?, creator, *header.author(), header.number())?;
|
||||
}
|
||||
|
||||
Ok(creator)
|
||||
}
|
||||
|
||||
fn update_signers_on_vote(
|
||||
&mut self,
|
||||
kind: VoteType,
|
||||
signer: Address,
|
||||
beneficiary: Address,
|
||||
block_number: u64
|
||||
) -> Result<(), Error> {
|
||||
|
||||
trace!(target: "engine", "Attempt vote {:?} {:?}", kind, beneficiary);
|
||||
|
||||
let pending_vote = PendingVote { signer, beneficiary };
|
||||
|
||||
let reverted = if self.is_valid_vote(&beneficiary, kind) {
|
||||
self.add_vote(pending_vote, kind)
|
||||
} else {
|
||||
// This case only happens if a `signer` wants to revert their previous vote
|
||||
// (does nothing if no previous vote was found)
|
||||
self.revert_vote(pending_vote)
|
||||
};
|
||||
|
||||
// Add all votes to the history
|
||||
self.votes_history.push(
|
||||
Vote {
|
||||
block_number,
|
||||
beneficiary,
|
||||
kind,
|
||||
signer,
|
||||
reverted,
|
||||
});
|
||||
|
||||
// If no vote was found for the beneficiary return `early` but don't propogate an error
|
||||
let (votes, vote_kind) = match self.get_current_votes_and_kind(beneficiary) {
|
||||
Some((v, k)) => (v, k),
|
||||
None => return Ok(()),
|
||||
};
|
||||
let threshold = self.signers.len() / 2;
|
||||
|
||||
debug!(target: "engine", "{}/{} votes to have consensus", votes, threshold + 1);
|
||||
trace!(target: "engine", "votes: {:?}", votes);
|
||||
|
||||
if votes > threshold {
|
||||
match vote_kind {
|
||||
VoteType::Add => {
|
||||
if self.signers.insert(beneficiary) {
|
||||
debug!(target: "engine", "added new signer: {}", beneficiary);
|
||||
}
|
||||
}
|
||||
VoteType::Remove => {
|
||||
if self.signers.remove(&beneficiary) {
|
||||
debug!(target: "engine", "removed signer: {}", beneficiary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.rotate_recent_signers();
|
||||
self.remove_all_votes_from(beneficiary);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Calculate the next timestamp for `inturn` and `noturn` fails if any of them can't be represented as
|
||||
/// `SystemTime`
|
||||
// TODO(niklasad1): refactor this method to be in constructor of `CliqueBlockState` instead.
|
||||
// This is a quite bad API because we must mutate both variables even when already `inturn` fails
|
||||
// That's why we can't return early and must have the `if-else` in the end
|
||||
pub fn calc_next_timestamp(&mut self, timestamp: u64, period: u64) -> Result<(), Error> {
|
||||
let inturn = CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(timestamp.saturating_add(period)));
|
||||
|
||||
self.next_timestamp_inturn = inturn;
|
||||
|
||||
let delay = Duration::from_millis(
|
||||
rand::thread_rng().gen_range(0u64, (self.signers.len() as u64 / 2 + 1) * SIGNING_DELAY_NOTURN_MS));
|
||||
self.next_timestamp_noturn = inturn.map(|inturn| {
|
||||
inturn + delay
|
||||
});
|
||||
|
||||
if self.next_timestamp_inturn.is_some() && self.next_timestamp_noturn.is_some() {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(BlockError::TimestampOverflow)?
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if the block difficulty should be `inturn`
|
||||
pub fn is_inturn(&self, current_block_number: u64, author: &Address) -> bool {
|
||||
if let Some(pos) = self.signers.iter().position(|x| *author == *x) {
|
||||
return current_block_number % self.signers.len() as u64 == pos as u64;
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
/// Returns whether the signer is authorized to sign a block
|
||||
pub fn is_authorized(&self, author: &Address) -> bool {
|
||||
self.signers.contains(author) && !self.recent_signers.contains(author)
|
||||
}
|
||||
|
||||
/// Returns whether it makes sense to cast the specified vote in the
|
||||
/// current state (e.g. don't try to add an already authorized signer).
|
||||
pub fn is_valid_vote(&self, address: &Address, vote_type: VoteType) -> bool {
|
||||
let in_signer = self.signers.contains(address);
|
||||
match vote_type {
|
||||
VoteType::Add => !in_signer,
|
||||
VoteType::Remove => in_signer,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the list of current signers
|
||||
pub fn signers(&self) -> &BTreeSet<Address> {
|
||||
&self.signers
|
||||
}
|
||||
|
||||
// Note this method will always return `true` but it is intended for a uniform `API`
|
||||
fn add_vote(&mut self, pending_vote: PendingVote, kind: VoteType) -> bool {
|
||||
|
||||
self.votes.entry(pending_vote)
|
||||
.and_modify(|state| {
|
||||
state.votes = state.votes.saturating_add(1);
|
||||
})
|
||||
.or_insert_with(|| VoteState { kind, votes: 1 });
|
||||
true
|
||||
}
|
||||
|
||||
fn revert_vote(&mut self, pending_vote: PendingVote) -> bool {
|
||||
let mut revert = false;
|
||||
let mut remove = false;
|
||||
|
||||
self.votes.entry(pending_vote).and_modify(|state| {
|
||||
if state.votes.saturating_sub(1) == 0 {
|
||||
remove = true;
|
||||
}
|
||||
revert = true;
|
||||
});
|
||||
|
||||
if remove {
|
||||
self.votes.remove(&pending_vote);
|
||||
}
|
||||
|
||||
revert
|
||||
}
|
||||
|
||||
fn get_current_votes_and_kind(&self, beneficiary: Address) -> Option<(usize, VoteType)> {
|
||||
let kind = self.votes.iter()
|
||||
.find(|(v, _t)| v.beneficiary == beneficiary)
|
||||
.map(|(_v, t)| t.kind)?;
|
||||
|
||||
let votes = self.votes.keys()
|
||||
.filter(|vote| vote.beneficiary == beneficiary)
|
||||
.count();
|
||||
|
||||
Some((votes, kind))
|
||||
}
|
||||
|
||||
fn rotate_recent_signers(&mut self) {
|
||||
if self.recent_signers.len() >= ( self.signers.len() / 2 ) + 1 {
|
||||
self.recent_signers.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_all_votes_from(&mut self, beneficiary: Address) {
|
||||
self.votes = std::mem::replace(&mut self.votes, HashMap::new())
|
||||
.into_iter()
|
||||
.filter(|(v, _t)| v.signer != beneficiary && v.beneficiary != beneficiary)
|
||||
.collect();
|
||||
}
|
||||
}
|
||||
@@ -1,774 +0,0 @@
|
||||
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Ethereum.
|
||||
|
||||
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Implementation of the Clique PoA Engine.
|
||||
//!
|
||||
//! File structure:
|
||||
//! - mod.rs -> Provides the engine API implementation, with additional block state tracking
|
||||
//! - block_state.rs -> Records the Clique state for given block.
|
||||
//! - params.rs -> Contains the parameters for the Clique engine.
|
||||
//! - step_service.rs -> An event loop to trigger sealing.
|
||||
//! - util.rs -> Various standalone utility functions.
|
||||
//! - tests.rs -> Consensus tests as defined in EIP-225.
|
||||
|
||||
/// How syncing works:
|
||||
///
|
||||
/// 1. Client will call:
|
||||
/// - `Clique::verify_block_basic()`
|
||||
/// - `Clique::verify_block_unordered()`
|
||||
/// - `Clique::verify_block_family()`
|
||||
/// 2. Using `Clique::state()` we try and retrieve the parent state. If this isn't found
|
||||
/// we need to back-fill it from the last known checkpoint.
|
||||
/// 3. Once we have a good state, we can record it using `CliqueBlockState::apply()`.
|
||||
|
||||
/// How sealing works:
|
||||
///
|
||||
/// 1. Set a signer using `Engine::set_signer()`. If a miner account was set up through
|
||||
/// a config file or CLI flag `MinerService::set_author()` will eventually set the signer
|
||||
/// 2. We check that the engine seals internally through `Clique::seals_internally()`
|
||||
/// Note: This is always true for Clique
|
||||
/// 3. Calling `Clique::new()` will spawn a `StepService` thread. This thread will call `Engine::step()`
|
||||
/// periodically. Internally, the Clique `step()` function calls `Client::update_sealing()`, which is
|
||||
/// what makes and seals a block.
|
||||
/// 4. `Clique::generate_seal()` will then be called by `miner`. This will return a `Seal` which
|
||||
/// is either a `Seal::None` or `Seal:Regular`. The following shows how a `Seal` variant is chosen:
|
||||
/// a. We return `Seal::None` if no signer is available or the signer is not authorized.
|
||||
/// b. If period == 0 and block has transactions, we return `Seal::Regular`, otherwise return `Seal::None`.
|
||||
/// c. If we're `INTURN`, wait for at least `period` since last block before trying to seal.
|
||||
/// d. If we're not `INTURN`, we wait for a random amount of time using the algorithm specified
|
||||
/// in EIP-225 before trying to seal again.
|
||||
/// 5. Miner will create new block, in process it will call several engine methods to do following:
|
||||
/// a. `Clique::open_block_header_timestamp()` must set timestamp correctly.
|
||||
/// b. `Clique::populate_from_parent()` must set difficulty to correct value.
|
||||
/// Note: `Clique::populate_from_parent()` is used in both the syncing and sealing code paths.
|
||||
/// 6. We call `Clique::on_seal_block()` which will allow us to modify the block header during seal generation.
|
||||
/// 7. Finally, `Clique::verify_local_seal()` is called. After this, the syncing code path will be followed
|
||||
/// in order to import the new block.
|
||||
|
||||
use std::cmp;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::VecDeque;
|
||||
use std::sync::{Arc, Weak};
|
||||
use std::thread;
|
||||
use std::time;
|
||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||
|
||||
use block::ExecutedBlock;
|
||||
use bytes::Bytes;
|
||||
use client::{BlockId, EngineClient};
|
||||
use engines::clique::util::{extract_signers, recover_creator};
|
||||
use engines::{Engine, EngineError, Seal};
|
||||
use error::{BlockError, Error};
|
||||
use ethereum_types::{Address, H64, H160, H256, U256};
|
||||
use ethkey::Signature;
|
||||
use hash::KECCAK_EMPTY_LIST_RLP;
|
||||
use itertools::Itertools;
|
||||
use lru_cache::LruCache;
|
||||
use machine::{Call, EthereumMachine};
|
||||
use parking_lot::RwLock;
|
||||
use rand::Rng;
|
||||
use super::signer::EngineSigner;
|
||||
use unexpected::{Mismatch, OutOfBounds};
|
||||
use time_utils::CheckedSystemTime;
|
||||
use types::BlockNumber;
|
||||
use types::header::{ExtendedHeader, Header};
|
||||
|
||||
use self::block_state::CliqueBlockState;
|
||||
use self::params::CliqueParams;
|
||||
use self::step_service::StepService;
|
||||
|
||||
mod params;
|
||||
mod block_state;
|
||||
mod step_service;
|
||||
mod util;
|
||||
|
||||
// TODO(niklasad1): extract tester types into a separate mod to be shared in the code base
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
// Protocol constants
|
||||
/// Fixed number of extra-data prefix bytes reserved for signer vanity
|
||||
pub const VANITY_LENGTH: usize = 32;
|
||||
/// Fixed number of extra-data suffix bytes reserved for signer signature
|
||||
pub const SIGNATURE_LENGTH: usize = 65;
|
||||
/// Address length of signer
|
||||
pub const ADDRESS_LENGTH: usize = 20;
|
||||
/// Nonce value for DROP vote
|
||||
pub const NONCE_DROP_VOTE: H64 = H64([0; 8]);
|
||||
/// Nonce value for AUTH vote
|
||||
pub const NONCE_AUTH_VOTE: H64 = H64([0xff; 8]);
|
||||
/// Difficulty for INTURN block
|
||||
pub const DIFF_INTURN: U256 = U256([2, 0, 0, 0]);
|
||||
/// Difficulty for NOTURN block
|
||||
pub const DIFF_NOTURN: U256 = U256([1, 0, 0, 0]);
|
||||
/// Default empty author field value
|
||||
pub const NULL_AUTHOR: Address = H160([0x00; 20]);
|
||||
/// Default empty nonce value
|
||||
pub const NULL_NONCE: H64 = NONCE_DROP_VOTE;
|
||||
/// Default value for mixhash
|
||||
pub const NULL_MIXHASH: H256 = H256([0; 32]);
|
||||
/// Default value for uncles hash
|
||||
pub const NULL_UNCLES_HASH: H256 = KECCAK_EMPTY_LIST_RLP;
|
||||
/// Default noturn block wiggle factor defined in spec.
|
||||
pub const SIGNING_DELAY_NOTURN_MS: u64 = 500;
|
||||
|
||||
/// How many CliqueBlockState to cache in the memory.
|
||||
pub const STATE_CACHE_NUM: usize = 128;
|
||||
|
||||
/// Vote to add or remove the beneficiary
|
||||
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd)]
|
||||
pub enum VoteType {
|
||||
Add,
|
||||
Remove,
|
||||
}
|
||||
|
||||
impl VoteType {
|
||||
/// Try to construct a `Vote` from a nonce
|
||||
pub fn from_nonce(nonce: H64) -> Result<Self, Error> {
|
||||
if nonce == NONCE_AUTH_VOTE {
|
||||
Ok(VoteType::Add)
|
||||
} else if nonce == NONCE_DROP_VOTE {
|
||||
Ok(VoteType::Remove)
|
||||
} else {
|
||||
Err(EngineError::CliqueInvalidNonce(nonce))?
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the rlp encoding of the vote
|
||||
pub fn as_rlp(&self) -> Vec<Vec<u8>> {
|
||||
match self {
|
||||
VoteType::Add => vec![rlp::encode(&NULL_MIXHASH), rlp::encode(&NONCE_AUTH_VOTE)],
|
||||
VoteType::Remove => vec![rlp::encode(&NULL_MIXHASH), rlp::encode(&NONCE_DROP_VOTE)],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Clique Engine implementation
|
||||
// block_state_by_hash -> block state indexed by header hash.
|
||||
#[cfg(not(test))]
|
||||
pub struct Clique {
|
||||
epoch_length: u64,
|
||||
period: u64,
|
||||
machine: EthereumMachine,
|
||||
client: RwLock<Option<Weak<EngineClient>>>,
|
||||
block_state_by_hash: RwLock<LruCache<H256, CliqueBlockState>>,
|
||||
proposals: RwLock<HashMap<Address, VoteType>>,
|
||||
signer: RwLock<Option<Box<EngineSigner>>>,
|
||||
step_service: Option<Arc<StepService>>,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
/// Test version of `CliqueEngine` to make all fields public
|
||||
pub struct Clique {
|
||||
pub epoch_length: u64,
|
||||
pub period: u64,
|
||||
pub machine: EthereumMachine,
|
||||
pub client: RwLock<Option<Weak<EngineClient>>>,
|
||||
pub block_state_by_hash: RwLock<LruCache<H256, CliqueBlockState>>,
|
||||
pub proposals: RwLock<HashMap<Address, VoteType>>,
|
||||
pub signer: RwLock<Option<Box<EngineSigner>>>,
|
||||
pub step_service: Option<Arc<StepService>>,
|
||||
}
|
||||
|
||||
impl Clique {
|
||||
/// Initialize Clique engine from empty state.
|
||||
pub fn new(our_params: CliqueParams, machine: EthereumMachine) -> Result<Arc<Self>, Error> {
|
||||
let mut engine = Clique {
|
||||
epoch_length: our_params.epoch,
|
||||
period: our_params.period,
|
||||
client: Default::default(),
|
||||
block_state_by_hash: RwLock::new(LruCache::new(STATE_CACHE_NUM)),
|
||||
proposals: Default::default(),
|
||||
signer: Default::default(),
|
||||
machine,
|
||||
step_service: None,
|
||||
};
|
||||
|
||||
let res = Arc::new(engine);
|
||||
|
||||
if our_params.period > 0 {
|
||||
engine.step_service = Some(StepService::start(Arc::downgrade(&res) as Weak<Engine<_>>));
|
||||
}
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
/// Initialize test variant of `CliqueEngine`,
|
||||
/// Note we need to `mock` the miner and it is introduced to test block verification to trigger new blocks
|
||||
/// to mainly test consensus edge cases
|
||||
pub fn with_test(epoch_length: u64, period: u64) -> Self {
|
||||
use spec::Spec;
|
||||
|
||||
Self {
|
||||
epoch_length,
|
||||
period,
|
||||
client: Default::default(),
|
||||
block_state_by_hash: RwLock::new(LruCache::new(STATE_CACHE_NUM)),
|
||||
proposals: Default::default(),
|
||||
signer: Default::default(),
|
||||
machine: Spec::new_test_machine(),
|
||||
step_service: None,
|
||||
}
|
||||
}
|
||||
|
||||
fn sign_header(&self, header: &Header) -> Result<(Signature, H256), Error> {
|
||||
|
||||
match self.signer.read().as_ref() {
|
||||
None => {
|
||||
Err(EngineError::RequiresSigner)?
|
||||
}
|
||||
Some(signer) => {
|
||||
let digest = header.hash();
|
||||
match signer.sign(digest) {
|
||||
Ok(sig) => Ok((sig, digest)),
|
||||
Err(e) => Err(EngineError::Custom(e.into()))?,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Construct an new state from given checkpoint header.
|
||||
fn new_checkpoint_state(&self, header: &Header) -> Result<CliqueBlockState, Error> {
|
||||
debug_assert_eq!(header.number() % self.epoch_length, 0);
|
||||
|
||||
let mut state = CliqueBlockState::new(
|
||||
extract_signers(header)?);
|
||||
|
||||
// TODO(niklasad1): refactor to perform this check in the `CliqueBlockState` constructor instead
|
||||
state.calc_next_timestamp(header.timestamp(), self.period)?;
|
||||
|
||||
Ok(state)
|
||||
}
|
||||
|
||||
fn state_no_backfill(&self, hash: &H256) -> Option<CliqueBlockState> {
|
||||
self.block_state_by_hash.write().get_mut(hash).cloned()
|
||||
}
|
||||
|
||||
/// Get `CliqueBlockState` for given header, backfill from last checkpoint if needed.
|
||||
fn state(&self, header: &Header) -> Result<CliqueBlockState, Error> {
|
||||
let mut block_state_by_hash = self.block_state_by_hash.write();
|
||||
if let Some(state) = block_state_by_hash.get_mut(&header.hash()) {
|
||||
return Ok(state.clone());
|
||||
}
|
||||
// If we are looking for an checkpoint block state, we can directly reconstruct it.
|
||||
if header.number() % self.epoch_length == 0 {
|
||||
let state = self.new_checkpoint_state(header)?;
|
||||
block_state_by_hash.insert(header.hash(), state.clone());
|
||||
return Ok(state);
|
||||
}
|
||||
// BlockState is not found in memory, which means we need to reconstruct state from last checkpoint.
|
||||
match self.client.read().as_ref().and_then(|w| w.upgrade()) {
|
||||
None => {
|
||||
return Err(EngineError::RequiresClient)?;
|
||||
}
|
||||
Some(c) => {
|
||||
let last_checkpoint_number = header.number() - header.number() % self.epoch_length as u64;
|
||||
debug_assert_ne!(last_checkpoint_number, header.number());
|
||||
|
||||
// Catching up state, note that we don't really store block state for intermediary blocks,
|
||||
// for speed.
|
||||
let backfill_start = time::Instant::now();
|
||||
trace!(target: "engine",
|
||||
"Back-filling block state. last_checkpoint_number: {}, target: {}({}).",
|
||||
last_checkpoint_number, header.number(), header.hash());
|
||||
|
||||
let mut chain: &mut VecDeque<Header> = &mut VecDeque::with_capacity(
|
||||
(header.number() - last_checkpoint_number + 1) as usize);
|
||||
|
||||
// Put ourselves in.
|
||||
chain.push_front(header.clone());
|
||||
|
||||
// populate chain to last checkpoint
|
||||
loop {
|
||||
let (last_parent_hash, last_num) = {
|
||||
let l = chain.front().expect("chain has at least one element; qed");
|
||||
(*l.parent_hash(), l.number())
|
||||
};
|
||||
|
||||
if last_num == last_checkpoint_number + 1 {
|
||||
break;
|
||||
}
|
||||
match c.block_header(BlockId::Hash(last_parent_hash)) {
|
||||
None => {
|
||||
return Err(BlockError::UnknownParent(last_parent_hash))?;
|
||||
}
|
||||
Some(next) => {
|
||||
chain.push_front(next.decode()?);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get the state for last checkpoint.
|
||||
let last_checkpoint_hash = *chain.front()
|
||||
.expect("chain has at least one element; qed")
|
||||
.parent_hash();
|
||||
|
||||
let last_checkpoint_header = match c.block_header(BlockId::Hash(last_checkpoint_hash)) {
|
||||
None => return Err(EngineError::CliqueMissingCheckpoint(last_checkpoint_hash))?,
|
||||
Some(header) => header.decode()?,
|
||||
};
|
||||
|
||||
let last_checkpoint_state = match block_state_by_hash.get_mut(&last_checkpoint_hash) {
|
||||
Some(state) => state.clone(),
|
||||
None => self.new_checkpoint_state(&last_checkpoint_header)?,
|
||||
};
|
||||
|
||||
block_state_by_hash.insert(last_checkpoint_header.hash(), last_checkpoint_state.clone());
|
||||
|
||||
// Backfill!
|
||||
let mut new_state = last_checkpoint_state.clone();
|
||||
for item in chain {
|
||||
new_state.apply(item, false)?;
|
||||
}
|
||||
new_state.calc_next_timestamp(header.timestamp(), self.period)?;
|
||||
block_state_by_hash.insert(header.hash(), new_state.clone());
|
||||
|
||||
let elapsed = backfill_start.elapsed();
|
||||
trace!(target: "engine", "Back-filling succeed, took {} ms.", elapsed.as_millis());
|
||||
Ok(new_state)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Engine<EthereumMachine> for Clique {
|
||||
fn name(&self) -> &str { "Clique" }
|
||||
|
||||
fn machine(&self) -> &EthereumMachine { &self.machine }
|
||||
|
||||
// Clique use same fields, nonce + mixHash
|
||||
fn seal_fields(&self, _header: &Header) -> usize { 2 }
|
||||
|
||||
fn maximum_uncle_count(&self, _block: BlockNumber) -> usize { 0 }
|
||||
|
||||
fn on_new_block(
|
||||
&self,
|
||||
_block: &mut ExecutedBlock,
|
||||
_epoch_begin: bool,
|
||||
_ancestry: &mut Iterator<Item=ExtendedHeader>,
|
||||
) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Clique has no block reward.
|
||||
fn on_close_block(&self, _block: &mut ExecutedBlock) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn on_seal_block(&self, block: &mut ExecutedBlock) -> Result<(), Error> {
|
||||
trace!(target: "engine", "on_seal_block");
|
||||
|
||||
let header = &mut block.header;
|
||||
|
||||
let state = self.state_no_backfill(header.parent_hash())
|
||||
.ok_or_else(|| BlockError::UnknownParent(*header.parent_hash()))?;
|
||||
|
||||
let is_checkpoint = header.number() % self.epoch_length == 0;
|
||||
|
||||
header.set_author(NULL_AUTHOR);
|
||||
|
||||
// Cast a random Vote if not checkpoint
|
||||
if !is_checkpoint {
|
||||
// TODO(niklasad1): this will always be false because `proposals` is never written to
|
||||
let votes = self.proposals.read().iter()
|
||||
.filter(|(address, vote_type)| state.is_valid_vote(*address, **vote_type))
|
||||
.map(|(address, vote_type)| (*address, *vote_type))
|
||||
.collect_vec();
|
||||
|
||||
if !votes.is_empty() {
|
||||
// Pick a random vote.
|
||||
let random_vote = rand::thread_rng().gen_range(0 as usize, votes.len());
|
||||
let (beneficiary, vote_type) = votes[random_vote];
|
||||
|
||||
trace!(target: "engine", "Casting vote: beneficiary {}, type {:?} ", beneficiary, vote_type);
|
||||
|
||||
header.set_author(beneficiary);
|
||||
header.set_seal(vote_type.as_rlp());
|
||||
}
|
||||
}
|
||||
|
||||
// Work on clique seal.
|
||||
|
||||
let mut seal: Vec<u8> = Vec::with_capacity(VANITY_LENGTH + SIGNATURE_LENGTH);
|
||||
|
||||
// At this point, extra_data should only contain miner vanity.
|
||||
if header.extra_data().len() != VANITY_LENGTH {
|
||||
Err(BlockError::ExtraDataOutOfBounds(OutOfBounds {
|
||||
min: Some(VANITY_LENGTH),
|
||||
max: Some(VANITY_LENGTH),
|
||||
found: header.extra_data().len()
|
||||
}))?;
|
||||
}
|
||||
// vanity
|
||||
{
|
||||
seal.extend_from_slice(&header.extra_data()[0..VANITY_LENGTH]);
|
||||
}
|
||||
|
||||
// If we are building an checkpoint block, add all signers now.
|
||||
if is_checkpoint {
|
||||
seal.reserve(state.signers().len() * 20);
|
||||
state.signers().iter().foreach(|addr| {
|
||||
seal.extend_from_slice(&addr[..]);
|
||||
});
|
||||
}
|
||||
|
||||
header.set_extra_data(seal.clone());
|
||||
|
||||
// append signature onto extra_data
|
||||
let (sig, _msg) = self.sign_header(&header)?;
|
||||
seal.extend_from_slice(&sig[..]);
|
||||
header.set_extra_data(seal.clone());
|
||||
|
||||
header.compute_hash();
|
||||
|
||||
// locally sealed block don't go through valid_block_family(), so we have to record state here.
|
||||
let mut new_state = state.clone();
|
||||
new_state.apply(&header, is_checkpoint)?;
|
||||
new_state.calc_next_timestamp(header.timestamp(), self.period)?;
|
||||
self.block_state_by_hash.write().insert(header.hash(), new_state);
|
||||
|
||||
trace!(target: "engine", "on_seal_block: finished, final header: {:?}", header);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Clique doesn't require external work to seal, so we always return true here.
|
||||
fn seals_internally(&self) -> Option<bool> {
|
||||
Some(true)
|
||||
}
|
||||
|
||||
/// Returns if we are ready to seal, the real sealing (signing extra_data) is actually done in `on_seal_block()`.
|
||||
fn generate_seal(&self, block: &ExecutedBlock, parent: &Header) -> Seal {
|
||||
trace!(target: "engine", "tried to generate_seal");
|
||||
let null_seal = util::null_seal();
|
||||
|
||||
if block.header.number() == 0 {
|
||||
trace!(target: "engine", "attempted to seal genesis block");
|
||||
return Seal::None;
|
||||
}
|
||||
|
||||
// if sealing period is 0, and not an checkpoint block, refuse to seal
|
||||
if self.period == 0 {
|
||||
if block.transactions.is_empty() && block.header.number() % self.epoch_length != 0 {
|
||||
return Seal::None;
|
||||
}
|
||||
return Seal::Regular(null_seal);
|
||||
}
|
||||
|
||||
// Check we actually have authority to seal.
|
||||
if let Some(author) = self.signer.read().as_ref().map(|x| x.address()) {
|
||||
|
||||
// ensure the voting state exists
|
||||
match self.state(&parent) {
|
||||
Err(e) => {
|
||||
warn!(target: "engine", "generate_seal: can't get parent state(number: {}, hash: {}): {} ",
|
||||
parent.number(), parent.hash(), e);
|
||||
return Seal::None;
|
||||
}
|
||||
Ok(state) => {
|
||||
// Are we authorized to seal?
|
||||
if !state.is_authorized(&author) {
|
||||
trace!(target: "engine", "generate_seal: Not authorized to sign right now.");
|
||||
// wait for one third of period to try again.
|
||||
thread::sleep(Duration::from_secs(self.period / 3 + 1));
|
||||
return Seal::None;
|
||||
}
|
||||
|
||||
let inturn = state.is_inturn(block.header.number(), &author);
|
||||
|
||||
let now = SystemTime::now();
|
||||
|
||||
let limit = match inturn {
|
||||
true => state.next_timestamp_inturn.unwrap_or(now),
|
||||
false => state.next_timestamp_noturn.unwrap_or(now),
|
||||
};
|
||||
|
||||
// Wait for the right moment.
|
||||
if now < limit {
|
||||
trace!(target: "engine",
|
||||
"generate_seal: sleeping to sign: inturn: {}, now: {:?}, to: {:?}.",
|
||||
inturn, now, limit);
|
||||
match limit.duration_since(SystemTime::now()) {
|
||||
Ok(duration) => {
|
||||
thread::sleep(duration);
|
||||
},
|
||||
Err(e) => {
|
||||
warn!(target:"engine", "generate_seal: unable to sleep, err: {}", e);
|
||||
return Seal::None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
trace!(target: "engine", "generate_seal: seal ready for block {}, txs: {}.",
|
||||
block.header.number(), block.transactions.len());
|
||||
return Seal::Regular(null_seal);
|
||||
}
|
||||
}
|
||||
}
|
||||
Seal::None
|
||||
}
|
||||
|
||||
fn verify_local_seal(&self, _header: &Header) -> Result<(), Error> { Ok(()) }
|
||||
|
||||
fn verify_block_basic(&self, header: &Header) -> Result<(), Error> {
|
||||
// Largely same as https://github.com/ethereum/go-ethereum/blob/master/consensus/clique/clique.go#L275
|
||||
|
||||
// Ignore genesis block.
|
||||
if header.number() == 0 {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// Don't waste time checking blocks from the future
|
||||
{
|
||||
let limit = CheckedSystemTime::checked_add(SystemTime::now(), Duration::from_secs(self.period))
|
||||
.ok_or(BlockError::TimestampOverflow)?;
|
||||
|
||||
// This should succeed under the contraints that the system clock works
|
||||
let limit_as_dur = limit.duration_since(UNIX_EPOCH).map_err(|e| {
|
||||
Box::new(format!("Converting SystemTime to Duration failed: {}", e))
|
||||
})?;
|
||||
|
||||
let hdr = Duration::from_secs(header.timestamp());
|
||||
if hdr > limit_as_dur {
|
||||
let found = CheckedSystemTime::checked_add(UNIX_EPOCH, hdr).ok_or(BlockError::TimestampOverflow)?;
|
||||
|
||||
Err(BlockError::TemporarilyInvalid(OutOfBounds {
|
||||
min: None,
|
||||
max: Some(limit),
|
||||
found,
|
||||
}))?
|
||||
}
|
||||
}
|
||||
|
||||
let is_checkpoint = header.number() % self.epoch_length == 0;
|
||||
|
||||
if is_checkpoint && *header.author() != NULL_AUTHOR {
|
||||
return Err(EngineError::CliqueWrongAuthorCheckpoint(Mismatch {
|
||||
expected: 0.into(),
|
||||
found: *header.author(),
|
||||
}))?;
|
||||
}
|
||||
|
||||
let seal_fields = header.decode_seal::<Vec<_>>()?;
|
||||
if seal_fields.len() != 2 {
|
||||
Err(BlockError::InvalidSealArity(Mismatch {
|
||||
expected: 2,
|
||||
found: seal_fields.len(),
|
||||
}))?
|
||||
}
|
||||
|
||||
let mixhash: H256 = seal_fields[0].into();
|
||||
let nonce: H64 = seal_fields[1].into();
|
||||
|
||||
// Nonce must be 0x00..0 or 0xff..f
|
||||
if nonce != NONCE_DROP_VOTE && nonce != NONCE_AUTH_VOTE {
|
||||
Err(EngineError::CliqueInvalidNonce(nonce))?;
|
||||
}
|
||||
|
||||
if is_checkpoint && nonce != NULL_NONCE {
|
||||
Err(EngineError::CliqueInvalidNonce(nonce))?;
|
||||
}
|
||||
|
||||
// Ensure that the mix digest is zero as Clique don't have fork protection currently
|
||||
if mixhash != NULL_MIXHASH {
|
||||
Err(BlockError::MismatchedH256SealElement(Mismatch {
|
||||
expected: NULL_MIXHASH,
|
||||
found: mixhash,
|
||||
}))?
|
||||
}
|
||||
|
||||
let extra_data_len = header.extra_data().len();
|
||||
|
||||
if extra_data_len < VANITY_LENGTH {
|
||||
Err(EngineError::CliqueMissingVanity)?
|
||||
}
|
||||
|
||||
if extra_data_len < VANITY_LENGTH + SIGNATURE_LENGTH {
|
||||
Err(EngineError::CliqueMissingSignature)?
|
||||
}
|
||||
|
||||
let signers = extra_data_len - (VANITY_LENGTH + SIGNATURE_LENGTH);
|
||||
|
||||
// Checkpoint blocks must at least contain one signer
|
||||
if is_checkpoint && signers == 0 {
|
||||
Err(EngineError::CliqueCheckpointNoSigner)?
|
||||
}
|
||||
|
||||
// Addresses must be be divisable by 20
|
||||
if is_checkpoint && signers % ADDRESS_LENGTH != 0 {
|
||||
Err(EngineError::CliqueCheckpointInvalidSigners(signers))?
|
||||
}
|
||||
|
||||
// Ensure that the block doesn't contain any uncles which are meaningless in PoA
|
||||
if *header.uncles_hash() != NULL_UNCLES_HASH {
|
||||
Err(BlockError::InvalidUnclesHash(Mismatch {
|
||||
expected: NULL_UNCLES_HASH,
|
||||
found: *header.uncles_hash(),
|
||||
}))?
|
||||
}
|
||||
|
||||
// Ensure that the block's difficulty is meaningful (may not be correct at this point)
|
||||
if *header.difficulty() != DIFF_INTURN && *header.difficulty() != DIFF_NOTURN {
|
||||
Err(BlockError::DifficultyOutOfBounds(OutOfBounds {
|
||||
min: Some(DIFF_NOTURN),
|
||||
max: Some(DIFF_INTURN),
|
||||
found: *header.difficulty(),
|
||||
}))?
|
||||
}
|
||||
|
||||
// All basic checks passed, continue to next phase
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn verify_block_unordered(&self, _header: &Header) -> Result<(), Error> {
|
||||
// Nothing to check here.
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Verify block family by looking up parent state (backfill if needed), then try to apply current header.
|
||||
/// see https://github.com/ethereum/go-ethereum/blob/master/consensus/clique/clique.go#L338
|
||||
fn verify_block_family(&self, header: &Header, parent: &Header) -> Result<(), Error> {
|
||||
// Ignore genesis block.
|
||||
if header.number() == 0 {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// parent sanity check
|
||||
if parent.hash() != *header.parent_hash() || header.number() != parent.number() + 1 {
|
||||
Err(BlockError::UnknownParent(parent.hash()))?
|
||||
}
|
||||
|
||||
// Ensure that the block's timestamp isn't too close to it's parent
|
||||
let limit = parent.timestamp().saturating_add(self.period);
|
||||
if limit > header.timestamp() {
|
||||
let max = CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(header.timestamp()));
|
||||
let found = CheckedSystemTime::checked_add(UNIX_EPOCH, Duration::from_secs(limit))
|
||||
.ok_or(BlockError::TimestampOverflow)?;
|
||||
|
||||
Err(BlockError::InvalidTimestamp(OutOfBounds {
|
||||
min: None,
|
||||
max,
|
||||
found,
|
||||
}))?
|
||||
}
|
||||
|
||||
// Retrieve the parent state
|
||||
let parent_state = self.state(&parent)?;
|
||||
// Try to apply current state, apply() will further check signer and recent signer.
|
||||
let mut new_state = parent_state.clone();
|
||||
new_state.apply(header, header.number() % self.epoch_length == 0)?;
|
||||
new_state.calc_next_timestamp(header.timestamp(), self.period)?;
|
||||
self.block_state_by_hash.write().insert(header.hash(), new_state);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn genesis_epoch_data(&self, header: &Header, _call: &Call) -> Result<Vec<u8>, String> {
|
||||
let mut state = self.new_checkpoint_state(header).expect("Unable to parse genesis data.");
|
||||
state.calc_next_timestamp(header.timestamp(), self.period).map_err(|e| format!("{}", e))?;
|
||||
self.block_state_by_hash.write().insert(header.hash(), state);
|
||||
|
||||
// no proof.
|
||||
Ok(Vec::new())
|
||||
}
|
||||
|
||||
// Our task here is to set difficulty
|
||||
fn populate_from_parent(&self, header: &mut Header, parent: &Header) {
|
||||
// TODO(https://github.com/paritytech/parity-ethereum/issues/10410): this is a horrible hack,
|
||||
// it is due to the fact that enact and miner both use OpenBlock::new() which will both call
|
||||
// this function. more refactoring is definitely needed.
|
||||
if header.extra_data().len() < VANITY_LENGTH + SIGNATURE_LENGTH {
|
||||
trace!(target: "engine", "populate_from_parent in sealing");
|
||||
|
||||
// It's unclear how to prevent creating new blocks unless we are authorized, the best way (and geth does this too)
|
||||
// it's just to ignore setting an correct difficulty here, we will check authorization in next step in generate_seal anyway.
|
||||
if let Some(signer) = self.signer.read().as_ref() {
|
||||
let state = match self.state(&parent) {
|
||||
Err(e) => {
|
||||
trace!(target: "engine", "populate_from_parent: Unable to find parent state: {}, ignored.", e);
|
||||
return;
|
||||
}
|
||||
Ok(state) => state,
|
||||
};
|
||||
|
||||
if state.is_authorized(&signer.address()) {
|
||||
if state.is_inturn(header.number(), &signer.address()) {
|
||||
header.set_difficulty(DIFF_INTURN);
|
||||
} else {
|
||||
header.set_difficulty(DIFF_NOTURN);
|
||||
}
|
||||
}
|
||||
|
||||
let zero_padding_len = VANITY_LENGTH - header.extra_data().len();
|
||||
if zero_padding_len > 0 {
|
||||
let mut resized_extra_data = header.extra_data().clone();
|
||||
resized_extra_data.resize(VANITY_LENGTH, 0);
|
||||
header.set_extra_data(resized_extra_data);
|
||||
}
|
||||
} else {
|
||||
trace!(target: "engine", "populate_from_parent: no signer registered");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn set_signer(&self, signer: Box<EngineSigner>) {
|
||||
trace!(target: "engine", "set_signer: {}", signer.address());
|
||||
*self.signer.write() = Some(signer);
|
||||
}
|
||||
|
||||
fn register_client(&self, client: Weak<EngineClient>) {
|
||||
*self.client.write() = Some(client.clone());
|
||||
}
|
||||
|
||||
fn step(&self) {
|
||||
if self.signer.read().is_some() {
|
||||
if let Some(ref weak) = *self.client.read() {
|
||||
if let Some(c) = weak.upgrade() {
|
||||
c.update_sealing();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn stop(&mut self) {
|
||||
if let Some(mut s) = self.step_service.as_mut() {
|
||||
Arc::get_mut(&mut s).map(|x| x.stop());
|
||||
} else {
|
||||
warn!(target: "engine", "Stopping `CliqueStepService` failed requires mutable access");
|
||||
}
|
||||
}
|
||||
|
||||
/// Clique timestamp is set to parent + period , or current time which ever is higher.
|
||||
fn open_block_header_timestamp(&self, parent_timestamp: u64) -> u64 {
|
||||
let now = time::SystemTime::now().duration_since(time::UNIX_EPOCH).unwrap_or_default();
|
||||
cmp::max(now.as_secs() as u64, parent_timestamp.saturating_add(self.period))
|
||||
}
|
||||
|
||||
fn is_timestamp_valid(&self, header_timestamp: u64, parent_timestamp: u64) -> bool {
|
||||
header_timestamp >= parent_timestamp.saturating_add(self.period)
|
||||
}
|
||||
|
||||
fn fork_choice(&self, new: &ExtendedHeader, current: &ExtendedHeader) -> super::ForkChoice {
|
||||
super::total_difficulty_fork_choice(new, current)
|
||||
}
|
||||
|
||||
// Clique uses the author field for voting, the real author is hidden in the `extra_data` field.
|
||||
// So when executing tx's (like in `enact()`) we want to use the executive author
|
||||
fn executive_author(&self, header: &Header) -> Result<Address, Error> {
|
||||
recover_creator(header)
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Ethereum.
|
||||
|
||||
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Clique specific parameters.
|
||||
|
||||
use ethjson;
|
||||
|
||||
/// `Clique` params.
|
||||
pub struct CliqueParams {
|
||||
/// Period as defined in EIP
|
||||
pub period: u64,
|
||||
/// Epoch length as defined in EIP
|
||||
pub epoch: u64,
|
||||
}
|
||||
|
||||
impl From<ethjson::spec::CliqueParams> for CliqueParams {
|
||||
fn from(p: ethjson::spec::CliqueParams) -> Self {
|
||||
let period = p.period.map_or_else(|| 30000 as u64, Into::into);
|
||||
let epoch = p.epoch.map_or_else(|| 15 as u64, Into::into);
|
||||
|
||||
assert!(epoch > 0);
|
||||
|
||||
CliqueParams {
|
||||
period,
|
||||
epoch,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Ethereum.
|
||||
|
||||
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
use std::sync::Weak;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::time::Duration;
|
||||
use std::thread;
|
||||
use std::sync::Arc;
|
||||
|
||||
use engines::Engine;
|
||||
use machine::Machine;
|
||||
|
||||
/// Service that is managing the engine
|
||||
pub struct StepService {
|
||||
shutdown: Arc<AtomicBool>,
|
||||
thread: Option<thread::JoinHandle<()>>,
|
||||
}
|
||||
|
||||
impl StepService {
|
||||
/// Start the `StepService`
|
||||
pub fn start<M: Machine + 'static>(engine: Weak<Engine<M>>) -> Arc<Self> {
|
||||
let shutdown = Arc::new(AtomicBool::new(false));
|
||||
let s = shutdown.clone();
|
||||
|
||||
let thread = thread::Builder::new()
|
||||
.name("CliqueStepService".into())
|
||||
.spawn(move || {
|
||||
// startup delay.
|
||||
thread::sleep(Duration::from_secs(5));
|
||||
|
||||
loop {
|
||||
// see if we are in shutdown.
|
||||
if shutdown.load(Ordering::Acquire) {
|
||||
trace!(target: "miner", "CliqueStepService: received shutdown signal!");
|
||||
break;
|
||||
}
|
||||
|
||||
trace!(target: "miner", "CliqueStepService: triggering sealing");
|
||||
|
||||
// Try sealing
|
||||
engine.upgrade().map(|x| x.step());
|
||||
|
||||
// Yield
|
||||
thread::sleep(Duration::from_millis(2000));
|
||||
}
|
||||
trace!(target: "miner", "CliqueStepService: shutdown.");
|
||||
}).expect("CliqueStepService thread failed");
|
||||
|
||||
Arc::new(StepService {
|
||||
shutdown: s,
|
||||
thread: Some(thread),
|
||||
})
|
||||
}
|
||||
|
||||
/// Stop the `StepService`
|
||||
pub fn stop(&mut self) {
|
||||
trace!(target: "miner", "CliqueStepService: shutting down.");
|
||||
self.shutdown.store(true, Ordering::Release);
|
||||
if let Some(t) = self.thread.take() {
|
||||
t.join().expect("CliqueStepService thread panicked!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,804 +0,0 @@
|
||||
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Ethereum.
|
||||
|
||||
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Consensus tests for `PoA Clique Engine`, see http://eips.ethereum.org/EIPS/eip-225 for more information
|
||||
|
||||
use block::*;
|
||||
use engines::Engine;
|
||||
use error::{Error, ErrorKind};
|
||||
use ethereum_types::{Address, H256};
|
||||
use ethkey::{Secret, KeyPair};
|
||||
use state_db::StateDB;
|
||||
use super::*;
|
||||
use test_helpers::get_temp_state_db;
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::collections::HashMap;
|
||||
|
||||
/// Possible signers
|
||||
pub const SIGNER_TAGS: [char; 6] = ['A', 'B', 'C', 'D', 'E', 'F'];
|
||||
|
||||
/// Clique block types
|
||||
pub enum CliqueBlockType {
|
||||
/// Epoch transition block must contain list of signers
|
||||
Checkpoint,
|
||||
/// Block with no votes
|
||||
Empty,
|
||||
/// Vote
|
||||
Vote(VoteType),
|
||||
}
|
||||
|
||||
/// Clique tester
|
||||
pub struct CliqueTester {
|
||||
/// Mocked Clique
|
||||
pub clique: Clique,
|
||||
/// Mocked genesis state
|
||||
pub genesis: Header,
|
||||
/// StateDB
|
||||
pub db: StateDB,
|
||||
/// List of signers
|
||||
pub signers: HashMap<char, KeyPair>,
|
||||
}
|
||||
|
||||
impl CliqueTester {
|
||||
/// Create a `Clique` tester with settings
|
||||
pub fn with(epoch: u64, period: u64, initial_signers: Vec<char>) -> Self {
|
||||
assert_eq!(initial_signers.iter().all(|s| SIGNER_TAGS.contains(s)), true,
|
||||
"Not all the initial signers is in SIGNER_TAGS, possible keys are 'A' ..= 'F'");
|
||||
|
||||
let clique = Clique::with_test(epoch, period);
|
||||
let mut genesis = Header::default();
|
||||
let mut signers = HashMap::new();
|
||||
|
||||
let call = |_a, _b| {
|
||||
unimplemented!("Clique doesn't use Engine::Call");
|
||||
};
|
||||
|
||||
let mut extra_data = vec![0; VANITY_LENGTH];
|
||||
|
||||
for &signer in SIGNER_TAGS.iter() {
|
||||
let secret = Secret::from(H256::from(signer as u64));
|
||||
let keypair = KeyPair::from_secret(secret).unwrap();
|
||||
if initial_signers.contains(&signer) {
|
||||
extra_data.extend(&*keypair.address());
|
||||
}
|
||||
signers.insert(signer, keypair);
|
||||
}
|
||||
|
||||
// append dummy signature
|
||||
extra_data.extend(std::iter::repeat(0).take(SIGNATURE_LENGTH));
|
||||
|
||||
genesis.set_extra_data(extra_data);
|
||||
genesis.set_gas_limit(U256::from(0xa00000));
|
||||
genesis.set_difficulty(U256::from(1));
|
||||
genesis.set_seal(util::null_seal());
|
||||
|
||||
clique.genesis_epoch_data(&genesis, &call).expect("Create genesis failed");
|
||||
Self {clique, genesis, db: get_temp_state_db(), signers}
|
||||
}
|
||||
|
||||
/// Get difficulty for a given block
|
||||
pub fn get_difficulty(&self, block_num: BlockNumber, header: &Header, signer: &Address) -> U256 {
|
||||
let state = self.clique.state(header).unwrap();
|
||||
if state.is_inturn(block_num, signer) {
|
||||
DIFF_INTURN
|
||||
} else {
|
||||
DIFF_NOTURN
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the state of a given block
|
||||
// Note, this will read the cache and `will` not work with more than 128 blocks
|
||||
pub fn get_state_at_block(&self, hash: &H256) -> CliqueBlockState {
|
||||
self.clique.block_state_by_hash.write()
|
||||
.get_mut(hash)
|
||||
.expect("CliqueBlockState not found tested failed")
|
||||
.clone()
|
||||
}
|
||||
|
||||
/// Get signers after a certain state
|
||||
// This is generally used to fetch the state after a test has been executed and checked against
|
||||
// the intial list of signers provided in the test
|
||||
pub fn clique_signers(&self, hash: &H256) -> impl Iterator<Item = Address> {
|
||||
self.get_state_at_block(hash).signers().clone().into_iter()
|
||||
}
|
||||
|
||||
/// Fetches all addresses at current `block` and converts them back to `tags (char)` and sorts them
|
||||
/// Addresses are supposed sorted based on address but these tests are using `tags` just for simplicity
|
||||
/// and the order is not important!
|
||||
pub fn into_tags<T: Iterator<Item = Address>>(&self, addr: T) -> Vec<char> {
|
||||
let mut tags: Vec<char> = addr.filter_map(|addr| {
|
||||
for (t, kp) in self.signers.iter() {
|
||||
if addr == kp.address() {
|
||||
return Some(*t)
|
||||
}
|
||||
}
|
||||
None
|
||||
})
|
||||
.collect();
|
||||
|
||||
tags.sort();
|
||||
tags
|
||||
}
|
||||
|
||||
/// Create a new `Clique` block and import
|
||||
pub fn new_block_and_import(
|
||||
&self,
|
||||
block_type: CliqueBlockType,
|
||||
last_header: &Header,
|
||||
beneficary: Option<Address>,
|
||||
signer: char,
|
||||
) -> Result<Header, Error> {
|
||||
|
||||
let mut extra_data = vec![0; VANITY_LENGTH];
|
||||
let mut seal = util::null_seal();
|
||||
let last_hash = last_header.hash();
|
||||
|
||||
match block_type {
|
||||
CliqueBlockType::Checkpoint => {
|
||||
let signers = self.clique.state(&last_header).unwrap().signers().clone();
|
||||
for signer in signers {
|
||||
extra_data.extend(&*signer);
|
||||
}
|
||||
}
|
||||
CliqueBlockType::Vote(v) => seal = v.as_rlp(),
|
||||
CliqueBlockType::Empty => (),
|
||||
};
|
||||
|
||||
let db = self.db.boxed_clone();
|
||||
|
||||
let mut block = OpenBlock::new(
|
||||
&self.clique,
|
||||
Default::default(),
|
||||
false,
|
||||
db,
|
||||
&last_header.clone(),
|
||||
Arc::new(vec![last_hash]),
|
||||
beneficary.unwrap_or_default(),
|
||||
(3141562.into(), 31415620.into()),
|
||||
extra_data,
|
||||
false,
|
||||
None,
|
||||
).unwrap();
|
||||
|
||||
{
|
||||
let difficulty = self.get_difficulty(block.header.number(), last_header, &self.signers[&signer].address());
|
||||
let b = block.block_mut();
|
||||
b.header.set_timestamp(last_header.timestamp() + self.clique.period);
|
||||
b.header.set_difficulty(difficulty);
|
||||
b.header.set_seal(seal);
|
||||
|
||||
let sign = ethkey::sign(self.signers[&signer].secret(), &b.header.hash()).unwrap();
|
||||
let mut extra_data = b.header.extra_data().clone();
|
||||
extra_data.extend_from_slice(&*sign);
|
||||
b.header.set_extra_data(extra_data);
|
||||
}
|
||||
|
||||
let current_header = &block.header;
|
||||
self.clique.verify_block_basic(current_header)?;
|
||||
self.clique.verify_block_family(current_header, &last_header)?;
|
||||
|
||||
Ok(current_header.clone())
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn one_signer_with_no_votes() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A']);
|
||||
|
||||
let empty_block = tester.new_block_and_import(CliqueBlockType::Empty, &tester.genesis, None, 'A').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&empty_block.hash()));
|
||||
assert_eq!(&tags, &['A']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn one_signer_two_votes() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A']);
|
||||
|
||||
// Add a vote for `B` signed by `A`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &tester.genesis,
|
||||
Some(tester.signers[&'B'].address()), 'A').unwrap();
|
||||
let tags = tester.into_tags(tester.clique_signers(&vote.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
|
||||
// Add a empty block signed by `B`
|
||||
let empty = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'B').unwrap();
|
||||
|
||||
// Add vote for `C` signed by A but should not be accepted
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &empty,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&vote.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn two_signers_six_votes_deny_last() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A', 'B']);
|
||||
|
||||
let mut prev_header = tester.genesis.clone();
|
||||
|
||||
// Add two votes for `C` signed by `A` and `B`
|
||||
for &signer in SIGNER_TAGS.iter().take(2) {
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &prev_header,
|
||||
Some(tester.signers[&'C'].address()), signer).unwrap();
|
||||
prev_header = vote.clone();
|
||||
}
|
||||
|
||||
// Add two votes for `D` signed by `A` and `B`
|
||||
for &signer in SIGNER_TAGS.iter().take(2) {
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &prev_header,
|
||||
Some(tester.signers[&'D'].address()), signer).unwrap();
|
||||
prev_header = vote.clone();
|
||||
}
|
||||
|
||||
// Add a empty block signed by `C`
|
||||
let empty = tester.new_block_and_import(CliqueBlockType::Empty, &prev_header, None, 'C').unwrap();
|
||||
prev_header = empty.clone();
|
||||
|
||||
// Add two votes for `E` signed by `A` and `B`
|
||||
for &signer in SIGNER_TAGS.iter().take(2) {
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &prev_header,
|
||||
Some(tester.signers[&'E'].address()), signer).unwrap();
|
||||
prev_header = vote.clone();
|
||||
}
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&prev_header.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C', 'D']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn one_signer_dropping_itself() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A']);
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'A'].address()), 'A').unwrap();
|
||||
let signers = tester.clique_signers(&vote.hash());
|
||||
assert!(signers.count() == 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn two_signers_one_remove_vote_no_consensus() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A', 'B']);
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'B'].address()), 'A').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&vote.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn two_signers_consensus_remove_b() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A', 'B']);
|
||||
let first_vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'B'].address()), 'A').unwrap();
|
||||
let second_vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &first_vote,
|
||||
Some(tester.signers[&'B'].address()), 'B').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&second_vote.hash()));
|
||||
assert_eq!(&tags, &['A']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn three_signers_consensus_remove_c() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A', 'B', 'C']);
|
||||
let first_vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
let second_vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &first_vote,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&second_vote.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn four_signers_half_no_consensus() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A', 'B', 'C', 'D']);
|
||||
let first_vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
let second_vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &first_vote,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&second_vote.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C', 'D']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn four_signers_three_consensus_rm() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A', 'B', 'C', 'D']);
|
||||
|
||||
let mut prev_header = tester.genesis.clone();
|
||||
|
||||
// Three votes to remove `D` signed by ['A', 'B', 'C']
|
||||
for signer in SIGNER_TAGS.iter().take(3) {
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &prev_header,
|
||||
Some(tester.signers[&'D'].address()), *signer).unwrap();
|
||||
prev_header = vote.clone();
|
||||
}
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&prev_header.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn vote_add_only_counted_once_per_signer() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A', 'B']);
|
||||
|
||||
// Add a vote for `C` signed by `A`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &tester.genesis,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
// Empty block signed by B`
|
||||
let empty = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'B').unwrap();
|
||||
|
||||
// Add a vote for `C` signed by `A`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &empty,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
// Empty block signed by `B`
|
||||
let empty = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'B').unwrap();
|
||||
|
||||
// Add a vote for `C` signed by `A`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &empty,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&vote.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn vote_add_concurrently_is_permitted() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A', 'B']);
|
||||
|
||||
// Add a vote for `C` signed by `A`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &tester.genesis,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
// Empty block signed by `B`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Empty, &b, None, 'B').unwrap();
|
||||
|
||||
// Add a vote for `D` signed by `A`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &b,
|
||||
Some(tester.signers[&'D'].address()), 'A').unwrap();
|
||||
|
||||
// Empty block signed by `B`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Empty, &b, None, 'B').unwrap();
|
||||
|
||||
// Empty block signed by `A`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Empty, &b, None, 'A').unwrap();
|
||||
|
||||
// Add a vote for `D` signed by `B`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &b,
|
||||
Some(tester.signers[&'D'].address()), 'B').unwrap();
|
||||
|
||||
// Empty block signed by `A`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Empty, &b, None, 'A').unwrap();
|
||||
|
||||
// Add a vote for `C` signed by `B`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &b,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&b.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C', 'D']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn vote_rm_only_counted_once_per_signer() {
|
||||
let tester = CliqueTester::with(10, 1, vec!['A', 'B']);
|
||||
|
||||
let mut prev_header = tester.genesis.clone();
|
||||
|
||||
for _ in 0..2 {
|
||||
// Vote to remove `B` signed by `A`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &prev_header,
|
||||
Some(tester.signers[&'B'].address()), 'A').unwrap();
|
||||
// Empty block signed by `B`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Empty, &b, None, 'B').unwrap();
|
||||
|
||||
prev_header = b.clone();
|
||||
}
|
||||
|
||||
// Add a vote for `B` signed by `A`
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &prev_header,
|
||||
Some(tester.signers[&'B'].address()), 'A').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&b.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn vote_rm_concurrently_is_permitted() {
|
||||
let tester = CliqueTester::with(100, 1, vec!['A', 'B', 'C', 'D']);
|
||||
|
||||
// Add a vote for `C` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
// Empty block signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'B').unwrap();
|
||||
// Empty block signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'C').unwrap();
|
||||
|
||||
// Add a vote for `D` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'A').unwrap();
|
||||
|
||||
// Empty block signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'B').unwrap();
|
||||
// Empty block signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'C').unwrap();
|
||||
// Empty block signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'A').unwrap();
|
||||
|
||||
// Add a vote for `D` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'B').unwrap();
|
||||
// Add a vote for `D` signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'C').unwrap();
|
||||
|
||||
// Empty block signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'A').unwrap();
|
||||
// Add a vote for `C` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn vote_to_rm_are_immediate_and_ensure_votes_are_rm() {
|
||||
let tester = CliqueTester::with(100, 1, vec!['A', 'B', 'C']);
|
||||
|
||||
// Vote to remove `B` signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'B'].address()), 'C').unwrap();
|
||||
// Vote to remove `C` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
// Vote to remove `C` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
// Vote to remove `B` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'B'].address()), 'A').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn vote_to_rm_are_immediate_and_votes_should_be_dropped_from_kicked_signer() {
|
||||
let tester = CliqueTester::with(100, 1, vec!['A', 'B', 'C']);
|
||||
|
||||
// Vote to add `D` signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &tester.genesis,
|
||||
Some(tester.signers[&'D'].address()), 'C').unwrap();
|
||||
// Vote to remove `C` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
// Vote to remove `C` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
// Vote to add `D` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &block,
|
||||
Some(tester.signers[&'D'].address()), 'A').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cascading_not_allowed() {
|
||||
let tester = CliqueTester::with(100, 1, vec!['A', 'B', 'C', 'D']);
|
||||
|
||||
// Vote against `C` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
// Empty block signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'B').unwrap();
|
||||
|
||||
// Empty block signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'C').unwrap();
|
||||
|
||||
// Vote against `D` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'A').unwrap();
|
||||
|
||||
// Vote against `C` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
// Empty block signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'C').unwrap();
|
||||
|
||||
// Empty block signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'A').unwrap();
|
||||
|
||||
// Vote against `D` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'B').unwrap();
|
||||
|
||||
// Vote against `D` signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'C').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn consensus_out_of_bounds_consensus_execute_on_touch() {
|
||||
let tester = CliqueTester::with(100, 1, vec!['A', 'B', 'C', 'D']);
|
||||
|
||||
// Vote against `C` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
// Empty block signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'B').unwrap();
|
||||
|
||||
// Empty block signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'C').unwrap();
|
||||
|
||||
// Vote against `D` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'A').unwrap();
|
||||
|
||||
// Vote against `C` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
// Empty block signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'C').unwrap();
|
||||
|
||||
// Empty block signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'A').unwrap();
|
||||
|
||||
// Vote against `D` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'B').unwrap();
|
||||
|
||||
// Vote against `D` signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'C').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C'], "D should have been removed after 3/4 remove votes");
|
||||
|
||||
// Empty block signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'A').unwrap();
|
||||
|
||||
// Vote for `C` signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &block,
|
||||
Some(tester.signers[&'C'].address()), 'C').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['A', 'B']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn consensus_out_of_bounds_first_touch() {
|
||||
let tester = CliqueTester::with(100, 1, vec!['A', 'B', 'C', 'D']);
|
||||
|
||||
// Vote against `C` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &tester.genesis,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
// Empty block signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'B').unwrap();
|
||||
|
||||
// Empty block signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'C').unwrap();
|
||||
|
||||
// Vote against `D` signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'A').unwrap();
|
||||
|
||||
// Vote against `C` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
// Empty block signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'C').unwrap();
|
||||
|
||||
// Empty block signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'A').unwrap();
|
||||
|
||||
// Vote against `D` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'B').unwrap();
|
||||
|
||||
// Vote against `D` signed by `C`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &block,
|
||||
Some(tester.signers[&'D'].address()), 'C').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C']);
|
||||
|
||||
// Empty block signed by `A`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'A').unwrap();
|
||||
|
||||
// Vote for `C` signed by `B`
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &block,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C']);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pending_votes_doesnt_survive_authorization_changes() {
|
||||
let tester = CliqueTester::with(100, 1, vec!['A', 'B', 'C', 'D', 'E']);
|
||||
|
||||
let mut prev_header = tester.genesis.clone();
|
||||
|
||||
// Vote for `F` from [`A`, `B`, `C`]
|
||||
for sign in SIGNER_TAGS.iter().take(3) {
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &prev_header,
|
||||
Some(tester.signers[&'F'].address()), *sign).unwrap();
|
||||
prev_header = block.clone();
|
||||
}
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&prev_header.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C', 'D', 'E', 'F'], "F should have been added");
|
||||
|
||||
// Vote against `F` from [`D`, `E`, `B`, `C`]
|
||||
for sign in SIGNER_TAGS.iter().skip(3).chain(SIGNER_TAGS.iter().skip(1).take(2)) {
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &prev_header,
|
||||
Some(tester.signers[&'F'].address()), *sign).unwrap();
|
||||
prev_header = block.clone();
|
||||
}
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&prev_header.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C', 'D', 'E'], "F should have been removed");
|
||||
|
||||
// Vote for `F` from [`D`, `E`]
|
||||
for sign in SIGNER_TAGS.iter().skip(3).take(2) {
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &prev_header,
|
||||
Some(tester.signers[&'F'].address()), *sign).unwrap();
|
||||
prev_header = block.clone();
|
||||
}
|
||||
|
||||
// Vote against `A` from [`B`, `C`, `D`]
|
||||
for sign in SIGNER_TAGS.iter().skip(1).take(3) {
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Remove), &prev_header,
|
||||
Some(tester.signers[&'A'].address()), *sign).unwrap();
|
||||
prev_header = block.clone();
|
||||
}
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&prev_header.hash()));
|
||||
assert_eq!(&tags, &['B', 'C', 'D', 'E'], "A should have been removed");
|
||||
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &prev_header,
|
||||
Some(tester.signers[&'F'].address()), 'B').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['B', 'C', 'D', 'E', 'F'], "F should have been added again");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn epoch_transition_reset_all_votes() {
|
||||
let tester = CliqueTester::with(3, 1, vec!['A', 'B']);
|
||||
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &tester.genesis,
|
||||
Some(tester.signers[&'C'].address()), 'A').unwrap();
|
||||
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'B').unwrap();
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Checkpoint, &block, None, 'A').unwrap();
|
||||
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &block,
|
||||
Some(tester.signers[&'C'].address()), 'B').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&block.hash()));
|
||||
assert_eq!(&tags, &['A', 'B'], "Votes should have been reset after checkpoint");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unauthorized_signer_should_not_be_able_to_sign_block() {
|
||||
let tester = CliqueTester::with(3, 1, vec!['A']);
|
||||
let err = tester.new_block_and_import(CliqueBlockType::Empty, &tester.genesis, None, 'B').unwrap_err();
|
||||
|
||||
match err.kind() {
|
||||
ErrorKind::Engine(EngineError::NotAuthorized(_)) => (),
|
||||
_ => assert!(true == false, "Wrong error kind"),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn signer_should_not_be_able_to_sign_two_consequtive_blocks() {
|
||||
let tester = CliqueTester::with(3, 1, vec!['A', 'B']);
|
||||
let b = tester.new_block_and_import(CliqueBlockType::Empty, &tester.genesis, None, 'A').unwrap();
|
||||
let err = tester.new_block_and_import(CliqueBlockType::Empty, &b, None, 'A').unwrap_err();
|
||||
|
||||
match err.kind() {
|
||||
ErrorKind::Engine(EngineError::CliqueTooRecentlySigned(_)) => (),
|
||||
_ => assert!(true == false, "Wrong error kind"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn recent_signers_should_not_reset_on_checkpoint() {
|
||||
let tester = CliqueTester::with(3, 1, vec!['A', 'B', 'C']);
|
||||
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &tester.genesis, None, 'A').unwrap();
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'B').unwrap();
|
||||
let block = tester.new_block_and_import(CliqueBlockType::Checkpoint, &block, None, 'A').unwrap();
|
||||
|
||||
let err = tester.new_block_and_import(CliqueBlockType::Empty, &block, None, 'A').unwrap_err();
|
||||
|
||||
match err.kind() {
|
||||
ErrorKind::Engine(EngineError::CliqueTooRecentlySigned(_)) => (),
|
||||
_ => assert!(true == false, "Wrong error kind"),
|
||||
}
|
||||
}
|
||||
|
||||
// Not part of http://eips.ethereum.org/EIPS/eip-225
|
||||
#[test]
|
||||
fn bonus_consensus_should_keep_track_of_votes_before_latest_per_signer() {
|
||||
let tester = CliqueTester::with(100, 1, vec!['A', 'B', 'C', 'D']);
|
||||
|
||||
// Add a vote for `E` signed by `A`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &tester.genesis,
|
||||
Some(tester.signers[&'E'].address()), 'A').unwrap();
|
||||
// Empty block signed by `B`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'B').unwrap();
|
||||
|
||||
// Empty block signed by `C`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'C').unwrap();
|
||||
|
||||
// Empty block signed by `D`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'D').unwrap();
|
||||
|
||||
// Add a vote for `F` signed by `A`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &vote,
|
||||
Some(tester.signers[&'F'].address()), 'A').unwrap();
|
||||
// Empty block signed by `C`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'C').unwrap();
|
||||
|
||||
// Empty block signed by `D`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'D').unwrap();
|
||||
|
||||
// Add a vote for `E` signed by `B`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &vote,
|
||||
Some(tester.signers[&'E'].address()), 'B').unwrap();
|
||||
// Empty block signed by `A`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'A').unwrap();
|
||||
|
||||
// Empty block signed by `C`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'C').unwrap();
|
||||
|
||||
// Empty block signed by `D`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'D').unwrap();
|
||||
|
||||
// Add a vote for `F` signed by `B`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &vote,
|
||||
Some(tester.signers[&'F'].address()), 'B').unwrap();
|
||||
|
||||
// Empty block signed by A`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Empty, &vote, None, 'A').unwrap();
|
||||
|
||||
// Add a vote for `E` signed by `C`
|
||||
let vote = tester.new_block_and_import(CliqueBlockType::Vote(VoteType::Add), &vote,
|
||||
Some(tester.signers[&'E'].address()), 'C').unwrap();
|
||||
|
||||
let tags = tester.into_tags(tester.clique_signers(&vote.hash()));
|
||||
assert_eq!(&tags, &['A', 'B', 'C', 'D', 'E']);
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Parity Ethereum.
|
||||
|
||||
// Parity Ethereum is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Parity Ethereum is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
use engines::EngineError;
|
||||
use engines::clique::{ADDRESS_LENGTH, SIGNATURE_LENGTH, VANITY_LENGTH, NULL_NONCE, NULL_MIXHASH};
|
||||
use error::Error;
|
||||
use ethereum_types::{Address, H256};
|
||||
use ethkey::{public_to_address, recover as ec_recover, Signature};
|
||||
use lru_cache::LruCache;
|
||||
use parking_lot::RwLock;
|
||||
use rlp::encode;
|
||||
use types::header::Header;
|
||||
|
||||
/// How many recovered signature to cache in the memory.
|
||||
pub const CREATOR_CACHE_NUM: usize = 4096;
|
||||
lazy_static! {
|
||||
/// key: header hash
|
||||
/// value: creator address
|
||||
static ref CREATOR_BY_HASH: RwLock<LruCache<H256, Address>> = RwLock::new(LruCache::new(CREATOR_CACHE_NUM));
|
||||
}
|
||||
|
||||
/// Recover block creator from signature
|
||||
pub fn recover_creator(header: &Header) -> Result<Address, Error> {
|
||||
// Initialization
|
||||
let mut cache = CREATOR_BY_HASH.write();
|
||||
|
||||
if let Some(creator) = cache.get_mut(&header.hash()) {
|
||||
return Ok(*creator);
|
||||
}
|
||||
|
||||
let data = header.extra_data();
|
||||
if data.len() < VANITY_LENGTH {
|
||||
Err(EngineError::CliqueMissingVanity)?
|
||||
}
|
||||
|
||||
if data.len() < VANITY_LENGTH + SIGNATURE_LENGTH {
|
||||
Err(EngineError::CliqueMissingSignature)?
|
||||
}
|
||||
|
||||
// Split `signed_extra data` and `signature`
|
||||
let (signed_data_slice, signature_slice) = data.split_at(data.len() - SIGNATURE_LENGTH);
|
||||
|
||||
// convert `&[u8]` to `[u8; 65]`
|
||||
let signature = {
|
||||
let mut s = [0; SIGNATURE_LENGTH];
|
||||
s.copy_from_slice(signature_slice);
|
||||
s
|
||||
};
|
||||
|
||||
// modify header and hash it
|
||||
let unsigned_header = &mut header.clone();
|
||||
unsigned_header.set_extra_data(signed_data_slice.to_vec());
|
||||
let msg = unsigned_header.hash();
|
||||
|
||||
let pubkey = ec_recover(&Signature::from(signature), &msg)?;
|
||||
let creator = public_to_address(&pubkey);
|
||||
|
||||
cache.insert(header.hash(), creator.clone());
|
||||
Ok(creator)
|
||||
}
|
||||
|
||||
/// Extract signer list from extra_data.
|
||||
///
|
||||
/// Layout of extra_data:
|
||||
/// ----
|
||||
/// VANITY: 32 bytes
|
||||
/// Signers: N * 32 bytes as hex encoded (20 characters)
|
||||
/// Signature: 65 bytes
|
||||
/// --
|
||||
pub fn extract_signers(header: &Header) -> Result<BTreeSet<Address>, Error> {
|
||||
let data = header.extra_data();
|
||||
|
||||
if data.len() <= VANITY_LENGTH + SIGNATURE_LENGTH {
|
||||
Err(EngineError::CliqueCheckpointNoSigner)?
|
||||
}
|
||||
|
||||
// extract only the portion of extra_data which includes the signer list
|
||||
let signers_raw = &data[(VANITY_LENGTH)..data.len() - (SIGNATURE_LENGTH)];
|
||||
|
||||
if signers_raw.len() % ADDRESS_LENGTH != 0 {
|
||||
Err(EngineError::CliqueCheckpointInvalidSigners(signers_raw.len()))?
|
||||
}
|
||||
|
||||
let num_signers = signers_raw.len() / 20;
|
||||
|
||||
let signers: BTreeSet<Address> = (0..num_signers)
|
||||
.map(|i| {
|
||||
let start = i * ADDRESS_LENGTH;
|
||||
let end = start + ADDRESS_LENGTH;
|
||||
signers_raw[start..end].into()
|
||||
})
|
||||
.collect();
|
||||
|
||||
Ok(signers)
|
||||
}
|
||||
|
||||
/// Retrieve `null_seal`
|
||||
pub fn null_seal() -> Vec<Vec<u8>> {
|
||||
vec![encode(&NULL_MIXHASH.to_vec()), encode(&NULL_NONCE.to_vec())]
|
||||
}
|
||||
@@ -15,10 +15,7 @@
|
||||
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use engines::{Engine, Seal};
|
||||
use machine::Machine;
|
||||
use types::header::{Header, ExtendedHeader};
|
||||
use block::ExecutedBlock;
|
||||
use std::sync::atomic::{AtomicU64, Ordering};
|
||||
use parity_machine::{Machine, Transactions, TotalScoredHeader};
|
||||
|
||||
/// `InstantSeal` params.
|
||||
#[derive(Default, Debug, PartialEq)]
|
||||
@@ -40,21 +37,22 @@ impl From<::ethjson::spec::InstantSealParams> for InstantSealParams {
|
||||
pub struct InstantSeal<M> {
|
||||
params: InstantSealParams,
|
||||
machine: M,
|
||||
last_sealed_block: AtomicU64,
|
||||
}
|
||||
|
||||
impl<M> InstantSeal<M> {
|
||||
/// Returns new instance of InstantSeal over the given state machine.
|
||||
pub fn new(params: InstantSealParams, machine: M) -> Self {
|
||||
InstantSeal {
|
||||
params,
|
||||
machine,
|
||||
last_sealed_block: AtomicU64::new(0),
|
||||
params, machine,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<M: Machine> Engine<M> for InstantSeal<M> {
|
||||
impl<M: Machine> Engine<M> for InstantSeal<M>
|
||||
where M::LiveBlock: Transactions,
|
||||
M::ExtendedHeader: TotalScoredHeader,
|
||||
<M::ExtendedHeader as TotalScoredHeader>::Value: Ord
|
||||
{
|
||||
fn name(&self) -> &str {
|
||||
"InstantSeal"
|
||||
}
|
||||
@@ -63,23 +61,11 @@ impl<M: Machine> Engine<M> for InstantSeal<M> {
|
||||
|
||||
fn seals_internally(&self) -> Option<bool> { Some(true) }
|
||||
|
||||
fn generate_seal(&self, block: &ExecutedBlock, _parent: &Header) -> Seal {
|
||||
if !block.transactions.is_empty() {
|
||||
let block_number = block.header.number();
|
||||
let last_sealed_block = self.last_sealed_block.load(Ordering::SeqCst);
|
||||
// Return a regular seal if the given block is _higher_ than
|
||||
// the last sealed one
|
||||
if block_number > last_sealed_block {
|
||||
let prev_last_sealed_block = self.last_sealed_block.compare_and_swap(last_sealed_block, block_number, Ordering::SeqCst);
|
||||
if prev_last_sealed_block == last_sealed_block {
|
||||
return Seal::Regular(Vec::new())
|
||||
}
|
||||
}
|
||||
}
|
||||
Seal::None
|
||||
fn generate_seal(&self, block: &M::LiveBlock, _parent: &M::Header) -> Seal {
|
||||
if block.transactions().is_empty() { Seal::None } else { Seal::Regular(Vec::new()) }
|
||||
}
|
||||
|
||||
fn verify_local_seal(&self, _header: &Header) -> Result<(), M::Error> {
|
||||
fn verify_local_seal(&self, _header: &M::Header) -> Result<(), M::Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -98,7 +84,7 @@ impl<M: Machine> Engine<M> for InstantSeal<M> {
|
||||
header_timestamp >= parent_timestamp
|
||||
}
|
||||
|
||||
fn fork_choice(&self, new: &ExtendedHeader, current: &ExtendedHeader) -> super::ForkChoice {
|
||||
fn fork_choice(&self, new: &M::ExtendedHeader, current: &M::ExtendedHeader) -> super::ForkChoice {
|
||||
super::total_difficulty_fork_choice(new, current)
|
||||
}
|
||||
}
|
||||
@@ -120,9 +106,9 @@ mod tests {
|
||||
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let genesis_header = spec.genesis_header();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::default(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::default(), (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b = b.close_and_lock().unwrap();
|
||||
if let Seal::Regular(seal) = engine.generate_seal(&b, &genesis_header) {
|
||||
if let Seal::Regular(seal) = engine.generate_seal(b.block(), &genesis_header) {
|
||||
assert!(b.try_seal(engine, seal).is_ok());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
mod authority_round;
|
||||
mod basic_authority;
|
||||
mod clique;
|
||||
mod instant_seal;
|
||||
mod null_engine;
|
||||
mod validator_set;
|
||||
@@ -28,14 +27,14 @@ pub mod signer;
|
||||
|
||||
pub use self::authority_round::AuthorityRound;
|
||||
pub use self::basic_authority::BasicAuthority;
|
||||
pub use self::epoch::{EpochVerifier, Transition as EpochTransition};
|
||||
pub use self::instant_seal::{InstantSeal, InstantSealParams};
|
||||
pub use self::null_engine::NullEngine;
|
||||
pub use self::signer::EngineSigner;
|
||||
pub use self::clique::Clique;
|
||||
|
||||
// TODO [ToDr] Remove re-export (#10130)
|
||||
pub use types::engines::ForkChoice;
|
||||
pub use types::engines::epoch::{self, Transition as EpochTransition};
|
||||
pub use types::engines::epoch;
|
||||
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
@@ -45,24 +44,21 @@ use builtin::Builtin;
|
||||
use vm::{EnvInfo, Schedule, CreateContractAddress, CallType, ActionValue};
|
||||
use error::Error;
|
||||
use types::BlockNumber;
|
||||
use types::header::{Header, ExtendedHeader};
|
||||
use types::header::Header;
|
||||
use snapshot::SnapshotComponents;
|
||||
use spec::CommonParams;
|
||||
use types::transaction::{self, UnverifiedTransaction, SignedTransaction};
|
||||
|
||||
use ethkey::{Signature};
|
||||
use machine::{self, Machine, AuxiliaryRequest, AuxiliaryData};
|
||||
use ethereum_types::{H64, H256, U256, Address};
|
||||
use parity_machine::{Machine, LocalizedMachine as Localized, TotalScoredHeader};
|
||||
use ethereum_types::{H256, U256, Address};
|
||||
use unexpected::{Mismatch, OutOfBounds};
|
||||
use bytes::Bytes;
|
||||
use types::ancestry_action::AncestryAction;
|
||||
use block::ExecutedBlock;
|
||||
|
||||
/// Default EIP-210 contract code.
|
||||
/// As defined in https://github.com/ethereum/EIPs/pull/210
|
||||
pub const DEFAULT_BLOCKHASH_CONTRACT: &'static str = "73fffffffffffffffffffffffffffffffffffffffe33141561006a5760014303600035610100820755610100810715156100455760003561010061010083050761010001555b6201000081071515610064576000356101006201000083050761020001555b5061013e565b4360003512151561008457600060405260206040f361013d565b61010060003543031315156100a857610100600035075460605260206060f361013c565b6101006000350715156100c55762010000600035430313156100c8565b60005b156100ea576101006101006000350507610100015460805260206080f361013b565b620100006000350715156101095763010000006000354303131561010c565b60005b1561012f57610100620100006000350507610200015460a052602060a0f361013a565b600060c052602060c0f35b5b5b5b5b";
|
||||
/// The number of generations back that uncles can be.
|
||||
pub const MAX_UNCLE_AGE: usize = 6;
|
||||
|
||||
/// Voting errors.
|
||||
#[derive(Debug)]
|
||||
@@ -87,45 +83,12 @@ pub enum EngineError {
|
||||
RequiresClient,
|
||||
/// Invalid engine specification or implementation.
|
||||
InvalidEngine,
|
||||
/// Requires signer ref, but none registered.
|
||||
RequiresSigner,
|
||||
/// Checkpoint is missing
|
||||
CliqueMissingCheckpoint(H256),
|
||||
/// Missing vanity data
|
||||
CliqueMissingVanity,
|
||||
/// Missing signature
|
||||
CliqueMissingSignature,
|
||||
/// Missing signers
|
||||
CliqueCheckpointNoSigner,
|
||||
/// List of signers is invalid
|
||||
CliqueCheckpointInvalidSigners(usize),
|
||||
/// Wrong author on a checkpoint
|
||||
CliqueWrongAuthorCheckpoint(Mismatch<Address>),
|
||||
/// Wrong checkpoint authors recovered
|
||||
CliqueFaultyRecoveredSigners(Vec<String>),
|
||||
/// Invalid nonce (should contain vote)
|
||||
CliqueInvalidNonce(H64),
|
||||
/// The signer signed a block to recently
|
||||
CliqueTooRecentlySigned(Address),
|
||||
/// Custom
|
||||
Custom(String),
|
||||
}
|
||||
|
||||
impl fmt::Display for EngineError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
use self::EngineError::*;
|
||||
let msg = match *self {
|
||||
CliqueMissingCheckpoint(ref hash) => format!("Missing checkpoint block: {}", hash),
|
||||
CliqueMissingVanity => format!("Extra data is missing vanity data"),
|
||||
CliqueMissingSignature => format!("Extra data is missing signature"),
|
||||
CliqueCheckpointInvalidSigners(len) => format!("Checkpoint block list was of length: {} of checkpoint but
|
||||
it needs to be bigger than zero and a divisible by 20", len),
|
||||
CliqueCheckpointNoSigner => format!("Checkpoint block list of signers was empty"),
|
||||
CliqueInvalidNonce(ref mis) => format!("Unexpected nonce {} expected {} or {}", mis, 0_u64, u64::max_value()),
|
||||
CliqueWrongAuthorCheckpoint(ref oob) => format!("Unexpected checkpoint author: {}", oob),
|
||||
CliqueFaultyRecoveredSigners(ref mis) => format!("Faulty recovered signers {:?}", mis),
|
||||
CliqueTooRecentlySigned(ref address) => format!("The signer: {} has signed a block too recently", address),
|
||||
Custom(ref s) => s.clone(),
|
||||
DoubleVote(ref address) => format!("Author {} issued too many blocks.", address),
|
||||
NotProposer(ref mis) => format!("Author is not a current proposer: {}", mis),
|
||||
NotAuthorized(ref address) => format!("Signer {} is not authorized.", address),
|
||||
@@ -135,7 +98,6 @@ impl fmt::Display for EngineError {
|
||||
FailedSystemCall(ref msg) => format!("Failed to make system call: {}", msg),
|
||||
MalformedMessage(ref msg) => format!("Received malformed consensus message: {}", msg),
|
||||
RequiresClient => format!("Call requires client but none registered"),
|
||||
RequiresSigner => format!("Call requires signer but none registered"),
|
||||
InvalidEngine => format!("Invalid engine specification or implementation"),
|
||||
};
|
||||
|
||||
@@ -156,7 +118,7 @@ pub enum Seal {
|
||||
Proposal(Vec<Bytes>),
|
||||
/// Regular block seal; should be part of the blockchain.
|
||||
Regular(Vec<Bytes>),
|
||||
/// Engine does not generate seal for this block right now.
|
||||
/// Engine does generate seal for this block right now.
|
||||
None,
|
||||
}
|
||||
|
||||
@@ -214,7 +176,8 @@ pub type PendingTransitionStore<'a> = Fn(H256) -> Option<epoch::PendingTransitio
|
||||
/// Proof dependent on state.
|
||||
pub trait StateDependentProof<M: Machine>: Send + Sync {
|
||||
/// Generate a proof, given the state.
|
||||
fn generate_proof<'a>(&self, state: &machine::Call) -> Result<Vec<u8>, String>;
|
||||
// TODO: make this into an &M::StateContext
|
||||
fn generate_proof<'a>(&self, state: &<M as Localized<'a>>::StateContext) -> Result<Vec<u8>, String>;
|
||||
/// Check a proof generated elsewhere (potentially by a peer).
|
||||
// `engine` needed to check state proofs, while really this should
|
||||
// just be state machine params.
|
||||
@@ -254,7 +217,7 @@ impl<'a, M: Machine> ConstructedVerifier<'a, M> {
|
||||
/// Results of a query of whether an epoch change occurred at the given block.
|
||||
pub enum EpochChange<M: Machine> {
|
||||
/// Cannot determine until more data is passed.
|
||||
Unsure(AuxiliaryRequest),
|
||||
Unsure(M::AuxiliaryRequest),
|
||||
/// No epoch change.
|
||||
No,
|
||||
/// The epoch will change, with proof.
|
||||
@@ -272,14 +235,17 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
fn machine(&self) -> &M;
|
||||
|
||||
/// The number of additional header fields required for this engine.
|
||||
fn seal_fields(&self, _header: &Header) -> usize { 0 }
|
||||
fn seal_fields(&self, _header: &M::Header) -> usize { 0 }
|
||||
|
||||
/// Additional engine-specific information for the user/developer concerning `header`.
|
||||
fn extra_info(&self, _header: &Header) -> BTreeMap<String, String> { BTreeMap::new() }
|
||||
fn extra_info(&self, _header: &M::Header) -> BTreeMap<String, String> { BTreeMap::new() }
|
||||
|
||||
/// Maximum number of uncles a block is allowed to declare.
|
||||
fn maximum_uncle_count(&self, _block: BlockNumber) -> usize { 0 }
|
||||
|
||||
/// The number of generations back that uncles can be.
|
||||
fn maximum_uncle_age(&self) -> usize { 6 }
|
||||
|
||||
/// Optional maximum gas limit.
|
||||
fn maximum_gas_limit(&self) -> Option<U256> { None }
|
||||
|
||||
@@ -287,21 +253,18 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
/// `epoch_begin` set to true if this block kicks off an epoch.
|
||||
fn on_new_block(
|
||||
&self,
|
||||
_block: &mut ExecutedBlock,
|
||||
_block: &mut M::LiveBlock,
|
||||
_epoch_begin: bool,
|
||||
_ancestry: &mut Iterator<Item = ExtendedHeader>,
|
||||
_ancestry: &mut Iterator<Item=M::ExtendedHeader>,
|
||||
) -> Result<(), M::Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Block transformation functions, after the transactions.
|
||||
fn on_close_block(&self, _block: &mut ExecutedBlock) -> Result<(), M::Error> {
|
||||
fn on_close_block(&self, _block: &mut M::LiveBlock) -> Result<(), M::Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Allow mutating the header during seal generation. Currently only used by Clique.
|
||||
fn on_seal_block(&self, _block: &mut ExecutedBlock) -> Result<(), Error> { Ok(()) }
|
||||
|
||||
/// None means that it requires external input (e.g. PoW) to seal a block.
|
||||
/// Some(true) means the engine is currently prime for seal generation (i.e. node is the current validator).
|
||||
/// Some(false) means that the node might seal internally but is not qualified now.
|
||||
@@ -316,7 +279,7 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
///
|
||||
/// It is fine to require access to state or a full client for this function, since
|
||||
/// light clients do not generate seals.
|
||||
fn generate_seal(&self, _block: &ExecutedBlock, _parent: &Header) -> Seal { Seal::None }
|
||||
fn generate_seal(&self, _block: &M::LiveBlock, _parent: &M::Header) -> Seal { Seal::None }
|
||||
|
||||
/// Verify a locally-generated seal of a header.
|
||||
///
|
||||
@@ -328,25 +291,25 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
///
|
||||
/// It is fine to require access to state or a full client for this function, since
|
||||
/// light clients do not generate seals.
|
||||
fn verify_local_seal(&self, header: &Header) -> Result<(), M::Error>;
|
||||
fn verify_local_seal(&self, header: &M::Header) -> Result<(), M::Error>;
|
||||
|
||||
/// Phase 1 quick block verification. Only does checks that are cheap. Returns either a null `Ok` or a general error detailing the problem with import.
|
||||
/// The verification module can optionally avoid checking the seal (`check_seal`), if seal verification is disabled this method won't be called.
|
||||
fn verify_block_basic(&self, _header: &Header) -> Result<(), M::Error> { Ok(()) }
|
||||
fn verify_block_basic(&self, _header: &M::Header) -> Result<(), M::Error> { Ok(()) }
|
||||
|
||||
/// Phase 2 verification. Perform costly checks such as transaction signatures. Returns either a null `Ok` or a general error detailing the problem with import.
|
||||
/// The verification module can optionally avoid checking the seal (`check_seal`), if seal verification is disabled this method won't be called.
|
||||
fn verify_block_unordered(&self, _header: &Header) -> Result<(), M::Error> { Ok(()) }
|
||||
fn verify_block_unordered(&self, _header: &M::Header) -> Result<(), M::Error> { Ok(()) }
|
||||
|
||||
/// Phase 3 verification. Check block information against parent. Returns either a null `Ok` or a general error detailing the problem with import.
|
||||
fn verify_block_family(&self, _header: &Header, _parent: &Header) -> Result<(), M::Error> { Ok(()) }
|
||||
fn verify_block_family(&self, _header: &M::Header, _parent: &M::Header) -> Result<(), M::Error> { Ok(()) }
|
||||
|
||||
/// Phase 4 verification. Verify block header against potentially external data.
|
||||
/// Should only be called when `register_client` has been called previously.
|
||||
fn verify_block_external(&self, _header: &Header) -> Result<(), M::Error> { Ok(()) }
|
||||
fn verify_block_external(&self, _header: &M::Header) -> Result<(), M::Error> { Ok(()) }
|
||||
|
||||
/// Genesis epoch data.
|
||||
fn genesis_epoch_data<'a>(&self, _header: &Header, _state: &machine::Call) -> Result<Vec<u8>, String> { Ok(Vec::new()) }
|
||||
fn genesis_epoch_data<'a>(&self, _header: &M::Header, _state: &<M as Localized<'a>>::StateContext) -> Result<Vec<u8>, String> { Ok(Vec::new()) }
|
||||
|
||||
/// Whether an epoch change is signalled at the given header but will require finality.
|
||||
/// If a change can be enacted immediately then return `No` from this function but
|
||||
@@ -357,7 +320,7 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
/// Return `Yes` or `No` when the answer is definitively known.
|
||||
///
|
||||
/// Should not interact with state.
|
||||
fn signals_epoch_end<'a>(&self, _header: &Header, _aux: AuxiliaryData<'a>)
|
||||
fn signals_epoch_end<'a>(&self, _header: &M::Header, _aux: <M as Localized<'a>>::AuxiliaryData)
|
||||
-> EpochChange<M>
|
||||
{
|
||||
EpochChange::No
|
||||
@@ -373,9 +336,9 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
/// Return optional transition proof.
|
||||
fn is_epoch_end(
|
||||
&self,
|
||||
_chain_head: &Header,
|
||||
_chain_head: &M::Header,
|
||||
_finalized: &[H256],
|
||||
_chain: &Headers<Header>,
|
||||
_chain: &Headers<M::Header>,
|
||||
_transition_store: &PendingTransitionStore,
|
||||
) -> Option<Vec<u8>> {
|
||||
None
|
||||
@@ -392,8 +355,8 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
/// Return optional transition proof.
|
||||
fn is_epoch_end_light(
|
||||
&self,
|
||||
_chain_head: &Header,
|
||||
_chain: &Headers<Header>,
|
||||
_chain_head: &M::Header,
|
||||
_chain: &Headers<M::Header>,
|
||||
_transition_store: &PendingTransitionStore,
|
||||
) -> Option<Vec<u8>> {
|
||||
None
|
||||
@@ -401,18 +364,22 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
|
||||
/// Create an epoch verifier from validation proof and a flag indicating
|
||||
/// whether finality is required.
|
||||
fn epoch_verifier<'a>(&self, _header: &Header, _proof: &'a [u8]) -> ConstructedVerifier<'a, M> {
|
||||
ConstructedVerifier::Trusted(Box::new(NoOp))
|
||||
fn epoch_verifier<'a>(&self, _header: &M::Header, _proof: &'a [u8]) -> ConstructedVerifier<'a, M> {
|
||||
ConstructedVerifier::Trusted(Box::new(self::epoch::NoOp))
|
||||
}
|
||||
|
||||
/// Populate a header's fields based on its parent's header.
|
||||
/// Usually implements the chain scoring rule based on weight.
|
||||
fn populate_from_parent(&self, _header: &mut Header, _parent: &Header) { }
|
||||
fn populate_from_parent(&self, _header: &mut M::Header, _parent: &M::Header) { }
|
||||
|
||||
/// Handle any potential consensus messages;
|
||||
/// updating consensus state and potentially issuing a new one.
|
||||
fn handle_message(&self, _message: &[u8]) -> Result<(), EngineError> { Err(EngineError::UnexpectedMessage) }
|
||||
|
||||
/// Find out if the block is a proposal block and should not be inserted into the DB.
|
||||
/// Takes a header of a fully verified block.
|
||||
fn is_proposal(&self, _verified_header: &M::Header) -> bool { false }
|
||||
|
||||
/// Register a component which signs consensus messages.
|
||||
fn set_signer(&self, _signer: Box<EngineSigner>) {}
|
||||
|
||||
@@ -426,7 +393,7 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
fn step(&self) {}
|
||||
|
||||
/// Stops any services that the may hold the Engine and makes it safe to drop.
|
||||
fn stop(&mut self) {}
|
||||
fn stop(&self) {}
|
||||
|
||||
/// Create a factory for building snapshot chunks and restoring from them.
|
||||
/// Returning `None` indicates that this engine doesn't support snapshot creation.
|
||||
@@ -454,21 +421,16 @@ pub trait Engine<M: Machine>: Sync + Send {
|
||||
|
||||
/// Gather all ancestry actions. Called at the last stage when a block is committed. The Engine must guarantee that
|
||||
/// the ancestry exists.
|
||||
fn ancestry_actions(&self, _header: &Header, _ancestry: &mut Iterator<Item = ExtendedHeader>) -> Vec<AncestryAction> {
|
||||
fn ancestry_actions(&self, _header: &M::Header, _ancestry: &mut Iterator<Item=M::ExtendedHeader>) -> Vec<AncestryAction> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
/// Check whether the given new block is the best block, after finalization check.
|
||||
fn fork_choice(&self, new: &ExtendedHeader, best: &ExtendedHeader) -> ForkChoice;
|
||||
|
||||
/// Returns author should used when executing tx's for this block.
|
||||
fn executive_author(&self, header: &Header) -> Result<Address, Error> {
|
||||
Ok(*header.author())
|
||||
}
|
||||
fn fork_choice(&self, new: &M::ExtendedHeader, best: &M::ExtendedHeader) -> ForkChoice;
|
||||
}
|
||||
|
||||
/// Check whether a given block is the best block based on the default total difficulty rule.
|
||||
pub fn total_difficulty_fork_choice(new: &ExtendedHeader, best: &ExtendedHeader) -> ForkChoice {
|
||||
pub fn total_difficulty_fork_choice<T: TotalScoredHeader>(new: &T, best: &T) -> ForkChoice where <T as TotalScoredHeader>::Value: Ord {
|
||||
if new.total_score() > best.total_score() {
|
||||
ForkChoice::New
|
||||
} else {
|
||||
@@ -561,29 +523,3 @@ pub trait EthEngine: Engine<::machine::EthereumMachine> {
|
||||
|
||||
// convenience wrappers for existing functions.
|
||||
impl<T> EthEngine for T where T: Engine<::machine::EthereumMachine> { }
|
||||
|
||||
/// Verifier for all blocks within an epoch with self-contained state.
|
||||
pub trait EpochVerifier<M: machine::Machine>: Send + Sync {
|
||||
/// Lightly verify the next block header.
|
||||
/// This may not be a header belonging to a different epoch.
|
||||
fn verify_light(&self, header: &Header) -> Result<(), M::Error>;
|
||||
|
||||
/// Perform potentially heavier checks on the next block header.
|
||||
fn verify_heavy(&self, header: &Header) -> Result<(), M::Error> {
|
||||
self.verify_light(header)
|
||||
}
|
||||
|
||||
/// Check a finality proof against this epoch verifier.
|
||||
/// Returns `Some(hashes)` if the proof proves finality of these hashes.
|
||||
/// Returns `None` if the proof doesn't prove anything.
|
||||
fn check_finality_proof(&self, _proof: &[u8]) -> Option<Vec<H256>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Special "no-op" verifier for stateless, epoch-less engines.
|
||||
pub struct NoOp;
|
||||
|
||||
impl<M: machine::Machine> EpochVerifier<M> for NoOp {
|
||||
fn verify_light(&self, _header: &Header) -> Result<(), M::Error> { Ok(()) }
|
||||
}
|
||||
|
||||
@@ -17,10 +17,9 @@
|
||||
use engines::Engine;
|
||||
use engines::block_reward::{self, RewardKind};
|
||||
use ethereum_types::U256;
|
||||
use machine::Machine;
|
||||
use machine::WithRewards;
|
||||
use parity_machine::{Machine, Header, LiveBlock, TotalScoredHeader};
|
||||
use types::BlockNumber;
|
||||
use types::header::{Header, ExtendedHeader};
|
||||
use block::ExecutedBlock;
|
||||
|
||||
/// Params for a null engine.
|
||||
#[derive(Clone, Default)]
|
||||
@@ -59,23 +58,26 @@ impl<M: Default> Default for NullEngine<M> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<M: Machine> Engine<M> for NullEngine<M> {
|
||||
impl<M: Machine + WithRewards> Engine<M> for NullEngine<M>
|
||||
where M::ExtendedHeader: TotalScoredHeader,
|
||||
<M::ExtendedHeader as TotalScoredHeader>::Value: Ord
|
||||
{
|
||||
fn name(&self) -> &str {
|
||||
"NullEngine"
|
||||
}
|
||||
|
||||
fn machine(&self) -> &M { &self.machine }
|
||||
|
||||
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), M::Error> {
|
||||
fn on_close_block(&self, block: &mut M::LiveBlock) -> Result<(), M::Error> {
|
||||
use std::ops::Shr;
|
||||
|
||||
let author = *block.header.author();
|
||||
let number = block.header.number();
|
||||
let author = *LiveBlock::header(&*block).author();
|
||||
let number = LiveBlock::header(&*block).number();
|
||||
|
||||
let reward = self.params.block_reward;
|
||||
if reward == U256::zero() { return Ok(()) }
|
||||
|
||||
let n_uncles = block.uncles.len();
|
||||
let n_uncles = LiveBlock::uncles(&*block).len();
|
||||
|
||||
let mut rewards = Vec::new();
|
||||
|
||||
@@ -84,7 +86,7 @@ impl<M: Machine> Engine<M> for NullEngine<M> {
|
||||
rewards.push((author, RewardKind::Author, result_block_reward));
|
||||
|
||||
// bestow uncle rewards.
|
||||
for u in &block.uncles {
|
||||
for u in LiveBlock::uncles(&*block) {
|
||||
let uncle_author = u.author();
|
||||
let result_uncle_reward = (reward * U256::from(8 + u.number() - number)).shr(3);
|
||||
rewards.push((*uncle_author, RewardKind::uncle(number, u.number()), result_uncle_reward));
|
||||
@@ -95,7 +97,7 @@ impl<M: Machine> Engine<M> for NullEngine<M> {
|
||||
|
||||
fn maximum_uncle_count(&self, _block: BlockNumber) -> usize { 2 }
|
||||
|
||||
fn verify_local_seal(&self, _header: &Header) -> Result<(), M::Error> {
|
||||
fn verify_local_seal(&self, _header: &M::Header) -> Result<(), M::Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -103,7 +105,7 @@ impl<M: Machine> Engine<M> for NullEngine<M> {
|
||||
Some(Box::new(::snapshot::PowSnapshot::new(10000, 10000)))
|
||||
}
|
||||
|
||||
fn fork_choice(&self, new: &ExtendedHeader, current: &ExtendedHeader) -> super::ForkChoice {
|
||||
fn fork_choice(&self, new: &M::ExtendedHeader, current: &M::ExtendedHeader) -> super::ForkChoice {
|
||||
super::total_difficulty_fork_choice(new, current)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ impl Multi {
|
||||
impl ValidatorSet for Multi {
|
||||
fn default_caller(&self, block_id: BlockId) -> Box<Call> {
|
||||
self.correct_set(block_id).map(|set| set.default_caller(block_id))
|
||||
.unwrap_or_else(|| Box::new(|_, _| Err("No validator set for given ID.".into())))
|
||||
.unwrap_or(Box::new(|_, _| Err("No validator set for given ID.".into())))
|
||||
}
|
||||
|
||||
fn on_epoch_begin(&self, _first: bool, header: &Header, call: &mut SystemCall) -> Result<(), ::error::Error> {
|
||||
@@ -141,7 +141,7 @@ impl ValidatorSet for Multi {
|
||||
*self.block_number.write() = Box::new(move |id| client
|
||||
.upgrade()
|
||||
.ok_or_else(|| "No client!".into())
|
||||
.and_then(|c| c.block_number(id).ok_or_else(|| "Unknown block".into())));
|
||||
.and_then(|c| c.block_number(id).ok_or("Unknown block".into())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
|
||||
//! General error types for use in ethcore.
|
||||
|
||||
// Silence: `use of deprecated item 'std::error::Error::cause': replaced by Error::source, which can support downcasting`
|
||||
// https://github.com/paritytech/parity-ethereum/issues/10302
|
||||
#![allow(deprecated)]
|
||||
|
||||
use std::{fmt, error};
|
||||
use std::time::SystemTime;
|
||||
|
||||
@@ -37,7 +33,7 @@ use engines::EngineError;
|
||||
|
||||
pub use executed::{ExecutionError, CallError};
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Eq)]
|
||||
#[derive(Debug, PartialEq, Clone, Copy, Eq)]
|
||||
/// Errors concerning block processing.
|
||||
pub enum BlockError {
|
||||
/// Block has too many uncles.
|
||||
@@ -88,7 +84,7 @@ pub enum BlockError {
|
||||
/// Timestamp header field is too far in future.
|
||||
TemporarilyInvalid(OutOfBounds<SystemTime>),
|
||||
/// Log bloom header field is invalid.
|
||||
InvalidLogBloom(Box<Mismatch<Bloom>>),
|
||||
InvalidLogBloom(Mismatch<Bloom>),
|
||||
/// Number field of header is invalid.
|
||||
InvalidNumber(Mismatch<BlockNumber>),
|
||||
/// Block number isn't sensible.
|
||||
|
||||
@@ -241,16 +241,17 @@ impl Engine<EthereumMachine> for Arc<Ethash> {
|
||||
/// This assumes that all uncles are valid uncles (i.e. of at least one generation before the current).
|
||||
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error> {
|
||||
use std::ops::Shr;
|
||||
use parity_machine::LiveBlock;
|
||||
|
||||
let author = *block.header.author();
|
||||
let number = block.header.number();
|
||||
let author = *LiveBlock::header(&*block).author();
|
||||
let number = LiveBlock::header(&*block).number();
|
||||
|
||||
let rewards = match self.ethash_params.block_reward_contract {
|
||||
Some(ref c) if number >= self.ethash_params.block_reward_contract_transition => {
|
||||
let mut beneficiaries = Vec::new();
|
||||
|
||||
beneficiaries.push((author, RewardKind::Author));
|
||||
for u in &block.uncles {
|
||||
for u in LiveBlock::uncles(&*block) {
|
||||
let uncle_author = u.author();
|
||||
beneficiaries.push((*uncle_author, RewardKind::uncle(number, u.number())));
|
||||
}
|
||||
@@ -273,8 +274,7 @@ impl Engine<EthereumMachine> for Arc<Ethash> {
|
||||
let eras_rounds = self.ethash_params.ecip1017_era_rounds;
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, reward, number);
|
||||
|
||||
//let n_uncles = LiveBlock::uncles(&*block).len();
|
||||
let n_uncles = block.uncles.len();
|
||||
let n_uncles = LiveBlock::uncles(&*block).len();
|
||||
|
||||
// Bestow block rewards.
|
||||
let mut result_block_reward = reward + reward.shr(5) * U256::from(n_uncles);
|
||||
@@ -282,7 +282,7 @@ impl Engine<EthereumMachine> for Arc<Ethash> {
|
||||
rewards.push((author, RewardKind::Author, result_block_reward));
|
||||
|
||||
// Bestow uncle rewards.
|
||||
for u in &block.uncles {
|
||||
for u in LiveBlock::uncles(&*block) {
|
||||
let uncle_author = u.author();
|
||||
let result_uncle_reward = if eras == 0 {
|
||||
(reward * U256::from(8 + u.number() - number)).shr(3)
|
||||
@@ -540,9 +540,9 @@ mod tests {
|
||||
let genesis_header = spec.genesis_header();
|
||||
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b = b.close().unwrap();
|
||||
assert_eq!(b.state.balance(&Address::zero()).unwrap(), U256::from_str("4563918244f40000").unwrap());
|
||||
assert_eq!(b.state().balance(&Address::zero()).unwrap(), U256::from_str("4563918244f40000").unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -589,15 +589,15 @@ mod tests {
|
||||
let genesis_header = spec.genesis_header();
|
||||
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
let mut b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let mut b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let mut uncle = Header::new();
|
||||
let uncle_author: Address = "ef2d6d194084c2de36e0dabfce45d046b37d1106".into();
|
||||
uncle.set_author(uncle_author);
|
||||
b.push_uncle(uncle).unwrap();
|
||||
|
||||
let b = b.close().unwrap();
|
||||
assert_eq!(b.state.balance(&Address::zero()).unwrap(), "478eae0e571ba000".into());
|
||||
assert_eq!(b.state.balance(&uncle_author).unwrap(), "3cb71f51fc558000".into());
|
||||
assert_eq!(b.state().balance(&Address::zero()).unwrap(), "478eae0e571ba000".into());
|
||||
assert_eq!(b.state().balance(&uncle_author).unwrap(), "3cb71f51fc558000".into());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -607,14 +607,14 @@ mod tests {
|
||||
let genesis_header = spec.genesis_header();
|
||||
let db = spec.ensure_db_good(get_temp_state_db(), &Default::default()).unwrap();
|
||||
let last_hashes = Arc::new(vec![genesis_header.hash()]);
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, None).unwrap();
|
||||
let b = OpenBlock::new(engine, Default::default(), false, db, &genesis_header, last_hashes, Address::zero(), (3141562.into(), 31415620.into()), vec![], false, &mut Vec::new().into_iter()).unwrap();
|
||||
let b = b.close().unwrap();
|
||||
|
||||
let ubi_contract: Address = "00efdd5883ec628983e9063c7d969fe268bbf310".into();
|
||||
let dev_contract: Address = "00756cf8159095948496617f5fb17ed95059f536".into();
|
||||
assert_eq!(b.state.balance(&Address::zero()).unwrap(), U256::from_str("d8d726b7177a80000").unwrap());
|
||||
assert_eq!(b.state.balance(&ubi_contract).unwrap(), U256::from_str("2b5e3af16b1880000").unwrap());
|
||||
assert_eq!(b.state.balance(&dev_contract).unwrap(), U256::from_str("c249fdd327780000").unwrap());
|
||||
assert_eq!(b.state().balance(&Address::zero()).unwrap(), U256::from_str("d8d726b7177a80000").unwrap());
|
||||
assert_eq!(b.state().balance(&ubi_contract).unwrap(), U256::from_str("2b5e3af16b1880000").unwrap());
|
||||
assert_eq!(b.state().balance(&dev_contract).unwrap(), U256::from_str("c249fdd327780000").unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -57,19 +57,9 @@ pub fn new_poanet<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/poacore.json"))
|
||||
}
|
||||
|
||||
/// Create a new xDai chain spec.
|
||||
pub fn new_xdai<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/xdai.json"))
|
||||
}
|
||||
|
||||
/// Create a new Volta mainnet chain spec.
|
||||
pub fn new_volta<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/volta.json"))
|
||||
}
|
||||
|
||||
/// Create a new EWC mainnet chain spec.
|
||||
pub fn new_ewc<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/ewc.json"))
|
||||
/// Create a new Tobalaba mainnet chain spec.
|
||||
pub fn new_tobalaba<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/tobalaba.json"))
|
||||
}
|
||||
|
||||
/// Create a new Expanse mainnet chain spec.
|
||||
@@ -94,11 +84,6 @@ pub fn new_mix<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/mix.json"))
|
||||
}
|
||||
|
||||
/// Create a new Callisto chain spec
|
||||
pub fn new_callisto<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/callisto.json"))
|
||||
}
|
||||
|
||||
/// Create a new Morden testnet chain spec.
|
||||
pub fn new_morden<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/morden.json"))
|
||||
@@ -114,26 +99,16 @@ pub fn new_kovan<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/kovan.json"))
|
||||
}
|
||||
|
||||
/// Create a new Rinkeby testnet chain spec.
|
||||
pub fn new_rinkeby<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/rinkeby.json"))
|
||||
}
|
||||
|
||||
/// Create a new Görli testnet chain spec.
|
||||
pub fn new_goerli<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/goerli.json"))
|
||||
}
|
||||
|
||||
/// Create a new Kotti testnet chain spec.
|
||||
pub fn new_kotti<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/kotti.json"))
|
||||
}
|
||||
|
||||
/// Create a new POA Sokol testnet chain spec.
|
||||
pub fn new_sokol<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/poasokol.json"))
|
||||
}
|
||||
|
||||
/// Create a new Callisto chaun spec
|
||||
pub fn new_callisto<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
|
||||
load(params.into(), include_bytes!("../../res/ethereum/callisto.json"))
|
||||
}
|
||||
|
||||
// For tests
|
||||
|
||||
/// Create a new Foundation Frontier-era chain spec as though it never changes to Homestead.
|
||||
|
||||
@@ -167,7 +167,7 @@ pub enum CallError {
|
||||
/// Couldn't find requested block's state in the chain.
|
||||
StatePruned,
|
||||
/// Couldn't find an amount of gas that didn't result in an exception.
|
||||
Exceptional(vm::Error),
|
||||
Exceptional,
|
||||
/// Corrupt state.
|
||||
StateCorrupt,
|
||||
/// Error executing.
|
||||
@@ -187,7 +187,7 @@ impl fmt::Display for CallError {
|
||||
let msg = match *self {
|
||||
TransactionNotFound => "Transaction couldn't be found in the chain".into(),
|
||||
StatePruned => "Couldn't find the transaction block's state in the chain".into(),
|
||||
Exceptional(ref e) => format!("An exception ({}) happened in the execution", e),
|
||||
Exceptional => "An exception happened in the execution".into(),
|
||||
StateCorrupt => "Stored state found to be corrupted.".into(),
|
||||
Execution(ref e) => format!("{}", e),
|
||||
};
|
||||
@@ -197,4 +197,4 @@ impl fmt::Display for CallError {
|
||||
}
|
||||
|
||||
/// Transaction execution result.
|
||||
pub type ExecutionResult = Result<Box<Executed>, ExecutionError>;
|
||||
pub type ExecutionResult = Result<Executed, ExecutionError>;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user