Merge branch 'master' into secretstore_stresstest
This commit is contained in:
commit
9b34c77f98
12
.github/ISSUE_TEMPLATE.md
vendored
Normal file
12
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
_Before filing a new issue, please **provide the following information**._
|
||||
|
||||
> I'm running:
|
||||
>
|
||||
> - **Parity version**: 0.0.0
|
||||
> - **Operating system**: Windows / MacOS / Linux
|
||||
> - **And installed**: via installer / homebrew / binaries / from source
|
||||
|
||||
_Your issue description goes here below. Try to include **actual** vs. **expected behavior** and **steps to reproduce** the issue._
|
||||
|
||||
---
|
||||
|
@ -561,11 +561,9 @@ docker-build:
|
||||
- docker info
|
||||
script:
|
||||
- if [ "$CI_BUILD_REF_NAME" == "beta-release" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi
|
||||
- docker login -u $Docker_Hub_User -p $Docker_Hub_Pass
|
||||
- sh scripts/docker-build.sh $DOCKER_TAG ethcore
|
||||
- docker logout
|
||||
- echo "Tag:" $DOCKER_TAG
|
||||
- docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity
|
||||
- sh scripts/docker-build.sh $DOCKER_TAG parity
|
||||
- sh scripts/docker-build.sh $DOCKER_TAG
|
||||
- docker logout
|
||||
tags:
|
||||
- docker
|
||||
@ -613,11 +611,12 @@ test-rust-stable:
|
||||
image: parity/rust:gitlab-ci
|
||||
before_script:
|
||||
- git submodule update --init --recursive
|
||||
- export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^appveyor.yml -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l)
|
||||
- export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l)
|
||||
script:
|
||||
- rustup show
|
||||
- export RUST_BACKTRACE=1
|
||||
- if [ $RUST_FILES_MODIFIED -eq 0 ]; then echo "Skipping Rust tests since no Rust files modified."; else ./test.sh $CARGOFLAGS; fi
|
||||
- if [ "$CI_BUILD_REF_NAME" == "nightly" ]; then sh scripts/aura-test.sh; fi
|
||||
tags:
|
||||
- rust
|
||||
- rust-stable
|
||||
|
486
CHANGELOG.md
486
CHANGELOG.md
@ -1,3 +1,489 @@
|
||||
## Parity [v1.7.0](https://github.com/paritytech/parity/releases/tag/v1.7.0) (2017-07-28)
|
||||
|
||||
Parity 1.7.0 is a major release introducing several important features:
|
||||
|
||||
- **Experimental [Light client](https://github.com/paritytech/parity/wiki/The-Parity-Light-Protocol-(PIP)) support**. Start Parity with `--light` to enable light mode. Please, note: The wallet UI integration for the light client is not included, yet.
|
||||
- **Experimental web wallet**. A hosted version of Parity that keeps the keys and signs transactions using your browser storage. Try it at https://wallet.parity.io or run your own with `--public-node`.
|
||||
- **WASM contract support**. Private networks can run contracts compiled into WASM bytecode. _More information and documentation to follow_.
|
||||
- **DApps and RPC server merge**. DApp and RPC are now available through a single API endpoint. DApp server related settings are deprecated.
|
||||
- **Export accounts from the wallet**. Backing up your keys can now simply be managed through the wallet interface.
|
||||
- **PoA/Kovan validator set contract**. The PoA network validator-set management via smart contract is now supported by warp and, in the near future, light sync.
|
||||
- **PubSub API**. https://github.com/paritytech/parity/wiki/JSONRPC-Parity-Pub-Sub-module
|
||||
- **Signer apps for IOS and Android**.
|
||||
|
||||
Full list of included changes:
|
||||
|
||||
- Backports [#6163](https://github.com/paritytech/parity/pull/6163)
|
||||
- Light client improvements ([#6156](https://github.com/paritytech/parity/pull/6156))
|
||||
- No seal checking
|
||||
- Import command and --no-seal-check for light client
|
||||
- Fix eth_call
|
||||
- Tweak registry dapps lookup
|
||||
- Ignore failed requests to non-server peers
|
||||
- Fix connecting to wildcard addresses. ([#6167](https://github.com/paritytech/parity/pull/6167))
|
||||
- Don't display an overlay in case the time sync check fails. ([#6164](https://github.com/paritytech/parity/pull/6164))
|
||||
- Small improvements to time estimation.
|
||||
- Temporarily disable NTP time check by default.
|
||||
- Light client fixes ([#6148](https://github.com/paritytech/parity/pull/6148)) [#6151](https://github.com/paritytech/parity/pull/6151)
|
||||
- Light client fixes
|
||||
- Fix memory-lru-cache
|
||||
- Clear pending reqs on disconnect
|
||||
- Filter tokens logs from current block, not genesis ([#6128](https://github.com/paritytech/parity/pull/6128)) [#6141](https://github.com/paritytech/parity/pull/6141)
|
||||
- Fix QR scanner returning null on confirm [#6122](https://github.com/paritytech/parity/pull/6122)
|
||||
- Check QR before lowercase ([#6119](https://github.com/paritytech/parity/pull/6119)) [#6120](https://github.com/paritytech/parity/pull/6120)
|
||||
- Remove chunk to restore from pending set only upon successful import [#6117](https://github.com/paritytech/parity/pull/6117)
|
||||
- Fixed node address detection on incoming connection [#6094](https://github.com/paritytech/parity/pull/6094)
|
||||
- Place RETURNDATA behind block number gate [#6095](https://github.com/paritytech/parity/pull/6095)
|
||||
- Update wallet library binaries [#6108](https://github.com/paritytech/parity/pull/6108)
|
||||
- Backported wallet fix [#6105](https://github.com/paritytech/parity/pull/6105)
|
||||
- Fix initialisation bug. ([#6102](https://github.com/paritytech/parity/pull/6102))
|
||||
- Update wallet library modifiers ([#6103](https://github.com/paritytech/parity/pull/6103))
|
||||
- Place RETURNDATA behind block number gate [#6095](https://github.com/paritytech/parity/pull/6095)
|
||||
- Fixed node address detection on incoming connection [#6094](https://github.com/paritytech/parity/pull/6094)
|
||||
- Bump snap version and tweak importing detection logic ([#6079](https://github.com/paritytech/parity/pull/6079)) [#6081](https://github.com/paritytech/parity/pull/6081)
|
||||
- bump last tick just before printing info and restore sync detection
|
||||
- bump kovan snapshot version
|
||||
- Fixed sync tests
|
||||
- Fixed rpc tests
|
||||
- Acquire client report under lock in informant [#6071](https://github.com/paritytech/parity/pull/6071)
|
||||
- Show busy indicator on Address forget [#6069](https://github.com/paritytech/parity/pull/6069)
|
||||
- Add CSP for worker-src ([#6059](https://github.com/paritytech/parity/pull/6059)) [#6064](https://github.com/paritytech/parity/pull/6064)
|
||||
- Specify worker-src seperately, add blob
|
||||
- Upgrade react-qr-scan to latest version
|
||||
- Set release channel to beta
|
||||
- Limit transaction queue memory & limit future queue [#6038](https://github.com/paritytech/parity/pull/6038)
|
||||
- Fix CI build issue [#6050](https://github.com/paritytech/parity/pull/6050)
|
||||
- New contract PoA sync fixes [#5991](https://github.com/paritytech/parity/pull/5991)
|
||||
- Fixed link to Multisig Contract Wallet on master [#5984](https://github.com/paritytech/parity/pull/5984)
|
||||
- Ethcore crate split part 1 [#6041](https://github.com/paritytech/parity/pull/6041)
|
||||
- Fix status icon [#6039](https://github.com/paritytech/parity/pull/6039)
|
||||
- Errors & warnings for inappropriate RPCs [#6029](https://github.com/paritytech/parity/pull/6029)
|
||||
- Add missing CSP for web3.site [#5992](https://github.com/paritytech/parity/pull/5992)
|
||||
- Remove cargo install --git from README.md [#6037](https://github.com/paritytech/parity/pull/6037)
|
||||
- Node Health warnings [#5951](https://github.com/paritytech/parity/pull/5951)
|
||||
- RPC cpu pool [#6023](https://github.com/paritytech/parity/pull/6023)
|
||||
- Use crates.io dependencies for parity-wasm [#6036](https://github.com/paritytech/parity/pull/6036)
|
||||
- Add test for loading the chain specs [#6028](https://github.com/paritytech/parity/pull/6028)
|
||||
- Whitelist APIs for generic Pub-Sub [#5840](https://github.com/paritytech/parity/pull/5840)
|
||||
- WASM contracts MVP [#5679](https://github.com/paritytech/parity/pull/5679)
|
||||
- Fix valid QR scan not advancing [#6033](https://github.com/paritytech/parity/pull/6033)
|
||||
- --reseal-on-uncle [#5940](https://github.com/paritytech/parity/pull/5940)
|
||||
- Support comments in reserved peers file ([#6004](https://github.com/paritytech/parity/pull/6004)) [#6012](https://github.com/paritytech/parity/pull/6012)
|
||||
- Add new md tnc [#5937](https://github.com/paritytech/parity/pull/5937)
|
||||
- Fix output of parity-evm in case of bad instruction [#5955](https://github.com/paritytech/parity/pull/5955)
|
||||
- Don't send notifications to unsubscribed clients of PubSub [#5960](https://github.com/paritytech/parity/pull/5960)
|
||||
- Proper light client informant and more verification of imported headers [#5897](https://github.com/paritytech/parity/pull/5897)
|
||||
- New Kovan bootnodes [#6017](https://github.com/paritytech/parity/pull/6017)
|
||||
- Use standard paths for Ethash cache [#5881](https://github.com/paritytech/parity/pull/5881)
|
||||
- Defer code hash calculation. [#5959](https://github.com/paritytech/parity/pull/5959)
|
||||
- Fix first run wizard. [#6000](https://github.com/paritytech/parity/pull/6000)
|
||||
- migration to serde 1.0 [#5996](https://github.com/paritytech/parity/pull/5996)
|
||||
- SecretStore: generating signatures [#5764](https://github.com/paritytech/parity/pull/5764)
|
||||
- bigint upgraded to version 3.0 [#5986](https://github.com/paritytech/parity/pull/5986)
|
||||
- config: don't allow dev chain with force sealing option [#5965](https://github.com/paritytech/parity/pull/5965)
|
||||
- Update lockfile for miniz-sys and gcc [#5969](https://github.com/paritytech/parity/pull/5969)
|
||||
- Clean up function naming in RPC error module [#5995](https://github.com/paritytech/parity/pull/5995)
|
||||
- Fix underflow in gas calculation [#5975](https://github.com/paritytech/parity/pull/5975)
|
||||
- PubSub for parity-js [#5830](https://github.com/paritytech/parity/pull/5830)
|
||||
- Report whether a peer was kept from `Handler::on_connect` [#5958](https://github.com/paritytech/parity/pull/5958)
|
||||
- Implement skeleton for transaction index and epoch transition proof PIP messages [#5908](https://github.com/paritytech/parity/pull/5908)
|
||||
- TransactionQueue improvements [#5917](https://github.com/paritytech/parity/pull/5917)
|
||||
- constant time HMAC comparison and clarify docs in ethkey [#5952](https://github.com/paritytech/parity/pull/5952)
|
||||
- Avoid pre-computing jump destinations [#5954](https://github.com/paritytech/parity/pull/5954)
|
||||
- Upgrade elastic array [#5949](https://github.com/paritytech/parity/pull/5949)
|
||||
- PoA: Wait for transition finality before applying [#5774](https://github.com/paritytech/parity/pull/5774)
|
||||
- Logs Pub-Sub [#5705](https://github.com/paritytech/parity/pull/5705)
|
||||
- Add the command to install the parity snap [#5945](https://github.com/paritytech/parity/pull/5945)
|
||||
- Reduce unnecessary allocations [#5944](https://github.com/paritytech/parity/pull/5944)
|
||||
- Clarify confusing messages. [#5935](https://github.com/paritytech/parity/pull/5935)
|
||||
- Content Security Policy [#5790](https://github.com/paritytech/parity/pull/5790)
|
||||
- CLI: Export error message and less verbose peer counter. [#5870](https://github.com/paritytech/parity/pull/5870)
|
||||
- network: make it more explicit about StreamToken and TimerToken [#5939](https://github.com/paritytech/parity/pull/5939)
|
||||
- sync: make it more idiomatic rust [#5938](https://github.com/paritytech/parity/pull/5938)
|
||||
- Prioritize accounts over address book [#5909](https://github.com/paritytech/parity/pull/5909)
|
||||
- Fixing failing compilation of RPC test on master. [#5916](https://github.com/paritytech/parity/pull/5916)
|
||||
- Empty local middleware, until explicitly requested [#5912](https://github.com/paritytech/parity/pull/5912)
|
||||
- Cancel propagated TX [#5899](https://github.com/paritytech/parity/pull/5899)
|
||||
- fix minor race condition in aura seal generation [#5910](https://github.com/paritytech/parity/pull/5910)
|
||||
- Docs for Pub-Sub, optional parameter for parity_subscribe [#5833](https://github.com/paritytech/parity/pull/5833)
|
||||
- Fix gas editor doubling-up on gas [#5820](https://github.com/paritytech/parity/pull/5820)
|
||||
- Information about used paths added to general output block [#5904](https://github.com/paritytech/parity/pull/5904)
|
||||
- Domain-locked web tokens. [#5894](https://github.com/paritytech/parity/pull/5894)
|
||||
- Removed panic handlers [#5895](https://github.com/paritytech/parity/pull/5895)
|
||||
- Latest changes from Rust RocksDB binding merged [#5905](https://github.com/paritytech/parity/pull/5905)
|
||||
- Adjust keyethereum/secp256 aliasses [#5903](https://github.com/paritytech/parity/pull/5903)
|
||||
- Keyethereum fs dependency [#5902](https://github.com/paritytech/parity/pull/5902)
|
||||
- Ethereum Classic Monetary Policy [#5741](https://github.com/paritytech/parity/pull/5741)
|
||||
- Initial token should allow full access. [#5873](https://github.com/paritytech/parity/pull/5873)
|
||||
- Fixed account selection for Dapps on public node [#5856](https://github.com/paritytech/parity/pull/5856)
|
||||
- blacklist bad snapshot manifest hashes upon failure [#5874](https://github.com/paritytech/parity/pull/5874)
|
||||
- Fix wrongly called timeouts [#5838](https://github.com/paritytech/parity/pull/5838)
|
||||
- ArchiveDB and other small fixes [#5867](https://github.com/paritytech/parity/pull/5867)
|
||||
- convert try!() to ? [#5866](https://github.com/paritytech/parity/pull/5866)
|
||||
- Make config file optional in systemd [#5847](https://github.com/paritytech/parity/pull/5847)
|
||||
- EIP-116 (214), [#4833](https://github.com/paritytech/parity/issues/4833) [#4851](https://github.com/paritytech/parity/pull/4851)
|
||||
- all executables are workspace members [#5865](https://github.com/paritytech/parity/pull/5865)
|
||||
- minor optimizations of the modexp builtin [#5860](https://github.com/paritytech/parity/pull/5860)
|
||||
- three small commits for HashDB and MemoryDB [#5766](https://github.com/paritytech/parity/pull/5766)
|
||||
- use rust 1.18's retain to boost the purge performance [#5801](https://github.com/paritytech/parity/pull/5801)
|
||||
- Allow IPFS server to accept POST requests [#5858](https://github.com/paritytech/parity/pull/5858)
|
||||
- Dutch i18n from [#5802](https://github.com/paritytech/parity/issues/5802) for master [#5836](https://github.com/paritytech/parity/pull/5836)
|
||||
- Typos in token deploy dapp ui [#5851](https://github.com/paritytech/parity/pull/5851)
|
||||
- A CLI flag to allow fast transaction signing when account is unlocked. [#5778](https://github.com/paritytech/parity/pull/5778)
|
||||
- Removing `additional` field from EVM instructions [#5821](https://github.com/paritytech/parity/pull/5821)
|
||||
- Don't fail on wrong log decoding [#5813](https://github.com/paritytech/parity/pull/5813)
|
||||
- Use randomized subscription ids for PubSub [#5756](https://github.com/paritytech/parity/pull/5756)
|
||||
- Fixed mem write for empty slice [#5827](https://github.com/paritytech/parity/pull/5827)
|
||||
- Fix party technologies [#5810](https://github.com/paritytech/parity/pull/5810)
|
||||
- Revert "Fixed mem write for empty slice" [#5826](https://github.com/paritytech/parity/pull/5826)
|
||||
- Fixed mem write for empty slice [#5825](https://github.com/paritytech/parity/pull/5825)
|
||||
- Fix JS tests [#5822](https://github.com/paritytech/parity/pull/5822)
|
||||
- Bump native-tls and openssl crates. [#5817](https://github.com/paritytech/parity/pull/5817)
|
||||
- Public node using WASM [#5734](https://github.com/paritytech/parity/pull/5734)
|
||||
- enforce block signer == author field in PoA [#5808](https://github.com/paritytech/parity/pull/5808)
|
||||
- Fix stack display in evmbin. [#5733](https://github.com/paritytech/parity/pull/5733)
|
||||
- Disable UI if it's not compiled in. [#5773](https://github.com/paritytech/parity/pull/5773)
|
||||
- Require phrase confirmation. [#5731](https://github.com/paritytech/parity/pull/5731)
|
||||
- Duration limit made optional for EthashParams [#5777](https://github.com/paritytech/parity/pull/5777)
|
||||
- Update Changelog for 1.6.8 [#5798](https://github.com/paritytech/parity/pull/5798)
|
||||
- Replace Ethcore comany name in T&C and some other places [#5796](https://github.com/paritytech/parity/pull/5796)
|
||||
- PubSub for IPC. [#5800](https://github.com/paritytech/parity/pull/5800)
|
||||
- Fix terminology distributed -> decentralized applications [#5797](https://github.com/paritytech/parity/pull/5797)
|
||||
- Disable compression for RLP strings [#5786](https://github.com/paritytech/parity/pull/5786)
|
||||
- update the source for the snapcraft package [#5781](https://github.com/paritytech/parity/pull/5781)
|
||||
- Fixed default UI port for mac installer [#5782](https://github.com/paritytech/parity/pull/5782)
|
||||
- Block invalid account name creation [#5784](https://github.com/paritytech/parity/pull/5784)
|
||||
- Update Cid/multihash/ring/tinykeccak [#5785](https://github.com/paritytech/parity/pull/5785)
|
||||
- use NULL_RLP, remove NULL_RLP_STATIC [#5742](https://github.com/paritytech/parity/pull/5742)
|
||||
- Blacklist empty phrase account. [#5730](https://github.com/paritytech/parity/pull/5730)
|
||||
- EIP-211 RETURNDATACOPY and RETURNDATASIZE [#5678](https://github.com/paritytech/parity/pull/5678)
|
||||
- Bump mio [#5763](https://github.com/paritytech/parity/pull/5763)
|
||||
- Fixing UI issues after UI server refactor [#5710](https://github.com/paritytech/parity/pull/5710)
|
||||
- Fix WS server expose issue. [#5728](https://github.com/paritytech/parity/pull/5728)
|
||||
- Fix local transactions without condition. [#5716](https://github.com/paritytech/parity/pull/5716)
|
||||
- Bump parity-wordlist. [#5748](https://github.com/paritytech/parity/pull/5748)
|
||||
- two small changes in evm [#5700](https://github.com/paritytech/parity/pull/5700)
|
||||
- Evmbin: JSON format printing pre-state. [#5712](https://github.com/paritytech/parity/pull/5712)
|
||||
- Recover from empty phrase in dev mode [#5698](https://github.com/paritytech/parity/pull/5698)
|
||||
- EIP-210 BLOCKHASH changes [#5505](https://github.com/paritytech/parity/pull/5505)
|
||||
- fixes typo [#5708](https://github.com/paritytech/parity/pull/5708)
|
||||
- Bump rocksdb [#5707](https://github.com/paritytech/parity/pull/5707)
|
||||
- Fixed --datadir option [#5697](https://github.com/paritytech/parity/pull/5697)
|
||||
- rpc -> weak to arc [#5688](https://github.com/paritytech/parity/pull/5688)
|
||||
- typo fix [#5699](https://github.com/paritytech/parity/pull/5699)
|
||||
- Revamping parity-evmbin [#5696](https://github.com/paritytech/parity/pull/5696)
|
||||
- Update dependencies and bigint api [#5685](https://github.com/paritytech/parity/pull/5685)
|
||||
- UI server refactoring [#5580](https://github.com/paritytech/parity/pull/5580)
|
||||
- Fix from/into electrum in ethkey [#5686](https://github.com/paritytech/parity/pull/5686)
|
||||
- Add unit tests [#5668](https://github.com/paritytech/parity/pull/5668)
|
||||
- Guanqun add unit tests [#5671](https://github.com/paritytech/parity/pull/5671)
|
||||
- Parity-PubSub as a separate API. [#5676](https://github.com/paritytech/parity/pull/5676)
|
||||
- EIP-140 REVERT opcode [#5477](https://github.com/paritytech/parity/pull/5477)
|
||||
- Update CHANGELOG for 1.6.7 [#5683](https://github.com/paritytech/parity/pull/5683)
|
||||
- Updated docs slightly. [#5674](https://github.com/paritytech/parity/pull/5674)
|
||||
- Fix build [#5684](https://github.com/paritytech/parity/pull/5684)
|
||||
- Back-references for the on-demand service [#5573](https://github.com/paritytech/parity/pull/5573)
|
||||
- Dynamically adjust PIP request costs based on gathered data [#5603](https://github.com/paritytech/parity/pull/5603)
|
||||
- use cargo workspace [#5601](https://github.com/paritytech/parity/pull/5601)
|
||||
- Latest headers Pub-Sub [#5655](https://github.com/paritytech/parity/pull/5655)
|
||||
- improved dockerfile builds [#5659](https://github.com/paritytech/parity/pull/5659)
|
||||
- Adding CLI options: port shift and unsafe expose. [#5677](https://github.com/paritytech/parity/pull/5677)
|
||||
- Report missing author in Aura [#5583](https://github.com/paritytech/parity/pull/5583)
|
||||
- typo fix [#5669](https://github.com/paritytech/parity/pull/5669)
|
||||
- Remove public middleware (temporary) [#5665](https://github.com/paritytech/parity/pull/5665)
|
||||
- Remove additional polyfill [#5663](https://github.com/paritytech/parity/pull/5663)
|
||||
- Importing accounts from files. [#5644](https://github.com/paritytech/parity/pull/5644)
|
||||
- remove the deprecated options in rustfmt.toml [#5616](https://github.com/paritytech/parity/pull/5616)
|
||||
- Update the Console dapp [#5602](https://github.com/paritytech/parity/pull/5602)
|
||||
- Create an account for chain=dev [#5612](https://github.com/paritytech/parity/pull/5612)
|
||||
- Use babel-runtime as opposed to babel-polyfill [#5662](https://github.com/paritytech/parity/pull/5662)
|
||||
- Connection dialog timestamp info [#5554](https://github.com/paritytech/parity/pull/5554)
|
||||
- use copy_from_slice instead of for loop [#5647](https://github.com/paritytech/parity/pull/5647)
|
||||
- Light friendly dapps [#5634](https://github.com/paritytech/parity/pull/5634)
|
||||
- Add Recover button to Accounts and warnings [#5645](https://github.com/paritytech/parity/pull/5645)
|
||||
- Update eth_sign docs. [#5631](https://github.com/paritytech/parity/pull/5631)
|
||||
- Proper signer Pub-Sub for pending requests. [#5594](https://github.com/paritytech/parity/pull/5594)
|
||||
- Bump bigint to 1.0.5 [#5641](https://github.com/paritytech/parity/pull/5641)
|
||||
- PoA warp implementation [#5488](https://github.com/paritytech/parity/pull/5488)
|
||||
- Improve on-demand dispatch and add support for batch requests [#5419](https://github.com/paritytech/parity/pull/5419)
|
||||
- Use default account for sending transactions [#5588](https://github.com/paritytech/parity/pull/5588)
|
||||
- Add peer management to the Status tab [#5566](https://github.com/paritytech/parity/pull/5566)
|
||||
- Add monotonic step transition [#5587](https://github.com/paritytech/parity/pull/5587)
|
||||
- Decrypting for external accounts. [#5581](https://github.com/paritytech/parity/pull/5581)
|
||||
- only enable warp sync when engine supports it [#5595](https://github.com/paritytech/parity/pull/5595)
|
||||
- fix the doc of installing rust [#5586](https://github.com/paritytech/parity/pull/5586)
|
||||
- Small fixes [#5584](https://github.com/paritytech/parity/pull/5584)
|
||||
- SecretStore: remove session on master node [#5545](https://github.com/paritytech/parity/pull/5545)
|
||||
- run-clean [#5607](https://github.com/paritytech/parity/pull/5607)
|
||||
- relicense RLP to MIT/Apache2 [#5591](https://github.com/paritytech/parity/pull/5591)
|
||||
- Fix eth_sign signature encoding. [#5597](https://github.com/paritytech/parity/pull/5597)
|
||||
- Check pending request on Node local transactions [#5564](https://github.com/paritytech/parity/pull/5564)
|
||||
- Add tooltips on ActionBar [#5562](https://github.com/paritytech/parity/pull/5562)
|
||||
- Can't deploy without compiling Contract [#5593](https://github.com/paritytech/parity/pull/5593)
|
||||
- Add a warning when node is syncing [#5565](https://github.com/paritytech/parity/pull/5565)
|
||||
- Update registry middleware [#5585](https://github.com/paritytech/parity/pull/5585)
|
||||
- Set block condition to BigNumber in MethodDecoding [#5592](https://github.com/paritytech/parity/pull/5592)
|
||||
- Load the sources immediately in Contract Dev [#5575](https://github.com/paritytech/parity/pull/5575)
|
||||
- Remove formal verification messages in Dev Contract [#5574](https://github.com/paritytech/parity/pull/5574)
|
||||
- Fix event params decoding when no names for parameters [#5567](https://github.com/paritytech/parity/pull/5567)
|
||||
- Do not convert to Dates twice [#5563](https://github.com/paritytech/parity/pull/5563)
|
||||
- Fix Multisig wallet settings [#5560](https://github.com/paritytech/parity/pull/5560)
|
||||
- Typo [#5547](https://github.com/paritytech/parity/pull/5547)
|
||||
- Generic PubSub implementation [#5456](https://github.com/paritytech/parity/pull/5456)
|
||||
- Fix CI paths. [#5570](https://github.com/paritytech/parity/pull/5570)
|
||||
- reorg into blocks before minimum history [#5558](https://github.com/paritytech/parity/pull/5558)
|
||||
- EIP-86 update [#5506](https://github.com/paritytech/parity/pull/5506)
|
||||
- Secretstore RPCs + integration [#5439](https://github.com/paritytech/parity/pull/5439)
|
||||
- Fixes Parity Bar position [#5557](https://github.com/paritytech/parity/pull/5557)
|
||||
- Fixes invalid log in BadgeReg events [#5556](https://github.com/paritytech/parity/pull/5556)
|
||||
- Fix issues in Contract Development view [#5555](https://github.com/paritytech/parity/pull/5555)
|
||||
- Added missing methods [#5542](https://github.com/paritytech/parity/pull/5542)
|
||||
- option to disable persistent txqueue [#5544](https://github.com/paritytech/parity/pull/5544)
|
||||
- Bump jsonrpc [#5552](https://github.com/paritytech/parity/pull/5552)
|
||||
- Retrieve block headers only for header-only info [#5480](https://github.com/paritytech/parity/pull/5480)
|
||||
- add snap to CI [#5519](https://github.com/paritytech/parity/pull/5519)
|
||||
- Pass additional data when reporting [#5527](https://github.com/paritytech/parity/pull/5527)
|
||||
- Calculate post-constructors state root in spec at load time [#5523](https://github.com/paritytech/parity/pull/5523)
|
||||
- Fix utf8 decoding [#5533](https://github.com/paritytech/parity/pull/5533)
|
||||
- Add CHANGELOG.md [#5513](https://github.com/paritytech/parity/pull/5513)
|
||||
- Change all occurrences of ethcore.io into parity.io [#5528](https://github.com/paritytech/parity/pull/5528)
|
||||
- Memory usage optimization [#5526](https://github.com/paritytech/parity/pull/5526)
|
||||
- Compose transaction RPC. [#5524](https://github.com/paritytech/parity/pull/5524)
|
||||
- Support external eth_sign [#5481](https://github.com/paritytech/parity/pull/5481)
|
||||
- Treat block numbers as strings, not BigNums. [#5449](https://github.com/paritytech/parity/pull/5449)
|
||||
- npm cleanups [#5512](https://github.com/paritytech/parity/pull/5512)
|
||||
- Export acc js [#4973](https://github.com/paritytech/parity/pull/4973)
|
||||
- YARN [#5395](https://github.com/paritytech/parity/pull/5395)
|
||||
- Fix linting issues [#5511](https://github.com/paritytech/parity/pull/5511)
|
||||
- Chinese Translation [#5460](https://github.com/paritytech/parity/pull/5460)
|
||||
- Fixing secretstore TODOs - part 2 [#5416](https://github.com/paritytech/parity/pull/5416)
|
||||
- fix json format of state snapshot [#5504](https://github.com/paritytech/parity/pull/5504)
|
||||
- Bump jsonrpc version [#5489](https://github.com/paritytech/parity/pull/5489)
|
||||
- Groundwork for generalized warp sync [#5454](https://github.com/paritytech/parity/pull/5454)
|
||||
- Add the packaging metadata to build the parity snap [#5496](https://github.com/paritytech/parity/pull/5496)
|
||||
- Cancel tx JS [#4958](https://github.com/paritytech/parity/pull/4958)
|
||||
- EIP-212 (bn128 curve pairing) [#5307](https://github.com/paritytech/parity/pull/5307)
|
||||
- fix panickers in tree-route [#5479](https://github.com/paritytech/parity/pull/5479)
|
||||
- Update links to etherscan.io [#5455](https://github.com/paritytech/parity/pull/5455)
|
||||
- Refresh UI on nodeKind changes, e.g. personal -> public [#5312](https://github.com/paritytech/parity/pull/5312)
|
||||
- Correct contract address for EIP-86 [#5473](https://github.com/paritytech/parity/pull/5473)
|
||||
- Force two decimals for USD conversion rate [#5471](https://github.com/paritytech/parity/pull/5471)
|
||||
- Refactoring of Tokens & Balances [#5372](https://github.com/paritytech/parity/pull/5372)
|
||||
- Background-repeat round [#5475](https://github.com/paritytech/parity/pull/5475)
|
||||
- nl i18n updated [#5461](https://github.com/paritytech/parity/pull/5461)
|
||||
- Show ETH value (even 0) if ETH transfer in transaction list [#5406](https://github.com/paritytech/parity/pull/5406)
|
||||
- Store the pending requests per network version [#5405](https://github.com/paritytech/parity/pull/5405)
|
||||
- Use in-memory database for tests [#5451](https://github.com/paritytech/parity/pull/5451)
|
||||
- WebSockets RPC server [#5425](https://github.com/paritytech/parity/pull/5425)
|
||||
- Added missing docs [#5452](https://github.com/paritytech/parity/pull/5452)
|
||||
- Tests and tweaks for public node middleware [#5417](https://github.com/paritytech/parity/pull/5417)
|
||||
- Fix removal of hash-mismatched files. [#5440](https://github.com/paritytech/parity/pull/5440)
|
||||
- parity_getBlockHeaderByNumber and LightFetch utility [#5383](https://github.com/paritytech/parity/pull/5383)
|
||||
- New state tests [#5418](https://github.com/paritytech/parity/pull/5418)
|
||||
- Fix buffer length for QR code gen. [#5447](https://github.com/paritytech/parity/pull/5447)
|
||||
- Add raw hash signing [#5423](https://github.com/paritytech/parity/pull/5423)
|
||||
- Filters and block RPCs for the light client [#5320](https://github.com/paritytech/parity/pull/5320)
|
||||
- Work around mismatch for QR checksum [#5374](https://github.com/paritytech/parity/pull/5374)
|
||||
- easy to use conversion from and to string for ethstore::Crypto [#5437](https://github.com/paritytech/parity/pull/5437)
|
||||
- Tendermint fixes [#5415](https://github.com/paritytech/parity/pull/5415)
|
||||
- Adrianbrink lightclientcache branch. [#5428](https://github.com/paritytech/parity/pull/5428)
|
||||
- Add caching to HeaderChain struct [#5403](https://github.com/paritytech/parity/pull/5403)
|
||||
- Add decryption to the UI (in the Signer) [#5422](https://github.com/paritytech/parity/pull/5422)
|
||||
- Add CIDv0 RPC [#5414](https://github.com/paritytech/parity/pull/5414)
|
||||
- Updating documentation for RPCs [#5392](https://github.com/paritytech/parity/pull/5392)
|
||||
- Fixing secretstore TODOs - part 1 [#5386](https://github.com/paritytech/parity/pull/5386)
|
||||
- Fixing disappearing content. [#5399](https://github.com/paritytech/parity/pull/5399)
|
||||
- Snapshot chunks packed by size [#5318](https://github.com/paritytech/parity/pull/5318)
|
||||
- APIs wildcards and simple arithmetic. [#5402](https://github.com/paritytech/parity/pull/5402)
|
||||
- Fixing compilation without dapps. [#5410](https://github.com/paritytech/parity/pull/5410)
|
||||
- Don't use port 8080 anymore [#5397](https://github.com/paritytech/parity/pull/5397)
|
||||
- Quick'n'dirty CLI for the light client [#5002](https://github.com/paritytech/parity/pull/5002)
|
||||
- set gas limit before proving transactions [#5401](https://github.com/paritytech/parity/pull/5401)
|
||||
- Public node: perf and fixes [#5390](https://github.com/paritytech/parity/pull/5390)
|
||||
- Straight download path in the readme [#5393](https://github.com/paritytech/parity/pull/5393)
|
||||
- On-chain ACL checker for secretstore [#5015](https://github.com/paritytech/parity/pull/5015)
|
||||
- Allow empty-encoded values from QR encoding [#5385](https://github.com/paritytech/parity/pull/5385)
|
||||
- Update npm build for new inclusions [#5381](https://github.com/paritytech/parity/pull/5381)
|
||||
- Fix for Ubuntu Dockerfile [#5356](https://github.com/paritytech/parity/pull/5356)
|
||||
- Secretstore over network [#4974](https://github.com/paritytech/parity/pull/4974)
|
||||
- Dapps and RPC server merge [#5365](https://github.com/paritytech/parity/pull/5365)
|
||||
- trigger js build release [#5379](https://github.com/paritytech/parity/pull/5379)
|
||||
- Update expanse json with fork at block 600000 [#5351](https://github.com/paritytech/parity/pull/5351)
|
||||
- Futures-based native wrappers for contract ABIs [#5341](https://github.com/paritytech/parity/pull/5341)
|
||||
- Kovan warp sync fixed [#5337](https://github.com/paritytech/parity/pull/5337)
|
||||
- Aura eip155 validation transition [#5362](https://github.com/paritytech/parity/pull/5362)
|
||||
- Shared wordlist for brain wallets [#5331](https://github.com/paritytech/parity/pull/5331)
|
||||
- Allow signing via Qr [#4881](https://github.com/paritytech/parity/pull/4881)
|
||||
- Allow entry of url or hash for DappReg meta [#5360](https://github.com/paritytech/parity/pull/5360)
|
||||
- Adjust tx overlay colours [#5353](https://github.com/paritytech/parity/pull/5353)
|
||||
- Add ability to disallow API subscriptions [#5366](https://github.com/paritytech/parity/pull/5366)
|
||||
- EIP-213 (bn128 curve operations) [#4999](https://github.com/paritytech/parity/pull/4999)
|
||||
- Fix analize output file name [#5357](https://github.com/paritytech/parity/pull/5357)
|
||||
- Add default eip155 validation [#5346](https://github.com/paritytech/parity/pull/5346)
|
||||
- Add new seed nodes for Classic chain [#5345](https://github.com/paritytech/parity/pull/5345)
|
||||
- Shared wordlist for frontend [#5336](https://github.com/paritytech/parity/pull/5336)
|
||||
- fix rpc tests [#5338](https://github.com/paritytech/parity/pull/5338)
|
||||
- Public node with accounts and signing in Frontend [#5304](https://github.com/paritytech/parity/pull/5304)
|
||||
- Rename Status/Status -> Status/NodeStatus [#5332](https://github.com/paritytech/parity/pull/5332)
|
||||
- Updating paths to repos. [#5330](https://github.com/paritytech/parity/pull/5330)
|
||||
- Separate status for canceled local transactions. [#5319](https://github.com/paritytech/parity/pull/5319)
|
||||
- Cleanup the Status View [#5317](https://github.com/paritytech/parity/pull/5317)
|
||||
- Update UI minimised requests [#5324](https://github.com/paritytech/parity/pull/5324)
|
||||
- Order signer transactions FIFO [#5321](https://github.com/paritytech/parity/pull/5321)
|
||||
- updating dependencies [#5028](https://github.com/paritytech/parity/pull/5028)
|
||||
- Minimise transactions progress [#4942](https://github.com/paritytech/parity/pull/4942)
|
||||
- Fix eth_sign showing as wallet account [#5309](https://github.com/paritytech/parity/pull/5309)
|
||||
- Ropsten revival [#5302](https://github.com/paritytech/parity/pull/5302)
|
||||
- Strict validation transitions [#4988](https://github.com/paritytech/parity/pull/4988)
|
||||
- Fix default list sorting [#5303](https://github.com/paritytech/parity/pull/5303)
|
||||
- Use unique owners for multisig wallets [#5298](https://github.com/paritytech/parity/pull/5298)
|
||||
- Copy all existing i18n strings into zh (as-is translation aid) [#5305](https://github.com/paritytech/parity/pull/5305)
|
||||
- Fix booleans in Typedinput [#5295](https://github.com/paritytech/parity/pull/5295)
|
||||
- node kind RPC [#5025](https://github.com/paritytech/parity/pull/5025)
|
||||
- Fix the use of MobX in playground [#5294](https://github.com/paritytech/parity/pull/5294)
|
||||
- Fine grained snapshot chunking [#5019](https://github.com/paritytech/parity/pull/5019)
|
||||
- Add lint:i18n to find missing & extra keys [#5290](https://github.com/paritytech/parity/pull/5290)
|
||||
- Scaffolding for zh translations, including first-round by @btceth [#5289](https://github.com/paritytech/parity/pull/5289)
|
||||
- JS package bumps [#5287](https://github.com/paritytech/parity/pull/5287)
|
||||
- Auto-extract new i18n strings (update) [#5288](https://github.com/paritytech/parity/pull/5288)
|
||||
- eip100b [#5027](https://github.com/paritytech/parity/pull/5027)
|
||||
- Set earliest era in snapshot restoration [#5021](https://github.com/paritytech/parity/pull/5021)
|
||||
- Avoid clogging up tmp when updater dir has bad permissions. [#5024](https://github.com/paritytech/parity/pull/5024)
|
||||
- Resilient warp sync [#5018](https://github.com/paritytech/parity/pull/5018)
|
||||
- Create webpack analysis files (size) [#5009](https://github.com/paritytech/parity/pull/5009)
|
||||
- Dispatch an open event on drag of Parity Bar [#4987](https://github.com/paritytech/parity/pull/4987)
|
||||
- Various installer and tray apps fixes [#4970](https://github.com/paritytech/parity/pull/4970)
|
||||
- Export account RPC [#4967](https://github.com/paritytech/parity/pull/4967)
|
||||
- Switching ValidatorSet [#4961](https://github.com/paritytech/parity/pull/4961)
|
||||
- Implement PIP messages, request builder, and handlers [#4945](https://github.com/paritytech/parity/pull/4945)
|
||||
- auto lint [#5003](https://github.com/paritytech/parity/pull/5003)
|
||||
- Fix FireFox overflows [#5000](https://github.com/paritytech/parity/pull/5000)
|
||||
- Show busy indicator, focus first field in password change [#4997](https://github.com/paritytech/parity/pull/4997)
|
||||
- Consistent store naming in the Signer components [#4996](https://github.com/paritytech/parity/pull/4996)
|
||||
- second (and last) part of rlp refactor [#4901](https://github.com/paritytech/parity/pull/4901)
|
||||
- Double click to select account creation type [#4986](https://github.com/paritytech/parity/pull/4986)
|
||||
- Fixes to the Registry dapp [#4984](https://github.com/paritytech/parity/pull/4984)
|
||||
- Extend api.util [#4979](https://github.com/paritytech/parity/pull/4979)
|
||||
- Updating JSON-RPC crates [#4934](https://github.com/paritytech/parity/pull/4934)
|
||||
- splitting part of util into smaller crates [#4956](https://github.com/paritytech/parity/pull/4956)
|
||||
- Updating syntex et al [#4983](https://github.com/paritytech/parity/pull/4983)
|
||||
- EIP198 and built-in activation [#4926](https://github.com/paritytech/parity/pull/4926)
|
||||
- Fix MethodDecoding for Arrays [#4977](https://github.com/paritytech/parity/pull/4977)
|
||||
- Try to fix WS race condition connection [#4976](https://github.com/paritytech/parity/pull/4976)
|
||||
- eth_sign where account === undefined [#4964](https://github.com/paritytech/parity/pull/4964)
|
||||
- Fix references to api outside of `parity.js` [#4981](https://github.com/paritytech/parity/pull/4981)
|
||||
- Fix Password Dialog form overflow [#4968](https://github.com/paritytech/parity/pull/4968)
|
||||
- Changing Mutex into RwLock for transaction queue [#4951](https://github.com/paritytech/parity/pull/4951)
|
||||
- Disable max seal period for external sealing [#4927](https://github.com/paritytech/parity/pull/4927)
|
||||
- Attach hardware wallets already in addressbook [#4912](https://github.com/paritytech/parity/pull/4912)
|
||||
- rlp serialization refactor [#4873](https://github.com/paritytech/parity/pull/4873)
|
||||
- Bump nanomsg [#4965](https://github.com/paritytech/parity/pull/4965)
|
||||
- Fixed multi-chunk ledger transactions on windows [#4960](https://github.com/paritytech/parity/pull/4960)
|
||||
- Fix outputs in Contract Constant Queries [#4953](https://github.com/paritytech/parity/pull/4953)
|
||||
- systemd: Start parity after network.target [#4952](https://github.com/paritytech/parity/pull/4952)
|
||||
- Remove transaction RPC [#4949](https://github.com/paritytech/parity/pull/4949)
|
||||
- Swap out ethcore.io url for parity.io [#4947](https://github.com/paritytech/parity/pull/4947)
|
||||
- Don't remove confirmed requests to early. [#4933](https://github.com/paritytech/parity/pull/4933)
|
||||
- Ensure sealing work enabled in miner once subscribers added [#4930](https://github.com/paritytech/parity/pull/4930)
|
||||
- Add z-index to small modals as well [#4923](https://github.com/paritytech/parity/pull/4923)
|
||||
- Bump nanomsg [#4946](https://github.com/paritytech/parity/pull/4946)
|
||||
- Bumping multihash and libc [#4943](https://github.com/paritytech/parity/pull/4943)
|
||||
- Edit ETH value, gas and gas price in Contract Deployment [#4919](https://github.com/paritytech/parity/pull/4919)
|
||||
- Add ability to configure Secure API [#4922](https://github.com/paritytech/parity/pull/4922)
|
||||
- Add Token image from URL [#4916](https://github.com/paritytech/parity/pull/4916)
|
||||
- Use the registry fee in Token Deployment dapp [#4915](https://github.com/paritytech/parity/pull/4915)
|
||||
- Add reseal max period [#4903](https://github.com/paritytech/parity/pull/4903)
|
||||
- Detect rust compiler version in Parity build script, closes 4742 [#4907](https://github.com/paritytech/parity/pull/4907)
|
||||
- Add Vaults logic to First Run [#4914](https://github.com/paritytech/parity/pull/4914)
|
||||
- Updated gcc and rayon crates to remove outdated num_cpus dependency [#4909](https://github.com/paritytech/parity/pull/4909)
|
||||
- Renaming evm binary to avoid conflicts. [#4899](https://github.com/paritytech/parity/pull/4899)
|
||||
- Better error handling for traces RPC [#4849](https://github.com/paritytech/parity/pull/4849)
|
||||
- Safari SectionList fix [#4895](https://github.com/paritytech/parity/pull/4895)
|
||||
- Safari Dialog scrolling fix [#4893](https://github.com/paritytech/parity/pull/4893)
|
||||
- Spelling :) [#4900](https://github.com/paritytech/parity/pull/4900)
|
||||
- Additional kovan params [#4892](https://github.com/paritytech/parity/pull/4892)
|
||||
- trigger js-precompiled build [#4898](https://github.com/paritytech/parity/pull/4898)
|
||||
- Recalculate receipt roots in close_and_lock [#4884](https://github.com/paritytech/parity/pull/4884)
|
||||
- Reload UI on network switch [#4864](https://github.com/paritytech/parity/pull/4864)
|
||||
- Update parity-ui-precompiled with branch [#4850](https://github.com/paritytech/parity/pull/4850)
|
||||
- OSX Installer is no longer experimental [#4882](https://github.com/paritytech/parity/pull/4882)
|
||||
- Chain-selection from UI [#4859](https://github.com/paritytech/parity/pull/4859)
|
||||
- removed redundant (and unused) FromJson trait [#4871](https://github.com/paritytech/parity/pull/4871)
|
||||
- fix typos and grammar [#4880](https://github.com/paritytech/parity/pull/4880)
|
||||
- Remove old experimental remote-db code [#4872](https://github.com/paritytech/parity/pull/4872)
|
||||
- removed redundant FixedHash trait, fixes [#4029](https://github.com/paritytech/parity/issues/4029) [#4866](https://github.com/paritytech/parity/pull/4866)
|
||||
- Reference JSON-RPC more changes-friendly [#4870](https://github.com/paritytech/parity/pull/4870)
|
||||
- Better handling of Solidity compliation [#4860](https://github.com/paritytech/parity/pull/4860)
|
||||
- Go through contract links in Transaction List display [#4863](https://github.com/paritytech/parity/pull/4863)
|
||||
- Fix Gas Price Selector Tooltips [#4865](https://github.com/paritytech/parity/pull/4865)
|
||||
- Fix auto-updater [#4867](https://github.com/paritytech/parity/pull/4867)
|
||||
- Make the UI work offline [#4861](https://github.com/paritytech/parity/pull/4861)
|
||||
- Subscribe to accounts info in Signer / ParityBar [#4856](https://github.com/paritytech/parity/pull/4856)
|
||||
- Don't link libsnappy explicitly [#4841](https://github.com/paritytech/parity/pull/4841)
|
||||
- Fix paste in Inputs [#4854](https://github.com/paritytech/parity/pull/4854)
|
||||
- Extract i18n from shared UI components [#4834](https://github.com/paritytech/parity/pull/4834)
|
||||
- Fix paste in Inputs [#4844](https://github.com/paritytech/parity/pull/4844)
|
||||
- Pull contract deployment title from available steps [#4848](https://github.com/paritytech/parity/pull/4848)
|
||||
- Supress USB error message [#4839](https://github.com/paritytech/parity/pull/4839)
|
||||
- Fix getTransactionCount in --geth mode [#4837](https://github.com/paritytech/parity/pull/4837)
|
||||
- CI: test coverage (for core and js) [#4832](https://github.com/paritytech/parity/pull/4832)
|
||||
- Lowering threshold for transactions above gas limit [#4831](https://github.com/paritytech/parity/pull/4831)
|
||||
- Fix TxViewer when no `to` (contract deployment) [#4847](https://github.com/paritytech/parity/pull/4847)
|
||||
- Fix method decoding [#4845](https://github.com/paritytech/parity/pull/4845)
|
||||
- Add React Hot Reload to dapps + TokenDeploy fix [#4846](https://github.com/paritytech/parity/pull/4846)
|
||||
- Dapps show multiple times in some cases [#4843](https://github.com/paritytech/parity/pull/4843)
|
||||
- Fixes to the Registry dapp [#4838](https://github.com/paritytech/parity/pull/4838)
|
||||
- Show token icons on list summary pages [#4826](https://github.com/paritytech/parity/pull/4826)
|
||||
- Calibrate step before rejection [#4800](https://github.com/paritytech/parity/pull/4800)
|
||||
- Add replay protection [#4808](https://github.com/paritytech/parity/pull/4808)
|
||||
- Better icon on windows [#4804](https://github.com/paritytech/parity/pull/4804)
|
||||
- Better logic for contract deployments detection [#4821](https://github.com/paritytech/parity/pull/4821)
|
||||
- Fix wrong default values for contract queries inputs [#4819](https://github.com/paritytech/parity/pull/4819)
|
||||
- Adjust selection colours/display [#4811](https://github.com/paritytech/parity/pull/4811)
|
||||
- Update the Wallet Library Registry key [#4817](https://github.com/paritytech/parity/pull/4817)
|
||||
- Update Wallet to new Wallet Code [#4805](https://github.com/paritytech/parity/pull/4805)
|
||||
|
||||
## Parity [v1.6.10](https://github.com/paritytech/parity/releases/tag/v1.6.10) (2017-07-25)
|
||||
|
||||
This is a hotfix release for the stable channel addressing the recent [multi-signature wallet vulnerability](https://blog.parity.io/security-alert-high-2/). Note, upgrading is not mandatory, and all future multi-sig wallets created by any version of Parity are secure.
|
||||
|
||||
All Changes:
|
||||
|
||||
- Backports for stable [#6116](https://github.com/paritytech/parity/pull/6116)
|
||||
- Remove chunk to restore from pending set only upon successful import [#6112](https://github.com/paritytech/parity/pull/6112)
|
||||
- Blacklist bad snapshot manifest hashes upon failure [#5874](https://github.com/paritytech/parity/pull/5874)
|
||||
- Bump snap version and tweak importing detection logic [#6079](https://github.com/paritytech/parity/pull/6079) (modified to work)
|
||||
- Fix docker build for stable [#6118](https://github.com/paritytech/parity/pull/6118)
|
||||
- Update wallet library binaries [#6108](https://github.com/paritytech/parity/pull/6108)
|
||||
- Backported wallet fix [#6104](https://github.com/paritytech/parity/pull/6104)
|
||||
- Fix initialisation bug. ([#6102](https://github.com/paritytech/parity/pull/6102))
|
||||
- Update wallet library modifiers ([#6103](https://github.com/paritytech/parity/pull/6103))
|
||||
- Bump to v1.6.10
|
||||
|
||||
## Parity [v1.6.9](https://github.com/paritytech/parity/releases/tag/v1.6.9) (2017-07-16)
|
||||
|
||||
This is a first stable release of 1.6 series. It contains a number of minor fixes and introduces the `--reseal-on-uncles` option for miners.
|
||||
|
||||
Full list of changes:
|
||||
|
||||
- Backports [#6061](https://github.com/paritytech/parity/pull/6061)
|
||||
- Ethereum Classic Monetary Policy [#5741](https://github.com/paritytech/parity/pull/5741)
|
||||
- Update rewards for uncle miners for ECIP1017
|
||||
- Fix an off-by-one error in ECIP1017 era calculation
|
||||
- `ecip1017_era_rounds` missing from EthashParams when run in build bot
|
||||
- strip out ecip1017_eras_block_reward function and add unit test
|
||||
- JS precompiled set to stable
|
||||
- Backports [#6060](https://github.com/paritytech/parity/pull/6060)
|
||||
- --reseal-on-uncle [#5940](https://github.com/paritytech/parity/pull/5940)
|
||||
- Optimized uncle check
|
||||
- Additional uncle check
|
||||
- Updated comment
|
||||
- Bump to v1.6.9
|
||||
- CLI: Export error message and less verbose peer counter. [#5870](https://github.com/paritytech/parity/pull/5870)
|
||||
- Removed numbed of active connections from informant
|
||||
- Print error message when fatdb is required
|
||||
- Remove peers from UI
|
||||
|
||||
## Parity [v1.6.8](https://github.com/paritytech/parity/releases/tag/v1.6.8) (2017-06-08)
|
||||
|
||||
This release addresses:
|
||||
|
235
Cargo.lock
generated
235
Cargo.lock
generated
@ -1,6 +1,15 @@
|
||||
[root]
|
||||
name = "using_queue"
|
||||
name = "wasm"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore-logger 1.8.0",
|
||||
"ethcore-util 1.8.0",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-wasm 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vm 0.1.0",
|
||||
"wasm-utils 0.1.0 (git+https://github.com/paritytech/wasm-utils)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "advapi32-sys"
|
||||
@ -81,6 +90,20 @@ dependencies = [
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "backtrace-sys"
|
||||
version = "0.1.11"
|
||||
@ -167,6 +190,14 @@ name = "blastfig"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "bloomable"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ethcore-bigint 0.1.3",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bloomchain"
|
||||
version = "0.1.0"
|
||||
@ -206,6 +237,15 @@ name = "cfg-if"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "chainspec"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"ethjson 0.1.0",
|
||||
"serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cid"
|
||||
version = "0.2.2"
|
||||
@ -257,6 +297,7 @@ dependencies = [
|
||||
name = "common-types"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bloomable 0.1.0",
|
||||
"ethcore-util 1.8.0",
|
||||
"ethjson 0.1.0",
|
||||
"rlp 0.2.0",
|
||||
@ -302,6 +343,11 @@ name = "crossbeam"
|
||||
version = "0.2.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "crunchy"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "crypt32-sys"
|
||||
version = "0.2.0"
|
||||
@ -424,13 +470,14 @@ dependencies = [
|
||||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ethash"
|
||||
version = "1.8.0"
|
||||
dependencies = [
|
||||
"crunchy 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"primal 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -442,6 +489,7 @@ name = "ethcore"
|
||||
version = "1.8.0"
|
||||
dependencies = [
|
||||
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bloomable 0.1.0",
|
||||
"bloomchain 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bn 0.4.4 (git+https://github.com/paritytech/bn)",
|
||||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -475,15 +523,19 @@ dependencies = [
|
||||
"native-contracts 0.1.0",
|
||||
"num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"price-info 1.7.0",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.2.0",
|
||||
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"stats 0.1.0",
|
||||
"table 0.1.0",
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transient-hashmap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"using_queue 0.1.0",
|
||||
"vm 0.1.0",
|
||||
"wasm 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -605,6 +657,7 @@ dependencies = [
|
||||
"smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"stats 0.1.0",
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vm 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -636,6 +689,7 @@ dependencies = [
|
||||
"ethcrypto 0.1.0",
|
||||
"ethkey 0.2.0",
|
||||
"igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipnetwork 0.12.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mio 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -648,7 +702,7 @@ dependencies = [
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slab 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -667,7 +721,7 @@ dependencies = [
|
||||
"ethcrypto 0.1.0",
|
||||
"ethkey 0.2.0",
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -732,11 +786,9 @@ dependencies = [
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sha3 0.1.0",
|
||||
"table 0.1.0",
|
||||
"target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"using_queue 0.1.0",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vergen 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -749,7 +801,7 @@ dependencies = [
|
||||
"ethkey 0.2.0",
|
||||
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"subtle 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -757,7 +809,7 @@ name = "ethjson"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"clippy 0.0.103 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore-util 1.8.0",
|
||||
"ethcore-bigint 0.1.3",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -775,7 +827,7 @@ dependencies = [
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -784,6 +836,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethkey 0.2.0",
|
||||
"panic_hook 0.1.0",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -811,7 +864,7 @@ dependencies = [
|
||||
"smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -820,6 +873,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethstore 0.1.0",
|
||||
"panic_hook 0.1.0",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -842,6 +896,7 @@ dependencies = [
|
||||
"ethcore-util 1.8.0",
|
||||
"ethkey 0.2.0",
|
||||
"heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipnetwork 0.12.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -858,6 +913,7 @@ dependencies = [
|
||||
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"common-types 0.1.0",
|
||||
"ethcore-logger 1.8.0",
|
||||
"ethcore-util 1.8.0",
|
||||
"ethjson 0.1.0",
|
||||
"evmjit 1.8.0",
|
||||
@ -866,6 +922,7 @@ dependencies = [
|
||||
"parity-wasm 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.2.0",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vm 0.1.0",
|
||||
"wasm-utils 0.1.0 (git+https://github.com/paritytech/wasm-utils)",
|
||||
]
|
||||
|
||||
@ -877,16 +934,18 @@ dependencies = [
|
||||
"ethcore 1.8.0",
|
||||
"ethcore-util 1.8.0",
|
||||
"evm 0.1.0",
|
||||
"panic_hook 0.1.0",
|
||||
"rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vm 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "evmjit"
|
||||
version = "1.8.0"
|
||||
dependencies = [
|
||||
"tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -902,7 +961,7 @@ name = "fetch"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -935,10 +994,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "futures-cpupool"
|
||||
version = "0.1.2"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@ -1016,6 +1074,11 @@ dependencies = [
|
||||
"unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hex"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "hidapi"
|
||||
version = "0.3.1"
|
||||
@ -1124,6 +1187,11 @@ dependencies = [
|
||||
"semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ipnetwork"
|
||||
version = "0.12.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "isatty"
|
||||
version = "0.1.1"
|
||||
@ -1150,7 +1218,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
[[package]]
|
||||
name = "jsonrpc-core"
|
||||
version = "7.0.0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#5e79be8a098cdda221713992f4a46b41a1d4d8f0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#4d3ec22c7aba426988a678b489b2791e95283699"
|
||||
dependencies = [
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1162,7 +1230,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "jsonrpc-http-server"
|
||||
version = "7.0.0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#5e79be8a098cdda221713992f4a46b41a1d4d8f0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#4d3ec22c7aba426988a678b489b2791e95283699"
|
||||
dependencies = [
|
||||
"hyper 0.10.0-a.0 (git+https://github.com/paritytech/hyper)",
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
@ -1175,7 +1243,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "jsonrpc-ipc-server"
|
||||
version = "7.0.0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#5e79be8a098cdda221713992f4a46b41a1d4d8f0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#4d3ec22c7aba426988a678b489b2791e95283699"
|
||||
dependencies = [
|
||||
"bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
@ -1188,7 +1256,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "jsonrpc-macros"
|
||||
version = "7.0.0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#5e79be8a098cdda221713992f4a46b41a1d4d8f0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#4d3ec22c7aba426988a678b489b2791e95283699"
|
||||
dependencies = [
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-pubsub 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
@ -1198,7 +1266,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "jsonrpc-minihttp-server"
|
||||
version = "7.0.0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#5e79be8a098cdda221713992f4a46b41a1d4d8f0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#4d3ec22c7aba426988a678b489b2791e95283699"
|
||||
dependencies = [
|
||||
"bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
@ -1213,7 +1281,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "jsonrpc-pubsub"
|
||||
version = "7.0.0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#5e79be8a098cdda221713992f4a46b41a1d4d8f0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#4d3ec22c7aba426988a678b489b2791e95283699"
|
||||
dependencies = [
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1223,7 +1291,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "jsonrpc-server-utils"
|
||||
version = "7.0.0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#5e79be8a098cdda221713992f4a46b41a1d4d8f0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#4d3ec22c7aba426988a678b489b2791e95283699"
|
||||
dependencies = [
|
||||
"bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"globset 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1236,7 +1304,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "jsonrpc-tcp-server"
|
||||
version = "7.0.0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#5e79be8a098cdda221713992f4a46b41a1d4d8f0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#4d3ec22c7aba426988a678b489b2791e95283699"
|
||||
dependencies = [
|
||||
"bytes 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
@ -1250,7 +1318,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "jsonrpc-ws-server"
|
||||
version = "7.0.0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#5e79be8a098cdda221713992f4a46b41a1d4d8f0"
|
||||
source = "git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7#4d3ec22c7aba426988a678b489b2791e95283699"
|
||||
dependencies = [
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-server-utils 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
@ -1479,7 +1547,7 @@ version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"ring 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1514,7 +1582,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethabi 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore-util 1.8.0",
|
||||
"ethcore-bigint 0.1.3",
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"native-contract-generator 0.1.0",
|
||||
]
|
||||
@ -1694,6 +1762,15 @@ name = "order-stat"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "ordered-float"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "owning_ref"
|
||||
version = "0.3.3"
|
||||
@ -1702,9 +1779,16 @@ dependencies = [
|
||||
"stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "panic_hook"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parity"
|
||||
version = "1.7.0"
|
||||
version = "1.8.0"
|
||||
dependencies = [
|
||||
"ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"app_dirs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1722,6 +1806,7 @@ dependencies = [
|
||||
"ethcore-ipc-tests 0.1.0",
|
||||
"ethcore-light 1.8.0",
|
||||
"ethcore-logger 1.8.0",
|
||||
"ethcore-network 1.8.0",
|
||||
"ethcore-secretstore 1.0.0",
|
||||
"ethcore-stratum 1.8.0",
|
||||
"ethcore-util 1.8.0",
|
||||
@ -1729,12 +1814,14 @@ dependencies = [
|
||||
"ethsync 1.8.0",
|
||||
"fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipnetwork 0.12.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"isatty 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"number_prefix 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"panic_hook 0.1.0",
|
||||
"parity-dapps 1.8.0",
|
||||
"parity-hash-fetch 1.8.0",
|
||||
"parity-ipfs-api 1.8.0",
|
||||
@ -1743,6 +1830,7 @@ dependencies = [
|
||||
"parity-rpc 1.8.0",
|
||||
"parity-rpc-client 1.4.0",
|
||||
"parity-updater 1.8.0",
|
||||
"parity-whisper 0.1.0",
|
||||
"path 0.1.0",
|
||||
"pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1772,7 +1860,7 @@ dependencies = [
|
||||
"ethcore-util 1.8.0",
|
||||
"fetch 0.1.0",
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-http-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1881,10 +1969,9 @@ dependencies = [
|
||||
"ethkey 0.2.0",
|
||||
"ethstore 0.1.0",
|
||||
"ethsync 1.8.0",
|
||||
"evm 0.1.0",
|
||||
"fetch 0.1.0",
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-http-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-ipc-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
@ -1910,6 +1997,7 @@ dependencies = [
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-timer 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transient-hashmap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vm 0.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1966,7 +2054,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "parity-ui-precompiled"
|
||||
version = "1.4.0"
|
||||
source = "git+https://github.com/paritytech/js-precompiled.git#92627cfd287eb5176c016089b9e2350107f8869a"
|
||||
source = "git+https://github.com/paritytech/js-precompiled.git#dd9b92d9d8c244678e15163347f9adb2e2560959"
|
||||
dependencies = [
|
||||
"parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@ -2000,6 +2088,36 @@ dependencies = [
|
||||
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parity-whisper"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ethcore-bigint 0.1.3",
|
||||
"ethcore-network 1.8.0",
|
||||
"ethcrypto 0.1.0",
|
||||
"ethkey 0.2.0",
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-core 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-macros 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-pubsub 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ring 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.2.0",
|
||||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"smallvec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parity-wordlist"
|
||||
version = "1.0.1"
|
||||
@ -2088,6 +2206,17 @@ dependencies = [
|
||||
"difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "price-info"
|
||||
version = "1.7.0"
|
||||
dependencies = [
|
||||
"fetch 0.1.0",
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "primal"
|
||||
version = "0.2.3"
|
||||
@ -2474,6 +2603,14 @@ dependencies = [
|
||||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_ignored"
|
||||
version = "0.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.2"
|
||||
@ -2728,7 +2865,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tiny-keccak"
|
||||
version = "1.2.1"
|
||||
version = "1.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@ -2951,6 +3088,10 @@ dependencies = [
|
||||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "using_queue"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "utf8-ranges"
|
||||
version = "1.0.0"
|
||||
@ -2979,6 +3120,20 @@ dependencies = [
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vm"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"common-types 0.1.0",
|
||||
"ethcore-util 1.8.0",
|
||||
"ethjson 0.1.0",
|
||||
"evmjit 1.8.0",
|
||||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "void"
|
||||
version = "1.0.2"
|
||||
@ -2987,7 +3142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
[[package]]
|
||||
name = "wasm-utils"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/wasm-utils#fee06b6d5826c2dc1fc1aa183b0c2c75e3e140c3"
|
||||
source = "git+https://github.com/paritytech/wasm-utils#9462bcc0680f0ec2c876abdf75bae981dd4344a5"
|
||||
dependencies = [
|
||||
"clap 2.24.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -3073,6 +3228,7 @@ dependencies = [
|
||||
"checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0"
|
||||
"checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159"
|
||||
"checksum backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "346d7644f0b5f9bc73082d3b2236b69a05fd35cce0cfa3724e184e6a5c9e2a2f"
|
||||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76"
|
||||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff"
|
||||
"checksum base-x 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f59103b47307f76e03bef1633aec7fa9e29bfb5aa6daf5a334f94233c71f6c1"
|
||||
"checksum base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9605ba46d61df0410d8ac686b0007add8172eba90e8e909c347856fe794d8c"
|
||||
@ -3101,6 +3257,7 @@ dependencies = [
|
||||
"checksum core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "20a6d0448d3a99d977ae4a2aa5a98d886a923e863e81ad9ff814645b6feb3bbd"
|
||||
"checksum core-foundation-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "05eed248dc504a5391c63794fe4fb64f46f071280afaa1b73308f3c0ce4574c5"
|
||||
"checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97"
|
||||
"checksum crunchy 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e6aa9cb5f2d7bffc4eecfaf924fe450549dc4f0c3a6502298dc24f968b1eabbe"
|
||||
"checksum crypt32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e34988f7e069e0b2f3bfc064295161e489b2d4e04a2e4248fb94360cdf00b4ec"
|
||||
"checksum ctrlc 1.1.1 (git+https://github.com/paritytech/rust-ctrlc.git)" = "<none>"
|
||||
"checksum custom_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9"
|
||||
@ -3121,7 +3278,7 @@ dependencies = [
|
||||
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344"
|
||||
"checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d"
|
||||
"checksum futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8e51e7f9c150ba7fd4cee9df8bf6ea3dea5b63b68955ddad19ccd35b71dcfb4d"
|
||||
"checksum futures-cpupool 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bb982bb25cd8fa5da6a8eb3a460354c984ff1113da82bcb4f0b0862b5795db82"
|
||||
"checksum futures-cpupool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a283c84501e92cade5ea673a2a7ca44f71f209ccdd302a3e0896f50083d2c5ff"
|
||||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a"
|
||||
"checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518"
|
||||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
|
||||
@ -3130,6 +3287,7 @@ dependencies = [
|
||||
"checksum hamming 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65043da274378d68241eb9a8f8f8aa54e349136f7b8e12f63e3ef44043cc30e1"
|
||||
"checksum heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4c7593b1522161003928c959c20a2ca421c68e940d63d75573316a009e48a6d4"
|
||||
"checksum heck 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f807d2f64cc044a6bcf250ff23e59be0deec7a16612c014f962a06fa7e020f9"
|
||||
"checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa"
|
||||
"checksum hidapi 0.3.1 (git+https://github.com/paritytech/hidapi-rs)" = "<none>"
|
||||
"checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae"
|
||||
"checksum hyper 0.10.0-a.0 (git+https://github.com/paritytech/hyper)" = "<none>"
|
||||
@ -3139,6 +3297,7 @@ dependencies = [
|
||||
"checksum igd 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "356a0dc23a4fa0f8ce4777258085d00a01ea4923b2efd93538fc44bf5e1bda76"
|
||||
"checksum integer-encoding 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a053c9c7dcb7db1f2aa012c37dc176c62e4cdf14898dee0eecc606de835b8acb"
|
||||
"checksum iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29d062ee61fccdf25be172e70f34c9f6efc597e1fb8f6526e8437b2046ab26be"
|
||||
"checksum ipnetwork 0.12.6 (registry+https://github.com/rust-lang/crates.io-index)" = "232e76922883005380e831068f731ef0305541c9f77b30df3a1635047b16f370"
|
||||
"checksum isatty 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7408a548dc0e406b7912d9f84c261cc533c1866e047644a811c133c56041ac0c"
|
||||
"checksum itertools 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d95557e7ba6b71377b0f2c3b3ae96c53f1b75a926a6901a500f557a370af730a"
|
||||
"checksum itoa 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91fd9dc2c587067de817fec4ad355e3818c3d893a78cab32a0a474c7a15bb8d5"
|
||||
@ -3199,6 +3358,7 @@ dependencies = [
|
||||
"checksum openssl 0.9.13 (registry+https://github.com/rust-lang/crates.io-index)" = "b34cd77cf91301fff3123fbd46b065c3b728b17a392835de34c397315dce5586"
|
||||
"checksum openssl-sys 0.9.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e035022a50faa380bd7ccdbd184d946ce539ebdb0a358780de92a995882af97a"
|
||||
"checksum order-stat 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "efa535d5117d3661134dbf1719b6f0ffe06f2375843b13935db186cd094105eb"
|
||||
"checksum ordered-float 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58d25b6c0e47b20d05226d288ff434940296e7e2f8b877975da32f862152241f"
|
||||
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
|
||||
"checksum parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1d06f6ee0fda786df3784a96ee3f0629f529b91cbfb7d142f6410e6bcd1ce2c"
|
||||
"checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "<none>"
|
||||
@ -3257,6 +3417,7 @@ dependencies = [
|
||||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a"
|
||||
"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639"
|
||||
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a"
|
||||
"checksum serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "190e9765dcedb56be63b6e0993a006c7e3b071a016a304736e4a315dc01fb142"
|
||||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b"
|
||||
"checksum serde_urlencoded 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce0fd303af908732989354c6f02e05e2e6d597152870f2c6990efb0577137480"
|
||||
"checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c"
|
||||
@ -3287,7 +3448,7 @@ dependencies = [
|
||||
"checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a"
|
||||
"checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7"
|
||||
"checksum time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7ec6d62a20df54e07ab3b78b9a3932972f4b7981de295563686849eb3989af"
|
||||
"checksum tiny-keccak 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b50173faa6ee499206f77b189d7ff3bef40f6969f228c9ec22b82080df9aa41"
|
||||
"checksum tiny-keccak 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52d12ad79e4063e0cb0ca5efa202ed7244b6ce4d25f4d3abe410b2a66128292"
|
||||
"checksum tokio-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "99e958104a67877907c1454386d5482fe8e965a55d60be834a15a44328e7dc76"
|
||||
"checksum tokio-io 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "48f55df1341bb92281f229a6030bc2abffde2c7a44c6d6b802b7687dd8be0775"
|
||||
"checksum tokio-minihttp 0.1.0 (git+https://github.com/tomusdrw/tokio-minihttp)" = "<none>"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
description = "Parity Ethereum client"
|
||||
name = "parity"
|
||||
version = "1.7.0"
|
||||
version = "1.8.0"
|
||||
license = "GPL-3.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
build = "build.rs"
|
||||
@ -41,6 +41,7 @@ ethcore-ipc-hypervisor = { path = "ipc/hypervisor" }
|
||||
ethcore-light = { path = "ethcore/light" }
|
||||
ethcore-logger = { path = "logger" }
|
||||
ethcore-stratum = { path = "stratum" }
|
||||
ethcore-network = { path = "util/network" }
|
||||
ethkey = { path = "ethkey" }
|
||||
rlp = { path = "util/rlp" }
|
||||
rpc-cli = { path = "rpc_cli" }
|
||||
@ -51,7 +52,9 @@ parity-reactor = { path = "util/reactor" }
|
||||
parity-rpc = { path = "rpc" }
|
||||
parity-rpc-client = { path = "rpc_client" }
|
||||
parity-updater = { path = "updater" }
|
||||
parity-whisper = { path = "whisper" }
|
||||
path = { path = "util/path" }
|
||||
panic_hook = { path = "panic_hook" }
|
||||
|
||||
parity-dapps = { path = "dapps", optional = true }
|
||||
clippy = { version = "0.0.103", optional = true}
|
||||
@ -63,6 +66,7 @@ rustc_version = "0.2"
|
||||
[dev-dependencies]
|
||||
ethcore-ipc-tests = { path = "ipc/tests" }
|
||||
pretty_assertions = "0.1"
|
||||
ipnetwork = "0.12.6"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi = "0.2"
|
||||
@ -106,4 +110,4 @@ lto = false
|
||||
panic = "abort"
|
||||
|
||||
[workspace]
|
||||
members = ["ethstore/cli", "ethkey/cli", "evmbin"]
|
||||
members = ["ethstore/cli", "ethkey/cli", "evmbin", "whisper", "chainspec"]
|
||||
|
50
README.md
50
README.md
@ -1,53 +1,41 @@
|
||||
# [Parity](https://parity.io/parity.html)
|
||||
### Fast, light, and robust Ethereum implementation
|
||||
# [Parity](https://parity.io/parity.html) - fast, light, and robust Ethereum client
|
||||
|
||||
### [Download latest release](https://github.com/paritytech/parity/releases)
|
||||
[![build status](https://gitlab.parity.io/parity/parity/badges/master/build.svg)](https://gitlab.parity.io/parity/parity/commits/master)
|
||||
[![Snap Status](https://build.snapcraft.io/badge/paritytech/parity.svg)](https://build.snapcraft.io/user/paritytech/parity)
|
||||
[![GPLv3](https://img.shields.io/badge/license-GPL%20v3-green.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
|
||||
|
||||
[![build status](https://gitlab.parity.io/parity/parity/badges/master/build.svg)](https://gitlab.parity.io/parity/parity/commits/master) [![Coverage Status][coveralls-image]][coveralls-url] [![GPLv3][license-image]][license-url]
|
||||
- [Download the latest release here.](https://github.com/paritytech/parity/releases)
|
||||
|
||||
### Join the chat!
|
||||
|
||||
Parity [![Join the chat at https://gitter.im/ethcore/parity][gitter-image]][gitter-url] and
|
||||
parity.js [![Join the chat at https://gitter.im/ethcore/parity.js](https://badges.gitter.im/ethcore/parity.js.svg)](https://gitter.im/ethcore/parity.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
[Internal Documentation][doc-url]
|
||||
|
||||
|
||||
Be sure to check out [our wiki][wiki-url] for more information.
|
||||
|
||||
[coveralls-image]: https://coveralls.io/repos/github/paritytech/parity/badge.svg?branch=master
|
||||
[coveralls-url]: https://coveralls.io/github/paritytech/parity?branch=master
|
||||
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg
|
||||
[gitter-url]: https://gitter.im/ethcore/parity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|
||||
[license-image]: https://img.shields.io/badge/license-GPL%20v3-green.svg
|
||||
[license-url]: https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
[doc-url]: https://paritytech.github.io/parity/ethcore/index.html
|
||||
[wiki-url]: https://github.com/paritytech/parity/wiki
|
||||
Get in touch with us on Gitter:
|
||||
[![Gitter: Parity](https://img.shields.io/badge/gitter-parity-4AB495.svg)](https://gitter.im/paritytech/parity)
|
||||
[![Gitter: Parity.js](https://img.shields.io/badge/gitter-parity.js-4AB495.svg)](https://gitter.im/paritytech/parity.js)
|
||||
[![Gitter: Parity/Miners](https://img.shields.io/badge/gitter-parity/miners-4AB495.svg)](https://gitter.im/paritytech/parity/miners)
|
||||
[![Gitter: Parity-PoA](https://img.shields.io/badge/gitter-parity--poa-4AB495.svg)](https://gitter.im/paritytech/parity-poa)
|
||||
|
||||
Be sure to check out [our wiki](https://github.com/paritytech/parity/wiki) and the [internal documentation](https://paritytech.github.io/parity/ethcore/index.html) for more information.
|
||||
|
||||
----
|
||||
|
||||
|
||||
## About Parity
|
||||
|
||||
Parity's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity using the sophisticated and
|
||||
cutting-edge Rust programming language. Parity is licensed under the GPLv3, and can be used for all your Ethereum needs.
|
||||
Parity's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity using the sophisticated and cutting-edge Rust programming language. Parity is licensed under the GPLv3, and can be used for all your Ethereum needs.
|
||||
|
||||
Parity comes with a built-in wallet. To access [Parity Wallet](http://web3.site/) simply go to http://web3.site/ (if you don't have access to the internet, but still want to use the service, you can also use http://127.0.0.1:8180/). It includes various functionality allowing you to:
|
||||
|
||||
Parity comes with a built-in wallet. To access [Parity Wallet](http://web3.site/) simply go to http://web3.site/ (if you don't have access to the internet, but still want to use the service, you can also use http://127.0.0.1:8180/). It
|
||||
includes various functionality allowing you to:
|
||||
- create and manage your Ethereum accounts;
|
||||
- manage your Ether and any Ethereum tokens;
|
||||
- create and register your own tokens;
|
||||
- and much more.
|
||||
|
||||
By default, Parity will also run a JSONRPC server on `127.0.0.1:8545`. This is fully configurable and supports a number
|
||||
of RPC APIs.
|
||||
By default, Parity will also run a JSONRPC server on `127.0.0.1:8545`. This is fully configurable and supports a number of RPC APIs.
|
||||
|
||||
If you run into an issue while using parity, feel free to file one in this repository
|
||||
or hop on our [gitter chat room][gitter-url] to ask a question. We are glad to help!
|
||||
If you run into an issue while using parity, feel free to file one in this repository or hop on our [gitter chat room](https://gitter.im/paritytech/parity) to ask a question. We are glad to help!
|
||||
|
||||
Parity's current release is 1.6. You can download it at https://github.com/paritytech/parity/releases or follow the instructions
|
||||
below to build from source.
|
||||
**For security-critical issues**, please refer to the security policy outlined in `SECURITY.MD`.
|
||||
|
||||
Parity's current release is 1.7. You can download it at https://github.com/paritytech/parity/releases or follow the instructions below to build from source.
|
||||
|
||||
----
|
||||
|
||||
|
54
SECURITY.md
Normal file
54
SECURITY.md
Normal file
@ -0,0 +1,54 @@
|
||||
# Security Policy
|
||||
|
||||
For security inquiries or vulnerability reports, please send a message to security@parity.io.
|
||||
|
||||
Please use a descriptive subject line so we can identify the report as such.
|
||||
|
||||
If you send a report, we will respond to the e-mail within 48 hours, and provide regular updates from that time onwards.
|
||||
|
||||
If you would like to encrypt your report, please use the PGP key provided below.
|
||||
It is also reproduced [on MIT's key server](https://pgp.mit.edu/pks/lookup?op=get&search=0x5D0F03018D07DE73)
|
||||
|
||||
```
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQENBFlyIAwBCACe0keNPjgYzZ1Oy/8t3zj/Qw9bHHqrzx7FWy8NbXnYBM19NqOZ
|
||||
DIP7Oe0DvCaf/uruBskCS0iVstHlEFQ2AYe0Ei0REt9lQdy61GylU/DEB3879IG+
|
||||
6FO0SnFeYeerv1/hFI2K6uv8v7PyyVDiiJSW0I1KIs2OBwJicTKmWxLAeQsRgx9G
|
||||
yRGalrVk4KP+6pWTA7k3DxmDZKZyfYV/Ej10NtuzmsemwDbv98HKeomp/kgFOfSy
|
||||
3AZjeCpctlsNqpjUuXa0/HudmH2WLxZ0fz8XeoRh8XM9UudNIecjrDqmAFrt/btQ
|
||||
/3guvlzhFCdhYPVGsUusKMECk/JG+Xx1/1ZjABEBAAG0LFBhcml0eSBTZWN1cml0
|
||||
eSBDb250YWN0IDxzZWN1cml0eUBwYXJpdHkuaW8+iQFUBBMBCAA+FiEE2uUVYCjP
|
||||
N6B8aTiDXQ8DAY0H3nMFAllyIAwCGwMFCQPCZwAFCwkIBwIGFQgJCgsCBBYCAwEC
|
||||
HgECF4AACgkQXQ8DAY0H3nM60wgAkS3A36Zc+upiaxU7tumcGv+an17j7gin0sif
|
||||
+0ELSjVfrXInM6ovai+NhUdcLkJ7tCrKS90fvlaELK5Sg9CXBWCTFccKN4A/B7ey
|
||||
rOg2NPXUecnyBB/XqQgKYH7ujYlOlqBDXMfz6z8Hj6WToxg9PPMGGomyMGh8AWxM
|
||||
3yRPFs5RKt0VKgN++5N00oly5Y8ri5pgCidDvCLYMGTVDHFKwkuc9w6BlWlu1R1e
|
||||
/hXFWUFAP1ffTAul3QwyKhjPn2iotCdxXjvt48KaU8DN4iL7aMBN/ZBKqGS7yRdF
|
||||
D/JbJyaaJ0ZRvFSTSXy/sWY3z1B5mtCPBxco8hqqNfRkCwuZ6LkBDQRZciAMAQgA
|
||||
8BP8xrwe12TOUTqL/Vrbxv/FLdhKh53J6TrPKvC2TEEKOrTNo5ahRq+XOS5E7G2N
|
||||
x3b+fq8gR9BzFcldAx0XWUtGs/Wv++ulaSNqTBxj13J3G3WGsUfMKxRgj//piCUD
|
||||
bCFLQfGZdKk0M1o9QkPVARwwmvCNiNB/l++xGqPtfc44H5jWj3GoGvL2MkShPzrN
|
||||
yN/bJ+m+R5gtFGdInqa5KXBuxxuW25eDKJ+LzjbgUgeC76wNcfOiQHTdMkcupjdO
|
||||
bbGFwo10hcbRAOcZEv6//Zrlmk/6nPxEd2hN20St2bSN0+FqfZ267mWEu3ejsgF8
|
||||
ArdCpv5h4fBvJyNwiTZwIQARAQABiQE8BBgBCAAmFiEE2uUVYCjPN6B8aTiDXQ8D
|
||||
AY0H3nMFAllyIAwCGwwFCQPCZwAACgkQXQ8DAY0H3nNisggAl4fqhRlA34wIb190
|
||||
sqXHVxiCuzPaqS6krE9xAa1+gncX485OtcJNqnjugHm2rFE48lv7oasviuPXuInE
|
||||
/OgVFnXYv9d/Xx2JUeDs+bFTLouCDRY2Unh7KJZasfqnMcCHWcxHx5FvRNZRssaB
|
||||
WTZVo6sizPurGUtbpYe4/OLFhadBqAE0EUmVRFEUMc1YTnu4eLaRBzoWN4d2UWwi
|
||||
LN25RSrVSke7LTSFbgn9ntQrQ2smXSR+cdNkkfRCjFcpUaecvFl9HwIqoyVbT4Ym
|
||||
0hbpbbX/cJdc91tKa+psa29uMeGL/cgL9fAu19yNFRyOTMxjZnvql1X/WE1pLmoP
|
||||
ETBD1Q==
|
||||
=K9Qw
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
```
|
||||
|
||||
Important Legal Information:
|
||||
|
||||
Your submission might be eligible for a bug bounty. The bug bounty program is an experimental and discretionary rewards program for the Parity community to reward those who are helping to improve the Parity software. Rewards are at the sole discretion of Parity Technologies Ltd..
|
||||
|
||||
We are not able to issue rewards to individuals who are on sanctions lists or who are in countries on sanctions lists (e.g. North Korea, Iran, etc).
|
||||
|
||||
You are responsible for all taxes. All rewards are subject to applicable law.
|
||||
|
||||
Finally, your testing must not violate any law or compromise any data that is not yours.
|
9
chainspec/Cargo.toml
Normal file
9
chainspec/Cargo.toml
Normal file
@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "chainspec"
|
||||
version = "0.1.0"
|
||||
authors = ["debris <marek.kotewicz@gmail.com>"]
|
||||
|
||||
[dependencies]
|
||||
ethjson = { path = "../json" }
|
||||
serde_json = "1.0"
|
||||
serde_ignored = "0.0.4"
|
48
chainspec/src/main.rs
Normal file
48
chainspec/src/main.rs
Normal file
@ -0,0 +1,48 @@
|
||||
extern crate serde_json;
|
||||
extern crate serde_ignored;
|
||||
extern crate ethjson;
|
||||
|
||||
use std::collections::BTreeSet;
|
||||
use std::{fs, env, process};
|
||||
use ethjson::spec::Spec;
|
||||
|
||||
fn quit(s: &str) -> ! {
|
||||
println!("{}", s);
|
||||
process::exit(1);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut args = env::args();
|
||||
if args.len() != 2 {
|
||||
quit("You need to specify chainspec.json\n\
|
||||
\n\
|
||||
./chainspec <chainspec.json>");
|
||||
}
|
||||
|
||||
let path = args.nth(1).expect("args.len() == 2; qed");
|
||||
let file = match fs::File::open(&path) {
|
||||
Ok(file) => file,
|
||||
Err(_) => quit(&format!("{} could not be opened", path)),
|
||||
};
|
||||
|
||||
let mut unused = BTreeSet::new();
|
||||
let mut deserializer = serde_json::Deserializer::from_reader(file);
|
||||
|
||||
let spec: Result<Spec, _> = serde_ignored::deserialize(&mut deserializer, |field| {
|
||||
unused.insert(field.to_string());
|
||||
});
|
||||
|
||||
if let Err(err) = spec {
|
||||
quit(&format!("{} {}", path, err.to_string()));
|
||||
}
|
||||
|
||||
if !unused.is_empty() {
|
||||
let err = unused.into_iter()
|
||||
.map(|field| format!("{} unexpected field `{}`", path, field))
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
quit(&err);
|
||||
}
|
||||
|
||||
println!("{} is valid", path);
|
||||
}
|
@ -21,7 +21,7 @@ use hyper::method::Method;
|
||||
use hyper::status::StatusCode;
|
||||
|
||||
use api::{response, types};
|
||||
use api::time::TimeChecker;
|
||||
use api::time::{TimeChecker, MAX_DRIFT};
|
||||
use apps::fetcher::Fetcher;
|
||||
use handlers::{self, extract_url};
|
||||
use endpoint::{Endpoint, Handler, EndpointPath};
|
||||
@ -122,7 +122,6 @@ impl RestApiRouter {
|
||||
|
||||
// Check time
|
||||
let time = {
|
||||
const MAX_DRIFT: i64 = 500;
|
||||
let (status, message, details) = match time {
|
||||
Ok(Ok(diff)) if diff < MAX_DRIFT && diff > -MAX_DRIFT => {
|
||||
(HealthStatus::Ok, "".into(), diff)
|
||||
@ -147,13 +146,7 @@ impl RestApiRouter {
|
||||
HealthInfo { status, message, details, }
|
||||
};
|
||||
|
||||
let status = if [&peers.status, &sync.status, &time.status].iter().any(|x| *x != &HealthStatus::Ok) {
|
||||
StatusCode::PreconditionFailed // HTTP 412
|
||||
} else {
|
||||
StatusCode::Ok // HTTP 200
|
||||
};
|
||||
|
||||
response::as_json(status, &Health { peers, sync, time })
|
||||
response::as_json(StatusCode::Ok, &Health { peers, sync, time })
|
||||
};
|
||||
|
||||
let time = self.api.time.time_drift();
|
||||
|
@ -33,17 +33,22 @@
|
||||
|
||||
use std::io;
|
||||
use std::{fmt, mem, time};
|
||||
|
||||
use std::collections::VecDeque;
|
||||
use std::sync::atomic::{self, AtomicUsize};
|
||||
use std::sync::Arc;
|
||||
|
||||
use futures::{self, Future, BoxFuture};
|
||||
use futures_cpupool::CpuPool;
|
||||
use futures::future::{self, IntoFuture};
|
||||
use futures_cpupool::{CpuPool, CpuFuture};
|
||||
use ntp;
|
||||
use time::{Duration, Timespec};
|
||||
use util::{Arc, RwLock};
|
||||
use util::RwLock;
|
||||
|
||||
/// Time checker error.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Error {
|
||||
/// No servers are currently available for a query.
|
||||
NoServersAvailable,
|
||||
/// There was an error when trying to reach the NTP server.
|
||||
Ntp(String),
|
||||
/// IO error when reading NTP response.
|
||||
@ -55,6 +60,7 @@ impl fmt::Display for Error {
|
||||
use self::Error::*;
|
||||
|
||||
match *self {
|
||||
NoServersAvailable => write!(fmt, "No NTP servers available"),
|
||||
Ntp(ref err) => write!(fmt, "NTP error: {}", err),
|
||||
Io(ref err) => write!(fmt, "Connection Error: {}", err),
|
||||
}
|
||||
@ -71,52 +77,123 @@ impl From<ntp::errors::Error> for Error {
|
||||
|
||||
/// NTP time drift checker.
|
||||
pub trait Ntp {
|
||||
/// Returned Future.
|
||||
type Future: IntoFuture<Item=Duration, Error=Error>;
|
||||
|
||||
/// Returns the current time drift.
|
||||
fn drift(&self) -> BoxFuture<Duration, Error>;
|
||||
fn drift(&self) -> Self::Future;
|
||||
}
|
||||
|
||||
const SERVER_MAX_POLL_INTERVAL_SECS: u64 = 60;
|
||||
#[derive(Debug)]
|
||||
struct Server {
|
||||
pub address: String,
|
||||
next_call: RwLock<time::Instant>,
|
||||
failures: AtomicUsize,
|
||||
}
|
||||
|
||||
impl Server {
|
||||
pub fn is_available(&self) -> bool {
|
||||
*self.next_call.read() < time::Instant::now()
|
||||
}
|
||||
|
||||
pub fn report_success(&self) {
|
||||
self.failures.store(0, atomic::Ordering::SeqCst);
|
||||
self.update_next_call(1)
|
||||
}
|
||||
|
||||
pub fn report_failure(&self) {
|
||||
let errors = self.failures.fetch_add(1, atomic::Ordering::SeqCst);
|
||||
self.update_next_call(1 << errors)
|
||||
}
|
||||
|
||||
fn update_next_call(&self, delay: usize) {
|
||||
*self.next_call.write() = time::Instant::now() + time::Duration::from_secs(delay as u64 * SERVER_MAX_POLL_INTERVAL_SECS);
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: AsRef<str>> From<T> for Server {
|
||||
fn from(t: T) -> Self {
|
||||
Server {
|
||||
address: t.as_ref().to_owned(),
|
||||
next_call: RwLock::new(time::Instant::now()),
|
||||
failures: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// NTP client using the SNTP algorithm for calculating drift.
|
||||
#[derive(Clone)]
|
||||
pub struct SimpleNtp {
|
||||
address: Arc<String>,
|
||||
addresses: Vec<Arc<Server>>,
|
||||
pool: CpuPool,
|
||||
}
|
||||
|
||||
impl fmt::Debug for SimpleNtp {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Ntp {{ address: {} }}", self.address)
|
||||
f
|
||||
.debug_struct("SimpleNtp")
|
||||
.field("addresses", &self.addresses)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl SimpleNtp {
|
||||
fn new(address: &str, pool: CpuPool) -> SimpleNtp {
|
||||
fn new<T: AsRef<str>>(addresses: &[T], pool: CpuPool) -> SimpleNtp {
|
||||
SimpleNtp {
|
||||
address: Arc::new(address.to_owned()),
|
||||
addresses: addresses.iter().map(Server::from).map(Arc::new).collect(),
|
||||
pool: pool,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Ntp for SimpleNtp {
|
||||
fn drift(&self) -> BoxFuture<Duration, Error> {
|
||||
let address = self.address.clone();
|
||||
self.pool.spawn_fn(move || {
|
||||
let packet = ntp::request(&*address)?;
|
||||
let dest_time = ::time::now_utc().to_timespec();
|
||||
let orig_time = Timespec::from(packet.orig_time);
|
||||
let recv_time = Timespec::from(packet.recv_time);
|
||||
let transmit_time = Timespec::from(packet.transmit_time);
|
||||
type Future = future::Either<
|
||||
CpuFuture<Duration, Error>,
|
||||
future::FutureResult<Duration, Error>,
|
||||
>;
|
||||
|
||||
let drift = ((recv_time - orig_time) + (transmit_time - dest_time)) / 2;
|
||||
fn drift(&self) -> Self::Future {
|
||||
use self::future::Either::{A, B};
|
||||
|
||||
Ok(drift)
|
||||
}).boxed()
|
||||
let server = self.addresses.iter().find(|server| server.is_available());
|
||||
server.map(|server| {
|
||||
let server = server.clone();
|
||||
A(self.pool.spawn_fn(move || {
|
||||
debug!(target: "dapps", "Fetching time from {}.", server.address);
|
||||
|
||||
match ntp::request(&server.address) {
|
||||
Ok(packet) => {
|
||||
let dest_time = ::time::now_utc().to_timespec();
|
||||
let orig_time = Timespec::from(packet.orig_time);
|
||||
let recv_time = Timespec::from(packet.recv_time);
|
||||
let transmit_time = Timespec::from(packet.transmit_time);
|
||||
|
||||
let drift = ((recv_time - orig_time) + (transmit_time - dest_time)) / 2;
|
||||
|
||||
server.report_success();
|
||||
Ok(drift)
|
||||
},
|
||||
Err(err) => {
|
||||
server.report_failure();
|
||||
Err(err.into())
|
||||
},
|
||||
}
|
||||
}))
|
||||
}).unwrap_or_else(|| B(future::err(Error::NoServersAvailable)))
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE In a positive scenario first results will be seen after:
|
||||
// MAX_RESULTS * UPDATE_TIMEOUT_INCOMPLETE_SECS seconds.
|
||||
const MAX_RESULTS: usize = 4;
|
||||
const UPDATE_TIMEOUT_OK_SECS: u64 = 30;
|
||||
const UPDATE_TIMEOUT_ERR_SECS: u64 = 2;
|
||||
const UPDATE_TIMEOUT_OK_SECS: u64 = 6 * 60 * 60;
|
||||
const UPDATE_TIMEOUT_WARN_SECS: u64 = 15 * 60;
|
||||
const UPDATE_TIMEOUT_ERR_SECS: u64 = 60;
|
||||
const UPDATE_TIMEOUT_INCOMPLETE_SECS: u64 = 10;
|
||||
|
||||
/// Maximal valid time drift.
|
||||
pub const MAX_DRIFT: i64 = 500;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
/// A time checker.
|
||||
@ -127,13 +204,13 @@ pub struct TimeChecker<N: Ntp = SimpleNtp> {
|
||||
|
||||
impl TimeChecker<SimpleNtp> {
|
||||
/// Creates new time checker given the NTP server address.
|
||||
pub fn new(ntp_address: String, pool: CpuPool) -> Self {
|
||||
pub fn new<T: AsRef<str>>(ntp_addresses: &[T], pool: CpuPool) -> Self {
|
||||
let last_result = Arc::new(RwLock::new(
|
||||
// Assume everything is ok at the very beginning.
|
||||
(time::Instant::now(), vec![Ok(0)].into())
|
||||
));
|
||||
|
||||
let ntp = SimpleNtp::new(&ntp_address, pool);
|
||||
let ntp = SimpleNtp::new(ntp_addresses, pool);
|
||||
|
||||
TimeChecker {
|
||||
ntp,
|
||||
@ -142,22 +219,34 @@ impl TimeChecker<SimpleNtp> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<N: Ntp> TimeChecker<N> {
|
||||
impl<N: Ntp> TimeChecker<N> where <N::Future as IntoFuture>::Future: Send + 'static {
|
||||
/// Updates the time
|
||||
pub fn update(&self) -> BoxFuture<i64, Error> {
|
||||
trace!(target: "dapps", "Updating time from NTP.");
|
||||
let last_result = self.last_result.clone();
|
||||
self.ntp.drift().then(move |res| {
|
||||
self.ntp.drift().into_future().then(move |res| {
|
||||
let res = res.map(|d| d.num_milliseconds());
|
||||
|
||||
if let Err(Error::NoServersAvailable) = res {
|
||||
debug!(target: "dapps", "No NTP servers available. Selecting an older result.");
|
||||
return select_result(last_result.read().1.iter());
|
||||
}
|
||||
|
||||
// Update the results.
|
||||
let mut results = mem::replace(&mut last_result.write().1, VecDeque::new());
|
||||
let has_all_results = results.len() >= MAX_RESULTS;
|
||||
let valid_till = time::Instant::now() + time::Duration::from_secs(
|
||||
if res.is_ok() && results.len() == MAX_RESULTS {
|
||||
UPDATE_TIMEOUT_OK_SECS
|
||||
} else {
|
||||
UPDATE_TIMEOUT_ERR_SECS
|
||||
match res {
|
||||
Ok(time) if has_all_results && time < MAX_DRIFT => UPDATE_TIMEOUT_OK_SECS,
|
||||
Ok(_) if has_all_results => UPDATE_TIMEOUT_WARN_SECS,
|
||||
Err(_) if has_all_results => UPDATE_TIMEOUT_ERR_SECS,
|
||||
_ => UPDATE_TIMEOUT_INCOMPLETE_SECS,
|
||||
}
|
||||
);
|
||||
|
||||
trace!(target: "dapps", "New time drift received: {:?}", res);
|
||||
// Push the result.
|
||||
results.push_back(res.map(|d| d.num_milliseconds()));
|
||||
results.push_back(res);
|
||||
while results.len() > MAX_RESULTS {
|
||||
results.pop_front();
|
||||
}
|
||||
@ -202,7 +291,7 @@ mod tests {
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::time::Instant;
|
||||
use time::Duration;
|
||||
use futures::{self, BoxFuture, Future};
|
||||
use futures::{future, Future};
|
||||
use super::{Ntp, TimeChecker, Error};
|
||||
use util::RwLock;
|
||||
|
||||
@ -217,15 +306,17 @@ mod tests {
|
||||
}
|
||||
|
||||
impl Ntp for FakeNtp {
|
||||
fn drift(&self) -> BoxFuture<Duration, Error> {
|
||||
type Future = future::FutureResult<Duration, Error>;
|
||||
|
||||
fn drift(&self) -> Self::Future {
|
||||
self.1.set(self.1.get() + 1);
|
||||
futures::future::ok(self.0.borrow_mut().pop().expect("Unexpected call to drift().")).boxed()
|
||||
future::ok(self.0.borrow_mut().pop().expect("Unexpected call to drift()."))
|
||||
}
|
||||
}
|
||||
|
||||
fn time_checker() -> TimeChecker<FakeNtp> {
|
||||
let last_result = Arc::new(RwLock::new(
|
||||
(Instant::now(), vec![Err(Error::Ntp("NTP server unavailable.".into()))].into())
|
||||
(Instant::now(), vec![Err(Error::Ntp("NTP server unavailable".into()))].into())
|
||||
));
|
||||
|
||||
TimeChecker {
|
||||
|
@ -68,6 +68,9 @@ pub fn add_security_headers(headers: &mut header::Headers, embeddable_on: Embedd
|
||||
b"font-src 'self' data: https:;".to_vec(),
|
||||
// Allow inline scripts and scripts eval (webpack/jsconsole)
|
||||
b"script-src 'self' 'unsafe-inline' 'unsafe-eval';".to_vec(),
|
||||
// Same restrictions as script-src (fallback) with additional
|
||||
// blob: that is required for camera access (worker)
|
||||
b"worker-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ;".to_vec(),
|
||||
// Restrict everything else to the same origin.
|
||||
b"default-src 'self';".to_vec(),
|
||||
// Run in sandbox mode (although it's not fully safe since we allow same-origin and script)
|
||||
@ -140,4 +143,3 @@ pub fn convert_uri_to_url(uri: &uri::RequestUri, host: Option<&header::Host>) ->
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ impl Middleware {
|
||||
|
||||
/// Creates new middleware for UI server.
|
||||
pub fn ui<F: Fetch>(
|
||||
ntp_server: &str,
|
||||
ntp_servers: &[String],
|
||||
pool: CpuPool,
|
||||
remote: Remote,
|
||||
dapps_domain: &str,
|
||||
@ -146,7 +146,7 @@ impl Middleware {
|
||||
).embeddable_on(None).allow_dapps(false));
|
||||
let special = {
|
||||
let mut special = special_endpoints(
|
||||
ntp_server,
|
||||
ntp_servers,
|
||||
pool,
|
||||
content_fetcher.clone(),
|
||||
remote.clone(),
|
||||
@ -171,7 +171,7 @@ impl Middleware {
|
||||
|
||||
/// Creates new Dapps server middleware.
|
||||
pub fn dapps<F: Fetch>(
|
||||
ntp_server: &str,
|
||||
ntp_servers: &[String],
|
||||
pool: CpuPool,
|
||||
remote: Remote,
|
||||
ui_address: Option<(String, u16)>,
|
||||
@ -203,7 +203,7 @@ impl Middleware {
|
||||
|
||||
let special = {
|
||||
let mut special = special_endpoints(
|
||||
ntp_server,
|
||||
ntp_servers,
|
||||
pool,
|
||||
content_fetcher.clone(),
|
||||
remote.clone(),
|
||||
@ -237,8 +237,8 @@ impl http::RequestMiddleware for Middleware {
|
||||
}
|
||||
}
|
||||
|
||||
fn special_endpoints(
|
||||
ntp_server: &str,
|
||||
fn special_endpoints<T: AsRef<str>>(
|
||||
ntp_servers: &[T],
|
||||
pool: CpuPool,
|
||||
content_fetcher: Arc<apps::fetcher::Fetcher>,
|
||||
remote: Remote,
|
||||
@ -250,7 +250,7 @@ fn special_endpoints(
|
||||
special.insert(router::SpecialEndpoint::Api, Some(api::RestApi::new(
|
||||
content_fetcher,
|
||||
sync_status,
|
||||
api::TimeChecker::new(ntp_server.into(), pool),
|
||||
api::TimeChecker::new(ntp_servers, pool),
|
||||
remote,
|
||||
)));
|
||||
special
|
||||
|
@ -255,7 +255,7 @@ impl Server {
|
||||
fetch: F,
|
||||
) -> Result<Server, http::Error> {
|
||||
let middleware = Middleware::dapps(
|
||||
"pool.ntp.org:123",
|
||||
&["0.pool.ntp.org:123".into(), "1.pool.ntp.org:123".into()],
|
||||
CpuPool::new(4),
|
||||
remote,
|
||||
signer_address,
|
||||
|
@ -4,7 +4,7 @@ WORKDIR /build
|
||||
#ENV for build TAG
|
||||
ARG BUILD_TAG
|
||||
ENV BUILD_TAG ${BUILD_TAG:-master}
|
||||
RUN echo $BUILD_TAG
|
||||
RUN echo "Build tag:" $BUILD_TAG
|
||||
# install tools and dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --force-yes --no-install-recommends \
|
||||
@ -48,7 +48,7 @@ RUN apt-get update && \
|
||||
# show backtraces
|
||||
RUST_BACKTRACE=1 && \
|
||||
# build parity
|
||||
cd /build&&git clone https://github.com/paritytech/parity && \
|
||||
cd /build&&git clone https://github.com/paritytech/parity && \
|
||||
cd parity && \
|
||||
git pull&& \
|
||||
git checkout $BUILD_TAG && \
|
||||
|
@ -10,3 +10,7 @@ log = "0.3"
|
||||
sha3 = { path = "../util/sha3" }
|
||||
primal = "0.2.3"
|
||||
parking_lot = "0.4"
|
||||
crunchy = "0.1.0"
|
||||
|
||||
[features]
|
||||
benches = []
|
@ -123,7 +123,9 @@ impl Light {
|
||||
}
|
||||
let num_nodes = cache_size / NODE_BYTES;
|
||||
let mut nodes: Vec<Node> = Vec::with_capacity(num_nodes);
|
||||
nodes.resize(num_nodes, unsafe { mem::uninitialized() });
|
||||
|
||||
unsafe { nodes.set_len(num_nodes) };
|
||||
|
||||
let buf = unsafe { slice::from_raw_parts_mut(nodes.as_mut_ptr() as *mut u8, cache_size) };
|
||||
file.read_exact(buf)?;
|
||||
Ok(Light {
|
||||
@ -208,17 +210,20 @@ pub fn slow_get_seedhash(block_number: u64) -> H256 {
|
||||
SeedHashCompute::resume_compute_seedhash([0u8; 32], 0, block_number / ETHASH_EPOCH_LENGTH)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn fnv_hash(x: u32, y: u32) -> u32 {
|
||||
return x.wrapping_mul(FNV_PRIME) ^ y;
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn sha3_512(input: &[u8], output: &mut [u8]) {
|
||||
unsafe { sha3::sha3_512(output.as_mut_ptr(), output.len(), input.as_ptr(), input.len()) };
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn sha3_512_inplace(input: &mut [u8]) {
|
||||
// This is safe since `sha3_*` uses an internal buffer and copies the result to the output. This
|
||||
// means that we can reuse the input buffer for both input and output.
|
||||
unsafe { sha3::sha3_512(input.as_mut_ptr(), input.len(), input.as_ptr(), input.len()) };
|
||||
}
|
||||
|
||||
fn get_cache_size(block_number: u64) -> usize {
|
||||
let mut sz: u64 = CACHE_BYTES_INIT + CACHE_BYTES_GROWTH * (block_number / ETHASH_EPOCH_LENGTH);
|
||||
sz = sz - NODE_BYTES as u64;
|
||||
@ -228,7 +233,6 @@ fn get_cache_size(block_number: u64) -> usize {
|
||||
sz as usize
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_data_size(block_number: u64) -> usize {
|
||||
let mut sz: u64 = DATASET_BYTES_INIT + DATASET_BYTES_GROWTH * (block_number / ETHASH_EPOCH_LENGTH);
|
||||
sz = sz - ETHASH_MIX_BYTES as u64;
|
||||
@ -238,7 +242,6 @@ fn get_data_size(block_number: u64) -> usize {
|
||||
sz as usize
|
||||
}
|
||||
|
||||
|
||||
/// Difficulty quick check for POW preverification
|
||||
///
|
||||
/// `header_hash` The hash of the header
|
||||
@ -246,17 +249,27 @@ fn get_data_size(block_number: u64) -> usize {
|
||||
/// `mix_hash` The mix digest hash
|
||||
/// Boundary recovered from mix hash
|
||||
pub fn quick_get_difficulty(header_hash: &H256, nonce: u64, mix_hash: &H256) -> H256 {
|
||||
let mut buf = [0u8; 64 + 32];
|
||||
unsafe { ptr::copy_nonoverlapping(header_hash.as_ptr(), buf.as_mut_ptr(), 32) };
|
||||
unsafe { ptr::copy_nonoverlapping(mem::transmute(&nonce), buf[32..].as_mut_ptr(), 8) };
|
||||
unsafe {
|
||||
// This is safe - the `sha3_512` call below reads the first 40 bytes (which we explicitly set
|
||||
// with two `copy_nonoverlapping` calls) but writes the first 64, and then we explicitly write
|
||||
// the next 32 bytes before we read the whole thing with `sha3_256`.
|
||||
//
|
||||
// This cannot be elided by the compiler as it doesn't know the implementation of
|
||||
// `sha3_512`.
|
||||
let mut buf: [u8; 64 + 32] = mem::uninitialized();
|
||||
|
||||
unsafe { sha3::sha3_512(buf.as_mut_ptr(), 64, buf.as_ptr(), 40) };
|
||||
unsafe { ptr::copy_nonoverlapping(mix_hash.as_ptr(), buf[64..].as_mut_ptr(), 32) };
|
||||
ptr::copy_nonoverlapping(header_hash.as_ptr(), buf.as_mut_ptr(), 32);
|
||||
ptr::copy_nonoverlapping(mem::transmute(&nonce), buf[32..].as_mut_ptr(), 8);
|
||||
|
||||
let mut hash = [0u8; 32];
|
||||
unsafe { sha3::sha3_256(hash.as_mut_ptr(), hash.len(), buf.as_ptr(), buf.len()) };
|
||||
hash.as_mut_ptr();
|
||||
hash
|
||||
sha3::sha3_512(buf.as_mut_ptr(), 64, buf.as_ptr(), 40);
|
||||
ptr::copy_nonoverlapping(mix_hash.as_ptr(), buf[64..].as_mut_ptr(), 32);
|
||||
|
||||
// This is initialized in `sha3_256`
|
||||
let mut hash: [u8; 32] = mem::uninitialized();
|
||||
sha3::sha3_256(hash.as_mut_ptr(), hash.len(), buf.as_ptr(), buf.len());
|
||||
|
||||
hash
|
||||
}
|
||||
}
|
||||
|
||||
/// Calculate the light client data
|
||||
@ -269,78 +282,194 @@ pub fn light_compute(light: &Light, header_hash: &H256, nonce: u64) -> ProofOfWo
|
||||
}
|
||||
|
||||
fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64) -> ProofOfWork {
|
||||
macro_rules! make_const_array {
|
||||
($n:expr, $value:expr) => {{
|
||||
// We use explicit lifetimes to ensure that val's borrow is invalidated until the
|
||||
// transmuted val dies.
|
||||
unsafe fn make_const_array<'a, T, U>(val: &'a mut [T]) -> &'a mut [U; $n] {
|
||||
use ::std::mem;
|
||||
|
||||
debug_assert_eq!(val.len() * mem::size_of::<T>(), $n * mem::size_of::<U>());
|
||||
mem::transmute(val.as_mut_ptr())
|
||||
}
|
||||
|
||||
make_const_array($value)
|
||||
}}
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
struct MixBuf {
|
||||
half_mix: Node,
|
||||
compress_bytes: [u8; MIX_WORDS],
|
||||
};
|
||||
|
||||
if full_size % MIX_WORDS != 0 {
|
||||
panic!("Unaligned full size");
|
||||
}
|
||||
// pack hash and nonce together into first 40 bytes of s_mix
|
||||
let mut s_mix: [Node; MIX_NODES + 1] = [Node::default(), Node::default(), Node::default()];
|
||||
unsafe { ptr::copy_nonoverlapping(header_hash.as_ptr(), s_mix.get_unchecked_mut(0).bytes.as_mut_ptr(), 32) };
|
||||
unsafe { ptr::copy_nonoverlapping(mem::transmute(&nonce), s_mix.get_unchecked_mut(0).bytes[32..].as_mut_ptr(), 8) };
|
||||
|
||||
// compute sha3-512 hash and replicate across mix
|
||||
unsafe {
|
||||
sha3::sha3_512(s_mix.get_unchecked_mut(0).bytes.as_mut_ptr(), NODE_BYTES, s_mix.get_unchecked(0).bytes.as_ptr(), 40);
|
||||
let (f_mix, mut mix) = s_mix.split_at_mut(1);
|
||||
for w in 0..MIX_WORDS {
|
||||
*mix.get_unchecked_mut(0).as_words_mut().get_unchecked_mut(w) = *f_mix.get_unchecked(0).as_words().get_unchecked(w % NODE_WORDS);
|
||||
}
|
||||
// You may be asking yourself: what in the name of Crypto Jesus is going on here? So: we need
|
||||
// `half_mix` and `compress_bytes` in a single array later down in the code (we hash them
|
||||
// together to create `value`) so that we can hash the full array. However, we do a bunch of
|
||||
// reading and writing to these variables first. We originally allocated two arrays and then
|
||||
// stuck them together with `ptr::copy_nonoverlapping` at the end, but this method is
|
||||
// _significantly_ faster - by my benchmarks, a consistent 3-5%. This is the most ridiculous
|
||||
// optimization I have ever done and I am so sorry. I can only chalk it up to cache locality
|
||||
// improvements, since I can't imagine that 3-5% of our runtime is taken up by catting two
|
||||
// arrays together.
|
||||
let mut buf: MixBuf = MixBuf {
|
||||
half_mix: unsafe {
|
||||
// Pack `header_hash` and `nonce` together
|
||||
// We explicitly write the first 40 bytes, leaving the last 24 as uninitialized. Then
|
||||
// `sha3_512` reads the first 40 bytes (4th parameter) and overwrites the entire array,
|
||||
// leaving it fully initialized.
|
||||
let mut out: [u8; NODE_BYTES] = mem::uninitialized();
|
||||
|
||||
let page_size = 4 * MIX_WORDS;
|
||||
let num_full_pages = (full_size / page_size) as u32;
|
||||
let cache: &[Node] = &light.cache; // deref once for better performance
|
||||
ptr::copy_nonoverlapping(
|
||||
header_hash.as_ptr(),
|
||||
out.as_mut_ptr(),
|
||||
header_hash.len(),
|
||||
);
|
||||
ptr::copy_nonoverlapping(
|
||||
mem::transmute(&nonce),
|
||||
out[header_hash.len()..].as_mut_ptr(),
|
||||
mem::size_of::<u64>(),
|
||||
);
|
||||
|
||||
for i in 0..(ETHASH_ACCESSES as u32) {
|
||||
let index = fnv_hash(f_mix.get_unchecked(0).as_words().get_unchecked(0) ^ i, *mix.get_unchecked(0).as_words().get_unchecked((i as usize) % MIX_WORDS)) % num_full_pages;
|
||||
for n in 0..MIX_NODES {
|
||||
let tmp_node = calculate_dag_item(index * MIX_NODES as u32 + n as u32, cache);
|
||||
for w in 0..NODE_WORDS {
|
||||
*mix.get_unchecked_mut(n).as_words_mut().get_unchecked_mut(w) = fnv_hash(*mix.get_unchecked(n).as_words().get_unchecked(w), *tmp_node.as_words().get_unchecked(w));
|
||||
// compute sha3-512 hash and replicate across mix
|
||||
sha3::sha3_512(
|
||||
out.as_mut_ptr(),
|
||||
NODE_BYTES,
|
||||
out.as_ptr(),
|
||||
header_hash.len() + mem::size_of::<u64>()
|
||||
);
|
||||
|
||||
Node { bytes: out }
|
||||
},
|
||||
// This is fully initialized before being read, see `let mut compress = ...` below
|
||||
compress_bytes: unsafe { mem::uninitialized() },
|
||||
};
|
||||
|
||||
let mut mix: [_; MIX_NODES] = [buf.half_mix.clone(), buf.half_mix.clone()];
|
||||
|
||||
let page_size = 4 * MIX_WORDS;
|
||||
let num_full_pages = (full_size / page_size) as u32;
|
||||
// deref once for better performance
|
||||
let cache: &[Node] = &light.cache;
|
||||
let first_val = buf.half_mix.as_words()[0];
|
||||
|
||||
debug_assert_eq!(MIX_NODES, 2);
|
||||
debug_assert_eq!(NODE_WORDS, 16);
|
||||
|
||||
for i in 0..ETHASH_ACCESSES as u32 {
|
||||
let index = {
|
||||
// This is trivially safe, but does not work on big-endian. The safety of this is
|
||||
// asserted in debug builds (see the definition of `make_const_array!`).
|
||||
let mix_words: &mut [u32; MIX_WORDS] = unsafe {
|
||||
make_const_array!(MIX_WORDS, &mut mix)
|
||||
};
|
||||
|
||||
fnv_hash(
|
||||
first_val ^ i,
|
||||
mix_words[i as usize % MIX_WORDS]
|
||||
) % num_full_pages
|
||||
};
|
||||
|
||||
unroll! {
|
||||
// MIX_NODES
|
||||
for n in 0..2 {
|
||||
let tmp_node = calculate_dag_item(
|
||||
index * MIX_NODES as u32 + n as u32,
|
||||
cache,
|
||||
);
|
||||
|
||||
unroll! {
|
||||
// NODE_WORDS
|
||||
for w in 0..16 {
|
||||
mix[n].as_words_mut()[w] =
|
||||
fnv_hash(
|
||||
mix[n].as_words()[w],
|
||||
tmp_node.as_words()[w],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// compress mix
|
||||
for i in 0..(MIX_WORDS / 4) {
|
||||
let w = i * 4;
|
||||
let mut reduction = *mix.get_unchecked(0).as_words().get_unchecked(w + 0);
|
||||
reduction = reduction.wrapping_mul(FNV_PRIME) ^ *mix.get_unchecked(0).as_words().get_unchecked(w + 1);
|
||||
reduction = reduction.wrapping_mul(FNV_PRIME) ^ *mix.get_unchecked(0).as_words().get_unchecked(w + 2);
|
||||
reduction = reduction.wrapping_mul(FNV_PRIME) ^ *mix.get_unchecked(0).as_words().get_unchecked(w + 3);
|
||||
*mix.get_unchecked_mut(0).as_words_mut().get_unchecked_mut(i) = reduction;
|
||||
}
|
||||
let mix_words: [u32; MIX_WORDS] = unsafe { mem::transmute(mix) };
|
||||
|
||||
let mut mix_hash = [0u8; 32];
|
||||
let mut buf = [0u8; 32 + 64];
|
||||
ptr::copy_nonoverlapping(f_mix.get_unchecked_mut(0).bytes.as_ptr(), buf.as_mut_ptr(), 64);
|
||||
ptr::copy_nonoverlapping(mix.get_unchecked_mut(0).bytes.as_ptr(), buf[64..].as_mut_ptr(), 32);
|
||||
ptr::copy_nonoverlapping(mix.get_unchecked_mut(0).bytes.as_ptr(), mix_hash.as_mut_ptr(), 32);
|
||||
let mut value: H256 = [0u8; 32];
|
||||
sha3::sha3_256(value.as_mut_ptr(), value.len(), buf.as_ptr(), buf.len());
|
||||
ProofOfWork {
|
||||
mix_hash: mix_hash,
|
||||
value: value,
|
||||
{
|
||||
// This is an uninitialized buffer to begin with, but we iterate precisely `compress.len()`
|
||||
// times and set each index, leaving the array fully initialized. THIS ONLY WORKS ON LITTLE-
|
||||
// ENDIAN MACHINES. See a future PR to make this and the rest of the code work correctly on
|
||||
// big-endian arches like mips.
|
||||
let mut compress: &mut [u32; MIX_WORDS / 4] = unsafe {
|
||||
make_const_array!(MIX_WORDS / 4, &mut buf.compress_bytes)
|
||||
};
|
||||
|
||||
// Compress mix
|
||||
debug_assert_eq!(MIX_WORDS / 4, 8);
|
||||
unroll! {
|
||||
for i in 0..8 {
|
||||
let w = i * 4;
|
||||
|
||||
let mut reduction = mix_words[w + 0];
|
||||
reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 1];
|
||||
reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 2];
|
||||
reduction = reduction.wrapping_mul(FNV_PRIME) ^ mix_words[w + 3];
|
||||
compress[i] = reduction;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mix_hash = buf.compress_bytes;
|
||||
|
||||
let value: H256 = unsafe {
|
||||
// We can interpret the buffer as an array of `u8`s, since it's `repr(C)`.
|
||||
let read_ptr: *const u8 = mem::transmute(&buf);
|
||||
// We overwrite the second half since `sha3_256` has an internal buffer and so allows
|
||||
// overlapping arrays as input.
|
||||
let write_ptr: *mut u8 = mem::transmute(&mut buf.compress_bytes);
|
||||
sha3::sha3_256(
|
||||
write_ptr,
|
||||
buf.compress_bytes.len(),
|
||||
read_ptr,
|
||||
buf.half_mix.bytes.len() + buf.compress_bytes.len(),
|
||||
);
|
||||
buf.compress_bytes
|
||||
};
|
||||
|
||||
ProofOfWork {
|
||||
mix_hash: mix_hash,
|
||||
value: value,
|
||||
}
|
||||
}
|
||||
|
||||
fn calculate_dag_item(node_index: u32, cache: &[Node]) -> Node {
|
||||
unsafe {
|
||||
let num_parent_nodes = cache.len();
|
||||
let init = cache.get_unchecked(node_index as usize % num_parent_nodes);
|
||||
let mut ret = init.clone();
|
||||
*ret.as_words_mut().get_unchecked_mut(0) ^= node_index;
|
||||
sha3::sha3_512(ret.bytes.as_mut_ptr(), ret.bytes.len(), ret.bytes.as_ptr(), ret.bytes.len());
|
||||
let num_parent_nodes = cache.len();
|
||||
let mut ret = cache[node_index as usize % num_parent_nodes].clone();
|
||||
ret.as_words_mut()[0] ^= node_index;
|
||||
|
||||
for i in 0..ETHASH_DATASET_PARENTS {
|
||||
let parent_index = fnv_hash(node_index ^ i, *ret.as_words().get_unchecked(i as usize % NODE_WORDS)) % num_parent_nodes as u32;
|
||||
let parent = cache.get_unchecked(parent_index as usize);
|
||||
for w in 0..NODE_WORDS {
|
||||
*ret.as_words_mut().get_unchecked_mut(w) = fnv_hash(*ret.as_words().get_unchecked(w), *parent.as_words().get_unchecked(w));
|
||||
sha3_512_inplace(&mut ret.bytes);
|
||||
|
||||
debug_assert_eq!(NODE_WORDS, 16);
|
||||
for i in 0..ETHASH_DATASET_PARENTS as u32 {
|
||||
let parent_index = fnv_hash(
|
||||
node_index ^ i,
|
||||
ret.as_words()[i as usize % NODE_WORDS],
|
||||
) % num_parent_nodes as u32;
|
||||
let parent = &cache[parent_index as usize];
|
||||
|
||||
unroll! {
|
||||
for w in 0..16 {
|
||||
ret.as_words_mut()[w] = fnv_hash(ret.as_words()[w], parent.as_words()[w]);
|
||||
}
|
||||
}
|
||||
sha3::sha3_512(ret.bytes.as_mut_ptr(), ret.bytes.len(), ret.bytes.as_ptr(), ret.bytes.len());
|
||||
ret
|
||||
}
|
||||
|
||||
sha3_512_inplace(&mut ret.bytes);
|
||||
|
||||
ret
|
||||
}
|
||||
|
||||
fn light_new<T: AsRef<Path>>(cache_dir: T, block_number: u64) -> Light {
|
||||
@ -351,21 +480,30 @@ fn light_new<T: AsRef<Path>>(cache_dir: T, block_number: u64) -> Light {
|
||||
assert!(cache_size % NODE_BYTES == 0, "Unaligned cache size");
|
||||
let num_nodes = cache_size / NODE_BYTES;
|
||||
|
||||
let mut nodes = Vec::with_capacity(num_nodes);
|
||||
nodes.resize(num_nodes, Node::default());
|
||||
let mut nodes: Vec<Node> = Vec::with_capacity(num_nodes);
|
||||
unsafe {
|
||||
// Use uninit instead of unnecessarily writing `size_of::<Node>() * num_nodes` 0s
|
||||
nodes.set_len(num_nodes);
|
||||
|
||||
sha3_512(&seedhash[0..32], &mut nodes.get_unchecked_mut(0).bytes);
|
||||
for i in 1..num_nodes {
|
||||
sha3::sha3_512(nodes.get_unchecked_mut(i).bytes.as_mut_ptr(), NODE_BYTES, nodes.get_unchecked(i - 1).bytes.as_ptr(), NODE_BYTES);
|
||||
}
|
||||
|
||||
debug_assert_eq!(NODE_WORDS, 16);
|
||||
|
||||
// This _should_ get unrolled by the compiler, since it's not using the loop variable.
|
||||
for _ in 0..ETHASH_CACHE_ROUNDS {
|
||||
for i in 0..num_nodes {
|
||||
let idx = *nodes.get_unchecked_mut(i).as_words().get_unchecked(0) as usize % num_nodes;
|
||||
let mut data = nodes.get_unchecked((num_nodes - 1 + i) % num_nodes).clone();
|
||||
for w in 0..NODE_WORDS {
|
||||
*data.as_words_mut().get_unchecked_mut(w) ^= *nodes.get_unchecked(idx).as_words().get_unchecked(w);
|
||||
|
||||
unroll! {
|
||||
for w in 0..16 {
|
||||
*data.as_words_mut().get_unchecked_mut(w) ^= *nodes.get_unchecked(idx).as_words().get_unchecked(w);
|
||||
}
|
||||
}
|
||||
|
||||
sha3_512(&data.bytes, &mut nodes.get_unchecked_mut(i).bytes);
|
||||
}
|
||||
}
|
||||
|
@ -16,10 +16,15 @@
|
||||
|
||||
//! Ethash implementation
|
||||
//! See https://github.com/ethereum/wiki/wiki/Ethash
|
||||
|
||||
#![cfg_attr(feature = "benches", feature(test))]
|
||||
|
||||
extern crate primal;
|
||||
extern crate sha3;
|
||||
extern crate parking_lot;
|
||||
|
||||
#[macro_use]
|
||||
extern crate crunchy;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
mod compute;
|
||||
@ -128,3 +133,29 @@ fn test_lru() {
|
||||
assert_eq!(ethash.cache.lock().recent_epoch.unwrap(), 2);
|
||||
assert_eq!(ethash.cache.lock().prev_epoch.unwrap(), 0);
|
||||
}
|
||||
|
||||
#[cfg(feature = "benches")]
|
||||
mod benchmarks {
|
||||
extern crate test;
|
||||
|
||||
use compute::{Light, light_compute, SeedHashCompute};
|
||||
use self::test::Bencher;
|
||||
|
||||
#[bench]
|
||||
fn bench_light_compute(b: &mut Bencher) {
|
||||
use ::std::env;
|
||||
|
||||
let hash = [0xf5, 0x7e, 0x6f, 0x3a, 0xcf, 0xc0, 0xdd, 0x4b, 0x5b, 0xf2, 0xbe, 0xe4, 0x0a, 0xb3, 0x35, 0x8a, 0xa6, 0x87, 0x73, 0xa8, 0xd0, 0x9f, 0x5e, 0x59, 0x5e, 0xab, 0x55, 0x94, 0x05, 0x52, 0x7d, 0x72];
|
||||
let nonce = 0xd7b3ac70a301a249;
|
||||
let light = Light::new(env::temp_dir(), 486382);
|
||||
|
||||
b.iter(|| light_compute(&light, &hash, nonce));
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn bench_seedhash(b: &mut Bencher) {
|
||||
let seed_compute = SeedHashCompute::new();
|
||||
|
||||
b.iter(|| seed_compute.get_seedhash(486382));
|
||||
}
|
||||
}
|
||||
|
@ -44,15 +44,20 @@ lru-cache = "0.1.0"
|
||||
native-contracts = { path = "native_contracts" }
|
||||
num = "0.1"
|
||||
num_cpus = "1.2"
|
||||
price-info = { path = "../price-info" }
|
||||
rand = "0.3"
|
||||
rlp = { path = "../util/rlp" }
|
||||
rust-crypto = "0.2.34"
|
||||
rustc-hex = "1.0"
|
||||
rustc-serialize = "0.3"
|
||||
semver = "0.6"
|
||||
stats = { path = "../util/stats" }
|
||||
time = "0.1"
|
||||
transient-hashmap = "0.4"
|
||||
using_queue = { path = "../util/using_queue" }
|
||||
table = { path = "../util/table" }
|
||||
bloomable = { path = "../util/bloomable" }
|
||||
vm = { path = "vm" }
|
||||
wasm = { path = "wasm" }
|
||||
|
||||
[dev-dependencies]
|
||||
native-contracts = { path = "native_contracts", features = ["test_contracts"] }
|
||||
|
@ -13,7 +13,9 @@ ethjson = { path = "../../json" }
|
||||
lazy_static = "0.2"
|
||||
log = "0.3"
|
||||
rlp = { path = "../../util/rlp" }
|
||||
vm = { path = "../vm" }
|
||||
parity-wasm = "0.12"
|
||||
ethcore-logger = { path = "../../logger" }
|
||||
wasm-utils = { git = "https://github.com/paritytech/wasm-utils" }
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -25,7 +25,7 @@ extern crate test;
|
||||
use self::test::{Bencher, black_box};
|
||||
|
||||
use util::*;
|
||||
use evm::action_params::ActionParams;
|
||||
use vm::ActionParams;
|
||||
use evm::{self, Factory, VMType};
|
||||
use evm::tests::FakeExt;
|
||||
|
||||
|
@ -17,142 +17,8 @@
|
||||
//! Evm interface.
|
||||
|
||||
use std::{ops, cmp, fmt};
|
||||
use util::{U128, U256, U512, trie};
|
||||
use action_params::ActionParams;
|
||||
use {Ext};
|
||||
|
||||
use super::wasm;
|
||||
|
||||
/// Evm errors.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum Error {
|
||||
/// `OutOfGas` is returned when transaction execution runs out of gas.
|
||||
/// The state should be reverted to the state from before the
|
||||
/// transaction execution. But it does not mean that transaction
|
||||
/// was invalid. Balance still should be transfered and nonce
|
||||
/// should be increased.
|
||||
OutOfGas,
|
||||
/// `BadJumpDestination` is returned when execution tried to move
|
||||
/// to position that wasn't marked with JUMPDEST instruction
|
||||
BadJumpDestination {
|
||||
/// Position the code tried to jump to.
|
||||
destination: usize
|
||||
},
|
||||
/// `BadInstructions` is returned when given instruction is not supported
|
||||
BadInstruction {
|
||||
/// Unrecognized opcode
|
||||
instruction: u8,
|
||||
},
|
||||
/// `StackUnderflow` when there is not enough stack elements to execute instruction
|
||||
StackUnderflow {
|
||||
/// Invoked instruction
|
||||
instruction: &'static str,
|
||||
/// How many stack elements was requested by instruction
|
||||
wanted: usize,
|
||||
/// How many elements were on stack
|
||||
on_stack: usize
|
||||
},
|
||||
/// When execution would exceed defined Stack Limit
|
||||
OutOfStack {
|
||||
/// Invoked instruction
|
||||
instruction: &'static str,
|
||||
/// How many stack elements instruction wanted to push
|
||||
wanted: usize,
|
||||
/// What was the stack limit
|
||||
limit: usize
|
||||
},
|
||||
/// Built-in contract failed on given input
|
||||
BuiltIn(&'static str),
|
||||
/// When execution tries to modify the state in static context
|
||||
MutableCallInStaticContext,
|
||||
/// Likely to cause consensus issues.
|
||||
Internal(String),
|
||||
/// Wasm runtime error
|
||||
Wasm(String),
|
||||
}
|
||||
|
||||
impl From<Box<trie::TrieError>> for Error {
|
||||
fn from(err: Box<trie::TrieError>) -> Self {
|
||||
Error::Internal(format!("Internal error: {}", err))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<wasm::RuntimeError> for Error {
|
||||
fn from(err: wasm::RuntimeError) -> Self {
|
||||
Error::Wasm(format!("Runtime error: {:?}", err))
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
use self::Error::*;
|
||||
match *self {
|
||||
OutOfGas => write!(f, "Out of gas"),
|
||||
BadJumpDestination { destination } => write!(f, "Bad jump destination {:x}", destination),
|
||||
BadInstruction { instruction } => write!(f, "Bad instruction {:x}", instruction),
|
||||
StackUnderflow { instruction, wanted, on_stack } => write!(f, "Stack underflow {} {}/{}", instruction, wanted, on_stack),
|
||||
OutOfStack { instruction, wanted, limit } => write!(f, "Out of stack {} {}/{}", instruction, wanted, limit),
|
||||
BuiltIn(name) => write!(f, "Built-in failed: {}", name),
|
||||
Internal(ref msg) => write!(f, "Internal error: {}", msg),
|
||||
MutableCallInStaticContext => write!(f, "Mutable call in static context"),
|
||||
Wasm(ref msg) => write!(f, "Internal error: {}", msg),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A specialized version of Result over EVM errors.
|
||||
pub type Result<T> = ::std::result::Result<T, Error>;
|
||||
|
||||
/// Return data buffer. Holds memory from a previous call and a slice into that memory.
|
||||
#[derive(Debug)]
|
||||
pub struct ReturnData {
|
||||
mem: Vec<u8>,
|
||||
offset: usize,
|
||||
size: usize,
|
||||
}
|
||||
|
||||
impl ::std::ops::Deref for ReturnData {
|
||||
type Target = [u8];
|
||||
fn deref(&self) -> &[u8] {
|
||||
&self.mem[self.offset..self.offset + self.size]
|
||||
}
|
||||
}
|
||||
|
||||
impl ReturnData {
|
||||
/// Create empty `ReturnData`.
|
||||
pub fn empty() -> Self {
|
||||
ReturnData {
|
||||
mem: Vec::new(),
|
||||
offset: 0,
|
||||
size: 0,
|
||||
}
|
||||
}
|
||||
/// Create `ReturnData` from give buffer and slice.
|
||||
pub fn new(mem: Vec<u8>, offset: usize, size: usize) -> Self {
|
||||
ReturnData {
|
||||
mem: mem,
|
||||
offset: offset,
|
||||
size: size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Gas Left: either it is a known value, or it needs to be computed by processing
|
||||
/// a return instruction.
|
||||
#[derive(Debug)]
|
||||
pub enum GasLeft {
|
||||
/// Known gas left
|
||||
Known(U256),
|
||||
/// Return or Revert instruction must be processed.
|
||||
NeedsReturn {
|
||||
/// Amount of gas left.
|
||||
gas_left: U256,
|
||||
/// Return data buffer.
|
||||
data: ReturnData,
|
||||
/// Apply or revert state changes on revert.
|
||||
apply_state: bool
|
||||
},
|
||||
}
|
||||
use util::{U128, U256, U512};
|
||||
use vm::{Ext, Result, ReturnData, GasLeft, Error};
|
||||
|
||||
/// Finalization result. Gas Left: either it is a known value, or it needs to be computed by processing
|
||||
/// a return instruction.
|
||||
@ -281,15 +147,6 @@ impl CostType for usize {
|
||||
}
|
||||
}
|
||||
|
||||
/// Evm interface
|
||||
pub trait Evm {
|
||||
/// This function should be used to execute transaction.
|
||||
///
|
||||
/// It returns either an error, a known amount of gas left, or parameters to be used
|
||||
/// to compute the final gas left.
|
||||
fn exec(&mut self, params: ActionParams, ext: &mut Ext) -> Result<GasLeft>;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use util::U256;
|
||||
|
@ -17,7 +17,7 @@
|
||||
//! Evm factory.
|
||||
//!
|
||||
use std::sync::Arc;
|
||||
use evm::Evm;
|
||||
use vm::Vm;
|
||||
use util::U256;
|
||||
use super::interpreter::SharedCache;
|
||||
use super::vmtype::VMType;
|
||||
@ -33,7 +33,7 @@ impl Factory {
|
||||
/// Create fresh instance of VM
|
||||
/// Might choose implementation depending on supplied gas.
|
||||
#[cfg(feature = "jit")]
|
||||
pub fn create(&self, gas: U256) -> Box<Evm> {
|
||||
pub fn create(&self, gas: U256) -> Box<Vm> {
|
||||
match self.evm {
|
||||
VMType::Jit => {
|
||||
Box::new(super::jit::JitEvm::default())
|
||||
@ -49,7 +49,7 @@ impl Factory {
|
||||
/// Create fresh instance of VM
|
||||
/// Might choose implementation depending on supplied gas.
|
||||
#[cfg(not(feature = "jit"))]
|
||||
pub fn create(&self, gas: U256) -> Box<Evm> {
|
||||
pub fn create(&self, gas: U256) -> Box<Vm> {
|
||||
match self.evm {
|
||||
VMType::Interpreter => if Self::can_fit_in_usize(gas) {
|
||||
Box::new(super::interpreter::Interpreter::<usize>::new(self.evm_cache.clone()))
|
||||
|
@ -14,18 +14,19 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::cmp;
|
||||
use util::*;
|
||||
use super::u256_to_address;
|
||||
|
||||
use {evm, ext};
|
||||
use {evm, vm};
|
||||
use instructions::{self, Instruction, InstructionInfo};
|
||||
use interpreter::stack::Stack;
|
||||
use schedule::Schedule;
|
||||
use vm::Schedule;
|
||||
|
||||
macro_rules! overflowing {
|
||||
($x: expr) => {{
|
||||
let (v, overflow) = $x;
|
||||
if overflow { return Err(evm::Error::OutOfGas); }
|
||||
if overflow { return Err(vm::Error::OutOfGas); }
|
||||
v
|
||||
}}
|
||||
}
|
||||
@ -59,16 +60,16 @@ impl<Gas: evm::CostType> Gasometer<Gas> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn verify_gas(&self, gas_cost: &Gas) -> evm::Result<()> {
|
||||
pub fn verify_gas(&self, gas_cost: &Gas) -> vm::Result<()> {
|
||||
match &self.current_gas < gas_cost {
|
||||
true => Err(evm::Error::OutOfGas),
|
||||
true => Err(vm::Error::OutOfGas),
|
||||
false => Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// How much gas is provided to a CALL/CREATE, given that we need to deduct `needed` for this operation
|
||||
/// and that we `requested` some.
|
||||
pub fn gas_provided(&self, schedule: &Schedule, needed: Gas, requested: Option<U256>) -> evm::Result<Gas> {
|
||||
pub fn gas_provided(&self, schedule: &Schedule, needed: Gas, requested: Option<U256>) -> vm::Result<Gas> {
|
||||
// Try converting requested gas to `Gas` (`U256/u64`)
|
||||
// but in EIP150 even if we request more we should never fail from OOG
|
||||
let requested = requested.map(Gas::from_u256);
|
||||
@ -82,7 +83,7 @@ impl<Gas: evm::CostType> Gasometer<Gas> {
|
||||
};
|
||||
|
||||
if let Some(Ok(r)) = requested {
|
||||
Ok(min(r, max_gas_provided))
|
||||
Ok(cmp::min(r, max_gas_provided))
|
||||
} else {
|
||||
Ok(max_gas_provided)
|
||||
}
|
||||
@ -107,12 +108,12 @@ impl<Gas: evm::CostType> Gasometer<Gas> {
|
||||
/// it will be the amount of gas that the current context provides to the child context.
|
||||
pub fn requirements(
|
||||
&mut self,
|
||||
ext: &ext::Ext,
|
||||
ext: &vm::Ext,
|
||||
instruction: Instruction,
|
||||
info: &InstructionInfo,
|
||||
stack: &Stack<U256>,
|
||||
current_mem_size: usize,
|
||||
) -> evm::Result<InstructionRequirements<Gas>> {
|
||||
) -> vm::Result<InstructionRequirements<Gas>> {
|
||||
let schedule = ext.schedule();
|
||||
let tier = instructions::get_tier_idx(info.tier);
|
||||
let default_gas = Gas::from(schedule.tier_step_gas[tier]);
|
||||
@ -291,7 +292,7 @@ impl<Gas: evm::CostType> Gasometer<Gas> {
|
||||
})
|
||||
}
|
||||
|
||||
fn mem_gas_cost(&self, schedule: &Schedule, current_mem_size: usize, mem_size: &Gas) -> evm::Result<(Gas, Gas, usize)> {
|
||||
fn mem_gas_cost(&self, schedule: &Schedule, current_mem_size: usize, mem_size: &Gas) -> vm::Result<(Gas, Gas, usize)> {
|
||||
let gas_for_mem = |mem_size: Gas| {
|
||||
let s = mem_size >> 5;
|
||||
// s * memory_gas + s * s / quad_coeff_div
|
||||
@ -319,12 +320,12 @@ impl<Gas: evm::CostType> Gasometer<Gas> {
|
||||
|
||||
|
||||
#[inline]
|
||||
fn mem_needed_const<Gas: evm::CostType>(mem: &U256, add: usize) -> evm::Result<Gas> {
|
||||
fn mem_needed_const<Gas: evm::CostType>(mem: &U256, add: usize) -> vm::Result<Gas> {
|
||||
Gas::from_u256(overflowing!(mem.overflowing_add(U256::from(add))))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn mem_needed<Gas: evm::CostType>(offset: &U256, size: &U256) -> evm::Result<Gas> {
|
||||
fn mem_needed<Gas: evm::CostType>(offset: &U256, size: &U256) -> vm::Result<Gas> {
|
||||
if size.is_zero() {
|
||||
return Ok(Gas::from(0));
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use util::U256;
|
||||
use {ReturnData};
|
||||
use vm::ReturnData;
|
||||
|
||||
const MAX_RETURN_WASTE_BYTES: usize = 16384;
|
||||
|
||||
|
@ -23,17 +23,23 @@ mod stack;
|
||||
mod memory;
|
||||
mod shared_cache;
|
||||
|
||||
use std::marker::PhantomData;
|
||||
use std::{cmp, mem};
|
||||
use std::sync::Arc;
|
||||
|
||||
use vm::{
|
||||
self, ActionParams, ActionValue, CallType, MessageCallResult,
|
||||
ContractCreateResult, CreateContractAddress, ReturnData, GasLeft
|
||||
};
|
||||
|
||||
use evm::CostType;
|
||||
use instructions::{self, Instruction, InstructionInfo};
|
||||
|
||||
use self::gasometer::Gasometer;
|
||||
use self::stack::{Stack, VecStack};
|
||||
use self::memory::Memory;
|
||||
pub use self::shared_cache::SharedCache;
|
||||
|
||||
use std::marker::PhantomData;
|
||||
use action_params::{ActionParams, ActionValue};
|
||||
use call_type::CallType;
|
||||
use instructions::{self, Instruction, InstructionInfo};
|
||||
use evm::{self, GasLeft, CostType, ReturnData};
|
||||
use ext::{self, MessageCallResult, ContractCreateResult, CreateContractAddress};
|
||||
use bit_set::BitSet;
|
||||
|
||||
use util::*;
|
||||
@ -107,8 +113,8 @@ pub struct Interpreter<Cost: CostType> {
|
||||
_type: PhantomData<Cost>,
|
||||
}
|
||||
|
||||
impl<Cost: CostType> evm::Evm for Interpreter<Cost> {
|
||||
fn exec(&mut self, params: ActionParams, ext: &mut ext::Ext) -> evm::Result<GasLeft> {
|
||||
impl<Cost: CostType> vm::Vm for Interpreter<Cost> {
|
||||
fn exec(&mut self, params: ActionParams, ext: &mut vm::Ext) -> vm::Result<GasLeft> {
|
||||
self.mem.clear();
|
||||
|
||||
let mut informant = informant::EvmInformant::new(ext.depth());
|
||||
@ -205,33 +211,34 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
}
|
||||
}
|
||||
|
||||
fn verify_instruction(&self, ext: &ext::Ext, instruction: Instruction, info: &InstructionInfo, stack: &Stack<U256>) -> evm::Result<()> {
|
||||
fn verify_instruction(&self, ext: &vm::Ext, instruction: Instruction, info: &InstructionInfo, stack: &Stack<U256>) -> vm::Result<()> {
|
||||
let schedule = ext.schedule();
|
||||
|
||||
if (instruction == instructions::DELEGATECALL && !schedule.have_delegate_call) ||
|
||||
(instruction == instructions::CREATE2 && !schedule.have_create2) ||
|
||||
(instruction == instructions::STATICCALL && !schedule.have_static_call) ||
|
||||
((instruction == instructions::RETURNDATACOPY || instruction == instructions::RETURNDATASIZE) && !schedule.have_return_data) ||
|
||||
(instruction == instructions::REVERT && !schedule.have_revert) {
|
||||
|
||||
return Err(evm::Error::BadInstruction {
|
||||
return Err(vm::Error::BadInstruction {
|
||||
instruction: instruction
|
||||
});
|
||||
}
|
||||
|
||||
if info.tier == instructions::GasPriceTier::Invalid {
|
||||
return Err(evm::Error::BadInstruction {
|
||||
return Err(vm::Error::BadInstruction {
|
||||
instruction: instruction
|
||||
});
|
||||
}
|
||||
|
||||
if !stack.has(info.args) {
|
||||
Err(evm::Error::StackUnderflow {
|
||||
Err(vm::Error::StackUnderflow {
|
||||
instruction: info.name,
|
||||
wanted: info.args,
|
||||
on_stack: stack.size()
|
||||
})
|
||||
} else if stack.size() - info.args + info.ret > schedule.stack_limit {
|
||||
Err(evm::Error::OutOfStack {
|
||||
Err(vm::Error::OutOfStack {
|
||||
instruction: info.name,
|
||||
wanted: info.ret - info.args,
|
||||
limit: schedule.stack_limit
|
||||
@ -271,12 +278,12 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
&mut self,
|
||||
gas: Cost,
|
||||
params: &ActionParams,
|
||||
ext: &mut ext::Ext,
|
||||
ext: &mut vm::Ext,
|
||||
instruction: Instruction,
|
||||
code: &mut CodeReader,
|
||||
stack: &mut Stack<U256>,
|
||||
provided: Option<Cost>
|
||||
) -> evm::Result<InstructionResult<Cost>> {
|
||||
) -> vm::Result<InstructionResult<Cost>> {
|
||||
match instruction {
|
||||
instructions::JUMP => {
|
||||
let jump = stack.pop_back();
|
||||
@ -592,13 +599,13 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
}
|
||||
}
|
||||
|
||||
fn verify_jump(&self, jump_u: U256, valid_jump_destinations: &BitSet) -> evm::Result<usize> {
|
||||
fn verify_jump(&self, jump_u: U256, valid_jump_destinations: &BitSet) -> vm::Result<usize> {
|
||||
let jump = jump_u.low_u64() as usize;
|
||||
|
||||
if valid_jump_destinations.contains(jump) && U256::from(jump) == jump_u {
|
||||
Ok(jump)
|
||||
} else {
|
||||
Err(evm::Error::BadJumpDestination {
|
||||
Err(vm::Error::BadJumpDestination {
|
||||
destination: jump
|
||||
})
|
||||
}
|
||||
@ -616,7 +623,7 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
}
|
||||
}
|
||||
|
||||
fn exec_stack_instruction(&self, instruction: Instruction, stack: &mut Stack<U256>) -> evm::Result<()> {
|
||||
fn exec_stack_instruction(&self, instruction: Instruction, stack: &mut Stack<U256>) -> vm::Result<()> {
|
||||
match instruction {
|
||||
instructions::DUP1...instructions::DUP16 => {
|
||||
let position = instructions::get_dup_position(instruction);
|
||||
@ -821,7 +828,7 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
return Err(evm::Error::BadInstruction {
|
||||
return Err(vm::Error::BadInstruction {
|
||||
instruction: instruction
|
||||
});
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ use util::*;
|
||||
use evmjit;
|
||||
use evm::{self, GasLeft};
|
||||
use evm::CallType;
|
||||
use vm::{self, Vm};
|
||||
|
||||
/// Should be used to convert jit types to ethcore
|
||||
trait FromJit<T>: Sized {
|
||||
@ -318,7 +319,7 @@ pub struct JitEvm {
|
||||
context: Option<evmjit::ContextHandle>,
|
||||
}
|
||||
|
||||
impl evm::Evm for JitEvm {
|
||||
impl vm::Vm for JitEvm {
|
||||
fn exec(&mut self, params: ActionParams, ext: &mut evm::Ext) -> evm::Result<GasLeft> {
|
||||
// Dirty hack. This is unsafe, but we interact with ffi, so it's justified.
|
||||
let ext_adapter: ExtAdapter<'static> = unsafe { ::std::mem::transmute(ExtAdapter::new(ext, params.address.clone())) };
|
||||
@ -370,8 +371,8 @@ impl evm::Evm for JitEvm {
|
||||
ext.suicide(&Address::from_jit(&context.suicide_refund_address()));
|
||||
Ok(GasLeft::Known(U256::from(context.gas_left())))
|
||||
},
|
||||
evmjit::ReturnCode::OutOfGas => Err(evm::Error::OutOfGas),
|
||||
_err => Err(evm::Error::Internal)
|
||||
evmjit::ReturnCode::OutOfGas => Err(vm::Error::OutOfGas),
|
||||
_err => Err(vm::Error::Internal)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,11 +24,12 @@ extern crate ethjson;
|
||||
extern crate rlp;
|
||||
extern crate parity_wasm;
|
||||
extern crate wasm_utils;
|
||||
extern crate ethcore_logger;
|
||||
extern crate vm;
|
||||
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
#[cfg(feature = "jit")]
|
||||
@ -37,14 +38,8 @@ extern crate evmjit;
|
||||
#[cfg(test)]
|
||||
extern crate rustc_hex;
|
||||
|
||||
pub mod action_params;
|
||||
pub mod call_type;
|
||||
pub mod env_info;
|
||||
pub mod ext;
|
||||
pub mod evm;
|
||||
pub mod interpreter;
|
||||
pub mod schedule;
|
||||
pub mod wasm;
|
||||
|
||||
#[macro_use]
|
||||
pub mod factory;
|
||||
@ -59,12 +54,12 @@ mod tests;
|
||||
#[cfg(all(feature="benches", test))]
|
||||
mod benches;
|
||||
|
||||
pub use self::action_params::ActionParams;
|
||||
pub use self::call_type::CallType;
|
||||
pub use self::env_info::EnvInfo;
|
||||
pub use self::evm::{Evm, Error, Finalize, FinalizationResult, GasLeft, Result, CostType, ReturnData};
|
||||
pub use self::ext::{Ext, ContractCreateResult, MessageCallResult, CreateContractAddress};
|
||||
pub use vm::{
|
||||
Schedule, CleanDustMode, EnvInfo, CallType, ActionParams, Ext,
|
||||
ContractCreateResult, MessageCallResult, CreateContractAddress,
|
||||
GasLeft, ReturnData
|
||||
};
|
||||
pub use self::evm::{Finalize, FinalizationResult, CostType};
|
||||
pub use self::instructions::{InstructionInfo, INSTRUCTIONS, push_bytes};
|
||||
pub use self::vmtype::VMType;
|
||||
pub use self::factory::Factory;
|
||||
pub use self::schedule::{Schedule, CleanDustMode};
|
||||
|
@ -15,212 +15,17 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::str::FromStr;
|
||||
use std::hash::Hash;
|
||||
use std::sync::Arc;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use rustc_hex::FromHex;
|
||||
use util::*;
|
||||
use action_params::{ActionParams, ActionValue};
|
||||
use env_info::EnvInfo;
|
||||
use call_type::CallType;
|
||||
use schedule::Schedule;
|
||||
use evm::{self, GasLeft, ReturnData};
|
||||
use ext::{Ext, ContractCreateResult, MessageCallResult, CreateContractAddress};
|
||||
use vm::{self, ActionParams, ActionValue};
|
||||
use vm::tests::{FakeExt, FakeCall, FakeCallType, test_finalize};
|
||||
use factory::Factory;
|
||||
use vmtype::VMType;
|
||||
|
||||
pub struct FakeLogEntry {
|
||||
topics: Vec<H256>,
|
||||
data: Bytes
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Hash, Debug)]
|
||||
pub enum FakeCallType {
|
||||
Call, Create
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Hash, Debug)]
|
||||
pub struct FakeCall {
|
||||
pub call_type: FakeCallType,
|
||||
pub gas: U256,
|
||||
pub sender_address: Option<Address>,
|
||||
pub receive_address: Option<Address>,
|
||||
pub value: Option<U256>,
|
||||
pub data: Bytes,
|
||||
pub code_address: Option<Address>,
|
||||
}
|
||||
|
||||
/// Fake externalities test structure.
|
||||
///
|
||||
/// Can't do recursive calls.
|
||||
#[derive(Default)]
|
||||
pub struct FakeExt {
|
||||
pub store: HashMap<H256, H256>,
|
||||
pub suicides: HashSet<Address>,
|
||||
pub calls: HashSet<FakeCall>,
|
||||
sstore_clears: usize,
|
||||
depth: usize,
|
||||
blockhashes: HashMap<U256, H256>,
|
||||
codes: HashMap<Address, Arc<Bytes>>,
|
||||
logs: Vec<FakeLogEntry>,
|
||||
info: EnvInfo,
|
||||
schedule: Schedule,
|
||||
balances: HashMap<Address, U256>,
|
||||
}
|
||||
|
||||
// similar to the normal `finalize` function, but ignoring NeedsReturn.
|
||||
fn test_finalize(res: Result<GasLeft, evm::Error>) -> Result<U256, evm::Error> {
|
||||
match res {
|
||||
Ok(GasLeft::Known(gas)) => Ok(gas),
|
||||
Ok(GasLeft::NeedsReturn{..}) => unimplemented!(), // since ret is unimplemented.
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
}
|
||||
|
||||
impl FakeExt {
|
||||
pub fn new() -> Self {
|
||||
FakeExt::default()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Schedule {
|
||||
fn default() -> Self {
|
||||
Schedule::new_frontier()
|
||||
}
|
||||
}
|
||||
|
||||
impl Ext for FakeExt {
|
||||
fn storage_at(&self, key: &H256) -> evm::Result<H256> {
|
||||
Ok(self.store.get(key).unwrap_or(&H256::new()).clone())
|
||||
}
|
||||
|
||||
fn set_storage(&mut self, key: H256, value: H256) -> evm::Result<()> {
|
||||
self.store.insert(key, value);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn exists(&self, address: &Address) -> evm::Result<bool> {
|
||||
Ok(self.balances.contains_key(address))
|
||||
}
|
||||
|
||||
fn exists_and_not_null(&self, address: &Address) -> evm::Result<bool> {
|
||||
Ok(self.balances.get(address).map_or(false, |b| !b.is_zero()))
|
||||
}
|
||||
|
||||
fn origin_balance(&self) -> evm::Result<U256> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn balance(&self, address: &Address) -> evm::Result<U256> {
|
||||
Ok(self.balances[address])
|
||||
}
|
||||
|
||||
fn blockhash(&mut self, number: &U256) -> H256 {
|
||||
self.blockhashes.get(number).unwrap_or(&H256::new()).clone()
|
||||
}
|
||||
|
||||
fn create(&mut self, gas: &U256, value: &U256, code: &[u8], _address: CreateContractAddress) -> ContractCreateResult {
|
||||
self.calls.insert(FakeCall {
|
||||
call_type: FakeCallType::Create,
|
||||
gas: *gas,
|
||||
sender_address: None,
|
||||
receive_address: None,
|
||||
value: Some(*value),
|
||||
data: code.to_vec(),
|
||||
code_address: None
|
||||
});
|
||||
ContractCreateResult::Failed
|
||||
}
|
||||
|
||||
fn call(&mut self,
|
||||
gas: &U256,
|
||||
sender_address: &Address,
|
||||
receive_address: &Address,
|
||||
value: Option<U256>,
|
||||
data: &[u8],
|
||||
code_address: &Address,
|
||||
_output: &mut [u8],
|
||||
_call_type: CallType
|
||||
) -> MessageCallResult {
|
||||
|
||||
self.calls.insert(FakeCall {
|
||||
call_type: FakeCallType::Call,
|
||||
gas: *gas,
|
||||
sender_address: Some(sender_address.clone()),
|
||||
receive_address: Some(receive_address.clone()),
|
||||
value: value,
|
||||
data: data.to_vec(),
|
||||
code_address: Some(code_address.clone())
|
||||
});
|
||||
MessageCallResult::Success(*gas, ReturnData::empty())
|
||||
}
|
||||
|
||||
fn extcode(&self, address: &Address) -> evm::Result<Arc<Bytes>> {
|
||||
Ok(self.codes.get(address).unwrap_or(&Arc::new(Bytes::new())).clone())
|
||||
}
|
||||
|
||||
fn extcodesize(&self, address: &Address) -> evm::Result<usize> {
|
||||
Ok(self.codes.get(address).map_or(0, |c| c.len()))
|
||||
}
|
||||
|
||||
fn log(&mut self, topics: Vec<H256>, data: &[u8]) -> evm::Result<()> {
|
||||
self.logs.push(FakeLogEntry {
|
||||
topics: topics,
|
||||
data: data.to_vec()
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn ret(self, _gas: &U256, _data: &ReturnData) -> evm::Result<U256> {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
fn suicide(&mut self, refund_address: &Address) -> evm::Result<()> {
|
||||
self.suicides.insert(refund_address.clone());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn schedule(&self) -> &Schedule {
|
||||
&self.schedule
|
||||
}
|
||||
|
||||
fn env_info(&self) -> &EnvInfo {
|
||||
&self.info
|
||||
}
|
||||
|
||||
fn depth(&self) -> usize {
|
||||
self.depth
|
||||
}
|
||||
|
||||
fn inc_sstore_clears(&mut self) {
|
||||
self.sstore_clears += 1;
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stack_underflow() {
|
||||
let address = Address::from_str("0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6").unwrap();
|
||||
let code = "01600055".from_hex().unwrap();
|
||||
|
||||
let mut params = ActionParams::default();
|
||||
params.address = address.clone();
|
||||
params.gas = U256::from(100_000);
|
||||
params.code = Some(Arc::new(code));
|
||||
let mut ext = FakeExt::new();
|
||||
|
||||
let err = {
|
||||
let mut vm : Box<evm::Evm> = Box::new(super::interpreter::Interpreter::<usize>::new(Arc::new(super::interpreter::SharedCache::default())));
|
||||
test_finalize(vm.exec(params, &mut ext)).unwrap_err()
|
||||
};
|
||||
|
||||
match err {
|
||||
evm::Error::StackUnderflow {wanted, on_stack, ..} => {
|
||||
assert_eq!(wanted, 2);
|
||||
assert_eq!(on_stack, 0);
|
||||
}
|
||||
_ => {
|
||||
assert!(false, "Expected StackUndeflow")
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
evm_test!{test_add: test_add_jit, test_add_int}
|
||||
fn test_add(factory: super::Factory) {
|
||||
let address = Address::from_str("0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6").unwrap();
|
||||
@ -849,7 +654,7 @@ fn test_badinstruction_int() {
|
||||
};
|
||||
|
||||
match err {
|
||||
evm::Error::BadInstruction { instruction: 0xaf } => (),
|
||||
vm::Error::BadInstruction { instruction: 0xaf } => (),
|
||||
_ => assert!(false, "Expected bad instruction")
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ ethcore-io = { path = "../../util/io" }
|
||||
ethcore-ipc = { path = "../../ipc/rpc", optional = true }
|
||||
ethcore-devtools = { path = "../../devtools" }
|
||||
evm = { path = "../evm" }
|
||||
vm = { path = "../vm" }
|
||||
rlp = { path = "../../util/rlp" }
|
||||
time = "0.1"
|
||||
smallvec = "0.4"
|
||||
|
@ -405,6 +405,7 @@ impl HeaderChain {
|
||||
|
||||
match id {
|
||||
BlockId::Earliest | BlockId::Number(0) => Some(self.genesis_header.clone()),
|
||||
BlockId::Hash(hash) if hash == self.genesis_hash() => { Some(self.genesis_header.clone()) }
|
||||
BlockId::Hash(hash) => load_from_db(hash),
|
||||
BlockId::Number(num) => {
|
||||
if self.best_block.read().number < num { return None }
|
||||
@ -781,4 +782,18 @@ mod tests {
|
||||
assert_eq!(chain.block_header(BlockId::Latest).unwrap().number(), 10);
|
||||
assert!(chain.candidates.read().get(&100).is_some())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn genesis_header_available() {
|
||||
let spec = Spec::new_test();
|
||||
let genesis_header = spec.genesis_header();
|
||||
let db = make_db();
|
||||
let cache = Arc::new(Mutex::new(Cache::new(Default::default(), Duration::hours(6))));
|
||||
|
||||
let chain = HeaderChain::new(db.clone(), None, &::rlp::encode(&genesis_header), cache.clone()).unwrap();
|
||||
|
||||
assert!(chain.block_header(BlockId::Earliest).is_some());
|
||||
assert!(chain.block_header(BlockId::Number(0)).is_some());
|
||||
assert!(chain.block_header(BlockId::Hash(genesis_header.hash())).is_some());
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,8 @@ pub struct Config {
|
||||
pub db_wal: bool,
|
||||
/// Should it do full verification of blocks?
|
||||
pub verify_full: bool,
|
||||
/// Should it check the seal of blocks?
|
||||
pub check_seal: bool,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@ -69,6 +71,7 @@ impl Default for Config {
|
||||
db_compaction: CompactionProfile::default(),
|
||||
db_wal: true,
|
||||
verify_full: true,
|
||||
check_seal: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -168,7 +171,7 @@ impl Client {
|
||||
let gh = ::rlp::encode(&spec.genesis_header());
|
||||
|
||||
Ok(Client {
|
||||
queue: HeaderQueue::new(config.queue, spec.engine.clone(), io_channel, true),
|
||||
queue: HeaderQueue::new(config.queue, spec.engine.clone(), io_channel, config.check_seal),
|
||||
engine: spec.engine.clone(),
|
||||
chain: HeaderChain::new(db.clone(), chain_col, &gh, cache)?,
|
||||
report: RwLock::new(ClientReport::default()),
|
||||
@ -282,6 +285,7 @@ impl Client {
|
||||
let mut good = Vec::new();
|
||||
for verified_header in self.queue.drain(MAX) {
|
||||
let (num, hash) = (verified_header.number(), verified_header.hash());
|
||||
trace!(target: "client", "importing block {}", num);
|
||||
|
||||
if self.verify_full && !self.check_header(&mut bad, &verified_header) {
|
||||
continue
|
||||
@ -381,13 +385,17 @@ impl Client {
|
||||
}
|
||||
}
|
||||
|
||||
// return true if should skip, false otherwise. may push onto bad if
|
||||
// return false if should skip, true otherwise. may push onto bad if
|
||||
// should skip.
|
||||
fn check_header(&self, bad: &mut Vec<H256>, verified_header: &Header) -> bool {
|
||||
let hash = verified_header.hash();
|
||||
let parent_header = match self.chain.block_header(BlockId::Hash(*verified_header.parent_hash())) {
|
||||
Some(header) => header,
|
||||
None => return false, // skip import of block with missing parent.
|
||||
None => {
|
||||
trace!(target: "client", "No parent for block ({}, {})",
|
||||
verified_header.number(), hash);
|
||||
return false // skip import of block with missing parent.
|
||||
}
|
||||
};
|
||||
|
||||
// Verify Block Family
|
||||
|
@ -80,6 +80,7 @@ extern crate serde;
|
||||
extern crate smallvec;
|
||||
extern crate stats;
|
||||
extern crate time;
|
||||
extern crate vm;
|
||||
|
||||
#[cfg(feature = "ipc")]
|
||||
extern crate ethcore_ipc as ipc;
|
||||
|
@ -21,7 +21,7 @@
|
||||
use ethcore::transaction::UnverifiedTransaction;
|
||||
|
||||
use io::TimerToken;
|
||||
use network::{NetworkProtocolHandler, NetworkContext, PeerId};
|
||||
use network::{HostInfo, NetworkProtocolHandler, NetworkContext, PeerId};
|
||||
use rlp::{RlpStream, UntrustedRlp};
|
||||
use util::hash::H256;
|
||||
use util::{DBValue, Mutex, RwLock, U256};
|
||||
@ -806,6 +806,9 @@ impl LightProtocol {
|
||||
trace!(target: "pip", "Connected peer with chain head {:?}", (status.head_hash, status.head_num));
|
||||
|
||||
if (status.network_id, status.genesis_hash) != (self.network_id, self.genesis_hash) {
|
||||
trace!(target: "pip", "peer {} wrong network: network_id is {} vs our {}, gh is {} vs our {}",
|
||||
peer, status.network_id, self.network_id, status.genesis_hash, self.genesis_hash);
|
||||
|
||||
return Err(Error::WrongNetwork);
|
||||
}
|
||||
|
||||
@ -1074,7 +1077,7 @@ fn punish(peer: PeerId, io: &IoContext, e: Error) {
|
||||
}
|
||||
|
||||
impl NetworkProtocolHandler for LightProtocol {
|
||||
fn initialize(&self, io: &NetworkContext) {
|
||||
fn initialize(&self, io: &NetworkContext, _host_info: &HostInfo) {
|
||||
io.register_timer(TIMEOUT, TIMEOUT_INTERVAL_MS)
|
||||
.expect("Error registering sync timer.");
|
||||
io.register_timer(TICK_TIMEOUT, TICK_TIMEOUT_INTERVAL_MS)
|
||||
|
@ -54,13 +54,21 @@ struct Peer {
|
||||
}
|
||||
|
||||
impl Peer {
|
||||
// whether this peer can fulfill the
|
||||
fn can_fulfill(&self, c: &Capabilities) -> bool {
|
||||
let caps = &self.capabilities;
|
||||
// whether this peer can fulfill the necessary capabilities for the given
|
||||
// request.
|
||||
fn can_fulfill(&self, request: &Capabilities) -> bool {
|
||||
let local_caps = &self.capabilities;
|
||||
let can_serve_since = |req, local| {
|
||||
match (req, local) {
|
||||
(Some(request_block), Some(serve_since)) => request_block >= serve_since,
|
||||
(Some(_), None) => false,
|
||||
(None, _) => true,
|
||||
}
|
||||
};
|
||||
|
||||
caps.serve_headers == c.serve_headers &&
|
||||
caps.serve_chain_since >= c.serve_chain_since &&
|
||||
caps.serve_state_since >= c.serve_chain_since
|
||||
local_caps.serve_headers >= request.serve_headers &&
|
||||
can_serve_since(request.serve_chain_since, local_caps.serve_chain_since) &&
|
||||
can_serve_since(request.serve_state_since, local_caps.serve_state_since)
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,7 +252,7 @@ impl OnDemand {
|
||||
peers: RwLock::new(HashMap::new()),
|
||||
in_transit: RwLock::new(HashMap::new()),
|
||||
cache: cache,
|
||||
no_immediate_dispatch: true,
|
||||
no_immediate_dispatch: false,
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,7 +274,6 @@ impl OnDemand {
|
||||
-> Result<Receiver<Vec<Response>>, basic_request::NoSuchOutput>
|
||||
{
|
||||
let (sender, receiver) = oneshot::channel();
|
||||
|
||||
if requests.is_empty() {
|
||||
assert!(sender.send(Vec::new()).is_ok(), "receiver still in scope; qed");
|
||||
return Ok(receiver);
|
||||
@ -335,6 +342,7 @@ impl OnDemand {
|
||||
// dispatch pending requests, and discard those for which the corresponding
|
||||
// receiver has been dropped.
|
||||
fn dispatch_pending(&self, ctx: &BasicContext) {
|
||||
|
||||
// wrapper future for calling `poll_cancel` on our `Senders` to preserve
|
||||
// the invariant that it's always within a task.
|
||||
struct CheckHangup<'a, T: 'a>(&'a mut Sender<T>);
|
||||
@ -360,6 +368,8 @@ impl OnDemand {
|
||||
if self.pending.read().is_empty() { return }
|
||||
let mut pending = self.pending.write();
|
||||
|
||||
debug!(target: "on_demand", "Attempting to dispatch {} pending requests", pending.len());
|
||||
|
||||
// iterate over all pending requests, and check them for hang-up.
|
||||
// then, try and find a peer who can serve it.
|
||||
let peers = self.peers.read();
|
||||
@ -378,16 +388,21 @@ impl OnDemand {
|
||||
|
||||
match ctx.request_from(*peer_id, pending.net_requests.clone()) {
|
||||
Ok(req_id) => {
|
||||
trace!(target: "on_demand", "Dispatched request {} to peer {}", req_id, peer_id);
|
||||
self.in_transit.write().insert(req_id, pending);
|
||||
return None
|
||||
}
|
||||
Err(net::Error::NoCredits) => {}
|
||||
Err(net::Error::NoCredits) | Err(net::Error::NotServer) => {}
|
||||
Err(e) => debug!(target: "on_demand", "Error dispatching request to peer: {}", e),
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: maximum number of failures _when we have peers_.
|
||||
Some(pending)
|
||||
})
|
||||
.collect(); // `pending` now contains all requests we couldn't dispatch.
|
||||
|
||||
debug!(target: "on_demand", "Was unable to dispatch {} requests.", pending.len());
|
||||
}
|
||||
|
||||
// submit a pending request set. attempts to answer from cache before
|
||||
@ -395,6 +410,7 @@ impl OnDemand {
|
||||
fn submit_pending(&self, ctx: &BasicContext, mut pending: Pending) {
|
||||
// answer as many requests from cache as we can, and schedule for dispatch
|
||||
// if incomplete.
|
||||
|
||||
pending.answer_from_cache(&*self.cache);
|
||||
if let Some(mut pending) = pending.try_complete() {
|
||||
pending.update_net_requests();
|
||||
|
@ -24,7 +24,7 @@ use ethcore::engines::Engine;
|
||||
use ethcore::receipt::Receipt;
|
||||
use ethcore::state::{self, ProvedExecution};
|
||||
use ethcore::transaction::SignedTransaction;
|
||||
use evm::env_info::EnvInfo;
|
||||
use vm::EnvInfo;
|
||||
|
||||
use request::{self as net_request, IncompleteRequest, CompleteRequest, Output, OutputKind, Field};
|
||||
|
||||
|
@ -9,7 +9,7 @@ build = "build.rs"
|
||||
ethabi = "2.0"
|
||||
futures = "0.1"
|
||||
byteorder = "1.0"
|
||||
ethcore-util = { path = "../../util" }
|
||||
ethcore-bigint = { path = "../../util/bigint" }
|
||||
|
||||
[build-dependencies]
|
||||
native-contract-generator = { path = "generator" }
|
||||
|
@ -15,7 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Rust code contract generator.
|
||||
//! The code generated will require a dependence on the `ethcore-util`,
|
||||
//! The code generated will require a dependence on the `ethcore-bigint::prelude`,
|
||||
//! `ethabi`, `byteorder`, and `futures` crates.
|
||||
//! This currently isn't hygienic, so compilation of generated code may fail
|
||||
//! due to missing crates or name collisions. This will change when
|
||||
@ -48,14 +48,14 @@ pub fn generate_module(struct_name: &str, abi: &str) -> Result<String, Error> {
|
||||
use byteorder::{{BigEndian, ByteOrder}};
|
||||
use futures::{{future, Future, IntoFuture, BoxFuture}};
|
||||
use ethabi::{{Contract, Interface, Token, Event}};
|
||||
use util;
|
||||
use bigint;
|
||||
|
||||
/// Generated Rust bindings to an Ethereum contract.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct {name} {{
|
||||
contract: Contract,
|
||||
/// Address to make calls to.
|
||||
pub address: util::Address,
|
||||
pub address: bigint::prelude::H160,
|
||||
}}
|
||||
|
||||
const ABI: &'static str = r#"{abi_str}"#;
|
||||
@ -63,7 +63,7 @@ const ABI: &'static str = r#"{abi_str}"#;
|
||||
impl {name} {{
|
||||
/// Create a new instance of `{name}` with an address.
|
||||
/// Calls can be made, given a callback for dispatching calls asynchronously.
|
||||
pub fn new(address: util::Address) -> Self {{
|
||||
pub fn new(address: bigint::prelude::H160) -> Self {{
|
||||
let contract = Contract::new(Interface::load(ABI.as_bytes())
|
||||
.expect("ABI checked at generation-time; qed"));
|
||||
{name} {{
|
||||
@ -108,7 +108,7 @@ fn generate_functions(contract: &Contract) -> Result<String, Error> {
|
||||
/// Outputs: {abi_outputs:?}
|
||||
pub fn {snake_name}<F, U>(&self, call: F, {params}) -> BoxFuture<{output_type}, String>
|
||||
where
|
||||
F: FnOnce(util::Address, Vec<u8>) -> U,
|
||||
F: FnOnce(bigint::prelude::H160, Vec<u8>) -> U,
|
||||
U: IntoFuture<Item=Vec<u8>, Error=String>,
|
||||
U::Future: Send + 'static
|
||||
{{
|
||||
@ -217,8 +217,8 @@ fn output_params_codegen(outputs: &[ParamType]) -> Result<(String, String), Para
|
||||
// create code for an argument type from param type.
|
||||
fn rust_type(input: ParamType) -> Result<String, ParamType> {
|
||||
Ok(match input {
|
||||
ParamType::Address => "util::Address".into(),
|
||||
ParamType::FixedBytes(len) if len <= 32 => format!("util::H{}", len * 8),
|
||||
ParamType::Address => "bigint::prelude::H160".into(),
|
||||
ParamType::FixedBytes(len) if len <= 32 => format!("bigint::prelude::H{}", len * 8),
|
||||
ParamType::Bytes | ParamType::FixedBytes(_) => "Vec<u8>".into(),
|
||||
ParamType::Int(width) => match width {
|
||||
8 | 16 | 32 | 64 => format!("i{}", width),
|
||||
@ -226,7 +226,7 @@ fn rust_type(input: ParamType) -> Result<String, ParamType> {
|
||||
},
|
||||
ParamType::Uint(width) => match width {
|
||||
8 | 16 | 32 | 64 => format!("u{}", width),
|
||||
128 | 160 | 256 => format!("util::U{}", width),
|
||||
128 | 160 | 256 => format!("bigint::prelude::U{}", width),
|
||||
_ => return Err(ParamType::Uint(width)),
|
||||
},
|
||||
ParamType::Bool => "bool".into(),
|
||||
@ -259,8 +259,8 @@ fn tokenize(name: &str, input: ParamType) -> (bool, String) {
|
||||
},
|
||||
ParamType::Uint(width) => format!(
|
||||
"let mut r = [0; 32]; {}.to_big_endian(&mut r); Token::Uint(r)",
|
||||
if width <= 64 { format!("util::U256::from({} as u64)", name) }
|
||||
else { format!("util::U256::from({})", name) }
|
||||
if width <= 64 { format!("bigint::prelude::U256::from({} as u64)", name) }
|
||||
else { format!("bigint::prelude::U256::from({})", name) }
|
||||
),
|
||||
ParamType::Bool => format!("Token::Bool({})", name),
|
||||
ParamType::String => format!("Token::String({})", name),
|
||||
@ -281,11 +281,11 @@ fn tokenize(name: &str, input: ParamType) -> (bool, String) {
|
||||
// panics on unsupported types.
|
||||
fn detokenize(name: &str, output_type: ParamType) -> String {
|
||||
match output_type {
|
||||
ParamType::Address => format!("{}.to_address().map(util::H160)", name),
|
||||
ParamType::Address => format!("{}.to_address().map(bigint::prelude::H160)", name),
|
||||
ParamType::Bytes => format!("{}.to_bytes()", name),
|
||||
ParamType::FixedBytes(len) if len <= 32 => {
|
||||
// ensure no panic on slice too small.
|
||||
let read_hash = format!("b.resize({}, 0); util::H{}::from_slice(&b[..{}])",
|
||||
let read_hash = format!("b.resize({}, 0); bigint::prelude::H{}::from_slice(&b[..{}])",
|
||||
len, len * 8, len);
|
||||
|
||||
format!("{}.to_fixed_bytes().map(|mut b| {{ {} }})",
|
||||
@ -302,8 +302,8 @@ fn detokenize(name: &str, output_type: ParamType) -> String {
|
||||
}
|
||||
ParamType::Uint(width) => {
|
||||
let read_uint = match width {
|
||||
8 | 16 | 32 | 64 => format!("util::U256(u).low_u64() as u{}", width),
|
||||
_ => format!("util::U{}::from(&u[..])", width),
|
||||
8 | 16 | 32 | 64 => format!("bigint::prelude::U256(u).low_u64() as u{}", width),
|
||||
_ => format!("bigint::prelude::U{}::from(&u[..])", width),
|
||||
};
|
||||
|
||||
format!("{}.to_uint().map(|u| {})", name, read_uint)
|
||||
@ -328,30 +328,30 @@ mod tests {
|
||||
#[test]
|
||||
fn input_types() {
|
||||
assert_eq!(::input_params_codegen(&[]).unwrap().0, "");
|
||||
assert_eq!(::input_params_codegen(&[ParamType::Address]).unwrap().0, "param_0: util::Address, ");
|
||||
assert_eq!(::input_params_codegen(&[ParamType::Address]).unwrap().0, "param_0: bigint::prelude::H160, ");
|
||||
assert_eq!(::input_params_codegen(&[ParamType::Address, ParamType::Bytes]).unwrap().0,
|
||||
"param_0: util::Address, param_1: Vec<u8>, ");
|
||||
"param_0: bigint::prelude::H160, param_1: Vec<u8>, ");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn output_types() {
|
||||
assert_eq!(::output_params_codegen(&[]).unwrap().0, "()");
|
||||
assert_eq!(::output_params_codegen(&[ParamType::Address]).unwrap().0, "(util::Address)");
|
||||
assert_eq!(::output_params_codegen(&[ParamType::Address]).unwrap().0, "(bigint::prelude::H160)");
|
||||
assert_eq!(::output_params_codegen(&[ParamType::Address, ParamType::Array(Box::new(ParamType::Bytes))]).unwrap().0,
|
||||
"(util::Address, Vec<Vec<u8>>)");
|
||||
"(bigint::prelude::H160, Vec<Vec<u8>>)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rust_type() {
|
||||
assert_eq!(::rust_type(ParamType::FixedBytes(32)).unwrap(), "util::H256");
|
||||
assert_eq!(::rust_type(ParamType::FixedBytes(32)).unwrap(), "bigint::prelude::H256");
|
||||
assert_eq!(::rust_type(ParamType::Array(Box::new(ParamType::FixedBytes(32)))).unwrap(),
|
||||
"Vec<util::H256>");
|
||||
"Vec<bigint::prelude::H256>");
|
||||
|
||||
assert_eq!(::rust_type(ParamType::Uint(64)).unwrap(), "u64");
|
||||
assert!(::rust_type(ParamType::Uint(63)).is_err());
|
||||
|
||||
assert_eq!(::rust_type(ParamType::Int(32)).unwrap(), "i32");
|
||||
assert_eq!(::rust_type(ParamType::Uint(256)).unwrap(), "util::U256");
|
||||
assert_eq!(::rust_type(ParamType::Uint(256)).unwrap(), "bigint::prelude::U256");
|
||||
}
|
||||
|
||||
// codegen tests will need bootstrapping of some kind.
|
||||
|
@ -21,7 +21,7 @@
|
||||
extern crate futures;
|
||||
extern crate byteorder;
|
||||
extern crate ethabi;
|
||||
extern crate ethcore_util as util;
|
||||
extern crate ethcore_bigint as bigint;
|
||||
|
||||
mod key_server_set;
|
||||
mod registry;
|
||||
|
@ -3,7 +3,6 @@
|
||||
"engine": {
|
||||
"authorityRound": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"stepDuration": 1,
|
||||
"startStep": 2,
|
||||
"validators": {
|
||||
@ -17,6 +16,7 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -3,7 +3,6 @@
|
||||
"engine": {
|
||||
"basicAuthority": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"durationLimit": "0x0d",
|
||||
"validators": {
|
||||
"list": ["0x9cce34f7ab185c7aba1b7c8140d620b4bda941d6"]
|
||||
@ -12,6 +11,7 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0100000",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -4,6 +4,7 @@
|
||||
"null": null
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -4,15 +4,11 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"homesteadTransition": 1150000,
|
||||
"eip150Transition": 2500000,
|
||||
"eip155Transition": 3000000,
|
||||
"eip160Transition": 3000000,
|
||||
"ecip1010PauseTransition": 3000000,
|
||||
"ecip1010ContinueTransition": 5000000,
|
||||
@ -24,6 +20,9 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
@ -31,6 +30,8 @@
|
||||
"chainID": "0x3d",
|
||||
"forkBlock": "0x1d4c00",
|
||||
"forkCanonHash": "0x94365e3a8c0b35089c1d1195081fe7489b528a84b22199c916180db8b28ade7f",
|
||||
"eip155Transition": 3000000,
|
||||
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
},
|
||||
|
@ -3,15 +3,11 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"homesteadTransition": "0x0",
|
||||
"eip150Transition": "0x0",
|
||||
"eip155Transition": "0x7fffffffffffffff",
|
||||
"eip160Transition": "0x7fffffffffffffff",
|
||||
"eip161abcTransition": "0x7fffffffffffffff",
|
||||
"eip161dTransition": "0x7fffffffffffffff",
|
||||
@ -20,12 +16,16 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID" : "0x1",
|
||||
"eip98Transition": "0x7fffffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffffff"
|
||||
"eip86Transition": "0x7fffffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -3,15 +3,11 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"homesteadTransition": "0x0",
|
||||
"eip150Transition": "0x0",
|
||||
"eip155Transition": "0x7fffffffffffffff",
|
||||
"eip160Transition": "0x0",
|
||||
"eip161abcTransition": "0x0",
|
||||
"eip161dTransition": "0x0",
|
||||
@ -20,12 +16,16 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID" : "0x1",
|
||||
"eip98Transition": "0x7fffffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffffff"
|
||||
"eip86Transition": "0x7fffffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -4,19 +4,15 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"difficultyIncrementDivisor": "60",
|
||||
"durationLimit": "0x3C",
|
||||
"blockReward": "0x6f05b59d3b200000",
|
||||
"registrar" : "0x6c221ca53705f3497ec90ca7b84c59ae7382fc21",
|
||||
"homesteadTransition": "0x30d40",
|
||||
"difficultyHardforkTransition": "0x59d9",
|
||||
"difficultyHardforkBoundDivisor": "0x0200",
|
||||
"bombDefuseTransition": "0x30d40",
|
||||
"eip150Transition": "0x927C0",
|
||||
"eip155Transition": "0x927C0",
|
||||
"eip160Transition": "0x927C0",
|
||||
"eip161abcTransition": "0x927C0",
|
||||
"eip161dTransition": "0x927C0"
|
||||
@ -24,6 +20,9 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x6f05b59d3b200000",
|
||||
"registrar" : "0x6c221ca53705f3497ec90ca7b84c59ae7382fc21",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
@ -31,7 +30,8 @@
|
||||
"chainID": "0x2",
|
||||
"subprotocolName": "exp",
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
"eip86Transition": "0x7fffffffffffff",
|
||||
"eip155Transition": "0x927C0"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -4,12 +4,9 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xe3389675d0338462dC76C6f9A3e432550c36A142",
|
||||
"homesteadTransition": "0x118c30",
|
||||
"daoHardforkTransition": "0x1d4c00",
|
||||
"daoHardforkBeneficiary": "0xbf4ed7b27f1d666546e30d74d50d173d20bca754",
|
||||
@ -132,7 +129,6 @@
|
||||
"0x807640a13483f8ac783c557fcdf27be11ea4ac7a"
|
||||
],
|
||||
"eip150Transition": "0x259518",
|
||||
"eip155Transition": 2675000,
|
||||
"eip160Transition": 2675000,
|
||||
"eip161abcTransition": 2675000,
|
||||
"eip161dTransition": 2675000,
|
||||
@ -141,12 +137,17 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xe3389675d0338462dC76C6f9A3e432550c36A142",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID" : "0x1",
|
||||
"forkBlock": "0x1d4c00",
|
||||
"forkCanonHash": "0x4985f5ca3d2afbec36529aa96f74de3cc10a2a4a6c44f2157a57d2c6059a11bb",
|
||||
"eip155Transition": 2675000,
|
||||
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
},
|
||||
|
@ -3,12 +3,9 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"homesteadTransition": "0x118c30",
|
||||
"daoHardforkTransition": "0x1d4c00",
|
||||
"daoHardforkBeneficiary": "0xbf4ed7b27f1d666546e30d74d50d173d20bca754",
|
||||
@ -131,7 +128,6 @@
|
||||
"0x807640a13483f8ac783c557fcdf27be11ea4ac7a"
|
||||
],
|
||||
"eip150Transition": "0x7fffffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff",
|
||||
"eip160Transition": "0x7fffffffffffffff",
|
||||
"eip161abcTransition": "0x7fffffffffffffff",
|
||||
"eip161dTransition": "0x7fffffffffffffff"
|
||||
@ -139,12 +135,16 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID" : "0x1",
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
"eip86Transition": "0x7fffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -3,15 +3,11 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"homesteadTransition": "0x7fffffffffffffff",
|
||||
"eip150Transition": "0x7fffffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff",
|
||||
"eip160Transition": "0x7fffffffffffffff",
|
||||
"eip161abcTransition": "0x7fffffffffffffff",
|
||||
"eip161dTransition": "0x7fffffffffffffff"
|
||||
@ -19,12 +15,16 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID" : "0x1",
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
"eip86Transition": "0x7fffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -3,15 +3,11 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"homesteadTransition": "0x0",
|
||||
"eip150Transition": "0x7fffffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff",
|
||||
"eip160Transition": "0x7fffffffffffffff",
|
||||
"eip161abcTransition": "0x7fffffffffffffff",
|
||||
"eip161dTransition": "0x7fffffffffffffff"
|
||||
@ -19,12 +15,16 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID" : "0x1",
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
"eip86Transition": "0x7fffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -4,10 +4,7 @@
|
||||
"engine": {
|
||||
"authorityRound": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x400",
|
||||
"registrar" : "0xfAb104398BBefbd47752E7702D9fE23047E1Bca3",
|
||||
"stepDuration": "4",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"validators" : {
|
||||
"list": [
|
||||
"0x00D6Cc1BA9cf89BD2e58009741f4F7325BAdc0ED",
|
||||
@ -25,16 +22,19 @@
|
||||
]
|
||||
},
|
||||
"validateScoreTransition": 1000000,
|
||||
"eip155Transition": 1000000,
|
||||
"validateStepTransition": 1500000
|
||||
}
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"gasLimitBoundDivisor": "0x400",
|
||||
"registrar" : "0xfAb104398BBefbd47752E7702D9fE23047E1Bca3",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID" : "0x2A",
|
||||
"validateReceiptsTransition" : 1000000
|
||||
"validateReceiptsTransition" : 1000000,
|
||||
"eip155Transition": 1000000
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -3,15 +3,12 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
|
||||
"homesteadTransition": "0x0",
|
||||
"eip150Transition": "0x0",
|
||||
"eip155Transition": "0x0",
|
||||
"eip160Transition": "0x0",
|
||||
"eip161abcTransition": "0x0",
|
||||
"eip161dTransition": "0x0",
|
||||
@ -20,6 +17,9 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
@ -27,7 +27,8 @@
|
||||
"eip98Transition": "0x0",
|
||||
"eip86Transition": "0x0",
|
||||
"eip140Transition": "0x0",
|
||||
"eip210Transition": "0x0"
|
||||
"eip210Transition": "0x0",
|
||||
"eip155Transition": "0x0"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -4,15 +4,11 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar": "0x52dff57a8a1532e6afb3dc07e2af58bb9eb05b3d",
|
||||
"homesteadTransition": 494000,
|
||||
"eip150Transition": 1783000,
|
||||
"eip155Transition": 1915000,
|
||||
"eip160Transition": 1915000,
|
||||
"ecip1010PauseTransition": 1915000,
|
||||
"ecip1010ContinueTransition": 3415000,
|
||||
@ -23,6 +19,9 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar": "0x52dff57a8a1532e6afb3dc07e2af58bb9eb05b3d",
|
||||
"accountStartNonce": "0x0100000",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
@ -30,6 +29,8 @@
|
||||
"chainID": "0x3e",
|
||||
"forkBlock": "0x1b34d8",
|
||||
"forkCanonHash": "0xf376243aeff1f256d970714c3de9fd78fa4e63cf63e32a51fe1169e375d98145",
|
||||
"eip155Transition": 1915000,
|
||||
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
},
|
||||
|
@ -3,15 +3,11 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x08",
|
||||
"blockReward": "0x14D1120D7B160000",
|
||||
"registrar": "5e70c0bbcd5636e0f9f9316e9f8633feb64d4050",
|
||||
"homesteadTransition": "0x7fffffffffffffff",
|
||||
"eip150Transition": "0x7fffffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff",
|
||||
"eip160Transition": "0x7fffffffffffffff",
|
||||
"eip161abcTransition": "0x7fffffffffffffff",
|
||||
"eip161dTransition": "0x7fffffffffffffff"
|
||||
@ -19,12 +15,16 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x14D1120D7B160000",
|
||||
"registrar": "5e70c0bbcd5636e0f9f9316e9f8633feb64d4050",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x0400",
|
||||
"minGasLimit": "125000",
|
||||
"networkID" : "0x0",
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
"eip86Transition": "0x7fffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -4,15 +4,11 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2",
|
||||
"homesteadTransition": 0,
|
||||
"eip150Transition": 0,
|
||||
"eip155Transition": 10,
|
||||
"eip160Transition": 10,
|
||||
"eip161abcTransition": 10,
|
||||
"eip161dTransition": 10,
|
||||
@ -21,12 +17,17 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID" : "0x3",
|
||||
"forkBlock": 641350,
|
||||
"forkCanonHash": "0x8033403e9fe5811a7b6d6b469905915de1c59207ce2172cbcf5d6ff14fa6a2eb",
|
||||
"eip155Transition": 10,
|
||||
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
},
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 4e8b9be3fba16ec32e0cdf50b8f9329826283aaa
|
||||
Subproject commit ef191fdc61cf76cdb9cdc147465fb447304b0ed2
|
@ -3,12 +3,9 @@
|
||||
"engine": {
|
||||
"Ethash": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"minimumDifficulty": "0x020000",
|
||||
"difficultyBoundDivisor": "0x0800",
|
||||
"durationLimit": "0x0d",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"homesteadTransition": "0x5",
|
||||
"daoHardforkTransition": "0x8",
|
||||
"daoHardforkBeneficiary": "0xbf4ed7b27f1d666546e30d74d50d173d20bca754",
|
||||
@ -131,7 +128,6 @@
|
||||
"0x807640a13483f8ac783c557fcdf27be11ea4ac7a"
|
||||
],
|
||||
"eip150Transition": "0xa",
|
||||
"eip155Transition": "0x7fffffffffffffff",
|
||||
"eip160Transition": "0x7fffffffffffffff",
|
||||
"eip161abcTransition": "0x7fffffffffffffff",
|
||||
"eip161dTransition": "0x7fffffffffffffff"
|
||||
@ -139,12 +135,16 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"blockReward": "0x4563918244F40000",
|
||||
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
|
||||
"accountStartNonce": "0x00",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
"networkID" : "0x1",
|
||||
"eip98Transition": "0x7fffffffffffff",
|
||||
"eip86Transition": "0x7fffffffffffff"
|
||||
"eip86Transition": "0x7fffffffffffff",
|
||||
"eip155Transition": "0x7fffffffffffffff"
|
||||
},
|
||||
"genesis": {
|
||||
"seal": {
|
||||
|
@ -1,13 +1,10 @@
|
||||
{
|
||||
"name": "DevelopmentChain",
|
||||
"engine": {
|
||||
"instantSeal": {
|
||||
"params": {
|
||||
"registrar": "0x0000000000000000000000000000000000000005"
|
||||
}
|
||||
}
|
||||
"instantSeal": null
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -4,6 +4,7 @@
|
||||
"null": null
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -4,6 +4,7 @@
|
||||
"null": null
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -3,7 +3,6 @@
|
||||
"engine": {
|
||||
"tendermint": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"validators" : {
|
||||
"list": [
|
||||
"0x82a978b3f5962a5b0957d9ee9eef472ee55b42f1",
|
||||
@ -18,6 +17,7 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -3,7 +3,6 @@
|
||||
"engine": {
|
||||
"authorityRound": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"stepDuration": 1,
|
||||
"startStep": 2,
|
||||
"validators": {
|
||||
@ -14,6 +13,7 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -3,7 +3,6 @@
|
||||
"engine": {
|
||||
"basicAuthority": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"durationLimit": "0x0d",
|
||||
"validators": {
|
||||
"multi": {
|
||||
@ -15,6 +14,7 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -3,7 +3,6 @@
|
||||
"engine": {
|
||||
"basicAuthority": {
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"durationLimit": "0x0d",
|
||||
"validators": {
|
||||
"safeContract": "0x0000000000000000000000000000000000000005"
|
||||
@ -12,6 +11,7 @@
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"gasLimitBoundDivisor": "0x0400",
|
||||
"accountStartNonce": "0x0",
|
||||
"maximumExtraDataSize": "0x20",
|
||||
"minGasLimit": "0x1388",
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 9ed6304313fa949ed92aa0570fb2bc759fb6dc58
|
||||
Subproject commit 18dad7912cf42937ff725ffd944d01ff7ca1cce7
|
@ -15,6 +15,7 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! DB backend wrapper for Account trie
|
||||
use std::collections::HashMap;
|
||||
use util::*;
|
||||
use rlp::NULL_RLP;
|
||||
|
||||
|
@ -25,7 +25,7 @@ use util::{Bytes, Address, Hashable, U256, H256, ordered_trie_root, SHA3_NULL_RL
|
||||
use util::error::{Mismatch, OutOfBounds};
|
||||
|
||||
use basic_types::{LogBloom, Seal};
|
||||
use evm::env_info::{EnvInfo, LastHashes};
|
||||
use vm::{EnvInfo, LastHashes};
|
||||
use engines::Engine;
|
||||
use error::{Error, BlockError, TransactionError};
|
||||
use factory::Factories;
|
||||
@ -667,7 +667,7 @@ mod tests {
|
||||
use tests::helpers::*;
|
||||
use super::*;
|
||||
use engines::Engine;
|
||||
use evm::env_info::LastHashes;
|
||||
use vm::LastHashes;
|
||||
use error::Error;
|
||||
use header::Header;
|
||||
use factory::Factories;
|
||||
|
@ -16,6 +16,9 @@
|
||||
|
||||
//! Blockchain database.
|
||||
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
use std::mem;
|
||||
use bloomchain as bc;
|
||||
use util::*;
|
||||
use rlp::*;
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
//! Blockchain DB extras.
|
||||
|
||||
use std::ops;
|
||||
use std::io::Write;
|
||||
use bloomchain;
|
||||
use blooms::{GroupPosition, BloomGroup};
|
||||
use db::Key;
|
||||
@ -56,7 +58,7 @@ fn with_index(hash: &H256, i: ExtrasIndex) -> H264 {
|
||||
|
||||
pub struct BlockNumberKey([u8; 5]);
|
||||
|
||||
impl Deref for BlockNumberKey {
|
||||
impl ops::Deref for BlockNumberKey {
|
||||
type Target = [u8];
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
@ -88,7 +90,7 @@ impl Key<BlockDetails> for H256 {
|
||||
|
||||
pub struct LogGroupKey([u8; 6]);
|
||||
|
||||
impl Deref for LogGroupKey {
|
||||
impl ops::Deref for LogGroupKey {
|
||||
type Target = [u8];
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
@ -160,7 +162,8 @@ pub const EPOCH_KEY_PREFIX: &'static [u8; DB_PREFIX_LEN] = &[
|
||||
];
|
||||
|
||||
pub struct EpochTransitionsKey([u8; EPOCH_KEY_LEN]);
|
||||
impl Deref for EpochTransitionsKey {
|
||||
|
||||
impl ops::Deref for EpochTransitionsKey {
|
||||
type Target = [u8];
|
||||
|
||||
fn deref(&self) -> &[u8] { &self.0[..] }
|
||||
|
@ -36,9 +36,9 @@ impl From<&'static str> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<::evm::Error> for Error {
|
||||
fn into(self) -> ::evm::Error {
|
||||
::evm::Error::BuiltIn(self.0)
|
||||
impl Into<::vm::Error> for Error {
|
||||
fn into(self) -> ::vm::Error {
|
||||
::vm::Error::BuiltIn(self.0)
|
||||
}
|
||||
}
|
||||
|
||||
@ -352,7 +352,7 @@ fn read_point(reader: &mut io::Chain<&[u8], io::Repeat>) -> Result<::bn::G1, Err
|
||||
let px = Fq::from_slice(&buf[0..32]).map_err(|_| Error::from("Invalid point x coordinate"))?;
|
||||
|
||||
reader.read_exact(&mut buf[..]).expect("reading from zero-extended memory cannot fail; qed");
|
||||
let py = Fq::from_slice(&buf[0..32]).map_err(|_| Error::from("Invalid point x coordinate"))?;
|
||||
let py = Fq::from_slice(&buf[0..32]).map_err(|_| Error::from("Invalid point y coordinate"))?;
|
||||
|
||||
Ok(
|
||||
if px == Fq::zero() && py == Fq::zero() {
|
||||
|
@ -42,9 +42,8 @@ use client::{
|
||||
};
|
||||
use encoded;
|
||||
use engines::{Engine, EpochTransition};
|
||||
use evm::env_info::EnvInfo;
|
||||
use evm::env_info::LastHashes;
|
||||
use error::{ImportError, ExecutionError, CallError, BlockError, ImportResult, Error as EthcoreError};
|
||||
use vm::{EnvInfo, LastHashes};
|
||||
use evm::{Factory as EvmFactory, Schedule};
|
||||
use executive::{Executive, Executed, TransactOptions, contract_address};
|
||||
use factory::Factories;
|
||||
@ -907,7 +906,7 @@ impl Client {
|
||||
pub fn state_at(&self, id: BlockId) -> Option<State<StateDB>> {
|
||||
// fast path for latest state.
|
||||
match id.clone() {
|
||||
BlockId::Pending => return self.miner.pending_state().or_else(|| Some(self.state())),
|
||||
BlockId::Pending => return self.miner.pending_state(self.chain.read().best_block_number()).or_else(|| Some(self.state())),
|
||||
BlockId::Latest => return Some(self.state()),
|
||||
_ => {},
|
||||
}
|
||||
@ -1056,19 +1055,20 @@ impl Client {
|
||||
self.history
|
||||
}
|
||||
|
||||
fn block_hash(chain: &BlockChain, id: BlockId) -> Option<H256> {
|
||||
fn block_hash(chain: &BlockChain, miner: &Miner, id: BlockId) -> Option<H256> {
|
||||
match id {
|
||||
BlockId::Hash(hash) => Some(hash),
|
||||
BlockId::Number(number) => chain.block_hash(number),
|
||||
BlockId::Earliest => chain.block_hash(0),
|
||||
BlockId::Latest | BlockId::Pending => Some(chain.best_block_hash()),
|
||||
BlockId::Latest => Some(chain.best_block_hash()),
|
||||
BlockId::Pending => miner.pending_block_header(chain.best_block_number()).map(|header| header.hash())
|
||||
}
|
||||
}
|
||||
|
||||
fn transaction_address(&self, id: TransactionId) -> Option<TransactionAddress> {
|
||||
match id {
|
||||
TransactionId::Hash(ref hash) => self.chain.read().transaction_address(hash),
|
||||
TransactionId::Location(id, index) => Self::block_hash(&self.chain.read(), id).map(|hash| TransactionAddress {
|
||||
TransactionId::Location(id, index) => Self::block_hash(&self.chain.read(), &self.miner, id).map(|hash| TransactionAddress {
|
||||
block_hash: hash,
|
||||
index: index,
|
||||
})
|
||||
@ -1111,6 +1111,31 @@ impl Client {
|
||||
data: data,
|
||||
}.fake_sign(from)
|
||||
}
|
||||
|
||||
fn do_call(&self, env_info: &EnvInfo, state: &mut State<StateDB>, increase_balance: bool, t: &SignedTransaction, analytics: CallAnalytics) -> Result<Executed, CallError> {
|
||||
let original_state = if analytics.state_diffing { Some(state.clone()) } else { None };
|
||||
|
||||
// give the sender a sufficient balance (if calling in pending block)
|
||||
if increase_balance {
|
||||
let sender = t.sender();
|
||||
let balance = state.balance(&sender).map_err(ExecutionError::from)?;
|
||||
let needed_balance = t.value + t.gas * t.gas_price;
|
||||
if balance < needed_balance {
|
||||
state.add_balance(&sender, &(needed_balance - balance), state::CleanupMode::NoEmpty)
|
||||
.map_err(ExecutionError::from)?;
|
||||
}
|
||||
}
|
||||
|
||||
let options = TransactOptions { tracing: analytics.transaction_tracing, vm_tracing: analytics.vm_tracing, check_nonce: false };
|
||||
let mut ret = Executive::new(state, env_info, &*self.engine).transact_virtual(t, options)?;
|
||||
|
||||
// TODO gav move this into Executive.
|
||||
if let Some(original) = original_state {
|
||||
ret.state_diff = Some(state.diff_from(original).map_err(ExecutionError::from)?);
|
||||
}
|
||||
|
||||
Ok(ret)
|
||||
}
|
||||
}
|
||||
|
||||
impl snapshot::DatabaseRestore for Client {
|
||||
@ -1135,23 +1160,31 @@ impl snapshot::DatabaseRestore for Client {
|
||||
}
|
||||
|
||||
impl BlockChainClient for Client {
|
||||
fn call(&self, t: &SignedTransaction, block: BlockId, analytics: CallAnalytics) -> Result<Executed, CallError> {
|
||||
fn call(&self, transaction: &SignedTransaction, analytics: CallAnalytics, block: BlockId) -> Result<Executed, CallError> {
|
||||
let mut env_info = self.env_info(block).ok_or(CallError::StatePruned)?;
|
||||
env_info.gas_limit = U256::max_value();
|
||||
|
||||
// that's just a copy of the state.
|
||||
let mut state = self.state_at(block).ok_or(CallError::StatePruned)?;
|
||||
let original_state = if analytics.state_diffing { Some(state.clone()) } else { None };
|
||||
|
||||
let options = TransactOptions { tracing: analytics.transaction_tracing, vm_tracing: analytics.vm_tracing, check_nonce: false };
|
||||
let mut ret = Executive::new(&mut state, &env_info, &*self.engine).transact_virtual(t, options)?;
|
||||
self.do_call(&env_info, &mut state, block == BlockId::Pending, transaction, analytics)
|
||||
}
|
||||
|
||||
// TODO gav move this into Executive.
|
||||
if let Some(original) = original_state {
|
||||
ret.state_diff = Some(state.diff_from(original).map_err(ExecutionError::from)?);
|
||||
fn call_many(&self, transactions: &[(SignedTransaction, CallAnalytics)], block: BlockId) -> Result<Vec<Executed>, CallError> {
|
||||
let mut env_info = self.env_info(block).ok_or(CallError::StatePruned)?;
|
||||
env_info.gas_limit = U256::max_value();
|
||||
|
||||
// that's just a copy of the state.
|
||||
let mut state = self.state_at(block).ok_or(CallError::StatePruned)?;
|
||||
let mut results = Vec::with_capacity(transactions.len());
|
||||
|
||||
for &(ref t, analytics) in transactions {
|
||||
let ret = self.do_call(&env_info, &mut state, block == BlockId::Pending, t, analytics)?;
|
||||
env_info.gas_used = ret.cumulative_gas_used;
|
||||
results.push(ret);
|
||||
}
|
||||
|
||||
Ok(ret)
|
||||
Ok(results)
|
||||
}
|
||||
|
||||
fn estimate_gas(&self, t: &SignedTransaction, block: BlockId) -> Result<U256, CallError> {
|
||||
@ -1304,7 +1337,16 @@ impl BlockChainClient for Client {
|
||||
|
||||
fn block_header(&self, id: BlockId) -> Option<::encoded::Header> {
|
||||
let chain = self.chain.read();
|
||||
Self::block_hash(&chain, id).and_then(|hash| chain.block_header_data(&hash))
|
||||
|
||||
if let BlockId::Pending = id {
|
||||
if let Some(block) = self.miner.pending_block(chain.best_block_number()) {
|
||||
return Some(encoded::Header::new(block.header.rlp(Seal::Without)));
|
||||
}
|
||||
// fall back to latest
|
||||
return self.block_header(BlockId::Latest);
|
||||
}
|
||||
|
||||
Self::block_hash(&chain, &self.miner, id).and_then(|hash| chain.block_header_data(&hash))
|
||||
}
|
||||
|
||||
fn block_number(&self, id: BlockId) -> Option<BlockNumber> {
|
||||
@ -1312,30 +1354,48 @@ impl BlockChainClient for Client {
|
||||
BlockId::Number(number) => Some(number),
|
||||
BlockId::Hash(ref hash) => self.chain.read().block_number(hash),
|
||||
BlockId::Earliest => Some(0),
|
||||
BlockId::Latest | BlockId::Pending => Some(self.chain.read().best_block_number()),
|
||||
BlockId::Latest => Some(self.chain.read().best_block_number()),
|
||||
BlockId::Pending => Some(self.chain.read().best_block_number() + 1),
|
||||
}
|
||||
}
|
||||
|
||||
fn block_body(&self, id: BlockId) -> Option<encoded::Body> {
|
||||
let chain = self.chain.read();
|
||||
Self::block_hash(&chain, id).and_then(|hash| chain.block_body(&hash))
|
||||
|
||||
if let BlockId::Pending = id {
|
||||
if let Some(block) = self.miner.pending_block(chain.best_block_number()) {
|
||||
return Some(encoded::Body::new(BlockChain::block_to_body(&block.rlp_bytes(Seal::Without))));
|
||||
}
|
||||
// fall back to latest
|
||||
return self.block_body(BlockId::Latest);
|
||||
}
|
||||
|
||||
Self::block_hash(&chain, &self.miner, id).and_then(|hash| chain.block_body(&hash))
|
||||
}
|
||||
|
||||
fn block(&self, id: BlockId) -> Option<encoded::Block> {
|
||||
let chain = self.chain.read();
|
||||
|
||||
if let BlockId::Pending = id {
|
||||
if let Some(block) = self.miner.pending_block() {
|
||||
if let Some(block) = self.miner.pending_block(chain.best_block_number()) {
|
||||
return Some(encoded::Block::new(block.rlp_bytes(Seal::Without)));
|
||||
}
|
||||
// fall back to latest
|
||||
return self.block(BlockId::Latest);
|
||||
}
|
||||
let chain = self.chain.read();
|
||||
Self::block_hash(&chain, id).and_then(|hash| {
|
||||
|
||||
Self::block_hash(&chain, &self.miner, id).and_then(|hash| {
|
||||
chain.block(&hash)
|
||||
})
|
||||
}
|
||||
|
||||
fn block_status(&self, id: BlockId) -> BlockStatus {
|
||||
if let BlockId::Pending = id {
|
||||
return BlockStatus::Pending;
|
||||
}
|
||||
|
||||
let chain = self.chain.read();
|
||||
match Self::block_hash(&chain, id) {
|
||||
match Self::block_hash(&chain, &self.miner, id) {
|
||||
Some(ref hash) if chain.is_known(hash) => BlockStatus::InChain,
|
||||
Some(hash) => self.block_queue.status(&hash).into(),
|
||||
None => BlockStatus::Unknown
|
||||
@ -1343,13 +1403,18 @@ impl BlockChainClient for Client {
|
||||
}
|
||||
|
||||
fn block_total_difficulty(&self, id: BlockId) -> Option<U256> {
|
||||
if let BlockId::Pending = id {
|
||||
if let Some(block) = self.miner.pending_block() {
|
||||
return Some(*block.header.difficulty() + self.block_total_difficulty(BlockId::Latest).expect("blocks in chain have details; qed"));
|
||||
}
|
||||
}
|
||||
let chain = self.chain.read();
|
||||
Self::block_hash(&chain, id).and_then(|hash| chain.block_details(&hash)).map(|d| d.total_difficulty)
|
||||
if let BlockId::Pending = id {
|
||||
let latest_difficulty = self.block_total_difficulty(BlockId::Latest).expect("blocks in chain have details; qed");
|
||||
let pending_difficulty = self.miner.pending_block_header(chain.best_block_number()).map(|header| *header.difficulty());
|
||||
if let Some(difficulty) = pending_difficulty {
|
||||
return Some(difficulty + latest_difficulty);
|
||||
}
|
||||
// fall back to latest
|
||||
return Some(latest_difficulty);
|
||||
}
|
||||
|
||||
Self::block_hash(&chain, &self.miner, id).and_then(|hash| chain.block_details(&hash)).map(|d| d.total_difficulty)
|
||||
}
|
||||
|
||||
fn nonce(&self, address: &Address, id: BlockId) -> Option<U256> {
|
||||
@ -1362,7 +1427,7 @@ impl BlockChainClient for Client {
|
||||
|
||||
fn block_hash(&self, id: BlockId) -> Option<H256> {
|
||||
let chain = self.chain.read();
|
||||
Self::block_hash(&chain, id)
|
||||
Self::block_hash(&chain, &self.miner, id)
|
||||
}
|
||||
|
||||
fn code(&self, address: &Address, id: BlockId) -> Option<Option<Bytes>> {
|
||||
@ -1527,7 +1592,8 @@ impl BlockChainClient for Client {
|
||||
if self.chain.read().is_known(&unverified.hash()) {
|
||||
return Err(BlockImportError::Import(ImportError::AlreadyInChain));
|
||||
}
|
||||
if self.block_status(BlockId::Hash(unverified.parent_hash())) == BlockStatus::Unknown {
|
||||
let status = self.block_status(BlockId::Hash(unverified.parent_hash()));
|
||||
if status == BlockStatus::Unknown || status == BlockStatus::Pending {
|
||||
return Err(BlockImportError::Block(BlockError::UnknownParent(unverified.parent_hash())));
|
||||
}
|
||||
}
|
||||
@ -1541,7 +1607,8 @@ impl BlockChainClient for Client {
|
||||
if self.chain.read().is_known(&header.hash()) {
|
||||
return Err(BlockImportError::Import(ImportError::AlreadyInChain));
|
||||
}
|
||||
if self.block_status(BlockId::Hash(header.parent_hash())) == BlockStatus::Unknown {
|
||||
let status = self.block_status(BlockId::Hash(header.parent_hash()));
|
||||
if status == BlockStatus::Unknown || status == BlockStatus::Pending {
|
||||
return Err(BlockImportError::Block(BlockError::UnknownParent(header.parent_hash())));
|
||||
}
|
||||
}
|
||||
@ -1687,7 +1754,7 @@ impl BlockChainClient for Client {
|
||||
fn call_contract(&self, block_id: BlockId, address: Address, data: Bytes) -> Result<Bytes, String> {
|
||||
let transaction = self.contract_call_tx(block_id, address, data);
|
||||
|
||||
self.call(&transaction, block_id, Default::default())
|
||||
self.call(&transaction, Default::default(), block_id)
|
||||
.map_err(|e| format!("{:?}", e))
|
||||
.map(|executed| {
|
||||
executed.output
|
||||
|
@ -23,7 +23,7 @@ use util::kvdb::{self, KeyValueDB};
|
||||
use {state, state_db, client, executive, trace, db, spec};
|
||||
use factory::Factories;
|
||||
use evm::{self, VMType};
|
||||
use evm::action_params::ActionParams;
|
||||
use vm::{self, ActionParams};
|
||||
|
||||
/// EVM test Error.
|
||||
#[derive(Debug)]
|
||||
@ -31,7 +31,7 @@ pub enum EvmTestError {
|
||||
/// Trie integrity error.
|
||||
Trie(util::TrieError),
|
||||
/// EVM error.
|
||||
Evm(evm::Error),
|
||||
Evm(vm::Error),
|
||||
/// Initialization error.
|
||||
Initialization(::error::Error),
|
||||
/// Low-level database error.
|
||||
|
@ -40,7 +40,7 @@ pub use types::pruning_info::PruningInfo;
|
||||
pub use types::call_analytics::CallAnalytics;
|
||||
|
||||
pub use executive::{Executed, Executive, TransactOptions};
|
||||
pub use evm::env_info::{LastHashes, EnvInfo};
|
||||
pub use vm::{LastHashes, EnvInfo};
|
||||
|
||||
pub use error::{BlockImportError, TransactionImportError, TransactionImportResult};
|
||||
pub use verification::VerifierType;
|
||||
|
@ -17,6 +17,9 @@
|
||||
//! Test client.
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrder};
|
||||
use std::sync::Arc;
|
||||
use std::collections::{HashMap, BTreeMap};
|
||||
use std::mem;
|
||||
use rustc_hex::FromHex;
|
||||
use util::*;
|
||||
use rlp::*;
|
||||
@ -36,7 +39,8 @@ use log_entry::LocalizedLogEntry;
|
||||
use receipt::{Receipt, LocalizedReceipt};
|
||||
use blockchain::extras::BlockReceipts;
|
||||
use error::{ImportResult, Error as EthcoreError};
|
||||
use evm::{Factory as EvmFactory, VMType, Schedule};
|
||||
use evm::{Factory as EvmFactory, VMType};
|
||||
use vm::Schedule;
|
||||
use miner::{Miner, MinerService, TransactionImportResult};
|
||||
use spec::Spec;
|
||||
use types::basic_account::BasicAccount;
|
||||
@ -397,10 +401,18 @@ impl MiningBlockChainClient for TestBlockChainClient {
|
||||
}
|
||||
|
||||
impl BlockChainClient for TestBlockChainClient {
|
||||
fn call(&self, _t: &SignedTransaction, _block: BlockId, _analytics: CallAnalytics) -> Result<Executed, CallError> {
|
||||
fn call(&self, _t: &SignedTransaction, _analytics: CallAnalytics, _block: BlockId) -> Result<Executed, CallError> {
|
||||
self.execution_result.read().clone().unwrap()
|
||||
}
|
||||
|
||||
fn call_many(&self, txs: &[(SignedTransaction, CallAnalytics)], block: BlockId) -> Result<Vec<Executed>, CallError> {
|
||||
let mut res = Vec::with_capacity(txs.len());
|
||||
for &(ref tx, analytics) in txs {
|
||||
res.push(self.call(tx, analytics, block)?);
|
||||
}
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
fn estimate_gas(&self, _t: &SignedTransaction, _block: BlockId) -> Result<U256, CallError> {
|
||||
Ok(21000.into())
|
||||
}
|
||||
@ -419,7 +431,7 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
|
||||
fn nonce(&self, address: &Address, id: BlockId) -> Option<U256> {
|
||||
match id {
|
||||
BlockId::Latest => Some(self.nonces.read().get(address).cloned().unwrap_or(self.spec.params().account_start_nonce)),
|
||||
BlockId::Latest | BlockId::Pending => Some(self.nonces.read().get(address).cloned().unwrap_or(self.spec.params().account_start_nonce)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -434,16 +446,15 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
|
||||
fn code(&self, address: &Address, id: BlockId) -> Option<Option<Bytes>> {
|
||||
match id {
|
||||
BlockId::Latest => Some(self.code.read().get(address).cloned()),
|
||||
BlockId::Latest | BlockId::Pending => Some(self.code.read().get(address).cloned()),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn balance(&self, address: &Address, id: BlockId) -> Option<U256> {
|
||||
if let BlockId::Latest = id {
|
||||
Some(self.balances.read().get(address).cloned().unwrap_or_else(U256::zero))
|
||||
} else {
|
||||
None
|
||||
match id {
|
||||
BlockId::Latest | BlockId::Pending => Some(self.balances.read().get(address).cloned().unwrap_or_else(U256::zero)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -452,10 +463,9 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
}
|
||||
|
||||
fn storage_at(&self, address: &Address, position: &H256, id: BlockId) -> Option<H256> {
|
||||
if let BlockId::Latest = id {
|
||||
Some(self.storage.read().get(&(address.clone(), position.clone())).cloned().unwrap_or_else(H256::new))
|
||||
} else {
|
||||
None
|
||||
match id {
|
||||
BlockId::Latest | BlockId::Pending => Some(self.storage.read().get(&(address.clone(), position.clone())).cloned().unwrap_or_else(H256::new)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -544,7 +554,8 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
match id {
|
||||
BlockId::Number(number) if (number as usize) < self.blocks.read().len() => BlockStatus::InChain,
|
||||
BlockId::Hash(ref hash) if self.blocks.read().get(hash).is_some() => BlockStatus::InChain,
|
||||
BlockId::Latest | BlockId::Pending | BlockId::Earliest => BlockStatus::InChain,
|
||||
BlockId::Latest | BlockId::Earliest => BlockStatus::InChain,
|
||||
BlockId::Pending => BlockStatus::Pending,
|
||||
_ => BlockStatus::Unknown,
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ use std::collections::BTreeMap;
|
||||
use block::{OpenBlock, SealedBlock, ClosedBlock};
|
||||
use blockchain::TreeRoute;
|
||||
use encoded;
|
||||
use evm::env_info::LastHashes;
|
||||
use vm::LastHashes;
|
||||
use error::{ImportResult, CallError, Error as EthcoreError};
|
||||
use error::{TransactionImportResult, BlockImportError};
|
||||
use evm::{Factory as EvmFactory, Schedule};
|
||||
@ -182,7 +182,11 @@ pub trait BlockChainClient : Sync + Send {
|
||||
fn logs(&self, filter: Filter) -> Vec<LocalizedLogEntry>;
|
||||
|
||||
/// Makes a non-persistent transaction call.
|
||||
fn call(&self, t: &SignedTransaction, block: BlockId, analytics: CallAnalytics) -> Result<Executed, CallError>;
|
||||
fn call(&self, tx: &SignedTransaction, analytics: CallAnalytics, block: BlockId) -> Result<Executed, CallError>;
|
||||
|
||||
/// Makes multiple non-persistent but dependent transaction calls.
|
||||
/// Returns a vector of successes or a failure if any of the transaction fails.
|
||||
fn call_many(&self, txs: &[(SignedTransaction, CallAnalytics)], block: BlockId) -> Result<Vec<Executed>, CallError>;
|
||||
|
||||
/// Estimates how much gas will be necessary for a call.
|
||||
fn estimate_gas(&self, t: &SignedTransaction, block: BlockId) -> Result<U256, CallError>;
|
||||
|
@ -17,8 +17,10 @@
|
||||
//! A blockchain engine that supports a non-instant BFT proof-of-authority.
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, AtomicBool, Ordering as AtomicOrdering};
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::time::{UNIX_EPOCH, Duration};
|
||||
use std::collections::{BTreeMap, HashSet, HashMap};
|
||||
use std::cmp;
|
||||
|
||||
use account_provider::AccountProvider;
|
||||
use block::*;
|
||||
@ -47,22 +49,14 @@ mod finality;
|
||||
|
||||
/// `AuthorityRound` params.
|
||||
pub struct AuthorityRoundParams {
|
||||
/// Gas limit divisor.
|
||||
pub gas_limit_bound_divisor: U256,
|
||||
/// Time to wait before next block or authority switching.
|
||||
pub step_duration: Duration,
|
||||
/// Block reward.
|
||||
pub block_reward: U256,
|
||||
/// Namereg contract address.
|
||||
pub registrar: Address,
|
||||
/// Starting step,
|
||||
pub start_step: Option<u64>,
|
||||
/// Valid validators.
|
||||
pub validators: Box<ValidatorSet>,
|
||||
/// Chain score validation transition block.
|
||||
pub validate_score_transition: u64,
|
||||
/// Number of first block where EIP-155 rules are validated.
|
||||
pub eip155_transition: u64,
|
||||
/// Monotonic step validation transition block.
|
||||
pub validate_step_transition: u64,
|
||||
/// Immediate transitions.
|
||||
@ -72,14 +66,10 @@ pub struct AuthorityRoundParams {
|
||||
impl From<ethjson::spec::AuthorityRoundParams> for AuthorityRoundParams {
|
||||
fn from(p: ethjson::spec::AuthorityRoundParams) -> Self {
|
||||
AuthorityRoundParams {
|
||||
gas_limit_bound_divisor: p.gas_limit_bound_divisor.into(),
|
||||
step_duration: Duration::from_secs(p.step_duration.into()),
|
||||
validators: new_validator_set(p.validators),
|
||||
block_reward: p.block_reward.map_or_else(U256::zero, Into::into),
|
||||
registrar: p.registrar.map_or_else(Address::new, Into::into),
|
||||
start_step: p.start_step.map(Into::into),
|
||||
validate_score_transition: p.validate_score_transition.map_or(0, Into::into),
|
||||
eip155_transition: p.eip155_transition.map_or(0, Into::into),
|
||||
validate_step_transition: p.validate_step_transition.map_or(0, Into::into),
|
||||
immediate_transitions: p.immediate_transitions.unwrap_or(false),
|
||||
}
|
||||
@ -214,9 +204,6 @@ impl EpochManager {
|
||||
/// Engine using `AuthorityRound` proof-of-authority BFT consensus.
|
||||
pub struct AuthorityRound {
|
||||
params: CommonParams,
|
||||
gas_limit_bound_divisor: U256,
|
||||
block_reward: U256,
|
||||
registrar: Address,
|
||||
builtins: BTreeMap<Address, Builtin>,
|
||||
transition_service: IoService<()>,
|
||||
step: Arc<Step>,
|
||||
@ -225,7 +212,6 @@ pub struct AuthorityRound {
|
||||
signer: RwLock<EngineSigner>,
|
||||
validators: Box<ValidatorSet>,
|
||||
validate_score_transition: u64,
|
||||
eip155_transition: u64,
|
||||
validate_step_transition: u64,
|
||||
epoch_manager: Mutex<EpochManager>,
|
||||
immediate_transitions: bool,
|
||||
@ -362,9 +348,6 @@ impl AuthorityRound {
|
||||
let engine = Arc::new(
|
||||
AuthorityRound {
|
||||
params: params,
|
||||
gas_limit_bound_divisor: our_params.gas_limit_bound_divisor,
|
||||
block_reward: our_params.block_reward,
|
||||
registrar: our_params.registrar,
|
||||
builtins: builtins,
|
||||
transition_service: IoService::<()>::start()?,
|
||||
step: Arc::new(Step {
|
||||
@ -377,7 +360,6 @@ impl AuthorityRound {
|
||||
signer: Default::default(),
|
||||
validators: our_params.validators,
|
||||
validate_score_transition: our_params.validate_score_transition,
|
||||
eip155_transition: our_params.eip155_transition,
|
||||
validate_step_transition: our_params.validate_step_transition,
|
||||
epoch_manager: Mutex::new(EpochManager::blank()),
|
||||
immediate_transitions: our_params.immediate_transitions,
|
||||
@ -433,7 +415,9 @@ impl Engine for AuthorityRound {
|
||||
|
||||
fn params(&self) -> &CommonParams { &self.params }
|
||||
|
||||
fn additional_params(&self) -> HashMap<String, String> { hash_map!["registrar".to_owned() => self.registrar.hex()] }
|
||||
fn additional_params(&self) -> HashMap<String, String> {
|
||||
hash_map!["registrar".to_owned() => self.params().registrar.hex()]
|
||||
}
|
||||
|
||||
fn builtins(&self) -> &BTreeMap<Address, Builtin> { &self.builtins }
|
||||
|
||||
@ -461,11 +445,11 @@ impl Engine for AuthorityRound {
|
||||
header.set_difficulty(new_difficulty);
|
||||
header.set_gas_limit({
|
||||
let gas_limit = parent.gas_limit().clone();
|
||||
let bound_divisor = self.gas_limit_bound_divisor;
|
||||
let bound_divisor = self.params().gas_limit_bound_divisor;
|
||||
if gas_limit < gas_floor_target {
|
||||
min(gas_floor_target, gas_limit + gas_limit / bound_divisor - 1.into())
|
||||
cmp::min(gas_floor_target, gas_limit + gas_limit / bound_divisor - 1.into())
|
||||
} else {
|
||||
max(gas_floor_target, gas_limit - gas_limit / bound_divisor + 1.into())
|
||||
cmp::max(gas_floor_target, gas_limit - gas_limit / bound_divisor + 1.into())
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -476,8 +460,8 @@ impl Engine for AuthorityRound {
|
||||
|
||||
/// Attempt to seal the block internally.
|
||||
///
|
||||
/// This operation is synchronous and may (quite reasonably) not be available, in which `false` will
|
||||
/// be returned.
|
||||
/// This operation is synchronous and may (quite reasonably) not be available, in which case
|
||||
/// `Seal::None` will be returned.
|
||||
fn generate_seal(&self, block: &ExecutedBlock) -> Seal {
|
||||
// first check to avoid generating signature most of the time
|
||||
// (but there's still a race to the `compare_and_swap`)
|
||||
@ -532,7 +516,7 @@ impl Engine for AuthorityRound {
|
||||
fn on_new_block(
|
||||
&self,
|
||||
block: &mut ExecutedBlock,
|
||||
last_hashes: Arc<::evm::env_info::LastHashes>,
|
||||
last_hashes: Arc<::vm::LastHashes>,
|
||||
epoch_begin: bool,
|
||||
) -> Result<(), Error> {
|
||||
let parent_hash = block.fields().header.parent_hash().clone();
|
||||
@ -564,7 +548,8 @@ impl Engine for AuthorityRound {
|
||||
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error> {
|
||||
let fields = block.fields_mut();
|
||||
// Bestow block reward
|
||||
let res = fields.state.add_balance(fields.header.author(), &self.block_reward, CleanupMode::NoEmpty)
|
||||
let reward = self.params().block_reward;
|
||||
let res = fields.state.add_balance(fields.header.author(), &reward, CleanupMode::NoEmpty)
|
||||
.map_err(::error::Error::from)
|
||||
.and_then(|_| fields.state.commit());
|
||||
// Commit state so that we can actually figure out the state root.
|
||||
@ -629,7 +614,7 @@ impl Engine for AuthorityRound {
|
||||
}
|
||||
}
|
||||
|
||||
let gas_limit_divisor = self.gas_limit_bound_divisor;
|
||||
let gas_limit_divisor = self.params().gas_limit_bound_divisor;
|
||||
let min_gas = parent.gas_limit().clone() - parent.gas_limit().clone() / gas_limit_divisor;
|
||||
let max_gas = parent.gas_limit().clone() + parent.gas_limit().clone() / gas_limit_divisor;
|
||||
if header.gas_limit() <= &min_gas || header.gas_limit() >= &max_gas {
|
||||
@ -705,6 +690,7 @@ impl Engine for AuthorityRound {
|
||||
|
||||
// apply immediate transitions.
|
||||
if let Some(change) = self.validators.is_epoch_end(first, chain_head) {
|
||||
let change = combine_proofs(chain_head.number(), &change, &[]);
|
||||
return Some(change)
|
||||
}
|
||||
|
||||
@ -815,11 +801,11 @@ impl Engine for AuthorityRound {
|
||||
}
|
||||
}
|
||||
|
||||
fn verify_transaction_basic(&self, t: &UnverifiedTransaction, header: &Header) -> result::Result<(), Error> {
|
||||
fn verify_transaction_basic(&self, t: &UnverifiedTransaction, header: &Header) -> Result<(), Error> {
|
||||
t.check_low_s()?;
|
||||
|
||||
if let Some(n) = t.network_id() {
|
||||
if header.number() >= self.eip155_transition && n != self.params().chain_id {
|
||||
if header.number() >= self.params().eip155_transition && n != self.params().chain_id {
|
||||
return Err(TransactionError::InvalidNetworkId.into());
|
||||
}
|
||||
}
|
||||
@ -851,6 +837,7 @@ impl Engine for AuthorityRound {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering};
|
||||
use util::*;
|
||||
use header::Header;
|
||||
@ -941,10 +928,10 @@ mod tests {
|
||||
let addr = tap.insert_account("0".sha3().into(), "0").unwrap();
|
||||
let mut parent_header: Header = Header::default();
|
||||
parent_header.set_seal(vec![encode(&0usize).into_vec()]);
|
||||
parent_header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
parent_header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
let mut header: Header = Header::default();
|
||||
header.set_number(1);
|
||||
header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
header.set_author(addr);
|
||||
|
||||
let engine = Spec::new_test_round().engine;
|
||||
@ -967,10 +954,10 @@ mod tests {
|
||||
|
||||
let mut parent_header: Header = Header::default();
|
||||
parent_header.set_seal(vec![encode(&0usize).into_vec()]);
|
||||
parent_header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
parent_header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
let mut header: Header = Header::default();
|
||||
header.set_number(1);
|
||||
header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
header.set_author(addr);
|
||||
|
||||
let engine = Spec::new_test_round().engine;
|
||||
@ -993,10 +980,10 @@ mod tests {
|
||||
|
||||
let mut parent_header: Header = Header::default();
|
||||
parent_header.set_seal(vec![encode(&4usize).into_vec()]);
|
||||
parent_header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
parent_header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
let mut header: Header = Header::default();
|
||||
header.set_number(1);
|
||||
header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
header.set_author(addr);
|
||||
|
||||
let engine = Spec::new_test_round().engine;
|
||||
@ -1014,25 +1001,26 @@ mod tests {
|
||||
fn reports_skipped() {
|
||||
let last_benign = Arc::new(AtomicUsize::new(0));
|
||||
let params = AuthorityRoundParams {
|
||||
gas_limit_bound_divisor: U256::from_str("400").unwrap(),
|
||||
step_duration: Default::default(),
|
||||
block_reward: Default::default(),
|
||||
registrar: Default::default(),
|
||||
start_step: Some(1),
|
||||
validators: Box::new(TestSet::new(Default::default(), last_benign.clone())),
|
||||
validate_score_transition: 0,
|
||||
validate_step_transition: 0,
|
||||
eip155_transition: 0,
|
||||
immediate_transitions: true,
|
||||
};
|
||||
let aura = AuthorityRound::new(Default::default(), params, Default::default()).unwrap();
|
||||
|
||||
let aura = {
|
||||
let mut c_params = ::spec::CommonParams::default();
|
||||
c_params.gas_limit_bound_divisor = 5.into();
|
||||
AuthorityRound::new(c_params, params, Default::default()).unwrap()
|
||||
};
|
||||
|
||||
let mut parent_header: Header = Header::default();
|
||||
parent_header.set_seal(vec![encode(&1usize).into_vec()]);
|
||||
parent_header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
parent_header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
let mut header: Header = Header::default();
|
||||
header.set_number(1);
|
||||
header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
header.set_gas_limit("222222".parse::<U256>().unwrap());
|
||||
header.set_seal(vec![encode(&3usize).into_vec()]);
|
||||
|
||||
// Do not report when signer not present.
|
||||
|
@ -16,7 +16,9 @@
|
||||
|
||||
//! A blockchain engine that supports a basic, non-BFT proof-of-authority.
|
||||
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::collections::BTreeMap;
|
||||
use std::cmp;
|
||||
use util::*;
|
||||
use ethkey::{recover, public_to_address, Signature};
|
||||
use account_provider::AccountProvider;
|
||||
@ -35,8 +37,6 @@ use super::validator_set::{ValidatorSet, SimpleList, new_validator_set};
|
||||
/// `BasicAuthority` params.
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct BasicAuthorityParams {
|
||||
/// Gas limit divisor.
|
||||
pub gas_limit_bound_divisor: U256,
|
||||
/// Valid signatories.
|
||||
pub validators: ethjson::spec::ValidatorSet,
|
||||
}
|
||||
@ -44,7 +44,6 @@ pub struct BasicAuthorityParams {
|
||||
impl From<ethjson::spec::BasicAuthorityParams> for BasicAuthorityParams {
|
||||
fn from(p: ethjson::spec::BasicAuthorityParams) -> Self {
|
||||
BasicAuthorityParams {
|
||||
gas_limit_bound_divisor: p.gas_limit_bound_divisor.into(),
|
||||
validators: p.validators,
|
||||
}
|
||||
}
|
||||
@ -80,7 +79,6 @@ fn verify_external(header: &Header, validators: &ValidatorSet) -> Result<(), Err
|
||||
/// Engine using `BasicAuthority`, trivial proof-of-authority consensus.
|
||||
pub struct BasicAuthority {
|
||||
params: CommonParams,
|
||||
gas_limit_bound_divisor: U256,
|
||||
builtins: BTreeMap<Address, Builtin>,
|
||||
signer: RwLock<EngineSigner>,
|
||||
validators: Box<ValidatorSet>,
|
||||
@ -91,7 +89,6 @@ impl BasicAuthority {
|
||||
pub fn new(params: CommonParams, our_params: BasicAuthorityParams, builtins: BTreeMap<Address, Builtin>) -> Self {
|
||||
BasicAuthority {
|
||||
params: params,
|
||||
gas_limit_bound_divisor: our_params.gas_limit_bound_divisor,
|
||||
builtins: builtins,
|
||||
validators: new_validator_set(our_params.validators),
|
||||
signer: Default::default(),
|
||||
@ -119,11 +116,11 @@ impl Engine for BasicAuthority {
|
||||
header.set_difficulty(parent.difficulty().clone());
|
||||
header.set_gas_limit({
|
||||
let gas_limit = parent.gas_limit().clone();
|
||||
let bound_divisor = self.gas_limit_bound_divisor;
|
||||
let bound_divisor = self.params().gas_limit_bound_divisor;
|
||||
if gas_limit < gas_floor_target {
|
||||
min(gas_floor_target, gas_limit + gas_limit / bound_divisor - 1.into())
|
||||
cmp::min(gas_floor_target, gas_limit + gas_limit / bound_divisor - 1.into())
|
||||
} else {
|
||||
max(gas_floor_target, gas_limit - gas_limit / bound_divisor + 1.into())
|
||||
cmp::max(gas_floor_target, gas_limit - gas_limit / bound_divisor + 1.into())
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -147,7 +144,7 @@ impl Engine for BasicAuthority {
|
||||
Seal::None
|
||||
}
|
||||
|
||||
fn verify_block_basic(&self, header: &Header, _block: Option<&[u8]>) -> result::Result<(), Error> {
|
||||
fn verify_block_basic(&self, header: &Header, _block: Option<&[u8]>) -> Result<(), Error> {
|
||||
// check the seal fields.
|
||||
// TODO: pull this out into common code.
|
||||
if header.seal().len() != self.seal_fields() {
|
||||
@ -158,11 +155,11 @@ impl Engine for BasicAuthority {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn verify_block_unordered(&self, _header: &Header, _block: Option<&[u8]>) -> result::Result<(), Error> {
|
||||
fn verify_block_unordered(&self, _header: &Header, _block: Option<&[u8]>) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn verify_block_family(&self, header: &Header, parent: &Header, _block: Option<&[u8]>) -> result::Result<(), Error> {
|
||||
fn verify_block_family(&self, header: &Header, parent: &Header, _block: Option<&[u8]>) -> Result<(), Error> {
|
||||
// Do not calculate difficulty for genesis blocks.
|
||||
if header.number() == 0 {
|
||||
return Err(From::from(BlockError::RidiculousNumber(OutOfBounds { min: Some(1), max: None, found: header.number() })));
|
||||
@ -172,7 +169,7 @@ impl Engine for BasicAuthority {
|
||||
if header.difficulty() != parent.difficulty() {
|
||||
return Err(From::from(BlockError::InvalidDifficulty(Mismatch { expected: *parent.difficulty(), found: *header.difficulty() })))
|
||||
}
|
||||
let gas_limit_divisor = self.gas_limit_bound_divisor;
|
||||
let gas_limit_divisor = self.params().gas_limit_bound_divisor;
|
||||
let min_gas = parent.gas_limit().clone() - parent.gas_limit().clone() / gas_limit_divisor;
|
||||
let max_gas = parent.gas_limit().clone() + parent.gas_limit().clone() / gas_limit_divisor;
|
||||
if header.gas_limit() <= &min_gas || header.gas_limit() >= &max_gas {
|
||||
@ -254,6 +251,7 @@ impl Engine for BasicAuthority {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use block::*;
|
||||
use error::{BlockError, Error};
|
||||
|
@ -14,26 +14,24 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use util::{Address, HashMap};
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use util::Address;
|
||||
use builtin::Builtin;
|
||||
use engines::{Engine, Seal};
|
||||
use spec::CommonParams;
|
||||
use block::ExecutedBlock;
|
||||
use block::{ExecutedBlock, IsBlock};
|
||||
|
||||
/// An engine which does not provide any consensus mechanism, just seals blocks internally.
|
||||
pub struct InstantSeal {
|
||||
params: CommonParams,
|
||||
registrar: Address,
|
||||
builtins: BTreeMap<Address, Builtin>,
|
||||
}
|
||||
|
||||
impl InstantSeal {
|
||||
/// Returns new instance of InstantSeal with default VM Factory
|
||||
pub fn new(params: CommonParams, registrar: Address, builtins: BTreeMap<Address, Builtin>) -> Self {
|
||||
pub fn new(params: CommonParams, builtins: BTreeMap<Address, Builtin>) -> Self {
|
||||
InstantSeal {
|
||||
params: params,
|
||||
registrar: registrar,
|
||||
builtins: builtins,
|
||||
}
|
||||
}
|
||||
@ -49,7 +47,7 @@ impl Engine for InstantSeal {
|
||||
}
|
||||
|
||||
fn additional_params(&self) -> HashMap<String, String> {
|
||||
hash_map!["registrar".to_owned() => self.registrar.hex()]
|
||||
hash_map!["registrar".to_owned() => self.params().registrar.hex()]
|
||||
}
|
||||
|
||||
fn builtins(&self) -> &BTreeMap<Address, Builtin> {
|
||||
@ -58,13 +56,14 @@ impl Engine for InstantSeal {
|
||||
|
||||
fn seals_internally(&self) -> Option<bool> { Some(true) }
|
||||
|
||||
fn generate_seal(&self, _block: &ExecutedBlock) -> Seal {
|
||||
Seal::Regular(Vec::new())
|
||||
fn generate_seal(&self, block: &ExecutedBlock) -> Seal {
|
||||
if block.transactions().is_empty() { Seal::None } else { Seal::Regular(Vec::new()) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use tests::helpers::*;
|
||||
use spec::Spec;
|
||||
|
@ -35,7 +35,9 @@ pub use self::instant_seal::InstantSeal;
|
||||
pub use self::null_engine::NullEngine;
|
||||
pub use self::tendermint::Tendermint;
|
||||
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::fmt;
|
||||
|
||||
use self::epoch::PendingTransition;
|
||||
|
||||
@ -43,15 +45,13 @@ use account_provider::AccountProvider;
|
||||
use block::ExecutedBlock;
|
||||
use builtin::Builtin;
|
||||
use client::Client;
|
||||
use evm::env_info::{EnvInfo, LastHashes};
|
||||
use vm::{EnvInfo, LastHashes, Schedule, CreateContractAddress};
|
||||
use error::Error;
|
||||
use evm::Schedule;
|
||||
use header::{Header, BlockNumber};
|
||||
use receipt::Receipt;
|
||||
use snapshot::SnapshotComponents;
|
||||
use spec::CommonParams;
|
||||
use transaction::{UnverifiedTransaction, SignedTransaction};
|
||||
use evm::CreateContractAddress;
|
||||
|
||||
use ethkey::Signature;
|
||||
use util::*;
|
||||
@ -393,13 +393,12 @@ pub trait Engine : Sync + Send {
|
||||
|
||||
/// Common engine utilities
|
||||
pub mod common {
|
||||
use std::sync::Arc;
|
||||
use block::ExecutedBlock;
|
||||
use evm::env_info::{EnvInfo, LastHashes};
|
||||
use error::Error;
|
||||
use transaction::SYSTEM_ADDRESS;
|
||||
use executive::Executive;
|
||||
use evm::CallType;
|
||||
use evm::action_params::{ActionParams, ActionValue};
|
||||
use vm::{CallType, ActionParams, ActionValue, EnvInfo, LastHashes};
|
||||
use trace::{NoopTracer, NoopVMTracer};
|
||||
use state::Substate;
|
||||
|
||||
|
@ -16,7 +16,8 @@
|
||||
|
||||
//! A signer used by Engines which need to sign messages.
|
||||
|
||||
use util::{Arc, H256, Address};
|
||||
use std::sync::Arc;
|
||||
use util::{H256, Address};
|
||||
use ethkey::Signature;
|
||||
use account_provider::{self, AccountProvider};
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
//! Tendermint message handling.
|
||||
|
||||
use std::cmp;
|
||||
use util::*;
|
||||
use super::{Height, View, BlockHash, Step};
|
||||
use error::Error;
|
||||
@ -110,13 +111,13 @@ impl Default for VoteStep {
|
||||
}
|
||||
|
||||
impl PartialOrd for VoteStep {
|
||||
fn partial_cmp(&self, m: &VoteStep) -> Option<Ordering> {
|
||||
fn partial_cmp(&self, m: &VoteStep) -> Option<cmp::Ordering> {
|
||||
Some(self.cmp(m))
|
||||
}
|
||||
}
|
||||
|
||||
impl Ord for VoteStep {
|
||||
fn cmp(&self, m: &VoteStep) -> Ordering {
|
||||
fn cmp(&self, m: &VoteStep) -> cmp::Ordering {
|
||||
if self.height != m.height {
|
||||
self.height.cmp(&m.height)
|
||||
} else if self.view != m.view {
|
||||
@ -198,6 +199,7 @@ pub fn message_hash(vote_step: VoteStep, block_hash: H256) -> H256 {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use rlp::*;
|
||||
use account_provider::AccountProvider;
|
||||
|
@ -25,23 +25,25 @@
|
||||
mod message;
|
||||
mod params;
|
||||
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering};
|
||||
use std::collections::{HashSet, BTreeMap, HashMap};
|
||||
use std::cmp;
|
||||
use util::*;
|
||||
use client::{Client, EngineClient};
|
||||
use error::{Error, BlockError};
|
||||
use header::{Header, BlockNumber};
|
||||
use builtin::Builtin;
|
||||
use rlp::UntrustedRlp;
|
||||
use ethkey::{recover, public_to_address, Signature};
|
||||
use ethkey::{Message, public_to_address, recover, Signature};
|
||||
use account_provider::AccountProvider;
|
||||
use block::*;
|
||||
use spec::CommonParams;
|
||||
use engines::{Engine, Seal, EngineError};
|
||||
use engines::{Engine, Seal, EngineError, ConstructedVerifier};
|
||||
use state::CleanupMode;
|
||||
use io::IoService;
|
||||
use super::signer::EngineSigner;
|
||||
use super::validator_set::ValidatorSet;
|
||||
use super::validator_set::{ValidatorSet, SimpleList};
|
||||
use super::transition::TransitionHandler;
|
||||
use super::vote_collector::VoteCollector;
|
||||
use self::message::*;
|
||||
@ -71,12 +73,9 @@ pub type BlockHash = H256;
|
||||
/// Engine using `Tendermint` consensus algorithm, suitable for EVM chain.
|
||||
pub struct Tendermint {
|
||||
params: CommonParams,
|
||||
gas_limit_bound_divisor: U256,
|
||||
builtins: BTreeMap<Address, Builtin>,
|
||||
step_service: IoService<Step>,
|
||||
client: RwLock<Option<Weak<EngineClient>>>,
|
||||
block_reward: U256,
|
||||
registrar: Address,
|
||||
/// Blockchain height.
|
||||
height: AtomicUsize,
|
||||
/// Consensus view.
|
||||
@ -101,18 +100,74 @@ pub struct Tendermint {
|
||||
validators: Box<ValidatorSet>,
|
||||
}
|
||||
|
||||
struct EpochVerifier<F>
|
||||
where F: Fn(&Signature, &Message) -> Result<Address, Error> + Send + Sync
|
||||
{
|
||||
subchain_validators: SimpleList,
|
||||
recover: F
|
||||
}
|
||||
|
||||
impl <F> super::EpochVerifier for EpochVerifier<F>
|
||||
where F: Fn(&Signature, &Message) -> Result<Address, Error> + Send + Sync
|
||||
{
|
||||
fn verify_light(&self, header: &Header) -> Result<(), Error> {
|
||||
let message = header.bare_hash();
|
||||
|
||||
let mut addresses = HashSet::new();
|
||||
let ref header_signatures_field = header.seal().get(2).ok_or(BlockError::InvalidSeal)?;
|
||||
for rlp in UntrustedRlp::new(header_signatures_field).iter() {
|
||||
let signature: H520 = rlp.as_val()?;
|
||||
let address = (self.recover)(&signature.into(), &message)?;
|
||||
|
||||
if !self.subchain_validators.contains(header.parent_hash(), &address) {
|
||||
return Err(EngineError::NotAuthorized(address.to_owned()).into());
|
||||
}
|
||||
addresses.insert(address);
|
||||
}
|
||||
|
||||
let n = addresses.len();
|
||||
let threshold = self.subchain_validators.len() * 2/3;
|
||||
if n > threshold {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(EngineError::BadSealFieldSize(OutOfBounds {
|
||||
min: Some(threshold),
|
||||
max: None,
|
||||
found: n
|
||||
}).into())
|
||||
}
|
||||
}
|
||||
|
||||
fn check_finality_proof(&self, proof: &[u8]) -> Option<Vec<H256>> {
|
||||
let header: Header = ::rlp::decode(proof);
|
||||
self.verify_light(&header).ok().map(|_| vec![header.hash()])
|
||||
}
|
||||
}
|
||||
|
||||
fn combine_proofs(signal_number: BlockNumber, set_proof: &[u8], finality_proof: &[u8]) -> Vec<u8> {
|
||||
let mut stream = ::rlp::RlpStream::new_list(3);
|
||||
stream.append(&signal_number).append(&set_proof).append(&finality_proof);
|
||||
stream.out()
|
||||
}
|
||||
|
||||
fn destructure_proofs(combined: &[u8]) -> Result<(BlockNumber, &[u8], &[u8]), Error> {
|
||||
let rlp = UntrustedRlp::new(combined);
|
||||
Ok((
|
||||
rlp.at(0)?.as_val()?,
|
||||
rlp.at(1)?.data()?,
|
||||
rlp.at(2)?.data()?,
|
||||
))
|
||||
}
|
||||
|
||||
impl Tendermint {
|
||||
/// Create a new instance of Tendermint engine
|
||||
pub fn new(params: CommonParams, our_params: TendermintParams, builtins: BTreeMap<Address, Builtin>) -> Result<Arc<Self>, Error> {
|
||||
let engine = Arc::new(
|
||||
Tendermint {
|
||||
params: params,
|
||||
gas_limit_bound_divisor: our_params.gas_limit_bound_divisor,
|
||||
builtins: builtins,
|
||||
client: RwLock::new(None),
|
||||
step_service: IoService::<Step>::start()?,
|
||||
block_reward: our_params.block_reward,
|
||||
registrar: our_params.registrar,
|
||||
height: AtomicUsize::new(1),
|
||||
view: AtomicUsize::new(0),
|
||||
step: RwLock::new(Step::Propose),
|
||||
@ -387,7 +442,9 @@ impl Engine for Tendermint {
|
||||
|
||||
fn params(&self) -> &CommonParams { &self.params }
|
||||
|
||||
fn additional_params(&self) -> HashMap<String, String> { hash_map!["registrar".to_owned() => self.registrar.hex()] }
|
||||
fn additional_params(&self) -> HashMap<String, String> {
|
||||
hash_map!["registrar".to_owned() => self.params().registrar.hex()]
|
||||
}
|
||||
|
||||
fn builtins(&self) -> &BTreeMap<Address, Builtin> { &self.builtins }
|
||||
|
||||
@ -412,11 +469,11 @@ impl Engine for Tendermint {
|
||||
header.set_difficulty(new_difficulty);
|
||||
header.set_gas_limit({
|
||||
let gas_limit = parent.gas_limit().clone();
|
||||
let bound_divisor = self.gas_limit_bound_divisor;
|
||||
let bound_divisor = self.params().gas_limit_bound_divisor;
|
||||
if gas_limit < gas_floor_target {
|
||||
min(gas_floor_target, gas_limit + gas_limit / bound_divisor - 1.into())
|
||||
cmp::min(gas_floor_target, gas_limit + gas_limit / bound_divisor - 1.into())
|
||||
} else {
|
||||
max(gas_floor_target, gas_limit - gas_limit / bound_divisor + 1.into())
|
||||
cmp::max(gas_floor_target, gas_limit - gas_limit / bound_divisor + 1.into())
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -427,6 +484,9 @@ impl Engine for Tendermint {
|
||||
}
|
||||
|
||||
/// Attempt to seal generate a proposal seal.
|
||||
///
|
||||
/// This operation is synchronous and may (quite reasonably) not be available, in which case
|
||||
/// `Seal::None` will be returned.
|
||||
fn generate_seal(&self, block: &ExecutedBlock) -> Seal {
|
||||
let header = block.header();
|
||||
let author = header.author();
|
||||
@ -483,7 +543,8 @@ impl Engine for Tendermint {
|
||||
fn on_close_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>{
|
||||
let fields = block.fields_mut();
|
||||
// Bestow block reward
|
||||
let res = fields.state.add_balance(fields.header.author(), &self.block_reward, CleanupMode::NoEmpty)
|
||||
let reward = self.params().block_reward;
|
||||
let res = fields.state.add_balance(fields.header.author(), &reward, CleanupMode::NoEmpty)
|
||||
.map_err(::error::Error::from)
|
||||
.and_then(|_| fields.state.commit());
|
||||
// Commit state so that we can actually figure out the state root.
|
||||
@ -555,7 +616,7 @@ impl Engine for Tendermint {
|
||||
self.check_above_threshold(origins.len())?
|
||||
}
|
||||
|
||||
let gas_limit_divisor = self.gas_limit_bound_divisor;
|
||||
let gas_limit_divisor = self.params().gas_limit_bound_divisor;
|
||||
let min_gas = parent.gas_limit().clone() - parent.gas_limit().clone() / gas_limit_divisor;
|
||||
let max_gas = parent.gas_limit().clone() + parent.gas_limit().clone() / gas_limit_divisor;
|
||||
if header.gas_limit() <= &min_gas || header.gas_limit() >= &max_gas {
|
||||
@ -566,6 +627,58 @@ impl Engine for Tendermint {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn signals_epoch_end(&self, header: &Header, block: Option<&[u8]>, receipts: Option<&[::receipt::Receipt]>)
|
||||
-> super::EpochChange
|
||||
{
|
||||
let first = header.number() == 0;
|
||||
self.validators.signals_epoch_end(first, header, block, receipts)
|
||||
}
|
||||
|
||||
fn is_epoch_end(
|
||||
&self,
|
||||
chain_head: &Header,
|
||||
_chain: &super::Headers,
|
||||
transition_store: &super::PendingTransitionStore,
|
||||
) -> Option<Vec<u8>> {
|
||||
let first = chain_head.number() == 0;
|
||||
|
||||
if let Some(change) = self.validators.is_epoch_end(first, chain_head) {
|
||||
let change = combine_proofs(chain_head.number(), &change, &[]);
|
||||
return Some(change)
|
||||
} else if let Some(pending) = transition_store(chain_head.hash()) {
|
||||
let signal_number = chain_head.number();
|
||||
let finality_proof = ::rlp::encode(chain_head);
|
||||
return Some(combine_proofs(signal_number, &pending.proof, &finality_proof))
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
fn epoch_verifier<'a>(&self, _header: &Header, proof: &'a [u8]) -> ConstructedVerifier<'a> {
|
||||
let (signal_number, set_proof, finality_proof) = match destructure_proofs(proof) {
|
||||
Ok(x) => x,
|
||||
Err(e) => return ConstructedVerifier::Err(e),
|
||||
};
|
||||
|
||||
let first = signal_number == 0;
|
||||
match self.validators.epoch_set(first, self, signal_number, set_proof) {
|
||||
Ok((list, finalize)) => {
|
||||
let verifier = Box::new(EpochVerifier {
|
||||
subchain_validators: list,
|
||||
recover: |signature: &Signature, message: &Message| {
|
||||
Ok(public_to_address(&::ethkey::recover(&signature, &message)?))
|
||||
},
|
||||
});
|
||||
|
||||
match finalize {
|
||||
Some(finalize) => ConstructedVerifier::Unconfirmed(verifier, finality_proof, finalize),
|
||||
None => ConstructedVerifier::Trusted(verifier),
|
||||
}
|
||||
}
|
||||
Err(e) => ConstructedVerifier::Err(e),
|
||||
}
|
||||
}
|
||||
|
||||
fn set_signer(&self, ap: Arc<AccountProvider>, address: Address, password: String) {
|
||||
{
|
||||
self.signer.write().set(ap, address, password);
|
||||
@ -577,6 +690,10 @@ impl Engine for Tendermint {
|
||||
self.signer.read().sign(hash).map_err(Into::into)
|
||||
}
|
||||
|
||||
fn snapshot_components(&self) -> Option<Box<::snapshot::SnapshotComponents>> {
|
||||
Some(Box::new(::snapshot::PoaSnapshot))
|
||||
}
|
||||
|
||||
fn stop(&self) {
|
||||
self.step_service.stop()
|
||||
}
|
||||
@ -654,6 +771,7 @@ impl Engine for Tendermint {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::str::FromStr;
|
||||
use rustc_hex::FromHex;
|
||||
use util::*;
|
||||
use block::*;
|
||||
@ -665,6 +783,7 @@ mod tests {
|
||||
use account_provider::AccountProvider;
|
||||
use spec::Spec;
|
||||
use engines::{Engine, EngineError, Seal};
|
||||
use engines::epoch::EpochVerifier;
|
||||
use super::*;
|
||||
|
||||
/// Accounts inserted with "0" and "1" are validators. First proposer is "0".
|
||||
@ -932,7 +1051,7 @@ mod tests {
|
||||
client.miner().import_own_transaction(client.as_ref(), transaction.into()).unwrap();
|
||||
|
||||
// Propose
|
||||
let proposal = Some(client.miner().pending_block().unwrap().header.bare_hash());
|
||||
let proposal = Some(client.miner().pending_block(0).unwrap().header.bare_hash());
|
||||
// Propose timeout
|
||||
engine.step();
|
||||
|
||||
@ -949,4 +1068,76 @@ mod tests {
|
||||
vote(engine, |mh| tap.sign(v0, None, mh).map(H520::from), h, r, Step::Precommit, proposal);
|
||||
assert_eq!(client.chain_info().best_block_number, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn epoch_verifier_verify_light() {
|
||||
use ethkey::Error as EthkeyError;
|
||||
|
||||
let (spec, tap) = setup();
|
||||
let engine = spec.engine;
|
||||
|
||||
let mut parent_header: Header = Header::default();
|
||||
parent_header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
|
||||
let mut header = Header::default();
|
||||
header.set_number(2);
|
||||
header.set_gas_limit(U256::from_str("222222").unwrap());
|
||||
let proposer = insert_and_unlock(&tap, "1");
|
||||
header.set_author(proposer);
|
||||
let mut seal = proposal_seal(&tap, &header, 0);
|
||||
|
||||
let vote_info = message_info_rlp(&VoteStep::new(2, 0, Step::Precommit), Some(header.bare_hash()));
|
||||
let signature1 = tap.sign(proposer, None, vote_info.sha3()).unwrap();
|
||||
|
||||
let voter = insert_and_unlock(&tap, "0");
|
||||
let signature0 = tap.sign(voter, None, vote_info.sha3()).unwrap();
|
||||
|
||||
seal[1] = ::rlp::NULL_RLP.to_vec();
|
||||
seal[2] = ::rlp::encode_list(&vec![H520::from(signature1.clone())]).into_vec();
|
||||
header.set_seal(seal.clone());
|
||||
|
||||
let epoch_verifier = super::EpochVerifier {
|
||||
subchain_validators: SimpleList::new(vec![proposer.clone(), voter.clone()]),
|
||||
recover: {
|
||||
let signature1 = signature1.clone();
|
||||
let signature0 = signature0.clone();
|
||||
let proposer = proposer.clone();
|
||||
let voter = voter.clone();
|
||||
move |s: &Signature, _: &Message| {
|
||||
if *s == signature1 {
|
||||
Ok(proposer)
|
||||
} else if *s == signature0 {
|
||||
Ok(voter)
|
||||
} else {
|
||||
Err(Error::Ethkey(EthkeyError::InvalidSignature))
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// One good signature is not enough.
|
||||
match epoch_verifier.verify_light(&header) {
|
||||
Err(Error::Engine(EngineError::BadSealFieldSize(_))) => {},
|
||||
_ => panic!(),
|
||||
}
|
||||
|
||||
seal[2] = ::rlp::encode_list(&vec![H520::from(signature1.clone()), H520::from(signature0.clone())]).into_vec();
|
||||
header.set_seal(seal.clone());
|
||||
|
||||
assert!(epoch_verifier.verify_light(&header).is_ok());
|
||||
|
||||
let bad_voter = insert_and_unlock(&tap, "101");
|
||||
let bad_signature = tap.sign(bad_voter, None, vote_info.sha3()).unwrap();
|
||||
|
||||
seal[2] = ::rlp::encode_list(&vec![H520::from(signature1), H520::from(bad_signature)]).into_vec();
|
||||
header.set_seal(seal);
|
||||
|
||||
// One good and one bad signature.
|
||||
match epoch_verifier.verify_light(&header) {
|
||||
Err(Error::Ethkey(EthkeyError::InvalidSignature)) => {},
|
||||
_ => panic!(),
|
||||
};
|
||||
|
||||
engine.stop();
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
//! Tendermint specific parameters.
|
||||
|
||||
use ethjson;
|
||||
use util::{U256, Address};
|
||||
use time::Duration;
|
||||
use super::super::validator_set::{ValidatorSet, new_validator_set};
|
||||
use super::super::transition::Timeouts;
|
||||
@ -25,16 +24,10 @@ use super::Step;
|
||||
|
||||
/// `Tendermint` params.
|
||||
pub struct TendermintParams {
|
||||
/// Gas limit divisor.
|
||||
pub gas_limit_bound_divisor: U256,
|
||||
/// List of validators.
|
||||
pub validators: Box<ValidatorSet>,
|
||||
/// Timeout durations for different steps.
|
||||
pub timeouts: TendermintTimeouts,
|
||||
/// Block reward.
|
||||
pub block_reward: U256,
|
||||
/// Namereg contract address.
|
||||
pub registrar: Address,
|
||||
}
|
||||
|
||||
/// Base timeout of each step in ms.
|
||||
@ -81,7 +74,6 @@ impl From<ethjson::spec::TendermintParams> for TendermintParams {
|
||||
fn from(p: ethjson::spec::TendermintParams) -> Self {
|
||||
let dt = TendermintTimeouts::default();
|
||||
TendermintParams {
|
||||
gas_limit_bound_divisor: p.gas_limit_bound_divisor.into(),
|
||||
validators: new_validator_set(p.validators),
|
||||
timeouts: TendermintTimeouts {
|
||||
propose: p.timeout_propose.map_or(dt.propose, to_duration),
|
||||
@ -89,8 +81,6 @@ impl From<ethjson::spec::TendermintParams> for TendermintParams {
|
||||
precommit: p.timeout_precommit.map_or(dt.precommit, to_duration),
|
||||
commit: p.timeout_commit.map_or(dt.commit, to_duration),
|
||||
},
|
||||
block_reward: p.block_reward.map_or_else(U256::zero, Into::into),
|
||||
registrar: p.registrar.map_or_else(Address::new, Into::into),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -126,6 +126,7 @@ impl ValidatorSet for ValidatorContract {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use rustc_hex::FromHex;
|
||||
use util::*;
|
||||
use rlp::encode;
|
||||
@ -142,11 +143,11 @@ mod tests {
|
||||
#[test]
|
||||
fn fetches_validators() {
|
||||
let client = generate_dummy_client_with_spec_and_accounts(Spec::new_validator_contract, None);
|
||||
let vc = Arc::new(ValidatorContract::new(Address::from_str("0000000000000000000000000000000000000005").unwrap()));
|
||||
let vc = Arc::new(ValidatorContract::new("0000000000000000000000000000000000000005".parse::<Address>().unwrap()));
|
||||
vc.register_contract(Arc::downgrade(&client));
|
||||
let last_hash = client.best_block_header().hash();
|
||||
assert!(vc.contains(&last_hash, &Address::from_str("7d577a597b2742b498cb5cf0c26cdcd726d39e6e").unwrap()));
|
||||
assert!(vc.contains(&last_hash, &Address::from_str("82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap()));
|
||||
assert!(vc.contains(&last_hash, &"7d577a597b2742b498cb5cf0c26cdcd726d39e6e".parse::<Address>().unwrap()));
|
||||
assert!(vc.contains(&last_hash, &"82a978b3f5962a5b0957d9ee9eef472ee55b42f1".parse::<Address>().unwrap()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -155,7 +156,7 @@ mod tests {
|
||||
let v1 = tap.insert_account("1".sha3().into(), "").unwrap();
|
||||
let client = generate_dummy_client_with_spec_and_accounts(Spec::new_validator_contract, Some(tap.clone()));
|
||||
client.engine().register_client(Arc::downgrade(&client));
|
||||
let validator_contract = Address::from_str("0000000000000000000000000000000000000005").unwrap();
|
||||
let validator_contract = "0000000000000000000000000000000000000005".parse::<Address>().unwrap();
|
||||
|
||||
// Make sure reporting can be done.
|
||||
client.miner().set_gas_floor_target(1_000_000.into());
|
||||
|
@ -142,6 +142,8 @@ impl ValidatorSet for Multi {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use std::collections::BTreeMap;
|
||||
use account_provider::AccountProvider;
|
||||
use client::{BlockChainClient, EngineClient};
|
||||
use engines::EpochChange;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
/// Validator set maintained in a contract, updated using `getValidators` method.
|
||||
|
||||
use std::sync::Weak;
|
||||
use std::sync::{Weak, Arc};
|
||||
use futures::Future;
|
||||
use native_contracts::ValidatorSet as Provider;
|
||||
|
||||
@ -299,7 +299,7 @@ impl ValidatorSet for ValidatorSafeContract {
|
||||
let (old_header, state_items) = decode_first_proof(&rlp)?;
|
||||
let old_hash = old_header.hash();
|
||||
|
||||
let env_info = ::evm::env_info::EnvInfo {
|
||||
let env_info = ::vm::EnvInfo {
|
||||
number: old_header.number(),
|
||||
author: *old_header.author(),
|
||||
difficulty: *old_header.difficulty(),
|
||||
@ -422,6 +422,7 @@ impl ValidatorSet for ValidatorSafeContract {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use rustc_hex::FromHex;
|
||||
use util::*;
|
||||
use types::ids::BlockId;
|
||||
@ -438,11 +439,11 @@ mod tests {
|
||||
#[test]
|
||||
fn fetches_validators() {
|
||||
let client = generate_dummy_client_with_spec_and_accounts(Spec::new_validator_safe_contract, None);
|
||||
let vc = Arc::new(ValidatorSafeContract::new(Address::from_str("0000000000000000000000000000000000000005").unwrap()));
|
||||
let vc = Arc::new(ValidatorSafeContract::new("0000000000000000000000000000000000000005".parse::<Address>().unwrap()));
|
||||
vc.register_contract(Arc::downgrade(&client));
|
||||
let last_hash = client.best_block_header().hash();
|
||||
assert!(vc.contains(&last_hash, &Address::from_str("7d577a597b2742b498cb5cf0c26cdcd726d39e6e").unwrap()));
|
||||
assert!(vc.contains(&last_hash, &Address::from_str("82a978b3f5962a5b0957d9ee9eef472ee55b42f1").unwrap()));
|
||||
assert!(vc.contains(&last_hash, &"7d577a597b2742b498cb5cf0c26cdcd726d39e6e".parse::<Address>().unwrap()));
|
||||
assert!(vc.contains(&last_hash, &"82a978b3f5962a5b0957d9ee9eef472ee55b42f1".parse::<Address>().unwrap()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -454,7 +455,7 @@ mod tests {
|
||||
let network_id = Spec::new_validator_safe_contract().network_id();
|
||||
let client = generate_dummy_client_with_spec_and_accounts(Spec::new_validator_safe_contract, Some(tap));
|
||||
client.engine().register_client(Arc::downgrade(&client));
|
||||
let validator_contract = Address::from_str("0000000000000000000000000000000000000005").unwrap();
|
||||
let validator_contract = "0000000000000000000000000000000000000005".parse::<Address>().unwrap();
|
||||
|
||||
client.miner().set_engine_signer(v1, "".into()).unwrap();
|
||||
// Remove "1" validator.
|
||||
@ -520,7 +521,7 @@ mod tests {
|
||||
|
||||
let client = generate_dummy_client_with_spec_and_accounts(Spec::new_validator_safe_contract, None);
|
||||
let engine = client.engine().clone();
|
||||
let validator_contract = Address::from_str("0000000000000000000000000000000000000005").unwrap();
|
||||
let validator_contract = "0000000000000000000000000000000000000005".parse::<Address>().unwrap();
|
||||
|
||||
let last_hash = client.best_block_header().hash();
|
||||
let mut new_header = Header::default();
|
||||
|
@ -17,8 +17,9 @@
|
||||
/// Used for Engine testing.
|
||||
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering as AtomicOrdering};
|
||||
use util::{Arc, Bytes, H256, Address, HeapSizeOf};
|
||||
use util::{Bytes, H256, Address, HeapSizeOf};
|
||||
|
||||
use engines::{Call, Engine};
|
||||
use header::{Header, BlockNumber};
|
||||
|
@ -17,6 +17,8 @@
|
||||
//! Collects votes on hashes at each Message::Round.
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::collections::{BTreeMap, HashSet, HashMap};
|
||||
use std::hash::Hash;
|
||||
use util::*;
|
||||
use rlp::{Encodable, RlpStream};
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
//! General error types for use in ethcore.
|
||||
|
||||
use std::fmt;
|
||||
use util::*;
|
||||
use io::*;
|
||||
use header::BlockNumber;
|
||||
|
@ -15,11 +15,14 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::path::Path;
|
||||
use std::cmp;
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::sync::Arc;
|
||||
use ethash::{quick_get_difficulty, slow_get_seedhash, EthashManager};
|
||||
use util::*;
|
||||
use block::*;
|
||||
use builtin::Builtin;
|
||||
use evm::env_info::EnvInfo;
|
||||
use vm::EnvInfo;
|
||||
use error::{BlockError, Error, TransactionError};
|
||||
use header::{Header, BlockNumber};
|
||||
use state::CleanupMode;
|
||||
@ -29,7 +32,7 @@ use engines::{self, Engine};
|
||||
use evm::Schedule;
|
||||
use ethjson;
|
||||
use rlp::{self, UntrustedRlp};
|
||||
use evm::env_info::LastHashes;
|
||||
use vm::LastHashes;
|
||||
|
||||
/// Parity tries to round block.gas_limit to multiple of this constant
|
||||
pub const PARITY_GAS_LIMIT_DETERMINANT: U256 = U256([37, 0, 0, 0]);
|
||||
@ -41,8 +44,6 @@ const SNAPSHOT_BLOCKS: u64 = 30000;
|
||||
/// Ethash params.
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct EthashParams {
|
||||
/// Gas limit divisor.
|
||||
pub gas_limit_bound_divisor: U256,
|
||||
/// Minimum difficulty.
|
||||
pub minimum_difficulty: U256,
|
||||
/// Difficulty bound divisor.
|
||||
@ -53,10 +54,6 @@ pub struct EthashParams {
|
||||
pub metropolis_difficulty_increment_divisor: u64,
|
||||
/// Block duration.
|
||||
pub duration_limit: u64,
|
||||
/// Block reward.
|
||||
pub block_reward: U256,
|
||||
/// Namereg contract address.
|
||||
pub registrar: Address,
|
||||
/// Homestead transition block number.
|
||||
pub homestead_transition: u64,
|
||||
/// DAO hard-fork transition block (X).
|
||||
@ -75,8 +72,6 @@ pub struct EthashParams {
|
||||
pub eip100b_transition: u64,
|
||||
/// Number of first block where EIP-150 rules begin.
|
||||
pub eip150_transition: u64,
|
||||
/// Number of first block where EIP-155 rules begin.
|
||||
pub eip155_transition: u64,
|
||||
/// Number of first block where EIP-160 rules begin.
|
||||
pub eip160_transition: u64,
|
||||
/// Number of first block where EIP-161.abc begin.
|
||||
@ -104,14 +99,11 @@ pub struct EthashParams {
|
||||
impl From<ethjson::spec::EthashParams> for EthashParams {
|
||||
fn from(p: ethjson::spec::EthashParams) -> Self {
|
||||
EthashParams {
|
||||
gas_limit_bound_divisor: p.gas_limit_bound_divisor.into(),
|
||||
minimum_difficulty: p.minimum_difficulty.into(),
|
||||
difficulty_bound_divisor: p.difficulty_bound_divisor.into(),
|
||||
difficulty_increment_divisor: p.difficulty_increment_divisor.map_or(10, Into::into),
|
||||
metropolis_difficulty_increment_divisor: p.metropolis_difficulty_increment_divisor.map_or(9, Into::into),
|
||||
duration_limit: p.duration_limit.map_or(0, Into::into),
|
||||
block_reward: p.block_reward.into(),
|
||||
registrar: p.registrar.map_or_else(Address::new, Into::into),
|
||||
homestead_transition: p.homestead_transition.map_or(0, Into::into),
|
||||
dao_hardfork_transition: p.dao_hardfork_transition.map_or(u64::max_value(), Into::into),
|
||||
dao_hardfork_beneficiary: p.dao_hardfork_beneficiary.map_or_else(Address::new, Into::into),
|
||||
@ -121,7 +113,6 @@ impl From<ethjson::spec::EthashParams> for EthashParams {
|
||||
bomb_defuse_transition: p.bomb_defuse_transition.map_or(u64::max_value(), Into::into),
|
||||
eip100b_transition: p.eip100b_transition.map_or(u64::max_value(), Into::into),
|
||||
eip150_transition: p.eip150_transition.map_or(0, Into::into),
|
||||
eip155_transition: p.eip155_transition.map_or(0, Into::into),
|
||||
eip160_transition: p.eip160_transition.map_or(0, Into::into),
|
||||
eip161abc_transition: p.eip161abc_transition.map_or(0, Into::into),
|
||||
eip161d_transition: p.eip161d_transition.map_or(u64::max_value(), Into::into),
|
||||
@ -185,7 +176,7 @@ impl Engine for Arc<Ethash> {
|
||||
fn seal_fields(&self) -> usize { 2 }
|
||||
|
||||
fn params(&self) -> &CommonParams { &self.params }
|
||||
fn additional_params(&self) -> HashMap<String, String> { hash_map!["registrar".to_owned() => self.ethash_params.registrar.hex()] }
|
||||
fn additional_params(&self) -> HashMap<String, String> { hash_map!["registrar".to_owned() => self.params().registrar.hex()] }
|
||||
|
||||
fn builtins(&self) -> &BTreeMap<Address, Builtin> {
|
||||
&self.builtins
|
||||
@ -216,7 +207,7 @@ impl Engine for Arc<Ethash> {
|
||||
}
|
||||
|
||||
fn signing_network_id(&self, env_info: &EnvInfo) -> Option<u64> {
|
||||
if env_info.number >= self.ethash_params.eip155_transition {
|
||||
if env_info.number >= self.params().eip155_transition {
|
||||
Some(self.params().chain_id)
|
||||
} else {
|
||||
None
|
||||
@ -231,19 +222,19 @@ impl Engine for Arc<Ethash> {
|
||||
}
|
||||
let gas_limit = {
|
||||
let gas_limit = parent.gas_limit().clone();
|
||||
let bound_divisor = self.ethash_params.gas_limit_bound_divisor;
|
||||
let bound_divisor = self.params().gas_limit_bound_divisor;
|
||||
let lower_limit = gas_limit - gas_limit / bound_divisor + 1.into();
|
||||
let upper_limit = gas_limit + gas_limit / bound_divisor - 1.into();
|
||||
let gas_limit = if gas_limit < gas_floor_target {
|
||||
let gas_limit = min(gas_floor_target, upper_limit);
|
||||
let gas_limit = cmp::min(gas_floor_target, upper_limit);
|
||||
round_block_gas_limit(gas_limit, lower_limit, upper_limit)
|
||||
} else if gas_limit > gas_ceil_target {
|
||||
let gas_limit = max(gas_ceil_target, lower_limit);
|
||||
let gas_limit = cmp::max(gas_ceil_target, lower_limit);
|
||||
round_block_gas_limit(gas_limit, lower_limit, upper_limit)
|
||||
} else {
|
||||
let total_lower_limit = max(lower_limit, gas_floor_target);
|
||||
let total_upper_limit = min(upper_limit, gas_ceil_target);
|
||||
let gas_limit = max(gas_floor_target, min(total_upper_limit,
|
||||
let total_lower_limit = cmp::max(lower_limit, gas_floor_target);
|
||||
let total_upper_limit = cmp::min(upper_limit, gas_ceil_target);
|
||||
let gas_limit = cmp::max(gas_floor_target, cmp::min(total_upper_limit,
|
||||
lower_limit + (header.gas_used().clone() * 6.into() / 5.into()) / bound_divisor));
|
||||
round_block_gas_limit(gas_limit, total_lower_limit, total_upper_limit)
|
||||
};
|
||||
@ -284,7 +275,7 @@ impl Engine for Arc<Ethash> {
|
||||
/// Apply the block reward on finalisation of the block.
|
||||
/// 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> {
|
||||
let reward = self.ethash_params.block_reward;
|
||||
let reward = self.params().block_reward;
|
||||
let fields = block.fields_mut();
|
||||
let eras_rounds = self.ethash_params.ecip1017_era_rounds;
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, reward, fields.header.number());
|
||||
@ -319,7 +310,7 @@ impl Engine for Arc<Ethash> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn verify_block_basic(&self, header: &Header, _block: Option<&[u8]>) -> result::Result<(), Error> {
|
||||
fn verify_block_basic(&self, header: &Header, _block: Option<&[u8]>) -> Result<(), Error> {
|
||||
// check the seal fields.
|
||||
if header.seal().len() != self.seal_fields() {
|
||||
return Err(From::from(BlockError::InvalidSealArity(
|
||||
@ -357,7 +348,7 @@ impl Engine for Arc<Ethash> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn verify_block_unordered(&self, header: &Header, _block: Option<&[u8]>) -> result::Result<(), Error> {
|
||||
fn verify_block_unordered(&self, header: &Header, _block: Option<&[u8]>) -> Result<(), Error> {
|
||||
if header.seal().len() != self.seal_fields() {
|
||||
return Err(From::from(BlockError::InvalidSealArity(
|
||||
Mismatch { expected: self.seal_fields(), found: header.seal().len() }
|
||||
@ -376,7 +367,7 @@ impl Engine for Arc<Ethash> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn verify_block_family(&self, header: &Header, parent: &Header, _block: Option<&[u8]>) -> result::Result<(), Error> {
|
||||
fn verify_block_family(&self, header: &Header, parent: &Header, _block: Option<&[u8]>) -> Result<(), Error> {
|
||||
// we should not calculate difficulty for genesis blocks
|
||||
if header.number() == 0 {
|
||||
return Err(From::from(BlockError::RidiculousNumber(OutOfBounds { min: Some(1), max: None, found: header.number() })));
|
||||
@ -387,7 +378,7 @@ impl Engine for Arc<Ethash> {
|
||||
if header.difficulty() != &expected_difficulty {
|
||||
return Err(From::from(BlockError::InvalidDifficulty(Mismatch { expected: expected_difficulty, found: header.difficulty().clone() })))
|
||||
}
|
||||
let gas_limit_divisor = self.ethash_params.gas_limit_bound_divisor;
|
||||
let gas_limit_divisor = self.params().gas_limit_bound_divisor;
|
||||
let parent_gas_limit = *parent.gas_limit();
|
||||
let min_gas = parent_gas_limit - parent_gas_limit / gas_limit_divisor;
|
||||
let max_gas = parent_gas_limit + parent_gas_limit / gas_limit_divisor;
|
||||
@ -400,13 +391,13 @@ impl Engine for Arc<Ethash> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn verify_transaction_basic(&self, t: &UnverifiedTransaction, header: &Header) -> result::Result<(), Error> {
|
||||
fn verify_transaction_basic(&self, t: &UnverifiedTransaction, header: &Header) -> Result<(), Error> {
|
||||
if header.number() >= self.ethash_params.min_gas_price_transition && t.gas_price < self.ethash_params.min_gas_price {
|
||||
return Err(TransactionError::InsufficientGasPrice { minimal: self.ethash_params.min_gas_price, got: t.gas_price }.into());
|
||||
}
|
||||
|
||||
let check_low_s = header.number() >= self.ethash_params.homestead_transition;
|
||||
let network_id = if header.number() >= self.ethash_params.eip155_transition { Some(self.params().chain_id) } else { None };
|
||||
let network_id = if header.number() >= self.params().eip155_transition { Some(self.params().chain_id) } else { None };
|
||||
t.verify_basic(check_low_s, network_id, false)?;
|
||||
Ok(())
|
||||
}
|
||||
@ -493,28 +484,28 @@ impl Ethash {
|
||||
if diff_inc <= threshold {
|
||||
*parent.difficulty() + *parent.difficulty() / difficulty_bound_divisor * (threshold - diff_inc).into()
|
||||
} else {
|
||||
let multiplier = min(diff_inc - threshold, 99).into();
|
||||
let multiplier = cmp::min(diff_inc - threshold, 99).into();
|
||||
parent.difficulty().saturating_sub(
|
||||
*parent.difficulty() / difficulty_bound_divisor * multiplier
|
||||
)
|
||||
}
|
||||
};
|
||||
target = max(min_difficulty, target);
|
||||
target = cmp::max(min_difficulty, target);
|
||||
if header.number() < self.ethash_params.bomb_defuse_transition {
|
||||
if header.number() < self.ethash_params.ecip1010_pause_transition {
|
||||
let period = ((parent.number() + 1) / EXP_DIFF_PERIOD) as usize;
|
||||
if period > 1 {
|
||||
target = max(min_difficulty, target + (U256::from(1) << (period - 2)));
|
||||
target = cmp::max(min_difficulty, target + (U256::from(1) << (period - 2)));
|
||||
}
|
||||
}
|
||||
else if header.number() < self.ethash_params.ecip1010_continue_transition {
|
||||
let fixed_difficulty = ((self.ethash_params.ecip1010_pause_transition / EXP_DIFF_PERIOD) - 2) as usize;
|
||||
target = max(min_difficulty, target + (U256::from(1) << fixed_difficulty));
|
||||
target = cmp::max(min_difficulty, target + (U256::from(1) << fixed_difficulty));
|
||||
}
|
||||
else {
|
||||
let period = ((parent.number() + 1) / EXP_DIFF_PERIOD) as usize;
|
||||
let delay = ((self.ethash_params.ecip1010_continue_transition - self.ethash_params.ecip1010_pause_transition) / EXP_DIFF_PERIOD) as usize;
|
||||
target = max(min_difficulty, target + (U256::from(1) << (period - delay - 2)));
|
||||
target = cmp::max(min_difficulty, target + (U256::from(1) << (period - delay - 2)));
|
||||
}
|
||||
}
|
||||
target
|
||||
@ -559,6 +550,9 @@ impl Header {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::str::FromStr;
|
||||
use std::collections::BTreeMap;
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use block::*;
|
||||
use tests::helpers::*;
|
||||
@ -809,36 +803,32 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn has_valid_ecip1017_eras_block_reward() {
|
||||
let ethparams = EthashParams {
|
||||
// see ethcore/res/ethereum/classic.json
|
||||
ecip1017_era_rounds: 5000000,
|
||||
block_reward: U256::from_str("4563918244F40000").unwrap(),
|
||||
..get_default_ethash_params()
|
||||
};
|
||||
let eras_rounds = ethparams.ecip1017_era_rounds;
|
||||
let reward = ethparams.block_reward;
|
||||
let eras_rounds = 5000000;
|
||||
|
||||
let start_reward: U256 = "4563918244F40000".parse().unwrap();
|
||||
|
||||
let block_number = 0;
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, reward, block_number);
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, start_reward, block_number);
|
||||
assert_eq!(0, eras);
|
||||
assert_eq!(U256::from_str("4563918244F40000").unwrap(), reward);
|
||||
let reward = ethparams.block_reward;
|
||||
|
||||
let block_number = 5000000;
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, reward, block_number);
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, start_reward, block_number);
|
||||
assert_eq!(0, eras);
|
||||
assert_eq!(U256::from_str("4563918244F40000").unwrap(), reward);
|
||||
let reward = ethparams.block_reward;
|
||||
|
||||
let block_number = 10000000;
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, reward, block_number);
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, start_reward, block_number);
|
||||
assert_eq!(1, eras);
|
||||
assert_eq!(U256::from_str("3782DACE9D900000").unwrap(), reward);
|
||||
let reward = ethparams.block_reward;
|
||||
|
||||
let block_number = 20000000;
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, reward, block_number);
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, start_reward, block_number);
|
||||
assert_eq!(3, eras);
|
||||
assert_eq!(U256::from_str("2386F26FC1000000").unwrap(), reward);
|
||||
let reward = ethparams.block_reward;
|
||||
|
||||
let block_number = 80000000;
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, reward, block_number);
|
||||
let (eras, reward) = ecip1017_eras_block_reward(eras_rounds, start_reward, block_number);
|
||||
assert_eq!(15, eras);
|
||||
assert_eq!(U256::from_str("271000000000000").unwrap(), reward);
|
||||
}
|
||||
|
@ -134,23 +134,4 @@ mod tests {
|
||||
|
||||
let _ = frontier.engine;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn all_spec_files_valid() {
|
||||
let tmp = ::std::env::temp_dir();
|
||||
new_olympic(&tmp);
|
||||
new_foundation(&tmp);
|
||||
new_classic(&tmp);
|
||||
new_expanse(&tmp);
|
||||
new_kovan(&tmp);
|
||||
new_ropsten(&tmp);
|
||||
new_morden(&tmp);
|
||||
new_frontier_test();
|
||||
new_homestead_test();
|
||||
new_eip150_test();
|
||||
new_eip161_test();
|
||||
new_transition_test();
|
||||
new_mainnet_like();
|
||||
new_metropolis_test();
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
//! Transaction execution format module.
|
||||
|
||||
use util::{Bytes, U256, Address, U512, trie};
|
||||
use evm;
|
||||
use vm;
|
||||
use trace::{VMTrace, FlatTrace};
|
||||
use log_entry::LogEntry;
|
||||
use state_diff::StateDiff;
|
||||
@ -28,7 +28,7 @@ use std::fmt;
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
pub struct Executed {
|
||||
/// True if the outer call/create resulted in an exceptional exit.
|
||||
pub exception: Option<evm::Error>,
|
||||
pub exception: Option<vm::Error>,
|
||||
|
||||
/// Gas paid up front for execution of transaction.
|
||||
pub gas: U256,
|
||||
|
@ -15,14 +15,16 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Transaction Execution environment.
|
||||
use std::cmp;
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use evm::action_params::{ActionParams, ActionValue};
|
||||
use state::{Backend as StateBackend, State, Substate, CleanupMode};
|
||||
use engines::Engine;
|
||||
use evm::CallType;
|
||||
use evm::env_info::EnvInfo;
|
||||
use vm::EnvInfo;
|
||||
use error::ExecutionError;
|
||||
use evm::{self, wasm, Factory, Ext, Finalize, CreateContractAddress, FinalizationResult, ReturnData, CleanDustMode};
|
||||
use evm::{CallType, Factory, Finalize, FinalizationResult};
|
||||
use vm::{self, Ext, CreateContractAddress, ReturnData, CleanDustMode, ActionParams, ActionValue};
|
||||
use wasm;
|
||||
use externalities::*;
|
||||
use trace::{FlatTrace, Tracer, NoopTracer, ExecutiveTracer, VMTrace, VMTracer, ExecutiveVMTracer, NoopVMTracer};
|
||||
use transaction::{Action, SignedTransaction};
|
||||
@ -75,7 +77,7 @@ pub struct TransactOptions {
|
||||
}
|
||||
|
||||
pub fn executor<E>(engine: &E, vm_factory: &Factory, params: &ActionParams)
|
||||
-> Box<evm::Evm> where E: Engine + ?Sized
|
||||
-> Box<vm::Vm> where E: Engine + ?Sized
|
||||
{
|
||||
if engine.supports_wasm() && params.code.as_ref().map_or(false, |code| code.len() > 4 && &code[0..4] == WASM_MAGIC_NUMBER) {
|
||||
Box::new(
|
||||
@ -269,7 +271,7 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
output_policy: OutputPolicy,
|
||||
tracer: &mut T,
|
||||
vm_tracer: &mut V
|
||||
) -> evm::Result<FinalizationResult> where T: Tracer, V: VMTracer {
|
||||
) -> vm::Result<FinalizationResult> where T: Tracer, V: VMTracer {
|
||||
|
||||
let depth_threshold = ::io::LOCAL_STACK_SIZE.with(|sz| sz.get() / STACK_SIZE_PER_DEPTH);
|
||||
let static_call = params.call_type == CallType::StaticCall;
|
||||
@ -299,7 +301,7 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
/// Calls contract function with given contract params.
|
||||
/// NOTE. It does not finalize the transaction (doesn't do refunds, nor suicides).
|
||||
/// Modifies the substate and the output.
|
||||
/// Returns either gas_left or `evm::Error`.
|
||||
/// Returns either gas_left or `vm::Error`.
|
||||
pub fn call<T, V>(
|
||||
&mut self,
|
||||
params: ActionParams,
|
||||
@ -307,14 +309,14 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
mut output: BytesRef,
|
||||
tracer: &mut T,
|
||||
vm_tracer: &mut V
|
||||
) -> evm::Result<(U256, ReturnData)> where T: Tracer, V: VMTracer {
|
||||
) -> vm::Result<(U256, ReturnData)> where T: Tracer, V: VMTracer {
|
||||
|
||||
trace!("Executive::call(params={:?}) self.env_info={:?}", params, self.info);
|
||||
if (params.call_type == CallType::StaticCall ||
|
||||
((params.call_type == CallType::Call || params.call_type == CallType::DelegateCall) &&
|
||||
self.static_flag))
|
||||
&& params.value.value() > 0.into() {
|
||||
return Err(evm::Error::MutableCallInStaticContext);
|
||||
return Err(vm::Error::MutableCallInStaticContext);
|
||||
}
|
||||
|
||||
// backup used in case of running out of gas
|
||||
@ -344,7 +346,7 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
if cost <= params.gas {
|
||||
if let Err(e) = builtin.execute(data, &mut output) {
|
||||
self.state.revert_to_checkpoint();
|
||||
let evm_err: evm::evm::Error = e.into();
|
||||
let evm_err: vm::Error = e.into();
|
||||
tracer.trace_failed_call(trace_info, vec![], evm_err.clone().into());
|
||||
Err(evm_err)
|
||||
} else {
|
||||
@ -371,9 +373,9 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
// just drain the whole gas
|
||||
self.state.revert_to_checkpoint();
|
||||
|
||||
tracer.trace_failed_call(trace_info, vec![], evm::Error::OutOfGas.into());
|
||||
tracer.trace_failed_call(trace_info, vec![], vm::Error::OutOfGas.into());
|
||||
|
||||
Err(evm::Error::OutOfGas)
|
||||
Err(vm::Error::OutOfGas)
|
||||
}
|
||||
} else {
|
||||
let trace_info = tracer.prepare_trace_call(¶ms);
|
||||
@ -432,17 +434,17 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
substate: &mut Substate,
|
||||
tracer: &mut T,
|
||||
vm_tracer: &mut V,
|
||||
) -> evm::Result<(U256, ReturnData)> where T: Tracer, V: VMTracer {
|
||||
) -> vm::Result<(U256, ReturnData)> where T: Tracer, V: VMTracer {
|
||||
|
||||
let scheme = self.engine.create_address_scheme(self.info.number);
|
||||
if scheme != CreateContractAddress::FromSenderAndNonce && self.state.exists_and_has_code(¶ms.address)? {
|
||||
return Err(evm::Error::OutOfGas);
|
||||
return Err(vm::Error::OutOfGas);
|
||||
}
|
||||
|
||||
if params.call_type == CallType::StaticCall || self.static_flag {
|
||||
let trace_info = tracer.prepare_trace_create(¶ms);
|
||||
tracer.trace_failed_create(trace_info, vec![], evm::Error::MutableCallInStaticContext.into());
|
||||
return Err(evm::Error::MutableCallInStaticContext);
|
||||
tracer.trace_failed_create(trace_info, vec![], vm::Error::MutableCallInStaticContext.into());
|
||||
return Err(vm::Error::MutableCallInStaticContext);
|
||||
}
|
||||
|
||||
// backup used in case of running out of gas
|
||||
@ -496,7 +498,7 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
&mut self,
|
||||
t: &SignedTransaction,
|
||||
mut substate: Substate,
|
||||
result: evm::Result<(U256, ReturnData)>,
|
||||
result: vm::Result<(U256, ReturnData)>,
|
||||
output: Bytes,
|
||||
trace: Vec<FlatTrace>,
|
||||
vm_trace: Option<VMTrace>
|
||||
@ -538,7 +540,7 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
self.state.kill_garbage(&substate.touched, schedule.kill_empty, &min_balance, schedule.kill_dust == CleanDustMode::WithCodeAndStorage)?;
|
||||
|
||||
match result {
|
||||
Err(evm::Error::Internal(msg)) => Err(ExecutionError::Internal(msg)),
|
||||
Err(vm::Error::Internal(msg)) => Err(ExecutionError::Internal(msg)),
|
||||
Err(exception) => {
|
||||
Ok(Executed {
|
||||
exception: Some(exception),
|
||||
@ -572,20 +574,20 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
}
|
||||
}
|
||||
|
||||
fn enact_result(&mut self, result: &evm::Result<FinalizationResult>, substate: &mut Substate, un_substate: Substate) {
|
||||
fn enact_result(&mut self, result: &vm::Result<FinalizationResult>, substate: &mut Substate, un_substate: Substate) {
|
||||
match *result {
|
||||
Err(evm::Error::OutOfGas)
|
||||
| Err(evm::Error::BadJumpDestination {..})
|
||||
| Err(evm::Error::BadInstruction {.. })
|
||||
| Err(evm::Error::StackUnderflow {..})
|
||||
| Err(evm::Error::BuiltIn {..})
|
||||
| Err(evm::Error::Wasm {..})
|
||||
| Err(evm::Error::OutOfStack {..})
|
||||
| Err(evm::Error::MutableCallInStaticContext)
|
||||
Err(vm::Error::OutOfGas)
|
||||
| Err(vm::Error::BadJumpDestination {..})
|
||||
| Err(vm::Error::BadInstruction {.. })
|
||||
| Err(vm::Error::StackUnderflow {..})
|
||||
| Err(vm::Error::BuiltIn {..})
|
||||
| Err(vm::Error::Wasm {..})
|
||||
| Err(vm::Error::OutOfStack {..})
|
||||
| Err(vm::Error::MutableCallInStaticContext)
|
||||
| Ok(FinalizationResult { apply_state: false, .. }) => {
|
||||
self.state.revert_to_checkpoint();
|
||||
},
|
||||
Ok(_) | Err(evm::Error::Internal(_)) => {
|
||||
Ok(_) | Err(vm::Error::Internal(_)) => {
|
||||
self.state.discard_checkpoint();
|
||||
substate.accrue(un_substate);
|
||||
}
|
||||
@ -597,14 +599,14 @@ impl<'a, B: 'a + StateBackend, E: Engine + ?Sized> Executive<'a, B, E> {
|
||||
#[allow(dead_code)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
use std::str::FromStr;
|
||||
use rustc_hex::FromHex;
|
||||
use ethkey::{Generator, Random};
|
||||
use super::*;
|
||||
use util::{H256, U256, U512, Address, FromStr};
|
||||
use util::{H256, U256, U512, Address};
|
||||
use util::bytes::BytesRef;
|
||||
use evm::action_params::{ActionParams, ActionValue};
|
||||
use evm::env_info::EnvInfo;
|
||||
use evm::{Factory, VMType, CreateContractAddress};
|
||||
use vm::{ActionParams, ActionValue, CallType, EnvInfo, CreateContractAddress};
|
||||
use evm::{Factory, VMType};
|
||||
use error::ExecutionError;
|
||||
use state::{Substate, CleanupMode};
|
||||
use tests::helpers::*;
|
||||
@ -613,8 +615,6 @@ mod tests {
|
||||
use trace::{VMTrace, VMOperation, VMExecutedOperation, MemoryDiff, StorageDiff, VMTracer, NoopVMTracer, ExecutiveVMTracer};
|
||||
use transaction::{Action, Transaction};
|
||||
|
||||
use evm::CallType;
|
||||
|
||||
#[test]
|
||||
fn test_contract_address() {
|
||||
let address = Address::from_str("0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6").unwrap();
|
||||
|
@ -15,14 +15,17 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Transaction Execution environment.
|
||||
use std::cmp;
|
||||
use std::sync::Arc;
|
||||
use util::*;
|
||||
use evm::action_params::{ActionParams, ActionValue};
|
||||
use state::{Backend as StateBackend, State, Substate, CleanupMode};
|
||||
use engines::Engine;
|
||||
use evm::env_info::EnvInfo;
|
||||
use executive::*;
|
||||
use evm::{self, Schedule, Ext, ContractCreateResult, MessageCallResult, CreateContractAddress, ReturnData};
|
||||
use evm::CallType;
|
||||
use vm::{
|
||||
self, ActionParams, ActionValue, EnvInfo, CallType, Schedule,
|
||||
Ext, ContractCreateResult, MessageCallResult, CreateContractAddress,
|
||||
ReturnData
|
||||
};
|
||||
use transaction::UNSIGNED_SENDER;
|
||||
use trace::{Tracer, VMTracer};
|
||||
|
||||
@ -109,31 +112,31 @@ impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Externalities<'a, T, V, B, E>
|
||||
impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Ext for Externalities<'a, T, V, B, E>
|
||||
where T: Tracer, V: VMTracer, B: StateBackend, E: Engine + ?Sized
|
||||
{
|
||||
fn storage_at(&self, key: &H256) -> evm::Result<H256> {
|
||||
fn storage_at(&self, key: &H256) -> vm::Result<H256> {
|
||||
self.state.storage_at(&self.origin_info.address, key).map_err(Into::into)
|
||||
}
|
||||
|
||||
fn set_storage(&mut self, key: H256, value: H256) -> evm::Result<()> {
|
||||
fn set_storage(&mut self, key: H256, value: H256) -> vm::Result<()> {
|
||||
if self.static_flag {
|
||||
Err(evm::Error::MutableCallInStaticContext)
|
||||
Err(vm::Error::MutableCallInStaticContext)
|
||||
} else {
|
||||
self.state.set_storage(&self.origin_info.address, key, value).map_err(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
fn exists(&self, address: &Address) -> evm::Result<bool> {
|
||||
fn exists(&self, address: &Address) -> vm::Result<bool> {
|
||||
self.state.exists(address).map_err(Into::into)
|
||||
}
|
||||
|
||||
fn exists_and_not_null(&self, address: &Address) -> evm::Result<bool> {
|
||||
fn exists_and_not_null(&self, address: &Address) -> vm::Result<bool> {
|
||||
self.state.exists_and_not_null(address).map_err(Into::into)
|
||||
}
|
||||
|
||||
fn origin_balance(&self) -> evm::Result<U256> {
|
||||
fn origin_balance(&self) -> vm::Result<U256> {
|
||||
self.balance(&self.origin_info.address).map_err(Into::into)
|
||||
}
|
||||
|
||||
fn balance(&self, address: &Address) -> evm::Result<U256> {
|
||||
fn balance(&self, address: &Address) -> vm::Result<U256> {
|
||||
self.state.balance(address).map_err(Into::into)
|
||||
}
|
||||
|
||||
@ -274,16 +277,16 @@ impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Ext for Externalities<'a, T, V, B, E>
|
||||
}
|
||||
}
|
||||
|
||||
fn extcode(&self, address: &Address) -> evm::Result<Arc<Bytes>> {
|
||||
fn extcode(&self, address: &Address) -> vm::Result<Arc<Bytes>> {
|
||||
Ok(self.state.code(address)?.unwrap_or_else(|| Arc::new(vec![])))
|
||||
}
|
||||
|
||||
fn extcodesize(&self, address: &Address) -> evm::Result<usize> {
|
||||
fn extcodesize(&self, address: &Address) -> vm::Result<usize> {
|
||||
Ok(self.state.code_size(address)?.unwrap_or(0))
|
||||
}
|
||||
|
||||
#[cfg_attr(feature="dev", allow(match_ref_pats))]
|
||||
fn ret(mut self, gas: &U256, data: &ReturnData) -> evm::Result<U256>
|
||||
fn ret(mut self, gas: &U256, data: &ReturnData) -> vm::Result<U256>
|
||||
where Self: Sized {
|
||||
let handle_copy = |to: &mut Option<&mut Bytes>| {
|
||||
to.as_mut().map(|b| **b = data.to_vec());
|
||||
@ -307,7 +310,7 @@ impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Ext for Externalities<'a, T, V, B, E>
|
||||
let return_cost = U256::from(data.len()) * U256::from(self.schedule.create_data_gas);
|
||||
if return_cost > *gas || data.len() > self.schedule.create_data_limit {
|
||||
return match self.schedule.exceptional_failed_code_deposit {
|
||||
true => Err(evm::Error::OutOfGas),
|
||||
true => Err(vm::Error::OutOfGas),
|
||||
false => Ok(*gas)
|
||||
}
|
||||
}
|
||||
@ -320,11 +323,11 @@ impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Ext for Externalities<'a, T, V, B, E>
|
||||
}
|
||||
}
|
||||
|
||||
fn log(&mut self, topics: Vec<H256>, data: &[u8]) -> evm::Result<()> {
|
||||
fn log(&mut self, topics: Vec<H256>, data: &[u8]) -> vm::Result<()> {
|
||||
use log_entry::LogEntry;
|
||||
|
||||
if self.static_flag {
|
||||
return Err(evm::Error::MutableCallInStaticContext);
|
||||
return Err(vm::Error::MutableCallInStaticContext);
|
||||
}
|
||||
|
||||
let address = self.origin_info.address.clone();
|
||||
@ -337,9 +340,9 @@ impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Ext for Externalities<'a, T, V, B, E>
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn suicide(&mut self, refund_address: &Address) -> evm::Result<()> {
|
||||
fn suicide(&mut self, refund_address: &Address) -> vm::Result<()> {
|
||||
if self.static_flag {
|
||||
return Err(evm::Error::MutableCallInStaticContext);
|
||||
return Err(vm::Error::MutableCallInStaticContext);
|
||||
}
|
||||
|
||||
let address = self.origin_info.address.clone();
|
||||
@ -396,13 +399,11 @@ impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Ext for Externalities<'a, T, V, B, E>
|
||||
mod tests {
|
||||
use util::*;
|
||||
use engines::Engine;
|
||||
use evm::env_info::EnvInfo;
|
||||
use evm::Ext;
|
||||
use evm::{EnvInfo, Ext, CallType};
|
||||
use state::{State, Substate};
|
||||
use tests::helpers::*;
|
||||
use super::*;
|
||||
use trace::{NoopTracer, NoopVMTracer};
|
||||
use evm::CallType;
|
||||
|
||||
fn get_test_origin() -> OriginInfo {
|
||||
OriginInfo {
|
||||
@ -470,7 +471,7 @@ mod tests {
|
||||
|
||||
let mut ext = Externalities::new(state, &setup.env_info, &*setup.engine, 0, get_test_origin(), &mut setup.sub_state, OutputPolicy::InitContract(None), &mut tracer, &mut vm_tracer, false);
|
||||
|
||||
let hash = ext.blockhash(&U256::from_str("0000000000000000000000000000000000000000000000000000000000120000").unwrap());
|
||||
let hash = ext.blockhash(&"0000000000000000000000000000000000000000000000000000000000120000".parse::<U256>().unwrap());
|
||||
|
||||
assert_eq!(hash, H256::zero());
|
||||
}
|
||||
@ -494,7 +495,7 @@ mod tests {
|
||||
|
||||
let mut ext = Externalities::new(state, &setup.env_info, &*setup.engine, 0, get_test_origin(), &mut setup.sub_state, OutputPolicy::InitContract(None), &mut tracer, &mut vm_tracer, false);
|
||||
|
||||
let hash = ext.blockhash(&U256::from_str("0000000000000000000000000000000000000000000000000000000000120000").unwrap());
|
||||
let hash = ext.blockhash(&"0000000000000000000000000000000000000000000000000000000000120000".parse::<U256>().unwrap());
|
||||
|
||||
assert_eq!(test_hash, hash);
|
||||
}
|
||||
@ -513,10 +514,10 @@ mod tests {
|
||||
|
||||
// this should panic because we have no balance on any account
|
||||
ext.call(
|
||||
&U256::from_str("0000000000000000000000000000000000000000000000000000000000120000").unwrap(),
|
||||
&"0000000000000000000000000000000000000000000000000000000000120000".parse::<U256>().unwrap(),
|
||||
&Address::new(),
|
||||
&Address::new(),
|
||||
Some(U256::from_str("0000000000000000000000000000000000000000000000000000000000150000").unwrap()),
|
||||
Some("0000000000000000000000000000000000000000000000000000000000150000".parse::<U256>().unwrap()),
|
||||
&[],
|
||||
&Address::new(),
|
||||
&mut output,
|
||||
|
@ -16,13 +16,13 @@
|
||||
|
||||
//! Block header.
|
||||
|
||||
use std::cmp;
|
||||
use std::cell::RefCell;
|
||||
use util::*;
|
||||
use basic_types::{LogBloom, ZERO_LOGBLOOM};
|
||||
use time::get_time;
|
||||
use rlp::*;
|
||||
|
||||
use std::cell::RefCell;
|
||||
|
||||
pub use basic_types::Seal;
|
||||
|
||||
pub use types::BlockNumber;
|
||||
@ -175,7 +175,7 @@ impl Header {
|
||||
/// Set the timestamp field of the header.
|
||||
pub fn set_timestamp(&mut self, a: u64) { self.timestamp = a; self.note_dirty(); }
|
||||
/// Set the timestamp field of the header to the current time.
|
||||
pub fn set_timestamp_now(&mut self, but_later_than: u64) { self.timestamp = max(get_time().sec as u64, but_later_than + 1); self.note_dirty(); }
|
||||
pub fn set_timestamp_now(&mut self, but_later_than: u64) { self.timestamp = cmp::max(get_time().sec as u64, but_later_than + 1); self.note_dirty(); }
|
||||
/// Set the number field of the header.
|
||||
pub fn set_number(&mut self, a: BlockNumber) { self.number = a; self.note_dirty(); }
|
||||
/// Set the author field of the header.
|
||||
@ -275,7 +275,7 @@ impl Decodable for Header {
|
||||
number: r.val_at(8)?,
|
||||
gas_limit: r.val_at(9)?,
|
||||
gas_used: r.val_at(10)?,
|
||||
timestamp: min(r.val_at::<U256>(11)?, u64::max_value().into()).as_u64(),
|
||||
timestamp: cmp::min(r.val_at::<U256>(11)?, u64::max_value().into()).as_u64(),
|
||||
extra_data: r.val_at(12)?,
|
||||
seal: vec![],
|
||||
hash: RefCell::new(Some(r.as_raw().sha3())),
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use super::test_common::*;
|
||||
use std::sync::Arc;
|
||||
use client::{BlockChainClient, Client, ClientConfig};
|
||||
use block::Block;
|
||||
use ethereum;
|
||||
|
@ -14,16 +14,18 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::sync::Arc;
|
||||
use super::test_common::*;
|
||||
use evm::action_params::ActionParams;
|
||||
use state::{Backend as StateBackend, State, Substate};
|
||||
use executive::*;
|
||||
use engines::Engine;
|
||||
use evm::env_info::EnvInfo;
|
||||
use evm;
|
||||
use evm::{Schedule, Ext, Finalize, VMType, ContractCreateResult, MessageCallResult, CreateContractAddress, ReturnData};
|
||||
use evm::{VMType, Finalize};
|
||||
use vm::{
|
||||
self, ActionParams, CallType, Schedule, Ext,
|
||||
ContractCreateResult, EnvInfo, MessageCallResult,
|
||||
CreateContractAddress, ReturnData,
|
||||
};
|
||||
use externalities::*;
|
||||
use evm::CallType;
|
||||
use tests::helpers::*;
|
||||
use ethjson;
|
||||
use trace::{Tracer, NoopTracer};
|
||||
@ -88,27 +90,27 @@ impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> TestExt<'a, T, V, B, E>
|
||||
impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Ext for TestExt<'a, T, V, B, E>
|
||||
where T: Tracer, V: VMTracer, B: StateBackend, E: Engine + ?Sized
|
||||
{
|
||||
fn storage_at(&self, key: &H256) -> evm::Result<H256> {
|
||||
fn storage_at(&self, key: &H256) -> vm::Result<H256> {
|
||||
self.ext.storage_at(key)
|
||||
}
|
||||
|
||||
fn set_storage(&mut self, key: H256, value: H256) -> evm::Result<()> {
|
||||
fn set_storage(&mut self, key: H256, value: H256) -> vm::Result<()> {
|
||||
self.ext.set_storage(key, value)
|
||||
}
|
||||
|
||||
fn exists(&self, address: &Address) -> evm::Result<bool> {
|
||||
fn exists(&self, address: &Address) -> vm::Result<bool> {
|
||||
self.ext.exists(address)
|
||||
}
|
||||
|
||||
fn exists_and_not_null(&self, address: &Address) -> evm::Result<bool> {
|
||||
fn exists_and_not_null(&self, address: &Address) -> vm::Result<bool> {
|
||||
self.ext.exists_and_not_null(address)
|
||||
}
|
||||
|
||||
fn balance(&self, address: &Address) -> evm::Result<U256> {
|
||||
fn balance(&self, address: &Address) -> vm::Result<U256> {
|
||||
self.ext.balance(address)
|
||||
}
|
||||
|
||||
fn origin_balance(&self) -> evm::Result<U256> {
|
||||
fn origin_balance(&self) -> vm::Result<U256> {
|
||||
self.ext.origin_balance()
|
||||
}
|
||||
|
||||
@ -146,23 +148,23 @@ impl<'a, T: 'a, V: 'a, B: 'a, E: 'a> Ext for TestExt<'a, T, V, B, E>
|
||||
MessageCallResult::Success(*gas, ReturnData::empty())
|
||||
}
|
||||
|
||||
fn extcode(&self, address: &Address) -> evm::Result<Arc<Bytes>> {
|
||||
fn extcode(&self, address: &Address) -> vm::Result<Arc<Bytes>> {
|
||||
self.ext.extcode(address)
|
||||
}
|
||||
|
||||
fn extcodesize(&self, address: &Address) -> evm::Result<usize> {
|
||||
fn extcodesize(&self, address: &Address) -> vm::Result<usize> {
|
||||
self.ext.extcodesize(address)
|
||||
}
|
||||
|
||||
fn log(&mut self, topics: Vec<H256>, data: &[u8]) -> evm::Result<()> {
|
||||
fn log(&mut self, topics: Vec<H256>, data: &[u8]) -> vm::Result<()> {
|
||||
self.ext.log(topics, data)
|
||||
}
|
||||
|
||||
fn ret(self, gas: &U256, data: &ReturnData) -> Result<U256, evm::Error> {
|
||||
fn ret(self, gas: &U256, data: &ReturnData) -> Result<U256, vm::Error> {
|
||||
self.ext.ret(gas, data)
|
||||
}
|
||||
|
||||
fn suicide(&mut self, refund_address: &Address) -> evm::Result<()> {
|
||||
fn suicide(&mut self, refund_address: &Address) -> vm::Result<()> {
|
||||
self.ext.suicide(refund_address)
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ use spec::Spec;
|
||||
use ethjson;
|
||||
use ethjson::state::test::ForkSpec;
|
||||
use transaction::SignedTransaction;
|
||||
use evm::env_info::EnvInfo;
|
||||
use vm::EnvInfo;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref FRONTIER: Spec = ethereum::new_frontier_test();
|
||||
|
@ -15,6 +15,8 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
pub use util::*;
|
||||
use std::collections::HashSet;
|
||||
use std::io::Read;
|
||||
use std::fs::{File, read_dir};
|
||||
use std::path::Path;
|
||||
use std::ffi::OsString;
|
||||
|
@ -98,14 +98,19 @@ extern crate lru_cache;
|
||||
extern crate native_contracts;
|
||||
extern crate num_cpus;
|
||||
extern crate num;
|
||||
extern crate price_info;
|
||||
extern crate rand;
|
||||
extern crate rlp;
|
||||
extern crate rustc_hex;
|
||||
extern crate rustc_serialize;
|
||||
extern crate semver;
|
||||
extern crate stats;
|
||||
extern crate time;
|
||||
extern crate transient_hashmap;
|
||||
extern crate using_queue;
|
||||
extern crate table;
|
||||
extern crate bloomable;
|
||||
extern crate vm;
|
||||
extern crate wasm;
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user