Merge remote-tracking branch 'origin/master'

This commit is contained in:
kaikun213 2017-07-25 11:13:39 +02:00
commit 55bef6ec2f
65 changed files with 1289 additions and 303 deletions

View File

@ -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

View File

@ -1,3 +1,468 @@
## Parity [v1.6.10](https://github.com/paritytech/parity/releases/tag/v1.6.10) (2017-07-23)
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)
- 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.7.0](https://github.com/paritytech/parity/releases/tag/v1.7.0) (2017-07-23)
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.
- **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 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:
- 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)
- 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))
- 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.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:

81
Cargo.lock generated
View File

@ -81,6 +81,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"
@ -302,6 +316,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"
@ -431,6 +450,7 @@ dependencies = [
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)",
@ -475,11 +495,11 @@ 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",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
@ -667,7 +687,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)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
"native-contracts 0.1.0",
@ -783,6 +803,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)",
@ -818,6 +839,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)",
@ -875,6 +897,7 @@ 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)",
@ -900,7 +923,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)",
@ -933,10 +956,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)",
]
@ -1153,7 +1175,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)",
@ -1165,7 +1187,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)",
@ -1178,7 +1200,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)",
@ -1191,7 +1213,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)",
@ -1201,7 +1223,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)",
@ -1216,7 +1238,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)",
@ -1226,7 +1248,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)",
@ -1239,7 +1261,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)",
@ -1253,7 +1275,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)",
@ -1714,6 +1736,13 @@ 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"
@ -1741,12 +1770,13 @@ 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)",
"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",
@ -1785,7 +1815,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)",
@ -1897,7 +1927,7 @@ dependencies = [
"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)",
@ -1979,7 +2009,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#9394d746f859365082ae375119ee70a0a18956a5"
dependencies = [
"parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2131,6 +2161,17 @@ dependencies = [
"difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "price-info"
version = "1.7.0"
dependencies = [
"ethcore-util 1.8.0",
"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)",
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "primal"
version = "0.2.3"
@ -3116,6 +3157,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"
@ -3144,6 +3186,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"
@ -3164,7 +3207,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"

View File

@ -53,6 +53,7 @@ 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}

View File

@ -3,7 +3,7 @@
### [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) [![Coverage Status][coveralls-image]][coveralls-url] [![GPLv3][license-image]][license-url]
[![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] [![Snap Status](https://build.snapcraft.io/badge/paritytech/parity.svg)](https://build.snapcraft.io/user/paritytech/parity)
### Join the chat!
@ -46,6 +46,8 @@ 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!
**For security-critical issues**, please refer to the security policy outlined in `SECURITY.MD`.
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.

44
SECURITY.md Normal file
View File

@ -0,0 +1,44 @@
# 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-----
```

View File

@ -147,13 +147,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();

View File

@ -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 && \

View File

@ -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 = []

View File

@ -289,18 +289,48 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64)
let num_full_pages = (full_size / page_size) as u32;
let cache: &[Node] = &light.cache; // deref once for better performance
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));
debug_assert_eq!(ETHASH_ACCESSES, 64);
debug_assert_eq!(MIX_NODES, 2);
debug_assert_eq!(NODE_WORDS, 16);
unroll! {
// ETHASH_ACCESSES
for i_usize in 0..64 {
let i = i_usize 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;
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.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),
);
}
}
}
}
}
}
debug_assert_eq!(MIX_WORDS / 4, 8);
// compress mix
for i in 0..(MIX_WORDS / 4) {
unroll! {
for i in 0..8 {
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);
@ -308,6 +338,7 @@ fn hash_compute(light: &Light, full_size: usize, header_hash: &H256, nonce: u64)
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 mut mix_hash = [0u8; 32];
let mut buf = [0u8; 32 + 64];
@ -331,13 +362,22 @@ fn calculate_dag_item(node_index: u32, cache: &[Node]) -> Node {
*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());
for i in 0..ETHASH_DATASET_PARENTS {
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().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));
unroll! {
for w in 0..16 {
*ret.as_words_mut().get_unchecked_mut(w) =
fnv_hash(
*ret.as_words().get_unchecked(w),
*parent.as_words().get_unchecked(w)
);
}
}
}
sha3::sha3_512(ret.bytes.as_mut_ptr(), ret.bytes.len(), ret.bytes.as_ptr(), ret.bytes.len());
ret
}
@ -359,13 +399,20 @@ fn light_new<T: AsRef<Path>>(cache_dir: T, block_number: u64) -> Light {
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 {
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);
}
}

View File

@ -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,27 @@ 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) {
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(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));
}
}

View File

@ -44,11 +44,11 @@ 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"

View File

@ -211,6 +211,7 @@ impl<Cost: CostType> Interpreter<Cost> {
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 {

View File

@ -107,6 +107,8 @@ pub struct Schedule {
pub blockhash_gas: usize,
/// Static Call opcode enabled.
pub have_static_call: bool,
/// RETURNDATA and RETURNDATASIZE opcodes enabled.
pub have_return_data: bool,
/// Kill basic accounts below this balance if touched.
pub kill_dust: CleanDustMode,
}
@ -140,6 +142,7 @@ impl Schedule {
have_delegate_call: true,
have_create2: false,
have_revert: false,
have_return_data: false,
stack_limit: 1024,
max_depth: 1024,
tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0],
@ -190,6 +193,7 @@ impl Schedule {
schedule.have_create2 = true;
schedule.have_revert = true;
schedule.have_static_call = true;
schedule.have_return_data = true;
schedule.blockhash_gas = 350;
schedule
}
@ -200,6 +204,7 @@ impl Schedule {
have_delegate_call: hdc,
have_create2: false,
have_revert: false,
have_return_data: false,
stack_limit: 1024,
max_depth: 1024,
tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0],

@ -1 +1 @@
Subproject commit 4e8b9be3fba16ec32e0cdf50b8f9329826283aaa
Subproject commit ef191fdc61cf76cdb9cdc147465fb447304b0ed2

View File

@ -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() {

View File

@ -98,10 +98,10 @@ 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;

View File

@ -33,9 +33,10 @@ use miner::{MinerService, MinerStatus, TransactionQueue, RemovalReason, Transact
AccountDetails, TransactionOrigin};
use miner::banning_queue::{BanningTransactionQueue, Threshold};
use miner::work_notify::{WorkPoster, NotifyWork};
use miner::price_info::PriceInfo;
use miner::local_transactions::{Status as LocalTransactionStatus};
use miner::service_transaction_checker::ServiceTransactionChecker;
use price_info::{Client as PriceInfoClient, PriceInfo};
use price_info::fetch::Client as FetchClient;
use header::BlockNumber;
/// Different possible definitions for pending transaction set.
@ -154,6 +155,7 @@ pub struct GasPriceCalibratorOptions {
pub struct GasPriceCalibrator {
options: GasPriceCalibratorOptions,
next_calibration: Instant,
price_info: PriceInfoClient,
}
impl GasPriceCalibrator {
@ -163,7 +165,7 @@ impl GasPriceCalibrator {
let usd_per_tx = self.options.usd_per_tx;
trace!(target: "miner", "Getting price info");
PriceInfo::get(move |price: PriceInfo| {
self.price_info.get(move |price: PriceInfo| {
trace!(target: "miner", "Price info arrived: {:?}", price);
let usd_per_eth = price.ethusd;
let wei_per_usd: f32 = 1.0e18 / usd_per_eth;
@ -189,10 +191,11 @@ pub enum GasPricer {
impl GasPricer {
/// Create a new Calibrated `GasPricer`.
pub fn new_calibrated(options: GasPriceCalibratorOptions) -> GasPricer {
pub fn new_calibrated(options: GasPriceCalibratorOptions, fetch: FetchClient) -> GasPricer {
GasPricer::Calibrated(GasPriceCalibrator {
options: options,
next_calibration: Instant::now(),
price_info: PriceInfoClient::new(fetch),
})
}

View File

@ -45,7 +45,6 @@ mod banning_queue;
mod external;
mod local_transactions;
mod miner;
mod price_info;
mod service_transaction_checker;
mod transaction_queue;
mod work_notify;

View File

@ -1,125 +0,0 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use rustc_serialize::json::Json;
use std::thread;
use std::io::Read;
use std::time::Duration;
use std::str::FromStr;
use std::sync::mpsc;
use hyper::client::{Handler, Request, Response, Client};
use hyper::{Url, Next, Encoder, Decoder};
use hyper::net::HttpStream;
#[derive(Debug)]
pub struct PriceInfo {
pub ethusd: f32,
}
pub struct SetPriceHandler<F> {
set_price: F,
channel: mpsc::Sender<()>,
}
impl<F> Drop for SetPriceHandler<F> {
fn drop(&mut self) {
let _ = self.channel.send(());
}
}
impl<F: Fn(PriceInfo) + Sync + Send + 'static> Handler<HttpStream> for SetPriceHandler<F> {
fn on_request(&mut self, _: &mut Request) -> Next { Next::read().timeout(Duration::from_secs(3)) }
fn on_request_writable(&mut self, _: &mut Encoder<HttpStream>) -> Next { Next::read().timeout(Duration::from_secs(3)) }
fn on_response(&mut self, _: Response) -> Next { Next::read().timeout(Duration::from_secs(3)) }
fn on_response_readable(&mut self, r: &mut Decoder<HttpStream>) -> Next {
let mut body = String::new();
let info = r.read_to_string(&mut body)
.map_err(|e| format!("Unable to read response: {:?}", e))
.and_then(|_| self.process_response(&body));
if let Err(e) = info {
warn!("Failed to auto-update latest ETH price: {:?}", e);
}
Next::end()
}
}
impl<F: Fn(PriceInfo) + Sync + Send + 'static> SetPriceHandler<F> {
fn process_response(&self, body: &str) -> Result<(), String> {
let json = Json::from_str(body).map_err(|e| format!("Invalid JSON returned: {:?}", e))?;
let obj = json.find_path(&["result", "ethusd"]).ok_or("USD price not found".to_owned())?;
let ethusd = match *obj {
Json::String(ref s) => FromStr::from_str(s).ok(),
_ => None,
}.ok_or("Unexpected price format.".to_owned())?;
(self.set_price)(PriceInfo {
ethusd: ethusd,
});
Ok(())
}
}
impl PriceInfo {
pub fn get<F: Fn(PriceInfo) + Sync + Send + 'static>(set_price: F) {
thread::spawn(move || {
let url = FromStr::from_str("http://api.etherscan.io/api?module=stats&action=ethprice")
.expect("string known to be a valid URL; qed");
if let Err(e) = Self::request(url, set_price) {
warn!("Failed to auto-update latest ETH price: {:?}", e);
}
});
}
fn request<F: Fn(PriceInfo) + Send + Sync + 'static>(url: Url, set_price: F) -> Result<(), String> {
let (tx, rx) = mpsc::channel();
let client = Client::new().map_err(|e| format!("Unable to start client: {:?}", e))?;
client.request(
url,
SetPriceHandler {
set_price: set_price,
channel: tx,
},
).map_err(|_| "Request failed.".to_owned())?;
// Wait for exit
let _ = rx.recv().map_err(|e| format!("Request interrupted: {:?}", e))?;
client.close();
Ok(())
}
}
#[test] #[ignore]
fn should_get_price_info() {
use std::sync::Arc;
use std::time::Duration;
use ethcore_logger::init_log;
use util::{Condvar, Mutex};
init_log();
let done = Arc::new((Mutex::new(PriceInfo { ethusd: 0f32 }), Condvar::new()));
let rdone = done.clone();
PriceInfo::get(move |price| { let mut p = rdone.0.lock(); *p = price; rdone.1.notify_one(); });
let mut p = done.0.lock();
let t = done.1.wait_for(&mut p, Duration::from_millis(10000));
assert!(!t.timed_out());
assert!(p.ethusd != 0f32);
}

View File

@ -46,6 +46,9 @@ struct Guard(bool, PathBuf);
impl Guard {
fn new(path: PathBuf) -> Self { Guard(true, path) }
#[cfg(test)]
fn benign() -> Self { Guard(false, PathBuf::default()) }
fn disarm(mut self) { self.0 = false }
}
@ -123,7 +126,7 @@ impl Restoration {
// feeds a state chunk, aborts early if `flag` becomes false.
fn feed_state(&mut self, hash: H256, chunk: &[u8], flag: &AtomicBool) -> Result<(), Error> {
if self.state_chunks_left.remove(&hash) {
if self.state_chunks_left.contains(&hash) {
let len = snappy::decompress_into(chunk, &mut self.snappy_buffer)?;
self.state.feed(&self.snappy_buffer[..len], flag)?;
@ -131,6 +134,8 @@ impl Restoration {
if let Some(ref mut writer) = self.writer.as_mut() {
writer.write_state_chunk(hash, chunk)?;
}
self.state_chunks_left.remove(&hash);
}
Ok(())
@ -138,13 +143,15 @@ impl Restoration {
// feeds a block chunk
fn feed_blocks(&mut self, hash: H256, chunk: &[u8], engine: &Engine, flag: &AtomicBool) -> Result<(), Error> {
if self.block_chunks_left.remove(&hash) {
if self.block_chunks_left.contains(&hash) {
let len = snappy::decompress_into(chunk, &mut self.snappy_buffer)?;
self.secondary.feed(&self.snappy_buffer[..len], engine, flag)?;
if let Some(ref mut writer) = self.writer.as_mut() {
writer.write_block_chunk(hash, chunk)?;
}
self.block_chunks_left.remove(&hash);
}
Ok(())
@ -558,9 +565,9 @@ impl SnapshotService for Service {
self.reader.read().as_ref().map(|r| r.manifest().clone())
}
fn min_supported_version(&self) -> Option<u64> {
fn supported_versions(&self) -> Option<(u64, u64)> {
self.engine.snapshot_components()
.map(|c| c.min_supported_version())
.map(|c| (c.min_supported_version(), c.current_version()))
}
fn chunk(&self, hash: H256) -> Option<Bytes> {
@ -668,4 +675,50 @@ mod tests {
service.restore_state_chunk(Default::default(), vec![]);
service.restore_block_chunk(Default::default(), vec![]);
}
#[test]
fn cannot_finish_with_invalid_chunks() {
use util::H256;
use util::kvdb::DatabaseConfig;
let spec = get_test_spec();
let dir = RandomTempPath::new();
let state_hashes: Vec<_> = (0..5).map(|_| H256::random()).collect();
let block_hashes: Vec<_> = (0..5).map(|_| H256::random()).collect();
let db_config = DatabaseConfig::with_columns(::db::NUM_COLUMNS);
let gb = spec.genesis_block();
let flag = ::std::sync::atomic::AtomicBool::new(true);
let params = RestorationParams {
manifest: ManifestData {
version: 2,
state_hashes: state_hashes.clone(),
block_hashes: block_hashes.clone(),
state_root: H256::default(),
block_number: 100000,
block_hash: H256::default(),
},
pruning: Algorithm::Archive,
db_path: dir.as_path().to_owned(),
db_config: &db_config,
writer: None,
genesis: &gb,
guard: Guard::benign(),
engine: &*spec.engine.clone(),
};
let mut restoration = Restoration::new(params).unwrap();
let definitely_bad_chunk = [1, 2, 3, 4, 5];
for hash in state_hashes {
assert!(restoration.feed_state(hash, &definitely_bad_chunk, &flag).is_err());
assert!(!restoration.is_done());
}
for hash in block_hashes {
assert!(restoration.feed_blocks(hash, &definitely_bad_chunk, &*spec.engine, &flag).is_err());
assert!(!restoration.is_done());
}
}
}

View File

@ -27,9 +27,9 @@ pub trait SnapshotService : Sync + Send {
/// Query the most recent manifest data.
fn manifest(&self) -> Option<ManifestData>;
/// Get the minimum supported snapshot version number.
/// Get the supported range of snapshot version numbers.
/// `None` indicates warp sync isn't supported by the consensus engine.
fn min_supported_version(&self) -> Option<u64>;
fn supported_versions(&self) -> Option<(u64, u64)>;
/// Get raw chunk for a given hash.
fn chunk(&self, hash: H256) -> Option<Bytes>;

View File

@ -100,6 +100,7 @@ impl CommonParams {
schedule.have_create2 = block_number >= self.eip86_transition;
schedule.have_revert = block_number >= self.eip140_transition;
schedule.have_static_call = block_number >= self.eip214_transition;
schedule.have_return_data = block_number >= self.eip211_transition;
if block_number >= self.eip210_transition {
schedule.blockhash_gas = 350;
}

View File

@ -9,6 +9,7 @@ serde = "1.0"
serde_derive = "1.0"
rustc-hex = "1.0"
docopt = "0.8"
panic_hook = { path = "../../panic_hook" }
[[bin]]
name = "ethkey"

View File

@ -20,12 +20,14 @@ extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate ethkey;
extern crate panic_hook;
use std::{env, fmt, process};
use std::num::ParseIntError;
use docopt::Docopt;
use rustc_hex::{FromHex, FromHexError};
use ethkey::{KeyPair, Random, Brain, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address};
use std::io;
pub const USAGE: &'static str = r#"
Ethereum keys generator.
@ -87,6 +89,7 @@ enum Error {
FromHex(FromHexError),
ParseInt(ParseIntError),
Docopt(docopt::Error),
Io(io::Error),
}
impl From<EthkeyError> for Error {
@ -113,6 +116,12 @@ impl From<docopt::Error> for Error {
}
}
impl From<io::Error> for Error {
fn from(err: io::Error) -> Self {
Error::Io(err)
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match *self {
@ -120,6 +129,7 @@ impl fmt::Display for Error {
Error::FromHex(ref e) => write!(f, "{}", e),
Error::ParseInt(ref e) => write!(f, "{}", e),
Error::Docopt(ref e) => write!(f, "{}", e),
Error::Io(ref e) => write!(f, "{}", e),
}
}
}
@ -146,6 +156,8 @@ impl DisplayMode {
}
fn main() {
panic_hook::set();
match execute(env::args()) {
Ok(ok) => println!("{}", ok),
Err(err) => {
@ -176,17 +188,17 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
} else if args.cmd_generate {
let display_mode = DisplayMode::new(&args);
let keypair = if args.cmd_random {
Random.generate()
Random.generate()?
} else if args.cmd_prefix {
let prefix = args.arg_prefix.from_hex()?;
let iterations = usize::from_str_radix(&args.arg_iterations, 10)?;
Prefix::new(prefix, iterations).generate()
Prefix::new(prefix, iterations).generate()?
} else if args.cmd_brain {
Brain::new(args.arg_seed).generate()
Brain::new(args.arg_seed).generate().expect("Brain wallet generator is infallible; qed")
} else {
unreachable!();
};
Ok(display(keypair?, display_mode))
Ok(display(keypair, display_mode))
} else if args.cmd_sign {
let secret = args.arg_secret.parse().map_err(|_| EthkeyError::InvalidSecret)?;
let message = args.arg_message.parse().map_err(|_| EthkeyError::InvalidMessage)?;

View File

@ -9,6 +9,7 @@ serde = "1.0"
serde_derive = "1.0"
docopt = "0.8"
ethstore = { path = "../" }
panic_hook = { path = "../../panic_hook" }
[[bin]]
name = "ethstore"

View File

@ -20,6 +20,7 @@ extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate ethstore;
extern crate panic_hook;
use std::{env, process, fs, fmt};
use std::io::Read;
@ -134,6 +135,8 @@ impl fmt::Display for Error {
}
fn main() {
panic_hook::set();
match execute(env::args()) {
Ok(result) => println!("{}", result),
Err(err) => {

View File

@ -16,6 +16,7 @@ serde_derive = "1.0"
ethcore = { path = "../ethcore" }
ethcore-util = { path = "../util" }
evm = { path = "../ethcore/evm" }
panic_hook = { path = "../panic_hook" }
[features]
evm-debug = ["ethcore/evm-debug-tests"]

View File

@ -26,6 +26,7 @@ extern crate serde_derive;
extern crate docopt;
extern crate ethcore_util as util;
extern crate evm;
extern crate panic_hook;
use std::sync::Arc;
use std::{fmt, fs};
@ -63,6 +64,8 @@ General options:
fn main() {
panic_hook::set();
let args: Args = Docopt::new(USAGE).and_then(|d| d.deserialize()).unwrap_or_else(|e| e.exit());
if args.flag_json {

View File

@ -1,6 +1,6 @@
{
"name": "parity.js",
"version": "1.7.100",
"version": "1.8.6",
"main": "release/index.js",
"jsnext:main": "src/index.js",
"author": "Parity Team <admin@parity.io>",

File diff suppressed because one or more lines are too long

View File

@ -104,7 +104,7 @@ contract WalletLibrary is WalletEvents {
// constructor is given number of sigs required to do protected "onlymanyowners" transactions
// as well as the selection of addresses capable of confirming them.
function initMultiowned(address[] _owners, uint _required) {
function initMultiowned(address[] _owners, uint _required) only_uninitialized {
m_numOwners = _owners.length + 1;
m_owners[1] = uint(msg.sender);
m_ownerIndex[uint(msg.sender)] = 1;
@ -198,7 +198,7 @@ contract WalletLibrary is WalletEvents {
}
// constructor - stores initial daily limit and records the present day's index.
function initDaylimit(uint _limit) {
function initDaylimit(uint _limit) only_uninitialized {
m_dailyLimit = _limit;
m_lastDay = today();
}
@ -211,9 +211,12 @@ contract WalletLibrary is WalletEvents {
m_spentToday = 0;
}
// throw unless the contract is not yet initialized.
modifier only_uninitialized { if (m_numOwners > 0) throw; _; }
// constructor - just pass on the owner array to the multiowned and
// the limit to daylimit
function initWallet(address[] _owners, uint _required, uint _daylimit) {
function initWallet(address[] _owners, uint _required, uint _daylimit) only_uninitialized {
initDaylimit(_daylimit);
initMultiowned(_owners, _required);
}

View File

@ -120,7 +120,6 @@ export default class Store {
}
@computed get qrAddressValid () {
console.log('qrValid', this.qrAddress, this._api.util.isAddressValid(this.qrAddress));
return this._api.util.isAddressValid(this.qrAddress);
}
@ -191,7 +190,7 @@ export default class Store {
}
// FIXME: Current native signer encoding is not 100% for EIP-55, lowercase for now
this.qrAddress = this._api.util
this.qrAddress = qrAddress && this._api.util
? this._api.util.toChecksumAddress(qrAddress.toLowerCase())
: qrAddress;
}

View File

@ -191,6 +191,8 @@ export default class CreateWalletStore {
return null; // exception when registry is not available
})
.then((address) => {
console.warn('WalletLibrary address in registry', address);
if (!address || /^(0x)?0*$/.test(address)) {
return null;
}

View File

@ -144,13 +144,16 @@ export function updateTokensFilter (_addresses, _tokens, options = {}) {
promises.push(api.eth.uninstallFilter(tokensFilter.filterToId));
}
const promise = Promise.all(promises);
Promise
.all([
api.eth.blockNumber()
].concat(promises))
.then(([ block ]) => {
const topicsFrom = [ TRANSFER_SIGNATURE, addresses, null ];
const topicsTo = [ TRANSFER_SIGNATURE, null, addresses ];
const filterOptions = {
fromBlock: 0,
fromBlock: block,
toBlock: 'pending',
address: tokenAddresses
};
@ -170,8 +173,8 @@ export function updateTokensFilter (_addresses, _tokens, options = {}) {
api.eth.newFilter(optionsTo)
]);
promise
.then(() => newFilters)
return newFilters;
})
.then(([ filterFromId, filterToId ]) => {
const nextTokensFilter = {
filterFromId, filterToId,

View File

@ -69,14 +69,14 @@ export default class ConfirmDialog extends Component {
<Portal
buttons={ [
<Button
disabled={ disabledDeny }
disabled={ disabledDeny || busy }
icon={ iconDeny || <CancelIcon /> }
key='deny'
label={ labelDeny || DEFAULT_NO }
onClick={ onDeny }
/>,
<Button
disabled={ disabledConfirm }
disabled={ disabledConfirm || busy }
icon={ iconConfirm || <CheckIcon /> }
key='confirm'
label={ labelConfirm || DEFAULT_YES }

View File

@ -360,10 +360,10 @@ export default class TypedInput extends Component {
renderBoolean () {
const { allowCopy, className, label, error, hint, readOnly } = this.props;
const value = this.getValue();
const value = this.getValue() ? 'true' : 'false';
if (readOnly) {
return this.renderDefault();
return this.renderDefault(value);
}
const boolitems = ['false', 'true'].map((bool) => {
@ -386,11 +386,7 @@ export default class TypedInput extends Component {
hint={ hint }
label={ label }
onChange={ this.onChangeBool }
value={
value
? 'true'
: 'false'
}
value={ value }
>
{ boolitems }
</Select>

View File

@ -41,8 +41,13 @@ class Delete extends Component {
newError: PropTypes.func
};
state = {
isBusy: false
};
render () {
const { account, confirmMessage, visible } = this.props;
const { isBusy } = this.state;
if (!visible) {
return null;
@ -50,6 +55,7 @@ class Delete extends Component {
return (
<ConfirmDialog
busy={ isBusy }
className={ styles.delete }
title={
<FormattedMessage
@ -99,6 +105,8 @@ class Delete extends Component {
const { api, router } = this.context;
const { account, route, newError } = this.props;
this.setState({ isBusy: true });
api.parity
.removeAddress(account.address)
.then(() => {

View File

@ -407,7 +407,11 @@ export default class TransactionPendingFormConfirm extends Component {
onScan = (signature) => {
const { chainId, rlp, tx, data, decrypt } = this.state.qr;
if (signature && signature.substr(0, 2) !== '0x') {
if (!signature) {
return;
}
if (signature.substr(0, 2) !== '0x') {
signature = `0x${signature}`;
}

10
panic_hook/Cargo.toml Normal file
View File

@ -0,0 +1,10 @@
[package]
description = "Parity custom panic hook"
homepage = "http://parity.io"
license = "GPL-3.0"
name = "panic_hook"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
backtrace = "0.3.2"

69
panic_hook/src/lib.rs Normal file
View File

@ -0,0 +1,69 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Custom panic hook with bug report link
extern crate backtrace;
use backtrace::Backtrace;
use std::io::{self, Write};
use std::panic::{self, PanicInfo};
use std::thread;
/// Set the panic hook
pub fn set() {
panic::set_hook(Box::new(panic_hook));
}
static ABOUT_PANIC: &str = "
This is a bug. Please report it at:
https://github.com/paritytech/parity/issues/new
";
fn panic_hook(info: &PanicInfo) {
let location = info.location();
let file = location.as_ref().map(|l| l.file()).unwrap_or("<unknown>");
let line = location.as_ref().map(|l| l.line()).unwrap_or(0);
let msg = match info.payload().downcast_ref::<&'static str>() {
Some(s) => *s,
None => match info.payload().downcast_ref::<String>() {
Some(s) => &s[..],
None => "Box<Any>",
}
};
let thread = thread::current();
let name = thread.name().unwrap_or("<unnamed>");
let backtrace = Backtrace::new();
let mut stderr = io::stderr();
let _ = writeln!(stderr, "");
let _ = writeln!(stderr, "====================");
let _ = writeln!(stderr, "");
let _ = writeln!(stderr, "{:?}", backtrace);
let _ = writeln!(stderr, "");
let _ = writeln!(
stderr,
"Thread '{}' panicked at '{}', {}:{}",
name, msg, file, line
);
let _ = writeln!(stderr, "{}", ABOUT_PANIC);
}

View File

@ -531,10 +531,12 @@ pub fn kill_db(cmd: KillBlockchain) -> Result<(), String> {
let genesis_hash = spec.genesis_header().hash();
let db_dirs = cmd.dirs.database(genesis_hash, None, spec.data_dir);
let user_defaults_path = db_dirs.user_defaults_path();
let user_defaults = UserDefaults::load(&user_defaults_path)?;
let mut user_defaults = UserDefaults::load(&user_defaults_path)?;
let algorithm = cmd.pruning.to_algorithm(&user_defaults);
let dir = db_dirs.db_path(algorithm);
fs::remove_dir_all(&dir).map_err(|e| format!("Error removing database: {:?}", e))?;
user_defaults.is_first_launch = true;
user_defaults.save(&user_defaults_path)?;
info!("Database deleted.");
Ok(())
}

View File

@ -333,7 +333,7 @@ impl Configuration {
let verifier_settings = self.verifier_settings();
// Special presets are present for the dev chain.
let (gas_pricer, miner_options) = match spec {
let (gas_pricer_conf, miner_options) = match spec {
SpecType::Dev => (GasPricerConfig::Fixed(0.into()), self.miner_options(0)?),
_ => (self.gas_pricer_config()?, self.miner_options(self.args.flag_reseal_min_period)?),
};
@ -356,7 +356,7 @@ impl Configuration {
net_conf: net_conf,
network_id: network_id,
acc_conf: self.accounts_config()?,
gas_pricer: gas_pricer,
gas_pricer_conf: gas_pricer_conf,
miner_extras: self.miner_extras()?,
stratum: self.stratum_options()?,
update_policy: update_policy,
@ -1309,7 +1309,7 @@ mod tests {
public_node: false,
warp_sync: true,
acc_conf: Default::default(),
gas_pricer: Default::default(),
gas_pricer_conf: Default::default(),
miner_extras: Default::default(),
update_policy: UpdatePolicy { enable_downloading: true, require_consensus: true, filter: UpdateFilter::Critical, track: ReleaseTrack::Unknown, path: default_hypervisor_path() },
mode: Default::default(),
@ -1604,7 +1604,7 @@ mod tests {
let conf = parse(&args);
match conf.into_command().unwrap().cmd {
Cmd::Run(c) => {
assert_eq!(c.gas_pricer, GasPricerConfig::Fixed(0.into()));
assert_eq!(c.gas_pricer_conf, GasPricerConfig::Fixed(0.into()));
assert_eq!(c.miner_options.reseal_min_period, Duration::from_millis(0));
},
_ => panic!("Should be Cmd::Run"),

View File

@ -188,7 +188,10 @@ mod server {
use parity_rpc::{hyper, RequestMiddleware, RequestMiddlewareAction};
use rpc_apis;
pub type SyncStatus = Fn() -> bool;
pub trait SyncStatus {
fn is_major_importing(&self) -> bool;
fn peers(&self) -> (usize, usize);
}
pub struct Middleware;
impl RequestMiddleware for Middleware {

View File

@ -152,7 +152,7 @@ impl InformantData for FullNodeInformantData {
max_peers: status.current_max_peers(net_config.min_peers, net_config.max_peers),
}))
}
_ => (is_major_importing(None, queue_info.clone()), None),
_ => (is_major_importing(self.sync.as_ref().map(|s| s.status().state), queue_info.clone()), None),
};
Report {
@ -254,21 +254,22 @@ impl<T: InformantData> Informant<T> {
return;
}
let (client_report, full_report) = {
let mut last_report = self.last_report.lock();
let full_report = self.target.report();
let diffed = full_report.client_report.clone() - &*last_report;
*last_report = full_report.client_report.clone();
(diffed, full_report)
};
let Report {
importing,
chain_info,
client_report,
queue_info,
cache_sizes,
sync_info,
} = self.target.report();
let client_report = {
let mut last_report = self.last_report.lock();
let diffed = client_report.clone() - &*last_report;
*last_report = client_report.clone();
diffed
};
..
} = full_report;
let rpc_stats = self.rpc_stats.as_ref();

View File

@ -57,6 +57,7 @@ extern crate ethcore_logger;
extern crate ethcore_util as util;
extern crate ethkey;
extern crate ethsync;
extern crate panic_hook;
extern crate parity_hash_fetch as hash_fetch;
extern crate parity_ipfs_api;
extern crate parity_local_store as local_store;
@ -315,8 +316,7 @@ macro_rules! trace_main {
}
fn main() {
// Always print backtrace on panic.
env::set_var("RUST_BACKTRACE", "1");
panic_hook::set();
// assuming the user is not running with `--force-direct`, then:
// if argv[0] == "parity" and this executable != ~/.parity-updates/parity, run that instead.
@ -366,4 +366,3 @@ fn main() {
process::exit(main_direct(can_restart));
}
}

View File

@ -22,6 +22,7 @@ use ethcore::spec::Spec;
use ethcore::ethereum;
use ethcore::client::Mode;
use ethcore::miner::{GasPricer, GasPriceCalibratorOptions};
use hash_fetch::fetch::Client as FetchClient;
use user_defaults::UserDefaults;
#[derive(Debug, PartialEq)]
@ -226,15 +227,18 @@ impl Default for GasPricerConfig {
}
}
impl Into<GasPricer> for GasPricerConfig {
fn into(self) -> GasPricer {
match self {
impl GasPricerConfig {
pub fn to_gas_pricer(&self, fetch: FetchClient) -> GasPricer {
match *self {
GasPricerConfig::Fixed(u) => GasPricer::Fixed(u),
GasPricerConfig::Calibrated { usd_per_tx, recalibration_period, .. } => {
GasPricer::new_calibrated(GasPriceCalibratorOptions {
GasPricer::new_calibrated(
GasPriceCalibratorOptions {
usd_per_tx: usd_per_tx,
recalibration_period: recalibration_period,
})
},
fetch
)
}
}
}

View File

@ -88,7 +88,7 @@ pub struct RunCmd {
pub warp_sync: bool,
pub public_node: bool,
pub acc_conf: AccountsConfig,
pub gas_pricer: GasPricerConfig,
pub gas_pricer_conf: GasPricerConfig,
pub miner_extras: MinerExtras,
pub update_policy: UpdatePolicy,
pub mode: Option<Mode>,
@ -480,9 +480,12 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) -> R
// prepare account provider
let account_provider = Arc::new(prepare_account_provider(&cmd.spec, &cmd.dirs, &spec.data_dir, cmd.acc_conf, &passwords)?);
// fetch service
let fetch = FetchClient::new().map_err(|e| format!("Error starting fetch client: {:?}", e))?;
// create miner
let initial_min_gas_price = cmd.gas_pricer.initial_min();
let miner = Miner::new(cmd.miner_options, cmd.gas_pricer.into(), &spec, Some(account_provider.clone()));
let initial_min_gas_price = cmd.gas_pricer_conf.initial_min();
let miner = Miner::new(cmd.miner_options, cmd.gas_pricer_conf.to_gas_pricer(fetch.clone()), &spec, Some(account_provider.clone()));
miner.set_author(cmd.miner_extras.author);
miner.set_gas_floor_target(cmd.miner_extras.gas_floor_target);
miner.set_gas_ceil_target(cmd.miner_extras.gas_ceil_target);
@ -637,9 +640,6 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) -> R
// spin up event loop
let event_loop = EventLoop::spawn();
// fetch service
let fetch = FetchClient::new().map_err(|e| format!("Error starting fetch client: {:?}", e))?;
// the updater service
let updater = Updater::new(
Arc::downgrade(&(service.client() as Arc<BlockChainClient>)),
@ -754,6 +754,7 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc<RotatingLogger>) -> R
service.register_io_handler(informant.clone()).map_err(|_| "Unable to register informant handler".to_owned())?;
// save user defaults
user_defaults.is_first_launch = false;
user_defaults.pruning = algorithm;
user_defaults.tracing = tracing;
user_defaults.fat_db = fat_db;

View File

@ -41,6 +41,7 @@ impl Serialize for UserDefaults {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer {
let mut map: BTreeMap<String, Value> = BTreeMap::new();
map.insert("is_first_launch".into(), Value::Bool(self.is_first_launch));
map.insert("pruning".into(), Value::String(self.pruning.as_str().into()));
map.insert("tracing".into(), Value::Bool(self.tracing));
map.insert("fat_db".into(), Value::Bool(self.fat_db));

16
price-info/Cargo.toml Normal file
View File

@ -0,0 +1,16 @@
[package]
description = "Fetch current ETH price"
homepage = "http://parity.io"
license = "GPL-3.0"
name = "price-info"
version = "1.7.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
fetch = { path = "../util/fetch" }
futures = "0.1"
log = "0.3"
serde_json = "1.0"
[dev-dependencies]
ethcore-util = { path = "../util" }

31
price-info/src/lib.rs Normal file
View File

@ -0,0 +1,31 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
#![warn(missing_docs)]
//! A simple client to get the current ETH price using an external API.
extern crate futures;
extern crate serde_json;
#[macro_use]
extern crate log;
pub extern crate fetch;
mod price_info;
pub use price_info::*;

View File

@ -0,0 +1,222 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
use std::cmp;
use std::fmt;
use std::io;
use std::io::Read;
use std::str::FromStr;
use fetch;
use fetch::{Client as FetchClient, Fetch};
use futures::Future;
use serde_json;
use serde_json::Value;
/// Current ETH price information.
#[derive(Debug)]
pub struct PriceInfo {
/// Current ETH price in USD.
pub ethusd: f32,
}
/// Price info error.
#[derive(Debug)]
pub enum Error {
/// The API returned an unexpected status code or content.
UnexpectedResponse(&'static str, String),
/// There was an error when trying to reach the API.
Fetch(fetch::Error),
/// IO error when reading API response.
Io(io::Error),
}
impl From<io::Error> for Error {
fn from(err: io::Error) -> Self { Error::Io(err) }
}
impl From<fetch::Error> for Error {
fn from(err: fetch::Error) -> Self { Error::Fetch(err) }
}
/// A client to get the current ETH price using an external API.
pub struct Client<F = FetchClient> {
api_endpoint: String,
fetch: F,
}
impl<F> fmt::Debug for Client<F> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("price_info::Client")
.field("api_endpoint", &self.api_endpoint)
.finish()
}
}
impl<F> cmp::PartialEq for Client<F> {
fn eq(&self, other: &Client<F>) -> bool {
self.api_endpoint == other.api_endpoint
}
}
impl<F: Fetch> Client<F> {
/// Creates a new instance of the `Client` given a `fetch::Client`.
pub fn new(fetch: F) -> Client<F> {
let api_endpoint = "http://api.etherscan.io/api?module=stats&action=ethprice".to_owned();
Client { api_endpoint, fetch }
}
/// Gets the current ETH price and calls `set_price` with the result.
pub fn get<G: Fn(PriceInfo) + Sync + Send + 'static>(&self, set_price: G) {
self.fetch.forget(self.fetch.fetch(&self.api_endpoint)
.map_err(|err| Error::Fetch(err))
.and_then(move |mut response| {
let mut result = String::new();
response.read_to_string(&mut result)?;
if response.is_success() {
let value: Result<Value, _> = serde_json::from_str(&result);
if let Ok(v) = value {
let obj = v.pointer("/result/ethusd").and_then(|obj| {
match *obj {
Value::String(ref s) => FromStr::from_str(s).ok(),
_ => None,
}
});
if let Some(ethusd) = obj {
set_price(PriceInfo { ethusd });
return Ok(());
}
}
}
let status = response.status().canonical_reason().unwrap_or("unknown");
Err(Error::UnexpectedResponse(status, result))
})
.map_err(|err| {
warn!("Failed to auto-update latest ETH price: {:?}", err);
err
})
);
}
}
#[cfg(test)]
mod test {
extern crate ethcore_util as util;
use self::util::Mutex;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use fetch;
use fetch::Fetch;
use futures;
use futures::future::{Future, FutureResult};
use price_info::Client;
#[derive(Clone)]
struct FakeFetch(Option<String>, Arc<Mutex<u64>>);
impl Fetch for FakeFetch {
type Result = FutureResult<fetch::Response, fetch::Error>;
fn new() -> Result<Self, fetch::Error> where Self: Sized { Ok(FakeFetch(None, Default::default())) }
fn fetch_with_abort(&self, url: &str, _abort: fetch::Abort) -> Self::Result {
assert_eq!(url, "http://api.etherscan.io/api?module=stats&action=ethprice");
let mut val = self.1.lock();
*val = *val + 1;
if let Some(ref response) = self.0 {
let data = ::std::io::Cursor::new(response.clone());
futures::future::ok(fetch::Response::from_reader(data))
} else {
futures::future::ok(fetch::Response::not_found())
}
}
// this guarantees that the calls to price_info::Client::get will block for execution
fn forget<F, I, E>(&self, f: F) where
F: Future<Item=I, Error=E> + Send + 'static,
I: Send + 'static,
E: Send + 'static {
let _ = f.wait();
}
}
fn price_info_ok(response: &str) -> Client<FakeFetch> {
Client::new(FakeFetch(Some(response.to_owned()), Default::default()))
}
fn price_info_not_found() -> Client<FakeFetch> {
Client::new(FakeFetch::new().unwrap())
}
#[test]
fn should_get_price_info() {
// given
let response = r#"{
"status": "1",
"message": "OK",
"result": {
"ethbtc": "0.0891",
"ethbtc_timestamp": "1499894236",
"ethusd": "209.55",
"ethusd_timestamp": "1499894229"
}
}"#;
let price_info = price_info_ok(response);
// when
price_info.get(|price| {
// then
assert_eq!(price.ethusd, 209.55);
});
}
#[test]
fn should_not_call_set_price_if_response_is_malformed() {
// given
let response = "{}";
let price_info = price_info_ok(response);
let b = Arc::new(AtomicBool::new(false));
// when
let bb = b.clone();
price_info.get(move |_| {
bb.store(true, Ordering::Relaxed);
});
// then
assert_eq!(b.load(Ordering::Relaxed), false);
}
#[test]
fn should_not_call_set_price_if_response_is_invalid() {
// given
let price_info = price_info_not_found();
let b = Arc::new(AtomicBool::new(false));
// when
let bb = b.clone();
price_info.get(move |_| {
bb.store(true, Ordering::Relaxed);
});
// then
assert_eq!(b.load(Ordering::Relaxed), false);
}
}

View File

@ -21,9 +21,10 @@ use ethsync::SyncState;
/// Check if client is during major sync or during block import.
pub fn is_major_importing(sync_state: Option<SyncState>, queue_info: BlockQueueInfo) -> bool {
let is_syncing_state = sync_state.map_or(false, |s|
s != SyncState::Idle && s != SyncState::NewBlocks
);
let is_syncing_state = sync_state.map_or(false, |s| match s {
SyncState::Idle | SyncState::NewBlocks | SyncState::WaitingPeers => false,
_ => true,
});
let is_verifying = queue_info.unverified_queue_size + queue_info.verified_queue_size > 3;
is_verifying || is_syncing_state
}

View File

@ -41,7 +41,7 @@ impl TestSnapshotService {
impl SnapshotService for TestSnapshotService {
fn manifest(&self) -> Option<ManifestData> { None }
fn min_supported_version(&self) -> Option<u64> { None }
fn supported_versions(&self) -> Option<(u64, u64)> { None }
fn chunk(&self, _hash: H256) -> Option<Bytes> { None }
fn status(&self) -> RestorationStatus { self.status.lock().clone() }
fn begin_restore(&self, _manifest: ManifestData) { }

9
scripts/aura-test.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
cargo build -j $(nproc) --release --features final $CARGOFLAGS
git clone https://github.com/paritytech/parity-import-tests
cp target/release/parity parity-import-tests/aura/parity
cd parity-import-tests/aura
echo "Start Aura test"
parity import blocks.rlp --chain chain.json
parity restore snap --chain chain.json
echo "Aura test complete"

0
scripts/deb-build.sh Normal file → Executable file
View File

0
scripts/deploy.sh Normal file → Executable file
View File

8
scripts/docker-build.sh Normal file → Executable file
View File

@ -1,5 +1,7 @@
#!/bin/bash
cd docker/hub
if [ "$1" == "latest" ]; then DOCKER_BUILD_TAG="beta-release"; fi
docker build --build-arg BUILD_TAG=$DOCKER_BUILD_TAG --no-cache=true --tag $2/parity:$1 .
docker push $2/parity:$1
DOCKER_BUILD_TAG=$1
echo "Docker build tag: " $DOCKER_BUILD_TAG
docker build --build-arg BUILD_TAG=$DOCKER_BUILD_TAG --no-cache=true --tag parity/parity:$DOCKER_BUILD_TAG .
docker run -it parity/parity:$DOCKER_BUILD_TAG -v
docker push parity/parity:$DOCKER_BUILD_TAG

0
scripts/targets.sh Normal file → Executable file
View File

View File

@ -504,7 +504,7 @@ impl ChainSync {
}
fn maybe_start_snapshot_sync(&mut self, io: &mut SyncIo) {
if !self.enable_warp_sync || io.snapshot_service().min_supported_version().is_none() {
if !self.enable_warp_sync || io.snapshot_service().supported_versions().is_none() {
return;
}
if self.state != SyncState::WaitingPeers && self.state != SyncState::Blocks && self.state != SyncState::Waiting {
@ -1044,11 +1044,11 @@ impl ChainSync {
Ok(manifest) => manifest,
};
let is_supported_version = io.snapshot_service().min_supported_version()
.map_or(false, |v| manifest.version >= v);
let is_supported_version = io.snapshot_service().supported_versions()
.map_or(false, |(l, h)| manifest.version >= l && manifest.version <= h);
if !is_supported_version {
trace!(target: "sync", "{}: Snapshot manifest version too low: {}", peer_id, manifest.version);
trace!(target: "sync", "{}: Snapshot manifest version not supported: {}", peer_id, manifest.version);
io.disable_peer(peer_id);
self.continue_sync(io);
return Ok(());

View File

@ -71,8 +71,8 @@ impl SnapshotService for TestSnapshotService {
self.manifest.as_ref().cloned()
}
fn min_supported_version(&self) -> Option<u64> {
Some(1)
fn supported_versions(&self) -> Option<(u64, u64)> {
Some((1, 2))
}
fn chunk(&self, hash: H256) -> Option<Bytes> {

12
test.sh
View File

@ -24,15 +24,3 @@ esac
. ./scripts/targets.sh
cargo test -j 8 $OPTIONS --features "$FEATURES" $TARGETS $1 \
cd ..
ls target/debug
git clone https://github.com/paritytech/parity-import-tests
cp target/debug/parity-* parity-import-tests/aura.parity
cd parity-import-tests/aura
echo "start Aura test"
parity import blocks.rlp --chain chain.json
parity restore snap --chain chain.json
ehco "Aura test complete"

View File

@ -61,6 +61,14 @@ pub trait Fetch: Clone + Send + Sync + 'static {
f.boxed()
}
/// Spawn the future in context of this `Fetch` thread pool as "fire and forget", i.e. dropping this future without
/// canceling the underlying future.
/// Implementation is optional.
fn forget<F, I, E>(&self, _: F) where
F: Future<Item=I, Error=E> + Send + 'static,
I: Send + 'static,
E: Send + 'static {}
/// Fetch URL and get a future for the result.
/// Supports aborting the request in the middle of execution.
fn fetch_with_abort(&self, url: &str, abort: Abort) -> Self::Result;
@ -149,6 +157,14 @@ impl Fetch for Client {
self.pool.spawn(f).boxed()
}
fn forget<F, I, E>(&self, f: F) where
F: Future<Item=I, Error=E> + Send + 'static,
I: Send + 'static,
E: Send + 'static,
{
self.pool.spawn(f).forget()
}
fn fetch_with_abort(&self, url: &str, abort: Abort) -> Self::Result {
debug!(target: "fetch", "Fetching from: {:?}", url);

View File

@ -857,14 +857,19 @@ impl Host {
// Add it to the node table
if !s.info.originated {
if let Ok(address) = s.remote_addr() {
let entry = NodeEntry { id: id, endpoint: NodeEndpoint { address: address, udp_port: address.port() } };
self.nodes.write().add_node(Node::new(entry.id.clone(), entry.endpoint.clone()));
// We can't know remote listening ports, so just assume defaults and hope for the best.
let endpoint = NodeEndpoint { address: SocketAddr::new(address.ip(), DEFAULT_PORT), udp_port: DEFAULT_PORT };
let entry = NodeEntry { id: id, endpoint: endpoint };
let mut nodes = self.nodes.write();
if !nodes.contains(&entry.id) {
nodes.add_node(Node::new(entry.id.clone(), entry.endpoint.clone()));
let mut discovery = self.discovery.lock();
if let Some(ref mut discovery) = *discovery {
discovery.add_node(entry);
}
}
}
}
for (p, _) in self.handlers.read().iter() {
if s.have_capability(*p) {
ready_data.push(*p);

View File

@ -236,6 +236,11 @@ impl NodeTable {
self.nodes.get_mut(id)
}
/// Check if a node exists in the table.
pub fn contains(&self, id: &NodeId) -> bool {
self.nodes.contains_key(id)
}
/// Apply table changes coming from discovery
pub fn update(&mut self, mut update: TableUpdates, reserved: &HashSet<NodeId>) {
for (_, node) in update.added.drain() {