Compare commits

...

4280 Commits
v1.5.2 ... main

Author SHA1 Message Date
POA 6e06824c23 Bump to v3.3.3 2022-01-13 12:34:02 +03:00
Rim Rakhimov 43d6da6b52
Made nodes data concatenate as RLP sequences instead of bytes (#598)
* Made nodes data concatenate as RLP sequences instead of bytes

* Add test for getNodeData dispatch

* Update getNodeData to return data for non-aura networks
2022-01-13 12:26:33 +03:00
Rim Rakhimov 412d797a3b
Implements eip-3607 (#593)
* implements eip-3607

* Tests fixed

* Added tests for eip3607 functionality

* rast fmt
2022-01-10 18:01:46 +03:00
Rim Rakhimov 63bab44e3c
Makes eth_mining to return False if not is not allowed to seal (#581) 2021-12-10 14:25:39 +03:00
Rim Rakhimov f703d01f23
Add type field for legacy transactions in RPC calls (#580)
* Added type field for legacy transactions when returned as rpc call response

* Remove invalid test
2021-12-09 11:17:42 +03:00
POA f13fa10b8a Bump to v3.3.2, London on Sokol, effective_gas_price function enhancement 2021-12-07 14:03:48 +03:00
POA 657100cebc Bump to v3.3.1 2021-11-30 10:55:54 +03:00
POA d2d19ec8c2 Merge branch 'dev' of https://github.com/openethereum/openethereum into dev 2021-11-30 10:39:06 +03:00
POA 0f872aff78 Add a bootnode for Kovan 2021-11-30 10:38:55 +03:00
Rim Rakhimov 405738c791
Fix for modexp overflow in debug mode (#578)
* fix modexp overflow panic in debug mode

* Added one more unit test for modexp

* Remove redundant bytes from modexp unit test

Co-authored-by: POA <33550681+poa@users.noreply.github.com>
2021-11-30 10:33:40 +03:00
Rim Rakhimov 3b19a79c37
Adds eth_maxPriorityFeePerGas implementaiton (#570)
* added eth_maxPriorityFeePerGas rpc call

* cargo fmt

* moved block_base_fee implementation into the trait

* added basic test for eth_maxPriorityFeePerGas

* added test for eth_maxPriorityFeePerGas calculation

* Added support for zero-cost transactions

* Added 'eip1559_not_activated' error

* Fixes 'chain::supplier::test::return_nodes' test

* cargo fmt

* cargo fmt

* made calculation of fallback priority fee to ignore zero-cost transactions

* cargo fmt

* made use of 'saturating_sub' instead of minus
2021-11-25 10:43:00 +03:00
POA 64a1614769 Bump to v3.3.0 2021-11-17 12:05:58 +03:00
POA b981f7beef Add validateServiceTransactionsTransition spec option 2021-11-12 13:06:19 +03:00
POA caa210107e Add additional service transactions checking to block verifier 2021-11-10 16:36:17 +03:00
POA 88eb7d3257 Revert eip1559BaseFeeMinValue activation on xDai 2021-11-04 15:50:48 +03:00
POA 73895aae88 Set eip1559BaseFeeMinValue for POA Core 2021-11-02 10:29:54 +03:00
POA c5719983b2 Set eip1559BaseFeeInitialValue equal to eip1559BaseFeeMinValue for xDai 2021-11-02 09:34:53 +03:00
POA f9b2db206a Replace eip1559BaseFeeFixedValue* spec options with eip1559BaseFeeMinValue and eip1559BaseFeeMinValueTransition 2021-11-01 13:20:58 +03:00
POA 437ba9b044 Add eip1559BaseFeeFixedValue and eip1559BaseFeeFixedValueTransition spec options and bump to v3.3.0-rc.14 2021-11-01 10:53:50 +03:00
uink45 98873fc0c0
EIP-4345 enabled (#561)
* EIP-4345 enabled

Co-authored-by: varasev <33550681+varasev@users.noreply.github.com>
2021-11-01 07:14:52 +03:00
POA 415a522429 POA Core London hard fork and bump to v3.3.0-rc.13 2021-10-29 16:37:12 +03:00
POA 646f49fdd0 xDai London hard fork and bump to v3.3.0-rc.12 2021-10-22 09:44:16 +03:00
POA 25ce4b2ec8 Enable GetNodeData for AuRa chains and bump to v3.3.0-rc.11 2021-10-19 11:25:32 +03:00
POA ac30783c82 Add eip1559FeeCollector and eip1559FeeCollectorTransition spec options and bump to v3.3.0-rc.10 2021-10-14 16:14:38 +03:00
POA 5e9b4c58ae Bump to v3.3.0-rc.9 2021-10-04 10:43:30 +03:00
POA 74e709fd55 Fix MinGasPrice config option 2021-09-29 10:30:28 +03:00
POA 3413343caa Add service transactions support for EIP-1559 2021-09-29 10:30:28 +03:00
sunce86 8bb02dd479 small fixes 2021-09-29 10:30:27 +03:00
sunce86 79be8f1ab8 min_gas_price becomes min_effective_priority_fee (effective_gas_price - base_fee) 2021-09-29 10:30:27 +03:00
sunce86 a049baf6b2 added version 4 for TxPermission contract 2021-09-29 10:30:27 +03:00
sunce86 d8305c52ea Bump to v3.3.0-rc.8 2021-09-03 17:07:40 +02:00
Jochen Müller 239d790df1
Ignore GetNodeData requests (#519) 2021-09-03 16:43:33 +02:00
Jochen Müller 298a1a0ecc Bump to v3.3.0-rc.7 2021-08-23 14:03:36 +02:00
Jochen Müller 36b3f125a4
Fix wrong sync packet id (#514) 2021-08-23 13:54:25 +02:00
sunce86 5d9ff63043 Bump to v3.3.0-rc.6 2021-08-04 18:15:06 +02:00
sunce86 01996c8867 Merge branch 'dev' 2021-08-04 18:05:31 +02:00
varasev 2ae294990a
London HF on Kovan (#502)
* London HF on Kovan

Block number 26741100

* Set wasmDisableTransition for Kovan

Co-authored-by: Dusan Stanivukovic <dusan.stanivukovic@gmail.com>
2021-08-03 14:02:37 +02:00
sunce86 745c4bd00c Revert "Sunce86/eip1559 for x dai (#499)"
This reverts commit 87ae05d99e.
2021-08-03 11:49:51 +02:00
sunce86 ecae5f1c47 Revert "Sunce86/eip1559 for x dai (#499)"
This reverts commit 87ae05d99e.
2021-08-03 11:47:01 +02:00
Dusan Stanivukovic 87ae05d99e
Sunce86/eip1559 for x dai (#499)
* added version 4 for TxPermission contract
* min_gas_price becomes min_effective_priority_fee (effective_gas_price - base_fee)
2021-08-02 19:47:39 +02:00
sunce86 a92e5e761b Bump to v3.3.0-rc.4 2021-07-14 21:46:58 +02:00
Dusan Stanivukovic 87603926b5
feeHistory implementation (#484)
* feeHistory implementation

* code review fix
2021-07-14 21:21:28 +02:00
Dusan Stanivukovic eb42f0c5d9
gasPrice is required field for Transaction object (#481) 2021-07-12 15:22:27 +02:00
Dusan Stanivukovic 33908e8361
fix state test for openethereum-evm (#480)
* fix state test for openethereum-evm
2021-07-10 08:53:53 +02:00
Dusan Stanivukovic aa09846200
bump ethereum tests 9.0.3 (#478) 2021-07-09 16:47:02 +02:00
Dusan Stanivukovic 67ab600bc9
Sunce86/effective gas price not omitting (#477)
* no omit effectiveGasPrice in receipts
2021-07-09 14:56:37 +02:00
Dusan Stanivukovic 4b437428bd
define london block at 12965000 (#476)
* define london block at 12965000
2021-07-08 22:55:53 +02:00
Jochen Müller 38e40f649c
Restore GetNodeData (#469)
* Accept GetNodeData requests

* Implement blockchain client method for node data requests

* Reuse old database read methods for node data

* fmt

* Copy & paste old tests...

* ... and make them work

* fmt
2021-07-05 17:06:35 +02:00
Jochen Müller 43ee520904
Implement eth/66 (#467)
* Allow eth/66

* Add eth/66 request ids

* fmt

* Remove some leftovers

* fmt

* Change behaviour in case of missing peer info

- Assume eth/66 protocol, not earlier one
- Log just a trace, not an error
2021-07-05 15:59:22 +02:00
sunce86 fdaee51ca0 Bump to v3.3.0-rc.3 2021-06-29 22:56:40 +02:00
Dusan Stanivukovic eec38b30e3
forcing base fee to zero if gas pricing is omitted (#460)
* forcing base fee to zero if gas pricing is omitted

* force base fee to zero for estimate_gas
2021-06-29 22:17:00 +02:00
Dusan Stanivukovic 287409f9f5
gasPrice substituted with effective_gas_price (#458) 2021-06-28 19:15:37 +02:00
Dusan Stanivukovic e5ae846de4
added effectiveGasPrice to eth_getTransactionReceipt return structure (#450) 2021-06-28 19:04:52 +02:00
Dusan Stanivukovic e6f3794dd4
rust version reverted to 1.52.1 (#454) 2021-06-28 16:39:18 +02:00
sunce86 5920f232d0 Bump to v3.3.0-rc.2 2021-06-17 11:32:11 +02:00
sunce86 3bce814090 Update changelog 2021-06-17 11:31:33 +02:00
sunce86 118051696e Merge branch 'dev' 2021-06-16 21:18:02 +02:00
Dusan Stanivukovic 17057eeedc
bump ethereum tests 9.0.2, revert london mainnet block (#435)
* bump ethereum tests 9.0.2
* london mainnet block removed
2021-06-16 20:48:23 +02:00
Dusan Stanivukovic 7aa1e987de
Update CHANGELOG.md 2021-06-16 09:33:16 +02:00
Jochen Müller 193b25a22d Bump to v3.3.0-rc.1 2021-06-15 13:25:26 +02:00
Jochen Müller 99a8ddae41 Update changelog 2021-06-15 13:00:45 +02:00
Dusan Stanivukovic 93b39df02d
Eip 3554 enabled, London blocks defined (#433)
* Eip 3554 enabled
* london hard fork blocks
2021-06-15 11:18:56 +02:00
Dusan Stanivukovic 5dec58ba9f
Sunce86/fix tx pool locals for 1559 (#431)
* fixed handling of local txs after 1559 activation
2021-06-11 10:19:08 +02:00
Dusan Stanivukovic b928380b64
test update (#429)
support for 9.0.1 ethereum tests
2021-06-10 15:01:48 +02:00
Dusan Stanivukovic 5e7086d54c
Sunce86/eip 1559 (#393)
* eip1559 hard fork activation

* eip1559 hard fork activation 2

* added new transaction type for eip1559

* added base fee field to block header

* fmt fix

* added base fee calculation. added block header validation against base fee

* fmt

* temporarily added modified transaction pool

* tx pool fix of PendingIterator

* tx pool fix of UnorderedIterator

* tx pool added test for set_scoring

* transaction pool changes

* added tests for eip1559 transaction and eip1559 receipt

* added test for eip1559 transaction execution

* block gas limit / block gas target handling

* base fee verification moved out of engine

* calculate_base_fee moved to EthereumMachine

* handling of base_fee_per_gas as part of seal

* handling of base_fee_per_gas changed. Different encoding/decoding of block header

* eip1559 transaction execution - gas price handling

* eip1559 transaction execution - verification, fee burning

* effectiveGasPrice removed from the receipt payload (specs)

* added support for 1559 txs in tx pool verification

* added Aleut test network configuration

* effective_tip_scaled replaced by typed_gas_price

* eip 3198 - Basefee opcode

* rpc - updated structs Block and Header

* rpc changes for 1559

* variable renaming according to spec

* - typed_gas_price renamed to effective_gas_price
- elasticity_multiplier definition moved to update_schedule()

* calculate_base_fee simplified

* Evm environment context temporary fix for gas limit

* fmt fix

* fixed fake_sign::sign_call

* temporary fix for GASLIMIT opcode to provide gas_target actually

* gas_target removed from block header according to spec change: https://github.com/ethereum/EIPs/pull/3566

* tx pool verification fix

* env_info base fee changed to Option

* fmt fix

* pretty format

* updated ethereum tests

* cache_pending refresh on each update of score

* code review fixes

* fmt fix

* code review fix - changed handling of eip1559_base_fee_max_change_denominator

* code review fix - modification.gas_price

* Skip gas_limit_bump for Aura

* gas_limit calculation changed to target ceil

* gas_limit calculation will target ceil on 1559 activation block

* transaction verification updated according spec: https://github.com/ethereum/EIPs/pull/3594

* updated json tests

* ethereum json tests fix for base_fee
2021-06-04 12:12:24 +02:00
Jochen Müller 144b2293a2
EIP 3541 (#422)
* Add EIP-3541 transition block parameter

* Implement EIP-3541

* Add a unit test for EIP-3541

* Add error type for attempt to deploy invalid code

* fmt
2021-05-31 14:37:23 +02:00
Jochen Müller f14d3e5a5c
EIP-3529: Reduction in gas refunds (#406)
* Implement changed gas refund rules according to EIP-3529

* Add a unit test for changed gas refunds

* Add missing comment

* Add fork block to spec.hard_forks
2021-05-19 17:18:01 +02:00
Jochen Müller f9f492638c Bump to v3.2.6 2021-05-14 09:39:01 +02:00
varasev fe198ddf7d
Berlin HF on POA Core and Sokol (#398)
Co-authored-by: POA <33550681+poa@users.noreply.github.com>
2021-05-11 11:10:51 +02:00
Jochen Müller 32d8b5487a Bump to v3.2.5 2021-05-05 15:14:10 +02:00
rakita 6835ec53ad
Remove windows build artifacts (#385)
Remove windows build artifacts that were added by mistake
2021-05-05 13:33:48 +02:00
Jochen Müller 09ab40b956
Mention v3.2.2 changes in v3.2.5 changelog (#386)
Since the two hotfix releases, v3.2.3 and v3.2.4, did not include the
changes from v3.2.2-rc.1, they should be mentioned in the changelog for
v3.2.5-rc.1 again.
2021-05-05 12:19:45 +02:00
Jochen Müller 2df74c26dd Bump to v3.2.5-rc.1 2021-04-28 15:08:33 +02:00
varasev ed12fffeef
Berlin HF on xDai (#384)
* Berlin HF on xDai

* Update enodes for xDai

Co-authored-by: rakita <rakita@users.noreply.github.com>
2021-04-28 14:07:24 +02:00
Jochen Müller c03cc15468
Implement eth/65 (#352)
* EIP-2464: eth/65: transaction announcements and retrievals

* Updates to eth-65 implementatiom

- Replace deprecated syntax and method name
- Replace call to removed method
- Reimplement rlp::Encodable for SignedTransaction

* fmt

* More updates

- Replace calls to removed methods
- More dyns

* Apply requested changes

- Avoid unused variable warnings
- Avoid implementing Encodable trait for Transaction
- Update message encoding to EIP-2718 transaction format

* Update sync stats of eth-65 peers properly

* fmt & fix error propagation

* Fix: Add correct subset of transactions to stats.

* Update list of last sent transactions correctly.

Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
Co-authored-by: Karim Agha <karim.dev@gmail.com>
Co-authored-by: rakita <rakita@users.noreply.github.com>
2021-04-27 15:33:40 +02:00
rakita 3b3ecf6676
Bump eth tests to 8.0.3 (#349) 2021-04-27 14:36:50 +02:00
rakita be9b16ab67
Bump parking_lot to 0.11.1. Revert std mutex from #277 (#350) 2021-04-27 13:12:19 +02:00
varasev 392a909cb7
Berlin HF in Kovan (#380)
* Berlin HF in Kovan

According to https://github.com/poanetwork/poa-chain-spec/pull/171

* Update nodes for Kovan
2021-04-26 10:21:01 +02:00
Jochen Müller 6f5a00a642 Merge branch 'main' into dev 2021-04-21 15:42:43 +02:00
Jochen Müller 2453f1a803 Merge branch 'release/v3.2.x' into main 2021-04-21 15:27:39 +02:00
rakita 09967329af Bump to v3.2.4 2021-04-15 21:49:20 +02:00
rakita 459a1a02a4 Fix broadcast for typed tx 2021-04-15 21:47:50 +02:00
Wei Tang a716eb3871 EIP-2929: only add params.address to access list 2021-04-15 18:15:40 +02:00
Wei Tang 0fd7c59724 EIP-2929: add tx sender and address into the access list 2021-04-15 18:02:24 +02:00
rakita aa41520dd1 Bump to v3.2.3 2021-04-15 18:02:24 +02:00
Wei Tang 4bffab6715 Fix compile 2021-04-15 18:02:24 +02:00
Wei Tang 5709dbc3e0 EIP2929: only add builtin to warm address if they are active 2021-04-15 18:02:24 +02:00
Wei Tang 6ce6666cbb
EIP-2929: add tx sender and address into the access list (#360) 2021-04-15 17:41:33 +02:00
rakita 582bca385f Bump to v3.2.2-rc.1. Changelog 2021-03-31 15:07:27 +02:00
rakita 9037ad0ea7 Bump eth/tests to v8.0.2 2021-03-31 13:44:14 +02:00
rakita c9190a39ed
Executable queue for ancient blocks inclusion (#208)
* Executable queue for ancient blocks inclusion
* Add drop trait for client
* Added shutdown to tests
* Remove doubled call
* Use reth-util from reth repo
2021-03-25 16:04:32 +01:00
rakita 85391f99ac
Backport AuRa commits for xdai (#330)
* Add SealingState; don't prepare block when not ready. (#10529)
* Fix a few typos and unused warnings. #10803
* Configuration map of block reward contract addresses (#10875)
* Step duration map configuration parameter ported from the POA Network fork (#10902)
* Add a 2/3 quorum option to Authority Round. (#10909)
* Additional arithmetic EVM opcode benchmarks (#10916)
* RPC method for clearing the engine signer (#10920)
* authority_round: Fix next_step_time_duration. (#11379)
* Aura: Report malice on sibling blocks from the same validator (#11160)
* TxPermissions ver 3: gas price & data (#11170)
* Add randomness contract support to AuthorityRound. (#10946)
* Set the block gas limit to the value returned by a contract call (#10928)
* AuthorityEngine: Minor cleanups. (#11408)
* Add POSDAO transition and malice report queue. (#11245)
* PoA call validators on_close_block
* Actualize spec files for POA Networks
* Some fixes after merge
* Crypto error desc
* AuRa on_close_block Error::Old fix

Co-authored-by: POA <33550681+poa@users.noreply.github.com>
2021-03-25 14:37:01 +01:00
rakita 561ed8df3c fix miner_author by adding dummy msg 2021-03-24 17:50:36 +01:00
rakita 5eacff59e8 Revert "Remove eth/63 protocol version (#252)"
This reverts commit bbecb0415e.
2021-03-23 11:59:33 +01:00
rakita d030870220 Merge remote-tracking branch 'origin/main' into dev 2021-03-21 21:58:13 +01:00
Karim Agha ee88247e71 Fixing outdated readme links (#322) 2021-03-21 21:58:02 +01:00
Jochen Müller 37f5291538
Add Nethermind to clients that accept service transactions (#324)
* Add Nethermind to clients that accept service transactions

* fmt
2021-03-18 14:00:05 +01:00
rakita 5fdedf0858 Bump to v3.2.1. Changelog 2021-03-17 09:46:36 +01:00
Jochen Müller 504777e879
Implement the filter argument in parity_pendingTransactions (#295)
* Add filters for pending transactions to RPC API

Allow filtering results in the parity_pendingTransaction endpoint as described in the API docs.

* Make arguments in parity_pendingTransactions work together

filter and limit

* fmt

* Requested changes

- filter in ethcore to avoid unneccessary copying
- rename gas_price to gasPrice
- implement requesting contract creation txs with "action"

* Some beautifying

Remove missing import and unneccessary dependency entry, add a comment
and set right lint level on new module

* fixed broken build after merge

* fmt

* fixing CI errors: type conversion

Co-authored-by: Karim Agha <karim.dev@gmail.com>
2021-03-16 13:39:42 +01:00
rakita 3317797285 Initial sync block stuck. Block import logs (#318) 2021-03-16 12:08:22 +01:00
rakita 33a3a9deec
Initial sync block stuck. Block import logs (#318)
Co-authored-by: Karim Agha <karim.dev@gmail.com>
2021-03-14 11:18:38 +01:00
Karim Agha 327c4bcb14
Fixing outdated readme links (#322) 2021-03-14 10:25:45 +01:00
Karim Agha b6b5129058
Following up on PR #316, removing unused conversions that are now deadcode (#321) 2021-03-14 10:25:14 +01:00
Karim Agha 29dc10c446
Updating ethcore and ethjson crates to Rust Edition 2018 (#316)
* Migrating use crate::Type imports to Rust 2018 edition

* import name fixes

* fmt

* removing diff leftover

* catching up with latest developments on dev

* fmt

* removing another diff leftover
2021-03-12 14:55:49 +01:00
Simon KP 48e7d6cee4
Send SIGTERM instead of SIGHUP to OE daemon (#317)
* Send SIGTERM instead of SIGHUP to OE daemon

* Address comments
2021-03-12 13:00:09 +01:00
rakita a0f406e26b
Ethereum-types and various libs upgrade (#315)
* Upgrade Eth types

ethereum-types -> 0.9.2
rlp -> 0.4.6
keccak-hash -> 0.5.0
parity-crypto -> 0.6.2
ethabi -> 0.12.0
ethabi-derive -> 0.12.0
ethabi-contract -> 0.11.0
ethbloom -> 0.9.1
rand -> 0.7.3
trie-standardmap -> 0.15.2
triehash -> 0.5.0

* backport #10714. Small changes, merge fixes

Co-authored-by: mdben1247 <mdben1247@users.noreply.github.com>
2021-03-12 10:12:42 +01:00
rakita 3f8e0cfec4 Merge remote-tracking branch 'origin/main' into dev 2021-03-11 16:30:47 +01:00
rakita f143ddb75a [devops] Upgrade docker alpine to v1.13.2 2021-03-11 08:42:23 +01:00
rakita 32fd2b484c Merge remote-tracking branch 'origin/main' into dev 2021-03-10 17:23:00 +01:00
rakita 187c81b3f1 Upgrade ethereum/tests to v8.0.1 (#301) 2021-03-10 17:18:17 +01:00
rakita d7a958129f
[evmbin] Omit storage output, now for std-json (#311)
* [evmbin] Omit storage output, now for std-json
* fix tests
2021-03-10 16:39:32 +01:00
rakita eca8fb74ae
Strict memory order (#306)
* Make MemoryOrdering more strict

* fmt

* Strict mem order for priority_tasks_gate
2021-03-10 12:36:23 +01:00
Karim Agha e2024c4b81
Fixing a compilation warning (#308)
* Fixing a compilation warning
2021-03-10 09:46:34 +01:00
rakita 5b904476cd
Backport: Block sync stopped without any errors. #277 (#286)
* Backport: Block sync stopped without any errors. #277
* fmt
2021-03-09 11:20:32 +01:00
rakita 7ea5707904
Freeze pruning while creating snapshot (#205)
* Freeze pruning while creating snapshot
* Use scopeguard for snapshot generation
* Snapshot 1k blocks
* Snapshot number correction
2021-03-09 09:47:49 +01:00
rakita 458d55559e Bump to v3.2.0 2021-03-08 17:49:59 +01:00
rakita 6f50061f0c
AuRa multi block reward (#290)
* Multi block reward for AuRa
* Added test
* Better error on wrong config
2021-03-08 11:59:04 +01:00
gakada dbc5f94241
Migrate compare_and_swap to compare_exchange (#291) 2021-03-06 11:30:52 +01:00
rakita 0cf0cdbb86 Disable CI on tag for windows2019 machine"
This reverts commit efb80e1032.
2021-03-05 19:27:01 +01:00
rakita 91e57c803d Disable EIP-2315 2021-03-05 18:01:27 +01:00
adria0.eth 0fcb102f03
Improved metrics (#240)
Added db metrics (kvdb_bytes_read, kvdb_bytes_written, kvdb_reads, kvdb_writes)
Added --metrics-prefix=[prefix]
2021-03-03 22:44:35 +01:00
Dusan Stanivukovic 973a5a594b
Sunce86/add support eip2930 ethereum tests runner (#288)
* added support for eip2930 tests

Co-authored-by: sunce86 <dusan.stanivukovic@gmail.pm>
2021-03-03 15:57:25 +01:00
rakita ba011eba15
Send RLPx auth in EIP-8 format (#287) 2021-03-03 12:58:10 +01:00
Anonymous 7c9eed8d65 ethcore/snapshot: fix double-lock in Service::feed_chunk (#289) 2021-03-02 14:44:58 +01:00
Anonymous 63fdad8d86
ethcore/snapshot: fix double-lock in Service::feed_chunk (#289) 2021-03-02 14:27:28 +01:00
Dusan Stanivukovic 0947261cf2
Sunce86/rpc module reverted for RPC JSON api (#284)
* rpc module reverted for RPC JSON api

Co-authored-by: Dusan Stanivukovic <dusan.stanivukovic@gnosis.pm>
2021-02-26 15:23:29 +01:00
Giacomo efb80e1032
Enable CI on windows2019 machine (#283)
Enable CI on windows2019 machine

* Add -y for choco install
2021-02-26 10:35:17 +01:00
draganrakita f0fd88aa12 Github action path for folder structure 2021-02-25 17:21:02 +01:00
draganrakita 142b63a4f9 Backport github actions from old main 2021-02-25 17:05:24 +01:00
rakita 1d2b640834 chocolate -y confirmation steps 2021-02-25 11:11:31 +01:00
draganrakita f1dc682168 Bump to 3.2.0-rc.1 2021-02-24 13:00:50 +01:00
draganrakita 0bb2f8f6b8 Berlin hardfork blocks 2021-02-24 13:00:50 +01:00
rakita d5c2a0fbe2
Fix for TypedTx enabling and hash generation. Tweak sig V in RPC. (#272)
* Fix for TypedTx hash generation from RlpView
* Tweaks on sig V field in RPC
* Fix for eip2930 incomming tx
2021-02-23 13:46:08 +01:00
rakita 98563b0a45
Change ProtocolId to U64. yolo3x spec (#271)
* Change ProtocolId to U64 and make it support variable subprotocol names* 
* Add yolo3x testnet
2021-02-19 12:52:24 +01:00
adria0.eth d8ce175846
Fix modexp, update tests, update berlin chainspec (#267) 2021-02-17 19:43:09 +01:00
rakita fb9699d8e1
EIP-2930 remove type from legacy JSONRPC (#265)
* EIP-2930 remove type from legacy JSONRPC
* fmt
2021-02-17 16:52:51 +01:00
rakita dbf9a1cd98
EIP-2930 spec change for signature hash (#261)
* EIP-2930 spec change for signature hash
* Removing eip2930 test blocks
2021-02-10 15:58:35 +01:00
rakita 6b4e56b214
AccessList in JSONRPC. And enabling github action tests (#255)
* Enabling github action tests
* Fix failing tests
* AccessList to Option in json
* failing rust example removed
* AccessList for jsonrpc
* Tx type as sequence, AccessList as type
2021-02-08 14:55:03 +01:00
Jochen Müller f40e198eb7
Give IoService a consistent interface (#257)
The start() method had two different signatures depending on configuration. Since ethcore is built with either config depending on the build target, this resulted in compiler errors for either evmbin or oe.
2021-02-05 13:33:39 +01:00
rakita bbecb0415e
Remove eth/63 protocol version (#252)
* Remove eth/63 protocol
2021-02-04 14:10:48 +01:00
rakita 6d81fce451
Update EWF's chains with Istanbul transition block numbers (#11482) (#254)
Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
2021-02-04 11:39:10 +01:00
rakita 65c5e6dfd3
EIP-2930 RPC and TypedTransactionView support (#245)
* TypedTransactionView for EIP-2930
* Enable EIP-2930 in RPC calls
* type field added to TypedTransactionView
2021-02-02 16:26:55 +01:00
adria0.eth 2e23ca353f
Use berlin chainspec for unit test, yolo3 for testnet (#244)
* Fix yolo+berlin specs
* fix yolo3 maximumExtraDataSize
* fmt
2021-02-01 16:40:00 +01:00
rakita a831379ad8
Yolo3 spec (#241)
Update Yolo3
2021-02-01 08:34:44 +01:00
rakita cfc6439f2e
Local EIP2930 and EN/DE block tests (#237) 2021-01-28 17:23:01 +01:00
François Garillot 52d966ccaa
Cleans up a number of Option / Result patterns and warts (#226) 2021-01-21 18:27:35 +01:00
rakita 59d891edf4
Snapshot manifest block added to prometheus (#232)
Co-authored-by: adria0.eth <5526331+adria0@users.noreply.github.com>
2021-01-21 17:23:15 +01:00
draganrakita f3bdc0da3c Bump to 3.1.1 2021-01-19 14:49:25 +01:00
Denis Granha a55799d523
Set alpine version to 3.12.3
Alpine version is changed in order to prevent Cmake errors. Reference: https://gitlab.alpinelinux.org/alpine/aports/-/issues/12321.

Intends to solve https://github.com/openethereum/openethereum/issues/230
2021-01-19 10:59:40 +01:00
draganrakita 1d07c4c06b fix Supplied instant is later than self 2021-01-18 09:34:48 +01:00
rakita ea25ffd79d
Added additional Sg-1,Ca-2,Ca-3 OE bootnodes (#222) 2021-01-17 23:15:33 +01:00
Adria Massanet eb876cb2d7 CI fix 2021-01-14 15:30:57 +01:00
Adria Massanet 814526a248 Fix CI 2021-01-14 15:30:57 +01:00
Adria Massanet d3ba83405c fmt 2021-01-14 15:30:57 +01:00
Adria Massanet c46fe330dc Big folder refactor 2021-01-14 15:30:57 +01:00
draganrakita 0e5d6944b7 Add eip2929,eip2930 to ForkId list 2021-01-11 15:21:16 +01:00
adria0.eth b0a1e3da03
Update ethereum/tests to f55f344 (#220) 2021-01-11 14:14:41 +01:00
rakita 0706e5468d
EIP-1898: Allow default block parameter to be blockHash (#203)
* Allow default block parameter to be blockHash

Backport to 3.1 of https://github.com/openethereum/openethereum/pull/10932

Co-authored-by: Richard Patel <me@terorie.dev>

* Request canonical with BlockHash

Co-authored-by: Seun LanLege <seunlanlege@gmail.com>
Co-authored-by: Richard Patel <me@terorie.dev>
2021-01-11 11:00:27 +01:00
rakita f286597d10
Update link to issue (#202) 2021-01-08 15:56:53 +01:00
Giacomo e2f665e9cf
Enable Windows2019 CI on main/dev (#213)
* Revert "Disable windows2019, remove tagged windows artifact"

This reverts commit 08e6cca3e5.

* Allow running CI on windows only when pushing to main/dev

* Remove unneeded block code
2020-12-30 15:07:20 +01:00
draganrakita eab41b49cf test cfg 2020-12-23 15:31:13 +01:00
draganrakita 8d3e0582a8 fmt 2020-12-23 15:31:13 +01:00
draganrakita 705bc71593 Payload limit for test 2020-12-23 15:31:13 +01:00
draganrakita f723e288c3 Cleanup devp2p unused interface fn 2020-12-23 15:31:13 +01:00
Justin Beaurone a6bd3516e0 OpenEthereum rebranding 2020-12-21 13:34:05 +01:00
draganrakita 08e6cca3e5 Disable windows2019, remove tagged windows artifact 2020-12-21 11:54:53 +01:00
draganrakita 8a9d14141a Revert "Fix CI problems (#127)" and Remove sscache
This reverts commit 12afb13e9b.
2020-12-21 11:45:52 +01:00
draganrakita 832fc444b6 Tweaks in informer log 2020-12-15 17:07:49 +01:00
adria0.eth 612a71ecb2 Update ISSUE_TEMPLATE.md (#124)
Tell users to ask questions in discord instead of opening an issue.
2020-12-15 11:39:34 +01:00
Giacomo 06fc61d7c5
Add custom windows runner (#162) 2020-12-11 11:18:18 +01:00
rakita 837e8b8725
Ancient target set. InvalidStateRoot bug (#69) (#149) 2020-12-10 17:57:26 +01:00
rakita ea3efd926e
TypedTransaction (EIP-2718) and Optional access list (EIP-2930) (#135) 2020-12-10 16:42:05 +01:00
rakita 3f01b69084
Fix broken doc comments (#151) 2020-12-09 12:43:32 +01:00
rakita 647ff31942
Add ws-max-paxload (#155) 2020-12-09 11:48:27 +01:00
rakita 56131b6d92
Trace comment on new block inclusion (#100) 2020-12-02 11:31:11 +01:00
rakita 51d824fbdc
Remove sscache (#138) 2020-12-01 16:40:06 +01:00
rakita 1225ff2c5a
Add flag to disable storage output in openethereum-evm tool #97 (#115) 2020-11-26 08:31:44 +01:00
adria0.eth cb91b7e828
Fix CI problems (#127)
* Temporally Fix CI compilation
2020-11-25 18:28:17 +01:00
Adria Massanet 233bab2ee7 Update linked-hash-map to 0.5.3 2020-11-24 18:11:29 +00:00
Lachezar Lechev fed80cc075
ethstore - remove unnecessary dir & tiny-keccak dependencies from the lib (#107)
* ethstore - remove unnecessary dir & tiny-keccak dependencies
2020-11-23 13:49:32 +01:00
Giacomo 26ab00b6c7
Fix deprecated set-env declaration (#106)
* Fix deprecated set-env declaration

* Fix add-path and set-env in install-sscache.ps1
2020-11-17 11:16:24 +01:00
Giacomo 01e72efb80 Feature/improve dockerhub deployment (#98)
* Add docker deployment for Github actions

* Add docker specs for the release of tagged and latest versions, also add specs for nightly builds

Co-authored-by: Denis Granha <denis@gnosis.pm>
2020-11-16 18:30:13 +01:00
adria0.eth 81ae80b7f1
EIP2565 impl (#82)
EIP2565 implementation
2020-11-12 14:31:24 +01:00
adria0.eth 910bb78f0d
Downgrade sccache to 1.1.2 (#93) 2020-11-12 12:57:35 +01:00
adria0.eth 6078eeaed7
EIP2929 with journaling + Yolov3 (#79) 2020-11-04 19:11:05 +01:00
rakita 50a4d5fa57
Sync block verification (#74)
* Synchronize block verification
* max_round_blocks_to_import set to 1
* Fixed test that rely on 12block batches

Co-authored-by: adria0.eth <5526331+adria0@users.noreply.github.com>
2020-10-27 10:45:48 +01:00
Adria Massanet 410853e280 Update gitactions for dev branch, deprecate stable branch 2020-10-26 09:27:44 +00:00
Denis Granha bf5830f766
revert actions/cache to version 1.1.2 (#80) 2020-10-23 22:59:18 +02:00
rakita d811f6e3ce
Use ubuntu-16.04 for glibc compatibility (#11888) (#73) 2020-10-23 10:43:18 +02:00
adria0.eth 9110b1d9e4
Update gitactions master->main (#72) 2020-10-12 10:55:21 +02:00
varasev cb0513a8b1
Add `wasmDisableTransition` spec option (#60)
* Add wasmDisableTransition spec option
2020-10-08 22:37:48 +02:00
adria0.eth 84f675021c
Fix warnings (#64) 2020-09-30 13:10:54 +02:00
rakita 03bfb012a1
Change wiki links (#68) 2020-09-30 13:10:18 +02:00
Denis Granha 16542bd355
fix CD env param 2020-09-29 13:04:59 +02:00
Giacomo 24cff45334
Set AWS_REGION as a global env variable (#67) 2020-09-28 17:07:36 +02:00
adria0.eth 51817baecd
Bump to 3.1rc1 (#58) 2020-09-25 10:49:22 +02:00
rakita 15ebc98877
Drain the transaction overlay (#11654) (#59) 2020-09-25 10:46:51 +02:00
claveros b6a25ba30a
Update CHANGELOG to 3.1 (#56)
* Update CHANGELOG.md

Backport 3.1 Changelog

* Update CHANGELOG.md

3.0.0, 3.0.1, 3.1 changelog

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Added 3.0.x changelog

Co-authored-by: draganrakita <dragan0rakita@gmail.com>
2020-09-24 17:36:53 +03:00
rakita abceaf3832
fix migration check when version_db file does no exist (#57) 2020-09-23 19:57:52 +02:00
rakita 25c2f7e7fd
Dont upgrade for old versions of DB (#54) 2020-09-23 13:49:25 +02:00
rakita 27a0142af1
OpenEthereum rebranding (#31) 2020-09-22 14:53:52 +02:00
adria0.eth 698fa6e8f6
Remove classic, kotti, mordor, expanse (#52) 2020-09-22 13:45:38 +02:00
rakita ae312bcb01
Added bad block header hash for ropsten (#49)
* Added bad block header hash for ropsten
2020-09-22 13:29:03 +02:00
Artem Vorotnikov d17ee979b8
Remove accounts bloom (#33) 2020-09-22 12:41:04 +02:00
draganrakita 4fb4ef6d24 Bump jsonrpc-* to v15 2020-09-21 16:11:29 +00:00
adria0.eth 1c82a0733f
Implement eth/64, remove eth/62 (#46)
Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
2020-09-21 14:48:14 +02:00
adria0.eth b54ddd027d
No snapshotting by default (#11814) 2020-09-15 17:51:49 +03:00
Artem Vorotnikov 61e56aba41
Update Ellaism chainspec 2020-09-15 17:34:51 +03:00
rakita aecc6fc862
Prometheus, heavy memory calls removed (#27) 2020-09-14 16:08:57 +02:00
adria0.eth dd38573a28
Update ethereum/tests 2020-09-10 09:04:14 +03:00
adria0.eth c84d82580a
Implement JSON test suite (#11801) 2020-09-10 05:54:38 +03:00
rakita 506cee52e8
Fix issues during block sync (#11265) 2020-09-10 05:54:37 +03:00
rakita c58b52c21c
verification: fix race same block (#11400) 2020-09-10 05:54:37 +03:00
adria0.eth f8326b6e27
EIP-2537: Precompile for BLS12-381 curve operations (#11707) 2020-09-10 05:54:37 +03:00
Artem Vorotnikov ea0c13c0a4
Remove private transactions 2020-09-10 05:54:37 +03:00
rakita a8668b371c
Remove GetNodeData 2020-09-10 05:54:36 +03:00
Artem Vorotnikov 32ea4d69a3
Remove IPFS integration (#11532) 2020-09-10 05:54:36 +03:00
Artem Vorotnikov defd24c40e
Remove updater 2020-09-10 05:54:36 +03:00
Artem Vorotnikov 194101ed00
Remove light client 2020-09-10 05:54:36 +03:00
Artem Vorotnikov 2ab8c72ce3
Correct internal par protocol nomenclature 2020-09-10 05:54:30 +03:00
Artem Vorotnikov a75ba3620c
Remove C and Java bindings (#11346) 2020-09-10 05:54:10 +03:00
Artem Vorotnikov 54afb33333
Remove whisper (#10855) 2020-09-10 05:53:41 +03:00
Artem Vorotnikov 3f42b6178f
Remove security audit workflow for now 2020-09-10 05:53:41 +03:00
adria0.eth 1460f6cc27
EIP-2315: Simple Subroutines for the EVM (#11629) 2020-09-10 05:53:41 +03:00
Artem Vorotnikov 751210c963
Remove deprecated flags 2020-09-10 05:53:41 +03:00
Artem Vorotnikov 7dfa57999b
Remove failing test 2020-09-10 05:53:41 +03:00
Artem Vorotnikov 11fb967c6a
Remove support for hardware wallets (#10678) 2020-09-10 05:53:29 +03:00
Artem Vorotnikov c270599a23
Fix warnings: other 2020-08-07 20:47:14 +03:00
adria0 412d0307cb
Fix warnings: try/? in whisper 2020-08-07 20:47:14 +03:00
adria0 33b5b36f44
Fix warnings: single tuples 2020-08-07 20:47:14 +03:00
adria0 ef7a82835a
Fix warnings: future name collisions 2020-08-07 20:47:14 +03:00
adria0 ac8f65dbbf
Fix warnings: iter 2020-08-07 20:47:13 +03:00
adria0 725073a683
Fix warnings: docs 2020-08-07 20:47:13 +03:00
adria0 c5aed5bab1
Fix warnings: unnecessary mut 2020-08-07 20:47:13 +03:00
adria0 cacbf256fe
Fix warnings: unused 2020-08-07 20:47:13 +03:00
adria0 0cd972326c
Fix warnings: mem::uninitialized 2020-08-07 20:47:13 +03:00
adria0 239cf91594
Fix warnings: range patterns 2020-08-07 20:47:13 +03:00
adria0 1700873f48
Fix warnings: dyn 2020-08-07 20:47:12 +03:00
adria0 4adb44155d
Update bootnodes 2020-08-07 20:47:12 +03:00
adria0 82b37bfa0d
Add github actions 2020-08-07 20:47:12 +03:00
adria0 544725a018
Fix compilation errors 2020-08-07 20:47:12 +03:00
Artem Vorotnikov 26e253e554
Ignore reformat commit in git blame 2020-08-07 20:47:09 +03:00
Artem Vorotnikov 610d9baba4
Reformat the source code 2020-08-07 20:46:52 +03:00
s3krit 253ff3f37b
Update version and changelog (#11360) 2019-12-31 00:47:57 +01:00
Tomasz Drwięga 54c2d6167f Make sure to not mark block header hash as invalid if only the body is wrong. (#11356)
* Patch invalid transaction root.

* Add raw hash to bad and include fix for uncles too.

* Fix submodules.
2019-12-30 13:15:11 -08:00
David 29ebddc64f V2.5.12 stable (#11336)
* Enable EIP-2384 for ice age hard fork (#11281)
* ethcore/res: activate agharta on classic 9573000 (#11331)
* Istanbul HF in xDai (2019-12-12) (#11299)
* Istanbul HF in POA Core (2019-12-19) (#11298)
* Istanbul HF in POA Sokol (2019-12-05) (#11282)
* Activate ecip-1061 on kotti and mordor (#11338)
* Enable basic verification of local transactions (#11332)
* Disallow EIP-86 style null signatures for transactions outside tests (#11335)
2019-12-16 14:53:34 +01:00
Niklas Adolfsson fc129b4a26 [stable backport]: add `eip1344_transition` for istanbul (#11301) (#11303)
* [chainspec]: add `eip1344_transition` for istanbul (#11301)

* Update version and CHANGELOG.md
2019-12-05 14:11:55 +01:00
s3krit a071d81fe9
update CHANGELOG.md (#11263) 2019-11-14 17:42:49 +01:00
Denis S. Soldatov aka General-Beck 9f94473eaf `sccache --stop-server -> sccache --show-stats` (#11255) 2019-11-12 18:23:08 +01:00
s3krit 42437fbc57
fix windows libusb builds (#11251)
* fix libusb on Windows
2019-11-12 16:52:34 +01:00
Talha Cross f3cdd7bf21 v2.5.10 stable (#11239)
* ropsten #6631425 foundation #8798209 (#11201)
* [stable] builtin, istanbul and mordor testnet backports (#11234)
  * ethcore-builtin (#10850)
  * [builtin]: support `multiple prices and activations` in chain spec (#11039)
  * [chain specs]: activate `Istanbul` on mainnet (#11228)
  * ethcore/res: add mordor testnet configuration (#11200)
* Update list of bootnodes for xDai chain (#11236)
* ethcore: remove `test-helper feat` from build (#11047)
* Secret store: fix Instant::now() related race in net_keep_alive (#11155) (#11159)
* [stable]: backport #10691 and #10683 (#11143)
  * Fix compiler warning (that will become an error) (#10683)
  * Refactor Clique stepping (#10691)
* Add Constantinople eips to the dev (instant_seal) config (#10809)
* Add cargo-remote dir to .gitignore (?)
* Insert explicit warning into the panic hook (#11225)
* Fix docker centos build (#11226)
* Update MIX bootnodes. (#11203)
* Use provided usd-per-eth value if an endpoint is specified (#11209)
* Add new line after writing block to hex file. (#10984)
* Type annotation for next_key() matching of json filter options (#11192) (but no `FilterOption` in 2.5 so…)
* Upgrade jsonrpc to latest (#11206)
* [CI] check evmbin build (#11096)
* Correct EIP-712 encoding (#11092)
* [client]: Fix for incorrectly dropped consensus messages (#11086)
* Fix block detail updating (#11015)
* Switching sccache from local to Redis (#10971)
* Made ecrecover implementation trait public (#11188)
* [dependencies]: jsonrpc `14.0.1` (#11183)
* [receipt]: add `sender` & `receiver` to `RichReceipts` (#11179)
* [ethcore/builtin]: do not panic in blake2pricer on short input (#11180)
* util Host: fix a double Read Lock bug in fn Host::session_readable() (#11175)
* ethcore client: fix a double Read Lock bug in fn Client::logs() (#11172)
* Change how RPCs eth_call and eth_estimateGas handle "Pending" (#11127)
* Cleanup stratum a bit (#11161)
* Upgrade to jsonrpc v14 (#11151)
* SecretStore: expose restore_key_public in HTTP API (#10241)
2019-11-11 21:57:38 +01:00
Niklas Adolfsson 5ee54b7298 [stable]: backports (#11114)
* [spec] fix rinkeby spec (#11108)

* use images from our registry (#11105)
2019-10-02 12:23:20 +02:00
s3krit 06c7096054
Update CHANGELOG.md and version (#11093)
* Update CHANGELOG.md and version
2019-09-26 12:38:49 +02:00
s3krit b2277f65e4
v2.5.9-stable (#11089)
* ethcore/res: activate Istanbul on Ropsten, Görli, Rinkeby, Kovan (#11068)

* ethcore/res: activate Istanbul on Ropsten block 6485846

* ethcore/res: activate Istanbul on Goerli block 1561651

* ethcore/res: use hex values for Istanbul specs

* ethcore/res: fix trailing comma

* ethcore/res: be pedantic about EIP-1283 in Petersburg and Istanbul test specs

* ethcore/res: activate Istanbul on Rinkeby block 5435345

* ethcore/res: activate Istanbul on Kovan block 14111141

* ethcore/res: fix kovan istanbul number to 0xd751a5

* [json-spec] make blake2 pricing spec more readable (#11034)

* [json-spec] make blake2 pricing spec more readable

* [ethcore] fix compilation

* Manual backport of #11033
2019-09-26 11:03:39 +02:00
s3krit c52a6c8fb7
update CHANGELOG.md (#11057) 2019-09-16 12:00:04 +02:00
s3krit 7c7b181ca0
v2.5.8-stable (rev2) (#11051)
* EIP 1884 Re-pricing of trie-size dependent operations  (#10992)
* Implement EIP-1283 reenable transition, EIP-1706 and EIP-2200  (#10191)
2019-09-13 15:46:03 +02:00
David 24a4fdf405
Don't build rpc with ethcore test-helpers (#11048) 2019-09-13 11:53:49 +02:00
s3krit 45f27cec34
v2.5.8-stable (#11041)
* add more tx tests (#11038)
* Fix parallel transactions race-condition (#10995)
* Add blake2_f precompile (#11017)
* [trace] introduce trace failed to Ext (#11019)
* Edit publish-onchain.sh to use https (#11016)
* Fix deadlock in network-devp2p (#11013)
* EIP 1108: Reduce alt_bn128 precompile gas costs (#11008)
* xDai chain support and nodes list update (#10989)
* EIP 2028: transaction gas lowered from 68 to 16 (#10987)
* EIP-1344 Add CHAINID op-code (#10983)
* manual publish jobs for releases, no changes for nightlies (#10977)
* [blooms-db] Fix benchmarks (#10974)
* Verify transaction against its block during import (#10954)
* Better error message for rpc gas price errors (#10931)
* tx-pool: accept local tx with higher gas price when pool full (#10901)
* Fix fork choice (#10837)
* Cleanup unused vm dependencies (#10787)
* Fix compilation on recent nightlies (#10991)
2019-09-12 18:43:53 +02:00
s3krit 6bd7db96fe
v2.5.7 stable (#11006)
* [trace] check mem diff within range (#11002)

* Update version (v2.5.7-stable)
2019-08-29 12:06:49 +02:00
s3krit ff398fe7ff
V2.5.6 stable (#10961)
-  Fix cargo audit (#10921)
  - Add support for Energy Web Foundation's new chains (#10957)
  - Kaspersky AV whitelisting (#10919)
  - Avast whitelist script (#10900)
  - Docker images renaming (#10863)
  - Remove excessive warning (#10831)
  - Allow --nat extip:your.host.here.org (#10830)
  - When updating the client or when called from RPC, sleep should mean sleep (#10814)
  - added new ropsten-bootnode and removed old one (#10794)
  - ethkey no longer uses byteorder (#10786)
  - Do not drop the peer with None difficulty (#10772)
  - docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions (#10652)
2019-08-12 18:55:11 +02:00
s3krit 3ebc769757
version: stabilise v2.5 (#10857) 2019-07-08 12:30:14 +02:00
s3krit d60e6384d7
Beta 2.5.4 (#10827)
* cargo update -p smallvec (#10822)

Fixes https://github.com/servo/rust-smallvec/issues/148

* Update version to v2.5.3

Signed-off-by: Martin Pugh <pugh@s3kr.it>
2019-07-01 12:33:35 +02:00
s3krit 3fd58bdcbd
Beta 2.5.3 (#10776)
* ethcore/res: activate atlantis classic hf on block 8772000 (#10766)

* fix docker tags for publishing (#10741)

* fix: aura don't add `SystemTime::now()` (#10720)

This commit does the following:
- Prevent overflow in `verify_timestamp()` by not adding `now` to found faulty timestamp
- Use explicit `CheckedSystemTime::checked_add` to prevent potential consensus issues because SystemTime is platform
depedent
- remove `#[cfg(not(time_checked_add))]` conditional compilation

* Update version

* Treat empty account the same as non-exist accounts in EIP-1052 (#10775)

* DevP2p: Get node IP address and udp port from Socket, if not included in PING packet (#10705)

* get node IP address and udp port from Socket, if not included in PING packet

* prevent bootnodes from being added to host nodes

* code corrections

* code corrections

* code corrections

* code corrections

* docs

* code corrections

* code corrections

* Apply suggestions from code review

Co-Authored-By: David <dvdplm@gmail.com>

* Add a way to signal shutdown to snapshotting threads (#10744)

* Add a way to signal shutdown to snapshotting threads

* Pass Progress to fat_rlps() so we can abort from there too.

* Checking for abort in a single spot

* Remove nightly-only weak/strong counts

* fix warning

* Fix tests

* Add dummy impl to abort snapshots

* Add another dummy impl for TestSnapshotService

* Remove debugging code

* Return error instead of the odd Ok(())
Switch to AtomicU64

* revert .as_bytes() change

* fix build

* fix build maybe
2019-06-25 13:38:29 +00:00
Talha Cross ecbafb2390
backports for beta 2.5.2 (#10737)
* version: bump beta to 2.5.2

* [CI] allow cargo audit to fail (#10676)

* [CI] allow cargo audit to fail

* [.gitlab-ci.yml] add a comment about cargo audit

* [Cargo.lock] cargo update -p protobuf

* Reset blockchain properly (#10669)

* delete BlockDetails from COL_EXTRA

* better proofs

* added tests

* PR suggestions

* new image (#10673)

* Update publishing (#10644)

* docker images are now built on k8s: test run

* copy check_sync.sh in build-linux job

* copy scripts/docker/hub/* in build-linux job

* removed cache var

* cleanup, no more nightly dockers

* cleanup in dockerfile

* some new tags

* removed sccsche debug log, cleanup

* no_gits, new artifacts dir, changed scripts. Test run.

* define version once

* one source for TRACK

* stop kovan onchain updates

* moved changes for two images to a new branch

* rename Dockerfile

* no need in libudev-dev

* enable lto for release builds (#10717)

* Use RUSTFLAGS to set the optimization level (#10719)

* Use RUSTFLAGS to set the optimization level

Cargo has a [quirk]() in how configuration settings are propagated when `cargo test` runs: local code respect the settings in `[profile.test]` but all dependencies use the `[profile.dev]` settings. Here we force `opt-level=3` for all dependencies.

* Remove unused profile settings

* Maybe like this?

* Turn off incremental compilation

* Remove colors; try again with overflow-checks on

* Use quiet CI machine

* Turn overflow checking back on

* Be explicit about what options we use

* Remove "quiet machine" override

* ethcore: enable ECIP-1054 for classic (#10731)

* config: enable atlantis on ethereum classic

* config: enable atlantis on morden classic

* config: enable atlantis on morden classic

* config: enable atlantis on kotti classic

* ethcore: move kotti fork block to 0xAEF49

* ethcore: move morden fork block to 0x4829BA

* ethcore: move classic fork block to 0x81B320

* remove trailing comma

* remove trailing comma

* fix chainspec

* ethcore: move classic fork block to 0x7fffffffffffffff
2019-06-11 20:56:03 +02:00
Talha Cross adabd8198c
beta ci: backport missing diff from master (#10661)
* ci: publish docs debug (#10638)

* ci: backport missing diff from master
2019-05-14 15:03:29 +02:00
Talha Cross c2487cfe07
ci: publish docs debug (#10638) (#10660) 2019-05-14 14:04:54 +02:00
Talha Cross e0141f8324
beta 2.5.1 (#10643)
* version: bump beta to 2.5.1

* fix(whisper expiry): current time + work + ttl (#10587)

* update bootnodes (#10595)

* config: update goerli bootnodes

* config: update kotti bootnodes

* adds rpc error message for --no-ancient-blocks (#10608)

* adds error message for --no-ancient-blocks, closes #10261

* Apply suggestions from code review

Co-Authored-By: seunlanlege <seunlanlege@gmail.com>

* Constantinople HF on POA Core (#10606)

* Constantinople HF on POA Core

Plan Constantinople/St.Petersfork HF on POA Core network at block 8582254.
Original PR in POA repository: https://github.com/poanetwork/poa-chain-spec/pull/110

* Remove extra empty line

* evm: add some mulmod benches (#10600)

* evm: add blockhash_mulmod bench

* evm: use num-bigint for mod ops

* Clique: zero-fill extradata when the supplied value is less than 32 bytes in length (#10605)

* Update kovan.json to switch validator set to POA Consensus Contracts (#10628)

* Fix publish docs (#10635)

* Fix publish docs

* this never should be forced, either way compiling previous versions will produce outdated docs

* fix array, var was moved to the group project global variables list

* Fix rinkeby petersburg fork (#10632)
2019-05-10 13:48:52 +02:00
Talha Cross b52ac20660
beta backports (#10576)
* Reject crazy timestamps instead of truncating.

* fix(light cull): poll light cull instead of timer (#10559)

* fix(light cull): poll light cull instead of timer

* fix(grumbles): remove error + updated docs

* fix(on-demand request): `expect()` reason

* docs(remove misleading info)
2019-04-08 11:44:10 +02:00
soc1c 3c85f29f11
version: betalize 2.5 2019-04-02 09:37:43 +02:00
Andrew Jones d9673b0d6b tx-pool: check transaction readiness before replacing (#10526)
* Update to vanilla tx pool error

* Prevent a non ready tx replacing a ready tx

* Make tests compile

* Test ready tx not replaced by future tx

* Transaction indirection

* Use StateReadiness to calculate Ready in `should_replace`

* Test existing txs from same sender are used to compute Readiness

* private-tx: Wire up ShouldReplace

* Revert "Use StateReadiness to calculate Ready in `should_replace`"

This reverts commit af9e69c8

* Make replace generic so it works with private-tx

* Rename Replace and add missing docs

* ShouldReplace no longer mutable

* tx-pool: update to transaction-pool 2.0 from crates.io

* tx-pool: generic error type alias

* Exit early for first unmatching nonce

* Fix private-tx test, use existing write lock

* Use read lock for pool scoring
2019-04-01 10:48:51 +02:00
Niklas Adolfsson 89f828be1c fix(light account response): update `tx_queue` (#10545) 2019-03-31 11:54:19 +02:00
Thibaut Sardan ec56b1f09d Update light client harcoded headers (#10547)
* kovan #10643457

* ropsten #5296129

* foundation #7460865

* classic #7747585

* indentation

* morden #3973121
2019-03-31 11:46:36 +02:00
Niklas Adolfsson 95236d25b2 fix(light eth_gasPrice): ask network if not in cache (#10535)
* fix(light eth_gasPrice): ask N/W if not in cache

* fix(bad rebase)
2019-03-31 10:40:33 +02:00
Vladyslav Lupashevskyi 7b2afdfc8c Implement caching for service transactions checker (#10088)
* Tx permission contract improvement

* Take in account zero gas price certification when doing transact_contract

* DRY in ServiceTransactionChecker

* Fix typos and regroup mod

* Introduce CertifiedAddressesCache

* Introduce refresh_cache for CertifiedAddressesCache

* Add CertifiedAddressesCache read and write on checking

* Refresh CertifiedAddressesCache on new imported block

* Separate ChainInfo trait and fix errors after merge

* Do not fire an error when service txes contract does not exist

* WIP: Shared certified addresses cache between miner and client + use HashMap instead of BTreeMap

* Refactor refresh_cache for ServiceTransactionChecker

* Refresh cache fixes

* Add cache read in check_address + log when cache is used + improve code

* Remove ChainInfo from ServiceTransaction dependencies

* DRY ServiceTransactionChecker

* Fix Client and Miner in tests

* Fix node_filter test

* Fix Client::new in add_peer_with_private_config

* WIP: Separated ChainNotify from ethcore trait and implemented ChainNotify for ServiceTransactionChecker

* Fix watcher test

* Revert "Merge branch 'master' into master"

This reverts commit 4e7371dc109d022efe3087defc33d827998ce648, reversing
changes made to bffd73e5fd58a516bbf404281b51cf26422e181e.

* Revert "Fix watcher test"

This reverts commit bffd73e5fd58a516bbf404281b51cf26422e181e.

* Revert "WIP: Separated ChainNotify from ethcore trait and implemented ChainNotify for ServiceTransactionChecker"

This reverts commit 6e73d1e61fa15dc10ffd4fab63df29eabe9c3b3a.

* Revert "Fix Client::new in add_peer_with_private_config"

This reverts commit ec610a30bee95588d58b79edcc9e43c2ff90f1ad.

* Revert "Fix node_filter test"

This reverts commit 06a4b2de86317c902f579e912b40de0b0fbf6d78.

* Revert "Fix Client and Miner in tests"

This reverts commit 51bbad330ea6e7bdfc1516208cc8705d5d11516d.

* Implement ServiceTransactionChecker in miner and delegate it to client + revert unnecessary changes

* Merge master

* Code improvements

* Merge branch 'master' of https://github.com/paritytech/parity-ethereum

# Conflicts:
#	Cargo.lock
#	ethcore/private-tx/src/lib.rs
#	ethcore/src/miner/miner.rs
#	ethcore/src/miner/pool_client.rs
2019-03-31 10:39:38 +02:00
TriplEight 440e52f410 build android with cache, win fixes (#10546)
* build android with cache!

* windows fixes

* windows fixes 2

* windows fixes 3

* windows fixes 4

* windows should have sccache variables in env variables
2019-03-30 20:29:08 +01:00
jwasinger 8840a293dd clique: make state backfill time measurement more accurate (#10551) 2019-03-30 20:28:32 +01:00
Marek Kotewicz 89d627769e updated lru-cache to 0.1.2 (#10542) 2019-03-29 12:25:15 +00:00
TriplEight 4e2e88a620
separate docker image to build docs (#10543) 2019-03-28 17:19:00 +01:00
Niklas Adolfsson ebf51c0be0 fix(bump dependencies) (#10540)
* cargo update -p log:0.4.5

* cargo update -p regex:1.0.5

* cargo update -p parking_lot

* cargo update -p serde_derive

* cargo update -p serde_json

* cargo update -p serde

* cargo update -p lazy_static

* cargo update -p num_cpus

* cargo update -p toml
2019-03-28 15:31:06 +00:00
Wei Tang 04c6867660 Fix max_gas (#10537)
Fix max_gas
2019-03-27 15:53:06 -04:00
soc1c 0199acbece
ethcore: remove eth social and easthub chain configs (#10531) 2019-03-27 15:07:38 +01:00
Denis S. Soldatov aka General-Beck e4c2fe9e72 Initial support sccache for windows build (#10520)
* Initial support sccache for win build

* show sccache stats

* cache paths for shared runners

* sccache status is in the script.

* removed windows test for now
2019-03-27 14:47:08 +01:00
Niklas Adolfsson 407de5e8c4 fix(light): make `OnDemand` generic instead of using the concrete type (#10514)
* ethcore: add clique engine (#9981)

* fix broken sync

* correct seal fields

* ethcore: fix comment

* parity: remove duplicate params

* clique: fix whitespaces

* ethcore: fix goerli chain spec

* refactor signer_snapshot into pending/finalized state

* move close_block_extra_data after seal is applied

* refactor most of the logic into the signer_snapshot

* clique: refactor locking logic out of the consensus engine interface

* Fix jsonspec and add an unittest

* Replace space with tabs

* Unbroke sync

* Fix broken sync

* 1/2 state tracking without votes

* 2/2 implement vote tracking

* ci: use travis for goerli

* ci: setup a clique network

* ci: sync a görli node

* add clique deploy script

* ci: fix paths in clique deploy script

* ci: use docker compose

* ci: fix travis job names

* ci: fix build deps

* ci: massively reduce tests

* Revert "ci: massively reduce tests"

This reverts commit 6369f0b069ed2607a7e9f2e1d85489bacdc43384.

* ci: run cargo test directly

* ci: separate build and test stages

* ci: cache rust installation

* ci: simplify ci stages

* ci: make clique deploy script executable

* ci: shutdown goerli sync after 20min

* ci: remove slow sync stage

* ci: use timeout to finish jobs

* ci: fix build path

* ci: use absolute paths to end this confusion

* ci: add geth and parity to path

* ci: be more verbose

* ci: allow for more relaxed caching timeout

* ci: update repositories for custom ppa

* ci: fix typo in file name

* ci: fix docker compose file

* ci: add ethkey to docker

* ci: make sure deploy script is up to date with upstream

* ci: stop docker container after certain time

* ci: force superuser to update permissions on docker files

* ci: reduce run time of script to ~30 min

* ci: remove duplicate caching in travis

* remove trace statements

* clique: add more validation involving the recent signer list

* ethcore: enable constantinople for rinkeby

* ethcore: fix whitespaces in rinkeby spec

* ethcore: reformat goerli.json

* Revert "ci: remove duplicate caching in travis"

This reverts commit a562838d3d194d37f9871dcbe00b783637978f89.

* tmp commit

* another tmp commit

* it builds!

* add sealing capabilities

* add seal_header hook to allow separation of block seal/importing code paths

* clique: remove populate_from_parent.

* add panic

* make turn delay random

* initialize OpenBlock properly in 'enact'

* misc: remove duplicate lines

* misc: fix license headers

* misc: convert spaces to tabs

* misc: fix tabs

* Update Cargo.toml

* Update Cargo.toml

* Update Cargo.toml

* clique: ensure validator restores state before trying to seal

* clique: make 'state' return an Error.  Make some error messages more clear

* Fix compile error after rebase & toolchain upgrade

* fix a bunch of import warnings

* Refactor code

* Fix permissions

* Refactoring syncing

* Implement full validator checks

* Refactor util functions to seperate file

* mining 1

* ethcore: add chainspec for kotti

* ethcore: rename pre-goerli configs

* ethcore: load kotti chain spec

* cli: add kotti to params

* Implement working local sealing

* making sealing & syncing work together

* Relax timestamp checking

* ethcore: prepare for the real goerli to launch

* Implement NOTURN wiggle properly & cleanupnup warnings

* Implement vote casting

* Update docs & skip signing if no signer

* Optimize step-service interval

* Record state on local sealed block

* Fix script filemode

* Cleaning up codebase

* restore enact trace logging

* Delete clique.sh and move sync.sh

* remove travis.yml

* Remove dead code

* Cleanup compile warning

* address review comments

* adding more comments and removing unwrap()

* ci: remove sync script

* Address review comments

* fix compile error

* adding better debugging for timing

* Implement an dedicated thread for sealing timing

* fix(add helper for timestamp overflows) (#10330)

* fix(add helper timestamp overflows)

* fix(simplify code)

* fix(make helper private)

* snap: official image / test (#10168)

* official image / test

* fix / test

* bit more necromancy

* fix paths

* add source bin/df /test

* add source bin/df /test2

* something w paths /test

* something w paths /test

* add source-type /test

* show paths /test

* copy plugin /test

* plugin -> nil

* install rhash

* no questions while installing rhash

* publish snap only for release

* fix(docker): fix not receives SIGINT (#10059)

* fix(docker): fix not receives SIGINT

* fix: update with reviews

* update with review

* update

* update

* Don't add discovery initiators to the node table (#10305)

* Don't add discovery initiators to the node table

* Use enums for tracking state of the nodes in discovery

* Dont try to ping ourselves

* Fix minor nits

* Update timeouts when observing an outdated node

* Extracted update_bucket_record from update_node

* Fixed typo

* Fix two final nits from @todr

* change docker image based on debian instead of ubuntu due to the chan… (#10336)

* change docker image based on debian instead of ubuntu due to the changes of the build container

* role back docker build image and docker deploy image to ubuntu:xenial based (#10338)

* Bundle protocol and packet_id together in chain sync (#10315)

Define a new `enum` where devp2p subprotocol packet ids (currently eth and par) are defined. Additionally provide functionality to query id value and protocol of a given id object.

* snap: prefix version and populate candidate channel (#10343)

* snap: populate candidate releases with beta snaps to avoid stale channel

* snap: prefix version with v*

* addressing review comments

* engine: fix copyright header

* scripts: restore permissions on sign command

* ethcore: enforce tabs

* ethcore: enforce tabs

* ethcore: enforce tabs

* addressing comments

* addressing comments

* addressing more comments

* addressing more comments

* addressing more comments

* addressing more comments

* addressing more comments

* json-spec: fix clique epoch to non-zero u64

* ci: enable travis for parity goerli

* ci: don't separate build and test step

* ci: don't run c++ tests on travis

* ci: simplify cargo test to squeeze into travis timeout

* ci: don't run tests on travis at all

* style(fixes)

* fix(add tests)

* fix(recent_signer bug)

* fix(complete all tests)

* fix(nits)

* fix(simplify asserts)

* fix(cliqueState): simplify code

* fix(nits)

* docs(comments what's need to fixed)

* fix(revert unintended changes)

* fix(tests)

* fix(logs): voting logs

* fix(readability + more logs)

* fix(sync)

* docs(add missing licens header)

* fix(log): info! -> trace!

* docs(fix nits) + fix(remove assert)

* perf(use counter instead of vec)

* fix(remove needless block in match)

* fix(faulty comment)

* grumbles(docs for tests)

* fix(nits)

* fix(revert_vote): only remove vote when votes == 0

* fix(vote counter): checked arithmetics

* fix(simplify tests)

* fix(nits)

* fix(clique): err types

* fix(clique utils): make use of errors

* fix(cleanup nits)

* fix(clique sealing): don't read state no signer

* fix(replace Vec<Signers> with BTreeSet<Signers>)

* fix(tests): BTreeSet and more generic helpers

* fix(nits)

* fix(ethcore_block_seal): remove needless `Box`

* fix(faulty log): info -> trace

* fix(checked SystemTime): prevent SystemTime panics

* style(chain cfg): space after `:`

* style(fn enact): fix whitespace

* docs(clique): StepService

* docs(nit): fix faulty comment

* docs(fix typo)

* style(fix bad indentation)

* fix(bad regex match)

* grumble(on_seal_block): make `&mut` to avoid clone

* docs(on_seal_block): fix faulty documentation

* Delete .travis.yml

* docs: remove eth hf references in spec

* Update client.rs

* fix(nits)

* fix(clique step): `RwLock` -> `AtomicBool`

* fix(clique): use `Duration::as_millis`

* Clean up some Clique documentation

* Add trace information to eth_estimateGas (#10519)

* Add trace information to eth_estimateGas

* replace unwrap better version

* change vm::Error formatter to more user-friendly

* remove extra error format

* use map_or instead sequence of map/unwrap_or

* fix(light/on_demand): extract as a trait

* fix(grumble): OnDemand remove needless trait bound
2019-03-27 14:46:20 +01:00
Andrew Jones 7d26a82232 private-tx: replace error_chain (#10510)
* Update to vanilla tx pool error

* private-tx: remove error-chain, implement Error, derive Display

* private-tx: replace ErrorKind and bail!

* private-tx: add missing From impls and other compiler errors

* private-tx: use original tx-pool error

* Don't be silly cargo
2019-03-27 14:46:05 +01:00
Kirill Fomichev 3b23817936
Add trace information to eth_estimateGas (#10519)
* Add trace information to eth_estimateGas

* replace unwrap better version

* change vm::Error formatter to more user-friendly

* remove extra error format

* use map_or instead sequence of map/unwrap_or
2019-03-27 14:21:08 +01:00
5chdn aa8487c1d0
ethcore: add clique engine (#9981)
* fix broken sync

* correct seal fields

* ethcore: fix comment

* parity: remove duplicate params

* clique: fix whitespaces

* ethcore: fix goerli chain spec

* refactor signer_snapshot into pending/finalized state

* move close_block_extra_data after seal is applied

* refactor most of the logic into the signer_snapshot

* clique: refactor locking logic out of the consensus engine interface

* Fix jsonspec and add an unittest

* Replace space with tabs

* Unbroke sync

* Fix broken sync

* 1/2 state tracking without votes

* 2/2 implement vote tracking

* ci: use travis for goerli

* ci: setup a clique network

* ci: sync a görli node

* add clique deploy script

* ci: fix paths in clique deploy script

* ci: use docker compose

* ci: fix travis job names

* ci: fix build deps

* ci: massively reduce tests

* Revert "ci: massively reduce tests"

This reverts commit 6369f0b069ed2607a7e9f2e1d85489bacdc43384.

* ci: run cargo test directly

* ci: separate build and test stages

* ci: cache rust installation

* ci: simplify ci stages

* ci: make clique deploy script executable

* ci: shutdown goerli sync after 20min

* ci: remove slow sync stage

* ci: use timeout to finish jobs

* ci: fix build path

* ci: use absolute paths to end this confusion

* ci: add geth and parity to path

* ci: be more verbose

* ci: allow for more relaxed caching timeout

* ci: update repositories for custom ppa

* ci: fix typo in file name

* ci: fix docker compose file

* ci: add ethkey to docker

* ci: make sure deploy script is up to date with upstream

* ci: stop docker container after certain time

* ci: force superuser to update permissions on docker files

* ci: reduce run time of script to ~30 min

* ci: remove duplicate caching in travis

* remove trace statements

* clique: add more validation involving the recent signer list

* ethcore: enable constantinople for rinkeby

* ethcore: fix whitespaces in rinkeby spec

* ethcore: reformat goerli.json

* Revert "ci: remove duplicate caching in travis"

This reverts commit a562838d3d194d37f9871dcbe00b783637978f89.

* tmp commit

* another tmp commit

* it builds!

* add sealing capabilities

* add seal_header hook to allow separation of block seal/importing code paths

* clique: remove populate_from_parent.

* add panic

* make turn delay random

* initialize OpenBlock properly in 'enact'

* misc: remove duplicate lines

* misc: fix license headers

* misc: convert spaces to tabs

* misc: fix tabs

* Update Cargo.toml

* Update Cargo.toml

* Update Cargo.toml

* clique: ensure validator restores state before trying to seal

* clique: make 'state' return an Error.  Make some error messages more clear

* Fix compile error after rebase & toolchain upgrade

* fix a bunch of import warnings

* Refactor code

* Fix permissions

* Refactoring syncing

* Implement full validator checks

* Refactor util functions to seperate file

* mining 1

* ethcore: add chainspec for kotti

* ethcore: rename pre-goerli configs

* ethcore: load kotti chain spec

* cli: add kotti to params

* Implement working local sealing

* making sealing & syncing work together

* Relax timestamp checking

* ethcore: prepare for the real goerli to launch

* Implement NOTURN wiggle properly & cleanupnup warnings

* Implement vote casting

* Update docs & skip signing if no signer

* Optimize step-service interval

* Record state on local sealed block

* Fix script filemode

* Cleaning up codebase

* restore enact trace logging

* Delete clique.sh and move sync.sh

* remove travis.yml

* Remove dead code

* Cleanup compile warning

* address review comments

* adding more comments and removing unwrap()

* ci: remove sync script

* Address review comments

* fix compile error

* adding better debugging for timing

* Implement an dedicated thread for sealing timing

* fix(add helper for timestamp overflows) (#10330)

* fix(add helper timestamp overflows)

* fix(simplify code)

* fix(make helper private)

* snap: official image / test (#10168)

* official image / test

* fix / test

* bit more necromancy

* fix paths

* add source bin/df /test

* add source bin/df /test2

* something w paths /test

* something w paths /test

* add source-type /test

* show paths /test

* copy plugin /test

* plugin -> nil

* install rhash

* no questions while installing rhash

* publish snap only for release

* fix(docker): fix not receives SIGINT (#10059)

* fix(docker): fix not receives SIGINT

* fix: update with reviews

* update with review

* update

* update

* Don't add discovery initiators to the node table (#10305)

* Don't add discovery initiators to the node table

* Use enums for tracking state of the nodes in discovery

* Dont try to ping ourselves

* Fix minor nits

* Update timeouts when observing an outdated node

* Extracted update_bucket_record from update_node

* Fixed typo

* Fix two final nits from @todr

* change docker image based on debian instead of ubuntu due to the chan… (#10336)

* change docker image based on debian instead of ubuntu due to the changes of the build container

* role back docker build image and docker deploy image to ubuntu:xenial based (#10338)

* Bundle protocol and packet_id together in chain sync (#10315)

Define a new `enum` where devp2p subprotocol packet ids (currently eth and par) are defined. Additionally provide functionality to query id value and protocol of a given id object.

* snap: prefix version and populate candidate channel (#10343)

* snap: populate candidate releases with beta snaps to avoid stale channel

* snap: prefix version with v*

* addressing review comments

* engine: fix copyright header

* scripts: restore permissions on sign command

* ethcore: enforce tabs

* ethcore: enforce tabs

* ethcore: enforce tabs

* addressing comments

* addressing comments

* addressing more comments

* addressing more comments

* addressing more comments

* addressing more comments

* addressing more comments

* json-spec: fix clique epoch to non-zero u64

* ci: enable travis for parity goerli

* ci: don't separate build and test step

* ci: don't run c++ tests on travis

* ci: simplify cargo test to squeeze into travis timeout

* ci: don't run tests on travis at all

* style(fixes)

* fix(add tests)

* fix(recent_signer bug)

* fix(complete all tests)

* fix(nits)

* fix(simplify asserts)

* fix(cliqueState): simplify code

* fix(nits)

* docs(comments what's need to fixed)

* fix(revert unintended changes)

* fix(tests)

* fix(logs): voting logs

* fix(readability + more logs)

* fix(sync)

* docs(add missing licens header)

* fix(log): info! -> trace!

* docs(fix nits) + fix(remove assert)

* perf(use counter instead of vec)

* fix(remove needless block in match)

* fix(faulty comment)

* grumbles(docs for tests)

* fix(nits)

* fix(revert_vote): only remove vote when votes == 0

* fix(vote counter): checked arithmetics

* fix(simplify tests)

* fix(nits)

* fix(clique): err types

* fix(clique utils): make use of errors

* fix(cleanup nits)

* fix(clique sealing): don't read state no signer

* fix(replace Vec<Signers> with BTreeSet<Signers>)

* fix(tests): BTreeSet and more generic helpers

* fix(nits)

* fix(ethcore_block_seal): remove needless `Box`

* fix(faulty log): info -> trace

* fix(checked SystemTime): prevent SystemTime panics

* style(chain cfg): space after `:`

* style(fn enact): fix whitespace

* docs(clique): StepService

* docs(nit): fix faulty comment

* docs(fix typo)

* style(fix bad indentation)

* fix(bad regex match)

* grumble(on_seal_block): make `&mut` to avoid clone

* docs(on_seal_block): fix faulty documentation

* Delete .travis.yml

* docs: remove eth hf references in spec

* Update client.rs

* fix(nits)

* fix(clique step): `RwLock` -> `AtomicBool`

* fix(clique): use `Duration::as_millis`

* Clean up some Clique documentation

Co-authored-by: soc1c <soc1c@users.noreply.github.com>
Co-authored-by: HCastano <HCastano@users.noreply.github.com>
Co-authored-by: niklasad1 <niklasad1@users.noreply.github.com>
Co-authored-by: jwasinger <jwasinger@users.noreply.github.com>
Co-authored-by: ChainSafe <ChainSafe@users.noreply.github.com>
Co-authored-by: thefallentree <thefallentree@users.noreply.github.com>
Co-authored-by: 5chdn <5chdn@users.noreply.github.com>
2019-03-27 14:13:24 +01:00
TriplEight 9cb8606103
verbose flag for cpp tests (#10524) 2019-03-26 12:37:45 +01:00
Hernando Castano 6cf3ba7efd
Add a more realistic Batch test (#10511)
* Remove unrealistic tests

* Add test that more closely resembles real usage
2019-03-25 10:42:33 +01:00
Sočik 023e511f83 docs: add changelogs for 2.3.{6,7,8} and 2.4.{1,2,3} (#10494)
* docs: add changelogs for 2.3.{6,7} and 2.4.{1,2}

* docs: add changelogs for 2.4.3 beta and 2.3.8 stable

* Update docs/CHANGELOG-2.3.md

Co-Authored-By: soc1c <47772477+soc1c@users.noreply.github.com>

* Update docs/CHANGELOG-2.3.md

Co-Authored-By: soc1c <47772477+soc1c@users.noreply.github.com>

* docs: remove empty lines
2019-03-22 15:59:20 +01:00
Niklas Adolfsson 17042e9c32 fix(rpc): fix a bunch of clippy lints (#10493)
* fix(rpc): fix a bunch of clippy lints

* fix(rpc clippy): remove unused ignored lints

* fix(clippy): fix all redundant_field_names

This commit fixes all uses of `redundant_field_names` and removes the ignored lint `redundant_field_names`

* fix(brain unwrap): replace with expect
2019-03-22 12:01:11 +01:00
Denis S. Soldatov aka General-Beck f2c34f7ca2 fix Sha3/keccak256 hash calculation for binaries (#10509)
https://github.com/paritytech/parity-ethereum/issues/10495
2019-03-22 11:46:57 +01:00
Hernando Castano 375a8daeb4
Add additional request tests (#10503) 2019-03-21 17:37:13 +01:00
Guillaume Ballet b700ff3501 whisper/cli: add p2p port and ip parameters (#10057)
* whisper/cli: add p2p port and ip parameters

This is so that those params don't change randomly and are in sync with the URL that
is displayed.

* feedback: Result instead of panic

Co-Authored-By: gballet <gballet@gmail.com>

* feedback: Map error in port conversion

Co-Authored-By: gballet <gballet@gmail.com>

* whisper/cli: User can specify enode private key

So that the enode doesn't change at every run.

* whipser/cli: finish integrating review feedback.

* Accomodate error API change

* Update rustc-hex version in whisper/cli/Cargo.toml

Co-Authored-By: gballet <gballet@gmail.com>

* Update README with new whisper cli options

* Fix typo in error message

Co-Authored-By: gballet <gballet@gmail.com>

* Fix Cargo.lock and build issue after lib version upgrade

* Fix another typo

Co-Authored-By: gballet <gballet@gmail.com>
2019-03-21 17:45:02 +03:00
Niklas Adolfsson 9519493e32 fix(time-utils): add missing license (#10497) 2019-03-20 16:01:38 +01:00
Niklas Adolfsson 037fd1b309 fix(extract `timestamp_checked_add` as lib) (#10383)
* fix(extract `timestamp_checked_add` as lib)

* fix(whisper types): remove unused `EmptyTopics`

* fix(time-lib): feature-flag to use time-lib or std

This commit adds conditional compilation checks that falls back to `our time-lib` when
`time_checked_add` is not available in the standard library

Note, `time_checked_add` covers both `checked_add` and `checked_sub`

* fix(grumble): use cfg_attr to define rustc feature
2019-03-19 23:17:05 +01:00
Niklas Adolfsson 78a534633d fix(rpc): lint `unused_extern_crates` + fix warns (#10489) 2019-03-19 16:37:24 +01:00
Denis S. Soldatov aka General-Beck effead9ba5 fix win&mac build (#10486)
add CARGO_HOME:                      "${CI_PROJECT_DIR}/.cargo"
2019-03-19 11:39:44 +01:00
TriplEight a8ee3c97e6 Сaching through docker volume (#10477)
* _old codebase_ before docker update

* before docker update, testing runnr

* docker update, testing the caching

* distributed job cargo homes

* distributed job cargo homes 2

* distributed job cargo homes 3

* dockerfile with gitlab checkout, audit uses template

* dockerfile gets repo in volume

* change builds_dir

* trying docker cache for repo

* repo cached automatically

* after script is not concatenated

* check sccache non-cacheable reasons nature

* watch cache

* log sccache

* log sccache 2

* debug log sccache

* fix debug log sccache

* fix debug log sccache 2

* debug log cache 3

* debug log cache 3

* trace log all sccache

* test wo cargo cache

* test w removed cargo cache

* report non-cacheable reasons, cargo cache is back and empty

* report non-cacheable reasons, cargo cache is back and empty 2

* report non-cacheable reasons, cargo cache is back and empty 3

* wrap into after_script

* restore CI tags

`qa` -> `linux-docker`

* return to main runners, this will fail until config on runners And Dockerfile won't be updated

* typo fix CI lint

* return to docker tag
2019-03-19 03:14:59 +03:00
Marek Kotewicz fb461659c7
OpenBlock::new take IntoIterator instead of mutable ref to Iterator (#10480) 2019-03-15 15:43:54 +01:00
Marek Kotewicz a574df3132 simplify block module and usage (#10479)
* removed trait IsBlock and simplify block usage

* removed redundant ClosedBlock::hash function
2019-03-15 12:22:47 +00:00
Marek Kotewicz d83143d0ba remove unused Engine::maximum_uncle_age (#10476) 2019-03-14 21:34:26 +01:00
Marek Kotewicz f875175325 remove unused Engine::is_proposal (#10475) 2019-03-14 12:40:59 +00:00
Marek Kotewicz c9db8ea21d further simplify machine (#10472)
* removed AuxiliaryRequest from Machin trait

* removed AncestryAction from Machine trait

* removed AuxiliaryData from Machine trait

* removed LocalizedMachine trait
2019-03-14 11:28:15 +01:00
Marek Kotewicz a16bad4175
simplify parity machine (#10469)
* simplify ethcore machine by removing redundant traits

* further ethereum machine simplifications

* removed obsolete todo
2019-03-13 11:36:13 +01:00
Hernando Castano 595dac6c3f
Ensure static validator set changes are recognized (#10467) 2019-03-12 19:16:29 +01:00
TriplEight 82a148a99b
Tests parallelized (#10452)
* tests splitted, phase 1

* typo

* fix wrong launch commands

* typos

* rearrangements

* use `nproc` function for threads

* use nproc for threads

* let theads be auto, build-andriod no more in regular run

* split val chain and cargo check

* renamed some files

* wrong phase

* check rust files before test jobs

* lint error

* rust files modivied var

* test except changes

* add rust_changes except

* lint error

* fixes

* .gitlab-ci.yml can't be excluded

* pipeline shouldn't start

* pipeline must go

* pipeline must go 2

* pipeline must go 3

* pipeline must go 4

* pipeline must go 5

* pipeline must go 6

* pipeline must go 7

* pipeline must not go 1

* pipeline must go 8

* avoid skippng tests yet, reintroducing them after the caching

* test theory

* parallelized cargo check with combusting helicopters

* less uploads

* alias for cargo checks

* nice template
2019-03-11 15:26:35 +01:00
Niklas Adolfsson 4320c9bc4f docs(spec): remove link to obsolete issue (#10464) 2019-03-11 11:48:01 +01:00
Marek Kotewicz 23d977ecce simplify ethcore machine by removing redundant traits (#10454) 2019-03-11 10:37:48 +00:00
5chdn ab27848dc4 docs: update changelogs for 2.2.{8,9,10,11}, 2.3.{1,2,3,4,5}, and 2.4.0 (#10389)
* docs: move changelog 2-3 to docs/

* docs: fix changelog 2-3 path

* docs: add changelogs for 2.2.{8,9,10,11}

* docs: add changelogs for 2.3.{1,2,3,4}

* Update CHANGELOG.md

* Update CHANGELOG-2.3.md

* Update CHANGELOG.md

* Update CHANGELOG.md
2019-03-07 21:11:58 +01:00
Denis S. Soldatov aka General-Beck 742a6007fe
Revert "CI aws git checkout (#10451)" (#10456)
* Revert "CI aws git checkout (#10451)"

This reverts commit 3e1d73126c.

* Update .gitlab-ci.yml

revert aws script with small fixes

* Delete publish-aws.sh
2019-03-07 14:45:35 +03:00
Niklas Adolfsson 91933d857d perf(ethcore): `micro-opt` (#10405)
Mostly fixes that changes `eagerly eval` to `lazy eval`
2019-03-06 15:30:35 +01:00
Denis S. Soldatov aka General-Beck 3e1d73126c CI aws git checkout (#10451)
* Updating the CI system with the publication of releases and binary files on github

Signed-off-by: Denis S. Soldatov aka General-Beck <general.beck@gmail.com>

* move publish aws from gitlab.yml to gitlab scripts

Signed-off-by: Denis S. Soldatov aka General-Beck <general.beck@gmail.com>

* gitlab.yml cleaning
move publish AWS to gitlab scripts
remove dependencies from android build

Signed-off-by: Denis S. Soldatov aka General-Beck <general.beck@gmail.com>

* Revert "Updating the CI system with the publication of releases and binary files on github"

This reverts commit da87e06f2e4751dbca08a898b52926aef5ad0aba.

* remove no-git for aws

* microfix

* no need in no_git then
2019-03-05 18:33:10 +01:00
Axel Chalon 7014642815 Implement parity_versionInfo & parity_setChain on LC; fix parity_setChain (#10312)
* Light client: implement parity_versionInfo RPC

* Light client: implement set_exit_handler & parity_setChain RPC

* parity_setChain RPC: return an error if failed (instead of `true`)

* Implement eth_subscribe('syncing') RPC for full node & light node

* Fix indentation

* Revert commit: Implement eth_subscribe('syncing')

* Revert change to Cr callback function
2019-03-04 20:24:53 +01:00
Denis S. Soldatov aka General-Beck 1bd4564216
CI publish to aws (#10446)
* move publish aws from gitlab.yml to gitlab scripts

* gitlab.yml cleaning
move publish AWS to gitlab scripts
remove dependencies from android build
2019-03-04 21:59:20 +03:00
Andrew Jones 97cb010df8 Silence Error::cause deprecations (#10438) 2019-03-02 13:18:18 +01:00
Hernando Castano ed18c7b54c Use correct name for documentation field in Cargo.toml (#10440) 2019-03-01 16:23:40 +00:00
Thibaut Sardan e71598d876 Update hardcoded headers for Foundation, Ropsten, Kovan and Classic (#10417)
* update foundation to #7262209

* update kovan to #10434561

* update ropsten to #5027841

* update classic to #7555073

* Update Ropsten headers to #5101569
2019-02-27 15:50:45 +01:00
Marek Kotewicz 3d0ce10fa6 panic_hook module uses eprintln instead of raw stderr interface (#10426) 2019-02-27 09:48:40 +00:00
soc1c cfc8df156b ci: clean up gitlab-ci.yml leftovers from previous merge (#10429) 2019-02-27 10:47:27 +01:00
Marek Kotewicz 94cb3b6e0e
fix underflow in pip, closes #10419 (#10423) 2019-02-27 10:08:04 +01:00
Marek Kotewicz fefec000fb
remove redundant macro println_stderr from parity/cli/usage.rs (#10425) 2019-02-27 10:07:41 +01:00
Mohanson c7ded6a785 Remove duplicate test cases (#10385)
Case create_account() is same as new_account()
2019-02-27 10:07:12 +01:00
Marek Kotewicz 2fbb952cdd parity/main.rs uses eprintln instead of raw stderr interface (#10427) 2019-02-27 11:41:03 +03:00
Marek Kotewicz e2ab3e4f5b fix panic when logging directory does not exist, closes #10420 (#10424) 2019-02-26 18:14:11 +01:00
elferdo 1871275ecd Refactor ethcore::client::TransactResult to use it inside std::result::Result (#10366)
* Refactor TransactResult

* Adapt evmbin and tests
2019-02-26 13:49:33 +01:00
joshua-mir afc1b72611 10000 > 5000 (#10422)
addresses #10418
2019-02-26 15:35:40 +03:00
Niklas Adolfsson c5c3fb6a75
fix(rpc-types): replace uint and hash with `ethereum_types v0.4` (#10217)
* fix(rpc-types): remove uint and hash wrappers

* fix(tests)

* fix(cleanup)

* grumbles(rpc-api): revert `verify_signature`

* revert change of `U64` -> `u64`

* fix(cleanup after bad merge)

* chore(bump ethereum-types)

* fix(bad merge)

* feat(tests ethereum-types): add tests

* chore(update `ethereum-types` to 0.4.2)

* feat(tests for h256)

* chore(rpc): remove `ethbloom` import

Use re-export from `ethereum-types` instead

* fix(bad merge): remove `DefaultAccount` type

* doc(add TODO with issue link)
2019-02-25 14:27:28 +01:00
5chdn bceb883d99 snap: reenable i386, arm64, armhf architecture publishing (#10386)
* snap: reenable i386, arm64, armhf architecture publishing

* gitlab: fix indent

* gitlab: fix yml syntax

* Linker for crosscomile

* fix target to linker

* new docker image

* fix lint, add build to this PR

* calc SHA3 using rhash

* add new images for i386, armhf

* show snap target & artifacts

* set CARGO_TARGET for publish snap

* move detect Version to publish snap

* rm libc6 dep from snap-template up pub-snap script

* clean up cargo config before add linker

* move linker config to docker images
2019-02-25 14:56:38 +03:00
Antoine fcccbf3b75 fix #10390 (#10391) 2019-02-22 15:31:34 +01:00
Wei Tang 9ad71b7baa Fix to_pod storage trie value decoding (#10368) 2019-02-22 14:00:20 +01:00
TriplEight 4311d43497
revert some changes, could be buggy (#10399) 2019-02-21 21:06:49 +01:00
5chdn 0815cc3b83 version: bump nightly to 2.5 (#10392)
* version: bump nightly to 2.5

* revert(rand 0.3.22)
2019-02-21 20:03:34 +01:00
TriplEight b21844b371 no-git for publish jobs, empty artifacts dir (#10393)
* no-git for publish jobs, empty artifacts dir

* fix syntax

* prettiness

* fix prettiness

* should get rid of git in publishing
2019-02-21 21:14:59 +03:00
Niklas Adolfsson f825048efa fix(jni): bump to jni to 0.11 & remove unsafe impl (#10394) 2019-02-21 19:26:01 +03:00
Niklas Adolfsson 2cbffe36e2 chore(bump ethereum-types) (#10396)
Fixes a de-serialization bug in `ethereum-tyes`
2019-02-21 15:34:41 +00:00
cheme 6bb106a784 Update to latest mem-db, hash-db and trie-db. (#10314)
* Switch to 'trie' crates, there is an unpublished deps to staging
parity-common triehash still.

* Use crates.io dependency.

* indentation

* Update util/journaldb/src/traits.rs

indentation

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>

* Update ethcore/src/snapshot/tests/state.rs

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>
2019-02-20 21:09:34 +03:00
Andrew Jones 4e0ec4e66b
tx pool: always accept local transactions (#10375)
* tx pool: always accept local transactions

* tx pool: `choose` local txs with same sender and nonce
2019-02-20 16:49:39 +00:00
Niklas Adolfsson b58a3ed0ad fix(trace_main! macro): don't re-export (#10384) 2019-02-20 10:52:28 +01:00
felix b803f57db6 exchanged old(azure) bootnodes with new(ovh) ones (#10309)
* exchanged old(azure) bootnodes with new(ovh) ones

* Fix indent
2019-02-20 10:06:26 +01:00
André Silva b457f46c81 ethash: implement Progpow (#9762)
* ethash: initial implementation of progpow

* progpow: use wrapping arithmetic

* progpow: cleanup comments

* progpow: fix keccak_f800

* progpow: reorder definitions

* progpow: general fixing

* progpow: add basic tests from geth

* progpow: generate c_dag and add test

* progpow: fix progpow_init and progpow_loop

* progpow: fix and add new test

* progpow: tabify

* progpow: add shared testvectors from geth and aleth

* progpow: add benchmarks

* progpow: don't read bytes from dag

* ethash: use criterion for progpow benchmarks

* progpow: dont borrow hash on fnv1a_hash

* progpow: don't borrow operand on progpow merge

* progpow: hardcode dag lookup function

we only support light verification anyway

* progpow: read double words directly from the dag

* progpow: inline some small functions

* progpow: remove some bounds checking from the main loop

* progpow: remove unreachable match cases

* progpow: remove bounds check in keccak_f800_round

* progpow: fix ptr::swap

* progpow: force loop unroll in keccak_f800_round

* progpow: remove unnecessary branching in progpow_loop

* progpow: force loop unroll in fill_mix

* progpow: silence unused warning

* progpow: dont run last keccak_f800_round out of the loop

rustc generates the same assembly, it unrolls the loop

* progpow: fix output of keccak_f800_short

* ethcore: support progpow in ethash engine

* ethash: fix typo

* ethcore, ethash: fix tests

* json: fix ethash spec tests

* ethash: update quick_get_difficulty for progpow

* ethash: drop light cache on progpow transition block

* ethash: fix quick_get_difficulty tests

* progpow: update to spec v0.9.0

* progpow: update to spec v0.9.1

* progpow: update to spec v0.9.2

* ethash: rename progpow benchmarks

* fix Cargo.lock bad merge

* ethash: only export modules for benchmarks

* ethash: progpow: remove unsafe unchecked indexing

* ethash: create enum for pow algorithm

* ethash: box the progpow cdag

* ethash: skip slow progpow test vectors on ci

* ethash: don't skip progpow test vectors

they don't take too long when running in release mode which is the case
for CI.

* ethash: progpow: update copyright date

Co-Authored-By: andresilva <andre.beat@gmail.com>

* ethcore: remove verification of ci-skip-tests on non-test builds
2019-02-20 10:05:11 +01:00
Leo Arias b4520c5886 snap: add the removable-media plug (#10377)
This interface allows the snap to access the directories in /media. This is needed when the storage is in a separate disk, not part of home.
2019-02-20 09:49:54 +01:00
Psilon ca67dc251f Add message to IO errors (#10324) 2019-02-18 20:39:38 +03:00
Niklas Adolfsson aea289e79e chore(bump parity-daemonize): require rust >= 1.31 (#10359) 2019-02-18 13:38:46 +01:00
Svyatoslav Nikolsky ef0eda0c39 SecretStore: use in-memory transport in cluster tests (#9850)
* fixing SS tests

* removed some redundant clones

* fixed grumbles

* replaced hash.clone() with *hash + fixed comment

* lost files
2019-02-18 13:38:19 +01:00
Hernando Castano af7dc3676b
Add fields to `memzero`'s Cargo.toml (#10362)
* Add fields to Cargo.toml before publishing to crates.io

* Change license from MIT to GPL-3.0

* Add docs page
2019-02-15 12:32:33 +01:00
Afri Schoedon fa570f297e snap: release untagged versions from branches to the candidate snap channel (#10357) 2019-02-14 17:24:52 +01:00
Niklas Adolfsson 9cce6a47d4 fix(compilation warns): `no-default-features` (#10346) 2019-02-14 17:54:44 +03:00
TriplEight bff0bedfa9 no volumes are needed, just run -v volume:/path/in/the/container (#10345) 2019-02-14 12:45:56 +01:00
Dan Acristinii d6c80c1672 Fixed misstype (#10351)
* Fixed misstype

BadTransactonType => BadTransactionType

* fixed other insances of transacton
2019-02-14 12:25:44 +01:00
Afri Schoedon 512343003d
snap: prefix version and populate candidate channel (#10343)
* snap: populate candidate releases with beta snaps to avoid stale channel

* snap: prefix version with v*
2019-02-13 15:50:02 +01:00
elferdo 3adb640d2b
Bundle protocol and packet_id together in chain sync (#10315)
Define a new `enum` where devp2p subprotocol packet ids (currently eth and par) are defined. Additionally provide functionality to query id value and protocol of a given id object.
2019-02-13 09:20:33 +01:00
gabriel klawitter ea589a17a4
role back docker build image and docker deploy image to ubuntu:xenial based (#10338) 2019-02-12 20:52:30 +01:00
gabriel klawitter a3883ca5d9
change docker image based on debian instead of ubuntu due to the chan… (#10336)
* change docker image based on debian instead of ubuntu due to the changes of the build container
2019-02-12 19:00:52 +01:00
Kirill Pimenov 5be0163cde Don't add discovery initiators to the node table (#10305)
* Don't add discovery initiators to the node table

* Use enums for tracking state of the nodes in discovery

* Dont try to ping ourselves

* Fix minor nits

* Update timeouts when observing an outdated node

* Extracted update_bucket_record from update_node

* Fixed typo

* Fix two final nits from @todr
2019-02-12 16:57:53 +01:00
Shude Li 55454b2f2d fix(docker): fix not receives SIGINT (#10059)
* fix(docker): fix not receives SIGINT

* fix: update with reviews

* update with review

* update

* update
2019-02-12 16:57:07 +01:00
TriplEight a4dc85543b
snap: official image / test (#10168)
* official image / test

* fix / test

* bit more necromancy

* fix paths

* add source bin/df /test

* add source bin/df /test2

* something w paths /test

* something w paths /test

* add source-type /test

* show paths /test

* copy plugin /test

* plugin -> nil

* install rhash

* no questions while installing rhash

* publish snap only for release
2019-02-12 15:37:54 +01:00
Niklas Adolfsson d8394bded7 fix(add helper for timestamp overflows) (#10330)
* fix(add helper timestamp overflows)

* fix(simplify code)

* fix(make helper private)
2019-02-12 14:16:23 +00:00
cheme d89b8d904f Additional error for invalid gas (#10327)
* Tag sensible place (ECHECH)

* Additional overflows checks.
2019-02-11 22:20:51 +00:00
Hernando Castano 8e866ee551
Revive parity_setMinGasPrice RPC call (#10294)
* Add function to update minimum gas price

* Update TestMinerService to handle min_gas_price changes

* Place minimum gas price test behind feature flag

* Update check for fixed gas pricer to be more explicit

* Use errors::unsupported instead of errors::request_rejected

* Add test that fails to set minimum gas price

* Fix test that should fail when setting new gas price

* Put dev dependencies behind feature flag

* Fix deadlock in set_minimal_gas_price()

* Update RPC tests with mocked error response

* Remove unnecessary cfg flag

* Remove duplicate crate imports
2019-02-11 18:08:12 +01:00
Hernando Castano 6dfc1bd474 Add Statetest support for Constantinople Fix (#10323)
* Update Ethereum tests repo to v6.0.0-beta.3 tag

* Add spec for St.Peter's / ConstantinopleFix statetests
2019-02-11 17:13:36 +01:00
Niklas Adolfsson c84e5745fa fix(parity-clib): grumbles that were not addressed in #9920 (#10154)
* fix(remove needless unsafe blocks)

* style(nits)

* fix(parity-clib): eliminate repetitive event loops

* revert(java bindings): safe rust -> unsafe rust

These functions can still end up with `UB` thus should be unsafe

* fix(grumbles): make Callback trait `pub (crate)`
2019-02-11 15:27:46 +01:00
Niklas Adolfsson 751d15e4be fix(light-rpc): Make `light_sync` generic (#10238)
* fix(light-rpc): Make `light_sync` generic

The motivation behind this change is to easily mock `light-sync` to make it possible to enable `rpc-integration` tests
for the light-client.

Currently the `rpc's` requires the concrete type `sync::LightSync` which makes it very hard to do so

* fix(bad merge)
2019-02-11 10:33:16 +00:00
TriplEight 8b6c5be6a9
fix publish job (#10317)
* fix publish job

* dashes and colonels
2019-02-08 18:22:08 +01:00
Axel Chalon 3502b36232 Secure WS-RPC: grant access to all apis (#10246) 2019-02-08 14:11:55 +01:00
elferdo 046b8bbc8a
Make specification of protocol in SyncRequester::send_request explicit (#10295)
* Make the specification of the protocol to which a packet_id belongs to
  explicit when calling "SyncRequester::send_packet".

* Remove "SyncIO::send" and leave only "SyncIO::send_protocol"

* Adapt tests to new code.

* Strengthen tests to check if packet_id and protocol match when sending
a devp2p packet.
2019-02-08 13:01:29 +01:00
Alexander Arlt 6fa4b2dec5 fix: parity-clib/examples/cpp/CMakeLists.txt (#10313)
* use of ${CMAKE_SHARED_LIBRARY_PREFIX} &
${CMAKE_SHARED_LIBRARY_SUFFIX} to support other operating systems.
2019-02-08 12:01:29 +03:00
TriplEight 83bcb819da
CI optimizations (#10297)
* CI optimizations

* fix stripping

* new dockerfile

* no need n submodule upd

* review

* moved dockerfile

* it becomes large

* onchain update depends on s3

* fix dependency

* fix cache status

* fix cache status

* new cache status
2019-02-07 18:49:50 +01:00
elferdo b7e8621846 Increase number of requested block bodies in chain sync (#10247)
* Increase the number of block bodies requested during Sync.

* Increase the number of block bodies requested during Sync.

* Check if our peer is an older parity client with the bug
  of not handling large requests properly

* Add a ClientVersion struct and a ClientCapabilites trait

* Make ClientVersion its own module

* Refactor and extend use of ClientVersion

* Replace strings with ClientVersion in PeerInfo

* Group further functionality in ClientCapabilities

* Move parity client version data from tuple to its own struct.

* Implement accessor methods for ParityClientData and remove them
from ClientVersion.

* Minor fixes

* Make functions specific to parity return types specific to parity.

* Test for shorter ID strings

* Fix formatting and remove unneeded dependencies.

* Roll back Cargo.lock

* Commit last Cargo.lock

* Convert from string to ClientVersion

* * When checking if peer accepts service transactions just check
  if it's parity, remove version check.

* Remove dependency on semver in ethcore-sync

* Remove unnecessary String instantiation

* Rename peer_info to peer_version

* Update RPC test helpers

* Simplify From<String>

* Parse static version string only once

* Update RPC tests to new ClientVersion struct

* Document public members

* More robust parsing of ID string

* Minor changes.

* Update version in which large block bodies requests appear.

* Update ethcore/sync/src/block_sync.rs

Co-Authored-By: elferdo <elferdo@gmail.com>

* Update util/network/src/client_version.rs

Co-Authored-By: elferdo <elferdo@gmail.com>

* Update util/network/src/client_version.rs

Co-Authored-By: elferdo <elferdo@gmail.com>

* Update tests.

* Minor fixes.
2019-02-07 15:27:09 +01:00
Tomasz Drwięga d5c19f8719 Deprecate account management (#10213)
* Extract accounts from ethcore.

* Fix ethcore.

* Get rid of AccountProvider in test_helpers

* Fix rest of the code.

* Re-use EngineSigner, fix tests.

* Simplify EngineSigner to always have an Address.

* Fix RPC tests.

* Add deprecation notice to RPCs.

* Feature to disable accounts.

* extract accounts in RPC

* Run with accounts in tests.

* Fix RPC compilation and tests.

* Fix compilation of the binary.

* Fix compilation of the binary.

* Fix compilation with accounts enabled.

* Fix tests.

* Update submodule.

* Remove android.

* Use derive for Default

* Don't build secretstore by default.

* Add link to issue.

* Refresh Cargo.lock.

* Fix miner tests.

* Update rpc/Cargo.toml

Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com>

* Fix private tests.
2019-02-07 14:34:24 +01:00
Wei Tang 8fa56add47 Properly handle check_epoch_end_signal errors (#10015)
* Make check_epoch_end_signal to only use immutable data

* Move check_epoch_end_signals out of commit_block

* Make check_epoch_end_signals possible to fail

* Actually return the error from check_epoch_end_signals

* Remove a clone

* Fix import error
2019-02-07 14:34:07 +01:00
Niklas Adolfsson e45ee6cd72 fix(osx and windows builds): bump parity-daemonize (#10291) 2019-02-07 12:53:12 +01:00
Julien Bouteloup e344286c32 Add missing step for Using `systemd` service file (#10175)
* Add missing step for  Using `systemd` service file

Copy Parity release from target folder to bin, write `cp -R ./target/release/parity /usr/bin/` to match `ExecStart=/usr/bin/parity --config /etc/parity/config.toml` from `https://github.com/paritytech/parity-ethereum/blob/master/scripts/parity.service`

* Copy release to bin folder using sudo install

`sudo install ./target/release/parity /usr/bin/parity`
2019-02-07 12:50:15 +01:00
Anton Gavrilov 45d7c60608 Call private contract methods from another private contract (read-only) (#10086)
* Patch available private contracts during private transaction

* Key acl ABI added

* Work with secret store keys moved to the separate struct

* Private tx test refactored

* Revert "Private tx test refactored"

This reverts commit 476c132d692c7a886bc7b7cd7fe47b3d7692bd63.

* Test for calling private contract from another one added

* Test fixed

* Redundant tab removed

* ACL contract processing fixed, test added

* Merge with head

* Expect replaced with closure
2019-02-07 12:39:04 +01:00
Andronik Ordian a3e39c9858 update ring to 0.14 (#10262)
* cargo upgrade hyper-rustls --all

* cargo upgrade parity-crypto --all

* update Cargo.lock

* propagate NonZeroU32

* use NonZeroU32::new_unchecked for crypto::KEY_ITERATIONS

* update Cargo.lock

* replace unsafe code with lazy_static
2019-02-06 17:53:34 +01:00
Niklas Adolfsson 8ab6d89810 fix(secret-store): deprecation warning (#10301)
use of deprecated item 'core::str::<impl str>::trim_left_matches': superseded by `trim_start_matches`
2019-02-06 16:54:35 +03:00
Andrew Jones 1b3b9b2887
Update to jsonrpc-derive 10.0.2, fixes aliases bug (#10300) 2019-02-05 14:47:25 +00:00
Andrew Jones 89ae0f0ea0 Convert to jsonrpc-derive, use jsonrpc-* from crates.io (#10298)
* Use jsonrpc crates on local path

* Convert all RPC traits to use jsonrpc-derive

* Use local jsonrpc at top level

* Upgrade remaining jsonrpc dependencies

* Checkout Cargo.lock to master HEAD

* Use jsonrpc-* 10.0.1 from crates.io

* Attribute after docs
2019-02-05 14:31:19 +01:00
Pierre Krieger 06cae8a535 Fix Windows build (#10284) 2019-02-03 13:32:06 +01:00
Pierre Krieger 12ac992ffb Don't run the CPP example on CI (#10285)
* Don't run the CPP example on CI

* Add comment
2019-02-03 13:23:07 +01:00
Tomasz Drwięga 3b23c2e86d Additional tests for uint deserialization. (#10279) 2019-02-03 12:26:25 +01:00
Seun LanLege 0f9b2218da prevent silent errors in daemon mode (#10007)
* prevent silent errors in daemon mode

* change author in Cargo.toml, add preamble to pipe.rs

* set the uid and gid on daemon process, fix permission errors when writing to pid file

* call setup_logger before daemonize to prevent crashing when attempting to create logfile

* map_err for calls to splice and ioctl, fix spaces in Cargo.toml

* split out daemonize to own repo

* removed util/daemonize

* renamed dep to parity-daemonize

* fix(parity-clib): enable `logger`

* bump parity-daemonize

* remove obsolete comment

Co-Authored-By: seunlanlege <seunlanlege@gmail.com>

* fix(grumbles): docs and log in ParityParams

* Add FIXME comment regarding @tomaka grumbles
* Unify logger with the C-API in ParityParams (less type-safety with more from_raw() conversions)
* Add better documentation in the `parity.h`

* Apply suggestions from code review

Co-Authored-By: seunlanlege <seunlanlege@gmail.com>

* docs(parity lib): add link to logging issue

* fix(parity-clib): JNI enable `logger`

* fix(parity-clib): update `Java example`

* Update example to the API changes
* Remove needless printouts which can be controlled via logger instead
2019-02-01 19:31:02 +01:00
Tomasz Drwięga 12c42bce9b Fix join-set test to be deterministic. (#10263) 2019-01-30 12:57:38 +00:00
Gabriel Majoulet eb3d33ed6f Update CHANGELOG-2.2.md (#10254) 2019-01-29 10:13:21 +01:00
cheme a139c6d216 Macos heapsize force jemalloc (#10234)
* Switch to non prefixed malloc_size_of on macos

* Fix

* Testing darwin build

* Fix import

* conflict

* switch heapsize deps commit

* switch heapsize commit

* Rename branch

* Restore gitlab ci to origin

* test for mac

* mac tests?

* Switch of macos CI tests.
2019-01-29 09:26:22 +01:00
Andrew Plaza 50f5ccc4f2 Allow specifying local accounts via CLI (#9960)
* Allow specifying local accounts via CLI

 * Add `tx-queue-locals` CLI option
 * ethcore: modify miner to check options vec before importing transaction
 * modify tests (ethcore/parity)
Resolves #9634

* fix formatting

* fixes: Make prefer HashSet over Vec<>, add test, comment formatting

* Update ethcore/src/miner/miner.rs

Co-Authored-By: insipx <aplaza@liquidthink.net>

* Fix comments and add helper for set->vec conversion

* remove blank line from use statement

* fix helper test

* formatting

* fix test to pass on nightly

* revert test fix for nightly
2019-01-28 11:26:11 +01:00
Vladyslav Lupashevskyi 94db961975 Take in account zero gas price certification when doing transact_contract (#10232)
* Tx permission contract improvement

* Take in account zero gas price certification when doing transact_contract

* DRY in ServiceTransactionChecker

* Fix typos and regroup mod

* Fix imports

* Simplify code in struct instantiation

Co-Authored-By: VladLupashevskyi <vlad@lupashevskyi.com>
2019-01-28 10:58:34 +01:00
Yucong Sun 38f3747cde Update CHANGELOG.md (#10249)
change 2018 to 2019
2019-01-28 10:54:07 +01:00
folex 4fec2f2fc2 Fix typo: CHANGELOG-2.1 -> CHANGELOG-2.2 (#10233) 2019-01-23 11:09:40 +01:00
Sho Sawada c96d8a742b Update copyright year to 2019. (#10181)
* Update copyright year to 2019.

Have a great year.

* add `(UK)`

* 2018-2019
2019-01-23 09:26:36 +00:00
Elder Ryan c2de31e586 fixed: types::transaction::SignedTransaction; (#10229) 2019-01-22 22:03:31 +03:00
Niklas Adolfsson 4b11d79829
fix(ManageNetwork): replace Range with RangeInclusive (#10209)
* fix(ManageNetwork): replace Range -> RangeIncls

Fixes `TODO: Range should be changed to RangeInclusive once stable (https://github.com/rust-lang/rust/pull/50758)`

* fix(tests)

* fix(grumbles): off-by-one error in debug_asserts

* RangeInclusive::end() is inclusive which means that if start and end is equal the `debug_assert(range.end() >
range.start()` will fail which is shouldn't
2019-01-22 09:51:40 +01:00
Seun LanLege c35abe4196 import rpc transactions sequentially (#10051)
* import rpc transactions sequentially

* use impl trait in argument position, renamed ProspectiveDispatcher to WithPostSign

* grouped imports

* integrates PostSign with ProspectiveSigner

* fix spaces, removed unnecessary type cast and duplicate polling

* clean up code style

* Apply suggestions from code review
2019-01-22 09:33:56 +01:00
Afri Schoedon a9a278a6e1
Enable St-Peters-Fork ("Constantinople Fix") (#10223)
* ethcore: disable eip-1283 on kovan block 10255201

* ethcore: disable eip-1283 on ropsten block 4939394

* ethcore: enable st-peters-fork on mainnet block 7280000

* ethcore: fix kovan chain spec

* version: update fork blocks

* ethcore: disable eip-1283 on sokol block 7026400
2019-01-21 22:55:44 +01:00
Wei Tang fb07ffa676 Add EIP-1283 disable transition (#10214) 2019-01-21 12:22:29 +01:00
Michael Müller 940a88fa4e Echo CORS request headers by default (#10221)
* Echo CORS request headers by default

More details in https://github.com/paritytech/parity-ethereum/issues/6616.

* fixup: Single line
2019-01-21 10:30:24 +00:00
Bryant Eisenbach 708e495c28 Happy New Year! (#10211)
* Happy New Year!

* Happy New Year!

* Update README.md
2019-01-18 14:00:13 +01:00
Denis S. Soldatov aka General-Beck 460681ead9 perform stripping during build (#10208)
* perform stripping during build

* var RUSTFLAGS
2019-01-18 12:03:18 +01:00
Hernando Castano 2a7ed457dc
Remove CallContract and RegistryInfo re-exports from `ethcore/client` (#10205)
* Remove re-export of `CallContract` and `RegistryInfo` from `ethcore/client`

* Remove CallContract and RegistryInfo re-exports again

This was missed while fixing merge conflicts
2019-01-17 16:43:08 +01:00
Hernando Castano 35bbf11ba5 Extract CallContract and RegistryInfo traits into their own crate (#10178)
* Create call-contract crate

* Add license

* First attempt at using extracted CallContract trait

* Remove unneeded `extern crate` calls

* Move RegistryInfo trait into call-contract crate

* Move service-transaction-checker from ethcore to ethcore-miner

* Update Cargo.lock file

* Re-export call_contract

* Merge CallContract and RegistryInfo imports

* Remove commented code

* Add documentation to call_contract crate

* Add TODO for removal of re-exports

* Update call-contract crate description

Co-Authored-By: HCastano <HCastano@users.noreply.github.com>

* Rename call-contract crate to ethcore-call-contract
2019-01-16 19:52:21 +01:00
Afri Schoedon 4f1e1e8870 Update the changelogs for 2.1.11, 2.2.6, 2.2.7, and 2.3.0 (#10197)
* docs: move 2.2 changelog to docs/

* docs: mark parity 2.1 end of life

* docs: add changelog for 2.1.11

* docs: add changelog for 2.2.6

* docs: add changelog for 2.2.7

* docs: add changelog for 2.3.0

* docs: add release notes for 2.3.0
2019-01-16 18:32:53 +01:00
Victor Baranov cf505139f1 Cancel Constantinople HF on POA Core (#10198) 2019-01-16 18:31:59 +01:00
Seun LanLege cdba22a2cb Adds cli interface to allow reseting chain to a particular block (#9782)
* added BlockChainReset trait, client impl, and cli interface

* show block hashes to be deleted and new best block, update best block in db, better cli interface

* delete BlockNumber from COL_EXTRA

* add TODO comment

* add BlockReciepts to imports

* refactor block_headers_from_best_block, better cli documentation

* exit gracefully if reset arg isn't supplied

* fix cli usage macro

* removed stray int literals

* use Vec::with_capacity

Co-Authored-By: seunlanlege <seunlanlege@gmail.com>

* cast n to usize

* correct imports

* make db reset arg required
2019-01-16 16:37:26 +01:00
Nicolas Gotchac 1df6361753 Run all `igd` methods in its own thread (#10195) 2019-01-16 16:35:28 +01:00
Afri Schoedon a6c6c7c070
pull constantinople on ethereum network (#10189)
* ethcore: pull constantinople on ethereum network

* version: mark update as critical

* ethcore: remove constantinople alltogether from chain spec

* version: revert fork block for ethereum
2019-01-15 21:50:41 +01:00
TriplEight ed6f2877d7
Update for Android cross-compilation. (#10180)
* build-unix update

* .gitlab-ci update

* Update build-unix.sh

add android postprocessing

* path to android lib

libparity.so

* fix path to libparity

* add android lib to artifacts
2019-01-15 17:27:43 +01:00
Afri Schoedon 53c408f549
version: bump fork blocks for kovan and foundation (#10186) 2019-01-15 15:48:50 +01:00
Wei Tang 64704c456f Handle the case for contract creation on an empty but exist account with storage items (#10065)
* Add is_base_storage_root_unchanged

* Fix compile, use a shortcut for check, and remove ignored tests

* Add a warn!

* Update ethereum/tests to v6.0.0-beta.2

* grumble: use {:#x} instead of 0x{:x}

Co-Authored-By: sorpaas <accounts@that.world>
2019-01-15 10:21:44 +01:00
joshua-mir 0edf8e3f1b Align personal_unlockAccount behaviour when permanent unlock is disabled (#10060)
* align with docs

> If permanent unlocking is disabled (the default) then the duration argument will be ignored, and the account will be unlocked for a single signing.

Current behaviour throws an error that is no longer relevant.

* fix test

* Change back to throwing error

* Fix test again

* formatting

* oops

* whitespace fixes
2019-01-15 09:36:55 +01:00
Nicolas Gotchac 53a04e1686 Drop `runtime` after others (especially `ws_server`) (#10179) 2019-01-15 09:14:15 +01:00
Afri Schoedon d356c6640d
version: bump nightly to 2.4 (#10165)
* version: bump nightly to 2.4

* revert rand downgrade
2019-01-14 17:29:17 +01:00
Wei Tang e8e087fc37 Skip locking in statedb for non-canon blocks (#10141) 2019-01-15 01:33:10 +11:00
shoffmeister 181738a736 Remove reference to ui-interface command-line option (#10170) 2019-01-12 13:12:03 +01:00
Tomasz Drwięga 1ac1224cd3 Fix #9822: trace_filter does not return failed contract creation (#10140)
currently trace_filter can't return failed contract creation transaction
but trace_block can query the failed contract creation transaction.it
because the logic of parity-ethereum/ethcore/src/trace/types/filter.rs
Line 109 in 9982eba
```
 _ => false
```

this patch correct the logic:
```
 _ => self.to_address.matches_all()
```

Signed-off-by: Deshi Xiao <xiaods@gmail.com>
2019-01-11 18:08:58 +01:00
Nicolas Gotchac 3687df8da2 Fix _cannot recursively call into `Core`_ issue (#10144)
* Change igd to github:maufl/rust-igd

* Run `igd::search_gateway_from_timeout` from own thread
2019-01-11 17:59:05 +01:00
Niklas Adolfsson 67eee6aeb7 fix(whisper): correct PoW calculation (#10166)
* Fix off-by-one error on `leading_zeros` which was used to index in the hash to get leading zeros when not aligned on byte boundary (i.e, all the bits in a byte was not zero such as 0001 1111)
* Fix overflow by shifting with bigger value than 63
2019-01-11 17:48:58 +01:00
Tomasz Drwięga 83ba9df85b Bump JSON-RPC (#10151)
* Bump JSON-RPC

* Fix test casing.
2019-01-11 16:55:03 +01:00
Kirill Pimenov 83f706186f Ping nodes from discovery (#10167) 2019-01-10 20:43:16 +01:00
Niklas Adolfsson eea5f6f232 fix(android): remove dependency to libusb (#10161) 2019-01-10 13:13:15 +01:00
Niklas Adolfsson 38af7f35fc refactor(trim_right_matches -> trim_end_matches) (#10159) 2019-01-10 13:12:14 +01:00
Pierre Krieger eea3de00c1 Merge Machine and WithRewards (#10071) 2019-01-10 13:11:39 +01:00
Afri Schoedon 4d66e8d06d
snap: fix path in script (#10157)
* snap: fix path in script

* debug, revert me

* fix

* necromancer awk magic

* awk necromancy and path fixing

* working track selection
2019-01-10 10:58:30 +01:00
Wei Tang 010cfb7d67 Make sure parent block is not in importing queue when importing ancient blocks (#10138)
* Make sure parent block is not in importing queue when importing ancient blocks

* Clear queue when an ancient import fails

* Lock only once in clear

* Add comments why queued check is needed

* Should push the value back to the queue

* Directly check in chain.read()

* Remove extra empty line

* Revert unused verification change
2019-01-09 16:47:14 +03:00
Afri Schoedon f9a8aac036
ci: re-enable snap publishing (#10142)
* ci: enable snap publishing~

* ci: add publish snap script

* ci: add snapcraft skeleton

* ci: group export statements

* ci: enable snaps on pr branch

* ci: enable snaps on pr branch

* ci: set default BUILD_ARCH

* ci: enable snaps on pr branch

* ci: enable snaps on pr branch

* ci: add libdb to snap

* ci: reinitiate gitlabci

* ci: reinitiate publish-snap script

* ci: fix yaml syntax

* cargo/gitlab env vars

* debug, revert me

* version?

* debug vars

* vars

* vars fix

* vars fix

* revert

* Update scripts/gitlab/publish-snap.sh

Co-Authored-By: 5chdn <5chdn@users.noreply.github.com>

* ci: read track from cargo toml
2019-01-09 14:39:21 +01:00
Vadim Arasev 3d28823be7 HF in POA Core (2019-01-18) - Constantinople (#10155)
https://github.com/poanetwork/poa-chain-spec/pull/100
2019-01-09 12:42:44 +01:00
ETHorHIL 492317abd7 Update EWF's tobalaba chainspec (#10152)
Added some bootnodes and removed some that we have lost access to.
2019-01-09 11:37:28 +01:00
Tomasz Drwięga ab22d5e278 Replace ethcore-logger with env-logger. (#10102)
* Replace ethcore-logger with env-logger.

* Fix logger initialization in WASM tests.

* uncomment logger initialization in secret store

* Don't use ethcore-logger in whisper.

* Move ethcore-logger within parity dir.

* Uncomment rest from secret-store.

* Use `let _ =` in private_contract for consistency

* `ok()` to `let _ =` fix in service

* Use `let _ = ` for state_db
2019-01-08 15:07:20 +01:00
Andronik Ordian ce5f704dd5 finality: dont require chain head to be in the chain (#10054) 2019-01-08 11:14:59 +01:00
Anton Gavrilov 696dc05dda Remove caching for node connections (#10143) 2019-01-08 11:31:26 +11:00
cheme 589083ad7a Blooms file iterator empty on out of range position. (#10145) 2019-01-07 17:54:06 +01:00
joshua-mir 1fda997370 Autogen docs for the "Configuring Parity Ethereum" wiki page. (#10067)
* publish docs changes for autogen config docs

* Update publish-docs.sh

adding an environment variable so js knows not to download git master and just grab the local repo

* Update publish-docs.sh

made some changes making this unnecessary

* fix env variable

env variable passes to node properly now

* use yarn

* test pipeline, revert me

* fix test pipeline, revert me

* change runner tag

* change runner tag 2

* change runner tag

* global git config

* supress upload_files output

* Update .gitlab-ci.yml

reverting testing changes

* Replace tag if exists

Very unlikely to be important/useful
2019-01-07 14:47:28 +01:00
Afri Schoedon 7c335e8764
misc: bump license header to 2019 (#10135)
* misc: bump license header to 2019

* misc: remove_duplicate_empty_lines.sh

* misc: run license header script

* commit cargo lock
2019-01-07 11:33:07 +01:00
Tomasz Drwięga 5b1d33d5fa Hide most of the logs from cpp example. (#10139) 2019-01-07 10:23:50 +01:00
Nicolas Gotchac e435407080 Don't try to send oversized packets (#10042)
* Don't construct oversized packets

* Add test for payload limit

* [eth-sync] Fix wrongly computed data sizes

* Replace `MAX_RECEIPTS_TO_SEND` with overall softlimit
2019-01-04 19:58:21 +01:00
Anton Gavrilov b180be7526 Private tx enabled flag added into STATUS packet (#9999)
* Add private tx enabled flag into status packet

* Error log added for the case with no peers available

* Add flag only for supported protocol versions

* Work with private handler refactored

* Log target changed

* Cargo.lock updated
2019-01-04 19:57:01 +01:00
Sergei Pepyakin 90fb473d87 Update pwasm-utils to 0.6.1 (#10134) 2019-01-04 16:56:56 +01:00
Tomasz Drwięga 3650f2d51c Extract blockchain from ethcore (#10114)
* Split blockchain & db from ethcore.

* Clean up blockchain deps.

* Missing docs.

* Fix blockchain tests.

* Make other crates compile.

* Remove some re-exports.

* Remove types re-export from ethcore.

* Remove EVM dependency from transaction.

* Merge ethcore-transaction with common-types.

* Clean-up ethcore deps a bit.

* remove ethcore from cargo.toml

* Update ethcore/blockchain/src/lib.rs

Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com>

* Address review comments.

* Update DB comment.

* Add tracking issue to the TODO and fix typo.

* Common naming for common types.

* Update ethcore/db/src/keys.rs

Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com>

* Update ethcore/blockchain/src/generator.rs

Co-Authored-By: tomusdrw <tomusdrw@users.noreply.github.com>

* Try to fix beta tests.
2019-01-04 14:05:46 +01:00
Afri Schoedon 3090324366 ethcore: update hardcoded headers (#10123)
* ethcore: update hardcoded headers for foundation

* ethcore: update hardcoded headers for ropsten

* ethcore: update hardcoded headers for kovan

* ethcore: use consistant formatting

* ethcore: restore spaces after colon in chain spec

* ethcore: fix bootnodes in chain specs

* ethcore: fix bootnodes in chain specs

* ethcore: enforce newline at the end of chainspecs
2019-01-04 13:26:18 +01:00
joshua-mir 130901e820 Identity fix (#10128)
* fix #10125

fix service transaction version detection if --identity is enabled, change test to match how --identity actually works

* fix wrong var

* get the index of  v, not /

* idx, not idx.len()

* Update ethcore/sync/src/chain/propagator.rs

Co-Authored-By: joshua-mir <43032097+joshua-mir@users.noreply.github.com>

* Update ethcore/sync/src/chain/propagator.rs

Co-Authored-By: joshua-mir <43032097+joshua-mir@users.noreply.github.com>

* change version prefix to a const

* space

Co-Authored-By: joshua-mir <43032097+joshua-mir@users.noreply.github.com>
2019-01-04 13:23:46 +01:00
Tomasz Drwięga 801b8191ef Use LenCachingMutex to optimize verification. (#10117) 2019-01-03 14:11:07 +01:00
Piotr Chromiec 469f9c26e7 Pyethereum keystore support (#9710)
* support for keystore format produced by pyethereum lib + some debug msgs

* made salt unbound also for Scrypt

* made address optional and skip if its none

* ignore values of any type, not just i32

* WIP: local deps

* cleanup

* enable optional address + more cleanup

* yet another cleanup

* enable keystore wo address import (using passwd)

* cleanup

* doc enchancement

* parity/account fix

* redesign after review

* fix indentation

* ignore just version in json under crypto

* remove unnecessary borrowing within match str

Co-Authored-By: tworec <tworec@golem.network>

* remove another unnecessary borrowing

Co-Authored-By: tworec <tworec@golem.network>

* default derived instead of implementing

* log dependency removed

* [ethstore] warn restored + env_logger initialized in CLI

* applied suggestion from @tomusdrw
2019-01-03 14:07:27 +01:00
Pierre Krieger b5f510ead7 Bump rocksdb-sys to 0.5.5 (#10124)
* Bump rocksdb-sys to 0.5.5

* Revert rand
2019-01-03 13:13:02 +03:00
Niklas Adolfsson b4f8bba843 parity-clib: `async C bindings to RPC requests` + `subscribe/unsubscribe to websocket events` (#9920)
* feat(parity-clib asynchronous rpc queries)

* feat(seperate bindings for ws and rpc)

* Subscribing to websockets for the full-client works

* feat(c binding unsubscribe_from_websocket)

* fix(tests): tweak CMake build config

* Enforce C+11

* refactor(parity-cpp-example) : `cpp:ify`

* fix(typedefs) : revert typedefs parity-clib

* docs(nits)

* fix(simplify websocket_unsubscribe)

* refactor(cpp example) : more subscriptions

* fix(callback type) : address grumbles on callback

* Use it the example to avoid using global variables

* docs(nits) - don't mention `arc`

* fix(jni bindings): fix compile errors

* feat(java example and updated java bindings)

* fix(java example) : run both full and light client

* fix(Java shutdown) : unsubscribe to sessions

Forgot to pass the JNIEnv environment since it is an instance method

* feat(return valid JString)

* Remove Java dependency by constructing a valid Java String in the callback

* fix(logger) : remove `rpc` trace log

* fix(format)

* fix(parity-clib): remove needless callback `type`

* fix(parity-clib-examples) : update examples

* `cpp` example pass in a struct instead to determines `callback kind`
* `java` add a instance variable the class `Callback` to determine `callback kind`

* fix(review comments): docs and format

* Update parity-clib/src/java.rs

Co-Authored-By: niklasad1 <niklasadolfsson1@gmail.com>

* fix(bad merge + spelling)

* fix(move examples to parity-clib/examples)
2019-01-02 16:49:01 +01:00
Niklas Adolfsson 2bb79614f6 refactor (hardware wallet) : reduce the number of threads (#9644)
* refactor(hardware-wallet) - use only one thread

This changes parity to use one thread instead of two to subscribe USB
events via the hardware-wallets.

* Fix logs and tests

* fix(grumbles) : formatting and spelling nits

* Update hw/src/lib.rs

Co-Authored-By: niklasad1 <niklasadolfsson1@gmail.com>

* Update hw/src/lib.rs

Co-Authored-By: niklasad1 <niklasadolfsson1@gmail.com>

* Update hw/src/ledger.rs

Co-Authored-By: niklasad1 <niklasadolfsson1@gmail.com>

* fix(grumbles): clarify docs and use constants

* Clarify bad explaination of `run-to-completion`
* Replace magic numbers with constants
2019-01-02 16:48:45 +01:00
Vadim Arasev c077dc652d HF in POA Sokol (2019-01-04) (#10077)
* HF in POA Sokol (2019-01-04)

https://github.com/poanetwork/poa-chain-spec/pull/91

* Update POA Core bootnodes
2019-01-02 11:19:24 +01:00
Songtronix 1b6f2a3e92 Fix broken links (#10119)
Due to #10101 new directory structure, some links needed to be fixed.
2019-01-02 11:14:18 +01:00
Pierre Krieger 9136c81f05 Follow-up to #10105 (#10107) 2018-12-28 10:43:03 +01:00
Seun LanLege 912e5599d9 Move EIP-712 crate back to parity-ethereum (#10106)
* move eip-712 crate back to parity-ethereum

* changed license, updated documentation url
2018-12-28 17:36:55 +08:00
Tomasz Drwięga ff0095ac5e Move a bunch of stuff around (#10101)
* Move devtools.

* Merge stop_guard & rename memzero

* Move price-info to miner.

* Group account management

* Clean up workspace members.

* Move local store closer to miner.

* Move clib examples.

* Move registrar and hash-fetch

* Move rpc_cli/rpc_client

* Move stratum closer to miner.

* Fix naming convention of crates.

* Update Cpp examples path.

* Fix paths for clib-example.

* Fix removing build.
2018-12-28 17:33:49 +08:00
Tomasz Drwięga bf9fedc4ee Revert "Add --frozen when running cargo (#10081)" (#10105)
* Revert "Add --frozen when running cargo (#10081)"

This reverts commit c90e279ab5.

* Add Cargo.lock modification detection.
2018-12-27 13:42:19 +03:00
Wei Tang 78ba54da6b Fix left over small grumbles on whitespaces (#10084) 2018-12-20 14:28:32 +01:00
Pierre Krieger c90e279ab5 Add --frozen when running cargo (#10081) 2018-12-19 15:23:26 +03:00
mattrutherford 215602de08
Fix pubsub new_blocks notifications to include all blocks (#9987)
Fix: new blocks notifications sometimes missing in pubsub RPC

Implement new struct to pass to `new_blocks()` with extra parameter - `has_more_blocks_to_import`, which was previously used to determine whether the notification should be sent. Now it's up to each implementation to decide what to do.

Updated all implementations to behave as before, except `eth_pubsub`, which will send notification even when the queue is not empty.

Update tests.
2018-12-19 09:24:14 +00:00
Pierre Krieger 13b832f959 Update some dependencies for compilation with pc-windows-gnu (#10082) 2018-12-18 23:26:01 +03:00
cheme 789bb9c852 Fill transaction hash on ethGetLog of light client. (#9938)
* Fill transaction hash on ethGetLog of light client. This is enifficient
but we keep align with spec.

* Using better variables names.

* Expose old fast light get log as `parity_getLogsLight`.

* Update rpc/src/v1/helpers/light_fetch.rs

Fix indent.

Co-Authored-By: cheme <emericchevalier.pro@gmail.com>

* Factor common code between light_logs and logs.

* Remove useless check

* Rename parity light logs to 'parity_getLogsNoTransactionHash'.
Fix indent and extra white lines.

* Use vec instead of tree map to avoid inner function.

* better loop
2018-12-17 22:40:25 +03:00
Thibaut Sardan aada1f547b
Update changelog update for 2.2.5-beta and 2.1.10-stable (#10064)
* Update CHANGELOG.md

* Update CHANGELOG-2.1.md

* Update docs/CHANGELOG-2.1.md

Co-Authored-By: Tbaut <33178835+Tbaut@users.noreply.github.com>

* Update docs/CHANGELOG-2.1.md

Co-Authored-By: Tbaut <33178835+Tbaut@users.noreply.github.com>

* Use - instead of *
2018-12-14 16:48:36 +01:00
mattrutherford 60718225ac
Implement len caching for parking_lot RwLock (#10032)
- Refactor (and rename crate) and implement RwLock len cache.

- improve docs

- update ethcore verification queue to new version

- Implement Default, From,  also derive Debug

- update: parking_lot to 0.7
2018-12-13 18:07:56 +00:00
Pierre Krieger 1a2fc03083 Update parking_lot to 0.7 (#10050) 2018-12-11 17:22:55 +01:00
Tomasz Drwięga 61e8baee0c Bump crossbeam. (#10048) 2018-12-11 12:30:21 +00:00
Afri Schoedon dbc5f55da9 ethcore: enable constantinople on ethereum (#10031)
* ethcore: change blockreward to 2e18 for foundation after constantinople

* ethcore: delay diff bomb by 2e6 blocks for foundation after constantinople

* ethcore: enable eip-{145,1014,1052,1283} for foundation after constantinople
2018-12-11 12:06:04 +08:00
Tomasz Drwięga 81b7698428 Strict empty steps validation (#10041)
* Add two failings tests for strict empty steps.

* Implement strict validation of empty steps.
2018-12-10 18:58:38 +00:00
Lazaridis 4ce4bad383 Center the Subtitle, use some CAPS (#10034) 2018-12-10 21:45:48 +08:00
cheme 23d25a079b Change test miner max memory to malloc reports. (#10024) 2018-12-07 09:11:16 +01:00
Anton Gavrilov d19bdb642e Sort the storage for private state (#10018) 2018-12-06 13:02:15 +03:00
mattrutherford 2e0246a6c2
Fix: test corpus_inaccessible panic (#10019)
If system uptime is less than the duration in the test, thread
will panic due to: 'overflow when subtracting duration from instant'.

Changed duration to 20 seconds to make it unlikely the test will
fail due to this condition.

Since no operations that carry a similar risk of panic occur outside
of the tests, it doesn't seem warranted to depend on an external crate
to fix this.
2018-12-05 15:38:55 +00:00
Afri Schoedon 349098e7b2
ci: move future releases to ethereum subdir on s3 (#10017)
* ci: move future releases to ethereum subdir on s3

* ci: redesign s3 bucket logic

* ci: use the releases bucket
2018-12-05 15:02:37 +01:00
Andronik Ordian dc3b1ecdd0 light(on_demand): decrease default time window to 10 secs (#10016)
* light(on_demand): decrease default time window to 10 secs

* light(on_demand): use secs units for cli options
2018-12-05 19:17:26 +08:00
Niklas Adolfsson 7fb33796b1 light client : failsafe crate (circuit breaker) (#9790)
* refactor(light) : N/W calls with `circuit breaker`

* fix(nits) : forgot to commit new files

* Add tests and change CLI args

* Address grumbles

* fix(failsafe-rs) : Santize input to prevent panics

* chore(failsafe) : bump failsafe, (parking_lot)

Bump failsafe to v0.3.0 to enable `parking_lot::Mutex` instead
`spin::Mutex`

* Remove `success_rate`

* feat(circuit_breaker logger)

* feat(CLI): separate CLI args request and response

* Fix tests

* Error response provide request kind

When a reponse `times-out` provide the actual request or requests that failed

* Update ethcore/light/src/on_demand/mod.rs

Co-Authored-By: niklasad1 <niklasadolfsson1@gmail.com>

* Update ethcore/light/src/on_demand/mod.rs

Co-Authored-By: niklasad1 <niklasadolfsson1@gmail.com>

* fix(grumbles): formatting nit

* fix(grumbles)

* Use second resolution on CLI args
* Use `consecutive failure policy` instead of `timeOverWindow`
* Add a couple of tests for `request_guard`

* fix(request_guard): off-by-one error, update tests
2018-12-05 10:36:53 +01:00
mattrutherford ec886ddefb
LenCachingMutex (#9988)
New util LenCachingMutex can be used in place of a Mutex, when working
with collections, or other types with a len() method. When
the Guard is dropped, the value returned from len() is stored
into an AtomicUsize and can be queried using load_len() without
needing to lock the Mutex. Implementations for ```Vec``` and
```VecDeque```.

Now used in [Verification](4ded4181a6/ethcore/src/verification/queue/mod.rs (L196)) so that calls to ```VerificationQueue.queue_info()```
no longer require locks.
2018-12-04 14:30:52 +00:00
Anton Gavrilov 4ded4181a6 Version and notification for private contract wrapper added (#9761)
* Version and notification for private contract wrapper added

* Error handling improved

* Style for comments in file fixed

* TODO issue added into comments
2018-12-03 19:44:36 +00:00
Wei Tang 60691d03e0
Handle failing case for update account cache in require (#9989) 2018-12-03 23:26:39 +08:00
Anton Gavrilov 869fa399b1 Add tokio runtime to ethcore io worker (#9979)
* Add tokio runtime to ethcore io worker

* Reworked with block_on_all
2018-12-03 22:35:46 +08:00
Andronik Ordian 7af953fd62
move daemonize before creating account provider (#10003)
* move daemonize before creating account provider

* daemonize: add a future-proofing comment
2018-11-30 17:22:41 +03:00
Afri Schoedon 5acbcb0d57
docs: update changelogs (#9990)
* docs: add changelog for 2.1.7 stable

* docs: add changelog for 2.2.2.2.2.2... :)
2018-11-30 13:30:40 +01:00
Andronik Ordian 7000c394b2 Fix daemonize (#10000)
* Revert "prevent silent errors in daemon mode, closes #9367 (#9946)"

This reverts commit 52d5278a62.

* deps(daemonize): switch back to crates.io
2018-11-30 12:39:30 +01:00
Nicolas Gotchac 7c0d894ccf Fix Bloom migration (#9992)
* Fix wrong block number in blooms migration

* Fix wrong `const` type (usize -> u64) 😬
2018-11-30 12:08:20 +08:00
Wei Tang f092c10de5
Remove tendermint engine support (#9980)
* Remove tendermint engine support

* Remove tendermint test json spec

* Fix ethcore test compile

* Remove tendermint test in sync
2018-11-29 06:47:11 +08:00
Anton Gavrilov 7f5e6b3a0a Calculate gas for deployment transaction (#9840)
* Calculate gas for deployment transaction

* Space fixed

* ethcore: style fix in public_creation_transaction
2018-11-28 13:14:40 +01:00
Nicolas Gotchac 5e9dc185a5 Fix unstable peers and slowness in sync (#9967)
* Don't sync all peers after each response

* Update formating

* Fix tests: add `continue_sync` to `Sync_step`

* Update ethcore/sync/src/chain/mod.rs

Co-Authored-By: ngotchac <ngotchac@gmail.com>
2018-11-28 12:19:35 +01:00
Seun LanLege 0e94ac0111 adds parity_verifySignature RPC method (#9507)
* closes #7009

adds parity_verifySignature RPC method

* removed unneccesary into

* adds support for chain replay protected signatures

* corrected chain replay protection check

* corrected possible overflow

* added tests

* use checked_sub to prevent possible overflow

* use saturating_mul to prevent possible overflow

* changed method signature to accept r,s,v components

* added unit tests

* more tests

* refactored tests for better readability
moved verify_signature tests to live in the same file.

* removed unneccesary imports

* fixed PR grumbles

* fixed rsv notation

* fixed rsv notation

* renamed BasicAcount to RecoveredAccount, Support zero chain_id

* fixed compile errors

* fixed tests

* doc comment
2018-11-28 12:18:43 +01:00
Tomasz Drwięga 0b5bbf6048 Improve block and transaction propagation (#9954)
* Refactor sync to add priority tasks.

* Send priority tasks notifications.

* Propagate blocks, optimize transactions.

* Implement transaction propagation. Use sync_channel.

* Tone down info.

* Prevent deadlock by not waiting forever for sync lock.

* Fix lock order.

* Don't use sync_channel to prevent deadlocks.

* Fix tests.
2018-11-28 11:30:05 +01:00
Wei Tang 14c9cbd40e
Deny unknown fields for chainspec (#9972)
* Add deny_unknown_fields to chainspec

* Add tests and fix existing one

* Remove serde_ignored dependency for chainspec

* Fix rpc test eth chain spec

* Fix starting_nonce_test spec
2018-11-28 06:21:31 +08:00
gabriel klawitter c4466878cf fix docker build (#9971) 2018-11-27 12:51:42 +01:00
Afri Schoedon c584221fa2
ci: rearrange pipeline by logic (#9970)
* ci: rearrange pipeline by logic

* ci: rename docs script
2018-11-27 12:51:27 +01:00
Afri Schoedon 70ba050c06
Add changelogs for 2.0.9, 2.1.4, 2.1.6, and 2.2.1 (#9963)
* docs: add changelog for parity 2.0.9 stable (eol)

* docs: add changelog for parity 2.1.4 beta and 2.1.6 stable

* docs: add changelogs for 2.2.1 beta

* docs: add releasenotes for 2.2
2018-11-26 20:18:56 +01:00
Seun LanLege f2281dc38a Add Error message when sync is still in progress. (#9475)
* closes #9188

* check_for_unavailable_block in
eth_getTransactionByHash
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionReceipt

* check for unavailable block in eth_getBlockByNumber

* corrected checks for unavailable_block

* check for block gaps in db

* corrected error messages

* corrected error information

* added allow-empty-block-result cli flag

* address grumbles

* --jsonrpc-allow-missing-blocks

* fix tests

* added checks to
    block_transaction_count_by_hash
    block_transaction_count_by_number
    block_uncles_count_by_hash
    block_uncles_count_by_number
    uncle_by_block_hash_and_index
    uncle_by_block_number_and_index
fix PR grumbles

* Update parity/cli/mod.rs

revert config name

Co-Authored-By: seunlanlege <seunlanlege@gmail.com>

* Update parity/cli/mod.rs

revert cli arg

Co-Authored-By: seunlanlege <seunlanlege@gmail.com>

* Apply suggestions from code review

revert config name

Co-Authored-By: seunlanlege <seunlanlege@gmail.com>

* fix PR grumbles

* fix more PR grumbles
2018-11-27 02:58:27 +08:00
Wei Tang 18a2e6265d Make CALLCODE to trace value to be the code address (#9881) 2018-11-26 12:21:55 +01:00
Nicolas Gotchac 0d593199d0 Fix light client informant while syncing (#9932)
* Add `is_idle` to LightSync to check importing status

* Use SyncStateWrapper to make sure is_idle gets updates

* Update is_major_import to use verified queue size as well

* Add comment for `is_idle`

* Add Debug to `SyncStateWrapper`

* `fn get` -> `fn into_inner`
2018-11-26 14:05:02 +03:00
cheme 832c4a7565 Add a optional json dump state to evm-bin (#9706)
* Add a dump of the state at the end of transaction for --json-test.
Also fixes json-test output on finish, and allow to put both on err or
out (--out-only and --err-only).

* Dump state resolution from trie, function behind evm-bin feature to avoid misuse.

* Rename 'slow' method to 'to_pod_full'.
Use cache first in 'to_pod_full', for in between commits case.
Change dump activation to use a function pointer instead.

* Fix tests.

* Query and add storage values to dump.

* Switch to use `require` method, even if less efficient it is better in
this case to reuse existing code.
Reuse of `storage_at` was not easy in this case (could not iterate and
use the method at the same time (refcell mutable borrow panics) so
keeping code as is.

* Switch to returning error.
Use 'base_storage_root' instead of 'storage_root'.
Added a test, it will only execute with json-test in ci, or when launch
with the feature.

* Renaming of command line parameters.
Comments fixes.
Minor code changes.

* Fix evmbin cmd parsing test.

* README update.

* Fix extra space and avoid clone call on copiable address.

* Revert test submodule.

* Revert wasm-test submodule.

* Use map_or instead of map + unwrap_or

* restore tests submodule
2018-11-25 20:12:59 +01:00
Wei Tang 34d22a35dd Disable EIP-98 transition by default (#9955)
* Change eip98Transition default to BlockNumber::max_value

* Remove accidential ethereum/tests submodule change
2018-11-25 19:59:27 +01:00
Nick Sanders c880716f16 Remove secret_store runtimes. (#9888)
* Remove the independent runtimes from `KeyServerHttpListener` and
  `KeyServerCore` and instead require a `parity_runtime::Executor`
  to be passed upon creation of each.

* Remove the `threads` parameter from both `ClusterConfiguration` structs.

* Implement the `future::Executor` trait for `parity_runtime::Executor`.

* Update tests.
  - Update the `loop_until` function to instead use a oneshot to signal
    completion.
  - Modify the `make_key_servers` function to create and return a runtime.
2018-11-26 01:36:43 +08:00
Nicolas Gotchac f20f4c74d2 Fix a deadlock (#9952)
* Update informant:
  - decimal in Mgas/s
  - print every 5s (not randomly between 5s and 10s)

* Fix dead-lock in `blockchain.rs`

* Update locks ordering
2018-11-25 15:53:41 +08:00
Niklas Adolfsson 1fdfa1e6c6 chore(eip712): remove unused `failure-derive` (#9958) 2018-11-23 16:42:44 +00:00
Sebastian Siemssen 4ee49f03df Do not use the home directory as the working dir in docker (#9834)
* Do not create a home directory.

* Re-add -m flag
2018-11-22 14:15:04 +00:00
Seun LanLege 52d5278a62 prevent silent errors in daemon mode, closes #9367 (#9946) 2018-11-22 05:41:23 +08:00
Tomasz Drwięga 35a2b87174 Fix empty steps (#9939)
* Don't send empty step twice or empty step then block.

* Perform basic validation of locally sealed blocks.

* Don't include empty step twice.
2018-11-21 21:30:03 +00:00
Nicolas Gotchac 664bb2becd Adjust requests costs for light client (#9925)
* PIP Table Cost relative to average peers instead of max peers

* Add tracing in PIP new_cost_table

* Update stat peer_count

* Use number of leeching peers for Light serve costs

* Fix test::light_params_load_share_depends_on_max_peers (wrong type)

* Remove (now) useless test

* Remove `load_share` from LightParams.Config
Prevent div. by 0

* Add LEECHER_COUNT_FACTOR

* PR Grumble: u64 to u32 for f64 casting

* Prevent u32 overflow for avg_peer_count

* Add tests for LightSync::Statistics
2018-11-21 20:11:01 +01:00
Simon Jentzsch 8865b95818 EIP-1186: add `eth_getProof` RPC-Method (#9001)
* added eth_getAccount

* changed to getProof

* implemented storage_proof

* better formatting of storage proof

* fixed imports;2C

* removed spaces

* fixed whitespace

* fixed docker

* added doc

* fixed Compile-error

* expose more ports

* added eth_getAccount

* changed to getProof

* implemented storage_proof

* better formatting of storage proof

* fixed docker

* removed slockit-changes

* fixed Dockerfile

* intend

* spaces

* removed spaces

* fixed whitespace

* fixed docker

* tabs

* fixed Compile-error

* added eth_getAccount

* changed to getProof

* implemented storage_proof

* fixed docker

* removed slockit-changes

* fixed Dockerfile

* intend

* spaces

* removed spaces

* fixed whitespace

* fixed docker

* tabs

* merged changes

* fixed warnings

* added eth_getAccount

* changed to getProof

* implemented storage_proof

* better formatting of storage proof

* Update Dockerfile

* fixed docker

* removed slockit-changes

* fixed Dockerfile

* intend

* spaces

* removed spaces

* fixed whitespace

* fixed docker

* tabs

* added eth_getAccount

* changed to getProof

* implemented storage_proof

* removed spaces

* fixed whitespace

* fixed docker

* added eth_getAccount

* changed to getProof

* implemented storage_proof

* better formatting of storage proof

* fixed docker

* removed slockit-changes

* fixed Dockerfile

* intend

* spaces

* removed spaces

* fixed whitespace

* fixed docker

* tabs

* merged changes

* fixed merge error

* fixed formatting

* fixed rename_all = "camelCase"

* fixed tabs

* fixed spaces

* removed port exposer

* formatting

* fixed comment

* use filter_map

* formatting

* use better variable names

* changed casting

* fixed tabs

* remote into() from address

* remove space

Co-Authored-By: simon-jentzsch <simon@slock.it>

* fixed storage_index

Co-Authored-By: simon-jentzsch <simon@slock.it>

* fixed clone

* fixed format

Co-Authored-By: simon-jentzsch <simon@slock.it>

* fixed empty lines

* removed Option from EthAccount

* fixed storage_index

* implemented test and fixed the struct-spaces

* fixed tests

* added experimental RPCs flag for getProof

* optmized code
2018-11-21 20:09:33 +01:00
mattrutherford 03600dce97
Missing blocks in filter_changes RPC (#9947)
* feat + fix: Missing blocks in filter_changes RPC

 * Implement validity check of reported hashes (in case of re-org) and re-set last_block to the last block reported that is still valid.

* Add const to set history size for validity check (32).

* test: in the case of a re-org we get same block number if hash is different
2018-11-21 15:50:41 +00:00
gabriel klawitter 8b607efc40
allow rust-nightly builds fail in nightly builds (#9944) 2018-11-20 11:17:03 +01:00
Reyk Floeter 9f1af6b3e8 Update eth-secp256k1 to include fix for BSDs (#9935) 2018-11-18 14:22:59 +08:00
Reyk Floeter c0952ba44b Unbreak build on rust -stable (#9934) 2018-11-17 23:51:35 +00:00
Nicolas Gotchac 9475a2e474 Keep existing blocks when restoring a Snapshot (#8643)
* Rename db_restore => client

* First step: make it compile!

* Second step: working implementation!

* Refactoring

* Fix tests

* PR Grumbles

* PR Grumbles WIP

* Migrate ancient blocks interating backward

* Early return in block migration if snapshot is aborted

* Remove RwLock getter (PR Grumble I)

* Remove dependency on `Client`: only used Traits

* Add test for recovering aborted snapshot recovery

* Add test for migrating old blocks

* Fix build

* PR Grumble I

* PR Grumble II

* PR Grumble III

* PR Grumble IV

* PR Grumble V

* PR Grumble VI

* Fix one test

* Fix test

* PR Grumble

* PR Grumbles

* PR Grumbles II

* Fix tests

* Release RwLock earlier

* Revert Cargo.lock

* Update _update ancient block_ logic: set local in `commit`

* Update typo in ethcore/src/snapshot/service.rs

Co-Authored-By: ngotchac <ngotchac@gmail.com>
2018-11-18 00:06:34 +01:00
Tomasz Drwięga 5baed0c158 Add experimental RPCs flag (#9928)
* WiP

* Enable experimental RPCs.
2018-11-16 14:00:34 +01:00
Tomasz Drwięga 97c259858c Clarify poll lifetime (#9922)
* Clarify poll filter.

* Fix RPC test.
2018-11-16 11:39:29 +00:00
Niklas Adolfsson 0f90696528 docs(require rust 1.30) (#9923)
* docs(require rust 1.30)

* Update README.md

Co-Authored-By: niklasad1 <niklasadolfsson1@gmail.com>
2018-11-15 12:53:11 +01:00
Nicolas Gotchac ac974a180d Use block header for building finality (#9914) 2018-11-14 13:05:49 +01:00
TriplEight 052380b8de
simplify cargo audit (#9918) 2018-11-14 11:46:10 +01:00
Niklas Adolfsson 23a29439c0 light-fetch: Differentiate between out-of-gas/manual throw and use required gas from response on failure (#9824)
* fix start_gas, handle OOG exceptions & NotEnoughGas

* Change START_GAS: 50_000 -> 60_000
* When the `OutOfGas exception` is received then try to double the gas until it succeeds or block gas limit is reached
* When `NotEnoughBasGas error` is received then use the required gas provided in the response

* fix(light-fetch): ensure block_gas_limit is tried

Try the `block_gas_limit` before regard the execution as an error

* Update rpc/src/v1/helpers/light_fetch.rs

Co-Authored-By: niklasad1 <niklasadolfsson1@gmail.com>
2018-11-14 13:04:33 +03:00
Seun LanLege a8617e2862
EIP 191 (#9701)
* added sign_191 rpc method

* fixed hash_structured_data return type

* added ConfirmationPayload::SignMessage for non-prefixed signatures, added tests for sign191

* renamed WithValidator -> PresignedTransaction

* rename applicationData to data in test

* adds docs for EIP191Version, renamed SignRequest to EIP191SignRequest
2018-11-14 09:02:40 +01:00
Niklas Adolfsson 6945a6b320 fix(logger): `reqwest` no longer a dependency (#9908) 2018-11-13 16:19:58 +00:00
Pierre Krieger b375c9adbf Remove rust-toolchain file (#9906) 2018-11-13 18:23:17 +03:00
Thibaut Sardan 88a727739b
foundation: #6692865, ropsten: #4417537, kovan: #9363457 (#9907) 2018-11-13 14:48:23 +01:00
André Silva 5f3ae4dee3 ethcore: use Machine::verify_transaction on parent block (#9900)
* ethcore: use Machine::verify_transaction on parent block

also fixes off-by-one activation of transaction permission contract

* ethcore: clarify call to verify_transaction
2018-11-13 14:58:53 +03:00
Niklas Adolfsson 5cbe834024 chore(rpc-tests): remove unused rand (#9896) 2018-11-12 13:41:05 +03:00
mattrutherford eea5b86cc4 fix: Intermittent failing CI due to addr in use (#9885)
Allow OS to set port at runtime
2018-11-11 11:20:04 +01:00
Niklas Adolfsson 09c512abaa chore(bump docopt): 0.8 -> 1.0 (#9889) 2018-11-11 11:19:44 +01:00
zhangyaning d42d816e7f Use expect (#9883) 2018-11-09 14:54:23 +03:00
Nicolas Gotchac 17effd15ab Use Weak reference in PubSubClient (#9886) 2018-11-09 11:51:49 +00:00
Afri Schoedon 9982eba188 ci: nuke the gitlab caches (#9855)
Will go without cache. Meanwhile have to investigate what was wrong and how to use it effectively.
2018-11-08 19:37:12 +01:00
zhangyaning aafe527d4a Remove unused code (#9884) 2018-11-08 13:20:02 +01:00
Wei Tang e4c53a460e
Fix json tracer overflow (#9873)
* Fix json tracer overflow

* Replace trace_executed with a direct trace push

* Remove unused variable

* Add test for 5a51

* Remove duplicate json!
2018-11-08 03:04:36 +08:00
cheme ca01596a65 Allow to seal work on latest block (#9876)
* Allow to seal work on latest block.

* Test from @todr to check sealing conditions.
2018-11-07 17:59:08 +00:00
Afri Schoedon 4f2415b483 Fix docker script (#9854)
* Dockerfile: change source path of the newly added check_sync.sh (#9869)
2018-11-07 15:53:22 +01:00
Tomasz Drwięga f680eacdf2 Health endpoint (#9847)
* Health endpoint.

* Fix chain handling.

* Update to latest json-rpc.

* Change dev chain detection.

* Fix test.
2018-11-07 09:30:34 +01:00
gabriel klawitter f6dcca3ebb
gitlab-ci: make android release build succeed (#9743)
* use docker cargo config file for android builds

* make android build succeed
2018-11-06 20:26:05 +01:00
Wei Tang 1a642fc624
Clean up existing benchmarks (#9839)
* Add FIXME link for a state mod statement

* Remove unused benches feature in ethcore

* Fix evm benches compile

* Fix ethash benches compile

* Switch to criterion
2018-11-06 21:22:44 +08:00
Yohan Graterol c4469514db Update Callisto block reward code to support HF1 (#9811)
* Add Callisto Mainnet support

* Remove merge failure

* EIP-649 removed

* Remove eip649Reward

* Modify difficultyBombDelays

* Callisto reward smart contract

* Remove ethash params

* Fix merge

* Update bootnodes

* Update block reward to support HF1
2018-11-06 14:07:59 +08:00
Tomasz Drwięga 59daf95859 Option to disable keep alive for JSON-RPC http transport (#9848)
* Keep alive jsonrpc CLI option.

* Update to latest json-rpc.

* Keep alive flag.
2018-11-05 22:39:51 +08:00
Yaz Khoury 3a6e04ba15 Classic.json Bootnode Update (#9828)
* fix: Update bootnodes list to only responsive nodes

* feat: Add more bootnodes to classic.json list

* feat: Add retested bootnodes
2018-11-01 11:30:34 +01:00
Jonathan Brown b26f86d6ff Support MIX. (#9767)
* Support MIX.

* Re-arrange mix.json so tests pass.

* Add MIX hardfork.

* Fix MIX chain specification.

* Use original MIX datadir.

* Fix MIX Newark enode.
2018-11-01 11:06:53 +01:00
Afri Schoedon 570215acae
ci: remove failing tests for android, windows, and macos (#9788)
* ci: remove failing tests for android, windows, and macos

* ci: restore android build jobs
2018-11-01 11:06:24 +01:00
cheme a511264433 Implement NoProof for json tests and update tests reference (replaces #9744) (#9814)
* Update test reference.
Block test are really not working so I disabled a few by commenting
directly in source.

* Move ethtest commit cursor.

* Implements 'NoProof' engine from https://github.com/ethereum/tests/issues/464 .

Since tests has been regenerated those one were failing on block
difficulty check.

Update ethereum/tests, waiting for cost fix (block test are still
commented).

* Update tests submodule reference to latest (all test passing except an
identified case).
Fix block reward of constantinople json.

* Restore broken test by using old json tests files.

* Use CanonNoSeal instead of a custom engine, still have to include some
additional tests code.

* Gas upper limit check in json_chain test was bad, moving the test to
verification, the test is running in `verify_header_param`.
Note that test was previously only for ethash, and now for any engine.

* Restore old behavior (gas uper limit only for ethash engine), at the
cost of an additional trait method.

* Proper rpc test fix.

* Update tests submodule, add SStore bug tests.

* Fix json issue tabulation.
Update tests submodule to latest master (lot of new sstore tests
passing)

* Switch ethereum/tests to tag 6.0.0-beta.1 (no tests changes from latest
synch).

* Display hex with separator, use indirection instead of clone for copy
types.
2018-11-01 11:04:32 +01:00
Niklas Adolfsson 06f25d2b27 chore(bump regex) (#9842) 2018-11-01 13:16:02 +08:00
Anton Gavrilov a3bd355b16 Ignore global cache for patched accounts (#9752)
* Ignore global cache for patched accounts

* Rollback patched account flag

* Store root in checkpoint storage
2018-10-31 15:55:11 +00:00
Wei Tang 1c1cd8b164
Move state root verification before gas used (#9841) 2018-10-31 22:44:46 +08:00
Niklas Adolfsson a898109522 fix(docker-aarch64) : cross-compile config (#9798) 2018-10-31 12:39:18 +00:00
Afri Schoedon 3694b10e22 version: bump nightly to 2.3.0 (#9819)
* version: bump nightly to 2.3.0

* Revert Cargo.lock
2018-10-31 12:38:47 +00:00
cheme 39f25d20a8 Tests modification for windows CI (#9671)
* Fixing and disabling some tests for windows 10 compatibility.

* Few adjustment for windows in tests (eg bigger timeout for keyserver tests)

* Spaces and temporary single thread ci (to be able to spot the error).
2018-10-31 11:50:38 +01:00
Seun LanLege 61c1646b43 EIP-712 implementation (#9631)
* EIP-712 impl

* added more tests

* removed size parsing unwrap

* corrected TYPE_REGEX to disallow zero sized fixed length arrays, replaced LinkedHashSet with IndexSet, added API spec to docs, fixed Type::Byte encoding branch

* use Option<u64> instead of u64 for Type::Array::Length

* replace `.iter()` with  `.values()`

Co-Authored-By: seunlanlege <seunlanlege@gmail.com>

* tabify eip712.rs

* use proper comments for docs

* Cargo.lock: revert unrelated changes

* tabify encode.rs
2018-10-31 00:12:42 +03:00
Niklas Adolfsson 1b9396dcbb Fix typo (#9826) 2018-10-29 21:41:54 +01:00
Wei Tang 05be4b5b0e
Clean up serde rename and use rename_all = camelCase when possible (#9823)
* Clean up serde rename and use rename_all = camelCase when possible

* snake_case for pricing

* Use camelcase for engine

* Use camel case for seal

* Use camel case for validator set

* Use camel case for confirmation payload

* Use camel case for consensus status

* Use camel case for nodekind

* Use kebab case for provenance

* Use camel case for pubsub

* Use lowercase and camelcase for trace

* Use camel case for whisper

* rename Ethash as irregular name
2018-10-29 23:49:04 +08:00
Kirill Fomichev f8f8bf0fea RPC: parity_allTransactionHashes (#9745)
* rpc: add parity_allTransactionHashes

* Add light_all_transactionst to helpers

* Remove extra parentheses

* Move light_all_transactions to light_fetch

* Remove LightDispatcher import in light_fetch
2018-10-27 09:38:35 +02:00
Andronik Ordian 6643b6a306 Revert "prevent zero networkID (#9763)" (#9815)
This reverts commit 73f08b376f.
2018-10-27 02:53:19 +08:00
Wei Tang 7036ab26d7
Allow zero chain id in EIP155 signing process (#9792)
* Allow zero chain id in EIP155 signing process

* Rename test

* Fix test failure
2018-10-26 22:44:02 +08:00
Azamat M 9b55169251 Add readiness check for docker container (#9804)
* Update Dockerfile

Since parity is built for "mission critical use", I thought other operators may see the need for this.

Adding the `curl` and `jq` commands allows for an extremely simple health check to be usable in container orchestrators.

For example. Here is a health check for a parity docker container running in Kubernetes.

This can be setup as a readiness Probe that would prevent clustered nodes that aren't ready from serving traffic.

```bash
#!/bin/bash

ETH_SYNCING=$(curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost:8545 -H 'Content-Type: application/json')
RESULT=$(echo "$ETH_SYNCING | jq -r .result)

if [ "$RESULT" == "false" ]; then
  echo "Parity is ready to start accepting traffic"
  exit 0
else
  echo "Parity is still syncing the blockchain"
  exit 1
fi
```

* add sync check script
2018-10-26 13:51:08 +02:00
Wei Tang ff13c9c186
Insert dev account before unlocking (#9813) 2018-10-26 19:44:53 +08:00
felix 879e7305ca removed "rustup" & added new runner tag (#9731)
* removed "rustup" & added new runner tag

* exchanged tag "rust-windows" with "windows"

* revert windows tag change
2018-10-26 13:39:44 +02:00
Wei Tang 1ff827b2ea Expose config max-round-blocks-to-import (#9439)
* Expose config max-round-blocks-to-import

* Fix test
2018-10-26 13:21:36 +02:00
André Silva e7f1204fa4 aura: finalize blocks (#9692)
* aura: emit ancestry actions for finalizing blocks

* aura: refactor is_epoch_end to get finalized blocks as argument

* ethcore: add is_epoch_end_light method to Engine

The full client now tracks finality by querying the engine on each block import,
and it also persists the finalization state to the DB. For the light client
current it doesn't persist finality information and only keeps track of finality
for epoch signals, by calling `is_epoch_end_light`. This method implements the
previously existing logic of building finality for all the blocks in the current
epoch and then checking the finalized blocks against the transition store.

* ethcore: allow finalizing current block

* aura: fix construction of finality proof

* aura: fix warnings

- missing docs for is_epoch_end_light
- unused method unfinalized_hashes in RollingFinality

* aura: fix clone on copy types
2018-10-25 17:33:41 +02:00
Andrew Jones 9a2c4a34ee
sync: retry different peer after empty subchain heads response (#9753)
* If no subchain heads then try a different peer

* Add log when useless chain head

* Restrict ChainHead useless peer to ancient blocks

* sync: replace `limit_reorg` with `block_set` condition
2018-10-25 16:56:59 +02:00
Niklas Adolfsson f4c421f77a fix(light-rpc/parity) : Remove unused client (#9802) 2018-10-24 12:55:24 +02:00
Seun LanLege fe84718b55 drops support for olympic testnet, closes #9800 (#9801) 2018-10-23 23:54:44 +08:00
Nick Sanders 15d71a01d5 Replace `tokio_core` with `tokio` (`ring` -> 0.13) (#9657)
* Replace `tokio_core` with `tokio`.

* Remove `tokio-core` and replace with `tokio` in

    - `ethcore/stratum`

    - `secret_store`

    - `util/fetch`

    - `util/reactor`

* Bump hyper to 0.12 in

    - `miner`

    - `util/fake-fetch`

    - `util/fetch`

    - `secret_store`

* Bump `jsonrpc-***` to 0.9 in

    - `parity`

    - `ethcore/stratum`

    - `ipfs`

    - `rpc`

    - `rpc_client`

    - `whisper`

* Bump `ring` to 0.13

* Use a more graceful shutdown process in `secret_store` tests.

* Convert some mutexes to rwlocks in `secret_store`.

* Consolidate Tokio Runtime use, remove `CpuPool`.

* Rename and move the `tokio_reactor` crate (`util/reactor`) to
  `tokio_runtime` (`util/runtime`).

* Rename `EventLoop` to `Runtime`.

    - Rename `EventLoop::spawn` to `Runtime::with_default_thread_count`.

    - Add the `Runtime::with_thread_count` method.

    - Rename `Remote` to `Executor`.

* Remove uses of `CpuPool` and spawn all tasks via the `Runtime` executor
  instead.

* Other changes related to `CpuPool` removal:

    - Remove `Reservations::with_pool`. `::new` now takes an `Executor` as an argument.

    - Remove `SenderReservations::with_pool`. `::new` now takes an `Executor` as an argument.
2018-10-23 11:14:45 +02:00
Nick Sanders abe30f2578 Replace `tokio_core` with `tokio` (`ring` -> 0.13) (#9657)
* Replace `tokio_core` with `tokio`.

* Remove `tokio-core` and replace with `tokio` in

    - `ethcore/stratum`

    - `secret_store`

    - `util/fetch`

    - `util/reactor`

* Bump hyper to 0.12 in

    - `miner`

    - `util/fake-fetch`

    - `util/fetch`

    - `secret_store`

* Bump `jsonrpc-***` to 0.9 in

    - `parity`

    - `ethcore/stratum`

    - `ipfs`

    - `rpc`

    - `rpc_client`

    - `whisper`

* Bump `ring` to 0.13

* Use a more graceful shutdown process in `secret_store` tests.

* Convert some mutexes to rwlocks in `secret_store`.

* Consolidate Tokio Runtime use, remove `CpuPool`.

* Rename and move the `tokio_reactor` crate (`util/reactor`) to
  `tokio_runtime` (`util/runtime`).

* Rename `EventLoop` to `Runtime`.

    - Rename `EventLoop::spawn` to `Runtime::with_default_thread_count`.

    - Add the `Runtime::with_thread_count` method.

    - Rename `Remote` to `Executor`.

* Remove uses of `CpuPool` and spawn all tasks via the `Runtime` executor
  instead.

* Other changes related to `CpuPool` removal:

    - Remove `Reservations::with_pool`. `::new` now takes an `Executor` as an argument.

    - Remove `SenderReservations::with_pool`. `::new` now takes an `Executor` as an argument.
2018-10-22 10:11:24 +02:00
Nick Sanders fdae48547b Replace `tokio_core` with `tokio` (`ring` -> 0.13) (#9657)
* Replace `tokio_core` with `tokio`.

* Remove `tokio-core` and replace with `tokio` in

    - `ethcore/stratum`

    - `secret_store`

    - `util/fetch`

    - `util/reactor`

* Bump hyper to 0.12 in

    - `miner`

    - `util/fake-fetch`

    - `util/fetch`

    - `secret_store`

* Bump `jsonrpc-***` to 0.9 in

    - `parity`

    - `ethcore/stratum`

    - `ipfs`

    - `rpc`

    - `rpc_client`

    - `whisper`

* Bump `ring` to 0.13

* Use a more graceful shutdown process in `secret_store` tests.

* Convert some mutexes to rwlocks in `secret_store`.

* Consolidate Tokio Runtime use, remove `CpuPool`.

* Rename and move the `tokio_reactor` crate (`util/reactor`) to
  `tokio_runtime` (`util/runtime`).

* Rename `EventLoop` to `Runtime`.

    - Rename `EventLoop::spawn` to `Runtime::with_default_thread_count`.

    - Add the `Runtime::with_thread_count` method.

    - Rename `Remote` to `Executor`.

* Remove uses of `CpuPool` and spawn all tasks via the `Runtime` executor
  instead.

* Other changes related to `CpuPool` removal:

    - Remove `Reservations::with_pool`. `::new` now takes an `Executor` as an argument.

    - Remove `SenderReservations::with_pool`. `::new` now takes an `Executor` as an argument.
2018-10-22 10:09:28 +02:00
Nick Sanders 68ca8df22f Replace `tokio_core` with `tokio` (`ring` -> 0.13) (#9657)
* Replace `tokio_core` with `tokio`.

* Remove `tokio-core` and replace with `tokio` in

    - `ethcore/stratum`

    - `secret_store`

    - `util/fetch`

    - `util/reactor`

* Bump hyper to 0.12 in

    - `miner`

    - `util/fake-fetch`

    - `util/fetch`

    - `secret_store`

* Bump `jsonrpc-***` to 0.9 in

    - `parity`

    - `ethcore/stratum`

    - `ipfs`

    - `rpc`

    - `rpc_client`

    - `whisper`

* Bump `ring` to 0.13

* Use a more graceful shutdown process in `secret_store` tests.

* Convert some mutexes to rwlocks in `secret_store`.

* Consolidate Tokio Runtime use, remove `CpuPool`.

* Rename and move the `tokio_reactor` crate (`util/reactor`) to
  `tokio_runtime` (`util/runtime`).

* Rename `EventLoop` to `Runtime`.

    - Rename `EventLoop::spawn` to `Runtime::with_default_thread_count`.

    - Add the `Runtime::with_thread_count` method.

    - Rename `Remote` to `Executor`.

* Remove uses of `CpuPool` and spawn all tasks via the `Runtime` executor
  instead.

* Other changes related to `CpuPool` removal:

    - Remove `Reservations::with_pool`. `::new` now takes an `Executor` as an argument.

    - Remove `SenderReservations::with_pool`. `::new` now takes an `Executor` as an argument.
2018-10-22 09:40:50 +02:00
HackyMiner b8da38f4e4 Support eth_chainId RPC method (#9783)
* Support eth_chainId RPC method

 * https://github.com/ethereum/EIPs/pull/695
 * Original PR is #6329

* rpc: remove parity_chainId
2018-10-21 03:13:23 +08:00
Afri Schoedon 1f103ab7f1
ethcore: bump ropsten forkblock checkpoint (#9775) 2018-10-18 15:54:42 +02:00
Afri Schoedon da6cf33aac
docs: changelogs for 2.0.8 and 2.1.3 (#9758)
* docs: add changelog for parity ethereum v2.1.3 beta

* docs: add changelog for parity ethereum v2.0.7 stable
2018-10-17 14:52:11 +02:00
Seun LanLege 73f08b376f prevent zero networkID (#9763)
* prevent zero networkID, closes #8345

Signed-off-by: Seun LanLege <seunlanlege@gmail.com>

* updated networkID of olymic chain spec

Signed-off-by: Seun LanLege <seunlanlege@gmail.com>
2018-10-17 07:47:11 +08:00
Yucong Sun ed34d1fee7 Skip seal fields count check when --no-seal-check is used (#9757)
* Skip seal fields count check when --no-seal-check is used

* Remove trailing whitespace
2018-10-16 18:24:47 +08:00
André Silva e9f4f1d13c aura: fix panic on extra_info with unsealed block (#9755)
* aura: fix panic when unsealed block passed to extra_info

* aura: use hex formatting for EmptyStep hashes

* aura: add test for extra_info
2018-10-15 18:05:53 +02:00
Afri Schoedon e5bb330be5
docs: update changelogs (#9742)
* docs: add changelog for 2.0.7 stable

* docs: add changelog for 2.1.2 beta
2018-10-15 18:01:35 +02:00
Svyatoslav Nikolsky e23e22cb81 removed extra assert in generation_session_is_removed_when_succeeded (#9738) 2018-10-15 16:02:09 +01:00
Wei Tang 7434026f5f
Make checkpoint_storage_at use plain loop instead of recursion (#9734)
* Make checkpoint_storage_at use plain loop instead of recursion

* Add target: "state" to warn!

* Use iterator::Skip
2018-10-15 22:06:56 +08:00
Wei Tang 5319d33bc6
Use signed 256-bit integer for sstore gas refund substate (#9746)
* Add signed refund

* Use signed 256-bit integer for sstore gas refund substate

* Fix tests

* Remove signed mod and use i128 directly

* Fix evm test case casting

* Fix jsontests ext signature
2018-10-15 17:09:55 +08:00
gabriel klawitter 702311b6b2 heads ref not present for branches beta and stable (#9741) 2018-10-12 13:45:28 +02:00
Yohan Graterol 2511bc20e0 Add Callisto support (#9534)
* Add Callisto Mainnet support

* Add new bootnodes

* Remove merge failure

* EIP-649 removed

* Remove eip649Reward

* Modify difficultyBombDelays

* Callisto reward smart contract

* Remove ethash params

* Fix merge
2018-10-11 11:03:57 +02:00
Wei Tang ce5a6eabae Add --force to cargo audit install script (#9735) 2018-10-11 10:53:00 +02:00
Marek Kotewicz 581cd97ba1
remove unused expired value from Handshake (#9732) 2018-10-10 23:17:17 +02:00
Thibaut Sardan fa2f99641f Add hardcoded headers (#9730)
* add foundation hardcoded header #6486017

* add ropsten hardcoded headers #4202497

* add kovan hardcoded headers #9023489
2018-10-10 17:37:10 +02:00
Andronik Ordian c40f7db1ab
produce portable binaries (#9725) 2018-10-10 14:52:15 +02:00
gabriel klawitter be1363e943
gitlab ci: releasable_branches: change variables condition to schedule (#9729) 2018-10-10 14:51:36 +02:00
David c313039526 Update a few parity-common dependencies (#9663)
* Update a few parity-common dependencies

* cleanup

* cleanup

* revert update of ethereum/tests

* better reporting of network rlp errors

* Use rlp 0.3.0-beta.1

* fix util function get_dummy_blocks

* Already a Vec

* encode_list returns vec already

* Address grumble

* No need for betas

* Fix double spaces
2018-10-09 22:07:25 +02:00
Vadim Arasev 73db5dda8c HF in POA Core (2018-10-22) (#9724)
https://github.com/poanetwork/poa-chain-spec/pull/87
2018-10-09 17:17:39 +02:00
gabriel klawitter 5a8fb77fb2 Schedule nightly builds (#9717)
* introduce SCHEDULE_TAG variable for gitlab scheduled nightly builds

* add refs for complex only statement in .gitlab-ci.yml
2018-10-09 15:32:07 +02:00
Andrew Jones 4b6ebcbb61 Fix ancient blocks sync (#9531)
* Log block set in block_sync for easier debugging

* logging macros

* Match no args in sync logging macros

* Add QueueFull error

* Only allow importing headers if the first matches requested

* WIP

* Test for chain head gaps and log

* Calc distance even with 2 heads

* Revert previous commits, preparing simple fix

This reverts commit 5f38aa885b22ebb0e3a1d60120cea69f9f322628.

* Reject headers with no gaps when ChainHead

* Reset block sync download when queue full

* Simplify check for subchain heads

* Add comment to explain subchain heads filter

* Fix is_subchain_heads check and comment

* Prevent premature round completion after restart

This is a problem on mainnet where multiple stale peer requests will
force many rounds to complete quickly, forcing the retraction.

* Reset stale old blocks request after queue full

* Revert "Reject headers with no gaps when ChainHead"

This reverts commit 0eb865539e5dee37ab34f168f5fb643300de5ace.

* Add BlockSet to BlockDownloader logging

Currently it is difficult to debug this because there are two instances,
one for OldBlocks and one for NewBlocks. This adds the BlockSet to all
log messages for easy log filtering.

* Reset OldBlocks download from last enqueued

Previously when the ancient block queue was full it would restart the
download from the last imported block, so the ones still in the queue would be
redownloaded. Keeping the existing downloader instance and just
resetting it will start again from the last enqueued block.:wq

* Ignore expired Body and Receipt requests

* Log when ancient block download being restarted

* Only request old blocks from peers with >= difficulty

https://github.com/paritytech/parity-ethereum/pull/9226 might be too
permissive and causing the behaviour of the retraction soon after the
fork block. With this change the peer difficulty has to be greater than
or euqal to our syncing difficulty, so should still fix
https://github.com/paritytech/parity-ethereum/issues/9225

* Some logging and clear stalled blocks head

* Revert "Some logging and clear stalled blocks head"

This reverts commit 757641d9b817ae8b63fec684759b0815af9c4d0e.

* Reset stalled header if useless more than once

* Store useless headers in HashSet

* Add sync target to logging macro

* Don't disable useless peer and fix log macro

* Clear useless headers on reset and comments

* Use custom error for collecting blocks

Previously we resued BlockImportError, however only the Invalid case and
this made little sense with the QueueFull error.

* Remove blank line

* Test for reset sync after consecutive useless headers

* Don't reset after consecutive headers when chain head

* Delete commented out imports

* Return DownloadAction from collect_blocks instead of error

* Don't reset after round complete, was causing test hangs

* Add comment explaining reset after useless

* Replace HashSet with counter for useless headers

* Refactor sync reset on bad block/queue full

* Add missing target for log message

* Fix compiler errors and test after merge

* ethcore: revert ethereum tests submodule update
2018-10-09 15:31:40 +02:00
Afri Schoedon bc056c41bc
CI: Skip docs job for nightly (#9693)
* ci: force-tag wiki changes

* ci: force-tag wiki changes

* ci: skip docs job for master and nightly

* ci: revert docs job checking for nightly tag

* ci: exclude docs job from nightly builds in gitlab script
2018-10-09 12:50:31 +02:00
Niklas Adolfsson 5b54442a48
fix (light/provider) : Make `read_only executions` read-only (#9591)
* `ExecutionsRequest` from light-clients as read-only

This changes so all `ExecutionRequests` from light-clients are executed
as read-only which the `virtual``flag == true ensures.

This boost up the current transaction to always succeed

Note, this only affects `eth_estimateGas` and `eth_call` AFAIK.

* grumbles(revert renaming) : TransactionProof

* grumbles(trace) : remove incorrect trace

* grumbles(state/prove_tx) : explicit `virt`

Remove the boolean flag to determine that a `state::prove_transaction`
whether it should be executed in a virtual context or not.

Because of that also rename the function to
`state::prove_transction_virtual` to make more clear
2018-10-08 21:30:46 +02:00
André Silva dc14cce7a9 ethcore: fix detection of major import (#9552)
* sync: set state to idle after sync is completed

* sync: refactor sync reset
2018-10-08 12:04:38 +01:00
David 4f278ba715
return 0 on error (#9705) 2018-10-05 12:23:04 +02:00
Afri Schoedon 1036fcca36 ethcore: delay ropsten hardfork (#9704) 2018-10-05 15:09:42 +08:00
Marek Kotewicz 6b286a5dee make instantSeal engine backwards compatible, closes #9696 (#9700) 2018-10-04 15:08:20 +02:00
Wei Tang c8ae675b95
Implement CREATE2 gas changes and fix some potential overflowing (#9694)
* Implement CREATE2 gas changes and fix some potential overflowing

* Ignore create2 state tests

* Split CREATE and CREATE2 in gasometer

* Generalize rounding (x + 31) / 32 to to_word_size
2018-10-04 20:50:18 +08:00
Tomasz Drwięga 4186467129 Don't hash the init_code of CREATE. (#9688) 2018-10-04 12:32:04 +01:00
André Silva 726884afcb ethcore: minor optimization of modexp by using LR exponentiation (#9697) 2018-10-04 12:29:53 +01:00
Marek Kotewicz 5a2f3e700b removed redundant clone before each block import (#9683)
* removed redundant clone before each block import

* Fix a trival typo
2018-10-04 01:44:58 +08:00
EOS Classic 911fc74346 Add Foundation Bootnodes (#9666) 2018-10-04 00:01:22 +08:00
Lorenzo Manacorda 1388f4d27e Docker: run as parity user (#9689) 2018-10-03 13:10:05 +01:00
André Silva 5b87327a43 ethcore: mcip3 block reward contract (#9605)
* Use static call and apparent value transfer for block reward contract code

* ethcore: implement musicoin block reward logic with contract

* ethcore: update musicoin block reward contract bytecode

* ethcore: add comment with source of musicoin block reward contract

* ethcore: remove unused mcip6_byz chain spec
2018-10-03 12:44:43 +01:00
Jim Posen 2fc1679886 Verify block syncing responses against requests (#9670)
* sync: Validate received BlockHeaders packets against stored request.

* sync: Validate received BlockBodies and BlockReceipts.

* sync: Fix broken tests.

* sync: Unit tests for BlockDownloader::import_headers.

* sync: Unit tests for import_{bodies,receipts}.

* tests: Add missing method doc.
2018-10-03 18:35:10 +08:00
YihaoPeng 7ba5652bea Add a new RPC `parity_submitWorkDetail` similar `eth_submitWork` but return block hash (#9404)
* add a new RPC `eth_submitWorkDetail`similar `eth_submitWork`.

It has more details (block hash, error message, and more in future)
in its response and not only the `true` or `false`.

* move RPC submitWorkDetail from namespace eth_ to parity_

* remove SubmitDetailResult type; submitWorkDetail return a error when failed

* change error message of RPC error `cannot_submit_work`.

* remove double imported H256.

* put submit_work_detail into a helper to avoid the duplicate codes.
2018-10-03 03:02:48 +08:00
Wei Tang 1e9aebbc86
Resumable EVM and heap-allocated callstack (#9360)
* Add new Vm trappable interface

* Exec/Resume interface

* Basic implementation of CallCreateExecutive

* Implement resume_call and resume_create for executive

* Move convertion to call/create result to separate function

* Implement consume that converts resumable to non-resumable

* Use consume for Executive::call/create

* Resumable EVM

* Implement tracing mode without needing subtracers

* Implement vmtracer so it doesn't require extra structs for subtracing

* Use the new tracing mode in executive

* Fix most of the linting errors for cargo build

* Add the concept of stack_depth

* Add back crossbeam

* Fix some test compile

* Fix prefix address test

* Fix evm crate tests

* Fix wasm crate test compile

* Fix wasm runner compile

* Fix jsontests compile

* Fix evmbin compile

* Fix an issue with create nonce and better vm tracing interface

* Fix linting

* Fix evmbin compile

* Fix unconfirmed_substate and static_flag

* Fix an issue in create address logic

* Fix top-level tracing

* Handle builtin tracing

* Fix suicide and reward tracing index stack

* Fix an issue where trap conflicts with tracing

* Fix an issue in parent step vm tracing

* Fix revert tracing

* Fix evmbin tests

* Remove params clone

* Fix TODO proofs

* Fix jsontests compile

* Fix evmbin merge issue

* Fix wasm merge issue

* Fix wasm test

* Fix ethcore merge warnings

* Fix evmbin compile

* Better expect messages and add some trace::skip_one asserts
2018-10-02 22:33:19 +08:00
Marek Kotewicz 61ec361182 update parity-wordlist library (#9682) 2018-10-02 13:50:50 +01:00
Afri Schoedon 7781cbbc57
CI: Remove unnecessary pipes (#9681)
* ci: reduce gitlab pipelines significantly

* ci: build pipeline for PR

* ci: remove dead weight

* ci: remove github release script

* ci: remove forever broken aura tests

* ci: add random stuff to the end of the pipes

* ci: add wind and mac to the end of the pipe

* ci: remove snap artifacts

* ci: (re)move dockerfiles

* ci: clarify job names

* ci: add cargo audit job

* ci: make audit script executable

* ci: ignore snap and docker files for rust check

* ci: simplify audit script

* ci: rename misc to optional

* ci: add publish script to releaseable branches

* ci: more verbose cp command for windows build

* ci: fix weird binary checksum logic in push script

* ci: fix regex in push script for windows

* ci: simplify gitlab caching

* docs: align README with ci changes

* ci: specify default cargo target dir

* ci: print verbose environment

* ci: proper naming of scripts

* ci: restore docker files

* ci: use docker hub file

* ci: use cargo home instead of cargo target dir

* ci: touch random rust file to trigger real builds

* ci: set cargo target dir for audit script

* ci: remove temp file

* ci: don't export the cargo target dir in the audit script

* ci: fix windows unbound variable

* docs: fix gitlab badge path

* rename deprecated gitlab ci variables

https://docs.gitlab.com/ee/ci/variables/#9-0-renaming

* ci: fix git compare for nightly builds

* test: skip c++ example for all platforms but linux

* ci: add random rust file to trigger tests

* ci: remove random rust file

* disable cpp lib test for mac, win and beta (#9686)
2018-10-02 00:03:58 +01:00
gabriel klawitter f3b806b471 test.sh: use cargo --target for platforms other than linux, win or mac (#9650)
* test.sh: use cargo --target for platforms other than linux, win or mac

* drying test.sh script

* run tests only when not cross-compiling

* quote variable value
2018-10-01 11:55:17 +01:00
Andronik Ordian 6496405f30 ci: fix push script (#9679)
* ci: fix push script

* Fix copying & running on windows.
2018-10-01 10:13:31 +01:00
Afri Schoedon 85a6dc5e8c
Hardfork the testnets (#9562)
* ethcore: propose hardfork block number 4230000 for ropsten

* ethcore: propose hardfork block number 9000000 for kovan

* ethcore: enable kip-4 and kip-6 on kovan

* etcore: bump kovan hardfork to block 9.2M

* ethcore: fix ropsten constantinople block number to 4.2M

* ethcore: disable difficulty_test_ropsten until ethereum/tests are updated upstream
2018-09-30 13:44:17 +01:00
Tomasz Drwięga 856bbfc9c8 Calculate sha3 instead of sha256 for push-release. (#9673)
* Calculate sha3 instead of sha256 for push-release.

* Add pushes to the script.
2018-09-30 12:42:49 +01:00
Marek Kotewicz ebaa43fa4c ethcore-io retries failed work steal (#9651)
* ethcore-io uses newer version of crossbeam && retries failed work steal

* ethcore-io non-mio service uses newer crossbeam
2018-09-29 21:25:16 +01:00
Andronik Ordian 2d44b3ebea fix(light_fetch): avoid race with BlockNumber::Latest (#9665) 2018-09-29 21:22:36 +01:00
ddorgan 984493db30
Test fix for windows cache name... (#9658)
* Test fix for windows cache name...

* Fix variable name.
2018-09-28 18:52:15 +01:00
Niklas Adolfsson 47848769ff
refactor(fetch) : light use only one `DNS` thread (#9647)
* refactor(fetch) : light use only one `DNS` thread

* grumbles(fetch) : pass number of threads directly
2018-09-28 14:26:38 +01:00
cheme a8f6f5b974
ethereum libfuzzer integration small change (#9547)
* Minor changes for ethereum libfuzzer.
2018-09-27 17:17:23 +02:00
André Silva 1e13f474cb cli: remove reference to --no-ui in --unlock flag help (#9616) 2018-09-27 11:24:34 +01:00
Denis S. Soldatov aka General-Beck c69c3a9a46 remove master from releasable branches (#9655)
* remove master from releasable branches

need backporting in beta 
fix https://gitlab.parity.io/parity/parity-ethereum/-/jobs/101065 etc

* add except for snap packages for master
2018-09-27 11:21:48 +01:00
Niklas Adolfsson 3216b143c2 ethcore/VerificationQueue don't spawn up extra `worker-threads` when explictly specified not to (#9620)
* VerificationQueue don't spawn up extra threads

In the verification queue we spawn up worker threads to do the work.
However, if `num-verifiers` is specified we still spawn the maximum
number of threads which consume extra memory.

There is one catch though when `--scale-verifiers` is specified then
we can't do it because all threads are created upon initilization AFAIK.

In my opinion, is doesn't to use both `num-verifiers` and
`scale-verifiers` they are kind of contradictory!

* Fix nits in logic and add tests for verification

* refactor(verification queue) - rm hardcoded const

* Address grumbles in new tests
* Remove hardcoded `MAX_VERIFIERS` constant and replace it by relying
entirely on `num_cpu` crate instead inorder to support CPUs that have
more cores/logical cores
2018-09-26 15:11:50 +01:00
Tomasz Drwięga cc963d42a0 RPC: parity_getBlockReceipts (#9527)
* Block receipts RPC.

* Use lazy evaluation of block receipts (ecrecover).

* Optimize transaction_receipt to prevent performance regression.

* Fix RPC grumbles.

* Add block & transaction receipt tests.

* Fix conversion to block id.
2018-09-25 18:06:14 +01:00
Niklas Adolfsson 3f95a62e4f Remove unused dependencies (#9589)
Remove unused dependencies and move `rustc-hex` to tests because it is
only used in tests
2018-09-25 15:27:27 +02:00
Marek Kotewicz 7f9a9e2e82
ignore key_server_cluster randomly failing tests (#9639)
* ignore key_server_cluster randomly failing tests, related to #9635

* added explanation comment to test #[ignore]
2018-09-25 14:15:35 +01:00
André Silva 375ecd4ada ethcore: handle vm exception when estimating gas (#9615) 2018-09-25 12:35:07 +01:00
Marek Kotewicz 8875dccd11 fix bad-block reporting no reason (#9638) 2018-09-25 18:55:24 +08:00
Wei Tang 4c2301fdf6 Use static call and apparent value transfer for block reward contract code (#9603) 2018-09-25 11:39:27 +01:00
Vadim Arasev 346594c406 HF in POA Sokol (2018-09-19) (#9607)
https://github.com/poanetwork/poa-chain-spec/pull/86
2018-09-25 12:25:55 +02:00
Marek Kotewicz 2609e2db5c bump smallvec to 0.6 in ethcore-light, ethstore and whisper (#9588)
* bump smallvec to 0.6 in ethcore-light, ethstore and whisper

* bump transaction-pool

* Fix test.
2018-09-25 12:24:59 +02:00
cheme 692d5b4e08 Add constantinople conf to EvmTestClient. (#9570)
* Add constantinople conf to EvmTestClient.

* Skip some test to update submodule etheureum/tests submodule to latest.

* Put skipping 'under issue' test behind a feature.

* Change blockReward for const-test to pass ethereum/tests

* Update tests to new constantinple definition (change of reward at block
5).
Switch 'reference' to string, that way we can include issues from others
repo (more flexible)Update tests to new constantinple definition (change
of reward at block 5).
Switch 'reference' to string, that way we can include issues from others
repo (more flexible).

* Fix modexp and bn128_mul gas prices in chain config

* Changes `run_test_path` method to append its directory results (without
that it stop testing at the first file failure).
Add some missing tests.
Add skip for those (block create2 is one hundred percent false but on
hive we can see that geth and aleth got similar issue for this item).

* retab current.json

* Update reference to parity issue for failing tests.
2018-09-25 12:24:40 +02:00
Andronik Ordian c4af7464e5 fix(network): don't disconnect reserved peers (#9608)
The priority of && and || was borked.
2018-09-25 10:59:21 +01:00
Marek Kotewicz 5a1dc3eb8a
fix failing node-table tests on mac os, closes #9632 (#9633) 2018-09-24 21:51:16 +01:00
EOS Classic adcbfcf8d6 Update ropsten.json (#9602) 2018-09-24 11:30:01 +01:00
Marek Kotewicz b57607e7d3
simplify ethcore errors by removing BlockImportError (#9593) 2018-09-24 11:28:54 +01:00
Marek Kotewicz 2f159d4f45
fix windows compilation, replaces #9561 (#9621)
* fix windows compilation, replaces #9561

* tokio-named-pipes
2018-09-24 11:27:51 +01:00
gabriel klawitter 93e1040d07 master: rpc-docs set github token (#9610) 2018-09-21 13:02:15 +02:00
Afri Schoedon 403c07c305
docs: add changelogs for 1.11.10, 1.11.11, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.1.0, and 2.1.1 (#9554)
* docs: prepare changelog for 2.1.0 beta

* docs: move changelog for 2.0.x to stable

* docs: add changelog for legacy 1.11.x

* docs: add release notes for 2.0.x beta releases

* docs: mark 1.11 end of life

* docs: prepare release notes for 2.0.5 stable

* docs: prepare release notes for 2.1.0 beta

* ci: ignore docs in tests

* docs: bump version in readme

* docs: update changelog for 2.0.5 stable

* docs: update changelog for 2.1.0 beta

* docs: update changelog for 2.1.0 beta

* docs: remove eip86 from release notes

* docs: update changelog for 2.1.0

* docs: add changelog for 2.1.1 and 2.0.6

* docs: correct spelling of certain words in the latest changelog
2018-09-20 10:59:15 +02:00
Andronik Ordian 6253308e2e docs(rpc): annotate tag with the provided message (#9601) 2018-09-19 20:23:47 +02:00
Afri Schoedon 33a014013a
ci: fix regex 🙄 (#9597) 2018-09-19 18:57:59 +02:00
Denis S. Soldatov aka General-Beck 4637215ab2 Remove snapcraft clean (#9585)
* Revert " add snapcraft package image (master) (#9584)"

This reverts commit ceaedbbd7f.

* Update package-snap.sh

* Update .gitlab-ci.yml
2018-09-18 15:34:24 +02:00
Denis S. Soldatov aka General-Beck ceaedbbd7f add snapcraft package image (master) (#9584) 2018-09-18 14:39:27 +02:00
Andronik Ordian 52f8b1a1d7 docs(rpc): push the branch along with tags (#9578)
* docs(rpc): push the branch along with tags

* ci: remove old rpc docs script
2018-09-18 08:54:50 +02:00
Thibaut Sardan e6d1250185 Fix typo for jsonrpc-threads flag (#9574) 2018-09-18 00:56:33 +08:00
Wei Tang d04e5e49d0 Fix informant compile (#9571) 2018-09-17 16:16:49 +02:00
EOS Classic a72436f330 Added ropsten bootnodes (#9569)
from @eosclassicteam with ❤️
2018-09-17 12:16:32 +02:00
EOS Classic 467403f437 Increase Gas-floor-target and Gas Cap (#9564)
+ Gas-floor-target increased to 8M by default

+ Gas-cap increased to 10M by default
2018-09-17 08:33:00 +02:00
gabriel klawitter bbaac0c6a9 while working on the platform tests make them non-breaking (#9563)
* while working on the platform tests make them non-critical

* ci: unify test stage job names and torelate more failures

* ci: restore valid yaml

* ci: allow beta and nightly rust builds to fail
2018-09-15 13:43:19 +02:00
Nicolas Gotchac 753fd4bda3 Improve P2P discovery (#9526)
* Add `target` to Rust traces

* network-devp2p: Don't remove discovery peer in main sync

* network-p2p: Refresh discovery more often

* Update Peer discovery protocol

* Run discovery more often when not enough nodes connected

* Start the first discovery early

* Update fast discovery rate

* Fix tests

* Fix `ping` tests

* Fixing remote Node address ; adding PingPong round

* Fix tests: update new +1 PingPong round

* Increase slow Discovery rate
Check in flight FindNode before pings

* Add `deprecated` to deprecated_echo_hash

* Refactor `discovery_round` branching
2018-09-14 22:18:03 +02:00
gabriel klawitter 57d2c8c94a move dockerfile for android build container to scripts repo (#9560) 2018-09-14 16:16:36 +02:00
gabriel klawitter 870ec89e9a Simultaneous platform tests WIP (#9557)
* look into commit changes

* look into commit changes ii

* all on test

* build only_releaseable_branches for platforms

* allow failure for check during development

* windows test typo

* fix sh for windows

* remove check stage again

* debug macos platform
2018-09-14 15:55:14 +02:00
Marek Kotewicz 0c3b70f2fb update ethabi-derive, serde, serde_json, serde_derive, syn && quote (#9553) 2018-09-14 03:37:28 +08:00
Andronik Ordian 7a367698fe ci: fix rpc docs generation 2 (#9550) 2018-09-13 14:36:44 +02:00
Afri Schoedon c77e99814b
ci: always run build pipelines for win, mac, linux, and android (#9537)
* ci: always run build pipelines for win, mac, linux, and android

* ci: always run build pipelines for win, mac, linux, and android

* ci: disallow failure for publish scripts

* ci: enable tests on master

* ci: run tests in debug mode to speed things up

* ci: only build windows, darwin, and android targets on PRs

* ci: reenable darwin and android pipelines on PR

* ci: revert tests to run in release mode
2018-09-13 13:15:15 +02:00
Nicolas Gotchac 4ddd69cc55 Multithreaded snapshot creation (#9239)
* Add Progress to Snapshot Secondary chunks creation

* Use half of CPUs to multithread snapshot creation

* Use env var to define number of threads

* info to debug logs

* Add Snapshot threads as CLI option

* Randomize chunks per thread

* Remove randomness, add debugging

* Add warning

* Add tracing

* Use parity-common fix seek branch

* Fix log

* Fix tests

* Fix tests

* PR Grumbles

* PR Grumble II

* Update Cargo.lock

* PR Grumbles

* Default snapshot threads to half number of CPUs

* Fix default snapshot threads // min 1
2018-09-13 12:58:49 +02:00
Marek Kotewicz ef4a61c769
new ethabi (#9511)
* new ethabi migration in progress

* parity migrated to new ethabi

* migrated secred-store to new ethabi

* bump ethabi to 6.0

* fixed review suggestions
2018-09-13 11:04:39 +02:00
Tomasz Drwięga 7dfb5ff5bd Remove initial token for WS. (#9545) 2018-09-13 10:58:52 +02:00
Marek Kotewicz 6b391312ab net_version caches network_id to avoid redundant aquire of sync read lock (#9544)
* net_version caches network_id to avoid redundant aquire of sync read lock, #8746

* use lower_hex display formatting for net_peerCount rpc method
2018-09-13 10:16:24 +02:00
gabriel klawitter 6e62d77e4d correct before_script for nightly build versions (#9543)
- fix gitlab array of strings syntax error
- get proper commit id
- avoid colon in stings
2018-09-12 17:46:56 +03:00
Afri Schoedon 0281cca9af deps: bump kvdb-rocksdb to 0.1.4 (#9539) 2018-09-12 13:23:09 +02:00
Wei Tang 018e2403b1 state: test when contract creation fails, old storage values should re-appear (#9532)
Because more tests won't hurt. :)

Add a test case for https://github.com/ethereum/py-evm/pull/1224#issuecomment-418775512 where if contract creation fails, old storage values (if ever existed) should re-appear.
2018-09-12 11:42:09 +01:00
cheme 61f4534e2a Allow dropping light client RPC query with no results (#9318)
* OnDemand no longer loop until there is a query.
All peer known at the time will be queried, and the query fail if all
return no reply.
Returning the failure is done through an empty Vec of reply (the type
of the oneshot channel remains unchanged).
Before this commit the query were send randomly to any peer until there
is a reply (for a query that got no result it was an issue, for other
queries it was quering multiple times the same peers).
After this commit the first query is random but next queries
follows hashmap iterator order.

Test no_capability was broken by this commit (the pending query was
removed).

* OnDemand no longer loop until there is a query.
All peer known at the time will be queried, and the query fail if all
return no reply.
Returning the failure is done through an empty Vec of reply (the type
of the oneshot channel remains unchanged).
Before this commit the query were send randomly to any peer until there
is a reply (for a query that got no result it was an issue, for other
queries it was quering multiple times the same peers).
After this commit the first query is random but next queries
follows hashmap iterator order.

Test no_capability was broken by this commit (the pending query was
removed). If adding some kind of timeout mechanism it could be restored.

* Comment plus better field names.

* No panick on dropped oneshot channel.

* Use Set to avoid counter heuristic

* Cli option `on_demand_nb_retry` for maximum number of retry when doing
on demand query in light client.

* Missing test update for previous commit

* Add a timeout (only when there is no peer to query), that way we do not
set number of query to minimum current number peer or configured number
of query : that way capability test was restored.

* Adding an error type for on_demand, it helps having variant of error
reported at rpc level : choice of rpc error code error might not be
right.

* Duration as constant is nice

* Switch to duration in main too

* Fix indentation (sorry for that).

* Fix error management (bad merge in previous commit)

* Lots of english corrections, major change on the new command parameters :
 - use standard '-' instead of '_'
 - renaming nb_retry params to 'on-demand-retry-count'
2018-09-12 11:47:01 +02:00
Afri Schoedon 69667317c1
Bump master to 2.2.0 (#9517)
* parity-version: bump master to 2.2.0

* ci: update branch version references

* docker: release master to latest

* deps: bump fs-swap to 0.2.4
2018-09-12 11:32:05 +02:00
Wei Tang 530aac0682
Enable all Constantinople hard fork changes in constantinople_test.json (#9505)
* Enable all Constantinople hard fork changes in constantinople_test.json

* Address grumbles

* Remove EIP-210 activation

* 8m -> 5m

* Temporarily add back eip210 transition so we can get test passed

* Add eip210_test and remove eip210 transition from const_test
2018-09-12 02:08:23 +08:00
Niklas Adolfsson 6e7d8f90b5 [light] Validate `account balance` before importing transactions (#9417)
* `light::verify_transaction` basic tx validation

* update wasm tests

* Provide `cached_nonce` in `parity_next_nonce` RPC

* nits

* Improve error handeling

Two separate errors for distinguishing between `account not found` and
`insufficient balance`. However, when `next_nonce()` is called and the
account is not found then provide `local_best_next_nonce`!

* Ensure only one n/w request is performed

Refactored to code again:
* Removed `fn cached_next_nonce`
* Removed extra n/w request in `sign` to check balance
* Refactored `fill_optional_field` to request nonce and check account balance

* nits

* grumbles needless clone

* Prevent integer overflow with saturating add & mul

* Call `sign_transaction()` directly from `sign()`

Because the change in `fill_optional_fields` always fill the nonce it is
now possible to call `sign_transaction` directly instead of creating a
`ProspectiveSigner` "object".
2018-09-11 19:20:59 +02:00
cheme 65bf1086a2 In create memory calculation is the same for create2 because the additional parameter was popped before. (#9522) 2018-09-11 23:47:26 +08:00
cheme 98220442b4 Update patricia trie to 0.2.2 (#9525)
* Update patricia trie to 0.2.2 crates. Default dependencies on minor
version only.

* Putting back ethereum tests to the right commit
2018-09-11 16:20:26 +02:00
Hernando Castano 3c3d2ef2b9 Replace hardcoded JSON with serde json! macro (#9489)
* Replace hardcoded JSON with serde json! macro

* Use "{:#x}" formatter instead of "0x{:x}"

* Sort fields of JSON test strings alphabetically

* Stop escaping new lines in evmbin JSON errors

* Remove unnecessary 'to_string()' calls

* Add test with non-empty storage values
2018-09-11 11:36:38 +02:00
gabriel klawitter 67066eb32a
fix typo in version string (#9516) 2018-09-11 11:31:25 +02:00
Wei Tang 631df0fe56 Fix checkpointing when creating contract failed (#9514) 2018-09-11 10:28:31 +02:00
Andronik Ordian 485870296d ci: fix json docs generation (#9515) 2018-09-11 09:38:35 +02:00
Tomasz Drwięga 6e5a1c00dc Update state tests execution model (#9440)
* Update & fix JSON state tests.

* Update tests to be able to run ethtest at
021fe3d410773024cd5f0387e62db6e6ec800f32.

- Touch user in state
- Adjust transaction tests to new json format

* Switch to same commit for submodule ethereum/test as geth (next includes constantinople changes).
Added test `json_tests::trie::generic::TrieTests_trieanyorder` and a few
difficulty tests.

* Remove trietestnextprev as it would require to parse differently and
implement it.

* Support new (shitty) format of transaction tests.

* Ignore junk in ethereum/tests repo.

* Ignore incorrect test.

* Update to a later commit

* Move block number to a constant.

* Fix ZK2 test - touched account should also be cleared.

* Fix conflict resolution
2018-09-10 22:38:30 +02:00
Wei Tang ba487eaaca
Only check warp syncing for eth_getWorks (#9484)
* Only check warp syncing for eth_getWorks

* Use SyncStatus::is_snapshot_syncing
2018-09-11 01:53:42 +08:00
gabriel klawitter eb0986c3f9 upload will fail if a file with the same hash is already up (#9479)
* upload will fail if a file with the same hash is already up

* compose version string for nightly releases
2018-09-10 18:22:34 +03:00
Nicolas Gotchac baf5be09dc Fix Snapshot restoration failure on Windows (#9491)
* Close Blooms DB files before DB restoration

* PR Grumbles I

* PR Grumble

* Grumble
2018-09-10 17:21:57 +02:00
Nicolas Gotchac f3aed42dd6 Don't error when Snapshot is aborted (#9492)
* Don't error when Snapshot is aborted

* PR Grumble

* PR grumble
2018-09-10 21:26:52 +08:00
Wei Tang 44531e3009
light: give free credits for reserved peers (#9448)
* light: give free credits for reserved peers

* Fix ethcore-light tests

* Test free_flow_params
2018-09-10 19:45:49 +08:00
Afri Schoedon 2177a0179e
parity: print correct keys path on startup (#9501) 2018-09-09 00:43:24 +02:00
Wei Tang e1f333021f Generalized blockReward and difficultyBombDelays config (#9480)
* Implement multi blockReward

* Implement difficultyBombDelays

* Fix json crate compile

* json keys can only be string
2018-09-09 00:38:07 +02:00
Andronik Ordian 4040d73c60 rpc(debug_getBadBlocks): fix test (#9502) 2018-09-08 17:34:51 +02:00
Tomasz Drwięga 61bd47ccc1 Bad blocks RPC + reporting (#9433)
* Bad blocks RPC.

* Return bad blocks via RPC.

* Fix test.

* More verbose bad block message.

* Expose via CLI.

* Remove stray whitespace.

* Remove stray newline.

* Fix tests.
2018-09-08 04:04:28 +02:00
Wei Tang 915c366056
EIP 1283: Net gas metering for SSTORE without dirty maps (#9319)
* Implement last_checkpoint_storage_at

* Add reverted_storage_at for externalities

* sstore_clears_count -> sstore_clears_refund

* Implement eip1283 for evm

* Add eip1283Transition params

* evm: fix tests

* jsontests: fix test

* Return checkpoint index when creating

* Comply with spec Version II

* Fix docs

* Fix jsontests feature compile

* Address grumbles

* Fix no-checkpoint-entry case

* Remove unnecessary expect

* Add test for State::checkpoint_storage_at

* Add executive level test for eip1283

* Hard-code transaction_checkpoint_index to 0

* Fix jsontests

* Add tests for checkpoint discard/revert

* Require checkpoint to be empty for kill_account and commit

* Get code coverage

* Use saturating_add/saturating_sub

* Fix issues in insert_cache

* Clear the state again

* Fix original_storage_at

* Early return for empty RLP trie storage

* Update comments

* Fix borrow_mut issue

* Simplify checkpoint_storage_at if branches

* Better commenting for gas handling code

* Address naming grumbles

* More tests

* Fix an issue in overwrite_with

* Add another test

* Fix comment

* Remove unnecessary bracket

* Move orig to inner if

* Remove test coverage for this PR

* Add tests for executive original value

* Add warn! for an unreachable cause
2018-09-07 18:51:08 +08:00
Niklas Adolfsson 6888a968f9 Light `clippy(fy)` (#9473)
* wasm tests

* `clippyfy` light-client

* Revert inefficient change `collect_ready()`
2018-09-06 15:44:40 +02:00
André Silva 4e8e5bbb86 aura: don't report skipped primaries when empty steps are enabled (#9435) 2018-09-06 13:33:46 +02:00
Wei Tang 5752869824 Support millisecond timestamp for instant seal engine (#9469)
* Support millisecond timestamp for instant seal engine

* Forgot to checkin instant_seal mod

* Fix instant seal config

* Fix json crate compile

* Fix private_spec.json

* Option<bool> -> bool
2018-09-06 11:38:00 +02:00
André Silva 39a12622ae ethcore: don't validate difficulty when ignoring seal check (#9470)
* ethcore: don't validate difficulty when ignoring seal check

* ethcore: fix block verification test

* ethcore: document skipped verifications when check_seal is disabled
2018-09-06 04:37:41 +02:00
Niklas Adolfsson dca88ff85c [light/jsonrpc] Provide the actual account for `eth_coinbase` RPC and unify error handeling for light and full client (#9383)
* Provide the actual `account` for eth_coinbase

The previous implementation always provided the `zero address` on
`eth_coinbase` RPC. Now, instead the actual address is returned on
success or an error when no account(s) is found!

* full client `eth_coinbase` return err

In the full-client return an error when no account is found instead of
returning the `zero address`

* Remove needless blocks on single import

* Remove needless `static` lifetime on const

* Fix `rpc_eth_author` test
2018-09-05 19:21:08 +02:00
Pierre Krieger ab9843cb00 Add a Java interface (#9346)
* Add a Java interface

* Use system ABI

* Forgot exception

* Fix param for parity_rpc

* Address concerns
2018-09-05 17:17:12 +02:00
David 72fd1fa58d
Fetch `parity-common` crates from crates.io (#9410)
* Fetch `parity-common` crates from crates.io

* Add doc tests from `patricia-trie` to `patricia-trie-ethereum`
Fix/update a few deps

* [ethkey] upgrade ethereum-types

* [whisper] update deps

* [network] deps

* [network-devp2p] deps

* [journaldb] deps

* [fastmap] deps

* [miner] deps and test fixes

* [machine] deps

* [json] deps

* [hw] deps

* [ethash] deps

* [registrar] deps

* Update a few more dependencies with new ethabi-*

* [updater] Update deps

* deps

* [ethcore] Update deps

* Use new parity-snappy and parity-rocksdb crates

* Updated submodules

* Use parity-snappy 0.1

* Use kvdb-rocksdb 0.1.2

* Don't use latest ethereum/tests

* Fix merge conflicts errors

* Remove superseeded comment

* Address grumbles: add newlines, add/remove spaces
2018-09-04 20:13:51 +02:00
michaelr524 51eac1926f Fixed typo (#9467) 2018-09-04 15:47:33 +01:00
cheme c1aed4af45 Fix light client deadlock (#9385)
This PR is fixing deadlock for #8918 

It avoids some recursive calls on light_sync by making state check optional for Informant.

The current behavior is to display the information when informant checks if block is major version.
This change a bit the informant behavior, but not on most cases.

To remember where and how this kind of deadlock are likely to happen (not seen with Parkinglot deadlock detection because it uses std condvar), I am adding a description of the deadlock.
Also, for the reviewers there may be better solution than modifying the informant.

### Thread1 

- ethcore/sync/light_sync/mod.rs

A call to the light handler through any Io (having a loop of rpc query running on like client makes the dead lock way more likely).
At the end of those calls we systematically call `maintain_sync` method.

Here maintain_sync locks `state` (it is the deadlock cause), with a write purpose

`maintain_sync` -> `begin_search` with the state locked open

`begin_search` -> lightcliennt `flush_queue` method

- ethcore/light/src/client/mod.rs

`flush_queue` -> `flush` on queue (HeaderQueue aka VerificationQueue of headers)

- ethcore/src/verification/queue/mod.rs

Condition there is some unverified or verifying content

`flush` wait on a condvar until the queue is empty. The only way to unlock condvar is that worker is empty and unlock it (so thread 2 is Verification worker).

### Thread2

A verification worker at the end of a verify loop (new block).

- ethcore/src/verification/queue/mod.rs

thread loops on `verify` method.

End of loop condition is_ready -> Import the block immediately 

calls `set_sync` on QueueSignal which send a BlockVerified ClientIoMessage in inner channel (IoChannel of ClientIoMessage) using `send_sync`

- util/io/src/service_mio.rs

IoChannel `send_sync` method calls all handlers with `message` method; one of the handlers is ImportBlocks IoHandler (with a single inner Client service field)

- ethcore/light/src/client/service.rs

`message` trigger inner method `import_verified`

- core/light/src/client/mod.rs

`import_verified` at the very end notify the listeners of a new_headers, one of the listeners is Informant `listener` method

- parity/informant.rs

`newHeaders` run up to call to `is_major_importing` on its target (again clinet)

-  ethcore/sync/src/light_sync/mod.rs

Here `is_major_importing` tries to get state lock (read purpose only) but cannot because of previous state lock, thus deadlock
2018-09-04 15:36:34 +01:00
Wei Tang c12447c7c5 Fix docs of address_hash (#9463) 2018-09-04 11:25:22 +02:00
gabriel klawitter 502bacea82
fix typo in bash script (#9462) 2018-09-04 10:58:13 +02:00
Wei Tang da5ba4ccc8
Fix a bug in evmbin initial_gas display (#9457) 2018-09-04 16:33:14 +08:00
Andronik Ordian 1f2426226b evmbin: escape newlines in json errors (#9458) 2018-09-04 14:28:49 +08:00
André Silva c0eb30b604
use kvdb-* and parity-snappy crates from crates.io (#9441)
* use kvdb-* and parity-snappy crates from crates.io

* update rocksdb-sys and snappy-sys
2018-09-03 17:40:11 +01:00
Wei Tang caca3a8048
Add EIP-1014 transition config flag (#9268)
* Add EIP-1014 transition config flag

* Remove EIP-86 configs

* Change CREATE2 opcode index to 0xf5

* Move salt to the last item in the stack

* Change sendersaltandaddress scheme to comply with current EIP-1014

* Fix json configs

* Fix create2 test

* Fix deprecated comments
2018-08-31 23:43:51 +08:00
gabriel klawitter f929419676 add tags for runner selection of build-linux jobs (#9451) 2018-08-31 16:41:21 +02:00
Andrew Jones bc53e78a04
Remove unused BlockStatus::Pending (#9447)
Pending case never instantiated, and only ever matched together with Unknown
2018-08-31 12:13:01 +01:00
André Silva 3dbea1a7a1 ci: only include local paths in coverage script (except target) (#9437) 2018-08-31 01:21:57 +02:00
Afri Schoedon 644d1db5ef Add POA Networks: Core and Sokol (#9413)
* ethcore: add poa network and sokol chainspecs

* rpc: simplify chain spec docs

* cli: rearrange networks by main/test and size/range

* parity: don't blacklist 0x00a328 on sokol testnet

* parity: add sokol and poanet to params and clean up a bit, add tests

* ethcore: add the poa networks and clean up a bit

* ethcore: fix path to poacore chain spec

* parity: rename poa networks to poacore and poasokol

* parity: fix configuration tests

* parity: fix parameter tests

* ethcore: rename POA Core and POA Sokol
2018-08-30 21:32:47 +02:00
André Silva 07d97d5b26 docker: install missing dependencies in arm target dockerfiles (#9436) 2018-08-30 20:03:38 +02:00
Afri Schoedon c658b46fe1
Random small cleanups (#9423)
* clean up toml files

* update the parity ethereum toolchain docs

* update contribution guide and issue templates

* update desktop and service files

* build clib examples with 8 threads

* update header templates

* replace parity technologies with parity ethereum logo
2018-08-30 19:57:27 +02:00
Wei Tang 8a5c9a8c70 evmbin: Fix gas_used issue in state root mismatch and handle output better (#9418)
* Fix gas used in staterootmismatch, and print full state root hash

* Write trace info for stdjson to stderr

* Fix tests

* Remove struct trait bound
2018-08-29 20:13:45 +03:00
Thibaut Sardan 3e4a525520 Update hardcoded sync (#9421)
- Update foundation hardcoded header to block 6219777 
- Update ropsten hardcoded header to block 3917825 
- Update kovan hardcoded header to block 8511489
2018-08-29 16:56:25 +01:00
Wei Tang 74ce0f738e Add block reward contract config to ethash and allow off-chain contracts (#9312)
This adds block reward contract config to ethash. A new config `blockRewardContractCode` is also added to both Aura and ethash. When specified, it will execute the code directly and overrides any `blockRewardContractAddress` config. Having this `blockRewardContractCode` config allows chains to deploy hard fork by simply replacing the current config value, without the need from us to support any `multi` block reward scheme.
2018-08-29 16:17:18 +01:00
Anton Gavrilov 1073d56245 Private packets verification and queue refactoring (#8715)
* Verify private transaction before propagating

* Private transactions queue reworked with tx pool queue direct usage

* Styling fixed

* Prevent resending private packets to the sender

* Process signed private transaction packets via io queue

* Test fixed

* Build and test fixed after merge

* Comments after review fixed

* Signed transaction taken from verified

* Fix after merge

* Pool scoring generalized in order to use externally

* Lib refactored according to the review comments

* Ready state refactored

* Redundant bound and copying removed

* Fixed build after the merge

* Forgotten case reworked

* Review comments fixed

* Logging reworked, target added

* Fix after merge
2018-08-29 20:31:04 +08:00
ewaldhesse 7aa4484a03 Update tobalaba.json (#9419) 2018-08-28 14:06:36 +02:00
Afri Schoedon 6c96b60a63 docs: add parity ethereum logo to readme (#9415)
* docs: add parity ethereum logo

* docs: add logo to readme

* docs: align logo center

* docs: remove separators from readme

* docs: restructure readme

* docs: check spelling and grammar in readme

* docs: clarify readme

* docs: improve readme significantly
2018-08-27 17:01:56 +02:00
André Silva ac1900a0fc build: update rocksdb crate (#9414) 2018-08-27 12:52:49 +08:00
Denis S. Soldatov aka General-Beck bd3bc5c168 Updating the CI system (#8765)
* Updating the CI system with the publication of releases and binary files on github

Signed-off-by: Denis S. Soldatov aka General-Beck <general.beck@gmail.com>

* add missed scripts

* chmod +x scripts

* fix download link for github

* rebuilding CI scripts

* small fixes

* update submodule wasm tests

* ci: fix merge leftovers

* ci: remove gitlab-next from ci triggers

* ci: fix git add in docs script

* ci: use nightly instead of master for publish triggers

* ci: remove sleep from gitlab config

* ci: replace ':' with '-' in gitlab targets

* ci: fix recursive copy in docs script
2018-08-26 00:44:08 +02:00
Jim Posen 9ed43230ca Better support for eth_getLogs in light mode (#9186)
* Light client on-demand request for headers range.

* Cache headers in HeaderWithAncestors response.

Also fulfills request locally if all headers are in cache.

* LightFetch::logs fetches missing headers on demand.

* LightFetch::logs limit the number of headers requested at a time.

* LightFetch::logs refactor header fetching logic.

* Enforce limit on header range length in light client logs request.

* Fix light request tests after struct change.

* Respond to review comments.
2018-08-25 23:06:01 +02:00
Christopher Purta 7abe9ec4cc Add update docs script to CI (#9219)
* Add update docs script to CI

Added a script to CI that will use the jsonrpc tool to update rpc
documentation then commit and push those to the wiki repo.

* fix gitlab ci lint

* Only apply jsonrpc docs update on tags

* Update gitlab-rpc-docs.sh

* Copy correct parity repo to jsonrpc folder

Copy correct parity repo to jsonrpc folder before attempting to build docs since the CI runner clones the repo as parity and not parity-ethereum.

* Fix JSONRPC docs CI job

Update remote config in wiki repo before pushing changes using a github
token for authentication. Add message to wiki tag when pushing changes.
Use project directory to correctly copy parity code base into the
jsonrpc repo for doc generation.

* Fix set_remote_wiki function call in CI
2018-08-24 18:14:07 +02:00
Alexey 5ed2527663 `gasleft` extern implemented for WASM runtime (kip-6) (#9357)
* Wasm gasleft extern added

* wasm_gasleft_activation_transition -> kip4_transition

* use kip-6 switch

* gasleft_panic -> gasleft_fail rename

* call_msg_gasleft test added and gas_left agustments because this https://github.com/paritytech/wasm-tests/pull/52

* change .. to _

* fix comment for the have_gasleft param

* update tests (0edbf860ff)
2018-08-24 18:03:46 +02:00
Marek Kotewicz b87c7cac54 block view! removal in progress (#9397) 2018-08-24 10:53:31 +01:00
Andrew Jones 0b34579b04
Prevent sync restart if import queue full (#9381) 2018-08-24 09:42:24 +01:00
JohnnySheffield 31291ebd35 nonroot CentOS Docker image (#9280)
* Updates CentOS Docker image build process

* rename build.Dockerfile
2018-08-24 05:55:54 +02:00
André Silva e8e0b08f17 ethcore: kovan: delay activation of strict score validation (#9406) 2018-08-24 08:14:01 +08:00
Andronik Ordian 491ce61a76 Revert "Use std::sync::Condvar (#1732)" (#9392)
* Revert "Use std::sync::Condvar (#1732)"

This reverts commit c65ee93542.

* verification_queue: remove redundant mutexes
2018-08-22 16:01:07 +02:00
Niklas Adolfsson e12a26dac5 Replace `Duration::new()` w/ `Duration::from_nanos` (#9387) 2018-08-21 16:01:09 +01:00
Afri Schoedon 7bf1889af1 docs: restore readme (#9391) 2018-08-21 16:49:24 +02:00
Nick Sanders 139a2b7b0d Replace `std::env::home_dir()` with `home` crate impl. (#9293)
* Import the `home` crate in `util/dir`.

* Replace uses of `env::home_dir()` with `home::home_dir()`.
  * `home` uses a 'correct' impl. on windows and the stdlib impl.
    of `::home_dir` otherwise.

* Reexport `home::home_dir` from `util/dir`.

* Bump `util/dir` to 0.1.2.
2018-08-21 15:30:24 +02:00
Thibaut Sardan f230c719d8
Delete Dockerfile (#9386) 2018-08-21 14:36:04 +02:00
Niklas Adolfsson 8703449dfe network-devp2p `Fix some clippy errors/warnings` (#9378)
* fix some clippy warnings

* Remove `shallow-copy` of Node's

* Make `NonReservedPeerMode` Copy and pass-by-value
2018-08-21 12:55:31 +03:00
Tomasz Drwięga 108590d924 Allow calling contracts in genesis state. (#9375) 2018-08-20 13:05:01 +01:00
Niklas Adolfsson b2cf5d2958 Make `Capabilities struct` Copy (#9372) 2018-08-20 13:53:47 +03:00
Niklas Adolfsson ee5ed44761 Light client "Enable more logs for light client `on_demand`" (#9374)
* Enable more logs for light client `on_demand`

* Remove extra whitespace

* fix indentation
2018-08-17 19:21:49 +03:00
Tomasz Drwięga 346913b7f6 Better logging when mining own transactions. (#9363) 2018-08-17 16:01:32 +01:00
Niklas Adolfsson 18a8d2f67f Fix typos in `network-devp2p` (#9371) 2018-08-17 17:04:03 +03:00
Niklas Adolfsson 3ae10915e4 Light client `Provide default nonce in transactions when it´s missing` (#9370)
* Provide `default_nonce` in tx`s when it´s missing

When `nonce` is missing in a `EthTransaction` will cause it to fall in
these cases provide `default_nonce` value instead!

* Changed http:// to https:// on Yasm link (#9369)

Changed http:// to https:// on Yasm link in README.md

* Provide `default_nonce` in tx`s when it´s missing

When `nonce` is missing in a `EthTransaction` will cause it to fall in
these cases provide `default_nonce` value instead!

* Address grumbles
2018-08-17 14:45:43 +01:00
Marius Kjærstad 949b9c85ca Changed http:// to https:// on Yasm link (#9369)
Changed http:// to https:// on Yasm link in README.md
2018-08-17 18:19:15 +08:00
Andrew Jones c21c19bd6c
Fix no line breaks in logs (#9355) 2018-08-14 18:10:51 +01:00
Tomasz Drwięga 29125e830b Lower the max size of transaction packet to prevent going oversize. (#9308)
* Lower the max size of transaction packet to prevent going oversize.

* Log RLP size.
2018-08-14 17:20:29 +02:00
Wei Tang 1ac4676f4b Remove prepare_trace_output and make sure prepare_trace_call and trace*call are balanced (#9353)
This refactors `prepare_trace_output` to instead directly take the reference of return values, so that it's simpler and we save a stack item. This should also fixes [the issue](https://github.com/paritytech/parity-ethereum/pull/9236#issuecomment-408444995) @udoprog is facing. Replaces #9236
2018-08-14 15:34:46 +01:00
Tomasz Drwięga fe5301cebf More details in logs returned by light client (#9324)
* Log details for light logs.

* Create Log directly.
2018-08-14 16:13:11 +02:00
Tomasz Drwięga 7262601123 Expose UnorderedIterator. (#9347) 2018-08-14 12:11:56 +02:00
cheme fcb6cc1e76 Light client logs should include 'from_block' when querying logs (#9331)
* Fix PubSub for logs when using light client :
prior to this fix the pubsub process did send a
query for each new block header (and for each subs : there is something
to optimize here) by setting from and to of the filter at this block
number; but there was a bug in the code that fetch logs : it was non
inclusive for its start bound, meaning that with start bound = end bound
we never query any block (and attached logs).

* Option iter instead of once.
Use of bloom existing function to check if a bloom contains another.

* Makes from block header checking explicit
2018-08-14 09:58:29 +02:00
Wei Tang ff716e7799
Remove pass-by-reference return data value from executive (#9211)
* Remove pass-by-reference return data value from executive

* Fix tests

* Fix a missing test output

* typo: wasm_activation_test

* Tracing change in output

* json_tests: fix compile

* typo: 0..32 -> ..32 to keep it consistent with other occurance

* Fix tests
2018-08-14 05:27:13 +08:00
Wei Tang 9c595aff95
Allow single opcode stepping for EVM (#9051)
* Feed in ActionParams on VM creation

* Fix ethcore after Vm interface change

* Move informant inside Interpreter struct

* Move do_trace to Interpreter struct

* Move all remaining exec variables to Interpreter struct

* Refactor VM to allow single opcode step

* Fix all EVM tests

* Fix all wasm tests

* Fix wasm runner tests

* Fix a check case where code length is zero

* Fix jsontests compile

* Fix cargo lock

* Use match instead of expect

* Use cheaper check reader.len() == 0 for the initial special case

* Get rid of try_and_done! macro by using Result<(), ReturnType>

* Use Never instead of ()

* Fix parity-bytes path

* Bypass gasometer lifetime problem by borrow only for a instance

* typo: missing {

* Fix ethcore test compile

* Fix evm tests
2018-08-14 04:06:15 +08:00
Andronik Ordian 98dbd1fdc7
Fix load share (#9321)
* fix(light_sync): calculate `load_share` properly

* refactor(api.rs): extract `light_params` fn, add test

* style(api.rs): add trailing commas
2018-08-13 18:53:19 +03:00
Wei Tang a6df452841
Implement EIP234 block_hash for eth_getLogs (#9256)
* Implement EIP234

* Make filter conversion returns error if both blockHash and from/toBlock is found

This also changes PollFilter to store the EthFilter type, instead of the jsonrpc one, saving repeated conversion.

* Return error if block filtering target is not found in eth_getLogs

Use the old behavior (unwrap_or_default) for anywhere else.

* fix test: secret_store

* Fix weird indentation

* Make client log filter return error in case a block cannot be found

* Return blockId error in rpc

* test_client: allow return error on logs

* Add a mocked test for eth_getLogs error

* fix: should return error if from_block/to_block greater than best block number

* Add notes on pending

* Add comment for UNSUPPORTED_REQUEST

* Address grumbles

* Return err if from > to
2018-08-13 15:47:10 +08:00
André Silva 4eab8672b8 ethcore: fix pow difficulty validation (#9328)
* ethcore: fix pow difficulty validation

* ethcore: validate difficulty is not zero

* ethcore: add issue link to regression test

* ethcore: fix tests

* ethcore: move difficulty_to_boundary to ethash crate

* ethcore: reuse difficulty_to_boundary and boundary_to_difficulty

* ethcore: fix grumbles in difficulty_to_boundary_aux
2018-08-10 15:36:19 +02:00
Niklas Adolfsson 6e2821b4db ethcore/sync `Make view macro only visible to test` (#9316)
* remove needless macro import

* enable ethcore/macros in tests
2018-08-10 14:31:48 +02:00
Pierre Krieger 1564fae011 Allow setting the panic hook with parity-clib (#9292)
* Allow setting the panic hook with parity-clib

* Make all FFI functions unsafe

* Fix comment

* Fix concern
2018-08-10 11:06:30 +02:00
Tomasz Drwięga 30e40079ca Prevent blockchain & miner racing when accessing pending block. (#9310)
* Prevent blockchain & miner racing when accessing pending block.

* Fix unavailability of pending block during reseal.
2018-08-10 11:00:55 +02:00
Kirill Fomichev 65a1d88907 Docker alpine: use multi-stage concept (#9269)
* Docker alpine: use multi-stage concept

* Docker alpine: create config directory
2018-08-10 10:45:04 +02:00
Nick Sanders e590874a81 Update `log` -> 0.4, `env_logger` -> 0.5. (#9294)
* Rename a few types & methods.

* Change `(Log)Builder::format` (closure) arg.
2018-08-10 00:04:10 +01:00
Maciej Hirsz b28e742683 Update tobalaba.json (#9313) 2018-08-09 23:14:45 +02:00
Arkadiy Paronyan 62fdfb937a Allow tx pool to be Send (#9315) 2018-08-09 23:13:28 +02:00
Max Riveiro 8814195122 Fix codecov.io badge in README (#9327) 2018-08-09 17:54:08 +02:00
David e2095d4a5d Move ethereum-specific H256FastMap type to own crate (#9307)
* Add a `fastmap` crate that provides the H256FastMap specialized HashMap

* Use `fastmap` instead of `plain_hasher`

* Update submodules for Reasons™

* Submodule update
2018-08-09 09:51:48 +02:00
Marek Kotewicz 78a38e9825
ethcore sync decodes rlp less often (#9264)
* deserialize block only once during verification

* ethcore-sync uses Unverified

* ethcore-sync uses Unverified

* fixed build error

* removed Block::is_good

* applied review suggestions

* ethcore-sync deserializes headers and blocks only once
2018-08-08 10:56:54 +02:00
André Silva 712101b63d ethcore: add transition flag for transaction permission contract (#9275)
* ethcore: add transition flag for transaction permission contract

* ethcore: fix transaction permission contract tests
2018-08-07 15:18:19 +01:00
Wei Tang 1f18dbb17c
Remove all dapp permissions related settings (#9120)
* Completely remove all dapps struct from rpc

* Remove unused pub use

* Remove dapp policy/permission func in ethcore

* Remove all dapps settings from rpc

* Fix rpc tests

* Use both origin and user_agent

* Address grumbles

* Address grumbles

* Fix tests
2018-08-07 20:52:23 +08:00
Wei Tang 0d8001adea Improve return data truncate logic (#9254)
* Improve return data truncate logic

* fix: size -> offset + size
2018-08-07 11:48:25 +02:00
Wei Tang 1e44a62494 Update wasm-tests hash (#9295) 2018-08-07 12:36:56 +03:00
Wei Tang e8b13cb77e
Implement KIP4: create2 for wasm (#9277)
* Basic implementation for kip4

* Add KIP-4 config flags

* typo: docs fix

* Fix args offset

* Add tests for create2

* tests: evm

* Update wasm-tests and fix all gas costs

* Update wasm-tests

* Update wasm-tests and fix gas costs
2018-08-06 23:15:52 +08:00
Jongsic Choi 3f2fd610d9 Fix loop start value (#9285) 2018-08-06 12:04:28 +01:00
Pierre Krieger 25604dc577 Avoid using $HOME if not necessary (#9273)
* Avoid using $HOME if not necessary

* Fix concerns and issues
2018-08-03 09:58:59 +02:00
Pierre Krieger 0cfc6bf2a6 Fix path to parity.h (#9274)
* Fix path to parity.h

* Fix other paths as well
2018-08-02 22:18:49 +01:00
Tomasz Drwięga 90d7823acb Propagate transactions for next 4 blocks. (#9265)
Closes #9255 

This PR also removes the limit of max 64 transactions per packet, currently we only attempt to prevent the packet size to go over 8MB. This will only be the case for super-large transactions or high-block-gas-limit chains.

Patching this is important only for chains that have blocks that can fit more than 4k transactions (over 86M block gas limit)

For mainnet, we should actually see a tiny bit faster propagation since instead of computing 4k pending set, we only need `4 * 8M / 21k = 1523` transactions.

Running some tests on `dekompile` node right now, to check how it performs in the wild.
2018-08-02 11:58:02 +01:00
Marek Kotewicz b4ae1b6528 decode block rlp less often (#9252)
in total:
- removed 4 redundant rlp deserializations
- avoid 1 redundant block data copy
2018-08-02 10:20:46 +01:00
cheme f442665c46 Fix eternalities tests can_create (missing parameter) (#9270) 2018-08-02 17:15:22 +08:00
Nicolas Gotchac c22498066b
Update ref to `parity-common` and update `seek` behaviour (#9257)
* Update ref to `parity-common` and update `seek` behaviour

* Remove reference to `ng-fix-triedb-seek` branch
2018-08-01 18:03:41 +02:00
Wei Tang 637883f52b Comply EIP-86 with the new definition (#9140)
* Comply EIP-86 with the new CREATE2 opcode

* Fix rpc compile

* Fix interpreter CREATE/CREATE2 stack pop difference

* Add unreachable! to fix compile

* Fix instruction_info

* Fix gas check due to new stack item

* Add new tests in executive

* Fix have_create2 comment

* Remove all unused references of eip86_transition and block_number
2018-08-01 13:17:04 +02:00
Matthew Martin f0c0da8551 Check if synced when using eth_getWork (#9193) (#9210)
* Check if synced when using eth_getWork (#9193)

* Don't use fn syncing

* Fix identation

* Fix typo

* Don't check for warping

* rpc: avoid calling queue_info twice on eth_getWork
2018-07-31 12:52:49 +01:00
Marek Kotewicz 10f42a2b39 removed client error (#9253) 2018-07-31 10:55:18 +01:00
Wei Tang 29baccd857
Implement EIP-1052 (EXTCODEHASH) and fix several issues in state account cache (#9234)
* Implement EIP-1052 and fix several issues related to account cache

* Fix jsontests

* Merge two matches together

* Avoid making unnecessary Arc<Vec>

* Address grumbles
2018-07-31 13:27:57 +08:00
John-John Tedro f9814381a7 Improve Tracer documentation (#9237) 2018-07-30 13:59:01 +02:00
Denis S. Soldatov aka General-Beck 771ea47d37 Update Dockerfile (#9242)
* Update Dockerfile

fix Docker build

* fix dockerfile paths: parity -> parity-ethereum (#9248)
2018-07-30 11:28:44 +01:00
Marek Kotewicz c54beba932 block cleanup (#9117)
* blockchain insert expects owned block instead of block reference

* reduce a number of times a block is deserialized

* removed cached uncle_bytes from block

* removed is_finalized from OpenBlock

* removed unused parity_machine::WithMetadata trait

* removed commented out code

* remove unused metadata from block

* remove unused metadata from block

* BlockDetails extras may have at most 5 elements
2018-07-30 10:45:10 +01:00
Tomasz Drwięga a809621f63 Increase the number of sessions. (#9203) 2018-07-30 11:19:47 +02:00
Afri Schoedon 7ad556346e
add changelog for 1.11.8 stable and 2.0.1 beta (#9230)
* docs: add changelog for 1.11.8 stable

* docs: add changelog for 2.0.1 beta
2018-07-27 16:00:34 +02:00
Dong Zhou 5737c21340 fix typo (#9232) 2018-07-27 18:56:21 +08:00
Wei Tang 77a5ce6bf3 Fix potential as_usize overflow when casting from U256 in miner (#9221) 2018-07-27 11:07:46 +01:00
Andrew Jones fb503f523b
Allow old blocks from peers with lower difficulty (#9226)
Previously we only allow downloading of old blocks if the peer
difficulty was greater than our syncing difficulty. This change allows
downloading of blocks from peers where the difficulty is greater then
the last downloaded old block.
2018-07-27 10:13:05 +01:00
JohnnySheffield bf7677ce69 Removes duplicate libudev-dev from Dockerfile (#9220) 2018-07-27 12:20:27 +08:00
André Silva 1ce8c1cf82 snap: remove ssl dependencies from snapcraft definition (#9222) 2018-07-26 22:42:09 +02:00
Marek Kotewicz 4ddccfa5e5 remove ssl from dockerfiles, closes #8880 (#9195) 2018-07-26 12:36:15 +01:00
Wei Tang 5795d332c8 Insert PROOF messages for some cases in blockchain (#9141)
* Insert PROOF messages for some cases in blockchain

* Break expect to its own line to avoid things being too long

* Be more specific for all low-level database error cases

* Fix BranchBecomingCanonChain expect

* ethcore: fix typo in expect proof message
2018-07-25 17:45:06 +01:00
EOS Classic 823054dc34 [Chain] Add more bootnodes (#9174)
+ For ETC, ELLA, EXP, Morden, MUSIC
2018-07-25 18:06:45 +02:00
André Silva 2ce15f429b ethcore: update bn version (#9217) 2018-07-25 17:40:33 +02:00
Marek Kotewicz 143411aaf0
deserialize block only once during verification (#9161) 2018-07-25 14:36:46 +02:00
Piotr Chromiec 7d9548400d Simple build instruction fix (#9215)
Changed `parity` dir name into  `parity-ethereum`
2018-07-25 12:57:15 +02:00
Peter Pratscher 1b1941a896 Added --tx-queue-no-early-reject flag to disable early tx queue rejects (#9143)
* Added --tx-queue-no-early-reject flag to disable early tx queue rejects because of low gas price

* Fixed failing tests, clarified comments and simplified no_early_reject field name.

* Added test case for the --tx-queue-no-early-reject flag
2018-07-24 16:04:48 +03:00
Wei Tang 4848c384cd Avoid schedule copying in nested call/create (#9190)
* Avoid schedule copying in nested call/create

* Fix tests

* fix test: wrong Schedule used

* Fix private-tx test

* Fix jsontests compilation
2018-07-23 15:48:01 +02:00
André Silva d4f38d3894 ethcore: add builtin benchmarks based on geth (#9179)
* ethcore: add geth benchmarks for all builtins

* ethcore: remove old builtin benchmarks
2018-07-23 15:46:24 +02:00
André Silva e6acbc5a58 rpc: fix is_major_importing sync state condition (#9112)
* rpc: fix is_major_importing sync state condition

* rpc: fix informant printout when waiting for peers
2018-07-23 15:42:08 +02:00
Afri Schoedon 8dd4db5d85 docs: update repository links (#9159)
* docs: update repository links

* docs: update repository links in contribution guide
2018-07-23 13:58:50 +02:00
André Silva d436eddc6a parity: fix UserDefaults json parser (#9189)
* parity: fix UserDefaults json parser

* parity: use serde_derive for UserDefaults

* parity: support deserialization of old UserDefault json format

* parity: make UserDefaults serde backwards compatible

* parity: tabify indentation in UserDefaults
2018-07-23 13:57:50 +02:00
Max Kaye faf8e9ec6a Update "This is a bug. Please report it at:" link (#9191) 2018-07-23 09:18:49 +01:00
André Silva 7e6a571cba docker: update hub dockerfile (#9173)
* update Dockerfile for hub

update to Ubuntu Xenial 16.04
fix cmake version

* docker: fix tab indentation in hub dockerfile
2018-07-20 20:57:48 +03:00
Afri Schoedon 6bee9cd1e4 ci: update version strings for snaps (#9160) 2018-07-20 20:55:17 +03:00
André Silva fb2b77e991 ethcore: add missing builtins benchmarks (#9170)
* ethcore: add modexp benchmarks

* ethcore: add_bn_128_add benchmark
2018-07-20 15:06:11 +02:00
Wei Tang b914912c06 Fix bugfix hard fork logic (#9138)
* Fix bugfix hard fork logic

* Remove dustProtectionTransition from bugfix category

EIP-168 is not enabled by default

* Remove unnecessary 'static
2018-07-19 16:43:41 +02:00
Wei Tang 0ce04845de
Be more graceful on Aura difficulty validation (#9164)
* Be more graceful on Aura difficulty validation

* test: rejects_step_backwards

* test: proposer_switching

* test: rejects_future_block

* test: reports_skipped

* test: verify_empty_seal_steps
2018-07-19 22:41:31 +08:00
Marek Kotewicz 073365d5d9
handle SyncHandler errors properly (#9151)
* handle SyncHandler errors properly, closes #9150

* applied review suggestions
2018-07-19 12:46:33 +02:00
Amaury Martiny 3c27587d83 Remove node-health (#9119)
* Remove node-health

* Remove ntp_servers

* Add --ntp-servers as legacy instead of removing it

* Add --ntp-servers to deprecated args

* Remove unused stuff

* Remove _legacy_ntp_servers
2018-07-18 16:27:29 +02:00
Tomasz Drwięga dbccc700f1 Remove unused tx_queue_gas parameter. (#9153) 2018-07-18 10:58:14 +02:00
Afri Schoedon 9f90ff2e59
Changelogs for 1.11.7-stable and 2.0.0-beta (#9105)
* docs: mark 1.10 as end-of-life

* docs: move changelog for 1.11

* docs: Add changelog for 1.11.7-stable

* docs: add changelog for 2.0.0-beta

* docs: add release notes for 2.0.0 beta

* docs: fix links in changelog

* docs: Update changelog for 1.11.7-stable

* docs: Update changelog for 2.0.0-beta

* docs: address @tbaut's comments for the 2.0.0-beta changelog

* docs: add note regarding txqueue changes as recommended by @tomusdrw
2018-07-18 09:24:45 +02:00
Tomasz Drwięga 4d9c8926b1 Disable per-sender limit for local transactions. (#9148)
* Disable per-sender limit for local transactions.

* Add a missing new line.
2018-07-18 09:14:03 +02:00
André Silva 070695b348 parity: fix logging cli parameter example (#9154) 2018-07-18 09:09:31 +02:00
Thibaut S c6e97d4dc5 Be more specific for `-l` CLI arguments (#9149)
* typo

* typo

* Update mod.rs
2018-07-17 17:36:12 +01:00
Niklas Adolfsson a24e78fa92 Receipt constructor `Allocate less stack for blooms` (#9146)
* Allocate less stack in `Receipt ctor`

* ethcore: use accrue_bloom when computing transaction receipt
2018-07-17 16:55:46 +01:00
Niklas Adolfsson 21e0cd7781 `evm bench` fix broken dependencies (#9134)
* `evm bench` use valid dependencies

Benchmarks of the `evm` used stale versions of a couple a crates that
this commit fixes!

* fix warnings
2018-07-16 21:19:59 +02:00
Denis S. Soldatov aka General-Beck ed45760425 Update snapcraft.yaml (#9132) 2018-07-16 21:19:02 +02:00
Marek Kotewicz 0ca4250bd4 fix verification in ethcore-sync collect_blocks (#9135) 2018-07-16 21:05:47 +02:00
Wei Tang 5059619947 Unify engine error to reject blocks (#9085)
* Reject if Engine::on_close_block returns error

* Unify open block behaviors

* Fix tests in ethcore

* Fix Aura tests

* Fix RPC test

* Print a warning if open block failed

* Print the actual error when closing the block

* Update comments for prepare_pending_block

* Add BlockPreparationStatus to distingish three different state after prepare_pending_block
2018-07-16 13:53:55 +02:00
Niklas Adolfsson edb228839e Fix `todo` in `ethcore/types::Receipt` constructor (#9086)
Remove needless mutable variable and assignment
2018-07-16 12:43:14 +01:00
Wei Tang a9c93c797d Completely remove all dapps struct from rpc (#9107)
* Completely remove all dapps struct from rpc

* Remove unused pub use
2018-07-16 13:42:59 +02:00
Marek Kotewicz f826ac35e3
Removed redundant struct bounds and unnecessary data copying (#9096)
* Removed redundant struct bounds and unnecessary data copying

* Updated docs, removed redundant bindings
2018-07-15 11:01:47 +02:00
Anthony 9dc512349a Insert ETC (classic) hardcoded headers until block #6170625 (#9121) 2018-07-14 16:04:31 +01:00
Tomasz Drwięga 3ecf16a492 Make sure to produce full blocks. (#9115) 2018-07-13 15:20:24 +01:00
Thibaut S 584a76ab70 Update light client hardcoded headers (#9098)
* Insert Kovan hardcoded headers until #7690241

* Insert Kovan hardcoded headers until block 7690241

* Insert Ropsten hardcoded headers until #3612673

* Insert Mainnet hardcoded headers until block 5941249
2018-07-13 14:42:06 +02:00
Afri Schoedon e339cde790 parity-version: bump nightly version to 2.1 (#9095) 2018-07-13 11:44:31 +01:00
Tomasz Drwięga 82a6a0848a Fix work-notify. (#9104) 2018-07-13 11:36:58 +01:00
Marek Kotewicz 441cb7980b update snappy (#9082) 2018-07-13 11:25:46 +01:00
Tomasz Drwięga 5f523f6966 Offload cull to IoWorker. (#9099) 2018-07-13 12:23:57 +02:00
André Silva 993650f3d6 docker: add cmake dependency (#9111) 2018-07-13 12:09:41 +02:00
Marek Kotewicz ab330301eb Update hidapi, fixes #7542 (#9108) 2018-07-13 11:04:09 +02:00
Afri Schoedon bab85dd789
Update README.md (#9084)
* Update README.md

* rename parity client

* docs: remove UI stuff from readme.

* docs: add changelog link to readme
2018-07-12 18:55:14 +02:00
Pierre Krieger acae643a4a Revert "Replace `std::env::home_dir` with `dirs::home_dir` (#9077)" (#9097)
* Revert "Replace `std::env::home_dir` with `dirs::home_dir` (#9077)"

This reverts commit 7e779327eb.

* Restore some of the changes

* Update parity-common
2018-07-12 13:45:02 +02:00
Jim Posen 01f825b0e1 Multiple improvements to discovery ping handling (#8771)
* discovery: Only add nodes to routing table after receiving pong.

Previously the discovery algorithm would add nodes to the routing table
before confirming that the endpoint is participating in the protocol. This
now tracks in-flight pings and adds to the routing table only after receiving
a response.

* discovery: Refactor packet creation into its own function.

This function is useful inside unit tests.

* discovery: Additional testing for new add_node behavior.

* discovery: Track expiration of pings to non-yet-in-bucket nodes.

Now that we may ping nodes before adding to a k-bucket, the timeout tracking
must be separate from BucketEntry.

* discovery: Verify echo hash on pong packets.

Stores packet hash with in-flight requests and matches with pong response.

* discovery: Track timeouts on FIND_NODE requests.

* discovery: Retry failed pings with exponential backoff.

UDP packets may get dropped, so instead of immediately booting nodes that fail
to respond to a ping, retry 4 times with exponential backoff.

* !fixup Use slice instead of Vec for request_backoff.
2018-07-11 21:22:06 +02:00
Matthew Martin 796637b31a Add separate database directory for light client (#8927) (#9064)
* Add seperate default DB path for light client (#8927)

* Improve readability
2018-07-11 16:17:35 +02:00
Afri Schoedon 484ecfaf47
Parity Ethereum 2.0.0 (#9052)
* parity-version: major bump to 2.0.0 🎉

* parity-ethereum: rename crate 🌵

* ethcore: only accept service transactions from parity-ethereum nodes

* parity: fix --identity tests

* rpc: fix sync provider in tests

* rpc: fix parity_net_peers test

* ethcore-sync: accept service transactions from parity and parity-ethereum

* ethcore-sync: fix indentation

* ethcore-sync: split the ifs to reduce code redundancy

* ethcore-sync: fix syntax

* Fix building ethcore

* update cargo.lock

* parity-version: major bump to 2.0.0 tada

* fix merge
2018-07-11 13:35:10 +02:00
Nicolas Gotchac c082af6f74 Don't fetch snapshot chunks at random (#9088) 2018-07-11 13:04:31 +02:00
Pierre Krieger 494eb4ab6b Remove the dapps system (#9017)
* Remove the dapps system from Parity

* Move node-health outside of dapps

* Fix set dapps list test

* Update Cargo.lock

* Deprecate options

* Add _legacy_ prefixes in Dapps

* Fix tests

* Fix deprecatedness of dapps-path
2018-07-11 12:19:54 +02:00
Andronik Ordian fe678dcd2f Fix nightly warnings (#9080)
* chore: use 1.28 API for `memory_profiling`

* chore: import a type directly from `ethcore-light`
2018-07-11 08:02:14 +02:00
Afri Schoedon da5de4a6ff db: remove wal disabling / fast-and-loose option. (#8963)
* parity: highlight --fast-and-loose is not recommended.

* parity: remove fast-and-loose option, ref #1765

* db: remove db wal from options, it's always enabled

* db: remove wal from rocksdb helpers

* cli: fix wallet import test

* ethcore: fix client config tests

* parity: proper deprecated handling for fast-and-loose

* ethcore-client: fix config

* parity: mark fast-and-loose removed

* parity: fix test_find_deprecated

* parity: fix type for fast-and-loose flag

* lock file
2018-07-10 17:33:25 +02:00
shamardy 526c61e2c0 Transactions hashes missing in trace_replayBlockTransactions method result #8725 (#8883)
* Squashed commit of the following:

commit 1f85076fd584365f1acbbafef5c8bdee722b479b
Author: shamardy <shamardy@yahoo.com>
Date:   Sat Jun 30 03:40:12 2018 +0200

    update

commit 63363cca7354873a8abe3b631b8b7dbd9da6ce1e
Author: shamardy <shamardy@yahoo.com>
Date:   Sat Jun 30 03:36:25 2018 +0200

    Update

commit e05caddc170a4cf0e476c23d443f07184dcb4fb1
Author: shamardy <shamardy@yahoo.com>
Date:   Fri Jun 29 10:04:34 2018 +0200

    Test

commit b0be065eadd0f2dd70f6613c50cbf3eb16d693ec
Author: shamardy <shamardy@yahoo.com>
Date:   Fri Jun 29 09:19:57 2018 +0200

    test_client edit

commit 949205ccdbac75f730639e5f0d8e1bdd9436de1d
Author: shamardy <shamardy@yahoo.com>
Date:   Fri Jun 29 05:14:53 2018 +0200

    Edit Test

commit 7cd44ee379a1e847f3e7d225444e72775bdbd4b5
Author: shamardy <shamardy@yahoo.com>
Date:   Fri Jun 29 04:25:22 2018 +0200

    Updates

commit e90de71e698d29475e8ba5696664b7d7bb335f9c
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 27 13:53:15 2018 +0200

    Test

commit 12a76381561b66ecf6ea636d7eebe43d2dcb7731
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 27 11:43:39 2018 +0200

    Edited Tests

commit 6c21e6de2da24e7b9f33ac8b82abb0b39488bd60
Merge: 87c4c74b8 9550cf766
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 27 10:31:21 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 87c4c74b8f769c8e4b55ba78b5aa1d6716413f6d
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 27 10:31:13 2018 +0200

    Avoided Changing non-RPC Types

commit 9550cf76610953c8492cc9473e4b9f876e770b70
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:29:03 2018 +0200

    Update traces.rs

commit 3e0b0ef29685b62f0917b80a48054b3379d59a50
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:27:44 2018 +0200

    Update trace.rs

commit 5078d67a2da7268db2a1064540a3c887e1f1a3cd
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:26:08 2018 +0200

    Update traces.rs

commit 28f5ba1b035c6919ac11089cf1bdd703c75f0dbd
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:24:04 2018 +0200

    Update parity.rs

commit 3b86b98ab5860efa61a7cc6a2b20e6c5c0f859cb
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:23:33 2018 +0200

    Update eth.rs

commit bcad5a40f14a3c5d2d901ae1a9bed87949ab9c66
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:21:43 2018 +0200

    Update call_analytics.rs

commit e9029e0b8158387b606132b264652d285483870f
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:20:56 2018 +0200

    Update transaction.rs

commit 0dacc81779bc62713e3f8e405229dfd7f89f33e8
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:20:01 2018 +0200

    Update executive.rs

commit 3921d4ec77f49460d45603111b98cc07d3c235a0
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:18:39 2018 +0200

    Update executed.rs

commit 8416df654ebf6f68ad04c8a4a89a29ce704f9ca1
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Wed Jun 27 10:17:34 2018 +0200

    Update client.rs

commit cf0b4dddbc93395bc5ce1f17c3c07a294bf8dd49
Merge: 23bfa78c2 36e05e5f3
Author: shamardy <shamardy@yahoo.com>
Date:   Sun Jun 24 04:54:04 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 23bfa78c2662d697018e7061ab9ad0b864fde0ef
Author: shamardy <shamardy@yahoo.com>
Date:   Sun Jun 24 04:53:50 2018 +0200

    Undo

commit 36e05e5f30c35bd6b57af50fd337f2006df51b86
Merge: 2f6e1ef64 0afc74825
Author: shamardy <shamardy@yahoo.com>
Date:   Sun Jun 24 04:44:33 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 2f6e1ef64763a79ad2ed8baa2aed5a8f3136bafc
Author: shamardy <shamardy@yahoo.com>
Date:   Sun Jun 24 04:44:22 2018 +0200

    Another rpc test output with ("transactionHash":null)

commit 0afc74825828f724d68f3e444655b872a6c51ce0
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 07:18:45 2018 +0200

    Another rpc test output with ("transactionHash":null)

commit 138fbac9f02841adfeaaf061c5dd9e647f725e12
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 06:30:41 2018 +0200

    Edited some rpc tests output with ("transactionHash":null)

commit 8c129a63109c00f88ce36bad10699dc2f3237d95
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:48:39 2018 +0200

    Update traces.rs

commit 52c17f6191740637c1d1589a420996dccefe16bb
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:47:29 2018 +0200

    Update parity.rs

commit d39303aa8c2097ba9e2ed94c7ad2166bf1608d3f
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:46:25 2018 +0200

    Update eth.rs

commit 49be84bf529c33dc47c8260435fd0d26e137c66d
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:40:56 2018 +0200

    Update trace.rs

commit 4fc801377fb01ff11867f66b547a307c162d7a56
Merge: d34ba2351 544210439
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 05:12:21 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 54421043959e14a76f309fe87d3c7513a95999f8
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:04:51 2018 +0200

    Update trace.rs

commit 2b2524a31119d741df4076e9d1b3ce8f0b17b479
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:01:47 2018 +0200

    Update state_diff.rs

commit 2bf9982b8ce29ef69f116142eaeacf3049f7db49
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:00:50 2018 +0200

    Update transaction.rs

commit da696ea192c0f89cceb38834f6efee280129048c
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 05:00:13 2018 +0200

    Update mod.rs

commit cfc194ca0f44bfabec01a52897a322ea5a91930b
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 04:59:18 2018 +0200

    Update pod_state.rs

commit 3b3156853535a666778e0ad0e902de79fb138f1d
Author: shamardy <39480341+shamardy@users.noreply.github.com>
Date:   Thu Jun 14 04:57:37 2018 +0200

    Update client.rs

commit d34ba235132c654da6c2ed6ff0dcf96fda0c45ee
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 04:53:50 2018 +0200

    RPC Only

commit 8b5c4f19727549ee6f180a6effc228b2693509e9
Merge: 744491632 291b4a01b
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 02:55:14 2018 +0200

    Merge branch 'Issue#8725' of https://github.com/shamardy/parity into Issue#8725

commit 74449163222e0ab75c704ac0ad424870e3c321d9
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 02:27:13 2018 +0200

    Issue#8725

    Transactions hashes missing in trace_replayBlockTransactions method result #8725

commit 291b4a01be6771acff8f5829c5406fa193665dbe
Author: shamardy <shamardy@yahoo.com>
Date:   Thu Jun 14 01:18:18 2018 +0200

    Edited to make changes to RPC types only

    To make a transactions hash trace with "trace_replayBlockTransactions" add "transactionHash" to parameters

commit 9d082bece73beb8ebddfda51fa5ec279f30b7bea
Author: shamardy <shamardy@yahoo.com>
Date:   Wed Jun 13 09:15:56 2018 +0200

    Issue#8725

    Transactions hashes missing in trace_replayBlockTransactions method result #8725

* update

* Removed unwrap_or

* Update

* test_client update
2018-07-10 15:38:13 +01:00
David c7f608ec74
Delete crates from parity-ethereum and fetch them from parity-common instead (#9083)
Use crates from parity-common: hashdb, keccak-hash, kvdb, kvdb-memorydb, kvdb-rocksdb, memorydb, parity-bytes, parity-crypto, path, patricia_trie, plain_hasher, rlp, target, test-support, trie-standardmap, triehash
2018-07-10 14:59:19 +02:00
Niklas Adolfsson 6816f8b489 Updater verification (#8787)
* getting started

* refactor main

* unwrap_or -> unwrap_or_else

* force parity to lower version number to trigger update

* Fix typos

* formating

* some minor refactoring

* enable lints and fix some warnings

* make it compile

* minor tweaks to make it work

* address review comments

* Rename exe to exe_path and minor import changes

* updater: unreleased -> unknown

* Add `debug` configuration to force parity-updater

* Introduce a new feature `test-updater` in order conditionally hardcode
the version number in parity in order to force an update
* This should only be used for debug/dev purposes

* nits

* Pulled latest submodule of `wasm-tests`
2018-07-10 12:17:53 +02:00
Thibaut S cd58b5ff1f Phrasing, precisions and typos in CLI help (#9060)
* Update mod.rs

* Update mod.rs

Rephrase cli subcommand descriptions.

* fix comments
2018-07-10 12:17:11 +02:00
Pierre Krieger bca100cdb0 Some work towards iOS build (#9045) 2018-07-10 10:33:09 +02:00
Wei Tang c63452e25d Clean up deprecated options and add CHECK macro (#9036)
* CHECK macro to replace hard-coded checks

* Clean up deprecated options

* typo: FlAG -> FLAG

* Fix tests

* Deprecated non-used ui params default is None

* test: arg_ui_path is not deprecated

* arg_ui_port should be None

* Address grumbles

* Fix tests
2018-07-09 20:36:04 +01:00
Niklas Adolfsson 7e779327eb Replace `std::env::home_dir` with `dirs::home_dir` (#9077)
`std::env::home_dir` is deprecated but will probably take a while until
it is deprecated on stable. For more info see https://github.com/rust-lang/rust/pull/51656
2018-07-09 16:48:33 +02:00
Niklas Adolfsson 9f1e08663d fix warning in secret-store test (#9074) 2018-07-09 16:48:15 +02:00
Niklas Adolfsson 91122d9193 SeedHashCompute remove needless `new` impl (#9063) 2018-07-09 16:47:58 +02:00
Marek Kotewicz c7d21841a4 remove trait bounds from several structs (#9055) 2018-07-09 12:55:27 +01:00
Afri Schoedon 701692b7d3 docs: add changelog for 1.10.9 stable and 1.11.6 beta (#9069)
* docs: add changelog for 1.10.9 stable

* docs: add changelog for 1.11.6 beta
2018-07-09 13:48:40 +02:00
Niklas Adolfsson 787a30cd8e Enable test in `miner/pool/test` (#9072) 2018-07-09 12:34:28 +01:00
André Silva ca6edcaf71 fetch: replace futures-timer with tokio-timer (#9066)
* fetch: replace futures-timer with tokio-timer

Currently the coverage build fails because `futures-timer` fails to compile with
`-C link-dead-code`. This issue has been reported to `futures-timer`
(https://github.com/alexcrichton/futures-timer/issues/2) but has remained unsolved
for months. It should be fixed by rustc eventually
(https://github.com/rust-lang/rust/issues/45629).

* ci: only include local paths in coverage

* ci: exclude target from coverage
2018-07-09 09:59:05 +01:00
Marek Kotewicz 8d171a37f8 remove util-error (#9054)
* remove util-error

* fixed grumbles
2018-07-06 15:09:39 +02:00
André Silva e9bd41b3f1 Fixes for misbehavior reporting in AuthorityRound (#8998)
* aura: only report after checking for repeated skipped primaries

* aura: refactor duplicate code for getting epoch validator set

* aura: verify_external: report on validator set contract instance

* aura: use correct validator set epoch number when reporting

* aura: use epoch set when verifying blocks

* aura: report skipped primaries when generating seal

* aura: handle immediate transitions

* aura: don't report skipped steps from genesis to first block

* aura: fix reporting test

* aura: refactor duplicate code to handle immediate_transitions

* aura: let reporting fail on verify_block_basic

* aura: add comment about possible failure of reporting
2018-07-06 10:43:58 +01:00
Tomasz Drwięga aa67bd5d00 A last bunch of txqueue performance optimizations (#9024)
* Clear cache only when block is enacted.

* Add tracing for cull.

* Cull split.

* Cull after creating pending block.

* Add constant, remove sync::read tracing.

* Reset debug.

* Remove excessive tracing.

* Use struct for NonceCache.

* Fix build

* Remove warnings.

* Fix build again.
2018-07-05 16:27:48 +01:00
Marek Kotewicz 802d684994 reduce number of constraints for triedb types (#9043)
* NodeHandle does not require Hasher

* Node does not require Hasher

* change name of the template typo from I to O
2018-07-05 17:15:03 +02:00
Marek Kotewicz 434e018584 bump fs-swap to 0.2.3 so it is compatible with osx 10.11 again (#9050) 2018-07-05 14:18:50 +01:00
Sergey Pepyakin 4839294c86 Recursive test (#9042) 2018-07-05 10:09:01 +03:00
John-John Tedro 71bbcd54ff Introduce more optional features in ethcore (#9020)
* Make work-notify an optional feature

* More optional ethcore features: price-info, stratum

* Make ethcore features part of dependency instead of local features

* Put cfg gate in right location

* Feature gate register function on work-notify
2018-07-05 07:19:59 +02:00
Akira Takizawa 3db353f356 Update ETSC bootnodes (#9038) 2018-07-04 16:57:38 +01:00
Tomasz Drwięga f4c5ea8378 Optimize pending transactions filter (#9026)
* rpc: return unordered transactions in pending transactions filter

* ethcore: use LruCache for nonce cache

Only clear the nonce cache when a block is retracted

* Revert "ethcore: use LruCache for nonce cache"

This reverts commit b382c19abdb9985be1724c3b8cde83906da07d68.

* Use only cached nonces when computing pending hashes.

* Give filters their own locks, so that they don't block one another.

* Fix pending transaction count if not sealing.

* Clear cache only when block is enacted.

* Fix RPC tests.

* Address review comments.
2018-07-04 16:37:55 +01:00
Wei Tang 6a97a4a11e eip160/eip161 spec: u64 -> BlockNumber (#9044) 2018-07-04 17:28:43 +03:00
Pierre Krieger 79f754e6ac Move the C/C++ example to another directory (#9032) 2018-07-04 13:06:53 +03:00
Wei Tang e3e2fcc285 bump parking_lot to 0.6 (#9013)
* Bump parking_lot to 0.6

* Bump parity-wasm to 0.31 so it gets rid of parking_lot

ref https://github.com/paritytech/parity-wasm/pull/206

* Update jsonrpc versions

* Update wasmi and pwasm-utils version

* Fix compile

* Update jsonrpc crates
2018-07-03 17:31:08 +02:00
Tomasz Drwięga 00e61a9100 Never drop local transactions from different senders. (#9002) 2018-07-03 11:36:59 +02:00
Thibaut S f3107214f4 Precise HTTP or WebSockets for JSON-RPC options (#9027)
* Precise HTTP or WS for JSON-RPC options

- Align with https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options
- Make sure the JSON-RPC naming is consistent across the CLI options

* fix comments
2018-07-03 11:34:45 +02:00
Tomasz Drwięga 78e001284f Recently rejected cache for transaction queue (#9005)
* Store recently rejected transactions.

* Don't cache AlreadyImported rejections.

* Make the size of transaction verification queue dependent on pool size.

* Add a test for recently rejected.

* Fix logging for recently rejected.

* Make rejection cache smaller.

* obsolete test removed

* obsolete test removed

* Construct cache with_capacity.
2018-07-02 18:00:06 +01:00
David 9caa868603
Make HashDB generic (#8739)
The `patricia_trie` crate is generic over the hasher (by way of HashDB) and node encoding scheme. Adds a new `patricia_trie_ethereum` crate with concrete impls for Keccak/RLP.
2018-07-02 18:50:05 +02:00
Wei Tang 202c54d423 Only return error log for rustls (#9025) 2018-07-02 16:22:53 +01:00
Afri Schoedon 1051004aee
Update Changelogs for 1.10.8 and 1.11.5 (#9012)
* docs: update changelog for 1.10.8

* docs: update changelog for 1.11.5
2018-07-02 15:42:54 +02:00
Wei Tang a1a002f4da Attempt to graceful shutdown in case of panics (#8999)
* Handle graceful shutdown with unwinding

* Fix a race condition

* Avoid double exit deadlock

* typo: fix docs

* Fix ethkey cli compilation

* Fix all other cases panic_hook::set -> panic_hook::set_abort

* struct fields do not need to be public

* Add comments on why exiting AtomicBool is needed
2018-07-02 11:53:50 +02:00
Marek Kotewicz 5ef41ed53e simplify kvdb error types (#8924) 2018-07-02 10:04:48 +01:00
Matthew Martin 67721f3413 Add option for user to set max size limit for RPC requests (#9010)
* Add option for user to set max size limit for RPC requests as requested in #8961.

* Add max_payload to tests.

* Change name for max payload option and change value from NUM to MB.

* Fix broken test.

* Fix incorrect indentation.
2018-07-02 10:23:57 +02:00
Niklas Adolfsson 34bf2452c3
bump ntp to 0.5.0 (#9009) 2018-07-02 10:20:22 +02:00
outofgas 8fbb98fb3f Removed duplicate dependency (#9021) 2018-07-02 10:19:56 +02:00
Tomasz Drwięga 1792725651 Minimal effective gas price in the queue (#8934)
* Minimal effective gas price.

* Fix naming, add test

* Fix minimal entry score and add test.

* Fix worst_transaction.

* Remove effective gas price threshold.

* Don't leak gas_price decisions out of Scoring.
2018-06-30 11:11:31 +02:00
André Silva 47ff3a9bee parity: fix db path when migrating to blooms db (#8975) 2018-06-28 12:24:11 +02:00
Wei Tang ac3a706f0d Preserve the current abort behavior (#8995) 2018-06-27 22:31:20 +02:00
Jim Posen 9b5483a71b Improve should_replace on NonceAndGasPrice (#8980)
* Additional tests for NonceAndGasPrice::should_replace.

* Fix should_replace in the distinct sender case.

* Use natural priority ordering to simplify should_replace.
2018-06-27 15:59:36 -04:00
David 38c31c880f Tentative fix for missing dependency error (#8973)
* Tentative fix for missing dependency error

* Better fix

* Ignore build artifacts from parit-clib
2018-06-27 20:25:49 +02:00
Wei Tang 0bed5976e3 Refactor evm Instruction to be a c-like enum (#8914)
* Add a basic instruction c-like enum

* Fix all compiling errors

* Fix tests

* Access instruction info as a Instruction impl

* Use macro to avoid duplication in from_u8

* Use single space instead of multiple tabs to avoid formatting issue

* Fix evmbin compile

* typo: indentation

* Use if let to remove an expect

* Address grumbles
2018-06-27 13:33:32 +02:00
Tomasz Drwięga 19a6725430 Fix deadlock in blockchain. (#8977) 2018-06-26 20:49:06 +02:00
Afri Schoedon 48a54efcb2 snap: downgrade rust to revision 1.26.2, ref snapcraft/+bug/1778530 (#8984)
* snap: downgrade rust to revision 1.26.2, ref snapcraft/+bug/1778530

* snap: use plugin rust
2018-06-26 19:17:14 +02:00
Wei Tang c0b0dc5219 Use local parity-dapps-glue instead of crate published at crates.io (#8983)
* Use local parity-dapps-glue instead of crate published at crates.io

* Disable panic=abort and enable lto optimization
2018-06-26 17:37:51 +02:00
Afri Schoedon 683a26c830 parity: omit redundant last imported block number in light sync informant (#8962) 2018-06-26 11:31:22 +02:00
Niklas Adolfsson 1a16f335fa Disable hardware-wallets on platforms that don't support `libusb` (#8464)
* disable hardware-wallets that don't support libusb

* address grumbles

* nits

* Refactor to get rid off as much annotations asap

* Might consume slight more memory than pure conditional compilation
flags

* formatting nits

* Enable libusb for android

* Tested by it compiling succesfully with `cargo build --target=armv7--linux-androideabi`
* The binary is ~66 MB

```bash
$ size
size target/armv7-linux-androideabi/release/parity
text    	data     	bss     	dec     	hex 		filename
50676230        416200   	31456 		51123886        30c16ae 	target/armv7-linux-androideabi/release/parity
```

* Move all `fake-hardware-wallet` to its own crate

* Removes some conditional compilation flags
* Introduces `fake-hardware-wallet` crate

* return error if no hardware wallets are found
2018-06-26 09:03:38 +02:00
David 4145be863b Bump error-chain and quick_error versions (#8972)
* Update error-chain to 0.12 to silence warnings

* Bump quick_error crate to 1.2.2  to silence linter warnings
2018-06-25 14:20:44 +02:00
Wei Tang e9f1b38984 EVM benchmark utilities (#8944)
* Make it possible to expose jsontests using feature flag

* Add start_stop_hook for jsontests

* Fix evmbin compile

* Implement vm jsontests times to tsv result

* Use /usr/bin/env to avoid errors on non-Debian systems

* Move evmbin/bench.sh to scripts and add vm_jsontests script for convenience

* Add tempdir as required deps for test-helpers

* Address grumbles on comments

* Detect file/folder automatically and add command docs

* Fix bench script

* times -> timings

* typo: wrong if condition
2018-06-25 11:21:45 +02:00
Afri Schoedon edd90f153c
parity: hide legacy options from cli --help (#8967)
* parity: hide legacy options from cli --help

* parity: run a spellchecker over --help

* parity: fix casing in cli usage
2018-06-25 10:19:29 +02:00
Afri Schoedon dec390a89f scripts: fix docker build tag on latest using master (#8952) 2018-06-22 18:48:36 +03:00
Toralf Wittner 41348dead4 Add type for passwords. (#8920)
* Add type for passwords.

* Fix test.

* Simplify `Drop` impls of `Password` and `Memzero`.

* Spaces to tabs.

* Custom `Drop` impl for `Password`.
2018-06-22 15:09:15 +02:00
Afri Schoedon c473ab97c7 deps: bump fs-swap (#8953) 2018-06-22 12:57:59 +01:00
Niklas Adolfsson 0cd1de769b Eliminate some more `transmute()` (#8879)
* eliminate some more transmute()

* Address `review comments`

* Make unsafe block smaller
* Use different byte-order than `std`, read words as big endian instead
of little endian!

* Fix IpAddresses nits

* Use `from_be` to work both for big and little endian
* Ipv6 addresses were incorrectly `transmuted`

* remove needless lifetime annotation
2018-06-22 12:51:53 +01:00
Wei Tang 5ae8e8a9ca Restrict vault.json permssion to owner and using random suffix for temp vault.json file (#8932)
* Move dedup retry logic to a separate function

* Use random suffix temp vault filename and restrict permissions to owner
2018-06-22 12:30:48 +01:00
Svyatoslav Nikolsky 796d72f48e print SS.self_public when starting SS node (#8949) 2018-06-22 12:50:06 +02:00
Afri Schoedon 86a8584252
scripts: minor improvements (#8930)
* CI: enable 'latest' docker tag on master pipeline

* CI: mark both beta and stable as stable snap.

* CI: sign all windows binaries
2018-06-22 11:56:06 +02:00
André Silva 6509e90c36 rpc: cap gas limit of local calls (#8943) 2018-06-22 11:12:57 +02:00
Afri Schoedon 09ecd0c583
docs: update changelogs (#8931)
* docs: add changelog for 1.10.7

* docs: add changelog for 1.11.4
2018-06-22 11:06:31 +02:00
André Silva a6d6adc57f ethcore: fix compilation when using slow-blocks or evm-debug features (#8936)
* ethcore: fix compilation when slow-blocks feature is enabled

* ethcore: fix compilation when evm-debug feature is enabled
2018-06-22 11:00:19 +02:00
Svyatoslav Nikolsky 6be5744be4 fixed blooms dir creation (#8941) 2018-06-22 10:52:01 +02:00
Thibaut S 31b4437b93 Update hardcoded headers (#8925)
* Update kovan.json

Update Kovan to block 7693549

* Update foundation.json

Updated to block #5812225

* Update ropsten.json

Update to 3465217

* Update ropsten.json

use tabs

* Update foundation.json

use tabs

* Update kovan.json

use tabs
2018-06-22 10:49:10 +02:00
Marek Kotewicz 458afcd230 new blooms database (#8712)
* new blooms database

* fixed conflict in Cargo.lock

* removed bloomchain

* cleanup in progress

* all tests passing in trace db with new blooms-db

* added trace_blooms to BlockChainDB interface, fixed db flushing

* BlockChainDB no longer exposes RwLock in the interface

* automatically flush blooms-db after every insert

* blooms-db uses io::BufReader to read files, wrap blooms-db into Mutex, cause fs::File is just a shared file handle

* fix json_tests

* blooms-db can filter multiple possibilities at the same time

* removed enum trace/db.rs CacheId

* lint fixes

* fixed tests

* kvdb-rocksdb uses fs-swap crate

* update Cargo.lock

* use fs::rename

* fixed failing test on linux

* fix tests

* use fs_swap

* fixed failing test on linux

* cleanup after swap

* fix tests

* fixed osx permissions

* simplify parity database opening functions

* added migration to blooms-db

* address @niklasad1 grumbles

* fix license and authors field of blooms-db Cargo.toml

* restore blooms-db after snapshot
2018-06-20 15:13:07 +02:00
André Silva cf5ae81ced ethstore: retry deduplication of wallet file names until success (#8910) 2018-06-20 17:30:41 +08:00
Thibaut S 08e46432c5 Update ropsten.json (#8926) 2018-06-20 08:49:26 +02:00
Jim Posen 6f11621734 Include node identity in the P2P advertised client version. (#8830) 2018-06-18 15:50:17 +02:00
Max Kaye 6004c394d6 Allow disabling local-by-default for transactions with new config entry (#8882)
* Add tx_queue_allow_unknown_local config option

- Previous commit messages:

dispatcher checks if we have the sender account

Add `tx_queue_allow_unknown_local` to MinerOptions

Add `tx_queue_allow_unknown_local` to config

fix order in MinerOptions to match Configuration

add cli flag for tx_queue_allow_unknown_local

Update refs to `tx_queue_allow_unknown_local`

Add tx_queue_allow_unknown_local to config test

revert changes to dispatcher

Move tx_queue_allow_unknown_local to `import_own_transaction`

Fix var name

if statement should return the values

derp de derp derp derp semicolons

Reset dispatch file to how it was before

fix compile issues + change from FLAG to ARG

add test and use `into`

import MinerOptions, clone the secret

Fix tests?

Compiler/linter issues fixed

Fix linter msg - case of constants

IT LIVES

refactor to omit yucky explict return

update comments

Fix based on diff AccountProvider.has_account method

* Refactor flag name + don't change import_own_tx behaviour

fix arg name

Note: force commit to try and get gitlab tests working again 😠

* Add fn to TestMinerService

* Avoid race condition from trusted sources

- refactor the miner tests a bit to cut down on code reuse
- add `trusted` param to dispatch_transaction and import_claimed_local_transaction

Add param to `import_claimed_local_transaction`

Fix fn sig in tests
2018-06-18 15:32:18 +02:00
Benjamin Kampmann 609d83f92c Allow Poll Lifetime to be configured via CLI (#8885)
... rather than it being a hard-coded constant. fixes #5484 .
2018-06-18 13:42:54 +02:00
Marek Kotewicz 4ef71f8a82 cleanup nibbleslice (#8915) 2018-06-18 12:13:11 +02:00
Niklas Adolfsson b47218521f Hardware-wallets `Clean up things I missed in the latest PR` (#8890)
* Clean up things that I missed

* Address grumbles

* &Arc<Manager> -> &Manager
* Rustdoc -> Crate doc
2018-06-18 11:55:23 +02:00
Afri Schoedon c9cee8fd52
Remove debian/.deb and centos/.rpm packaging scripts (#8887)
* scripts: remove rpm packages

* scripts: remove deb packages

* scripts: remove unused zip archives

* scripts: remove unused ssl references

* scripts: remove debian and centos pipelines

* scripts: rename ubuntu to generic linux

* scripts: restore archives used in gitlab artifacts

* scripts: init submodules for full test suite

* scripts: do not publish master builds, only nightly, stable, beta
2018-06-18 11:49:15 +02:00
Wei Tang 75e779029f Remove a weird emoji in new_social docs (#8913) 2018-06-18 11:11:41 +02:00
André Silva 3016d54f13 Minor fix in chain supplier and light provider (#8906)
* fix chain supplier increment

* fix light provider block_headers
2018-06-15 17:30:34 +02:00
David 05e7c133fb Block 0 is valid in queries (#8891)
Early exit for block nr 0 leads to spurious error about pruning: `…your node is running with state pruning…`.

Fixes #7547, #8762
2018-06-14 19:56:27 +01:00
Marek Kotewicz fd57100190 fixed osx permissions (#8901) 2018-06-14 22:17:40 +08:00
Wei Tang fc86b1799a Atomic create new files with permissions to owner in ethstore (#8896)
* Atomic create new files with permissions to owner in ethstore

* Allow replacing existing files

We have two behaviors for `insert_with_filename` depending on whether `dedup` is true.  Add
`replace_file_with_permissions_to_owner` which use `OpenOptions::create(true)` instead of `create_new`.
2018-06-14 13:54:12 +02:00
Anthony 9546e0c8c2 Add ETC Cooperative-run load balanced parity node (#8892) 2018-06-14 13:47:19 +02:00
Maciej Hirsz 4fe6c148ef
Add support for --chain tobalaba (#8870)
* Add support for --chain tobalaba
2018-06-14 11:03:22 +02:00
Niklas Adolfsson 9e872788c7 fix some warns on nightly (#8889) 2018-06-14 10:58:46 +02:00
David Dorgan da95f77996 Add new ovh bootnodes and fix port for foundation bootnode 3.2 (#8886)
* Add new ovh bootnodes and fix port for foundation bootnode 3.2

* Remove old bootnodes.

* Remove duplicate 1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082
2018-06-14 10:46:00 +02:00
Svyatoslav Nikolsky 6f758bc7b1
SecretStore: service pack 1 (#8435)
* SecretStore: error unify initial commit

SecretStore: pass real error in error messages

SecretStore: is_internal_error -> Error::is_non_fatal

warnings

SecretStore: ConsensusTemporaryUnreachable

fix after merge

removed comments

removed comments

SecretStore: updated HTTP error responses

SecretStore: more ConsensusTemporaryUnreachable tests

fix after rebase

* SecretStore: unified SS contract config options && read

* SecretStore: service pack

SecretStore: service pack (continue)

* fixed grumbles
2018-06-14 10:01:52 +03:00
Wei Tang b37b3cd1fc Handle removed logs in filter changes and add geth compatibility field (#8796)
* Add removed geth compatibility field in log

* Fix mocked tests

* Add field block hash in PollFilter

* Store last block hash info for log filters

* Implement canon route

* Use canon logs for fetching reorg logs

Light client removed logs fetching is disabled. It looks expensive.

* Make sure removed flag is set

* Address grumbles
2018-06-13 13:39:27 +02:00
Marek Kotewicz e81069ab3d
fixed ipc leak, closes #8774 (#8876) 2018-06-13 13:02:16 +02:00
Afri Schoedon bf25f17880
scripts: remove md5 checksums (#8884) 2018-06-13 11:26:35 +02:00
Niklas Adolfsson 6201532c64 hardware_wallet/Ledger `Sign messages` + some refactoring (#8868)
* getting started

* getting started

* signing personal messages works and refactoring

* Refactor `Ledger`

* Make `Ledger Manager` only visible inside the hardwallet-crate
* Refactor `send_apdu` with separate functions for read and write

* Add support for signing messages through `ethcore`

* Trezor modify update_devices and some error msgs

* nits
2018-06-13 11:01:56 +02:00
Wei Tang 3094ae9df9 Check whether we need resealing in miner and unwrap has_account in account_provider (#8853)
* Remove unused Result wrap in has_account

* Check whether we need to reseal for external transactions

* Fix reference to has_account interface

* typo: missing )

* Refactor duplicates to prepare_and_update_sealing

* Fix build
2018-06-13 09:58:52 +02:00
André Silva 59f6931e06 docker: Fix alpine build (#8878)
- Switch to alpine edge for recent rustc version
- Remove openssl libs
- Add perl (needed for building ring)
2018-06-13 09:29:23 +02:00
Andrew Jones 95a601d053 Remove mac os installers etc (#8875) 2018-06-13 09:15:40 +02:00
shdown 5d7ef54d02 README.md: update the list of dependencies (#8864) 2018-06-12 23:49:19 +02:00
Wei Tang b34d46cbc8 Fix concurrent access to signer queue (#8854)
* Fix concurrent access to signer queue

* Put request back to the queue if confirmation failed

* typo: fix docs and rename functions to be more specific

`request_notify` does not need to be public, and it's renamed to `notify_result`.
`notify` is renamed to `notify_message`.

* Change trace info "Transaction" -> "Request"
2018-06-12 15:21:30 +02:00
Vladyslav Lupashevskyi 0bb78814a6 Tx permission contract improvement (#8400)
* Tx permission contract improvement

* Use tuple for to address

* Introduced ABI for deprecated tx permission contract

* Improved ABI for tx permission contract with contract name, name hash and version

* Introduced support for deprecated tx permission contract + fixed cache for the new version + introduced `target` for tx filter loging

* Introduced test for the new tx permission contract version + old test renamed as deprecated

* Removed empty lines

* Introduced filter_only_sender return value in allowedTxTypes fn + improved caching

* Introduced version checking for tx permission contract

* Moved tx permission contract test genesis specs to separate files

* handle queue import errors a bit more gracefully (#8385)

* Some tweaks to main.rs for parity as a library (#8370)

* Some tweaks to main.rs for parity as a library

* Remove pub from PostExecutionAction

* New Transaction Queue implementation (#8074)

* Implementation of Verifier, Scoring and Ready.

* Queue in progress.

* TransactionPool.

* Prepare for txpool release.

* Miner refactor [WiP]

* WiP reworking miner.

* Make it compile.

* Add some docs.

* Split blockchain access to a separate file.

* Work on miner API.

* Fix ethcore tests.

* Refactor miner interface for sealing/work packages.

* Implement next nonce.

* RPC compiles.

* Implement couple of missing methdods for RPC.

* Add transaction queue listeners.

* Compiles!

* Clean-up and parallelize.

* Get rid of RefCell in header.

* Revert "Get rid of RefCell in header."

This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb.

* Override Sync requirement.

* Fix status display.

* Unify logging.

* Extract some cheap checks.

* Measurements and optimizations.

* Fix scoring bug, heap size of bug and add cache

* Disable tx queueing and parallel verification.

* Make ethcore and ethcore-miner compile again.

* Make RPC compile again.

* Bunch of txpool tests.

* Migrate transaction queue tests.

* Nonce Cap

* Nonce cap cache and tests.

* Remove stale future transactions from the queue.

* Optimize scoring and write some tests.

* Simple penalization.

* Clean up and support for different scoring algorithms.

* Add CLI parameters for the new queue.

* Remove banning queue.

* Disable debug build.

* Change per_sender limit to be 1% instead of 5%

* Avoid cloning when propagating transactions.

* Remove old todo.

* Post-review fixes.

* Fix miner options default.

* Implement back ready transactions for light client.

* Get rid of from_pending_block

* Pass rejection reason.

* Add more details to drop.

* Rollback heap size of.

* Avoid cloning hashes when propagating and include more details on rejection.

* Fix tests.

* Introduce nonces cache.

* Remove uneccessary hashes allocation.

* Lower the mem limit.

* Re-enable parallel verification.

* Add miner log. Don't check the type if not below min_gas_price.

* Add more traces, fix disabling miner.

* Fix creating pending blocks twice on AuRa authorities.

* Fix tests.

* re-use pending blocks in AuRa

* Use reseal_min_period to prevent too frequent update_sealing.

* Fix log to contain hash not sender.

* Optimize local transactions.

* Fix aura tests.

* Update locks comments.

* Get rid of unsafe Sync impl.

* Review fixes.

* Remove excessive matches.

* Fix compilation errors.

* Use new pool in private transactions.

* Fix private-tx test.

* Fix secret store tests.

* Actually use gas_floor_target

* Fix config tests.

* Fix pool tests.

* Address grumbles.

* clarify that windows need perl and yasm (#8402)

* Unify and limit rocksdb dependency places (#8371)

* secret_store: remove kvdb_rocksdb dependency

* cli: init db mod for open dispatch

* cli: move db, client_db, restoration_db, secretstore_db to a separate mod

* migration: rename to migration-rocksdb and remove ethcore-migrations

* ethcore: re-move kvdb-rocksdb dep to test

* mark test_helpers as test only and fix migration mod naming

* Move restoration_db_handler to test_helpers_internal

* Fix missing preambles in test_helpers_internal and rocksdb/helpers

* Move test crates downward

* Fix missing docs

* cli, db::open_db: move each argument to a separate line

* Use featuregate instead of dead code for `open_secretstore_db`

* Move pathbuf import to open_secretstore_db

Because it's only used there behind a feature gate

* Use tokio::spawn in secret_store listener and fix Uri (#8373)

* Directly wait for future to resolve in a threadpool

* Ignore return value

* Use path.starts_with instead of req_uri.is_absolute

The later now means something else in hyper 0.11..

* Use tokio::spawn

* typo: remove accidential unsafe impl

* remove Tendermint extra_info due to seal inconsistencies (#8367)

* More code refactoring to integrate Duration (#8322)

* More code refactoring to integrate Duration

* Fix typo

* Fix tests

* More test fix

* tokio-core v0.1.16 -> v0.1.17 (#8408)

* Replace legacy Rlp with UntrustedRlp and use in ethcore rlp views (#8316)

* WIP

* Replace Rlp with UntrustedRlp in views, explicity unwrap with expect

First pass to get it to compile. Need to figure out whether to do this or to propogate Errors upstream, which would require many more changes to dependent code. If we do this way we are assuming that the views are always used in a context where the rlp is trusted to be valid e.g. when reading from our own DB. So need to fid out whether views are used with data received from an untrusted (e.g. extrernal peer).

* Remove original Rlp impl, rename UntrustedRlp -> Rlp

* Create rlp views with view! macro to record debug info

Views are assumed to be over valid rlp, so if there is a decoding error we record where the view was created in the first place and report it in the expect

* Use $crate in view! macro to avoid import, fix tests

* Expect valid rlp in decode functions for now

* Replace spaces with tabs in new file

* Add doc tests for creating views with macro

* Update rlp docs to reflect removing of UntrustedRlp

* Replace UntrustedRlp usages in private-tx merge

* Fix TODO comments (#8413)

* update zip to 0.3 (#8381)

* update zip to 0.3

* enable zip deflate feature

* typo, docs parity_chainId: empty string -> None (#8434)

* Fix receipts stripping. (#8414)

* Changelogs for 1.9.6 and 1.10.1 (#8411)

* Add changelog for 1.9.6

* Add Changelog for 1.10.1

* Move ethcore::Error to error_chain (#8386)

* WIP

* Convert Ethcore error to use error_chain

* Use error_chain for ImportError and BlockImportError

* Fix error pattern matches for error_chain in miner

* Implement explicit From for AccountsError

* Fix pattern matches for ErrorKinds

* Handle ethcore error_chain in light client

* Explicitly define Result type to avoid shadowing

* Fix remaining Error pattern matches

* Fix tab space formatting

* Helps if the tests compile

* Fix error chain matching after merge

* remove From::from. (#8390)

* Some tiny modifications.
1. fix some typo in the comment.
2. sort the order of methods in 'impl state::Backend for StateDB`

* Remove the clone of code_cache, as it has been done in clone_basic.

* remove From::from. It seems not necessary.

* Use forked app_dirs crate for reverted Windows dir behavior  (#8438)

* Remove unused appdirs dependency in CLI

* Use forked app_dirs crate for reverted Windows dir behavior

* Permission fix (#8441)

* Block reward contract (#8419)

* engine: add block reward contract abi and helper client

* aura: add support for block reward contract

* engine: test block reward contract client

* aura: test block reward contract

* engine + aura: add missing docs

* engine: share SystemCall type alias

* aura: add transition for block reward contract

* engine: fix example block reward contract source link and bytecode

* Improve VM executor stack size estimation rules (#8439)

* Improve VM executor stack size estimation rules

* typo: docs add "(Debug build)" comment

* Fix an off by one typo and set minimal stack size

This avoids the case if `depth_threshold == max_depth`. Usually setting stack size to zero will just rebound it to
platform minimal stack size, but we set it here just in case.

* Use saturating_sub to avoid potential overflow

* Private transactions processing error handling (#8431)

* Integration test for private transaction returned

* Do not interrupt verification in case of errors

* Helpers use specified

* Review comments fixed

* Update Cargo hidapi-rs dependency (#8447)

* Allow 32 bit pipelines to fail (#8454)

* Disable 32bit tragets for gitlab

* Rename linux pipelines

* Update wasmi (#8452)

* Return error in case eth_call returns VM errors (#8448)

* Add VMError generator

* Return executed exceptions in eth_call

* ParityShell::open `Return result` (#8377)

* start

* add error handling for winapi

* fix typo

* fix warnings and windows errors

* formatting

* Address review comments

* fix docker build (#8462)

* Add changelog for 1.9.7 and 1.10.2 (#8460)

* Add changelog for 1.9.7

* Add Changelog for 1.10.2

* Apply proper markdown

* Run a spellchecker :)

* Be pedantic about the 32-bit pipelines :)

* fix typos in vm description comment (#8446)

* Use rename_all for RichBlock and RichHeader serialization (#8471)

* typo: fix a resolved TODO comment

* Use rename_all instead of individual renames

* Don't require write lock when fetching status. (#8481)

* Bump master to 1.12 (#8477)

* Bump master to 1.12

* Bump crates to 1.12

* Bump mac installer version to 1.12

* Update Gitlab scripts

* Fix snap builds (#8483)

* Update hardcodedSync for Ethereum, Kovan, and Ropsten (#8489)

* Update wasmi and pwasm-utils (#8493)

* Update wasmi to 0.2

New wasmi supports 32bit platforms and no longer requires a special feature to build for such platforms.

* Update pwasm-utils to 0.1.5

* Remove three old warp boot nodes. (#8497)

* Return error if RLP size of transaction exceeds the limit (#8473)

* Return error if RLP size of transaction exceeds the limit

* Review comments fixed

* RLP check moved to verifier, corresponding pool test added

* `duration_ns: u64 -> duration: Duration` (#8457)

* duration_ns: u64 -> duration: Duration

* format on millis {:.2} -> {}

* Remove unused dependency `bigint` (#8505)

* remove unused dependency bigint in

* remove bigint in rpc_cli

* Show imported messages for light client (#8517)

* Directly return None if tracing is disabled (#8504)

* Directly return None if tracing is disabled

* Address gumbles: release read locks as fast as possible

* Hardware Wallet trait (#8071)

* getting started with replacing HardwareWalletManager

* trezor and ledger impls the new trait with some drawbacks

* Everything move to the new trait

* It required lifetime annotations in the trait because [u8] in unsized
* Lets now start moving entry point from HardwareWalletManager

* rename trait to Wallet

* move thread management to the actual wallets

* Moved thread management to each respective Wallet
* Cleaned up pub items that is needed to be pub
* Wallet trait more or less finished
* Cleaned up docs

* fix tests

* omit removed docs

* fix spelling, naming och remove old comments

* ledger test is broken, add correct logging format

* So locally on my machine Linux Ubuntu 17.10 the test doesn't panic but on the CI server libusb::Context::new()
fails which I don't understand because it has worked before
* Additionally the ledger test is optional so I lean toward ignoring it the CI Server

* ignore hardware tests by default

* more verbose checking in ledger test

* SecretStore: merge two types of errors into single one + Error::is_non_fatal (#8357)

* SecretStore: error unify initial commit

SecretStore: pass real error in error messages

SecretStore: is_internal_error -> Error::is_non_fatal

warnings

SecretStore: ConsensusTemporaryUnreachable

fix after merge

removed comments

removed comments

SecretStore: updated HTTP error responses

SecretStore: more ConsensusTemporaryUnreachable tests

fix after rebase

* fixed grumbles

* use HashSet in tests

* Enable WebAssembly and Byzantium for Ellaism (#8520)

* Enable WebAssembly and Byzantium for Ellaism

* Fix indentation

* Remove empty lines

* More changes for Android (#8421)

* Transaction Pool improvements (#8470)

* Don't use ethereum_types in transaction pool.

* Hide internal insertion_id.

* Fix tests.

* Review grumbles.

* Fetching logs by hash in blockchain database (#8463)

* Fetch logs by hash in blockchain database

* Fix tests

* Add unit test for branch block logs fetching

* Add docs that blocks must already be sorted

* Handle branch block cases properly

* typo: empty -> is_empty

* Remove return_empty_if_none by using a closure

* Use BTreeSet to avoid sorting again

* Move is_canon to BlockChain

* typo: pass value by reference

* Use loop and wrap inside blocks to simplify the code

Borrowed from https://github.com/paritytech/parity/pull/8463#discussion_r183453326

* typo: missed a comment

* Pass on storage keys tracing to handle the case when it is not modified (#8491)

* Pass on storage keys even if it is not modified

* typo: account and storage query

`to_pod_diff` builds both `touched_addresses` merge and storage keys merge.

* Fix tests

* Use state query directly because of suicided accounts

* Fix a RefCell borrow issue

* Add tests for unmodified storage trace

* Address grumbles

* typo: remove unwanted empty line

* ensure_cached compiles with the original signature

* Don't panic in import_block if invalid rlp (#8522)

* Don't panic in import_block if invalid rlp

* Remove redundant type annotation

* Replace RLP header view usage with safe decoding

Using the view will panic with invalid RLP. Here we use Rlp decoding directly which will return a `Result<_, DecoderError>`. While this path currently should not have any invalid RLP - it makes it safer if ever called with invalid RLP from other code paths.

* Remove expect (#8536)

* Remove expect and propagate rlp::DecoderErrors as TrieErrors

* EIP 145: Bitwise shifting instructions in EVM (#8451)

* Add SHL, SHR, SAR opcodes

* Add have_bitwise_shifting schedule flag

* Add all EIP tests for SHL

* Add SHR implementation and tests

* Implement SAR and add tests

* Add eip145transition config param

* Change map_or to map_or_else when possible

*  Consolidate crypto functionality in `ethcore-crypto`. (#8432)

* Consolidate crypto functionality in `ethcore-crypto`.

- Move `ecdh`/`ecies` modules to `ethkey`.
- Refactor `ethcore-crypto` to use file per module.
- Replace `subtle` with `ethcore_crypto::is_equal`.
- Add `aes_gcm` module to `ethcore-crypto`.

* Rename `aes::{encrypt,decrypt,decrypt_cbc}` ...

... to `aes::{encrypt_128_ctr,decrypt_128_ctr,decrypt_128_cbc}`.

* ethcore, rpc, machine: refactor block reward application and tracing (#8490)

* Keep all enacted blocks notify in order (#8524)

* Keep all enacted blocks notify in order

* Collect is unnecessary

* Update ChainNotify to use ChainRouteType

* Fix all ethcore fn defs

* Wrap the type within ChainRoute

* Fix private-tx and sync api

* Fix secret_store API

* Fix updater API

* Fix rpc api

* Fix informant api

* Eagerly cache enacted/retracted and remove contain_enacted/retracted

* Fix indent

* tests: should use full expr form for struct constructor

* Use into_enacted_retracted to further avoid copy

* typo: not a function

* rpc/tests: ChainRoute -> ChainRoute::new

* Node table sorting according to last contact data (#8541)

* network-devp2p: sort nodes in node table using last contact data

* network-devp2p: rename node contact types in node table json output

* network-devp2p: fix node table tests

* network-devp2p: note node failure when failed to establish connection

* network-devp2p: handle UselessPeer error

* network-devp2p: note failure when marking node as useless

* Rlp decode returns Result (#8527)

rlp::decode returns Result

Make a best effort to handle decoding errors gracefully throughout the code, using `expect` where the value is guaranteed to be valid (and in other places where it makes sense).

* Parity as a library (#8412)

* Parity as a library

* Fix concerns

* Allow using a null on_client_restart_cb

* Fix more concerns

* Test the C library in test.sh

* Reduce CMake version to 3.5

* Move the clib test before cargo test

* Add println in test

* Trace precompiled contracts when the transfer value is not zero (#8486)

* Trace precompiled contracts when the transfer value is not zero

* Add tests for precompiled CALL tracing

* Use byzantium test machine for the new test

* Add notes in comments on why we don't trace all precompileds

* Use is_transferred instead of transferred

* Don't block sync when importing old blocks (#8530)

* Alter IO queueing.

* Don't require IoMessages to be Clone

* Ancient blocks imported via IoChannel.

* Get rid of private transactions io message.

* Get rid of deadlock and fix disconnected handler.

* Revert to old disconnect condition.

* Fix tests.

* Fix deadlock.

* Make trace-time publishable. (#8568)

* Remove State::replace_backend (#8569)

* Refactoring `ethcore-sync` - Fixing warp-sync barrier (#8543)

* Start dividing sync chain : first supplier method

* WIP - updated chain sync supplier

* Finish refactoring the Chain Sync Supplier

* Create Chain Sync Requester

* Add Propagator for Chain Sync

* Add the Chain Sync Handler

* Move tests from mod -> handler

* Move tests to propagator

* Refactor SyncRequester arguments

* Refactoring peer fork header handler

* Fix wrong highest block number in snapshot sync

* Small refactor...

* Address PR grumbles

* Retry failed CI job

* Fix tests

* PR Grumbles

* Decoding headers can fail (#8570)

* rlp::decode returns Result

* Fix journaldb to handle rlp::decode Result

* Fix ethcore to work with rlp::decode returning Result

* Light client handles rlp::decode returning Result

* Fix tests in rlp_derive

* Fix tests

* Cleanup

* cleanup

* Allow panic rather than breaking out of iterator

* Let decoding failures when reading from disk blow up

* syntax

* Fix the trivial grumbles

* Fix failing tests

* Make Account::from_rlp return Result

* Syntx, sigh

* Temp-fix for decoding failures

* Header::decode returns Result

Handle new return type throughout the code base.

* Do not continue reading from the DB when a value could not be read

* Fix tests

* Handle header decoding in light_sync

* Handling header decoding errors

* Let the DecodeError bubble up unchanged

* Remove redundant error conversion

* Update CHANGELOG for 1.9, 1.10, and 1.11 (#8556)

* Move changelog for 1.10.x

* Mark 1.9 EOL

* Prepare changelog for 1.10.3 stable

* Prepare changelog for 1.11.0 stable

* Update changelogs

* Update CHANGELOG for 1.10.3 beta

* Update CHANGELOG for 1.11.0 beta

* Update CHANGELOG for 1.11.0 beta

* Update CHANGELOG for 1.11.0 beta

* Format changelog

* Handle socket address parsing errors (#8545)

Unpack errors and check for io::ErrorKind::InvalidInput and return our own AddressParse error. Remove the foreign link to std::net::AddrParseError and add an `impl From` for that error. Test parsing properly.

* Remove unnecessary cloning in overwrite_with (#8580)

* Remove unnecessary cloning in overwrite_with

* Remove into_iter

* changelog nit (#8585)

* Rename `whisper-cli binary` to `whisper` (#8579)

* rename whisper-cli binary to whisper

* fix tests

* Add whisper CLI to the pipelines (#8578)

* Add whisper CLI to the pipelines

* Address todo, ref #8579

* Added Dockerfile for alpine linux by @andresilva, closes #3565 (#8587)

* Changelog and Readme (#8591)

* Move changelog for 1.10.x

* Mark 1.9 EOL

* Prepare changelog for 1.10.3 stable

* Prepare changelog for 1.11.0 stable

* Update changelogs

* Update CHANGELOG for 1.10.3 beta

* Update CHANGELOG for 1.11.0 beta

* Update CHANGELOG for 1.11.0 beta

* Update CHANGELOG for 1.11.0 beta

* Format changelog

* Update README for 1.11

* Fix typo

* Attempt to fix intermittent test failures (#8584)

Occasionally should_return_correct_nonces_when_dropped_because_of_limit fails, possibly because of multiple threads competing to finish. See CI logs here for an example: https://gitlab.parity.io/parity/parity/-/jobs/86738

* Make mio optional in ethcore-io (#8537)

* Make mio optional in ethcore-io

* Add some annotations, plus a check for features

* Increase timer for test

* Fix Parity UI link (#8600)

Fix link https://github.com/paritytech/parity/issues/8599

* fix compiler warning (#8590)

* Block::decode() returns Result (#8586)

* block_header can fail so return Result (#8581)

* block_header can fail so return Result

* Restore previous return type based on feedback

* Fix failing doc tests running on non-code

* Remove inject.js server-side injection for dapps (#8539)

* Remove inject.js server-side injection for dapps

* Remove dapps test `should_inject_js`

Parity doesn't inject a <script> tag inside the responses anymore

* Fix the mio test again (#8602)

* 2 tiny modification on snapshot (#8601)

* Some tiny modifications.
1. fix some typo in the comment.
2. sort the order of methods in 'impl state::Backend for StateDB`

* Remove the clone of code_cache, as it has been done in clone_basic.

* remove From::from. It seems not necessary.

* change mode: remove rust files' executable mode.

* 2 tiny modifications on snapshot.

* Use full qualified syntax for itertools::Itertools::flatten (#8606)

* Fix packet count when talking with PAR2 peers (#8555)

* Support diferent packet counts in different protocol versions.

* Fix light timeouts and eclipse protection.

* Fix devp2p tests.

* Fix whisper-cli compilation.

* Fix compilation.

* Fix ethcore-sync tests.

* Revert "Fix light timeouts and eclipse protection."

This reverts commit 06285ea8c1d9d184d809f64b5507aece633da6cc.

* Increase timeouts.

* typo: wrong indentation in kovan config (#8610)

* Fix account list double 0x display (#8596)

* Remove unused self import

* Fix account list double 0x display

* Remove manually added text to the errors (#8595)

These messages were confusing for the users especially the help message.

* Gitlab test script fixes (#8573)

* Exclude /docs from modified files.

* Ensure all references in the working tree are available

* Remove duplicated line from test script

* Fix BlockReward contract "arithmetic operation overflow" (#8611)

* Fix BlockReward contract "arithmetic operation overflow"

* Add docs on how execute_as_system works

* Fix typo

* ´main.rs´ typo (#8629)

* Typo

* Update main.rs

* Store morden db and keys in "path/to/parity/data/Morden" (ropsten uses "test", like before) (#8621)

* Store morden db and keys in "path/to/parity/data/morden" (ropsten uses "test", like before)

* Fix light sync with initial validator-set contract (#8528)

* Fix #8468

* Use U256::max_value() instead

* Fix again

* Also change initial transaction gas

* Remove NetworkContext::io_channel() (#8625)

* Remove io_channel()

* Fix warning

* Check that the Android build doesn't dep on c++_shared (#8538)

* Fork choice and metadata framework for Engine (#8401)

* Add light client TODO item

* Move existing total-difficulty-based fork choice check to Engine

* Abstract total difficulty and block provider as Machine::BlockMetadata and Machine::BlockProvider

* Decouple "generate_metadata" logic to Engine

* Use fixed BlockMetadata and BlockProvider type for null and instantseal

In this way they can use total difficulty fork choice check

* Extend blockdetails with metadatas and finalized info

* Extra data update: mark_finalized and update_metadatas

* Check finalized block in Blockchain

* Fix a test constructor in verification mod

* Add total difficulty trait

* Fix type import

* Db migration to V13 with metadata column

* Address grumbles

* metadatas -> metadata

* Use generic type for update_metadata to avoid passing HashMap all around

* Remove metadata in blockdetails

* [WIP] Implement a generic metadata architecture

* [WIP] Metadata insertion logic in BlockChain

* typo: Value -> Self::Value

* [WIP] Temporarily remove Engine::is_new_best interface

So that we don't have too many type errors.

* [WIP] Fix more type errors

* [WIP] ExtendedHeader::PartialEq

* [WIP] Change metadata type Option<Vec<u8>> to Vec<u8>

* [WIP] Remove Metadata Error

* [WIP] Clean up error conversion

* [WIP] finalized -> is_finalized

* [WIP] Mark all fields in ExtrasInsert as pub

* [WIP] Remove unused import

* [WIP] Keep only local metadata info

* Mark metadata as optional

* [WIP] Revert metadata db change in BlockChain

* [WIP] Put finalization in unclosed state

* Use metadata interface in BlockDetail

* [WIP] Fix current build failures

* [WIP] Remove unused blockmetadata struct

* Remove DB migration info

* [WIP] Typo

* Use ExtendedHeader to implement fork choice check

* Implement is_new_best using Ancestry iterator

* Use expect instead of panic

* [WIP] Add ancestry Engine support via on_new_block

* Fix tests

* Emission of ancestry actions

* use_short_version should take account of metadata

* Engine::is_new_best -> Engine::fork_choice

* Use proper expect format as defined in #1026

* panic -> expect

* ancestry_header -> ancestry_with_metadata

* Boxed iterator -> &mut iterator

* Fix tests

* is_new_best -> primitive_fork_choice

* Document how fork_choice works

* Engine::fork_choice -> Engine::primitive_fork_choice

* comment: clarify types of finalization where Engine::primitive_fork_choice works

* Expose FinalizationInfo to Engine

* Fix tests due to merging

* Remove TotalDifficulty trait

* Do not pass FinalizationInfo to Engine

If there's finalized blocks in from route, choose the old branch without calling `Engine::fork_choice`.

* Fix compile

* Fix unused import

* Remove is_to_route_finalized

When no block reorg passes a finalized block, this variable is always false.

* Address format grumbles

* Fix docs: mark_finalized returns None if block hash is not found

`blockchain` mod does not yet have an Error type, so we still temporarily use None here.

* Fix inaccurate tree_route None expect description

* typo (#8640)

* Changelog for 1.10.4-stable and 1.11.1-beta (#8637)

* Add changelog for 1.10.4

* Add changelog for 1.11.1

* Fix Typos

* Don't open Browser post-install on Mac (#8641)

Since we start parity with the UI disabled per default now, opening the browser post installation will show an annoying error message, confusing the user. This patch removes opening the browser to prevent that annoyance.

fixes #8194

* Resumable warp-sync / Seed downloaded snapshots (#8544)

* Start dividing sync chain : first supplier method

* WIP - updated chain sync supplier

* Finish refactoring the Chain Sync Supplier

* Create Chain Sync Requester

* Add Propagator for Chain Sync

* Add the Chain Sync Handler

* Move tests from mod -> handler

* Move tests to propagator

* Refactor SyncRequester arguments

* Refactoring peer fork header handler

* Fix wrong highest block number in snapshot sync

* Small refactor...

* Resume warp-sync downloaded chunks

* Add comments

* Refactoring the previous chunks import

* Fix tests

* Address PR grumbles

* Fix not seeding current snapshot

* Address PR Grumbles

* Address PR grumble

* Retry failed CI job

* Update SnapshotService readiness check
Fix restoration locking issue for previous chunks restoration

* Fix tests

* Fix tests

* Fix test

* Early abort importing previous chunks

* PR Grumbles

* Update Gitlab CI config

* SyncState back to Waiting when Manifest peers disconnect

* Move fix

* Better fix

* Revert GitLab CI changes

* Fix Warning

* Refactor resuming snapshots

* Fix string construction

* Revert "Refactor resuming snapshots"

This reverts commit 75fd4b553a38e4a49dc5d6a878c70e830ff382eb.

* Update informant log

* Fix string construction

* Refactor resuming snapshots

* Fix informant

* PR Grumbles

* Update informant message : show chunks done

* PR Grumbles

* Fix

* Fix Warning

* PR Grumbles

* Fix not downloading old blocks (#8642)

* Remove HostInfo::next_nonce (#8644)

* Remove the Keccak C library and use the pure Rust impl (#8657)

* Add license and readme

* Use pure rust implementation

* Bump version to 0.1.1

* Don't use C, prefer the pure Rust implementation

* Add test for `write_keccak`

* Bump version

* Add benchmarks

* Add benchmarks

* Add keccak_256, keccak_512, keccak_256_unchecked and keccak_512_unchecked – mostly for compatibility with ethash

* Remove failed git merge attempt from external git repo
Cargo.lock updates

* whitespace

* Mark unsafe function unsafe

* Unsafe calls in unsafe block

* Document unsafety invariants

* Revert unintended changes to Cargo.lock

* updated tiny-keccak to 1.4.2 (#8669)

* parity: improve cli help and logging (#8665)

* parity: indicate disabling ancient blocks is not recommended

* parity: display decimals for stats in informant

* Refactor EIP150, EIP160 and EIP161 forks to be specified in CommonParams  (#8614)

* Allow post-homestead forks to be specified in CommonParams

* Fix all json configs

* Fix test in json crate

* Fix test in ethcore

* Fix all chain configs to use tabs

Given we use tabs in .editorconfig and the majority of chain configs.
This change is done in Emacs using `mark-whole-buffer` and `indent-region`.

* Remove HostInfo::client_version() and secret() (#8677)

* Move connection_filter to the network crate (#8674)

* Remove the error when stopping the network (#8671)

* Allow making direct RPC queries from the C API (#8588)

* Fix cli signer (#8682)

* Update ethereum-types so `{:#x}` applies 0x prefix

* Fix tx permission tests

* Use impl Future in the light client RPC helpers (#8628)

* Update mod.rs (#8695)

- Update interfaces affected by unsafe-expose
- replace `{{ }}` as this  throws an error in Jekyll (wiki)

* remove empty file (#8705)

* Set the request index to that of the current request (#8683)

* Set the request index to that of the current request

When setting up the chain of (two) requests to look up a block by hash, the second need to refer to the first. This fixes an issue where the back ref was set to the subsequent request, not the current one. When the requests are executed we loop through them in order and ensure the requests that should produce headers all match up. We do this by index so they better be right.

In other words: off by one.

* parity: trim whitespace when parsing duration strings (#8692)

* Implement recursive Debug for Nodes in patrica_trie::TrieDB (#8697)

fixes #8184

* Remove unused imports (#8722)

* Update dev chain (#8717)

* Make dev chain more foundation-like and enable wasm.

* Fix compilation warnings.

* Add a test for decoding corrupt data (#8713)

* Fix compilation error on nightly rust (#8707)

On nightly rust passing `public_url` works but that breaks on stable. This works for both.

* network-devp2p: handle UselessPeer disconnect (#8686)

* Shutdown the Snapshot Service early (#8658)

* Shutdown the Snapshot Service when shutting down the runner

* Rename `service` to `client_service`

* Fix tests

* Fix local transactions policy. (#8691)

* Add a deadlock detection thread (#8727)

* Add a deadlock detection thread

Expose it under a feature flag:
`cargo build --features "deadlock_detection"`

* Address Nicklas's comments

* Remove unused function new_pow_test_spec (#8735)

* Add 'interface' option to cli (#8699)

Additionally as to the port, the new  command line option
now allows the user to specify the network interface the P2P-Parity
listens, too. With support for 'all' and 'local' like in all other
versions of this flag. Default is 'all' (aka ).

* Fix some nits using clippy (#8731)

* fix some nits using clippy

* fix tests

* Remove a couple of unnecessary `transmute()` (#8736)

* bump tinykeccak to 1.4 (#8728)

* ease tiny-keccak version requirements (1.4.1 -> 1.4) (#8726)

* Remove -k/--insecure option from curl installer (#8719)

Piping `curl` to `bash` while **disabling** certificate verification can lead to security problems.

* Fix PoW blockchains sealing notifications in chain_new_blocks (#8656)

* Print warnings when fetching pending blocks (#8711)

* Lots of println to figure out what eth_getBlockByNumber does/should do

* Remove debugging

* Print warnings when fetching pending blocks

When calling `eth_getBlockByNumber` with `pending`, we now print a deprecation warning and:

* if a pending block is found, use it to respond
* if no pending block is found, respond as if if was a request for `Latest`

Addresses issue #8703 (not sure if it's enough to close it tbh)

* Fix XOR distance calculation in discovery Kademlia impl (#8589)

* network-devp2p: Test for discovery bucket insertion.

All test values are randomly generated and the assertions are checked manually.
Test fails because distance metric is implemented incorrectly.

* network-devp2p: Fix discovery distance function.

The Kademlia distance function (XOR) was implemented incorrectly as a population count.

* network-devp2p: Refactor nearest_node_entries to be on instance.

Optimizations are possible with more access to the discovery state.

* network-devp2p: Fix loss of precision in nearest_node_entries.

* network-devp2p: More efficient nearest node search.

The discovery algorithm to identify the nearest k nodes does not need to scan
all entries in all buckets.

* Remove NetworkService::config() (#8653)

* CI: Fixes for Android Pipeline (#8745)

* ci: Remove check for shared libraries in gitlab script

* ci: allow android arm build to fail

* Custom Error Messages on ENFILE and EMFILE IO Errors (#8744)

* Custom Error Messages on ENFILE and EMFILE IO Errors

Add custom mapping of ENFILE and EMFILE IO Errors (Failure because of missing system resource) right when chaining ioError into ::util::Network::Error to improve Error Messages given to user

Note: Adds libc as a dependency to util/network

* Use assert-matches for more readable tests

* Fix Wording and consistency
2018-06-12 09:31:14 +02:00
Tomasz Drwięga 4938d5dde5 Limit the number of transactions in pending set (#8777)
* Unordered iterator.

* Use unordered and limited set if full not required.

* Split timeout work into smaller timers.

* Avoid collecting all pending transactions when mining

* Remove println.

* Use priority ordering in eth-filter.

* Fix ethcore-miner tests and tx propagation.

* Review grumbles addressed.

* Add test for unordered not populating the cache.

* Fix ethcore tests.

* Fix light tests.

* Fix ethcore-sync tests.

* Fix RPC tests.
2018-06-12 08:22:54 +02:00
Wei Tang 4817b94d0b Use sealing.enabled to emit eth_mining information (#8844)
* Use sealing.enabled to emit eth_mining information

* Be more accurate on last_requests by using Option

* Add tests for internal sealing

* Add test for pow non-mining

* Add test for mining pow
2018-06-12 08:21:55 +02:00
Andronik Ordian 2a470deeaf Don't allocate in expect_valid_rlp unless necessary (#8867)
* don't allocate via format! in case there's no error

* fix test?
2018-06-12 08:15:52 +02:00
Benjamin Kampmann 861d829420 Fix Cli Return Code on --help for ethkey, ethstore & whisper (#8863)
Docopt handles `--help` automatically for us, however we've handled those
Errors the same as all others: by exiting with Return Code `1`, which is wrong
for a totally appropriate a quit on `--help`. Fortunately `docopt:Error`
provides an `exit` helper function that discriminates properly between fatal
and non-fatal errors and exist appropriately.

This patch makes sure we use that handy function in case we encounter such an
error in the CLI of ethkey, ethstore and whisper. Thus those are now giving
the appropriate Return code on `--help`.

fixes #8851
2018-06-11 20:38:01 +02:00
Wei Tang 09ee6e1477 Fix subcrate test compile (#8862)
* Fix test compile for light, node_filter, service in ethcore

* Fix ipfs, local-store, rpc, secret_store, updater subcrate test compile
2018-06-11 12:26:49 +02:00
Afri Schoedon 10fc74eb81
network-devp2p: downgrade logging to debug, add target (#8784)
* network-devp2p: downgrade logging to debug, add target

* network-devp2p: rename s/datagramm/datagram
2018-06-11 10:03:16 +02:00
Elichai Turkel 986f485b3e Clearing up a comment about the prefix for signing (#8828) 2018-06-11 10:02:46 +02:00
Tomasz Drwięga af1088ef61 Disable parallel verification and skip verifiying already imported txs. (#8834)
* Reject transactions that are already in pool without verifying them.

* Avoid verifying already imported transactions.
2018-06-08 17:05:46 +02:00
Jim Posen 13bc922e54 devp2p: Move UDP socket handling from Discovery to Host. (#8790)
* devp2p: Move UDP socket handling from Discovery to Host.

* devp2p: Fix bug with potentially incorrect UDP registration.

This works right now because the Host handler happens to be the first one
registered on the IoService.

* devp2p: Use 0-initialized memory buffer instead of unsafe.

* Remove send_queue field from public interface of Discovery.

* Rename Datagramm to Datagram.

sed -i 's/Datagramm/Datagram/g' util/network-devp2p/src/discovery.rs util/network-devp2p/src/host.rs
sed -i 's/datagramm/datagram/g' util/network-devp2p/src/discovery.rs util/network-devp2p/src/host.rs

* Include target in log statements.
2018-06-08 16:31:48 +02:00
Marek Kotewicz 1f39a1bd76 Fixed AuthorityRound deadlock on shutdown, closes #8088 (#8803) 2018-06-08 16:30:44 +02:00
Andrew Jones 13efb6586d
Specify critical release flag per network (#8821) 2018-06-08 14:54:23 +01:00
Andronik Ordian a48ed02433 Fix `deadlock_detection` feature branch compilation (#8824) 2018-06-08 10:04:12 +02:00
Andronik Ordian 24c43513a6 Use system allocator when profiling memory (#8831) 2018-06-07 16:48:01 +02:00
Alex Baranov a6d267abc0 added from and to to Receipt (#8756) 2018-06-07 16:47:41 +02:00
André Silva c8877d4098 ethcore: fix ancient block error msg handling (#8832) 2018-06-07 11:15:21 +02:00
Afri Schoedon 1318f536c9
CI: Fix docker tags (#8822)
* scripts: enable docker builds for beta and stable

* scripts: docker latest should be beta not master

* scripts: docker latest is master
2018-06-06 15:45:55 +02:00
Afri Schoedon bc2f86e806 parity: fix indentation in sync logging (#8794) 2018-06-06 14:15:13 +02:00
Marek Kotewicz 107f0fa4c6
Removed obsolete IpcMode enum (#8819) 2018-06-06 14:14:45 +02:00
Wei Tang a5190449da Remove UI related settings from CLI (#8783)
* Remove all ui reference in dapps interface

* Pass primary cli build

* Add back parity wallet dapp as builtin

* Clean up ui settings

* Fix all tests in cli

* Missed ui files to commit

* Add parity-utils endpoint back

* Fix non-dapp feature compiling

* Inline styles

* Remove parity-utils endpoint

* Remove ui precompiled crate

* Remove parity-ui alltogether

* Remove ui feature flags

* Move errors to static methods

* Fix tests

* Remove all reference to utils endpoint and remove server side injection

According to https://github.com/paritytech/parity/pull/8539, inject.js is already handled by Parity UI.
2018-06-06 10:05:52 +02:00
Andrew Jones 114d4433a9 Remove windows tray and installer (#8778)
* Remove windows tray and installer

* Remove make_exe (installer) target

* Change windows $ARC to amd64 for consistency

* Fix windows build - revert to winapi 0.2.8

* Remove publishing of windows installer bins
2018-06-06 10:02:25 +02:00
Afri Schoedon bd4498cffc docs: add changelogs for 1.10.6 and 1.11.3 (#8810)
* docs: add changelog for 1.10.6

* docs: add changelog for 1.11.3

* docs: markdownify the changelogs
2018-06-06 10:01:15 +02:00
Tomasz Drwięga 6771539a90 Fix ancient blocks queue deadlock (#8751)
* Revert "Fix not downloading old blocks (#8642)"

This reverts commit d1934363e7.

* Make sure only one thread actually imports old blocks.

* Add some trace timers.

* Bring back pending hashes set.

* Separate locks so that queue can happen while we are importing.

* Address grumbles.
2018-06-05 19:49:46 +02:00
Wei Tang 123b6ae62e Disallow unsigned transactions in case EIP-86 is disabled (#8802)
* Disallow unsigned transactions in case EIP-86 is disabled

* Add tests for verification

* Add disallow unsigned transactions test in machine
2018-06-05 19:49:11 +02:00
Wei Tang 5d6a0d4dae Fix evmbin compilation (#8795)
* Fix evmbin compilation

* Move features declaration to dependencies
2018-06-05 14:40:50 +02:00
Wei Tang 6ecc63002b Have space between feature cfg flag (#8791) 2018-06-05 11:28:35 +02:00
André Silva b3ea766bd5 rpc: fix address formatting in TransactionRequest Display (#8786)
* rpc: fix address formatting in TransactionRequest Display

* rpc: use unwrap_or_else when no to address provided
2018-06-05 09:58:09 +02:00
Wei Tang e2a90ce159 Conditionally compile ethcore public test helpers (#8743)
* Mark test helpers and test-only specs as cfg(test)

* Use test-probe to conditionally compile test helpers

* Remove test probe and directly use features tag
2018-06-04 15:58:44 +02:00
Andrew Jones 8057e8df43
Remove Result wrapper from AccountProvider in RPC impls (#8763)
* Remove AccountProvider Result, it's always `Ok`

* Remove unnecessary clones

* Remove redundant `Ok`
2018-06-04 10:26:30 +01:00
Niklas Adolfsson 98b7c07171 Update `license header` and `scripts` (#8666)
* Update `add_license` script

* run script

* add `remove duplicate lines script` and run it

* Revert changes `English spaces`

* strip whitespaces

* Revert `GPL` in files with `apache/mit license`

* don't append `gpl license` in files with other lic

* Don't append `gpl header` in files with other lic.

* re-ran script

* include c and cpp files too

* remove duplicate header

* rebase nit
2018-06-04 10:19:50 +02:00
Pierre Krieger 3d76417353 Remove HostTrait altogether (#8681) 2018-06-02 11:05:11 +02:00
André Silva 2060ea5de3 ethcore-sync: fix connection to peers behind chain fork block (#8710) 2018-06-02 10:29:44 +02:00
Wei Tang 79eb8f7ace Remove public node settings from cli (#8758)
* Remove public node related settings

* Fix tests

* Unwrap accounts provider in all rpc apis

* Unwrap AccountProvider in all cli places

* Fix rpc tests
2018-06-01 15:49:55 +01:00
Benjamin Kampmann 0ebcc200c3 Custom Error Messages on ENFILE and EMFILE IO Errors (#8744)
* Custom Error Messages on ENFILE and EMFILE IO Errors

Add custom mapping of ENFILE and EMFILE IO Errors (Failure because of missing system resource) right when chaining ioError into ::util::Network::Error to improve Error Messages given to user

Note: Adds libc as a dependency to util/network

* Use assert-matches for more readable tests

* Fix Wording and consistency
2018-06-01 13:37:43 +02:00
Afri Schoedon 27f3f42ce2 CI: Fixes for Android Pipeline (#8745)
* ci: Remove check for shared libraries in gitlab script

* ci: allow android arm build to fail
2018-06-01 09:52:30 +02:00
Pierre Krieger dab967ace8 Remove NetworkService::config() (#8653) 2018-06-01 09:49:46 +02:00
Jim Posen 485d4aa8f3 Fix XOR distance calculation in discovery Kademlia impl (#8589)
* network-devp2p: Test for discovery bucket insertion.

All test values are randomly generated and the assertions are checked manually.
Test fails because distance metric is implemented incorrectly.

* network-devp2p: Fix discovery distance function.

The Kademlia distance function (XOR) was implemented incorrectly as a population count.

* network-devp2p: Refactor nearest_node_entries to be on instance.

Optimizations are possible with more access to the discovery state.

* network-devp2p: Fix loss of precision in nearest_node_entries.

* network-devp2p: More efficient nearest node search.

The discovery algorithm to identify the nearest k nodes does not need to scan
all entries in all buckets.
2018-06-01 09:42:45 +02:00
David 799ae29ac4 Print warnings when fetching pending blocks (#8711)
* Lots of println to figure out what eth_getBlockByNumber does/should do

* Remove debugging

* Print warnings when fetching pending blocks

When calling `eth_getBlockByNumber` with `pending`, we now print a deprecation warning and:

* if a pending block is found, use it to respond
* if no pending block is found, respond as if if was a request for `Latest`

Addresses issue #8703 (not sure if it's enough to close it tbh)
2018-06-01 09:38:20 +02:00
Wei Tang 00b209a29e Fix PoW blockchains sealing notifications in chain_new_blocks (#8656) 2018-05-31 15:28:25 +02:00
vrde 581e510c2d Remove -k/--insecure option from curl installer (#8719)
Piping `curl` to `bash` while **disabling** certificate verification can lead to security problems.
2018-05-31 14:43:06 +02:00
Svyatoslav Nikolsky 9053c0dfd9 ease tiny-keccak version requirements (1.4.1 -> 1.4) (#8726) 2018-05-31 14:07:35 +02:00
Niklas Adolfsson d32ce37484 bump tinykeccak to 1.4 (#8728) 2018-05-31 13:53:09 +02:00
Niklas Adolfsson 1020560af6 Remove a couple of unnecessary `transmute()` (#8736) 2018-05-31 13:39:25 +02:00
Niklas Adolfsson 118588ef6c Fix some nits using clippy (#8731)
* fix some nits using clippy

* fix tests
2018-05-31 13:38:46 +02:00
Benjamin Kampmann 6b9314eaa9 Add 'interface' option to cli (#8699)
Additionally as to the port, the new  command line option
now allows the user to specify the network interface the P2P-Parity
listens, too. With support for 'all' and 'local' like in all other
versions of this flag. Default is 'all' (aka ).
2018-05-31 13:36:47 +02:00
Wei Tang 686bf443e6
Remove unused function new_pow_test_spec (#8735) 2018-05-31 15:06:22 +08:00
Andronik Ordian 93054ef24b Add a deadlock detection thread (#8727)
* Add a deadlock detection thread

Expose it under a feature flag:
`cargo build --features "deadlock_detection"`

* Address Nicklas's comments
2018-05-30 21:42:37 +08:00
Tomasz Drwięga 1620eabd9d Fix local transactions policy. (#8691) 2018-05-30 17:34:49 +08:00
Nicolas Gotchac 7fcb082cad Shutdown the Snapshot Service early (#8658)
* Shutdown the Snapshot Service when shutting down the runner

* Rename `service` to `client_service`

* Fix tests
2018-05-29 13:23:15 +03:00
André Silva 68d16b723a network-devp2p: handle UselessPeer disconnect (#8686) 2018-05-29 07:16:08 +00:00
David ec9c6e9783 Fix compilation error on nightly rust (#8707)
On nightly rust passing `public_url` works but that breaks on stable. This works for both.
2018-05-28 15:10:29 +00:00
David 3b083d545d Add a test for decoding corrupt data (#8713) 2018-05-28 14:41:08 +00:00
Tomasz Drwięga 5400447395 Update dev chain (#8717)
* Make dev chain more foundation-like and enable wasm.

* Fix compilation warnings.
2018-05-28 14:39:25 +00:00
Nicolas Gotchac ed8425b8b9 Remove unused imports (#8722) 2018-05-28 14:32:29 +00:00
Benjamin Kampmann 7d7d4822a5 Implement recursive Debug for Nodes in patrica_trie::TrieDB (#8697)
fixes #8184
2018-05-25 19:19:32 +08:00
André Silva 80528c5344 parity: trim whitespace when parsing duration strings (#8692) 2018-05-24 19:43:18 +02:00
David 6c24d9897a
Set the request index to that of the current request (#8683)
* Set the request index to that of the current request

When setting up the chain of (two) requests to look up a block by hash, the second need to refer to the first. This fixes an issue where the back ref was set to the subsequent request, not the current one. When the requests are executed we loop through them in order and ensure the requests that should produce headers all match up. We do this by index so they better be right.

In other words: off by one.
2018-05-24 17:29:28 +02:00
Niklas Adolfsson e346f3058e remove empty file (#8705) 2018-05-24 19:06:48 +08:00
Thibaut S dc8da3743d
Update mod.rs (#8695)
- Update interfaces affected by unsafe-expose
- replace `{{ }}` as this  throws an error in Jekyll (wiki)
2018-05-24 10:53:37 +02:00
Pierre Krieger 6563576ae9 Use impl Future in the light client RPC helpers (#8628) 2018-05-24 10:39:52 +08:00
Andrew Jones db9397890e
Fix cli signer (#8682)
* Update ethereum-types so `{:#x}` applies 0x prefix
2018-05-23 10:27:45 +01:00
Pierre Krieger bd1e3fc606 Allow making direct RPC queries from the C API (#8588) 2018-05-22 19:07:27 +02:00
Pierre Krieger fe5f5b28d9 Remove the error when stopping the network (#8671) 2018-05-22 12:35:13 +08:00
Pierre Krieger ee41fa6f30 Move connection_filter to the network crate (#8674) 2018-05-22 12:34:01 +08:00
Pierre Krieger 84ecab0eaf Remove HostInfo::client_version() and secret() (#8677) 2018-05-22 12:32:05 +08:00
Wei Tang 3fde07b2e1 Refactor EIP150, EIP160 and EIP161 forks to be specified in CommonParams (#8614)
* Allow post-homestead forks to be specified in CommonParams

* Fix all json configs

* Fix test in json crate

* Fix test in ethcore

* Fix all chain configs to use tabs

Given we use tabs in .editorconfig and the majority of chain configs.
This change is done in Emacs using `mark-whole-buffer` and `indent-region`.
2018-05-22 12:24:09 +08:00
Afri Schoedon 3c2f13f88b parity: improve cli help and logging (#8665)
* parity: indicate disabling ancient blocks is not recommended

* parity: display decimals for stats in informant
2018-05-22 10:19:00 +08:00
Marek Kotewicz 52f10242e2 updated tiny-keccak to 1.4.2 (#8669) 2018-05-21 09:33:47 +02:00
David 9e719f088f Remove the Keccak C library and use the pure Rust impl (#8657)
* Add license and readme

* Use pure rust implementation

* Bump version to 0.1.1

* Don't use C, prefer the pure Rust implementation

* Add test for `write_keccak`

* Bump version

* Add benchmarks

* Add benchmarks

* Add keccak_256, keccak_512, keccak_256_unchecked and keccak_512_unchecked – mostly for compatibility with ethash

* Remove failed git merge attempt from external git repo
Cargo.lock updates

* whitespace

* Mark unsafe function unsafe

* Unsafe calls in unsafe block

* Document unsafety invariants

* Revert unintended changes to Cargo.lock
2018-05-20 12:27:59 +08:00
Pierre Krieger 6552256981 Remove HostInfo::next_nonce (#8644) 2018-05-18 08:04:25 +02:00
Nicolas Gotchac d1934363e7 Fix not downloading old blocks (#8642) 2018-05-17 10:58:35 +02:00
Nicolas Gotchac cdbcfaa7de Resumable warp-sync / Seed downloaded snapshots (#8544)
* Start dividing sync chain : first supplier method

* WIP - updated chain sync supplier

* Finish refactoring the Chain Sync Supplier

* Create Chain Sync Requester

* Add Propagator for Chain Sync

* Add the Chain Sync Handler

* Move tests from mod -> handler

* Move tests to propagator

* Refactor SyncRequester arguments

* Refactoring peer fork header handler

* Fix wrong highest block number in snapshot sync

* Small refactor...

* Resume warp-sync downloaded chunks

* Add comments

* Refactoring the previous chunks import

* Fix tests

* Address PR grumbles

* Fix not seeding current snapshot

* Address PR Grumbles

* Address PR grumble

* Retry failed CI job

* Update SnapshotService readiness check
Fix restoration locking issue for previous chunks restoration

* Fix tests

* Fix tests

* Fix test

* Early abort importing previous chunks

* PR Grumbles

* Update Gitlab CI config

* SyncState back to Waiting when Manifest peers disconnect

* Move fix

* Better fix

* Revert GitLab CI changes

* Fix Warning

* Refactor resuming snapshots

* Fix string construction

* Revert "Refactor resuming snapshots"

This reverts commit 75fd4b553a38e4a49dc5d6a878c70e830ff382eb.

* Update informant log

* Fix string construction

* Refactor resuming snapshots

* Fix informant

* PR Grumbles

* Update informant message : show chunks done

* PR Grumbles

* Fix

* Fix Warning

* PR Grumbles
2018-05-16 22:01:55 +02:00
Benjamin Kampmann 6ecc855c34 Don't open Browser post-install on Mac (#8641)
Since we start parity with the UI disabled per default now, opening the browser post installation will show an annoying error message, confusing the user. This patch removes opening the browser to prevent that annoyance.

fixes #8194
2018-05-16 22:01:11 +02:00
Afri Schoedon 30ecd045fa
Changelog for 1.10.4-stable and 1.11.1-beta (#8637)
* Add changelog for 1.10.4

* Add changelog for 1.11.1

* Fix Typos
2018-05-16 22:00:33 +02:00
Niklas Adolfsson f9e64e0965 typo (#8640) 2018-05-16 20:09:59 +02:00
Wei Tang 0ecbb3ec02
Fork choice and metadata framework for Engine (#8401)
* Add light client TODO item

* Move existing total-difficulty-based fork choice check to Engine

* Abstract total difficulty and block provider as Machine::BlockMetadata and Machine::BlockProvider

* Decouple "generate_metadata" logic to Engine

* Use fixed BlockMetadata and BlockProvider type for null and instantseal

In this way they can use total difficulty fork choice check

* Extend blockdetails with metadatas and finalized info

* Extra data update: mark_finalized and update_metadatas

* Check finalized block in Blockchain

* Fix a test constructor in verification mod

* Add total difficulty trait

* Fix type import

* Db migration to V13 with metadata column

* Address grumbles

* metadatas -> metadata

* Use generic type for update_metadata to avoid passing HashMap all around

* Remove metadata in blockdetails

* [WIP] Implement a generic metadata architecture

* [WIP] Metadata insertion logic in BlockChain

* typo: Value -> Self::Value

* [WIP] Temporarily remove Engine::is_new_best interface

So that we don't have too many type errors.

* [WIP] Fix more type errors

* [WIP] ExtendedHeader::PartialEq

* [WIP] Change metadata type Option<Vec<u8>> to Vec<u8>

* [WIP] Remove Metadata Error

* [WIP] Clean up error conversion

* [WIP] finalized -> is_finalized

* [WIP] Mark all fields in ExtrasInsert as pub

* [WIP] Remove unused import

* [WIP] Keep only local metadata info

* Mark metadata as optional

* [WIP] Revert metadata db change in BlockChain

* [WIP] Put finalization in unclosed state

* Use metadata interface in BlockDetail

* [WIP] Fix current build failures

* [WIP] Remove unused blockmetadata struct

* Remove DB migration info

* [WIP] Typo

* Use ExtendedHeader to implement fork choice check

* Implement is_new_best using Ancestry iterator

* Use expect instead of panic

* [WIP] Add ancestry Engine support via on_new_block

* Fix tests

* Emission of ancestry actions

* use_short_version should take account of metadata

* Engine::is_new_best -> Engine::fork_choice

* Use proper expect format as defined in #1026

* panic -> expect

* ancestry_header -> ancestry_with_metadata

* Boxed iterator -> &mut iterator

* Fix tests

* is_new_best -> primitive_fork_choice

* Document how fork_choice works

* Engine::fork_choice -> Engine::primitive_fork_choice

* comment: clarify types of finalization where Engine::primitive_fork_choice works

* Expose FinalizationInfo to Engine

* Fix tests due to merging

* Remove TotalDifficulty trait

* Do not pass FinalizationInfo to Engine

If there's finalized blocks in from route, choose the old branch without calling `Engine::fork_choice`.

* Fix compile

* Fix unused import

* Remove is_to_route_finalized

When no block reorg passes a finalized block, this variable is always false.

* Address format grumbles

* Fix docs: mark_finalized returns None if block hash is not found

`blockchain` mod does not yet have an Error type, so we still temporarily use None here.

* Fix inaccurate tree_route None expect description
2018-05-16 14:58:01 +08:00
Pierre Krieger 3bb5ad7204 Check that the Android build doesn't dep on c++_shared (#8538) 2018-05-16 00:11:14 +03:00
Pierre Krieger 8e078b1d83 Remove NetworkContext::io_channel() (#8625)
* Remove io_channel()

* Fix warning
2018-05-15 17:03:09 +02:00
Pierre Krieger 0c4d2fbc70 Fix light sync with initial validator-set contract (#8528)
* Fix #8468

* Use U256::max_value() instead

* Fix again

* Also change initial transaction gas
2018-05-15 15:35:52 +02:00
David e4614e49ae
Store morden db and keys in "path/to/parity/data/Morden" (ropsten uses "test", like before) (#8621)
* Store morden db and keys in "path/to/parity/data/morden" (ropsten uses "test", like before)
2018-05-15 12:57:32 +02:00
Niklas Adolfsson 8f56606cac ´main.rs´ typo (#8629)
* Typo

* Update main.rs
2018-05-15 07:46:37 +02:00
Wei Tang af90fbfb33 Fix BlockReward contract "arithmetic operation overflow" (#8611)
* Fix BlockReward contract "arithmetic operation overflow"

* Add docs on how execute_as_system works

* Fix typo
2018-05-14 09:26:18 -05:00
Afri Schoedon 938c3707fc
Gitlab test script fixes (#8573)
* Exclude /docs from modified files.

* Ensure all references in the working tree are available

* Remove duplicated line from test script
2018-05-14 11:28:41 +02:00
Niklas Adolfsson 1b95af18ff Remove manually added text to the errors (#8595)
These messages were confusing for the users especially the help message.
2018-05-14 10:11:10 +02:00
Wei Tang 272ebc1ef7 Fix account list double 0x display (#8596)
* Remove unused self import

* Fix account list double 0x display
2018-05-14 10:10:28 +02:00
Wei Tang cfd50538bb typo: wrong indentation in kovan config (#8610) 2018-05-14 10:10:11 +02:00
Tomasz Drwięga 08abf67a51 Fix packet count when talking with PAR2 peers (#8555)
* Support diferent packet counts in different protocol versions.

* Fix light timeouts and eclipse protection.

* Fix devp2p tests.

* Fix whisper-cli compilation.

* Fix compilation.

* Fix ethcore-sync tests.

* Revert "Fix light timeouts and eclipse protection."

This reverts commit 06285ea8c1d9d184d809f64b5507aece633da6cc.

* Increase timeouts.
2018-05-14 10:09:05 +02:00
Wei Tang 981554cf74 Use full qualified syntax for itertools::Itertools::flatten (#8606) 2018-05-14 09:22:59 +02:00
lihuafeng 979af3d314 2 tiny modification on snapshot (#8601)
* Some tiny modifications.
1. fix some typo in the comment.
2. sort the order of methods in 'impl state::Backend for StateDB`

* Remove the clone of code_cache, as it has been done in clone_basic.

* remove From::from. It seems not necessary.

* change mode: remove rust files' executable mode.

* 2 tiny modifications on snapshot.
2018-05-12 22:46:08 +02:00
Pierre Krieger 57d1f2b4d3 Fix the mio test again (#8602) 2018-05-11 13:45:07 +02:00
Axel Chalon 1fa95ac236 Remove inject.js server-side injection for dapps (#8539)
* Remove inject.js server-side injection for dapps

* Remove dapps test `should_inject_js`

Parity doesn't inject a <script> tag inside the responses anymore
2018-05-11 12:09:42 +02:00
David 25dc1c2155 block_header can fail so return Result (#8581)
* block_header can fail so return Result

* Restore previous return type based on feedback

* Fix failing doc tests running on non-code
2018-05-11 11:34:07 +02:00
David 61ec02248a Block::decode() returns Result (#8586) 2018-05-11 11:33:13 +02:00
Niklas Adolfsson ecd7caa93d fix compiler warning (#8590) 2018-05-11 12:23:19 +03:00
Thibaut S aea26dcc64 Fix Parity UI link (#8600)
Fix link https://github.com/paritytech/parity/issues/8599
2018-05-11 09:04:04 +02:00
Pierre Krieger 1b8f299df2 Make mio optional in ethcore-io (#8537)
* Make mio optional in ethcore-io

* Add some annotations, plus a check for features

* Increase timer for test
2018-05-10 12:34:36 +02:00
David 6e2e08628a Attempt to fix intermittent test failures (#8584)
Occasionally should_return_correct_nonces_when_dropped_because_of_limit fails, possibly because of multiple threads competing to finish. See CI logs here for an example: https://gitlab.parity.io/parity/parity/-/jobs/86738
2018-05-10 12:33:56 +02:00
Afri Schoedon fb0e6cf0d0
Changelog and Readme (#8591)
* Move changelog for 1.10.x

* Mark 1.9 EOL

* Prepare changelog for 1.10.3 stable

* Prepare changelog for 1.11.0 stable

* Update changelogs

* Update CHANGELOG for 1.10.3 beta

* Update CHANGELOG for 1.11.0 beta

* Update CHANGELOG for 1.11.0 beta

* Update CHANGELOG for 1.11.0 beta

* Format changelog

* Update README for 1.11

* Fix typo
2018-05-10 12:33:40 +02:00
Marek Kotewicz a57c45bb1c Added Dockerfile for alpine linux by @andresilva, closes #3565 (#8587) 2018-05-09 23:28:16 +02:00
Afri Schoedon b2cc1c54f8
Add whisper CLI to the pipelines (#8578)
* Add whisper CLI to the pipelines

* Address todo, ref #8579
2018-05-09 23:26:30 +02:00
Niklas Adolfsson 21dad1d41e Rename `whisper-cli binary` to `whisper` (#8579)
* rename whisper-cli binary to whisper

* fix tests
2018-05-09 23:25:58 +02:00
Niklas Adolfsson 1d42b7f0d1 changelog nit (#8585) 2018-05-09 23:21:16 +02:00
Wei Tang cddc33bb24 Remove unnecessary cloning in overwrite_with (#8580)
* Remove unnecessary cloning in overwrite_with

* Remove into_iter
2018-05-09 18:41:56 +02:00
David cb7ad2366d
Handle socket address parsing errors (#8545)
Unpack errors and check for io::ErrorKind::InvalidInput and return our own AddressParse error. Remove the foreign link to std::net::AddrParseError and add an `impl From` for that error. Test parsing properly.
2018-05-09 15:58:02 +02:00
Afri Schoedon 25536c5ffb
Update CHANGELOG for 1.9, 1.10, and 1.11 (#8556)
* Move changelog for 1.10.x

* Mark 1.9 EOL

* Prepare changelog for 1.10.3 stable

* Prepare changelog for 1.11.0 stable

* Update changelogs

* Update CHANGELOG for 1.10.3 beta

* Update CHANGELOG for 1.11.0 beta

* Update CHANGELOG for 1.11.0 beta

* Update CHANGELOG for 1.11.0 beta

* Format changelog
2018-05-09 14:11:36 +02:00
David 842b75c0e6 Decoding headers can fail (#8570)
* rlp::decode returns Result

* Fix journaldb to handle rlp::decode Result

* Fix ethcore to work with rlp::decode returning Result

* Light client handles rlp::decode returning Result

* Fix tests in rlp_derive

* Fix tests

* Cleanup

* cleanup

* Allow panic rather than breaking out of iterator

* Let decoding failures when reading from disk blow up

* syntax

* Fix the trivial grumbles

* Fix failing tests

* Make Account::from_rlp return Result

* Syntx, sigh

* Temp-fix for decoding failures

* Header::decode returns Result

Handle new return type throughout the code base.

* Do not continue reading from the DB when a value could not be read

* Fix tests

* Handle header decoding in light_sync

* Handling header decoding errors

* Let the DecodeError bubble up unchanged

* Remove redundant error conversion
2018-05-09 12:05:56 +02:00
Nicolas Gotchac 8b0ba97cf2 Refactoring `ethcore-sync` - Fixing warp-sync barrier (#8543)
* Start dividing sync chain : first supplier method

* WIP - updated chain sync supplier

* Finish refactoring the Chain Sync Supplier

* Create Chain Sync Requester

* Add Propagator for Chain Sync

* Add the Chain Sync Handler

* Move tests from mod -> handler

* Move tests to propagator

* Refactor SyncRequester arguments

* Refactoring peer fork header handler

* Fix wrong highest block number in snapshot sync

* Small refactor...

* Address PR grumbles

* Retry failed CI job

* Fix tests

* PR Grumbles
2018-05-09 12:05:34 +02:00
Wei Tang b84682168d Remove State::replace_backend (#8569) 2018-05-09 08:55:01 +02:00
Tomasz Drwięga f20f9f376e Make trace-time publishable. (#8568) 2018-05-09 08:54:37 +02:00
Tomasz Drwięga 24838bbcd3 Don't block sync when importing old blocks (#8530)
* Alter IO queueing.

* Don't require IoMessages to be Clone

* Ancient blocks imported via IoChannel.

* Get rid of private transactions io message.

* Get rid of deadlock and fix disconnected handler.

* Revert to old disconnect condition.

* Fix tests.

* Fix deadlock.
2018-05-09 08:49:34 +02:00
Wei Tang 7a00d97977 Trace precompiled contracts when the transfer value is not zero (#8486)
* Trace precompiled contracts when the transfer value is not zero

* Add tests for precompiled CALL tracing

* Use byzantium test machine for the new test

* Add notes in comments on why we don't trace all precompileds

* Use is_transferred instead of transferred
2018-05-09 08:48:55 +02:00
Pierre Krieger ac3de4c5fc Parity as a library (#8412)
* Parity as a library

* Fix concerns

* Allow using a null on_client_restart_cb

* Fix more concerns

* Test the C library in test.sh

* Reduce CMake version to 3.5

* Move the clib test before cargo test

* Add println in test
2018-05-09 08:47:21 +02:00
David 28c731881f
Rlp decode returns Result (#8527)
rlp::decode returns Result

Make a best effort to handle decoding errors gracefully throughout the code, using `expect` where the value is guaranteed to be valid (and in other places where it makes sense).
2018-05-08 11:22:12 +02:00
André Silva a7a46f4253 Node table sorting according to last contact data (#8541)
* network-devp2p: sort nodes in node table using last contact data

* network-devp2p: rename node contact types in node table json output

* network-devp2p: fix node table tests

* network-devp2p: note node failure when failed to establish connection

* network-devp2p: handle UselessPeer error

* network-devp2p: note failure when marking node as useless
2018-05-07 13:11:12 +02:00
Wei Tang 528497b86a Keep all enacted blocks notify in order (#8524)
* Keep all enacted blocks notify in order

* Collect is unnecessary

* Update ChainNotify to use ChainRouteType

* Fix all ethcore fn defs

* Wrap the type within ChainRoute

* Fix private-tx and sync api

* Fix secret_store API

* Fix updater API

* Fix rpc api

* Fix informant api

* Eagerly cache enacted/retracted and remove contain_enacted/retracted

* Fix indent

* tests: should use full expr form for struct constructor

* Use into_enacted_retracted to further avoid copy

* typo: not a function

* rpc/tests: ChainRoute -> ChainRoute::new
2018-05-07 12:58:25 +02:00
André Silva 32c32ecfda ethcore, rpc, machine: refactor block reward application and tracing (#8490) 2018-05-07 12:57:03 +02:00
Toralf Wittner e30839e85f Consolidate crypto functionality in `ethcore-crypto`. (#8432)
* Consolidate crypto functionality in `ethcore-crypto`.

- Move `ecdh`/`ecies` modules to `ethkey`.
- Refactor `ethcore-crypto` to use file per module.
- Replace `subtle` with `ethcore_crypto::is_equal`.
- Add `aes_gcm` module to `ethcore-crypto`.

* Rename `aes::{encrypt,decrypt,decrypt_cbc}` ...

... to `aes::{encrypt_128_ctr,decrypt_128_ctr,decrypt_128_cbc}`.
2018-05-05 11:02:33 +02:00
Wei Tang a4c7843a07 EIP 145: Bitwise shifting instructions in EVM (#8451)
* Add SHL, SHR, SAR opcodes

* Add have_bitwise_shifting schedule flag

* Add all EIP tests for SHL

* Add SHR implementation and tests

* Implement SAR and add tests

* Add eip145transition config param

* Change map_or to map_or_else when possible
2018-05-05 10:23:50 +02:00
David f0c6d17ad8
Remove expect (#8536)
* Remove expect and propagate rlp::DecoderErrors as TrieErrors
2018-05-04 10:06:54 +02:00
Andrew Jones 66c0638f3b Don't panic in import_block if invalid rlp (#8522)
* Don't panic in import_block if invalid rlp

* Remove redundant type annotation

* Replace RLP header view usage with safe decoding

Using the view will panic with invalid RLP. Here we use Rlp decoding directly which will return a `Result<_, DecoderError>`. While this path currently should not have any invalid RLP - it makes it safer if ever called with invalid RLP from other code paths.
2018-05-03 09:01:13 +02:00
Wei Tang eec7364760 Pass on storage keys tracing to handle the case when it is not modified (#8491)
* Pass on storage keys even if it is not modified

* typo: account and storage query

`to_pod_diff` builds both `touched_addresses` merge and storage keys merge.

* Fix tests

* Use state query directly because of suicided accounts

* Fix a RefCell borrow issue

* Add tests for unmodified storage trace

* Address grumbles

* typo: remove unwanted empty line

* ensure_cached compiles with the original signature
2018-05-02 15:47:53 +01:00
Wei Tang b10094508f Fetching logs by hash in blockchain database (#8463)
* Fetch logs by hash in blockchain database

* Fix tests

* Add unit test for branch block logs fetching

* Add docs that blocks must already be sorted

* Handle branch block cases properly

* typo: empty -> is_empty

* Remove return_empty_if_none by using a closure

* Use BTreeSet to avoid sorting again

* Move is_canon to BlockChain

* typo: pass value by reference

* Use loop and wrap inside blocks to simplify the code

Borrowed from https://github.com/paritytech/parity/pull/8463#discussion_r183453326

* typo: missed a comment
2018-05-02 09:40:27 +02:00
Tomasz Drwięga 8e8679807d Transaction Pool improvements (#8470)
* Don't use ethereum_types in transaction pool.

* Hide internal insertion_id.

* Fix tests.

* Review grumbles.
2018-05-02 09:31:06 +02:00
Pierre Krieger 629da8f8bf More changes for Android (#8421) 2018-05-02 09:20:59 +02:00
ellaismer 10a346476a Enable WebAssembly and Byzantium for Ellaism (#8520)
* Enable WebAssembly and Byzantium for Ellaism

* Fix indentation

* Remove empty lines
2018-05-01 19:41:46 +01:00
Svyatoslav Nikolsky d1f5284fe6 SecretStore: merge two types of errors into single one + Error::is_non_fatal (#8357)
* SecretStore: error unify initial commit

SecretStore: pass real error in error messages

SecretStore: is_internal_error -> Error::is_non_fatal

warnings

SecretStore: ConsensusTemporaryUnreachable

fix after merge

removed comments

removed comments

SecretStore: updated HTTP error responses

SecretStore: more ConsensusTemporaryUnreachable tests

fix after rebase

* fixed grumbles

* use HashSet in tests
2018-05-01 15:02:14 +02:00
Niklas Adolfsson 849f5d9a44 Hardware Wallet trait (#8071)
* getting started with replacing HardwareWalletManager

* trezor and ledger impls the new trait with some drawbacks

* Everything move to the new trait

* It required lifetime annotations in the trait because [u8] in unsized
* Lets now start moving entry point from HardwareWalletManager

* rename trait to Wallet

* move thread management to the actual wallets

* Moved thread management to each respective Wallet
* Cleaned up pub items that is needed to be pub
* Wallet trait more or less finished
* Cleaned up docs

* fix tests

* omit removed docs

* fix spelling, naming och remove old comments

* ledger test is broken, add correct logging format

* So locally on my machine Linux Ubuntu 17.10 the test doesn't panic but on the CI server libusb::Context::new()
fails which I don't understand because it has worked before
* Additionally the ledger test is optional so I lean toward ignoring it the CI Server

* ignore hardware tests by default

* more verbose checking in ledger test
2018-05-01 15:01:49 +02:00
Wei Tang 7a76916143 Directly return None if tracing is disabled (#8504)
* Directly return None if tracing is disabled

* Address gumbles: release read locks as fast as possible
2018-05-01 14:47:04 +02:00
Wei Tang 2a829b1f1a Show imported messages for light client (#8517) 2018-05-01 14:16:03 +02:00
Niklas Adolfsson 44c68221a8 Remove unused dependency `bigint` (#8505)
* remove unused dependency bigint in

* remove bigint in rpc_cli
2018-04-27 17:46:17 +02:00
Niklas Adolfsson e36c4ecc98 `duration_ns: u64 -> duration: Duration` (#8457)
* duration_ns: u64 -> duration: Duration

* format on millis {:.2} -> {}
2018-04-27 15:04:27 +02:00
Anton Gavrilov 01d399ad66 Return error if RLP size of transaction exceeds the limit (#8473)
* Return error if RLP size of transaction exceeds the limit

* Review comments fixed

* RLP check moved to verifier, corresponding pool test added
2018-04-27 15:02:45 +02:00
David Dorgan 9376796bdb Remove three old warp boot nodes. (#8497) 2018-04-27 15:01:47 +02:00
Sergey Pepyakin f135c09b36 Update wasmi and pwasm-utils (#8493)
* Update wasmi to 0.2

New wasmi supports 32bit platforms and no longer requires a special feature to build for such platforms.

* Update pwasm-utils to 0.1.5
2018-04-26 14:00:42 +02:00
Afri Schoedon 4e85015836
Update hardcodedSync for Ethereum, Kovan, and Ropsten (#8489) 2018-04-25 16:27:22 +02:00
Afri Schoedon f56c065f57
Fix snap builds (#8483) 2018-04-25 16:25:57 +02:00
Afri Schoedon adc3457a89
Bump master to 1.12 (#8477)
* Bump master to 1.12

* Bump crates to 1.12

* Bump mac installer version to 1.12

* Update Gitlab scripts
2018-04-25 16:25:43 +02:00
Tomasz Drwięga fa261ebd02 Don't require write lock when fetching status. (#8481) 2018-04-25 15:39:45 +02:00
Wei Tang 7fdb87ad38 Use rename_all for RichBlock and RichHeader serialization (#8471)
* typo: fix a resolved TODO comment

* Use rename_all instead of individual renames
2018-04-25 10:00:58 +02:00
Ayrat Badykov baeda93474 fix typos in vm description comment (#8446) 2018-04-24 14:25:27 +02:00
Afri Schoedon 7a28f72abc
Add changelog for 1.9.7 and 1.10.2 (#8460)
* Add changelog for 1.9.7

* Add Changelog for 1.10.2

* Apply proper markdown

* Run a spellchecker :)

* Be pedantic about the 32-bit pipelines :)
2018-04-23 15:36:20 +02:00
Denis S. Soldatov aka General-Beck 1ab06ce2d2 fix docker build (#8462) 2018-04-23 15:36:08 +02:00
Niklas Adolfsson b0cc44aabb ParityShell::open `Return result` (#8377)
* start

* add error handling for winapi

* fix typo

* fix warnings and windows errors

* formatting

* Address review comments
2018-04-21 12:54:48 +02:00
Wei Tang c983efe895 Return error in case eth_call returns VM errors (#8448)
* Add VMError generator

* Return executed exceptions in eth_call
2018-04-21 11:41:09 +02:00
Sergey Pepyakin 650948feed Update wasmi (#8452) 2018-04-21 11:27:39 +02:00
Afri Schoedon 4e76cce0b7
Allow 32 bit pipelines to fail (#8454)
* Disable 32bit tragets for gitlab

* Rename linux pipelines
2018-04-21 11:24:51 +02:00
Nikita Chebykin 9e9045ab94 Update Cargo hidapi-rs dependency (#8447) 2018-04-20 15:46:08 +02:00
Anton Gavrilov d86333af6b Private transactions processing error handling (#8431)
* Integration test for private transaction returned

* Do not interrupt verification in case of errors

* Helpers use specified

* Review comments fixed
2018-04-20 15:45:53 +02:00
Wei Tang 28b5906d9e Improve VM executor stack size estimation rules (#8439)
* Improve VM executor stack size estimation rules

* typo: docs add "(Debug build)" comment

* Fix an off by one typo and set minimal stack size

This avoids the case if `depth_threshold == max_depth`. Usually setting stack size to zero will just rebound it to
platform minimal stack size, but we set it here just in case.

* Use saturating_sub to avoid potential overflow
2018-04-20 12:32:25 +02:00
André Silva 24f6d8296b Block reward contract (#8419)
* engine: add block reward contract abi and helper client

* aura: add support for block reward contract

* engine: test block reward contract client

* aura: test block reward contract

* engine + aura: add missing docs

* engine: share SystemCall type alias

* aura: add transition for block reward contract

* engine: fix example block reward contract source link and bytecode
2018-04-20 12:32:00 +02:00
Wei Tang 9c5e35548d Permission fix (#8441) 2018-04-20 12:22:19 +02:00
Wei Tang 92b5b5644f Use forked app_dirs crate for reverted Windows dir behavior (#8438)
* Remove unused appdirs dependency in CLI

* Use forked app_dirs crate for reverted Windows dir behavior
2018-04-20 08:38:30 +00:00
lihuafeng 8fb47b52f5 remove From::from. (#8390)
* Some tiny modifications.
1. fix some typo in the comment.
2. sort the order of methods in 'impl state::Backend for StateDB`

* Remove the clone of code_cache, as it has been done in clone_basic.

* remove From::from. It seems not necessary.
2018-04-19 13:16:04 +02:00
Andrew Jones 14361cc7b1 Move ethcore::Error to error_chain (#8386)
* WIP

* Convert Ethcore error to use error_chain

* Use error_chain for ImportError and BlockImportError

* Fix error pattern matches for error_chain in miner

* Implement explicit From for AccountsError

* Fix pattern matches for ErrorKinds

* Handle ethcore error_chain in light client

* Explicitly define Result type to avoid shadowing

* Fix remaining Error pattern matches

* Fix tab space formatting

* Helps if the tests compile

* Fix error chain matching after merge
2018-04-19 11:52:54 +02:00
Afri Schoedon 2257bc8e2f Changelogs for 1.9.6 and 1.10.1 (#8411)
* Add changelog for 1.9.6

* Add Changelog for 1.10.1
2018-04-19 10:26:55 +01:00
Tomasz Drwięga 461b2d4853 Fix receipts stripping. (#8414) 2018-04-19 10:25:15 +01:00
Wei Tang 941f2380c4 typo, docs parity_chainId: empty string -> None (#8434) 2018-04-19 10:24:19 +01:00
Marek Kotewicz cb31220a4a update zip to 0.3 (#8381)
* update zip to 0.3

* enable zip deflate feature
2018-04-19 10:53:14 +02:00
Wei Tang 9e09d5b6bf Fix TODO comments (#8413) 2018-04-16 20:14:42 +02:00
Andrew Jones a04c5b180a Replace legacy Rlp with UntrustedRlp and use in ethcore rlp views (#8316)
* WIP

* Replace Rlp with UntrustedRlp in views, explicity unwrap with expect

First pass to get it to compile. Need to figure out whether to do this or to propogate Errors upstream, which would require many more changes to dependent code. If we do this way we are assuming that the views are always used in a context where the rlp is trusted to be valid e.g. when reading from our own DB. So need to fid out whether views are used with data received from an untrusted (e.g. extrernal peer).

* Remove original Rlp impl, rename UntrustedRlp -> Rlp

* Create rlp views with view! macro to record debug info

Views are assumed to be over valid rlp, so if there is a decoding error we record where the view was created in the first place and report it in the expect

* Use $crate in view! macro to avoid import, fix tests

* Expect valid rlp in decode functions for now

* Replace spaces with tabs in new file

* Add doc tests for creating views with macro

* Update rlp docs to reflect removing of UntrustedRlp

* Replace UntrustedRlp usages in private-tx merge
2018-04-16 15:52:12 +02:00
Svyatoslav Nikolsky db7a8c4ac7 tokio-core v0.1.16 -> v0.1.17 (#8408) 2018-04-16 12:02:23 +02:00
Pierre Krieger fac356c701 More code refactoring to integrate Duration (#8322)
* More code refactoring to integrate Duration

* Fix typo

* Fix tests

* More test fix
2018-04-14 21:35:58 +02:00
Andronik Ordian 90eb61091a remove Tendermint extra_info due to seal inconsistencies (#8367) 2018-04-14 20:47:51 +02:00
Wei Tang f6998cb04e Use tokio::spawn in secret_store listener and fix Uri (#8373)
* Directly wait for future to resolve in a threadpool

* Ignore return value

* Use path.starts_with instead of req_uri.is_absolute

The later now means something else in hyper 0.11..

* Use tokio::spawn

* typo: remove accidential unsafe impl
2018-04-13 21:15:33 +02:00
Wei Tang 897a94641e Unify and limit rocksdb dependency places (#8371)
* secret_store: remove kvdb_rocksdb dependency

* cli: init db mod for open dispatch

* cli: move db, client_db, restoration_db, secretstore_db to a separate mod

* migration: rename to migration-rocksdb and remove ethcore-migrations

* ethcore: re-move kvdb-rocksdb dep to test

* mark test_helpers as test only and fix migration mod naming

* Move restoration_db_handler to test_helpers_internal

* Fix missing preambles in test_helpers_internal and rocksdb/helpers

* Move test crates downward

* Fix missing docs

* cli, db::open_db: move each argument to a separate line

* Use featuregate instead of dead code for `open_secretstore_db`

* Move pathbuf import to open_secretstore_db

Because it's only used there behind a feature gate
2018-04-13 21:14:53 +02:00
Niklas Adolfsson 3f677c6168 clarify that windows need perl and yasm (#8402) 2018-04-13 21:00:14 +02:00
Tomasz Drwięga 1cd93e4ceb New Transaction Queue implementation (#8074)
* Implementation of Verifier, Scoring and Ready.

* Queue in progress.

* TransactionPool.

* Prepare for txpool release.

* Miner refactor [WiP]

* WiP reworking miner.

* Make it compile.

* Add some docs.

* Split blockchain access to a separate file.

* Work on miner API.

* Fix ethcore tests.

* Refactor miner interface for sealing/work packages.

* Implement next nonce.

* RPC compiles.

* Implement couple of missing methdods for RPC.

* Add transaction queue listeners.

* Compiles!

* Clean-up and parallelize.

* Get rid of RefCell in header.

* Revert "Get rid of RefCell in header."

This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb.

* Override Sync requirement.

* Fix status display.

* Unify logging.

* Extract some cheap checks.

* Measurements and optimizations.

* Fix scoring bug, heap size of bug and add cache

* Disable tx queueing and parallel verification.

* Make ethcore and ethcore-miner compile again.

* Make RPC compile again.

* Bunch of txpool tests.

* Migrate transaction queue tests.

* Nonce Cap

* Nonce cap cache and tests.

* Remove stale future transactions from the queue.

* Optimize scoring and write some tests.

* Simple penalization.

* Clean up and support for different scoring algorithms.

* Add CLI parameters for the new queue.

* Remove banning queue.

* Disable debug build.

* Change per_sender limit to be 1% instead of 5%

* Avoid cloning when propagating transactions.

* Remove old todo.

* Post-review fixes.

* Fix miner options default.

* Implement back ready transactions for light client.

* Get rid of from_pending_block

* Pass rejection reason.

* Add more details to drop.

* Rollback heap size of.

* Avoid cloning hashes when propagating and include more details on rejection.

* Fix tests.

* Introduce nonces cache.

* Remove uneccessary hashes allocation.

* Lower the mem limit.

* Re-enable parallel verification.

* Add miner log. Don't check the type if not below min_gas_price.

* Add more traces, fix disabling miner.

* Fix creating pending blocks twice on AuRa authorities.

* Fix tests.

* re-use pending blocks in AuRa

* Use reseal_min_period to prevent too frequent update_sealing.

* Fix log to contain hash not sender.

* Optimize local transactions.

* Fix aura tests.

* Update locks comments.

* Get rid of unsafe Sync impl.

* Review fixes.

* Remove excessive matches.

* Fix compilation errors.

* Use new pool in private transactions.

* Fix private-tx test.

* Fix secret store tests.

* Actually use gas_floor_target

* Fix config tests.

* Fix pool tests.

* Address grumbles.
2018-04-13 17:34:27 +02:00
Pierre Krieger 03b96a7c0a
Some tweaks to main.rs for parity as a library (#8370)
* Some tweaks to main.rs for parity as a library

* Remove pub from PostExecutionAction
2018-04-13 14:21:15 +02:00
Robert Habermeier 869fa6fda8
handle queue import errors a bit more gracefully (#8385) 2018-04-13 14:06:22 +02:00
André Silva bc2f5586ee ci: fix change detection in master builds (#8382) 2018-04-12 15:53:54 +02:00
Pierre Krieger 16f435b906 Fix config test by adding no-hardcodec-sync (#8380) 2018-04-12 12:05:45 +01:00
Marek Kotewicz 0a170efaa5 fixed unsafe shell call on windows (#8372) 2018-04-11 17:21:29 +01:00
Marek Kotewicz 1356d6d8d5
parity uses winapi 0.3.4 (#8366)
* parity uses winapi 0.3.4

* remove redundant unsafe
2018-04-11 15:22:48 +02:00
Maciej Hirsz 0a9114203b No hardcoded client name (#8368)
* Fixes issues with version string if client name is substituted (required for Energy Web)
2018-04-11 14:41:06 +02:00
Toralf Wittner 2b05eb43a9 Add `util/mem` to zero out memory on drop. (#8356)
* Add `util/mem` to zero out memory on drop.

* Remove nonsense.

* Remove `Into` impls for `Memzero`.

* Update ethereum-types and remove H256Mut.
2018-04-11 13:57:12 +02:00
Marek Kotewicz dd2c27958c use atty instead of isatty (#8365) 2018-04-11 11:56:37 +01:00
Thibaut S 6737484eda Increase gasLimit to 8'000'000 (#8362)
- fix https://github.com/paritytech/parity/issues/8342
2018-04-11 12:10:57 +02:00
Niklas Adolfsson 9fe991db1c util `fake-fetch` (#8363)
* start

* hash-fetch

* rpc

* revert price-info

* remove used file

* adapt to changes in fetch

* make fake-fetch generic over

* fix tests to comply with the new `fake-fetch`
2018-04-11 11:59:04 +02:00
Marek Kotewicz 6cf441fc9e
bump snappy and ring, use single rayon version, closes #8296 (#8364) 2018-04-11 11:41:02 +02:00
Wei Tang 99e37844fd Use async hyper server in secret_store and upgrade igd (#8359)
* Update secret_store hyper dep to 0.11

* Upgrade igd to 0.7

* typo: spawn
2018-04-10 19:25:27 +02:00
Tomasz Drwięga 8348147a4f Enable UI by default, but only display deprecation notice (#8262)
* Enable UI by default, but only display info page.

* Fix test.

* Fix naming and remove old todo.

* Change "wallet" with "browser UI"

* Update text, its not deprecated, its moved
2018-04-10 16:14:15 +02:00
Marek Kotewicz bd7273061e
ethcrypto renamed to ethcore-crypto and moved to ethcore dir (#8340)
* ethcrypto renamed to ethcore-crypto and moved to ethcore dir

* fixed renaming
2018-04-10 13:56:56 +02:00
Svyatoslav Nikolsky 4f447c50b2 SecretStore: having <t+1 nodes with shares now does not abort ServersChangeSession (#8151) 2018-04-10 13:56:17 +02:00
Wei Tang 692cd10d4a Use hyper 0.11 in ethcore-miner and improvements in parity-reactor (#8335)
* parity-reactor: Pass over Handle in spawning fn to allow normal tokio ops

* Allow fetch to work with arbitrary requests

* typo: Fix missing handler closure

* miner, work_notify: use fetch and parity-reactor

* Fix work_notify pushing in parity CLI
2018-04-10 13:51:29 +02:00
Marek Kotewicz 86446d713a ethcore-sync (#8347) 2018-04-10 12:13:49 +02:00
Wei Tang d1487b3177 rpc, eth_filter: return error if the filter id does not exist (#8341) 2018-04-10 10:36:14 +02:00
Marek Kotewicz 8e7a08f865
ethcore-stratum crate moved to ethcore directory (#8338) 2018-04-10 10:13:42 +02:00
Svyatoslav Nikolsky 0d75d01c84 SecretStore: get rid of engine.signer dependency (#8173)
* SecretStore: get rid of engine.signer dependency

* SecretStore: fixed self for transact_contract

* SecretStore: fixed pending requests + 1-of-1 sessions completion

* SecretStore: fixed completion signal in 1-of-1 case

* fixed test(s)

* removed obsolete TODO && redundant statement

* ok_or -> ok_or_else
2018-04-09 16:38:59 +02:00
Niklas Adolfsson 1c75e8eb47 Whisper cli (#8201)
* getting started

* wip wip

* add parsing of pool-size and enable panic-hook

* more cli options

* remove explicit unwrapping

* bump dependencies to parity-jsonrpc

* add tests

* remove tests

* bump jsonrpc

* Remove unused dependencies

* add logging to the cli

* Fix so `FilterManager` drops its resources

* Introduced an AtomicBool flag in FilterManager to cancel the `Decryption Worker Thread`
* Added some very basic test to faulty arguments

* ignore privileged port test
2018-04-09 16:35:45 +02:00
Wei Tang 431b27d3e1 replace_home for password_files, reserved_peers and log_file (#8324)
* replace_home for password_files, reserved_peers and log_file

* typo: arg_log_file is Option
2018-04-09 16:34:47 +02:00
Akira Takizawa d97cf34138 Add Ethereum Social support (#8325) 2018-04-09 16:18:00 +02:00
Anton Gavrilov e6f75bccfe Private transactions integration pr (#6422)
* Private transaction message added

* Empty line removed

* Private transactions logic removed from client into the separate module

* Fixed compilation after merge with head

* Signed private transaction message added as well

* Comments after the review fixed

* Private tx execution

* Test update

* Renamed some methods

* Fixed some tests

* Reverted submodules

* Fixed build

* Private transaction message added

* Empty line removed

* Private transactions logic removed from client into the separate module

* Fixed compilation after merge with head

* Signed private transaction message added as well

* Comments after the review fixed

* Encrypted private transaction message and signed reply added

* Private tx execution

* Test update

* Main scenario completed

* Merged with the latest head

* Private transactions API

* Comments after review fixed

* Parameters for private transactions added to parity arguments

* New files added

* New API methods added

* Do not process packets from unconfirmed peers

* Merge with ptm_ss branch

* Encryption and permissioning with key server added

* Fixed compilation after merge

* Version of Parity protocol incremented in order to support private transactions

* Doc strings for constants added

* Proper format for doc string added

* fixed some encryptor.rs grumbles

* Private transactions functionality moved to the separate crate

* Refactoring in order to remove late initialisation

* Tests fixed after moving to the separate crate

* Fetch method removed

* Sync test helpers refactored

* Interaction with encryptor refactored

* Contract address retrieving via substate removed

* Sensible gas limit for private transactions implemented

* New private contract with nonces added

* Parsing of the response from key server fixed

* Build fixed after the merge, native contracts removed

* Crate renamed

* Tests moved to the separate directory

* Handling of errors reworked in order to use error chain

* Encodable macro added, new constructor replaced with default

* Native ethabi usage removed

* Couple conversions optimized

* Interactions with client reworked

* Errors omitting removed

* Fix after merge

* Fix after the merge

* private transactions improvements in progress

* private_transactions -> ethcore/private-tx

* making private transactions more idiomatic

* private-tx encryptor uses shared FetchClient and is more idiomatic

* removed redundant tests, moved integration tests to tests/ dir

* fixed failing service test

* reenable add_notify on private tx provider

* removed private_tx tests from sync module

* removed commented out code

* Use plain password instead of unlocking account manager

* remove dead code

* Link to the contract changed

* Transaction signature chain replay protection module created

* Redundant type conversion removed

* Contract address returned by private provider

* Test fixed

* Addressing grumbles in PrivateTransactions (#8249)

* Tiny fixes part 1.

* A bunch of additional comments and todos.

* Fix ethsync tests.

* resolved merge conflicts

* final private tx pr (#8318)

* added cli option that enables private transactions

* fixed failing test

* fixed failing test

* fixed failing test

* fixed failing test
2018-04-09 16:14:33 +02:00
Wei Tang c039ab79b5 Decouple rocksdb dependency from ethcore (#8320)
* Move client DB opening logic to CLI

* Move restoration db open logic to CLI

This adds KeyValueDBHandler which handles opening a new database, thus allow us to move the restoration db open logic
out of ethcore.

* Move rocksdb's compactionprofile conversion to CLI

* Move kvdb_rocksdb as test dependency for ethcore

* Fix tests due to interface change

* Fix service tests

* Remove unused migration dep for ethcore
2018-04-09 14:21:37 +02:00
lihuafeng 9436e88d27 remove the clone operation of code_cache (#8334)
* Some tiny modifications.
1. fix some typo in the comment.
2. sort the order of methods in 'impl state::Backend for StateDB`

* Remove the clone of code_cache, as it has been done in clone_basic.
2018-04-09 11:35:54 +02:00
Pierre Krieger 652f5032a2 Fix the JSONRPC API not running with the light client (#8326) 2018-04-08 18:29:25 +02:00
Wei Tang d7a7f034db Read registry_address from block with REQUEST_CONFIRMATIONS_REQUIRED (#8309)
* Read registry_address from block with REQUEST_CONFIRMATIONS_REQUIRED

* Require confirmation blocks in key_server_set

* Add license preamble

* TODO item for constant confirmation required number

* Change license year in helpers.rs to 2015-2018
2018-04-06 12:03:13 +02:00
Pierre Krieger 27c32d3629
Tweaks and add a Dockerfile for Android (#8036) 2018-04-05 14:38:50 +02:00
Kwang Yul Seo 0d2993e46d Use associated type M::Error instead of Error (#8308) 2018-04-05 11:31:58 +02:00
Wei Tang e4168c2985 Remove InvalidParentHash in favor of assert! (#8300)
* Remove InvalidParentHash in favor of assert!

* Typo: assert test true case
2018-04-05 11:03:25 +02:00
Marek Kotewicz 9d3771458d bump proc macro deps (#8310) 2018-04-05 10:31:06 +02:00
Wei Tang ff0ce70169 Decouple timestamp open-block-assignment/verification to Engine (#8305) 2018-04-05 10:11:21 +02:00
Andronik Ordian 811d165458 Validate if gas limit is not zero (#8307) 2018-04-05 00:14:59 +09:00
East Coin d57944ffb9 Implement Easthub chain spec (#8295) 2018-04-04 23:00:21 +09:00
Pierre Krieger 991f0cac6e Update some dependencies (#8285) 2018-04-04 22:38:04 +09:00
Dmitry Kashitsyn b2d338bf35 Ethcore now uses Rayon 1.0 as a dependency (#8296) (#8304) 2018-04-04 21:05:21 +09:00
Niklas Adolfsson ef80698deb Upgrader `remove raw unwrap` and bump semver (#8251)
* remove raw unwrap and bump semver

* bump rustc_version

* Semver -> SemVer
2018-04-04 11:54:41 +02:00
Pierre Krieger e12a5159a8 Cleaner binary shutdown system (#8284)
* Cleaner shutdown system when executing

* Simplify set_exit_handler for Client

* Minor change

* Fix submodule
2018-04-04 11:50:28 +02:00
Dmitry Kashitsyn 0455aa96bf Ethcore now uses rayon to 0.9 as a dependency (#8296) (#8302) 2018-04-04 11:50:01 +02:00
Wei Tang 9aaedad64f Include suicided accounts in state diff (#8297)
* Include suicided accounts in state diff

* Shorten form match -> if let

* Test suicide trace diff in State
2018-04-04 18:49:43 +09:00
Marek Kotewicz ea6b0ec164
remove evmjit (#8229)
* removed not working evmjit, closes #8192 closes #6205

* removed evmjit from build scripts

* fixed parity compile error

* removed evmjit cli options

* fixed invalid test config files
2018-04-04 18:07:49 +09:00
André Silva 679d6c6f2b
build: fix updater rand dependency in Cargo.lock (#8298) 2018-04-03 23:16:29 +01:00
Svyatoslav Nikolsky ec96091369 SecretStore: generating and retrieving decryption keys via service contract (#8029)
* SecretStore: started document keys generation via contract

* fixed Cargo.lock

* SecretStore: doc key contract gen tests

* SecretStore: fixed log parsing

* SecretStore: flush

* SecretStore: secretstore_generateDocumentKey RPC

* SecretStore: return encrypted_key from secretstore_generateDocumentKey

* prepare to GenerateDocKey -> StoreDocKey

* SecretStore: ability to identify requester via Public/Address

* SecretStore: store author address instead of public in db

* flush

* SecretStore: flush

* SecretStore: fixed test

* SecretStore: flush

* SecretStore: flush

* SecretStore: flush

* SecretStore: flush

* SecretStore: start async generation session

* SecretStore: process StoreDocumentKey service tasks

* SecretStore: flush

* SecretStore: update service contact ABI

* SecretStore: flush

* SecretStore: flush

* SecretStore: fixed event

* SecretStore: flush

* SecretStore: fixed tests

* SecretStore: fix broadcast shadows decryption

* SecretStore: finally decryption via service contract works

* SecretStore: fix for updated contract

* SecretStore: restored pending requests reqding

* SecretStore: fixed some TODOs

* SecretStore: OnChainServiceContractAggregate

* SecretStore: different names for different contracts types

* SecretStore: updated contracts interfaces

* SecretStore: utilize aggregate service contract

* fixed compilation

* SecretStore: fixes for updated contract

* SecretStore: service fixes after testing

* fixed cli test compilation

* SecretStore: decryption_session_origin_is_known_to_all_initialized_nodes

* SecretStore: added new contract listener tests

* SecretStore: session_listener_works

* removed optional TODO

* SecretStore: fixed KeyServer shutdown

* fixed warn + grumble

* const durations
2018-04-03 16:54:34 +02:00
Niklas Adolfsson 0a535bf485 Honor --max-peers if --min-peers is not specified (#8087)
* Change interpretation min and max peers

* Only min specified -> Set min to that value and max to default
* Only max specified -> Set min and max to that value
* Both specified -> Set min the smallest value and max to the largest value

* simplify logic, new ParseError & add tests

* simplify code according to the review comments

* address review comments

* more fine-grained tests
2018-04-03 16:51:57 +02:00
André Silva dcaff6f4c8 Auto-updater improvements (#8078)
* updater: refactor updater flow into state machine

* updater: delay update randomly within max range

* updater: configurable update delay

* updater: split polling and updater state machine step

* updater: drop state to avoid deadlocking

* updater: fix fetch backoff

* updater: fix overflow in update delay calculation

* updater: configurable update check frequency

* updater: fix update policy frequency comparison

* updater: use lazy_static for platform and platform_id_hash

* updater: refactor operations contract calls into OperationsClient

* updater: make updater generic over operations and fetch client

* updater: fix compilation

* updater: add testing infrastructure and minimal test

* updater: fix minor grumbles

* updater: add test for successful updater flow

* updater: add test for update delay

* updater: add test for update check frequency

* updater: mock time and rng for deterministic tests

* updater: test backoff on failure

* updater: add test for backoff short-circuit on new release

* updater: refactor to increase readability

* updater: cap maximum backoff to one month

* updater: add test for detecting already downloaded update

* updater: add test for updater disable on fatal errors

* updater: add test for pending outdated fetch

* updater: test auto install of updates

* updater: add test for capability updates

* updater: fix capability update

* updater: use ethabi to create event topic filter

* updater: decrease maximum backoff to 1 day

* updater: cap maximum update delay with upcoming fork block number

* updater: receive state mutex guard in updater_step

* updater: overload execute_upgrade to take state mutex guard

* updater: remove unnecessary clone of latest operations info

* updater: remove latest operations info clone when triggering fetch
2018-04-03 16:49:23 +02:00
Wei Tang 5e7d42e4a4 dapps-fetcher: calculate keccak in-flight while reading the response (#8294)
* dapps-fetcher: calculate keccak in-flight while reading the response

* Rename keccak_buffer_and_write -> keccak_pipe

* Fix file read bug by creating another file handle as the return value
2018-04-03 14:58:55 +02:00
ellaismer 99a13c4e66 Cleanup Ellaism bootnodes (#8276)
Removed several bootnodes known not to be running anymore. Added two new ones.
2018-04-03 21:58:24 +09:00
Tomasz Drwięga 060205ab27 Allow unsafe js eval on Parity Wallet. (#8204) 2018-04-03 12:43:34 +02:00
Tomasz Drwięga 9f775a7673 Remove RefCell from Header (#8227)
* Cache RLP and header hashes.

* Refactor header - WiP

* Avoid decoding laster header.

* Pre-compute hashes for Sealed/Locked block.

* Use accrue bloom. Closes ##8241
2018-04-03 17:01:28 +09:00
Wei Tang d477670cb9 Typo fix: todo with no content (#8292) 2018-04-03 09:32:38 +02:00
André Silva 54c9c382e7 Revert "ci: disable link-dead-code in coverage build (#8118)" (#8287)
This reverts commit 4d1cb01da0.
2018-04-02 16:06:07 +03:00
Tomasz Drwięga 9108a3bb50 Bump ethabi & ethereum-types. (#8258)
* Bump ethabi & ethereum-types.

* Fix test.

* Fix hex encodings.
2018-04-02 12:12:52 +01:00
Tomasz Drwięga c1cced3662 Allow customization of max WS connections. (#8257)
* Allow customization of max WS connections.

* remove superflous line.

* Add test for CLI argument parsing.
2018-04-02 11:33:09 +01:00
Tomasz Drwięga 5ea4c22868 Supress TemporaryInvalid verification failures. (#8256) 2018-04-02 11:30:26 +01:00
Wei Tang f1b7d8ab34 Return null number for pending block in eth_getBlockByNumber (#8281)
* Return null number for pending block in eth_getBlockByNumber

* Inline false in client_query

* block hash for pending should be null

* logsBloom should be null for pending blocks

* Fix test due to logsBloom type change
2018-04-02 10:04:14 +01:00
Ryan Leung 9c9ddaccec use constant durations (#8278)
* use constant durations

* fix CI

* address comments
2018-04-02 10:47:56 +02:00
Wei Tang 68a08df9c3 Typo fix: Mode doc - RLP should be client (#8283) 2018-03-31 15:41:53 +02:00
Wei Tang 1e6d889fc7 eth_uninstallFilter should return false for non-existent filter (#8280)
* eth_uninstallFilter should return false for non-existent filter

* Use shorter form is_some()
2018-03-31 11:06:16 +02:00
Ryan Leung 443115f885 Update `app_dirs` to 1.2.1 (#8268)
* use app_dirs2

* update app_dirs to 1.2.1
2018-03-30 10:31:54 +02:00
Sergey Pepyakin cab073ba00 Add missing license header for runtime.rs (#8252)
* Add missing license header for runtime.rs

* Update year
2018-03-29 13:48:57 +01:00
Pierre Krieger 7f9589d678 Fix warning about --no-hardcoded-sync being printed when it shouldn't (#8261) 2018-03-29 14:33:57 +02:00
Tomasz Drwięga 899c1a4b0e Warp-only sync with warp-barrier [blocknumber] flag. (#8228)
* Warp-only sync with warp-after [blocknumber] flag.

* Fix tests.

* Fix configuration tests.

* Rename to warp barrier.
2018-03-29 11:20:27 +02:00
Andrew Jones e3f7b70c38 Replace all Rlp usages with UntrustedRlp except for ethcore views (#8233)
* Replace Rlp with UntrustedRlp and unsafely unwrap

All Rlp methods return Result<_,DecoderError> now, so for this first
pass each will be marked with `expect("TODO")`. In the next pass we can
categorise figure out how to handle each case.

* Handle DecoderError for tendermint message

* Unwrap rlp results in TestBlockcChainClient

Rlp should be valid since created manually in tests

* Replace `use rlp::*` with explicit imports

* Remove rlp decode unwraps from light cli request

* Structured rlp encoding for curr best and latest in header chain

* Propogate decoder errors from send_packet

* Fix body uncles rlp index

* Use BodyView in sync and `expect` rlp errors

* Revert bbf28f removing original Rlp for this phase

This can be done again in the next phase, in order that we can leave the ethcore views unchanged

* Restore legacy Rlp and UntrustedRlp

Use legacy Rlp for ethcore views. Will redo replacing Rlp with UntrustedRlp in  a subsequent PR

* Fix tests

* Replace boilerplate Encodable/Decodable with derive

* Use BlockView instead of Rlp, remove unwrap

* Remove rlp test_cli unwraps by using BlockView instead of Rlp directly

* Remove unneccesary change to use borrowed hash

* Construct sync block using new_from_header_and_body
2018-03-29 11:19:45 +02:00
Marek Kotewicz 6e49ff1d98 Add test for ethstore-cli, fixes #8027 (#8187)
* Add test for ethstore-cli, fixes #8027

remove println

* Update test.sh
2018-03-28 22:04:08 +03:00
Varunram Ganesh 0c7f998c25 Update musicoin spec in line with gmc v2.6.2 (#8242) 2018-03-28 14:11:49 +02:00
Marek Kotewicz 23ea4798e0 fixed ethcore tx_filter (#8200) 2018-03-28 10:59:16 +01:00
Thibaut S 2632310b6a
Update CLI help for jsonrpc-apis, ws-apis and ipc-apis (#8234)
* jsonrpc-api,  ws-apis and ipc-apis update

* Better wording

* Clarify what "safe" has
2018-03-28 10:42:55 +02:00
Pierre Krieger c4dd156113 Remove network stats (#8225) 2018-03-28 15:45:36 +09:00
Marek Kotewicz 06a7ca221c
node-filter does not use ChainNotify (#8231)
* node-filter does not use ChainNotify

* fixed failing test
2018-03-28 11:32:44 +09:00
Pierre Krieger 04931618ed
Implement hardcoded sync in the light client (#8075)
* Implement hardcoded sync

* Fix concerns

* Remove artifact

* Fix cli tests

* Fix compilation

* Update hardcoded sync block

* Don't use any data fetch for the light service
2018-03-27 13:56:59 +02:00
Pierre Krieger dbc4d85f0a Update some of the dependencies for WASM (#8223) 2018-03-27 11:35:51 +09:00
Nikolay Volf bd45cd4a5e
bump wasmi version (#8209) 2018-03-26 16:55:48 +08:00
Kirill Pimenov 8c02211dc3 Updated jsonrpc to point to the 1.11 branch (#8180)
* Updated jsonrpc to point to the 1.11 branch

* Update dependencies.

- `jsonrpc` PR #244 required `hyper >= 0.11.20` which in turn required
updating `tokio-core`, `mio` and `iovec`.

- `jsonrpc` PR #246 required updating `https://github.com/tomusdrw/ws-rs`.

* Update tokio-core to 0.1.12

* Update hyper to 0.11.24
2018-03-24 14:43:28 +09:00
Amaury Martiny eb18e7ade7 Change name Wallet -> UI (#8164)
* Change name Wallet -> UI

* Make warning bold
2018-03-23 14:33:23 +01:00
Thibaut S 8ddd508a44 Introduce Parity UI (#8202) 2018-03-23 12:04:17 +01:00
Rando 857809f693 Update Changelogs (#8175)
* Move 1.9 changelog

* Mark Parity 1.8 EOL

* Make CHANGELOG 1.10 again

* Add changelog for 1.9.5 stable

* Add changelog for 1.10.0 beta

* Update changelog for 1.10.0 beta

* Update changelog for 1.10.0 beta

* Update changelog for 1.10.0 beta
2018-03-23 09:53:26 +00:00
James Ray ca0045482c Returns number of topcis to take fr.. (#8199) 2018-03-23 17:16:20 +09:00
Niklas Adolfsson 1c2c683ae3 make docopt usage non-const (#8189) 2018-03-23 13:53:06 +09:00
Tomasz Drwięga 7c8d404cf8 Avoid allocations when computing triehash. (#8176)
* Avoid allocations when computing triehash.

* Bump elastic-array to 0.10
2018-03-22 09:24:46 +01:00
Andrew Jones d293f94a6f Handle rlp decoding Result in patricia trie (#8166)
* Decode patricia node with UntrustedRlp

(cherry picked from commit efb993b8e7ce087f092cb8c2f633c62ad87e4fb8)

* Replace Rlp with UntrustedRlp in triedbmut

* Handle node decode results in trie
2018-03-22 10:08:48 +08:00
Nikolay Volf a60d0e440d bump wasm libs (#8171) 2018-03-21 10:47:25 +01:00
Tomasz Drwięga 9e294d577a Re-enable signer, even with no UI. (#8167)
* Re-enable signer, even with no UI.

* Fix message.
2018-03-20 17:57:37 +00:00
Pierre Krieger 6d5d419e14 Update daemonize (#8165) 2018-03-20 16:28:01 +01:00
lihuafeng 1b4d9c2d39 Some tiny modifications. (#8163)
1. fix some typo in the comment.
2. sort the order of methods in 'impl state::Backend for StateDB`
2018-03-20 15:46:03 +01:00
Svyatoslav Nikolsky a91e562021 SecretStore: store key author address in db (#7887)
* SecretStore: ability to identify requester via Public/Address

* SecretStore: store author address instead of public in db
2018-03-20 03:03:51 +01:00
Andrew Jones d7f690c8ba rename DatabaseValueView::new to from_rlp (#8159) 2018-03-20 03:02:07 +01:00
André Silva 7f1ff152ca dapps: update parity-ui dependencies (#8160) 2018-03-19 19:28:34 +01:00
Tomasz Drwięga beb6438ef5
Disable UI by default. (#8105) 2018-03-19 18:11:00 +01:00
Denis S. Soldatov aka General-Beck e25a660a11
fix wasmi x32 builds (#8155)
* fix wasmi x32 builds

* Update Cargo.toml
2018-03-19 18:42:51 +03:00
André Silva a7887fa9f1 Postpone Kovan hard fork (#8137)
* ethcore: postpone Kovan hard fork

* util: update version fork metadata
2018-03-19 11:23:12 +01:00
Svyatoslav Nikolsky a6915778bb SecretStore: ability to identify requester via Public/Address (#7886) 2018-03-19 06:42:40 +01:00
Robert Habermeier 249f81cbc5 optional dependency on secp256k1 for ethcrypto (#8109)
* optional dependency on secp256k1 for ethcrypto

* README
2018-03-19 06:39:46 +01:00
André Silva 373036bb7a network: init discovery using healthy nodes (#8061)
* network: init discovery using healthy nodes

* network: fix style grumble

* network: fix typo
2018-03-16 22:39:23 +01:00
Kirill Pimenov ed296312aa Check one step deeper if we're on release track branches (#8134) 2018-03-16 17:19:14 +03:00
Max Kaye d27c36cf75 explicitly mention pruning_history uses RAM (#8130) 2018-03-16 09:11:54 +01:00
Toralf Wittner c737056000 Remove `ethcrypto::{en,de}crypt_single_message`. (#8126)
Both functions are no longer in use within the parity code base.
2018-03-16 08:48:46 +01:00
Niklas Adolfsson 6f5bd845ad fix typo (#8124) 2018-03-15 18:49:43 +03:00
Toralf Wittner fed4864939 secret_store: use `ecies::encrypt`/`ecies::decrypt`. (#8125) 2018-03-15 18:49:13 +03:00
Alexey acd7192b17 Fix comment for fn gas() in wasm/runtime (#8122)
* Update runtime.rs

* Update runtime.rs
2018-03-15 15:34:11 +03:00
Marek Kotewicz 21cb08586b structured rlp encoding in journaldb (#8047)
* structured rlp encoding in journaldb

* removed redundant code
2018-03-15 10:14:38 +00:00
André Silva 4d1cb01da0 ci: disable link-dead-code in coverage build (#8118) 2018-03-15 02:21:40 +03:00
Marek Kotewicz 0e548ce7c5
fix trace filter returning returning unrelated reward calls, closes #8070 (#8098) 2018-03-14 20:27:57 +01:00
Toralf Wittner 236692cfd5 Const time comparison (#8113)
* Use `subtle::slices_equal` for constant time comparison.

Also update the existing version of subtle in `ethcrypto` from
0.1 to 0.5

* Test specifically for InvalidPassword error.
2018-03-14 15:41:35 +01:00
Toralf Wittner 322dfbcd78 Replace reqwest with hyper (#8099)
* Very primitive test of the Client API

* [WIP] getting rid of request

* Add support for redirects.

* Remove CpuPool from `fetch::Client`.

* Adapt code to API changes and fix tests.

* Use reference counter to stop background thread.

On `clone` the counter is incremented, on `drop` decremented. Once 0 we
send `None` over the channel, expecting the background thread to end.

* Fix tests.

* Comment.

* Change expect messages.

* Use local test server for testing fetch client.

* Ensure max_size also in BodyReader.

* Replace `Condvar` with `sync_channel`.

* Re-export `url::Url` from `fetch` crate.

* Remove spaces.

* Use random ports in local test server.
2018-03-14 13:40:54 +01:00
Nikolay Volf 1bad20ae38
more dos protection (#8104) 2018-03-14 15:27:56 +03:00
Pierre Krieger 113c35af0a Remove the time dependency where possible (#8100) 2018-03-14 12:29:52 +01:00
Alexey 5c47116889 fix comment for gas extern in Wasm runtime (#8101) 2018-03-14 12:27:18 +01:00
Niklas Adolfsson 23fc5517b5 Replace std::env::temp_dir with tempdir in tests (#8103)
* std::env::temp_dir -> tempdir in test context

* fix lifetime issue so tempdir removes tmpfiles
2018-03-14 12:26:20 +01:00
Pierre Krieger 7e948a088f Fix Cargo.lock not parsable (#8102) 2018-03-13 15:54:49 +01:00
Tomasz Drwięga 102bc7809f Additional data in EVMTestClient (#7964)
* Small changes to allow better re-use of EvmTestClient

* Expose logs.

* add outcome to TransactResult

* Fix submodule.

* Fix json tests.

* Fix evmbin.
2018-03-13 12:54:17 +01:00
Marek Kotewicz c2bd1a0e76
update serde, serde-derive, ethabi-derive, syn, quote and rlp_derive (#8085) 2018-03-13 12:43:24 +01:00
Marek Kotewicz de72643898
ethcore-service (#8089)
* ethcore test::helpers cleanup

* ethcore-service
2018-03-13 11:49:57 +01:00
Niklas Adolfsson e0f71b0c17 [contract-client] refactor (#7978)
* Refactor usage of registry contract

* remove unsed file

* Rename methods & fix comments

* refactor contract_client:

* Intoduced separate traits for asyncronous and syncronous contract clients
* Removed registrar from ethcore::client
* s/ContractClient/AsyncContractClient

* make the tests compile and pass

* omit changes in ethcore

* Use only one trait for ContractClient

* Use an associated type in the trait to determine syncronous or asyncronous communication
* Export the types from contract-client crate
* Document that "A" in the hash correspons to a DNS A Record A.K.A Address Record

* contract_client -> registrar

* address review feedback
2018-03-12 20:46:27 +00:00
Marek Kotewicz 66f3c50842 revert removing blooms (#8066)
* Revert "fix traces, removed bloomchain crate, closes #7228, closes #7167"

This reverts commit 1bf62038678295e5586f02a38a0c5aab9a9efe62.

* Revert "fixed broken logs (#7934)"

This reverts commit f8a2e53f3e.

* fixed broken logs

* bring back old lock order

* remove migration v13

* revert CURRENT_VERSION to 12 in migration.rs
2018-03-12 20:15:55 +00:00
Marek Kotewicz 373fdb65e9
ethcore test::helpers cleanup (#8086) 2018-03-12 18:05:52 +01:00
Nikolay Volf 58a1671076
add some dos protection (#8084) 2018-03-12 15:55:28 +03:00
Nikolay Volf e0a21e5aae WASM libraries bump (#7970)
* update wasmi, parity-wasm, wasm-utils to latest version

* Update to new wasmi & error handling

* also utilize new stack limiter

* fix typo

* replace dependency url

* Cargo.lock update
2018-03-12 11:37:32 +00:00
Fredrik Harrysson 3f33370e7d Echo back the message hash of a ping in the pong request (#8042)
* Echo back the message hash of a ping in the pong request

* Fixed broken link in README (#8012)

* Fixed broken link in README

* Updated wiki link

* [hardware wallet] sleeping -> pollling (#8018)

* Use polling, enable missing doc warnings & docs

* make try_connect_polling() a free function

* `Client` refactoring (#7038)

* Improves `BestBlock` comment

* Improves `TraceDB` comment

* Improves `journaldb::Algorithm` comment.

Probably the whole enum should be renamed to `Strategy` or something alike.

* Comments some of the `Client`'s fields

* Deglobs client imports

* Fixes comments

* Extracts `import_lock` to `Importer` struct

* Extracts `verifier` to `Importer` struct

* Extracts `block_queue` to `Importer` struct

* Extracts `miner` to `Importer` struct

* Extracts `ancient_verifier` to `Importer` struct

* Extracts `rng` to `Importer` struct

* Extracts `import_old_block` to `Importer` struct

* Adds `Nonce` trait

* Adds `Balance` trait

* Adds `ChainInfo` trait

* Fixes imports for tests using `chain_info` method

* Adds `BlockInfo` trait

* Adds more `ChainInfo` imports

* Adds `BlockInfo` imports

* Adds `ReopenBlock` trait

* Adds `PrepareOpenBlock` trait

* Fixes import in tests

* Adds `CallContract` trait

* Fixes imports in tests using `call_contract` method

* Adds `TransactionInfo` trait

* Adds `RegistryInfo` trait

* Fixes imports in tests using `registry_address` method

* Adds `ScheduleInfo` trait

* Adds `ImportSealedBlock` trait

* Fixes imports in test using `import_sealed_block` method

* Adds `BroadcastProposalBlock` trait

* Migrates `Miner` to static dispatch

* Fixes tests

* Moves `calculate_enacted_retracted` to `Importer`

* Moves import-related methods to `Importer`

* Removes redundant `import_old_block` wrapper

* Extracts `import_block*` into separate trait

* Fixes tests

* Handles `Pending` in `LightFetch`

* Handles `Pending` in filters

* Handles `Pending` in `ParityClient`

* Handles `Pending` in `EthClient`

* Removes `BlockId::Pending`, partly refactors dependent code

* Adds `StateInfo` trait

* Exports `StateOrBlock` and `BlockChain` types from `client` module

* Refactors `balance` RPC using generic API

* Refactors `storage_at` RPC using generic API

* Makes `MinerService::pending_state`'s return type dynamic

* Adds `StateOrBlock` and `BlockChain` types

* Adds impl of `client::BlockChain` for `Client`

* Exports `StateInfo` trait from `client` module

* Missing `self` use

To be fixed up to "Adds impl of `client::BlockChain` for `Client`"

* Adds `number_to_id` and refactors dependent RPC methods

* Refactors `code_at` using generic API

* Adds `StateClient` trait

* Refactors RPC to use `StateClient` trait

* Reverts `client::BlockChain` trait stuff, refactors methods to accept `StateOrBlock`

* Refactors TestClient

* Adds helper function `block_number_to_id`

* Uses `block_number_to_id` instead of local function

* Handles `Pending` in `list_accounts` and `list_storage_keys`

* Attempt to use associated types for state instead of trait objects

* Simplifies `state_at_beginning`

* Extracts `call` and `call_many` into separate trait

* Refactors `build_last_hashes` to accept reference

* Exports `Call` type from the module

* Refactors `call` and `call_many` to accept state and header

* Exports `state_at` in `StateClient`

* Exports `pending_block_header` from `MinerService`

* Refactors RPC `call` method using new API

* Adds missing parentheses

* Refactors `parity::call` to use new call API

* Update .gitlab-ci.yml

fix gitlab lint

* Fixes error handling

* Refactors `traces::call` and `call_many` to use new call API

* Refactors `call_contract`

* Refactors `block_header`

* Refactors internal RPC method `block`

* Moves `estimate_gas` to `Call` trait, refactors parameters

* Refactors `estimate_gas` in RPC

* Refactors `uncle`

* Refactors RPC `transaction`

* Covers missing branches

* Makes it all compile, fixes compiler grumbles

* Adds casts in `blockchain` module

* Fixes `PendingBlock` tests, work on `MinerService`

* Adds test stubs for StateClient and EngineInfo

* Makes `state_db` public

* Adds missing impls for `TestBlockChainClient`

* Adds trait documentation

* Adds missing docs to the `state_db` module

* Fixes trivial compilation errors

* Moves `code_hash` method to a `BlockInfo` trait

* Refactors `Verifier` to be generic over client

* Refactors `TransactionFilter` to be generic over client

* Refactors `Miner` and `Client` to reflect changes in verifier and txfilter API

* Moves `ServiceTransactionChecker` back to `ethcore`

* Fixes trait bounds in `Miner` API

* Fixes `Client`

* Fixes lifetime bound in `FullFamilyParams`

* Adds comments to `FullFamilyParams`

* Fixes imports in `ethcore`

* Fixes BlockNumber handling in `code_at` and `replay_block_transactions`

* fix compile issues

* First step to redundant trait merge

* Fixes compilation error in RPC tests

* Adds mock `State` as a stub for `TestClient`

* Handles `StateOrBlock::State` in `TestBlockChainClient::balance`

* Fixes `transaction_count` RPC

* Fixes `transaction_count`

* Moves `service_transaction.json` to the `contracts` subfolder

* Fixes compilation errors in tests

* Refactors client to use `AccountData`

* Refactors client to use `BlockChain`

* Refactors miner to use aggregate traits

* Adds `SealedBlockImporter` trait

* Refactors miner to use `SealedBlockImporter` trait

* Removes unused imports

* Simplifies `RegistryInfo::registry_address`

* Fixes indentation

* Removes commented out trait bound

* Bump master to 1.11.0 (#8021)

* Bump master to 1.11.0

* Bump price-info

* Bump mac installer version

* Fix gitlab builds

*  Add MCIP-6 Byzyantium transition to Musicoin spec (#7841)

* Add test chain spec for musicoin byzantium testnet

* Add MCIP-6 Byzyantium transition to Musicoin spec

* Update mcip6_byz.json

* ethcore: update musicoin byzantium block number

* ethcore: update musicoin byzantium block number

* ethcore: update musicoin bootnodes

* Update musicoin.json

* Update musicoin.json

* More bootnodes.

* prelude to the block module cleanup (#8025)

* prelude to block cleanup

* fixed tests

* fix cache & snapcraft CI build (#8052)

after successful testing it is necessary to port in a ```beta``` and ```stable```

* Update refs to shell (#8051)

* Abstract devp2p (#8048)

* Rename ethcore-network to ethcore-network-devp2p

* Fix typo

* Extract generic traits into util/network

* Simplify util/network

* Fix devp2p tests

* Remove old feature

* Fix RPC tests

* Change port because testing environment didn't like those ports
2018-03-12 11:06:48 +01:00
Nikolay Volf 06fa900504 Add Kovan WASM activation blocknumber (#8057) 2018-03-12 10:55:44 +01:00
Niklas Adolfsson 29d7a0e3c9 [ethkey] Unify debug/display for Address/Public/Secret (#8076)
* unify debug in ethkey

* fix tests
2018-03-09 16:32:20 +01:00
Arkadiy Paronyan e8106016c8 Limit incoming connections. (#8060)
* Limit ingress connections
* Optimized handshakes logging
2018-03-09 11:26:40 +01:00
Tomasz Drwięga d716bae3d5 Max code size on Kovan (#8067)
* Enable code size limit on kovan

* Fix formatting.
2018-03-07 15:11:09 +01:00
André Silva f48b09b76e updater: apply exponential backoff after download failure (#8059)
* updater: apply exponential backoff after download failure

* updater: reset backoff on new release
2018-03-06 21:16:38 +01:00
Marek Kotewicz f54944bbfc make blockchain functions more idiomatic, avoid needless writes to cache_man (#8054) 2018-03-06 19:44:05 +01:00
Marek Kotewicz ff722cac72 make patricia-trie more idiomatic and remove redundant code (#8056) 2018-03-06 19:42:24 +01:00
Pierre Krieger eeee90def5 Abstract devp2p (#8048)
* Rename ethcore-network to ethcore-network-devp2p

* Fix typo

* Extract generic traits into util/network

* Simplify util/network

* Fix devp2p tests

* Remove old feature

* Fix RPC tests
2018-03-05 11:56:35 +01:00
Amaury Martiny 47a02480c4 Update refs to shell (#8051) 2018-03-05 11:56:14 +01:00
Denis S. Soldatov aka General-Beck bbefdec973 fix cache & snapcraft CI build (#8052)
after successful testing it is necessary to port in a ```beta``` and ```stable```
2018-03-05 11:52:18 +01:00
Marek Kotewicz f864f72bb5 prelude to the block module cleanup (#8025)
* prelude to block cleanup

* fixed tests
2018-03-04 19:31:26 +01:00
Rando 6623de4e61 Add MCIP-6 Byzyantium transition to Musicoin spec (#7841)
* Add test chain spec for musicoin byzantium testnet

* Add MCIP-6 Byzyantium transition to Musicoin spec

* Update mcip6_byz.json

* ethcore: update musicoin byzantium block number

* ethcore: update musicoin byzantium block number

* ethcore: update musicoin bootnodes

* Update musicoin.json

* Update musicoin.json

* More bootnodes.
2018-03-04 16:18:51 +01:00
Rando 33284e988e
Bump master to 1.11.0 (#8021)
* Bump master to 1.11.0

* Bump price-info

* Bump mac installer version

* Fix gitlab builds
2018-03-03 22:02:33 +01:00
Dmitry Kashitsyn 9d7d6f7108 `Client` refactoring (#7038)
* Improves `BestBlock` comment

* Improves `TraceDB` comment

* Improves `journaldb::Algorithm` comment.

Probably the whole enum should be renamed to `Strategy` or something alike.

* Comments some of the `Client`'s fields

* Deglobs client imports

* Fixes comments

* Extracts `import_lock` to `Importer` struct

* Extracts `verifier` to `Importer` struct

* Extracts `block_queue` to `Importer` struct

* Extracts `miner` to `Importer` struct

* Extracts `ancient_verifier` to `Importer` struct

* Extracts `rng` to `Importer` struct

* Extracts `import_old_block` to `Importer` struct

* Adds `Nonce` trait

* Adds `Balance` trait

* Adds `ChainInfo` trait

* Fixes imports for tests using `chain_info` method

* Adds `BlockInfo` trait

* Adds more `ChainInfo` imports

* Adds `BlockInfo` imports

* Adds `ReopenBlock` trait

* Adds `PrepareOpenBlock` trait

* Fixes import in tests

* Adds `CallContract` trait

* Fixes imports in tests using `call_contract` method

* Adds `TransactionInfo` trait

* Adds `RegistryInfo` trait

* Fixes imports in tests using `registry_address` method

* Adds `ScheduleInfo` trait

* Adds `ImportSealedBlock` trait

* Fixes imports in test using `import_sealed_block` method

* Adds `BroadcastProposalBlock` trait

* Migrates `Miner` to static dispatch

* Fixes tests

* Moves `calculate_enacted_retracted` to `Importer`

* Moves import-related methods to `Importer`

* Removes redundant `import_old_block` wrapper

* Extracts `import_block*` into separate trait

* Fixes tests

* Handles `Pending` in `LightFetch`

* Handles `Pending` in filters

* Handles `Pending` in `ParityClient`

* Handles `Pending` in `EthClient`

* Removes `BlockId::Pending`, partly refactors dependent code

* Adds `StateInfo` trait

* Exports `StateOrBlock` and `BlockChain` types from `client` module

* Refactors `balance` RPC using generic API

* Refactors `storage_at` RPC using generic API

* Makes `MinerService::pending_state`'s return type dynamic

* Adds `StateOrBlock` and `BlockChain` types

* Adds impl of `client::BlockChain` for `Client`

* Exports `StateInfo` trait from `client` module

* Missing `self` use

To be fixed up to "Adds impl of `client::BlockChain` for `Client`"

* Adds `number_to_id` and refactors dependent RPC methods

* Refactors `code_at` using generic API

* Adds `StateClient` trait

* Refactors RPC to use `StateClient` trait

* Reverts `client::BlockChain` trait stuff, refactors methods to accept `StateOrBlock`

* Refactors TestClient

* Adds helper function `block_number_to_id`

* Uses `block_number_to_id` instead of local function

* Handles `Pending` in `list_accounts` and `list_storage_keys`

* Attempt to use associated types for state instead of trait objects

* Simplifies `state_at_beginning`

* Extracts `call` and `call_many` into separate trait

* Refactors `build_last_hashes` to accept reference

* Exports `Call` type from the module

* Refactors `call` and `call_many` to accept state and header

* Exports `state_at` in `StateClient`

* Exports `pending_block_header` from `MinerService`

* Refactors RPC `call` method using new API

* Adds missing parentheses

* Refactors `parity::call` to use new call API

* Update .gitlab-ci.yml

fix gitlab lint

* Fixes error handling

* Refactors `traces::call` and `call_many` to use new call API

* Refactors `call_contract`

* Refactors `block_header`

* Refactors internal RPC method `block`

* Moves `estimate_gas` to `Call` trait, refactors parameters

* Refactors `estimate_gas` in RPC

* Refactors `uncle`

* Refactors RPC `transaction`

* Covers missing branches

* Makes it all compile, fixes compiler grumbles

* Adds casts in `blockchain` module

* Fixes `PendingBlock` tests, work on `MinerService`

* Adds test stubs for StateClient and EngineInfo

* Makes `state_db` public

* Adds missing impls for `TestBlockChainClient`

* Adds trait documentation

* Adds missing docs to the `state_db` module

* Fixes trivial compilation errors

* Moves `code_hash` method to a `BlockInfo` trait

* Refactors `Verifier` to be generic over client

* Refactors `TransactionFilter` to be generic over client

* Refactors `Miner` and `Client` to reflect changes in verifier and txfilter API

* Moves `ServiceTransactionChecker` back to `ethcore`

* Fixes trait bounds in `Miner` API

* Fixes `Client`

* Fixes lifetime bound in `FullFamilyParams`

* Adds comments to `FullFamilyParams`

* Fixes imports in `ethcore`

* Fixes BlockNumber handling in `code_at` and `replay_block_transactions`

* fix compile issues

* First step to redundant trait merge

* Fixes compilation error in RPC tests

* Adds mock `State` as a stub for `TestClient`

* Handles `StateOrBlock::State` in `TestBlockChainClient::balance`

* Fixes `transaction_count` RPC

* Fixes `transaction_count`

* Moves `service_transaction.json` to the `contracts` subfolder

* Fixes compilation errors in tests

* Refactors client to use `AccountData`

* Refactors client to use `BlockChain`

* Refactors miner to use aggregate traits

* Adds `SealedBlockImporter` trait

* Refactors miner to use `SealedBlockImporter` trait

* Removes unused imports

* Simplifies `RegistryInfo::registry_address`

* Fixes indentation

* Removes commented out trait bound
2018-03-03 18:42:13 +01:00
Niklas Adolfsson 81b52c7336 [hardware wallet] sleeping -> pollling (#8018)
* Use polling, enable missing doc warnings & docs

* make try_connect_polling() a free function
2018-03-02 18:30:25 +01:00
Shane Vitarana fb17ae7751 Fixed broken link in README (#8012)
* Fixed broken link in README

* Updated wiki link
2018-03-02 17:21:35 +01:00
Tomasz Drwięga 9bcb589785 Support parity protocol. (#8035) 2018-03-02 10:26:49 +01:00
Rando 2e00f656d0 Add changelog for 1.8.11 stable and 1.9.4 beta (#8017)
* Add changelog for 1.8.11 stable

* Add changelog for 1.9.4 beta

* Bump release date
2018-03-01 20:53:21 +01:00
Marek Kotewicz 87f893265d fix for verify_block_basic crashing on invalid transaction rlp (#8032) 2018-03-01 19:55:24 +01:00
Pierre Krieger d4205da484 Extract the hard dependency on rocksdb from the light client (#8034)
* Extract the hard dependency on rocksdb from the light client

* Remove TODO
2018-03-01 19:53:15 +01:00
Marek Kotewicz ca0d1f5eb7 fixed parsing ethash seals and verify_block_undordered (#8031) 2018-03-01 19:13:20 +01:00
Marek Kotewicz e76a545970
fixed ethstore sign (#8026) 2018-03-01 14:20:11 +01:00
Denis S. Soldatov aka General-Beck ec7282d05c CI: Fix cargo cache (#7968)
* Fix cache

Blocking waiting for file lock on the registry index

* Only clean locked cargo cache on windows
2018-03-01 13:41:49 +01:00
Amaury Martiny ea3083bd3b Update ref to new shell (#8024) 2018-03-01 13:17:39 +01:00
Svyatoslav Nikolsky 6d5b13c80c SecretStore: secretstore_generateDocumentKey RPC (#7864)
* SecretStore: secretstore_generateDocumentKey RPC

* SecretStore: return encrypted_key from secretstore_generateDocumentKey
2018-03-01 10:00:44 +01:00
Svyatoslav Nikolsky 0da6c7eb45 SecretStore: ECDSA session for cases when 2*t < N (#7739)
* SecretStore: ECDSA PoC

* SecretStore: fixed ECDSA serialization + cleanup

* removed unused param

* removed unused method

* removed debug unwrap

* SecretStore: 'limited' ECDSA session

* fix after merge
2018-03-01 09:59:21 +01:00
Marek Kotewicz cdb3afee42
bump tiny-keccak (#8019) 2018-03-01 09:54:50 +01:00
Niklas Adolfsson e54c33d9a7 remove un-necessary comment (#8014) 2018-02-28 16:40:08 +03:00
Marek Kotewicz 9fec2142ae clean up account fmt::Debug (#7983) 2018-02-27 18:37:36 +01:00
Marek Kotewicz e32b600530 improve quality of vote_collector module (#7984) 2018-02-27 18:29:43 +01:00
Marek Kotewicz df63341eb4
ExecutedBlock cleanup (#7991)
* ExecutedBlock cleanup

* authority round makes only one call to note_rewards

* move Tracing from block to trace module

* removed BlockRef
2018-02-27 18:22:56 +01:00
Niklas Adolfsson 6445f12c2d Hardware-wallet/usb-subscribe-refactor (#7860)
* Hardware-wallet fix

* More fine-grained initilization of callbacks by vendorID, productID and usb class
* Each device manufacturer gets a seperate handle thread each
* Replaced "dummy for loop" with a delay to wait for the device to boot-up properly
* Haven't been very carefully with checking dependencies cycles etc
* Inline comments explaining where shortcuts have been taken
* Need to test this on Windows machine and with Ledger (both models)

Signed-off-by: niklasad1 <niklasadolfsson1@gmail.com>

* Validate product_id of detected ledger devices

* closed_device => unlocked_device

* address comments

* add target in debug

* Address feedback

* Remove thread joining in HardwareWalletManager
* Remove thread handlers in HardwareWalletManager because this makes them unused
2018-02-27 16:45:16 +01:00
Marek Kotewicz eff5cabb3f remove wildcard imports from views, make tests more idiomatic (#7986) 2018-02-23 20:01:33 +01:00
Marek Kotewicz f9d5d618dc moved PerfTimer to a separate crate - "trace-time" (#7985) 2018-02-23 19:49:08 +01:00
Marek Kotewicz 893979b5da clean up ethcore::spec module imports (#7990)
* clean up ethcore::spec module imports

* fixed missing reimport
2018-02-23 19:37:23 +01:00
André Silva e4f863b4b0 rpc: don't include current block in new_block_filter (#7982) 2018-02-23 10:41:29 +01:00
Marek Kotewicz 5cf6684461 fix traces, removed bloomchain crate, closes #7228, closes #7167 (#7979) 2018-02-23 10:29:11 +01:00
Marek Kotewicz 73756ce262 simplify compression and move it out of rlp crate (#7957)
* simplify compression and move it out of rlp crate

* removed lazy_static dependency from rlp
2018-02-23 10:12:52 +01:00
Marek Kotewicz ee93be80c0
removed old migrations (#7974)
* removed old migrations

* improve SimpleMigration

* fixed migration tests

* fixed redundant whitespace

* add ToV13 migration which removes bloom groups

* bump CURRENT_VERSION of db
2018-02-22 14:53:10 +01:00
Tomasz Drwięga d90ab40a78 Detect too large packets in snapshot sync. (#7977) 2018-02-22 14:52:29 +01:00
Marek Kotewicz f8a2e53f3e fixed broken logs (#7934)
* fixed broken logs

* bring back old lock order

* removed bloom groups from blockchain

* revert unrelated changes

* simplify blockchain_block_blooms
2018-02-22 11:22:56 +01:00
André Silva e0b4506474 Increase max download limit to 128MB (#7965)
* fetch: increase max download limit to 64MB

* parity: increase download size limit for updater service
2018-02-22 11:22:25 +01:00
Tomasz Drwięga 01d9bff3cf Calculate proper keccak256/sha3 using parity. (#7953) 2018-02-20 22:45:41 +00:00
Rando db90f5b0a4 Add changelog for 1.8.10 stable and 1.9.3 beta (#7947)
* Add changelog for 1.8.10 stable

* Add changelog for 1.9.3 beta

* Released 1.9.3 ahead of schedule :)
2018-02-20 16:28:09 +00:00
André Silva bfdc097538 kvdb-rocksdb: remove buffered operations when committing transaction (#7950) 2018-02-20 17:20:30 +01:00
Tomasz Drwięga 05f47b6359 Bump WS (#7952) 2018-02-20 10:28:10 +01:00
Marek Kotewicz 5b4abec2db removed redundant Bloom conversions (#7932)
* removed redundant Bloom conversions

* fixed broken tests
2018-02-19 13:08:33 +00:00
Marek Kotewicz d6d6a7cc95 simplify RefInfo fmt (#7929) 2018-02-19 13:05:00 +00:00
Nikolay Volf 684322cd6f Kovan WASM fork code (#7849)
* kovan fork code

* introduce ethcore level vm_factory and let it fail

* fix json tests

* wasmcosts as option

* review changes

* wasm costs in parser

* fix evm tests

* review fixes

* fix test

* remove redundant json field
2018-02-19 12:27:42 +01:00
Marek Kotewicz 605f3b0381
bring back trie and triehash benches (#7926) 2018-02-19 12:03:54 +01:00
Marek Kotewicz 4bda6efed0
removed redundant PodAccount::new method (#7928)
* removed redundant PodAccount::new method

* fixed failing test
2018-02-19 10:58:04 +01:00
Marek Kotewicz b77771171d
removed dummy wrapper structure - LogGroupPosition (#7922) 2018-02-19 10:52:33 +01:00
Lorenzo Manacorda e630f647d1 spec: Validate required divisor fields are not 0 (#7933)
* Add validate_non_zero function

It's used to validate that a Spec's uint field used as a divisor is not zero.

* Add deserialize_with to gas_limit_bound_divisor

Prevents panics due to divide-by-zero on the gas_limit_bound_divisor
field.

* Add deserialize_with to difficulty_bound_divisor

Prevents panics due to divide-by-zero on the difficulty_bound_divisor
field.

* Add validate_optional_non_zero function

Used to validate Option<Uint> divisor fields.

* Use deserialize_with on optional divisor fields.

* Add #[serde(default)] attribute to divisor fields

When using `#[serde(deserialize_with)]`, `#[serde(default)]` must be specified so that missing
fields can be deserialized with the deserializer for `None`.
2018-02-19 10:36:34 +01:00
Marek Kotewicz 76a098114f simplify Client::filter_traces method (#7936) 2018-02-18 23:02:02 +01:00
Denis S. Soldatov aka General-Beck e79ade59c9 gitlab cache (#7921)
it is necessary to test
2018-02-18 00:02:44 +01:00
Pierre Krieger 364a1fa5a8 Fix a division by zero in light client RPC handler (#7917) 2018-02-17 21:54:39 +01:00
Marek Kotewicz f905a1676f triehash optimisations (#7920) 2018-02-16 20:24:16 +01:00
Marek Kotewicz ff0c44c060
removed redundant Blockchain::db method (#7919) 2018-02-16 19:43:19 +01:00
Marek Kotewicz ec34d50459
removed redundant Blockchain::rewind method (#7918) 2018-02-16 19:43:05 +01:00
Tomasz Drwięga 236a4aac22 Pending transactions subscription (#7906)
* Pending transactions subscription.

* Pending transactions Pub-Sub

* Add light client support.

* Remove redundant Ok
2018-02-16 16:51:34 +01:00
Marek Kotewicz 899dd0ff4b
removed redundant otry! macro from ethcore (#7916)
* removed redundant otry! macro from ethcore

* removed redundant otry! macro from parity
2018-02-16 16:37:12 +01:00
Marek Kotewicz c6b931766c Make block generator easier to use (#7888)
* Make block generator easier to use

* applied review suggestions

* rename BlockMetadata -> BlockOptions

* removed redundant uses of blockchain generator and genereator.next().unwrap() calls
2018-02-16 10:11:29 +01:00
Tomasz Zdybał f8618dd02a ECIP 1041 - Remove Difficulty Bomb (#7905)
Enable difficulty bomb defusion at block:
 - 5900000 on Ethereum Classic mainnet,
 - 2300000 on morden testnet.

Reference:
https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1041.md
2018-02-16 10:09:49 +01:00
Svyatoslav Nikolsky 37bfcb737b SecretStore: threshold ECDSA PoC (#7615)
* SecretStore: ECDSA PoC

* SecretStore: fixed ECDSA serialization + cleanup

* removed unused param

* removed unused method

* removed debug unwrap

* 1/x -> inv(x)

* SecretStore: merged fixes from ECDSA session branch

* once again  1/* -> inv(*)

* fixed grumbles
2018-02-15 11:12:51 +01:00
Tomasz Drwięga 226215eff6 Fix CSP for dapps that require eval. (#7867)
* Add allowJsEval to manifest.

* Enable 'unsafe-eval' if requested in manifest.
2018-02-15 11:05:20 +01:00
Afri Schoedon 0a34ad50b4
Fix gitlab (#7901) 2018-02-15 08:27:32 +01:00
Denis S. Soldatov aka General-Beck 3d803762ff Gitlb snap master patch (#7900)
* fix snap build master

add rhash

* fix double line

* remove filure from snap build stage
2018-02-15 07:54:21 +01:00
André Silva aab63c339d Aura: Broadcast empty step messages instead of creating empty blocks (#7605)
* aura: broadcast empty step message instead of sealing empty block

* aura: add empty_step messages to seal

* aura: include parent_hash in empty step message

* aura: verify received empty step messages

* aura: verify empty step messages in block

* aura: fix dead lock on empty_steps

* aura: fix EmptyStep Encodable

* aura: take number of empty steps into account in chain score

* aura: use empty step signers for finality

* aura: add empty "empty step" messages to seal when reading from spec

* aura: fix EmptyStep rlp encoding

* aura: use Vec<u8> instead of Bytes

* aura: fix block empty step verification

* Update .gitlab-ci.yml

fix lint

* aura: fix accumulation of empty step signatures for finality

* aura: include empty steps in seal signature

* aura: configurable max number of empty steps

* engine: pass block header to seal_fields method

This is necessary to make the number of seal fields dynamic,
e.g. activating a transition on a certain block number that changes
the seal.

* aura: add transition to enable empty step messages

* aura: clear old empty step messages on verify_block_external

* aura: ignore empty step messages from the future

* aura: report skipped primaries when empty steps are not enabled

* aura: fix tests

* aura: report misbehavior

* aura: add tests for rolling finality with multiple signatures

* engine: fix validator set test

In this test the block validation wasn't failing because the block was in the
future (expected failure) but was instead failing because the author of the
block isn't the expected authority. Since we added reporting of blocks produced
by the wrong authority this test started failing.

* aura: reward all the authors of empty step messages

* aura: fix reward attribution for new blocks

* aura: add tests for empty steps broadcasting and inclusion in blocks

* aura: reduce size of empty step messages in seal

* aura: add test for empty step inclusion in blocks

* aura: add test for rewarding of empty steps

* aura: add test for empty steps validation

* aura: fix rlp encoding of sealed empty step

* aura: fix grumbles
2018-02-15 01:39:29 +01:00
Denis S. Soldatov aka General-Beck 5d6e7e1439 fix snap build master (#7896)
add rhash
2018-02-14 22:19:59 +01:00
André Silva d1815eec55 Fix wallet import (#7873)
* rpc: generate new account id for imported wallets

* ethstore: handle duplicate wallet filenames

* ethstore: simplify deduplication of wallet file names

* ethstore: do not dedup wallet filenames on update

* ethstore: fix minor grumbles
2018-02-14 14:21:58 +01:00
Afri Schoedon 1cce3cfb75
Fix snapcraft nightly (#7884)
* Fix snapcraft nightly

* Update gitlab-build.sh

* Update snapcraft.yaml

* Update gitlab-build.sh

* Update .gitlab-ci.yml

snap build switch to https://hub.docker.com/r/snapcore/snapcraft/

* skip aura-test.sh

https://github.com/paritytech/parity/pull/6078

* add snap artifacts

* Fix aura tests

* Fix macos build

* Allow aura test to fail

* Disable aura tests
2018-02-14 12:39:08 +01:00
Pierre Krieger bf57eb8978 Add a timeout for light client sync requests (#7848)
* Add a timeout for light client sync requests

* Adjusting timeout to number of headers
2018-02-14 11:31:14 +01:00
Svyatoslav Nikolsky ebb92947a3 SecretStore: fixed test (#7878) 2018-02-14 10:49:56 +01:00
Tomasz Drwięga 5584739b83 Fix checksums and auto-update push (#7846)
* Re-enable auto-update for windows. Fail build on non 2xx response from updater.

* Fix format of md5 and sha256 files.

* Fix identation.

* Add critical to metadata.

* Add some logs.

* Fix pushing build.

* Attempt to fix release pushing.

* Fix missing rhash?

* Workaround broken rhash.
2018-02-13 19:31:06 +01:00
Afri Schoedon 8b0004b4cf
Forward-port snap fixes (#7831) 2018-02-13 16:31:05 +01:00
Denis S. Soldatov aka General-Beck bf7e8741c7 Update gitlab-test.sh (#7883)
* Update gitlab-test.sh

https://github.com/paritytech/parity/issues/7871

* Update aura-test.sh
2018-02-13 16:21:24 +01:00
Afri Schoedon 3cae42bb34
Fix installer binary names for macos and windows (#7881)
* Fix windows installer file name

* Fix macos installer file name
2018-02-13 16:20:01 +01:00
Lexi Brent 006b2f3564 Fix string typo: "develoopment" -> "development" (#7874) 2018-02-13 09:52:05 +03:00
Leo Arias a385f9a649 Update the instructions to install the stable snap (#7876) 2018-02-13 07:50:21 +01:00
Svyatoslav Nikolsky 8579a56f71 SecretStore: 'broadcast' decryption session (#7843) 2018-02-12 18:05:33 +01:00
Tomasz Drwięga 90bd6bf700 Flush keyfiles. Resolves #7632 (#7868) 2018-02-12 18:03:37 +01:00
Svyatoslav Nikolsky 1ca1fba8cf read registry_address from given block (#7866) 2018-02-12 18:02:48 +01:00
Alexey a30de1b8d8 Clean up docs formatting for Wasm runtime (#7869)
* Clean up docs formatting for Wasm runtime

* Update runtime.rs
2018-02-12 17:59:41 +01:00
Nikolay Volf fab03398dd disable internal memory (#7842) 2018-02-12 11:19:43 +01:00
Denis S. Soldatov aka General-Beck 78f39e9090 Update gitlab-build.sh (#7855)
fix build ```version``` after https://github.com/paritytech/parity/pull/7723
2018-02-12 10:54:15 +01:00
Marek Kotewicz c060d9584d
ethabi version 5 (#7723)
* Refactor updater to use ethabi-derive

* Grumble: do_call type alias

* Empty commit to trigger test re-run

* migration to ethabi-5.0

* migration to ethabi-5.0 in progress

* use ethabi_deriven to generate TransactAcl contract

* use ethabi_deriven to generate Registry contract

* hash-fetch uses ethabi_derive, removed retain cycle from updater, fixed #7720

* node-filter crate uses ethabi_derive to generate peer_set contract interface

* use LruCache in node-filter instead of HashMap

* validator_set engine uses ethabi_derive

* ethcore does not depend on native_contracts

* miner does no depend on native_contracts

* secret_store does not use native_contracts (in progress)

* removed native-contracts

* ethcore and updater does not depend on futures

* updated ethereum-types

* fixed all warnings caused by using new version of ethereum-types

* updated ethabi_derive && ethabi_contract to get rid of warnings

* removed another retain cycle in updater, fixed following minor version on update

* moved contracts out of native_contracts res

* updated ethabi_contract

* fixed failing test

* fixed failing test

* there is no need to create two contracts of the same kind any more

* simplify updater::ReleaseTrack conversion into u8 and add several tests for it

* applied review suggestions

* applied review suggestions
2018-02-09 09:32:06 +01:00
Pierre Krieger 2c60a53fef Randomize the peer we dispatch to (#7844) 2018-02-08 21:36:46 +01:00
Tomasz Drwięga a59f6d9bd2 Move updater metadata to Cargo.toml of parity-version. (#7832) 2018-02-08 12:38:56 +01:00
Afri Schoedon a487182e92
Add new EF ropstens nodes. (#7824)
* Add new EF ropstens nodes.

* Fix tests
2018-02-08 12:38:18 +01:00
Marek Kotewicz f244ebeb4a
refactor stratum to remove retain cycle (#7827)
* refactor stratum to remove retain cycle, fixed #7823

* fix tests
2018-02-07 17:15:40 +01:00
Tomasz Drwięga b4ed51c5f1 Bump jsonrpc. (#7828) 2018-02-07 16:13:54 +01:00
Afri Schoedon 516bb685bf
Add binary identifiers and sha256sum to builds (#7830)
* Add binary identifiers and sha256sum to builds

* Print build ident
2018-02-07 15:02:13 +01:00
Jaco Greeff 66755be8f6 Update references to UI shell & wallet (#7808)
* Update references to UI shell & wallet

* Update after merge
2018-02-06 14:25:02 +01:00
Nikolay Volf 0a7cebe316 adjust storage update evm-style (#7812) 2018-02-06 11:57:29 +01:00
Nikolay Volf fb4582a90e wasmi interpreter (#7796) 2018-02-05 20:59:27 +01:00
Svyatoslav Nikolsky ebda6d3916 SecretStore: ignore removed authorities when running auto-migration (#7674) 2018-02-05 20:59:14 +01:00
Nikolay Volf 8587df17d9 Fix build (#7807)
* Update Cargo.toml

* updated Cargo.lock
2018-02-05 14:05:59 +03:00
Jaco Greeff 97a3c6e461 Move js & js-old code to github.com/parity-js (#7685)
* Move js & js-old to github.com/parity-js

* Update shell & dapp-wallet references

* Update wallet ref

* Remove JS stages

* Update to latest shell & wallet (token fixes)
2018-02-05 10:40:00 +01:00
Afri Schoedon 89772f40f9
More changelogs :) (#7782)
* Add CHANGELOG for 1.8.9

* Add CHANGELOG for 1.8.9

* Add CHANGELOG for 1.9.2
2018-02-05 10:34:21 +01:00
Svyatoslav Nikolsky 2cfc2b95d0 fixed API set in help (#7790) 2018-02-02 13:07:42 +01:00
Svyatoslav Nikolsky 10a95a5a22 remove obsolete file (#7788) 2018-02-02 08:55:44 +01:00
Afri Schoedon 0ea1c41573 Update ropsten.json (#7776) 2018-02-01 16:23:46 +00:00
Afri Schoedon d051dd2a60
CHANGELOG for 1.9.1 and 1.8.8 (#7775)
* Update CHANGELOGs for 1.8.8

* Update CHANGELOGs for 1.9.1
2018-02-01 13:50:23 +01:00
Afri Schoedon 6dec16bb41
Enable byzantium features on non-ethash chains (#7753)
* Enable byzantium on dev chain

* Enable byzantium on constractor spec

* Enable byzantium on aura specs

* Enable byzantium on tendermint chain spec

* Enable byzantium on null chain spec

* Fix tests

* Fix test
2018-02-01 13:42:56 +01:00
André Silva 4763887a68 Fix client not being dropped on shutdown (#7695)
* parity: wait for client to drop on shutdown

* parity: fix grumbles in shutdown wait

* parity: increase shutdown timeouts
2018-01-31 11:41:29 +01:00
Axel Chalon fee88d04d4 Wrap --help output to 120 characters (#7626)
* Update Clap dependency and remove workarounds

* WIP

* Remove line breaks in help messages for now

* Multiple values can only be separated by commas (closes #7428)

* Grumbles; refactor repeating code; add constant

* Use a single Wrapper rather than allocate a new one for each call

* Wrap --help to 120 characters rather than 100 characters
2018-01-31 09:50:52 +01:00
Tomasz Drwięga f5c68c601e Filter-out nodes.json (#7716)
* Filter-out nodes.json

* network: sort node table nodes by failure ratio

* network: fix node table tests

* network: fit node failure percentage into buckets of 5%

* network: consider number of attempts in sorting of node table

* network: fix node table grumbles
2018-01-31 09:50:01 +01:00
Dmitry Kashitsyn a412f7cca6 Removes redundant parentheses, whitelists them in generated code (#7721) 2018-01-31 09:48:37 +01:00
Tomasz Drwięga dae99cc53e Prepare for txpool release. (#7741) 2018-01-31 09:28:28 +03:00
Chase Wright afea11ede6 Reduce usd_per_tx (#7058)
* Update config.full.toml

* Update mod.rs

* Patch 1 (#1)

* Iterate over both buffered and unbuffered database entries

* Fix iterator issues

* no default uncles

* prepare cargo configuration for upload of crates

* update bigint version number

* update ethcore-bigint version

* rename hash crate to keccak-hash

* update memorydb

* update rlp

* update patricia-trie cargo.toml

* use error-chain in ethcore-network

* interleaved-ordered 0.1.1

* static linking for snappy

* removed redundant imports

* Add the desktop file for the snap

Now that we have added plugs to allow accessing the display, the snap needs
a desktop file. And bonus point, it will appear on the menu when it's
installed, and once you make a stable relase, it will appear in the gnome
software center app! So, one-click install for parity :)

Closes: #7056

* update icon for desktop

* Properly display Signer errors (Snackbar display popup) (#7053)

* Update to fixed @parity/ui (Errors component)

* Update ParityBar radius to align with Snackbar/Errors

* Update to latest @parity/ui

* Update dependencies @parity/signer-plugin-*

* Really pull in @parity/signer-plugin-* deps

* CHANGELOG for 1.7.8, 1.7.9, 1.8.2, and 1.8.3 (#7055)

* Update changelog for 1.7.8 stable

* Update changelog for 1.7.9 stable

* Improve wording in Changelog

* Update changelog for 1.8.2 beta

* Update changelog for 1.8.3 beta

* [ci skip] js-precompiled 20171115-103846

* ECIP-1039: Monetary policy rounding specification

Fix potential rounding errors between geth and parity in the long-term future.

* Change reward calculation to only use divide once

* SecretStore: servers set change session api (#6925)

* SecretStore: first key versions flush

* SecretStore: key versions in encryption session

* SecretStore: flush key versions negotiation session

* SecretStore: connected key version negotiation session to cluster

* SecretStore: cluster sessions container refactoring

* SecretStore: flush

* SecretStore: flush key versions

* SecretStore: flush

* SecretStore: delegation proto

* SecretStore: decryption_session_is_delegated_when_node_does_not_have_key_share

* SecretStore: fixed version in decryption session

* SecretStore: signing_session_is_delegated_when_node_does_not_have_key_share

* SecretStore: started restoring admin sessions

* SecretStore: restoring admin sessions

* SecretStore: removed obsolete ShareRemove && ShareMove sessions

* SecretStore: ShareAdd math tests only require old_t+1 nodes

* SecretStore: ShareAdd revamp using new math backend

* SecretStore: do not include isolated nodes into consensus_group

* SecretStore: ServersSetChange + ShareAdd revamp

* removed debug printlns

* SecretStore: key version negotiation tests

* SecretStore: removed debug/merge artifacts

* SecretStore: fixed master node selection

* SecretStore: cleanup + tests + fixes

* SecretStore: uncommented tests

* SecretStore: cleaning up

* SecretStore: cleaning up + tests

* SecretStore: cleaning up

* SecretStore: cleaning up && tests

* SecretStore: fixing TODOs

* SecretStore: fixing TODOs + cleanup

* SecretStore: fixing TODOs

* SecretStore: nodes_add_to_the_node_with_obsolete_version

* SecretStore: nodes_add_fails_when_not_enough_share_owners_are_connected

* SecretStore: tests

* SecretStore: signing && delegation tests

* SecretStore: signing && decryption tests when some nodes are isolated

* SecretStore: sessions_are_removed_when_initialization_fails

* SecretStore: ceaning up

* SecretStore: removed obsolete comments

* SecretStore: signing_session_completes_if_node_does_not_have_a_share

* SecretStore: initial ServersSetChange API

* SecretStore: added secretstore_signServersSet RPC

* SecretStore: ChangeServersSet parse tests

* SecretStore: fixes after manual ServersSetChange tests

* lost file

* fixed network ports overlap in tests

* lost files

* fix tests on patricia-trie

* updated eth-secp256k1

* Fix no-default-features.

* Parse payload from panic

Impl payload

empty str is none

Update tests

Clean

Update wasm-tests

* Allow localUrl in manifest

* Improve Github Issue Template: IT CROWD approved version.

* Remove seperator that causes issue descriptions to become headlines sometimes

* Add to all icon_url places

* Add appId as needed to local dapps

* localUrl only from manifest

* Update panic_payload.rs

* Use query-string for search parsing

* spaces to tabs.

* Add localUrl to serialization

* Make storage_read/write return nothing

* Update gas values

* Update wasm-tests

* Cleanup debug info

* Remove debug log

* Optimize & group dapp requests (#7083)

* Group similar methods in same grouping

* Add a shell_getMethodGroups API

* Small code clean changes

* Fix bug dapp.name not showing

* Additional error handling

* Store sources in own map

* Remove observable variables where not needed

* Refactor code and fix bug dapp not showing on approve

* [ci skip] js-precompiled 20171121-150329

* Remove unused and duplicated files in js-old (#7082)

* Cleanup v1 build process, application-only

* Remove built-in dapps from build (duplicated)

* User @parity/api instead of local version

* Update references to @parity/abi

* Remove unused js-old api/abi folders

* Remove duplicated v1 jsonrpc

* Cleanup unused routes

* Update manifest with wallet image

* Update wallet logo

* Re-add missing test.sh

* Update rpc mocks

* Update tests for Providers

* Use flex for iframe & status

* Additional cleanups (Home screen for embed)

* Keep statusbar fixed (and non-overallping with dapps)

* [ci skip] js-precompiled 20171121-164807

* Cleanup top bar, add Home icon for navigation (#7118)

* Localise images to config.js file

* Remove sample status plugin (commented)

* Update image references from config

* Remove Unknown capability & Capable (only display actions)

* Update to @parity/ui 2.2.14

* Add Home icon on statusbar (go back)

* 2.2.14 -> 2.2.x

* Builtin dapp icons where dappreg not available

* [ci skip] js-precompiled 20171122-140247

* fixed RotatingLogger after migrating to new arrayvec

* Update packages, pull in compiled-only repos (#7125)

* Update packages, pull in compiled-only repos

* Update js-precompiled to point to js-dist-paritytech

* Trigger both js & js-old builds to force update

* Update to bring scripts 100% in-sync

* Fixed build && test (#7128)

* fixed build && test

* fixed rpc tests

* Update js-precompiled ref, trigger JS build

* Add test for ECIP1017 at block 250000000

* Wrong era used in ECIP1017 test

It is era 49, and should correspond to ECIP1017/ECIP1039's era 50.

* [ci skip] js-precompiled 20171124-124119

* Push to correct shell branch (#7135)

* Push to correct shell branch

* Trigger both js & js-old builds

* [ci skip] js-precompiled 20171124-134823

* pwasm-run-test utility

* WASM Remove blockhash error (#7121)

* Remove blockhash error

* Update tests.

* Pull in new dapp-{methods,visible} dapps (#7150)

* [ci skip] js-precompiled 20171128-091552

* fixes typo in user config path (#7159)

* Cleanup JS build artifacts (#7164)

* Cleanup JS build artifacts

* Trigger js & js-old

* [ci skip] js-precompiled 20171129-135441

* Use git flag to remove old js artifacts (#7165)

* [ci skip] js-precompiled 20171129-144917

* Remove *.css.map & *.js.map (#7168)

* [ci skip] js-precompiled 20171129-172021

* Delete unused package.json (dist) (#7173)

* [ci skip] js-precompiled 20171130-103432

* Assorted improvements for ethstore and ethkey (#6961)

* Testing many passwords for presale wallet.

* Add multiple threads.

* WiP: ethkey brain wallets recover.

* Refactor pre-sale-wallet cracking.

* Generate in multiple threads. Brain with prefix.

* Validate bain wallet phrase.

* Brain wallet recovery.

* Self-review fixes.

* Fix tests.

* More docs.

* Bump versions.

* Remove cmd_find from borked merge.

* Update wasm submodules.

* Use threadpool.

* upper limit is gas limit * 10 in estimate gas

* React 16 (#7174)

* Update packages to use React 16

* Rollback to react-router v3

* Use component instead of pure one

* Remove warning about mobx

* Make webpack load css from @parity/ui

* Update enzyme to support react16

* Fix lint

* Use @parity/ui v3

* Update refs of plugin-signer-* deps

* Exclude plugin-signer-* from babel processing

* Reupdate refs to old method

* Update refs again

* [ci skip] js-precompiled 20171201-114538

* pwasm-run-test utility upgrade

* Removed ethcore-util dependency from ethcore-network (#7180)

* Removed ethcore-util dependency

* Removed snappy

* New account selector UI in top bar (#7179)

* Add a dropdown popup for account selector

* Install sui latest version for hideOnScroll bug fix

* Update ui

* Update package-lock after rebase

* Require parity/ui v3.0.3

* Pass accountStore as props

* Require parity/ui v3.0.4

* [ci skip] js-precompiled 20171204-115345

* Update mocha import stubs (#7191)

* Update mocha import stubs

* Add .md files to ignore list

* [ci skip] js-precompiled 20171205-084709

* Update FirstRun for UI-2 (#7195)

* WIP

* Update after @parity/ui update

* Update to latest

* Update semver for @parity

* Update & -> &amp;

* [ci skip] js-precompiled 20171205-102703

* Maximum uncle count transition (#7196)

* Enable delayed maximum_uncle_count activation.

* Fix tests.

* Defer kovan HF.

* mistake comment in calc difficulty (#7154)

* Send each log as a separate notifications. (#7175)

* Update config.full.toml

* Revert "Patch 1 (#1)" (#2)

This reverts commit 2fa0af6392f75cf9f7dd5f8250906e3767da8a5b.

* Update usd_per_tx test

* Fix tests

* Fix initial_minimum
2018-01-30 16:10:12 +01:00
Kirill Pimenov bc8216a82c More visible download link in README.md (#7707) 2018-01-28 09:17:58 +01:00
Afri Schoedon f0d9d3c4d2
Update CHANGELOG.md 2018-01-26 13:10:05 +01:00
fabiangmpf 326de9b535
Update SECURITY.md 2018-01-25 18:53:32 +01:00
Afri Schoedon 983c29dab1
Changelog for 1.9.0 (#7664)
* Move 1.8 changelog to docs/

* Add EOL notices for 0.9-1.7

* Add changelog for 1.8.7 stable

* Prepare changelog for 1.9.0 beta

* Update changelog for 1.9 beta

* Update changelog for 1.9 beta

* Fix typos in changelog

* Add changelog for 1.7.13

* Update CHANGELOGs for 1.9, 1.8, 1.7

* Update readme for 1.9

* Update CHANGELOG for 1.9
2018-01-25 16:39:01 +01:00
Afri Schoedon 73327d011d
Update Info.plist 2018-01-23 22:36:45 +01:00
Amaury Martiny 6d60286bf6 Add when when too many accounts (#7677) 2018-01-23 16:34:02 +01:00
Denis S. Soldatov aka General-Beck 66322c769e
remove cargo cache 2018-01-23 14:42:02 +03:00
Denis S. Soldatov aka General-Beck 9ab0b67bdf
small corrections in queue of checks 2018-01-23 05:04:28 +03:00
Denis S. Soldatov aka General-Beck 8d3843f7dc
Update .gitlab-ci.yml
enable cache for cargo
2018-01-23 04:59:40 +03:00
Tomasz Drwięga 99dbc68276 Light client RPCs (#7603)
* Implement registrar.

* Implement eth_getCode

* Don't wait for providers.

* Don't wait for providers.

* Fix linting and wasm tests.
2018-01-22 11:27:23 +01:00
Svyatoslav Nikolsky d4861f0a29 SecretStore: return HTTP 403 if consensus is unreachable (#7656) 2018-01-22 10:05:30 +01:00
Denis S. Soldatov aka General-Beck a39437ac5a
Update gitlab-test.sh
remove Always test on master, because js-release is always carried out and we receive [ci-skip]
2018-01-21 13:53:40 +03:00
GitLab Build Bot 3acb9d9f4e [ci skip] js-precompiled 20180120-201352 2018-01-20 20:15:03 +00:00
Marek Kotewicz 51ef70922e
Moved panick_hook to util/panic_hook (#7629) 2018-01-20 20:28:25 +01:00
GitLab Build Bot d31cfd3c64 [ci skip] js-precompiled 20180119-174947 2018-01-19 17:51:02 +00:00
Yurii Rashkovskii 18f555464e Problem: AttachedProtocols don't get registered (#7610)
I was investigating issues I am having with Whisper support. I've
enabled Whisper on a custom test network and inserted traces into
Whisper handler implementation (Network<T> and NetworkProtocolHandler
for Network<T>) and I noticed that the handler was never invoked.

After further research on this matter, I found out that
AttachedProtocol's register function does nothing:
https://github.com/paritytech/parity/blob/master/sync/src/api.rs#L172
but there was an implementation originally:
99075ad#diff-5212acb6bcea60e9804ba7b50f6fe6ec and it did the actual
expected logic of registering the protocol in the NetworkService.

However, as of 16d84f8#diff-5212acb6bcea60e9804ba7b50f6fe6ec ("finished
removing ipc") this implementation is gone and only the no-op function
is left.

Which leads me to a conclusion that in fact Whisper's handler never gets
registered in the service and therefore two nodes won't communicate
using it.

Solution: Resurrect original non-empty `AttachedProtocols.register`
implementation

Resolves #7566
2018-01-19 17:33:49 +01:00
Marek Kotewicz f43e355254
Replace RandomTempDir with tempdir::Tempdir (#7624)
* Remove GuardedTempResult

* Remove RandomTempPath

* ethcore does not depend on devtools
2018-01-19 17:32:53 +01:00
GitLab Build Bot 5859db59c8 [ci skip] js-precompiled 20180119-145350 2018-01-19 14:55:15 +00:00
Marek Kotewicz b535bf390c
Moved TestSocket to ethcore-network (#7633) 2018-01-19 14:41:34 +01:00
André Silva 2af4bd195f Improve handling of RocksDB corruption (#7630)
* kvdb-rocksdb: update rust-rocksdb version

* kvdb-rocksdb: mark corruptions and attempt repair on db open

* kvdb-rocksdb: better corruption detection on open

* kvdb-rocksdb: add corruption_file_name const

* kvdb-rocksdb: rename mark_corruption to check_for_corruption
2018-01-19 14:33:38 +01:00
Marek Kotewicz 6bebb9e74a
Moved StopGaurd to it's own crate (#7635) 2018-01-19 13:46:31 +01:00
Marek Kotewicz d430e7f4e2
Updated dependencies (#7628)
* Updated few dependencies

* Updated parking_lot to 0.5

* Updated backtrace to 0.3.5

* Updated crossbeam to 0.3
2018-01-19 13:46:11 +01:00
GitLab Build Bot b6791977b3 [ci skip] js-precompiled 20180119-112209 2018-01-19 11:23:20 +00:00
Jaco Greeff 9d972cde98
Update references to dapp sources (#7634)
* Update plugin references

* Update dapp references

* Update console references
2018-01-19 11:39:29 +01:00
GitLab Build Bot 7513949035 [ci skip] js-precompiled 20180119-103509 2018-01-19 10:36:32 +00:00
Tomasz Drwięga ad44855a1b Fix Temporarily Invalid blocks handling (#7613)
* Handle temporarily invalid blocks in sync.

* Fix tests.
2018-01-19 10:38:59 +01:00
Tomasz Drwięga 58645d3908 Hardening of CSP (#7621) 2018-01-19 10:38:00 +01:00
GitLab Build Bot f8bf7e7d41 [ci skip] js-precompiled 20180118-182530 2018-01-18 18:26:57 +00:00
Robert Habermeier 2c426defd9
remove check_hangup hack now that is_canceled exists (#7620) 2018-01-18 18:19:04 +01:00
Marek Kotewicz e5c131e0c1 removed old, unused build.rs (#7614) 2018-01-18 17:45:39 +01:00
Jaco Greeff d2e44cf1d0
Update tokenreg (#7618)
* Update tokenreg

* Add commit hash
2018-01-18 15:38:38 +01:00
GitLab Build Bot afae8e8f6e [ci skip] js-precompiled 20180118-122152 2018-01-18 12:23:19 +00:00
Marek Kotewicz f7012af92e Use rustc-hex instead of rustc-serialize in bloomchain tests (#7616) 2018-01-18 14:37:10 +03:00
GitLab Build Bot 5990c64e31 [ci skip] js-precompiled 20180118-112917 2018-01-18 11:30:46 +00:00
Guanqun Lu bfbe471a1a broken link in CHANGELOG (#7600)
Happen to note that the link is wrong, a typo here.
2018-01-18 11:41:03 +01:00
GitLab Build Bot b442b72c9d [ci skip] js-precompiled 20180118-102003 2018-01-18 10:21:34 +00:00
Tomasz Drwięga 709fbff067 Std-json format for VM traces (#7262)
* Std-json logging.

* fixed merge with master
2018-01-18 10:32:22 +01:00
GitLab Build Bot 30737fe580 [ci skip] js-precompiled 20180117-222359 2018-01-17 22:25:17 +00:00
Marek Kotewicz 0c01db4a49
separated ethcore_migrations from ethcore (#7586)
* separated ethcore_migrations from ethcore

* fixed authorship nitpick

* make ethcore_migrations related exports and imports more consistent
2018-01-17 22:11:13 +01:00
GitLab Build Bot d429ce1849 [ci skip] js-precompiled 20180117-165329 2018-01-17 16:55:42 +00:00
Afri Schoedon 6773e88211 Fix libssl1.1 package name for debian (#7596) 2018-01-17 19:06:54 +03:00
GitLab Build Bot 793624b08c [ci skip] js-precompiled 20180117-124844 2018-01-17 12:50:05 +00:00
Afri Schoedon 9083bec090 Add codecov badge (#7593)
* Add codecov badge

* Update cov.sh

remove coverall.io
2018-01-17 14:59:22 +03:00
GitLab Build Bot df200d4284 [ci skip] js-precompiled 20180117-113819 2018-01-17 11:39:36 +00:00
Marek Kotewicz 9adee532a0
bump some of our core dependencies (#7563)
* updated ethereum-types and tiny-keccak

* Updated several deps

* Updated several more dependencies

* Modify dummy file to trigger ci

* fixed update of memmap to 0.6 in ethash crate

* Fixed fetch after update to latest reqwest

* Updated jsonrpc-core with fixes for serde

* add expects in util/version/build.rs
2018-01-17 11:45:29 +01:00
Marek Kotewicz 7d49dd4727
Fixed delegatecall's from/to (#7568)
* Fixed delegatecall's from/to, closes #7166

* added tests for delegatecall traces, #7167
2018-01-17 10:44:11 +01:00
Marek Kotewicz 25b19835e3 Migration tests moved to a separate directory (#7582) 2018-01-17 10:36:40 +01:00
Marek Kotewicz ee1da09996
Network tests moved to a tests directory (#7583) 2018-01-17 10:36:12 +01:00
Marek Kotewicz 36ba004c29
removed redundant ethcore/basic_types.rs (#7584) 2018-01-17 10:35:43 +01:00
Alexey 534692cdae [Wasm] memcmp fix and test added (#7590)
* [Wasm] memcmp fix and test added

* [Wasm] use reqrep_test! macro for memcmp test
2018-01-17 13:13:17 +04:00
Robert Habermeier c7aed335ce update back-references more aggressively after answering from cache (#7578) 2018-01-17 09:45:36 +01:00
GitLab Build Bot 7aeb6c5b5f [ci skip] js-precompiled 20180117-080716 2018-01-17 08:08:35 +00:00
Denis S. Soldatov aka General-Beck 9fe61dd529
Update .gitlab-ci.yml
fix cache key
2018-01-17 10:12:02 +03:00
Denis S. Soldatov aka General-Beck 0510cb3aa1
fix gitlab.yml lint 2018-01-17 10:01:49 +03:00
GitLab Build Bot 0d7e7f0ab8 [ci skip] js-precompiled 20180116-220117 2018-01-16 22:02:35 +00:00
Denis S. Soldatov aka General-Beck c46887e90b
add codecov 2018-01-17 00:14:38 +03:00
Denis S. Soldatov aka General-Beck 12ebd901a5
Merge remote-tracking branch 'origin/master' 2018-01-16 20:31:45 +03:00
Denis S. Soldatov aka General-Beck 2ac2fbdf89 add ethkey & parity-evm todarwin pkg
+new ststus icons
mac/Parity Ethereum.xcodeproj/project.pbxproj
mac/Parity/AppDelegate.swift
mac/Parity/Assets.xcassets/statusIcon.imageset/Parity-1.png
mac/Parity/Assets.xcassets/statusIcon.imageset/Parity-2.png
mac/Parity/Assets.xcassets/statusIcon.imageset/Parity.png
mac/Parity/GetBSDProcessList.swift
mac/install-readme.txt
mac/uninstall-parity.sh
scripts/gitlab-build.sh
2018-01-16 20:30:28 +03:00
GitLab Build Bot a2d1e046a5 [ci skip] js-precompiled 20180116-132804 2018-01-16 13:29:21 +00:00
Jaco Greeff 62939fd5a0
Trigger js-precompiled (#7579) 2018-01-16 13:35:28 +01:00
Svyatoslav Nikolsky 04b571b742 SecretStore: threshold decrease PoC (#7562) 2018-01-16 12:58:41 +01:00
GitLab Build Bot 594716dc1e [ci skip] js-precompiled 20180115-172705 2018-01-15 17:28:27 +00:00
Kirill Pimenov 9578df2abe Rust change detections should do inverse grep (#7564) 2018-01-15 17:25:49 +01:00
GitLab Build Bot 43358cc6bd [ci skip] js-precompiled 20180115-153732 2018-01-15 15:38:56 +00:00
Alexey d927320719 [WASM] mem_cmp added to the Wasm runtime (#7539)
* mem_cmp added to the Wasm runtime

* schedule.wasm.mem_copy to schedule.wasm.mem_cmp for mem_cmp
2018-01-15 18:24:24 +04:00
GitLab Build Bot ad14e656f6 [ci skip] js-precompiled 20180115-060914 2018-01-15 06:10:33 +00:00
Denis S. Soldatov aka General-Beck 24a40af5bc
fix windows and centos builds (#7559)
* fix windows and centos builds
update gitlab-build.sh
windows installer `parity_$VER_installer.exe`
rpm package `parity_$VER_x86_64.rpm`

* Update .gitlab-ci.yml

add cache ``target``
fix windows and centos arg's

* Update installer.nsi

add ``ethstore.exe, ethkey.exe and parity-evm.exe`` to windows installer

* Update cov.sh

add timeout to coverage test's (10 min per test)
2018-01-15 08:20:04 +03:00
GitLab Build Bot b7266e7829 [ci skip] js-precompiled 20180115-051727 2018-01-15 05:18:52 +00:00
Denis S. Soldatov aka General-Beck 6dcf3618d5
Always run on master (#7557)
* Always build everything if we're on master

* Skip if zero foles have changed, not other way around

* Update test.js

* Update test.js

* Update gitlab-test.sh

* Update gitlab-test.sh

* Update gitlab-test.sh

* Update gitlab-test.sh

* Update gitlab-test.sh
2018-01-15 07:31:06 +03:00
GitLab Build Bot da62cfd111 [ci skip] js-precompiled 20180114-230435 2018-01-14 23:05:57 +00:00
Marek Kotewicz 668d910c44
bloom refactor (#7475)
* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor finished

* cleanup bloom mess

* simplify usage of Bloom in few places

* removed obsolete util/src/lib.rs

* removed commented out code

* ethereum-types 0.1.4

* updated ethereum-types and tiny-keccak
2018-01-14 22:43:28 +01:00
GitLab Build Bot e7f36665bb [ci skip] js-precompiled 20180113-020751 2018-01-13 02:09:53 +00:00
Jaco Greeff b6e61f403c
Trigger js-precompiled (#7546) 2018-01-12 13:15:12 +01:00
Denis S. Soldatov aka General-Beck f7f718b30f
test conditions in js-release 2018-01-12 13:45:49 +03:00
Jaco Greeff bc942e896e
Trigger js-precompiled (#7544) 2018-01-12 09:59:06 +01:00
Tomasz Drwięga f044b61f42 Extract some parts of miner from ethcore. (#7353)
* Move miner away from ethcore.

* Fix ethcore to use miner/transaction.

* Fix tests and warnings.

* fixed incorrect merge of the test in the documentation
2018-01-11 17:49:10 +01:00
Pierre Krieger 9a12945304 Statically link the C runtime on Windows (#7246) 2018-01-11 15:41:22 +01:00
Jaco Greeff bf2a925333
Trigger js-precompiled (#7534) 2018-01-11 12:13:33 +01:00
Marek Kotewicz cfc2a240c4 bump to 1.10.0 (#7507)
* bump to 1.10.0

* update version of version crate

* bump Cargo.lock
2018-01-11 09:58:37 +01:00
Denis S. Soldatov aka General-Beck 436f09d5a5 fix darwin build
Parity.png should be 512x512
fix ethstore

Signed-off-by: Denis S. Soldatov aka General-Beck <general.beck@gmail.com>
2018-01-11 07:54:42 +03:00
Jef 90b187a837 Fix benches (#7521) 2018-01-10 22:19:03 +01:00
André Silva 40551b8ffd Add `personal_sign` and `personal_ecRecover` RPC methods (#7453)
* rpc: implement personal_sign

* rpc: add test for personal_sign

* rpc: implement personal_ecRecover

* rpc: add test for personal_ecRecover

* rpc: fix order of arguments in personal_sign

* rpc: remove auxiliary methods for sign and ec_recover
2018-01-10 21:44:10 +01:00
Svyatoslav Nikolsky 73f5cc57be fixed warning (#7519) 2018-01-10 19:56:02 +01:00
Marek Kotewicz e95b093483 dissolve util (#7460)
* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor in progress

* ethereum-types refactor finished

* removed obsolete util/src/lib.rs

* removed commented out code
2018-01-10 15:35:18 +03:00
Jaco Greeff 4a4d64be56
Trigger js-precompiled (#7517) 2018-01-10 11:48:30 +01:00
Svyatoslav Nikolsky d360074323 SecretStore: do not send init if session has finished/failed instantly (#7397) 2018-01-10 11:35:23 +01:00
tzapu df5d27d516 added a new RPC call trace_replayBlockTransactions (#7366)
* intial add trace_replayBlockTransactions

* cleanup timing calls
add execution proof

* WIP implementing changes

* fix for trace_replayBlockTransactions rpc call

* cleanup comments

* cleanup, proof,
can't workout lifetime issues yet

* Fix lifetimes issue.

* naive rpc test

* updated docs
2018-01-10 11:34:34 +01:00
Svyatoslav Nikolsky b685b7fae3 SecretStore: tx retry pattern (#7323)
* SecretStore: auto migrate initial commit

* SecretStore: flush automigrate

* SecretStore: debug flush

* SecretStore: added migration to KeyServerSet contract

* SecretStore: flush automigrate

* SecretStore: flush before testing

* SecretStore: flush

* SecretStore: flush

* SecretStore: bunch of tests for simple ConnectionTrigger && KeyServerSet

* SecretStore: started work on TriggerWithMigration tests

* SecretStore: maintain_session tests

* SecretStore: updated some comments

* SecretStore pass migration_id to ServerSetChangeSession

* SecretStore: fixed lock scope

* SecretStore: fixed error response condition

* SecretStore: fixed ServerSetChange session auto-creation

* SecretStore: update active migration in connector

* removed commented code

* SecretStore: fixed tests compilation

* SecretStore: marked test-related unimplemented-s

* SecretStore: labeled all SS TODOs

* SecretStore: do not read auto-migration stuff when auto-migration is disabled + stripped KeyServerSet contract ABI

* SecretStore: ignore duplicated addresses in KeyServerSet

* fied compilation

* SecretStore: wait for N block confirmations before starting auto-migration

* SecretStore: more tests for migration delay

* SecretStore: clear current nodes set when KSS contract is uninstalled

* SecretStore: retry transaction interval
2018-01-10 11:33:45 +01:00
André Silva 7e0928b8a2 kvdb: update rust-rocksdb version (#7511) 2018-01-10 11:23:29 +01:00
Denis S. Soldatov aka General-Beck fff6e037ab clean .gitlab.yml and 2 scripts for test and build: gitlab-build.sh & gitlab-test.sh 2018-01-10 11:44:36 +03:00
Denis S. Soldatov aka General-Beck 0b91bd4b11 fix conditions 2018-01-10 07:33:46 +03:00
Denis S. Soldatov aka General-Beck cb8c4b4e96 add gitlab-test.sh
move functions from .yml to add gitlab-test.sh
2018-01-10 06:38:50 +03:00
Denis S. Soldatov aka General-Beck f400a7e171 .gitlab-ci cleanup
Resolves issue #4226 #7086 ci #63 close PR #7506
2018-01-10 05:58:12 +03:00
Afri Schoedon 0bdb5d1ca9
Changelog for 1.8.6 (#7440)
* Update CHANGELOG for 1.8.6

* Linkify issues.

* Add Changelog for 1.7.12

* Update Changelog for 1.7.12

* Update Changelog for 1.8.6

* Update Changelog for 1.7.12

* Update Changelog for 1.8.6

* Update CHANGELOG for 1.8.6
2018-01-10 00:11:13 +01:00
Amaury Martiny c2136f7976 Update js-api (#7509) 2018-01-09 17:12:32 +01:00
Tomasz Drwięga e4bd4ed060 Use sync wrapper instead of Mutex (#7456) 2018-01-09 16:10:39 +01:00
Tomasz Drwięga 69d7c4f519 Expose default gas price percentile configuration in CLI (#7497)
* Expose gas price percentile.

* Fix light eth_call.

* fix gas_price in light client
2018-01-09 12:43:36 +01:00
Fabian 1e8533acbc
Update README.md 2018-01-09 12:21:24 +01:00
Jay Little ab7335d21d Use https connection (#7503)
Use https when connecting to etherscan.io API for price-info
2018-01-09 12:17:01 +01:00
Kirill Pimenov bdc3d6fee0 More thorough changes detection (#7472)
* More thorough changes detection

This basically trades false-negatives ("dumb" last commit not touching
Rust on a Rust-touching branch) for false-positives (all builds against
`stable` and `beta` will run all tests almost always).
This seems to be a reasonable tradeoff.

Closes #6507

* We don't have Appveyor anymore

* before_script sections are not merged

* Limiting commit depth breaks branching detection
2018-01-08 21:23:56 +03:00
GitLab Build Bot 4c22ca2721 [ci skip] js-precompiled 20180108-171712 2018-01-08 17:18:32 +00:00
Amaury Martiny 825a962323 Fix small layout issues (#7500)
* Fix layout bug

* Change position of red signing label
2018-01-08 17:43:55 +01:00
GitLab Build Bot 9c88e755e2 [ci skip] js-precompiled 20180108-160030 2018-01-08 16:02:07 +00:00
Amaury Martiny c6b0db61e7 Show all accounts on Topbar (#7498)
* Show all accounts in the top bar

* Update to latest js-shared

* Add comments

* Update refs and remove dapp-dapp-accounts
2018-01-08 16:21:52 +01:00
Afri Schoedon a553485bbd
Update Parity Mainnet Bootnodes (#7476)
* Update Parity Mainnet Bootnodes

* Replace the Azure HDD bootnodes with the new ones :)
2018-01-08 15:06:08 +01:00
Marek Kotewicz 7316cb9d92 fixed panic when io is not available for export block, closes #7486 (#7495) 2018-01-08 14:46:29 +01:00
Tomasz Drwięga 33b8f28f62 Advance AuRa step as far as we can and prevent invalid blocks. (#7451)
* Advance AuRa step as far as we can.

* Wait for future blocks.
2018-01-08 14:46:11 +01:00
GitLab Build Bot 47b2b151ce [ci skip] js-precompiled 20180108-085319 2018-01-08 08:54:35 +00:00
Amaury Martiny a52d601f5c Update package-lock in js-old (#7494)
* Revert to latest package-lock for js-old

* Update package-lock after npm i
2018-01-08 09:45:07 +01:00
GitLab Build Bot fc6b1cb4b9 [ci skip] js-precompiled 20180108-084013 2018-01-08 08:41:21 +00:00
Afri Schoedon ef3cd042fb
Update issue template and readme (#7450)
* Ask about used network in issue template

* Update Riot-References

* Uppercase Parity
2018-01-08 09:24:49 +01:00
Jaco Greeff 23192e490e Revert package-lock.jsons to prior rm -rf (#7492) 2018-01-08 09:23:28 +01:00
Jaco Greeff c37a87e490
Explicit checkout (#7474) 2018-01-05 17:00:28 +01:00
Jaco Greeff 7e6e024546 Trigger js-precompiled (#7473) 2018-01-05 16:18:20 +01:00
Afri Schoedon 36e230ee16
Expanse Byzantium update w/ correct metropolis difficulty increment divisor (#7463)
* Byzantium Update for Expanse

Here the changes go. Hope I didnt miss anything.

* expip2 changes - update duration limit

* Fix missing EXPIP-2 fields

* Format numbers as hex

* Fix compilation errors

* Group expanse chain spec fields together

* Set metropolisDifficultyIncrementDivisor for Expanse

* Revert #7437

* Add Expanse block 900_000 hash checkpoint
2018-01-05 13:49:07 +01:00
Arkadiy Paronyan c8ad8aeac4 Updated icons (#7469) 2018-01-05 13:44:05 +01:00
Jaco Greeff 71da3af1a2
Cleanup certifications (#7454)
* Cleanup certifications

* Add key for accounts
2018-01-05 13:26:43 +01:00
Jaco Greeff ce69c4e6ea
Fix css lint (updated stylelint) (#7471) 2018-01-05 12:48:35 +01:00
Jaco Greeff 855c1126a4 Upgrade markdown-loader & marked (#7467)
* Upgrade markdown-loader & marked

* Align UglifyJS (wallet/shell)

* Add ethereumjs-util Babel compilation
2018-01-05 10:59:35 +01:00
Jaco Greeff ac95bfa285
Remove test for removed code (#7461) 2018-01-04 18:04:59 +01:00
Jaco Greeff 37796bdaa9
Pull in dapp-status (#7457)
* Remove status from tabs

* Update js-shared, add dapp-status
2018-01-04 17:05:10 +01:00
Afri Schoedon 36bb5ed795
Bump openssl crate (#7455) 2018-01-04 16:12:12 +01:00
Jaco Greeff c417f01a23
Signer updates from global Redux state (#7452)
* Remove unused layout

* Update to use pending from Redux

* Update @parity/shared
2018-01-04 13:13:15 +01:00
GitLab Build Bot 1d0af99744 [ci skip] js-precompiled 20180103-161510 2018-01-03 16:16:20 +00:00
Marek Kotewicz 75f292154d
Merge pull request #7437 from paritytech/a5-chains-expanse
Remove expanse chain
2018-01-03 16:12:39 +01:00
GitLab Build Bot 1764143db5 [ci skip] js-precompiled 20180103-144059 2018-01-03 14:42:11 +00:00
Jaco Greeff 7c1cbd33ff
Store tokens with repeatable id (#7435) 2018-01-03 15:25:45 +01:00
5chdn 5e4febfc2d
Fix tests 2018-01-03 15:14:49 +01:00
5chdn 0292348bd6
Remove all EXP references from old wallet 2018-01-03 13:28:03 +01:00
5chdn 27d8befbad
Remove expanse from available chains 2018-01-03 13:24:27 +01:00
Marek Kotewicz 51319ebe3f
Merge pull request #7433 from paritytech/td-strict-config
Strict config parsing
2018-01-03 12:27:17 +01:00
GitLab Build Bot 7643e0e17f [ci skip] js-precompiled 20180103-105415 2018-01-03 10:55:33 +00:00
Tomasz Drwięga 56311cf0b5
Merge branch 'master' into td-strict-config 2018-01-03 11:07:08 +01:00
Tomasz Drwięga e439eae54f
Enable strict config parsing. 2018-01-03 11:05:53 +01:00
André Silva e114b0b28d Upgrade to RocksDB 5.8.8 and tune settings to reduce space amplification (#7348)
* kvdb-rocksdb: update to RocksDB 5.8.8

* kvdb-rocksdb: tune RocksDB options

* Switch to level-style compaction
* Increase default block size (16K), and use bigger blocks for HDDs (64K)
* Increase default file size base (64MB SSDs, 256MB HDDs)
* Create a single block cache shared across all column families
* Tune compaction settings using RocksDB helper functions, taking into account
  memory budget spread across all columns
* Configure backgrounds jobs based on the number of CPUs
* Set some default recommended settings

* ethcore: remove unused config blockchain.db_cache_size

* parity: increase default value for db_cache_size

* kvdb-rocksdb: enable compression on all levels

* kvdb-rocksdb: set global db_write_bufer_size

* kvdb-rocksdb: reduce db_write_bufer_size to force earlier flushing

* kvdb-rocksdb: use master branch for rust-rocksdb dependency
2018-01-03 11:00:37 +01:00
Jaco Greeff 8405edab41
Fix status layout (#7432) 2018-01-03 10:49:52 +01:00
Marek Kotewicz 6a01113610
Merge pull request #7412 from paritytech/td-trace-failed-calls
Fix tracing failed calls.
2018-01-02 15:43:33 +01:00
Marek Kotewicz 4ce643ba3f
Merge pull request #7421 from poanetwork/whisper-relay
Problem: sending any Whisper message fails
2018-01-02 14:25:37 +01:00
Marek Kotewicz f3e7d94fc4
Merge pull request #7368 from paritytech/td-future-blocks
Wait for future blocks in AuRa
2018-01-02 14:21:50 +01:00
Marek Kotewicz 8cd1f890ca
Merge pull request #7426 from paritytech/td-fix-final
Fix final feature.
2018-01-02 14:09:18 +01:00
Marek Kotewicz 7deeb26e21
Merge pull request #7425 from paritytech/td-state-lock
Use RwLock for state DB
2018-01-02 11:57:29 +01:00
Tomasz Drwięga 457d8baf30
Fix final feature. 2018-01-02 11:02:04 +01:00
GitLab Build Bot 9d33f6f29a [ci skip] js-precompiled 20180102-090245 2018-01-02 09:04:01 +00:00
Tomasz Drwięga 823e0a22ca
Merge branch 'master' into td-state-lock 2018-01-02 09:55:53 +01:00
Amaury Martiny bc91eaf4d0 Update branding on UI (#7370)
* Update packages

* Update pictures for v1
2018-01-02 09:48:41 +01:00
Tomasz Drwięga c6aea0cae6
Move StateDB to RwLock 2018-01-02 09:43:08 +01:00
Yurii Rashkovskii 9c0fceb192
Problem: sending any Whisper message fails
The error is "PoW too low to compete with other messages"

This has been previously reported in #7144

Solution: prevent the move semantics

The source of the error is in PoolHandle.relay
implementation for NetPoolHandle.

Because of the move semantics, `res` variable is in fact
copied (as it implements Copy) into the closure and for
that reason, the returned result is always `false.
2018-01-01 20:54:15 -08:00
Afri Schoedon 51e6e0b4bd
Changelog for 1.8.5 and 1.7.11 (#7401)
* Add Changelog for 1.7.11

* Add Changelog for 1.8.5

* Markdownify issue links
2017-12-30 01:57:44 +01:00
Tomasz Drwięga 67a74e155d
Fix tracing failed calls. 2017-12-29 18:11:55 +01:00
Marek Kotewicz 2586eaef92
Merge pull request #7359 from VladLupashevskyi/transactions-permission-contract-fix
Added checking tx-type using transactions permission contract for miners
2017-12-29 11:46:10 +01:00
Marek Kotewicz 5fee880fbb
Merge pull request #7409 from paritytech/dircrate2
standalone dir crate, replaces #7383
2017-12-29 11:44:26 +01:00
Marek Kotewicz 483480d7a1
Merge pull request #7336 from paritytech/secretstore_rpc_sign_raw_hash
SecretStore: secretstore_signRawHash method
2017-12-29 11:10:29 +01:00
debris 7b40f1cfe9 Merge branch 'master' into dircrate2 2017-12-29 10:45:11 +01:00
Marek Kotewicz 81d4187d14
Merge pull request #7331 from paritytech/secretstore_resurrect_error404
SecretStore: return error 404 when there's no key shares for given key on all nodes
2017-12-29 05:33:47 -04:00
Marek Kotewicz f8bd6b9f63
Merge pull request #7101 from paritytech/secretstore_kovan
SecretStore: Kovan integration initial version
2017-12-29 05:31:51 -04:00
Tomasz Drwięga 48a15cecf8
Update bootnodes (#7363)
* Updating mainnet bootnodes.

* Add additional parity-beta bootnodes.

* Restore old parity bootnodes and update foudation bootnodes
2017-12-28 15:12:19 +01:00
Nicolas Ochem 09573497b0 move constants to platform-specific module too 2017-12-28 03:16:52 -08:00
Vlad Lupashevskyi 45116099c5 Merge remote-tracking branch 'remotes/upstream/master' into transactions-permission-contract-fix 2017-12-28 12:56:21 +02:00
Tomasz Drwięga 26e4fc680c Fix default CORS settings. (#7387)
* Fix default CORS settings.

* Add info regarding special options.
2017-12-27 18:56:06 +01:00
Nicolas Ochem a4a9c53b13 use platform module as intended 2017-12-27 06:17:39 -08:00
Kirill Pimenov eb1bb8f5bd
Merge pull request #7390 from paritytech/td-version
Fix version
2017-12-27 13:38:03 +01:00
Svyatoslav Nikolsky fc0eb600f3 checked_sub -> saturating_sub 2017-12-27 15:21:31 +03:00
Tomasz Drwięga 5b5dd85cf9
Fix lock file. 2017-12-27 11:32:05 +01:00
Tomasz Drwięga 74d2896397
Fix version. 2017-12-27 11:02:39 +01:00
Tomasz Drwięga a15f62d907
Merge branch 'master' into td-future-blocks 2017-12-27 11:01:08 +01:00
Svyatoslav Nikolsky 2a73101fab updated doc 2017-12-27 11:44:47 +03:00
Svyatoslav Nikolsky c0e7abcc81 Merge branch 'master' into secretstore_kovan 2017-12-27 11:44:28 +03:00
Nicolas Ochem a8001ab453 Add doc everywhere, warn on missing docs 2017-12-26 00:54:34 -08:00
Nicolas Ochem 268e8f5a64 move helper functions to platform module 2017-12-26 00:54:34 -08:00
Nicolas Ochem 2e12a2db50 Fix #6209 - introduce standalone dir crate
* created the dir crate in util
* moved code from ethstore/src/dir/paths.rs to dir crate
* rename dir module in ethstore to accounts_dir to distinguish it
  from the dir crate
* changes after @tomusdrw on #6952
2017-12-26 00:54:34 -08:00
Vlad Lupashevskyi 31ffb467f5 Passing verify tx errors to the caller 2017-12-23 00:00:27 +02:00
Vlad Lupashevskyi 0d5603eece Use is_err instead of match 2017-12-22 23:14:24 +02:00
Vlad Lupashevskyi d6ae6e315e Check tx-type before importing transactions to the queue 2017-12-22 22:50:09 +02:00
Vlad Lupashevskyi 9d35cc1881 "from" replaced with ".into()" 2017-12-22 22:48:37 +02:00
Nikolay Volf 82340c058a
Wasm runtime update (#7356)
* call augmented, wasm-tests updated

* fix all call tests

* fix comments
2017-12-22 21:54:35 +03:00
Marek Kotewicz d80dd81d77
parity-version pr reopen (#7136)
* parity-version module split from util

removed unused util deps and features

trigger buildbot again

only kvdb links rocksdb

snappy linker issues

* rm snappy

* fixed old version imports
2017-12-22 09:37:39 -04:00
Marek Kotewicz 7c24d0665e
Merge pull request #7355 from paritytech/td-clippy
Get rid of clippy remainings.
2017-12-22 07:09:26 -04:00
Marek Kotewicz 6f516607a1
Merge pull request #7357 from paritytech/unwrap-or
Avoid using ok_or with allocated argument
2017-12-22 06:55:37 -04:00
Tomasz Drwięga 83447c201b Make accounts refresh time configurable. (#7345)
* Configurable accounts refresh time.

* Fix tests.
2017-12-22 06:33:49 +03:00
Nicolas Gotchac 276496fb4b Enable traces for DEV chain (#6949) (#7327) 2017-12-22 06:33:17 +03:00
Vlad Lupashevskyi 24378f3c44 Added checking tx-type using transactions permission contract for miners 2017-12-21 22:42:36 +02:00
Tomasz Drwięga d6f160e868
Don't check max. 2017-12-21 16:16:55 +01:00
Tomasz Drwięga a5a7c1827a
Some more. 2017-12-21 15:37:10 +01:00
Tomasz Drwięga 7d4e4c7a62
Mark future blocks as temporarily invalid. 2017-12-21 15:34:27 +01:00
Yurii Rashkovskii d5b81ead71 Problem: AuRa's unsafeties around step duration (#7282)
Firstly, `Step.duration_remaining` casts it to u32, unnecesarily
limiting it to 2^32. While theoretically this is "good enough" (at 3
seconds steps it provides room for a little over 400 years), it is
still a lossy way to calculate the remaining time until the next step.

Secondly, step duration might be zero, triggering division by zero
in `Step.calibrate`

Solution: rework the code around the fact that duration is
typically in single digits and never grows, hence, it can be represented
by a much narrower range (u16) and this highlights the fact that
multiplying u64 by u16 will only result in an overflow in even further
future, at which point we should panic informatively (if anybody's
still around)

Similarly, panic when it is detected that incrementing the step
counter wrapped around on the overflow of usize.

As for the division by zero, prevent it by making zero an invalid
value for step duration. This will make AuRa log the constraint
mismatch and panic (after all, what purpose would zero step duration
serve? it makes no sense within the definition of the protocol,
as finality can only be achieved as per the specification
if messages are received within the step duration, which would violate
the speed of light and other physical laws in this case).
2017-12-21 14:59:09 +01:00
Svyatoslav Nikolsky 9a5d0fed2c SecretStore: return error if http listner init has failed 2017-12-21 16:54:24 +03:00
NikVolf 516725abe4 ok_or -> ok_or_else 2017-12-21 16:50:58 +03:00
Svyatoslav Nikolsky 8d15338c84 SecretStore: removed extra-tracing 2017-12-21 16:20:34 +03:00
Svyatoslav Nikolsky 9104d4673c SecretStore: reorganize service contract read 2017-12-21 16:19:15 +03:00
Tomasz Drwięga 00883e477a
Get rid of clippy remainings. 2017-12-21 11:27:26 +01:00
Svyatoslav Nikolsky ff094e0a03 Revert "SecretStore: get rid of read_logs in ServiceContract"
This reverts commit 6efca8860a.
2017-12-21 11:44:55 +03:00
Svyatoslav Nikolsky ee1ce42546 SecretStore: extracted TasksQueue to separate file 2017-12-20 19:27:47 +03:00
Svyatoslav Nikolsky b10d567386 SecretStore: ClusterSession::wait_session helper 2017-12-20 19:11:48 +03:00
Yurii Rashkovskii ab2caee0a3 Problem: Cargo.toml file contains [project] key (#7346)
This key is not recognized by some software
(like carnix).

It is also not documented in http://doc.crates.io/manifest.html

Solution: rename this key to [package]
2017-12-20 16:41:52 +01:00
Svyatoslav Nikolsky 6efca8860a SecretStore: get rid of read_logs in ServiceContract 2017-12-20 17:22:28 +03:00
Svyatoslav Nikolsky b7a744be59 SecretStore: require N confirmations in PendingRequestsIterator 2017-12-20 17:05:32 +03:00
Svyatoslav Nikolsky d7650e2b9c SecretStore: TrustedClient 2017-12-20 16:02:21 +03:00
Svyatoslav Nikolsky 794de9f743 SecretStore: fixing grumbles (part1) 2017-12-20 14:50:46 +03:00
GitLab Build Bot 2f9532fe4b [ci skip] js-precompiled 20171220-114610 2017-12-20 11:47:16 +00:00
Jaco Greeff 2856305977
Fix broken flex modal layouts (#7343) 2017-12-20 12:36:04 +01:00
GitLab Build Bot 25a3c001ad [ci skip] js-precompiled 20171219-170319 2017-12-19 17:04:25 +00:00
Amaury Martiny 3fa7d09b5e Fix dappIcon & Fix Signer Pending (#7338)
* Move signerPending inside this repo

* Use latest version of dappIcon

* Tell babel to ignore node_modules in tests
2017-12-19 17:54:09 +01:00
GitLab Build Bot 6bc88664ce [ci skip] js-precompiled 20171219-140820 2017-12-19 14:09:23 +00:00
Svyatoslav Nikolsky 6e5c188eef SecretStore: secretstore_signRawHash RPC 2017-12-19 16:59:37 +03:00
Jaco Greeff bdd4f62023
Fix wallet token/badge icons not showing up (#7333)
* Fix wallet icons not showing up

* Fix tests

* Remove debug log (oops)
2017-12-19 14:58:30 +01:00
Marek Kotewicz 53dce9ff98
Merge pull request #7222 from ellaismer/ellaism
Add Ellaism coin in chain config
2017-12-19 09:34:21 -04:00
Marek Kotewicz ee030cdcac
Merge pull request #7296 from paritytech/a5-kovan-bootnodes
Update bootnodes
2017-12-19 09:32:36 -04:00
GitLab Build Bot 4b016672f3 [ci skip] js-precompiled 20171219-102906 2017-12-19 10:30:17 +00:00
Dmitry Kashitsyn 5f82f0008f Adds `personal_signTransaction` RPC method (#6991)
* Adds personal_signTransaction RPC method

* Fixes sign_transaction() to return RichRawTransaction

* Adds test for invalid password

* Fix after rebase
2017-12-19 10:49:49 +01:00
Tomasz Drwięga 5713bb2099 Fix embeded transport. (#7326) 2017-12-19 10:34:34 +01:00
Tomasz Drwięga 9e7f5671a5
Merge branch 'master' into a5-kovan-bootnodes 2017-12-19 10:33:35 +01:00
Tomasz Drwięga 1d9206735b
Transaction Pool re-implementation (#6994)
* Initial design and some tests.

* Insertion & limits.

* Constructing pending block.

* Change to PendingIterator.

* Removing/cancelling transactions.

* Full status.

* Culling transactions.

* Use bigint.

* Add listener tests.

* Clean up listener types.

* Split into multiple files.

* Add copyright notice.

* Documentation.

* Don't require ownership.

* Fix cull to remove from by_hash.

* Make the queue generic over transactions.

* Address code review.

* Update wasm submodules.

* Fix review grumbles.

* Add some docs.
2017-12-19 10:20:49 +01:00
Svyatoslav Nikolsky 861aa1fa4b SecretStore: return error 404 when there's no key shares for given key on all nodes 2017-12-19 11:02:13 +03:00
GitLab Build Bot 4971171e8a [ci skip] js-precompiled 20171218-132345 2017-12-18 13:24:58 +00:00
Jaco Greeff 5cb53ddd8d
UI package bump (#7318)
* Bump js-ui

* Fix css for status plugins
2017-12-18 12:53:40 +01:00
Robert Habermeier f99b977399
Merge pull request #7011 from paritytech/whisper-testing
test framework and basic test for whisper
2017-12-18 11:48:20 +01:00
GitLab Build Bot 0637de7303 [ci skip] js-precompiled 20171218-102310 2017-12-18 10:24:14 +00:00
Jaco Greeff 3fd94dc40d
CI js-precompiled trigger (#7316) 2017-12-18 11:12:36 +01:00
GitLab Build Bot a638019c17 [ci skip] js-precompiled 20171218-094355 2017-12-18 09:44:58 +00:00
Jaco Greeff 509038c987
Fix inject.js & Signer store duplication (#7299)
* Remove extension mappings

* Remove duplicated pending stores
2017-12-15 17:52:45 +01:00
Robert Habermeier 8f6f6a068e detect different node, same-key signing in aura (#7245)
* detect different node, same-key signing in aura

* reduce scope of warning
2017-12-15 16:29:23 +01:00
5chdn 4a9a0f6f55
Update kovan boot nodes 2017-12-15 15:29:48 +01:00
5chdn 0a808a1ac2
Improve chainspec formatting 2017-12-15 15:29:09 +01:00
Konstantin bb1e03e9cb new warp enodes (#7287)
* new warp enodes

* added one more warp enode; replaced spaces with tabs
2017-12-15 15:19:06 +01:00
Jaco Greeff c9865e00a5
CSS fixes for v1 (#7285)
* CSS fixes for v1 (Thanks @ngotchac)

* Remove hack line completely

* Comment around Chrome upgrade
2017-12-15 14:48:10 +01:00
Jaco Greeff 6587dfecc0
Wallet subscriptions & refresh (#7283)
* Update to @parity/api 2.1.7

* Update packages

* Update after signer API alias
2017-12-15 12:48:51 +01:00
GitLab Build Bot 9821fd92e4 [ci skip] js-precompiled 20171214-193220 2017-12-14 19:33:27 +00:00
Jaco Greeff a4959c8509
Update inject web3 dependencies (#7286)
* Remove wallet web3 dependency

* Update shell web3 dependency
2017-12-14 17:32:59 +01:00
Jaco Greeff 4d28facf5e
Some padding around dapp image (#7276) 2017-12-13 14:49:40 +01:00
Jaco Greeff 053c009cdb
Expand available middleware methods (#7275)
* Expand available methods

* Updated with expanded groupings
2017-12-13 12:02:31 +01:00
Nicolas Gotchac 82d7fc54b3 Inject parity script to all dapps // Expand dapps to any ZIP file (#7260)
* Inject Parity script to all HTML dapps pages

* Small glitch

* Add injection test

* Add Special GHH commit value for serving ZIP files as DAPPS

* Refactor GithubDapp fetcher

* PR Grumbles
2017-12-13 09:56:35 +03:00
GitLab Build Bot f3297dd44a [ci skip] js-precompiled 20171212-180737 2017-12-12 18:08:59 +00:00
Amaury Martiny 1851453f00 New Homepage (#7266)
* Purify dappCard style

* Add support for pinning apps

* Add a section to show pinned apps

* Cleaner code

* Bump dependency versions

* Small tweaks

* Avoid double scrollbars

* Small style updates

* Bump parity/shared version
2017-12-12 17:35:21 +01:00
Tomasz Drwięga c731b5ef62 Update kovan HF block number. (#7259) 2017-12-12 16:03:28 +01:00
Afri Schoedon 0a7f27cb11
CHANGELOG for 1.7.10 and 1.8.4 (#7265)
* Add Changelog for 1.7.10

* Add Changelog for 1.8.4

* Add missing links

* Fix broken link
2017-12-12 15:37:10 +01:00
GitLab Build Bot 140a78fe0b [ci skip] js-precompiled 20171212-132048 2017-12-12 13:21:48 +00:00
Jaco Greeff 777bce8a13
Remove extraneous id hashing (#7269)
* Remove extraenous id hashing

* Update with latest js-shared
2017-12-12 12:09:24 +01:00
Jaco Greeff 11b0cb8da8
Simplify status + content display (#7264) 2017-12-12 11:25:57 +01:00
GitLab Build Bot 50ed1f9d1e [ci skip] js-precompiled 20171211-175904 2017-12-11 18:00:10 +00:00
Jaco Greeff 9202ccccf7
UI redirect to 127.0.0.1 when localhost requested (#7236)
* JS redirect from localhost -> 127.0.0.1

* ui-no-validation for 127.0.0.1

* Update with tests
2017-12-11 16:50:20 +01:00
GitLab Build Bot 0fe018ff68 [ci skip] js-precompiled 20171211-130343 2017-12-11 13:04:38 +00:00
Brennan Novak b25f93dda5 usability improvements to security token Dialog #7112 (#7134) 2017-12-11 12:59:24 +01:00
Jaco Greeff 16d6f98d7c
Don't display unneeded notifications (#7237)
* Cleanup overlay transparency

* Don't display "waiting in signer" messages
2017-12-11 11:05:24 +01:00
André Silva fcddc7751a Reduce max block timestamp drift to 15 seconds (#7240)
* reduce max block timestamp drift to 15 seconds

* add test for block timestamp validation within allowed drift
2017-12-08 11:43:31 +01:00
Tomasz Drwięga 77ee23bdd0
Increase allowed time drift to 10s. (#7238) 2017-12-08 11:16:20 +01:00
Afri Schoedon a05c90abb5
Update README.md 2017-12-08 10:32:41 +01:00
Jerome de Tychey ce390fcd75 improve building from source (#7239)
Lots of people are having trouble building from source and keep up to date. The main reason seems to be that cargo/rustup is hard to work with. The 'abort' panic strategy error is very frustrating and seems to be solved 100% of time with a clean.
 Adding those lines:
 When compiling a crate if you receive this error:
```
error: the crate is compiled with the panic strategy `abort` which is incompatible with this crate's strategy of `unwind`
```
Cleaning the repository will most likely solve the issue, try:
```
cargo clean
```
2017-12-08 10:31:21 +01:00
GitLab Build Bot 92f0db7cd7 [ci skip] js-precompiled 20171207-145246 2017-12-07 14:53:50 +00:00
Amaury Martiny f6f7a87dc6 Fix/Update method permissions (#7233)
* Use hex everywhere as appId

* Extract requestGroup sub item from clarity

* Change size of icon in SignerPending
2017-12-07 15:10:54 +01:00
Robert Habermeier 3cb4d81eb1 Fix aura difficulty race (#7198)
* Fix Aura difficulty race

* fix test key

* extract out score calculation

* fix build
2017-12-07 12:17:11 +01:00
GitLab Build Bot aff781b8bb [ci skip] js-precompiled 20171206-171108 2017-12-06 17:12:14 +00:00
Svyatoslav Nikolsky 5d792324e6 Merge branch 'master' into secretstore_kovan 2017-12-06 19:56:54 +03:00
Jaco Greeff f2b51fe9e0
Dependency updates (#7226)
* Update @parity/ui

* Update deps
2017-12-06 17:29:09 +01:00
GitLab Build Bot fb0006beee [ci skip] js-precompiled 20171206-162251 2017-12-06 16:23:52 +00:00
Jaco Greeff fa6156ed01
Display all dapps (shell) & wallet tabs (v1) by default (#7213)
* Display contracts tab by default

* Update packages
2017-12-06 16:40:24 +01:00
Jaco Greeff b1517654e1
Rework dapps list (#7206)
* Rework dapps list

* Update box sizing

* Remove non-passed-in prop

* PR comments

* Re-adjust key
2017-12-06 15:47:32 +01:00
Ellaismer dd0fba96a4 Add registrar for ellaism
Provided by @5chdn
2017-12-06 22:46:19 +08:00
Robert Habermeier f61feb33fd Merge branch 'master' into whisper-testing 2017-12-06 15:23:39 +01:00
Ellaismer 2d3073fc02 Remove compatibility fields to pass chainspec test for Ellaism 2017-12-06 21:01:03 +08:00
Ellaismer fb073583fe Add ellaism in --chain helper message 2017-12-06 20:51:34 +08:00
Ellaismer fcd1f72806 Add Ellaism to SpecType 2017-12-06 20:48:32 +08:00
Ellaismer dcf6e1d83d Add basic Elliasm config 2017-12-06 20:46:24 +08:00
Afri Schoedon 76b143a758
Add contributing guidelines and code of conduct. (#7157)
* Add contributing guidelines to the repository.

* Add code of conduct to the repository.

* Add note on CLA to contributing guidelines.

* Update contribution guideline headings

* Move CoC and ConG to .github

* Fix links

* Remove broken fork link.
2017-12-06 13:15:15 +01:00
GitLab Build Bot 1b898befab [ci skip] js-precompiled 20171206-102728 2017-12-06 10:28:34 +00:00
Amaury Martiny 7d0780d723 Make Signing Requests more visible (#7204)
* Add a signerPending component with popup

* Add text when no requests

* Remove lock icon

* Fix lint

* Create separate component from RequestItem

* Render different types of transaction

* Remove blue View button

* Remove useless code
2017-12-06 10:44:50 +01:00
Tomasz Drwięga d5c21c9707 Send each log as a separate notifications. (#7175) 2017-12-05 20:14:50 +03:00
Takehiro Miyao 3284020b04 mistake comment in calc difficulty (#7154) 2017-12-05 16:06:04 +01:00
Tomasz Drwięga 7e3872fddc Maximum uncle count transition (#7196)
* Enable delayed maximum_uncle_count activation.

* Fix tests.

* Defer kovan HF.
2017-12-05 15:57:45 +01:00
GitLab Build Bot e52a7de3f7 [ci skip] js-precompiled 20171205-102703 2017-12-05 10:28:13 +00:00
Jaco Greeff 1291a24e4e
Update FirstRun for UI-2 (#7195)
* WIP

* Update after @parity/ui update

* Update to latest

* Update semver for @parity

* Update & -> &amp;
2017-12-05 10:44:34 +01:00
GitLab Build Bot e08893fcf1 [ci skip] js-precompiled 20171205-084709 2017-12-05 08:48:09 +00:00
Jaco Greeff 63d86b50e0
Update mocha import stubs (#7191)
* Update mocha import stubs

* Add .md files to ignore list
2017-12-05 09:03:30 +01:00
Robert Habermeier e85c98e09a
Merge pull request #7075 from miyao-gmo/feature/estimate_gas_limit
escape inifinite loop in estimte_gas
2017-12-04 15:29:23 +01:00
GitLab Build Bot e76cec4afc [ci skip] js-precompiled 20171204-115345 2017-12-04 11:54:51 +00:00
Amaury Martiny 83ff213f6c New account selector UI in top bar (#7179)
* Add a dropdown popup for account selector

* Install sui latest version for hideOnScroll bug fix

* Update ui

* Update package-lock after rebase

* Require parity/ui v3.0.3

* Pass accountStore as props

* Require parity/ui v3.0.4
2017-12-04 12:09:08 +01:00
Arkadiy Paronyan dde6baedec
Removed ethcore-util dependency from ethcore-network (#7180)
* Removed ethcore-util dependency

* Removed snappy
2017-12-02 10:08:04 +01:00
Denis S. Soldatov aka General-Beck c544c3e518
Merge pull request #7147 from paritytech/pwasm-run
WASM test runner utility upgrade
2017-12-01 19:42:28 +03:00
NikVolf 4f12e1dab1 pwasm-run-test utility upgrade 2017-12-01 16:41:09 +03:00
GitLab Build Bot 801b6c4bc8 [ci skip] js-precompiled 20171201-114538 2017-12-01 11:46:30 +00:00
Amaury Martiny 2a7b2c7e32 React 16 (#7174)
* Update packages to use React 16

* Rollback to react-router v3

* Use component instead of pure one

* Remove warning about mobx

* Make webpack load css from @parity/ui

* Update enzyme to support react16

* Fix lint

* Use @parity/ui v3

* Update refs of plugin-signer-* deps

* Exclude plugin-signer-* from babel processing

* Reupdate refs to old method

* Update refs again
2017-12-01 12:30:13 +01:00
Takehiro Miyao ad01f99c44 upper limit is gas limit * 10 in estimate gas 2017-12-01 11:12:11 +00:00
Tomasz Drwięga 7663451116 Assorted improvements for ethstore and ethkey (#6961)
* Testing many passwords for presale wallet.

* Add multiple threads.

* WiP: ethkey brain wallets recover.

* Refactor pre-sale-wallet cracking.

* Generate in multiple threads. Brain with prefix.

* Validate bain wallet phrase.

* Brain wallet recovery.

* Self-review fixes.

* Fix tests.

* More docs.

* Bump versions.

* Remove cmd_find from borked merge.

* Update wasm submodules.

* Use threadpool.
2017-12-01 11:40:07 +03:00
GitLab Build Bot d1bf0e0e62 [ci skip] js-precompiled 20171130-103432 2017-11-30 10:35:49 +00:00
Jaco Greeff 2e96ffc582
Delete unused package.json (dist) (#7173) 2017-11-30 11:12:03 +01:00
GitLab Build Bot 3af1e1b3b0 [ci skip] js-precompiled 20171129-172021 2017-11-29 17:21:25 +00:00
Jaco Greeff a39e210742
Remove *.css.map & *.js.map (#7168) 2017-11-29 18:04:12 +01:00
GitLab Build Bot 538e540dde [ci skip] js-precompiled 20171129-144917 2017-11-29 14:50:14 +00:00
Jaco Greeff 519648eb01
Use git flag to remove old js artifacts (#7165) 2017-11-29 15:33:04 +01:00
GitLab Build Bot 903bbc7912 [ci skip] js-precompiled 20171129-135441 2017-11-29 13:55:41 +00:00
Jaco Greeff d1d502765b
Cleanup JS build artifacts (#7164)
* Cleanup JS build artifacts

* Trigger js & js-old
2017-11-29 14:39:57 +01:00
Robert Jensen ba89f34751 fixes typo in user config path (#7159) 2017-11-29 11:12:03 +01:00
GitLab Build Bot 33a96f8ffe [ci skip] js-precompiled 20171128-091552 2017-11-28 09:16:45 +00:00
Jaco Greeff 8780fa0d68
Pull in new dapp-{methods,visible} dapps (#7150) 2017-11-28 10:03:03 +01:00
Marek Kotewicz e8787c1acf
Merge pull request #7142 from paritytech/pwasm-run
WASM test runner utility
2017-11-27 10:16:28 +01:00
Sergey Pepyakin 359b4de3ff WASM Remove blockhash error (#7121)
* Remove blockhash error

* Update tests.
2017-11-26 23:18:58 +03:00
NikVolf 13f3113826 pwasm-run-test utility 2017-11-26 00:06:57 +03:00
Marek Kotewicz 68db425fe8
Merge pull request #7067 from sorpaas/patch-1
ECIP-1039: Monetary policy rounding specification
2017-11-24 15:49:33 +01:00
GitLab Build Bot c32a5353b9 [ci skip] js-precompiled 20171124-134823 2017-11-24 13:49:21 +00:00
Marek Kotewicz 06ff816afb
Merge pull request #7129 from paritytech/fix_logger
Fixed `RotatingLogger` after migrating to new arrayvec
2017-11-24 14:31:46 +01:00
Jaco Greeff 6836182a36
Push to correct shell branch (#7135)
* Push to correct shell branch

* Trigger both js & js-old builds
2017-11-24 14:22:37 +01:00
GitLab Build Bot e802ed04da [ci skip] js-precompiled 20171124-124119 2017-11-24 12:43:00 +00:00
Svyatoslav Nikolsky 9b63d6f63f Merge branch 'master' into secretstore_kovan 2017-11-24 15:42:50 +03:00
Wei Tang 8e89be775c
Wrong era used in ECIP1017 test
It is era 49, and should correspond to ECIP1017/ECIP1039's era 50.
2017-11-24 20:17:26 +08:00
debris 9f10fa3c3d Merge branch 'master' into fix_logger 2017-11-24 12:55:33 +01:00
Marek Kotewicz 95d54c4160
Merge pull request #7132 from paritytech/jg-fix-js-skeleton
Update js-precompiled ref, trigger JS build
2017-11-24 12:54:53 +01:00
Wei Tang bef85fb876
Add test for ECIP1017 at block 250000000 2017-11-24 19:31:48 +08:00
Jaco Greeff 9d3ca6ec10 Update js-precompiled ref, trigger JS build 2017-11-24 12:26:43 +01:00
Svyatoslav Nikolsky 37973f9112 SecretStore: do not update servers set until fully synchronized 2017-11-24 13:21:39 +03:00
Svyatoslav Nikolsky 009e350fc7 SecretStore: ACL checker now requires blockchain to be fully synchronized 2017-11-24 13:17:08 +03:00
Svyatoslav Nikolsky 14686f2652 SecretStore: cli option to configure service contract 2017-11-24 12:33:33 +03:00
Svyatoslav Nikolsky 30816d8155 Merge branch 'master' into secretstore_kovan 2017-11-24 11:04:36 +03:00
Svyatoslav Nikolsky 333e0e1637 SecretStore: publish key only if requested through contract 2017-11-24 10:26:24 +03:00
Svyatoslav Nikolsky 989f2a0542 SecretStore: removed code comments 2017-11-24 10:26:16 +03:00
Svyatoslav Nikolsky 5bd2894146 Fixed build && test (#7128)
* fixed build && test

* fixed rpc tests
2017-11-23 14:47:08 +01:00
Jaco Greeff 53e0e3be14
Update packages, pull in compiled-only repos (#7125)
* Update packages, pull in compiled-only repos

* Update js-precompiled to point to js-dist-paritytech

* Trigger both js & js-old builds to force update

* Update to bring scripts 100% in-sync
2017-11-23 14:29:56 +01:00
Svyatoslav Nikolsky 0f0a056225 fixed RotatingLogger after migrating to new arrayvec 2017-11-23 09:34:48 +03:00
Svyatoslav Nikolsky c296b8ac5d SecretStore: fixed service contract update 2017-11-23 09:33:27 +03:00
Svyatoslav Nikolsky 498a708df7 fixed warnings 2017-11-23 08:22:51 +03:00
Svyatoslav Nikolsky 6a7f523cdb SecretStore: generation_is_not_retried_if_tried_in_the_same_cycle 2017-11-23 08:07:46 +03:00
Svyatoslav Nikolsky 12e9c1cebc Merge branch 'master' into secretstore_kovan 2017-11-23 07:27:13 +03:00
Svyatoslav Nikolsky b036624bac SecretStore: key_is_read_and_published_when_processing_restore_server_key_task 2017-11-23 07:26:45 +03:00
Svyatoslav Nikolsky ea9c8a174c SecretStore: started adding tests for ServiceContractListener 2017-11-22 17:31:34 +03:00
GitLab Build Bot d793019607 [ci skip] js-precompiled 20171122-140247 2017-11-22 14:12:43 +00:00
Jaco Greeff cebf493dce
Cleanup top bar, add Home icon for navigation (#7118)
* Localise images to config.js file

* Remove sample status plugin (commented)

* Update image references from config

* Remove Unknown capability & Capable (only display actions)

* Update to @parity/ui 2.2.14

* Add Home icon on statusbar (go back)

* 2.2.14 -> 2.2.x

* Builtin dapp icons where dappreg not available
2017-11-22 14:56:12 +01:00
Svyatoslav Nikolsky 5d6abfe2f5 SecretStore: implemented restore_server_key 2017-11-22 11:51:51 +03:00
Svyatoslav Nikolsky a2c12ab13e SecretStore: fixed warnings 2017-11-22 11:47:15 +03:00
Svyatoslav Nikolsky 85e150dbb5 SecretStore: restore server key 2017-11-22 11:43:01 +03:00
Svyatoslav Nikolsky 7da66c24f0 SecretStore: store joint_public in key_storage 2017-11-22 11:09:48 +03:00
Svyatoslav Nikolsky df3a8a9234 SecretStore: default ClusterSessionsListener impl 2017-11-22 10:43:16 +03:00
Svyatoslav Nikolsky fc7f3433b7 SecretStore: removed obsolete traits 2017-11-22 10:21:14 +03:00
Svyatoslav Nikolsky 5a7e065e41 SecretStore: Kovan flush3 2017-11-22 10:05:14 +03:00
Marek Kotewicz a2c48deab5
Merge pull request #7110 from paritytech/remove-storage-error
WASM storage_read and storage_write don't return anything
2017-11-21 20:43:23 +01:00
Marek Kotewicz 309254348b
Merge pull request #7100 from paritytech/jg-dapp-localUrl
Local dapp development URL
2017-11-21 20:42:51 +01:00
GitLab Build Bot d160feeefd [ci skip] js-precompiled 20171121-164807 2017-11-21 17:04:16 +00:00
Jaco Greeff fcee1c0ac8
Remove unused and duplicated files in js-old (#7082)
* Cleanup v1 build process, application-only

* Remove built-in dapps from build (duplicated)

* User @parity/api instead of local version

* Update references to @parity/abi

* Remove unused js-old api/abi folders

* Remove duplicated v1 jsonrpc

* Cleanup unused routes

* Update manifest with wallet image

* Update wallet logo

* Re-add missing test.sh

* Update rpc mocks

* Update tests for Providers

* Use flex for iframe & status

* Additional cleanups (Home screen for embed)

* Keep statusbar fixed (and non-overallping with dapps)
2017-11-21 17:38:06 +01:00
GitLab Build Bot bc17c61d14 [ci skip] js-precompiled 20171121-150329 2017-11-21 15:14:37 +00:00
Amaury Martiny 570fc56af7 Optimize & group dapp requests (#7083)
* Group similar methods in same grouping

* Add a shell_getMethodGroups API

* Small code clean changes

* Fix bug dapp.name not showing

* Additional error handling

* Store sources in own map

* Remove observable variables where not needed

* Refactor code and fix bug dapp not showing on approve
2017-11-21 15:50:38 +01:00
Jaco Greeff e7543f656a Remove debug log 2017-11-21 15:17:05 +01:00
Jaco Greeff 20f8943eb3 Cleanup debug info 2017-11-21 15:04:47 +01:00
Sergey Pepyakin 3716b09b2e Update wasm-tests 2017-11-21 17:03:14 +03:00
Sergey Pepyakin 66b2db0137 Update gas values 2017-11-21 17:03:14 +03:00
Sergey Pepyakin 7564b05572 Make storage_read/write return nothing 2017-11-21 17:03:13 +03:00
Jaco Greeff 17df58b767 Add localUrl to serialization 2017-11-21 15:02:54 +01:00
Marek Kotewicz 2650154cd7
Merge pull request #7097 from paritytech/panic-payload-with-msg
WASM parse payload from panics
2017-11-21 15:01:32 +01:00
Sergey Pepyakin 3e4e00fc6a spaces to tabs. 2017-11-21 15:39:34 +03:00
Marek Kotewicz ab7307288b
Merge pull request #7096 from paritytech/td-nodef-features
Fix no-default-features.
2017-11-21 13:10:57 +01:00
Jaco Greeff e67b05e632 Use query-string for search parsing 2017-11-21 12:31:34 +01:00
Robert Habermeier d105bc272e
Merge pull request #7090 from paritytech/updated-secp256k1
updated eth-secp256k1
2017-11-20 22:36:30 +01:00
Svyatoslav Nikolsky 76e693240d fix after merge 2017-11-20 20:02:03 +03:00
Svyatoslav Nikolsky b5fad300ba Merge branch 'master' into secretstore_kovan 2017-11-20 19:58:01 +03:00
Svyatoslav Nikolsky af409eba07 SecretSTore: fix after merge from secretstore_kovan_1_8 2017-11-20 19:41:53 +03:00
Svyatoslav Nikolsky 32edb33608 removed some TODOs 2017-11-20 19:03:48 +03:00
Svyatoslav Nikolsky 01d6532875 SecretStore: fixed Ordering 2017-11-20 19:03:39 +03:00
Svyatoslav Nikolsky 3945a29ee6 SecretStore: mapping requests to KeyServer + requests retry 2017-11-20 19:03:31 +03:00
Svyatoslav Nikolsky 6618827d1a SecretStore: cleaning up service contract listener 2017-11-20 19:03:22 +03:00
Svyatoslav Nikolsky 56875a83b3 SecretStore: Kovan flush2 2017-11-20 19:03:06 +03:00
Nikolay Volf 9798e3c45a
Update panic_payload.rs 2017-11-20 18:12:31 +03:00
Jaco Greeff 73dcde65aa localUrl only from manifest 2017-11-20 15:11:12 +01:00
Jaco Greeff ac722e9e50 Add appId as needed to local dapps 2017-11-20 13:37:52 +01:00
Jaco Greeff d8e86cfe0a Add to all icon_url places 2017-11-20 13:37:23 +01:00
Kirill Pimenov 8d06e19b70
Merge pull request #7099 from paritytech/a5-docs-gitemplates
Improve Github Issue Template
2017-11-20 13:25:18 +01:00
5chdn 3d68051a1f
Remove seperator that causes issue descriptions to become headlines sometimes 2017-11-20 13:23:44 +01:00
5chdn 5a20a826c4
Improve Github Issue Template: IT CROWD approved version. 2017-11-20 13:07:53 +01:00
Jaco Greeff 6fe361b382 Allow localUrl in manifest 2017-11-20 12:05:03 +01:00
Sergey Pepyakin 3d0616c1ae Parse payload from panic
Impl payload

empty str is none

Update tests

Clean

Update wasm-tests
2017-11-20 13:09:57 +03:00
Tomasz Drwięga 4f5d73c945
Fix no-default-features. 2017-11-20 11:02:48 +01:00
debris 7dc7a673f0 updated eth-secp256k1 2017-11-18 22:14:57 +00:00
Robert Habermeier 4a6b103f0e
Merge pull request #7020 from paritytech/upload-crates
Changes necessary to upload crates to crates.io
2017-11-18 16:22:21 +01:00
Robert Habermeier 6fabb56104 fix tests on patricia-trie 2017-11-17 17:12:12 +01:00
Robert Habermeier 81212c5031 Merge branch 'master' into upload-crates 2017-11-17 16:42:41 +01:00
Marek Kotewicz 3c82a0d162
Merge pull request #7048 from paritytech/efyang
reopened 6860 - iterate over both buffered and unbuffered database entries
2017-11-16 17:49:02 +01:00
Svyatoslav Nikolsky e16f6fb9d9 SecretStore: servers set change session api (#6925)
* SecretStore: first key versions flush

* SecretStore: key versions in encryption session

* SecretStore: flush key versions negotiation session

* SecretStore: connected key version negotiation session to cluster

* SecretStore: cluster sessions container refactoring

* SecretStore: flush

* SecretStore: flush key versions

* SecretStore: flush

* SecretStore: delegation proto

* SecretStore: decryption_session_is_delegated_when_node_does_not_have_key_share

* SecretStore: fixed version in decryption session

* SecretStore: signing_session_is_delegated_when_node_does_not_have_key_share

* SecretStore: started restoring admin sessions

* SecretStore: restoring admin sessions

* SecretStore: removed obsolete ShareRemove && ShareMove sessions

* SecretStore: ShareAdd math tests only require old_t+1 nodes

* SecretStore: ShareAdd revamp using new math backend

* SecretStore: do not include isolated nodes into consensus_group

* SecretStore: ServersSetChange + ShareAdd revamp

* removed debug printlns

* SecretStore: key version negotiation tests

* SecretStore: removed debug/merge artifacts

* SecretStore: fixed master node selection

* SecretStore: cleanup + tests + fixes

* SecretStore: uncommented tests

* SecretStore: cleaning up

* SecretStore: cleaning up + tests

* SecretStore: cleaning up

* SecretStore: cleaning up && tests

* SecretStore: fixing TODOs

* SecretStore: fixing TODOs + cleanup

* SecretStore: fixing TODOs

* SecretStore: nodes_add_to_the_node_with_obsolete_version

* SecretStore: nodes_add_fails_when_not_enough_share_owners_are_connected

* SecretStore: tests

* SecretStore: signing && delegation tests

* SecretStore: signing && decryption tests when some nodes are isolated

* SecretStore: sessions_are_removed_when_initialization_fails

* SecretStore: ceaning up

* SecretStore: removed obsolete comments

* SecretStore: signing_session_completes_if_node_does_not_have_a_share

* SecretStore: initial ServersSetChange API

* SecretStore: added secretstore_signServersSet RPC

* SecretStore: ChangeServersSet parse tests

* SecretStore: fixes after manual ServersSetChange tests

* lost file

* fixed network ports overlap in tests

* lost files
2017-11-16 17:34:23 +01:00
Wei Tang b35cc3f716
Change reward calculation to only use divide once 2017-11-16 12:34:04 +08:00
Wei Tang 2ca57d7cdb
ECIP-1039: Monetary policy rounding specification
Fix potential rounding errors between geth and parity in the long-term future.
2017-11-16 12:25:05 +08:00
Marek Kotewicz 605cd5cd9f
Merge pull request #7006 from paritytech/no-uncles
Disable uncles by default
2017-11-15 23:51:49 +01:00
Marek Kotewicz 0230a44b15
Merge pull request #7040 from paritytech/squashed_network_error_chain
squashed ethcore-network changes which introduce error-chain
2017-11-15 18:18:25 +01:00
Marek Kotewicz fdc045327a
Merge pull request #7057 from paritytech/dep_cleanup
removed redundant imports
2017-11-15 18:14:04 +01:00
GitLab Build Bot a98652bef6 [ci skip] js-precompiled 20171115-103846 2017-11-15 10:50:45 +00:00
Afri Schoedon 95d3741e32
CHANGELOG for 1.7.8, 1.7.9, 1.8.2, and 1.8.3 (#7055)
* Update changelog for 1.7.8 stable

* Update changelog for 1.7.9 stable

* Improve wording in Changelog

* Update changelog for 1.8.2 beta

* Update changelog for 1.8.3 beta
2017-11-15 11:29:07 +01:00
Jaco Greeff 0bf48e94cc Properly display Signer errors (Snackbar display popup) (#7053)
* Update to fixed @parity/ui (Errors component)

* Update ParityBar radius to align with Snackbar/Errors

* Update to latest @parity/ui

* Update dependencies @parity/signer-plugin-*

* Really pull in @parity/signer-plugin-* deps
2017-11-15 11:28:42 +01:00
Denis S. Soldatov aka General-Beck cab5b09591
update icon for desktop 2017-11-14 22:45:14 +03:00
Denis S. Soldatov aka General-Beck 920e4ae1e2
Merge pull request #7059 from elopio/snap-desktopfile
Add the desktop file for the snap
2017-11-14 22:43:59 +03:00
Leo Arias 4dd3097493 Add the desktop file for the snap
Now that we have added plugs to allow accessing the display, the snap needs
a desktop file. And bonus point, it will appear on the menu when it's
installed, and once you make a stable relase, it will appear in the gnome
software center app! So, one-click install for parity :)

Closes: #7056
2017-11-14 19:30:35 +00:00
debris a22c48b6b0 removed redundant imports 2017-11-14 17:47:41 +01:00
Marek Kotewicz e6048e4a34
Merge pull request #7054 from paritytech/allocate_with_zeroes
Small performance gain in allocations
2017-11-14 15:48:11 +01:00
Marek Kotewicz 5a76d35ca8
Merge pull request #7051 from paritytech/td-jsonrpc-bump
Bump JSON-RPC version
2017-11-14 15:43:26 +01:00
Marek Kotewicz dd7177dbb2
Merge pull request #7025 from paritytech/fix-nonce-reservation
Fix nonce reservation
2017-11-14 13:44:52 +01:00
Marek Kotewicz cc184d5206
Merge pull request #7052 from paritytech/fix_ethstore_cli_output
Fixed ethstore-cli output
2017-11-14 13:44:11 +01:00
debris 4d7c31540e static linking for snappy 2017-11-14 13:20:36 +01:00
Kirill Pimenov 6ddabc0f49 Small performance gain in allocations
As measured in
https://gist.github.com/kirushik/e0d93759b0cd102f814408595c20a9d0,
it's much faster not to iterate over zeroes, and just allocate a
contiguous array of zeroes directly.
2017-11-14 13:06:50 +01:00
debris 57720311ad interleaved-ordered 0.1.1 2017-11-14 12:59:01 +01:00
Svyatoslav Nikolsky 7ed2fa8451 fixed ethstore-cli output 2017-11-14 14:33:05 +03:00
Svyatoslav Nikolsky abfb9fccd3 SecretStore: Kovan integration initial commit 2017-11-14 14:26:31 +03:00
Tomasz Drwięga f7fa9f6e9d
Drop jsonrpc_core::Error 2017-11-14 12:17:48 +01:00
Tomasz Drwięga 7e512c637a
Bump version. 2017-11-13 22:52:25 +01:00
GitLab Build Bot 361debd277 [ci skip] js-precompiled 20171113-174651 2017-11-13 18:03:28 +00:00
Jaco Greeff 2e6cf8e04b
Add mui for embed compilation (#7049) 2017-11-13 18:34:51 +01:00
Denis S. Soldatov aka General-Beck dbd64f13f0
Merge pull request #6993 from elopio/snapcraft-df
Update the snap metadata to keep working strictly confined
2017-11-13 19:23:04 +03:00
Tomasz Drwięga 8b85f648ca
HashMap::retain 2017-11-13 17:09:30 +01:00
debris b85369d6e8 Merge branch 'master' of https://github.com/efyang/parity into efyang 2017-11-13 17:06:44 +01:00
Jaco Greeff 0f92856c3f
Remove unused js packages (dapp cleanups) (#7046) 2017-11-13 16:51:57 +01:00
debris 3cf52dac59 use error-chain in ethcore-network 2017-11-13 16:48:58 +01:00
Jaco Greeff b5fc6419e6
Gitlog location update (#7042)
* Move git logging to .git-release.log

* Update gitlog location
2017-11-13 15:16:35 +01:00
Jaco Greeff a0090dd0d8
Move git logging to .git-release.log (#7041) 2017-11-13 14:51:36 +01:00
Jaco Greeff af35fa1e33
Start from rust root in update step (#7039) 2017-11-13 14:20:43 +01:00
Jaco Greeff 3833f87256
Complete token merge, remove unused files (#7037)
* Either js or js-old to have changes to trigger push-cargo

* Complete merge of token changes (code move to js-shared)

* Update setting variable
2017-11-13 13:44:51 +01:00
Jaco Greeff b9fbe52f32
Add missing script variable (#7036) 2017-11-13 13:11:32 +01:00
Amaury Martiny 93e93a50ce Fix npm start script (#7034) 2017-11-13 12:46:11 +01:00
Jaco Greeff 073b4dacfb
Update executable flags on release scripts (#7035)
* Combine cargo updates into one

* Update log tag

* Update executable flags on release scripts
2017-11-13 12:36:48 +01:00
Jaco Greeff 0f2bfda830
Fix v1 precompiled (#7033)
* Combine cargo updates into one

* Update log tag
2017-11-13 11:52:34 +01:00
GitLab Build Bot 399043d37e [ci skip] js-precompiled 20171113-100719 2017-11-13 10:19:26 +00:00
Jaco Greeff 1749dd8d6c
Push precompiled to correct branch (v1) (#7031) 2017-11-13 10:43:12 +01:00
GitLab Build Bot 6997ddda89 [ci skip] js-precompiled 20171113-091450 2017-11-13 09:27:11 +00:00
GitLab Build Bot 7fed79295d [ci skip] js-precompiled 20171113-084613 2017-11-13 08:57:55 +00:00
Jaco Greeff ce1609726f
Update v1 Wallet Dapp (#6935)
* Start removing duplicated functionality (v1 inside v2)

* Update compilation targets

* Update locks

* Fix js-old build

* Update with removed extra references

* Adapt dev.{parity,web3}.html for extra debug info

* Update dependencies

* Remove Tooltips

* Update dependencies

* Only inject window.ethereum once

* Fix versions to 2.0.x for @parity libraries

* Update to @parity/api 2.1.x

* Update for @parity/api 2.1.x

* Freeze signer plugin dependency hashes

* Fix lint

* Move local account handling from API

* Update for 2.2.x @parity/{shared,ui}

* Update API references for middleware

* Install updated dependencies

* Update for build

* Always do local builds for development

* Remove unused hasAccounts property

* Fix Windows build for js-old

* Adjust inclusing rules to be Windows friendly

* Explicitly add --config option to webpack

* Add process.env.EMBED flag for Windows compatability

* Revert embed flag

* Fix build

* Merge changes from beta

* Update packages after merge

* Update Accounts from beta

* Update with beta

* Remove upgrade check

* Fix CI build script execution

* Make rm -rf commands cross-platform

* Remove ability to deploy wallets (only watch)

* Update path references for js-old (Windows)

* Render local dapps first

* Cleanup dependencies
2017-11-13 09:31:08 +01:00
Sergey Pepyakin bcdfc50a0b pwasm-std update (#7018) 2017-11-13 00:21:15 +03:00
Tomasz Drwięga 72907da2ae
Garbage collect hashmap entries. 2017-11-12 12:50:13 +01:00
Robert Habermeier c4466f450b update patricia-trie cargo.toml 2017-11-10 20:26:19 +01:00
Robert Habermeier cffbf3cab1 update rlp 2017-11-10 20:22:45 +01:00
Robert Habermeier 75cfab8559 update memorydb 2017-11-10 20:17:41 +01:00
Robert Habermeier ec5519ccd1 rename hash crate to keccak-hash 2017-11-10 20:08:28 +01:00
Robert Habermeier 5c8f39c3bd update ethcore-bigint version 2017-11-10 18:50:45 +01:00
Robert Habermeier 5423518e1e update bigint version number 2017-11-10 18:43:18 +01:00
Robert Habermeier 2288bcd1b4 Merge branch 'master' of github.com:paritytech/parity into upload-crates 2017-11-10 18:42:18 +01:00
Robert Habermeier be092e7c09 prepare cargo configuration for upload of crates 2017-11-10 18:31:31 +01:00
Nicolas Gotchac 8c6b89df72 Merge branch 'master' into fix-nonce-reservation 2017-11-10 17:36:12 +01:00
Nicolas Gotchac 15c97336a4 Create hashmap in RPC Apis 2017-11-10 17:11:04 +01:00
Alexey df49b4b065
Merge pull request #6967 from paritytech/wasm-elog
Events in WASM runtime
2017-11-10 18:03:32 +03:00
Marek Kotewicz e13204c5c8
Merge pull request #6970 from paritytech/validate_node_url
Adds validate_node_url() and refactors boot node check (#6907)
2017-11-10 15:39:30 +01:00
Marek Kotewicz dd87b3014b
Merge pull request #7016 from paritytech/td-glue
Fix windows build (with ui rebuild)
2017-11-10 15:32:48 +01:00
Tomasz Drwięga dd35c9b1f7
Bump parity-dapps-glue. 2017-11-10 10:58:56 +01:00
Tomasz Drwięga f0fc8ed5f8
Rimraf. 2017-11-10 10:50:23 +01:00
Tomasz Drwięga 6ab03412ea
Fix js-glue. 2017-11-10 10:23:35 +01:00
keorn 261c0d5368 no default uncles 2017-11-09 23:56:02 +00:00
Office-Julia 73d195ab79
Update CHANGELOG-1.7.md 2017-11-10 03:13:09 +07:00
Office-Julia 5977e36687
Update CHANGELOG-1.7.md 2017-11-10 03:05:07 +07:00
Nicolas Gotchac 4c8780f188 Use nonce reservation per address 2017-11-09 19:49:34 +01:00
Robert Habermeier ea6e79c9c2 test framework and basic test for whisper 2017-11-09 19:20:32 +01:00
Kirill Pimenov 394d6e7259
Merge pull request #7004 from paritytech/cli-arguments-backwards-compatible
Make CLI arguments parsing more backwards compatible
2017-11-09 14:42:17 +01:00
Tomasz Drwięga aaeb5d4cd7 Fixes for parity-extension (#6990)
* Fix extension support.

* Fix environment variables on windows.

* Fix package-lock.json

* Fix build issues.
2017-11-09 13:20:26 +01:00
Axel Chalon 83e2fa3112 Make CLI arguments parsing more backwards compatible 2017-11-08 12:33:56 +01:00
Robert Habermeier b3795ac0b5
Merge pull request #6992 from paritytech/td-bigint
Update ethcore-bigint
2017-11-07 11:24:05 -06:00
Robert Habermeier d701ed7262
Merge pull request #6874 from paritytech/light-local-tx
Get local transactions by hash in the light client
2017-11-07 11:23:40 -06:00
Robert Habermeier 099303a342
Merge pull request #6875 from paritytech/warn-blacklisted
warn when blacklisted account present in store
2017-11-07 11:23:20 -06:00
Robert Habermeier acdec22d58 Merge branch 'master' into warn-blacklisted 2017-11-07 16:56:57 +01:00
Robert Habermeier 4a07010539 Merge branch 'master' into light-local-tx 2017-11-07 16:56:28 +01:00
Arkadiy Paronyan 85465fc0b1 Skip nonce check for gas estimation (#6997) 2017-11-07 09:21:30 +01:00
Tomasz Drwięga bd04517477
Update. 2017-11-06 16:31:15 +01:00
Leo Arias 6a0e8a557c Update the snap metadata to keep working strictly confined 2017-11-06 14:03:45 +00:00
Tomasz Drwięga 2557f282a4
Add std feature. 2017-11-06 12:52:38 +01:00
Tomasz Drwięga 0ed1e77996
Add version to plain-hasher. 2017-11-06 12:03:59 +01:00
Tomasz Drwięga d7e4dda3e1
Update ethcore-bigint. 2017-11-06 11:58:17 +01:00
Dmitry Kashitsyn 8fe40a64d0 Fixes test 2017-11-06 13:51:26 +07:00
Dmitry Kashitsyn 851401dded Removes obsolete is_valid_node_url() 2017-11-06 13:01:37 +07:00
Dmitry Kashitsyn 1516fc1c57 Adds validate_node_url() and refactors boot node check (#6907) 2017-11-06 12:46:11 +07:00
NikVolf bed82e5cc0 elog (events) for wasm runtime 2017-11-05 18:54:35 +03:00
Tomasz Drwięga ffee6aacff Creating pending block with all transactions from the queue (#6942)
* Allow to include all queue transactions in pending block.

* Fix tests.
2017-11-03 15:20:20 +01:00
Dmitry Kashitsyn 7eacef99b9 Removes MAX_TX_TO_IMPORT from `ChainSync` (#6976) 2017-11-03 13:09:59 +01:00
Svyatoslav Nikolsky 7703cd226b SecretStore: versioned keys (#6910)
* SecretStore: first key versions flush

* SecretStore: key versions in encryption session

* SecretStore: flush key versions negotiation session

* SecretStore: connected key version negotiation session to cluster

* SecretStore: cluster sessions container refactoring

* SecretStore: flush

* SecretStore: flush key versions

* SecretStore: flush

* SecretStore: delegation proto

* SecretStore: decryption_session_is_delegated_when_node_does_not_have_key_share

* SecretStore: fixed version in decryption session

* SecretStore: signing_session_is_delegated_when_node_does_not_have_key_share

* SecretStore: started restoring admin sessions

* SecretStore: restoring admin sessions

* SecretStore: removed obsolete ShareRemove && ShareMove sessions

* SecretStore: ShareAdd math tests only require old_t+1 nodes

* SecretStore: ShareAdd revamp using new math backend

* SecretStore: do not include isolated nodes into consensus_group

* SecretStore: ServersSetChange + ShareAdd revamp

* removed debug printlns

* SecretStore: key version negotiation tests

* SecretStore: removed debug/merge artifacts

* SecretStore: fixed master node selection

* SecretStore: cleanup + tests + fixes

* SecretStore: uncommented tests

* SecretStore: cleaning up

* SecretStore: cleaning up + tests

* SecretStore: cleaning up

* SecretStore: cleaning up && tests

* SecretStore: fixing TODOs

* SecretStore: fixing TODOs + cleanup

* SecretStore: fixing TODOs

* SecretStore: nodes_add_to_the_node_with_obsolete_version

* SecretStore: nodes_add_fails_when_not_enough_share_owners_are_connected

* SecretStore: tests

* SecretStore: signing && delegation tests

* SecretStore: signing && decryption tests when some nodes are isolated

* SecretStore: sessions_are_removed_when_initialization_fails

* SecretStore: ceaning up

* SecretStore: removed obsolete comments

* SecretStore: signing_session_completes_if_node_does_not_have_a_share
2017-11-02 15:33:11 +01:00
Dmitry Kashitsyn 713bba00ac Removes FUTURE_QUEUE_LIMITS_SHIFT (#6962) 2017-11-02 15:06:17 +01:00
Arkadiy Paronyan 60bb2d9c74
Set zero nonce and gasprice for calls by default (#6954) 2017-11-02 12:50:08 +01:00
Nikolay Volf f72858ee0a Add hint in ActionParams for splitting code/data (#6957)
* Action params and embedded params handling

* fix namespaces
2017-11-02 12:49:57 +01:00
Tomasz Drwięga 0a69d5ac4c Return decoded seal fields. (#6932) 2017-11-01 11:29:03 +01:00
Tomasz Drwięga ec44e3d265 Fix serialization of status in transaction receipts. (#6926) 2017-11-01 11:25:10 +01:00
Tomasz Drwięga b861ad37a4 Reserve nonces for signing (#6834)
* Nonce future - reserve and dispatch

* Single thread nonce tests

* Track status of reserved nonces.

* Initialization of nonce reservations.

* Prospective Signer

* Fix cli tests.
2017-11-01 11:23:18 +01:00
Kirill Pimenov 4b3c26f991
Merge pull request #6921 from paritytech/windows-fixes
Windows fixes
2017-11-01 11:06:03 +01:00
GitLab Build Bot d525d1e8a7 [ci skip] js-precompiled 20171030-184948 2017-10-30 19:03:18 +00:00
Jaco Greeff 152e56c5d9
Don't add {css,js}.map from dapps (#6931) 2017-10-30 14:36:37 +01:00
arkpar 38652bd296
Restored rust-toolchain 2017-10-30 08:05:44 +01:00
Marek Kotewicz 39e27076ad
Merge pull request #6842 from paritytech/td-evm-json
Fix JSON tracing for sub-calls.
2017-10-29 21:47:14 -07:00
arkpar 4c101c974d Tray app fixes 2017-10-29 14:43:44 +01:00
arkpar 719f3788e6
Installer fixes 2017-10-29 14:42:37 +01:00
arkpar 4b6036fa08
Updated icon 2017-10-29 14:42:37 +01:00
arkpar 4b56f2530d
Don't create IPC dir on windows 2017-10-29 14:42:37 +01:00
efyang 9b4db8b4f0 Fix iterator issues 2017-10-28 16:59:00 -05:00
GitLab Build Bot 44511f9254 [ci skip] js-precompiled 20171026-173947 2017-10-26 17:51:21 +00:00
GitLab Build Bot 0abc2b1374 [ci skip] js-precompiled 20171025-172424 2017-10-25 17:37:10 +00:00
Jaco Greeff f282823e78 Shell updates (bonds, updated Dapps) (#6897)
* Remove stage-0

* Re-add stage-0 for `export default from './xyz';`

* Add background loading image

* Add window.isParity for parity-specific actions

* inject bonds (temporary)

* Remove loading text overlay

* Remove background around logo

* Remove debug log

* Fix account selection (correct component used)

* Update with changed dapp dependencies

* Add oo7 to list of babel node_module targets

* injectObjects -> onDappLoad
2017-10-25 16:54:41 +02:00
Nicolas Ochem 542cee9ace fix #6228: do not display eth price in cli for etc (#6877)
* fix #6228: do not display eth price in cli for etc

Current behaviour:

When the client is started with defaults, the miner's gas calibrator
periodically queries the price of ether in usd and uses it to adjust
the wei_per_gas variable, displaying an info message in the cli each
time calibration happens. The info message mentions the price of ETH.

When started with the --min-gas-price option, the calibrator is inactive
and the price is not displayed.

Problem:

When running on an alternate chain such as ethereum classic, the info
message mentioning the ETH price is present, unless the --min-gas-price
option is used.

Solution:

if chain != foundation and --min-gas-price is not set,
don't use GasPricerConfig::Calibrated as default but rather fix
the minimum gas price to zero.

* self.chain() returns ChainType.

* match chain based on SpecType
2017-10-25 11:42:48 +02:00
Nicolas Ochem 54b14001fa fix mining help (#6885)
was
        --min-gas-price=[STRING]
	                Minimum amount of Wei per GAS to be paid for a
			transaction to be accepted for mining. Overrides
			--basic-tx-usd.

Issue: --basic-tx-usd does not exist. Author probably meant
--usd-per-tx.

New:
        --min-gas-price=[STRING]
	                Minimum amount of Wei per GAS to be paid for a
			transaction to be accepted for mining. Overrides
			--usd-per-tx.
2017-10-25 11:38:47 +02:00
Tomasz Drwięga 8dfdebc2a2 Refactor static context check in CREATE. (#6886)
* Refactor static context check in CREATE.

* Fix wasm.
2017-10-25 11:27:18 +02:00
GitLab Build Bot b50ed887c7 [ci skip] js-precompiled 20171024-132828 2017-10-24 13:48:32 +00:00
David Dorgan bdf1e6afcc Revert "Sync parity-ewf with parity"
This reverts commit f7ba063b22.
2017-10-24 13:31:58 +01:00
David Dorgan f7ba063b22 Sync parity-ewf with parity 2017-10-24 12:31:50 +01:00
Tomasz Drwięga dfccc3fb04 Allow force sealing and reseal=0 for non-dev chains. (#6878) 2017-10-24 12:25:34 +02:00
Tomasz Drwięga b98150526c Fix serialization of non-localized transactions (#6868)
* Fix serialization of non-localized transactions.

* Return proper SignedTransactions representation.
2017-10-24 12:13:00 +02:00
Marek Kotewicz d68b3f131d updated ntp to version 0.3 (#6854) 2017-10-24 12:12:15 +02:00
Afri Schoedon f68cb37efb Align README with 1.8 and prepare CHANGELOG with 1.8.1 (#6833)
* Update README.md for 1.8.0

* Update CHANGELOG.md for 1.8.1

* Clarify note on trezor wallets

* Update CHANGELOG.md for 1.8.1

* Update CHANGELOG.md for 1.8.1

* Update CHANGELOG.md for 1.8.1

* Fix Typos.
2017-10-24 12:01:35 +02:00
Tomasz Drwięga 025244e8b2 Return error on timed unlock attempt. (#6777) 2017-10-24 11:57:55 +02:00
Tomasz Drwięga 1253a5c577
Merge branch 'master' into td-evm-json 2017-10-24 09:16:51 +02:00
Robert Habermeier dd13526f6c warn when blacklisted account present in store 2017-10-24 09:04:28 +02:00
Robert Habermeier 965dff3d32 light: get local transactions by hash 2017-10-24 07:30:53 +02:00
Marek Kotewicz 3e5d9b92c1 Merge pull request #6866 from paritytech/td-fix-dapps-tests
Fix dapps tests in master
2017-10-24 11:31:14 +07:00
Tomasz Drwięga dd21e61371
Fix ws tests. 2017-10-23 23:52:50 +02:00
Tomasz Drwięga 42e23a9633
Return proper SignedTransactions representation. 2017-10-23 16:45:06 +02:00
Tomasz Drwięga 4ba2587226
Fix serialization of non-localized transactions. 2017-10-23 14:46:36 +02:00
Tomasz Drwięga 5f5476ceb8
Fix parsing of non-utf8 characters. 2017-10-23 14:02:53 +02:00
efyang 56b6adec68 Iterate over both buffered and unbuffered database entries 2017-10-22 20:58:06 -05:00
Arkadiy Paronyan 097815cb71 Ethstore optimizations (#6827) 2017-10-20 20:20:41 +02:00
Tomasz Drwięga 1177c39772
Merge branch 'master' into td-evm-json 2017-10-20 16:06:44 +02:00
Tomasz Drwięga 2d222a5920
Capture traces and write some tests. 2017-10-20 16:06:36 +02:00
Tomasz Drwięga 4ac406da6b
Merge branch 'master' into td-evm-json 2017-10-20 13:36:45 +02:00
GitLab Build Bot f4c9524eb4 [ci skip] js-precompiled 20171020-105109 2017-10-20 11:04:41 +00:00
ia bbe9d73e9a Add ECIP1017 to Morden config (#6810)
* Add ECIP1017 setting to Morden config

* Convert spaces to tabs

* Update Morden bootnodes to match Geth
2017-10-20 12:37:37 +02:00
Jaco Greeff 9ca294740d Remove all package publishing to npm (#6838) 2017-10-20 12:16:26 +02:00
Marek Kotewicz 9228ce4bae util crates use tempdir crate instead of devtools to create temp path (#6807)
* use tempdir instead of devtools in kvdb-rocksdb

* use tempdir instead of devtools in migration

* use tempdir instead of devtools in ethcore-network

* fixed wrong merge
2017-10-20 12:11:34 +02:00
Jaco Greeff 7b14907f7f Trigger build (#6836) 2017-10-20 11:51:37 +02:00
Tomasz Drwięga aa929fe6ae Clean-up scripts. (#6832) 2017-10-20 11:41:11 +02:00
Arkadiy Paronyan 3a01068747 Merge pull request #6829 from paritytech/tweak-snapshot-sync
Tweaked snapshot sync threshold
2017-10-20 08:18:25 +02:00
arkpar 3ea9d80859
Tweaked snapshot sync threshold 2017-10-19 23:11:38 +02:00
Arkadiy Paronyan 41eabfcc1e Merge pull request #6819 from paritytech/td-ui-2
Integrate UI 2
2017-10-19 22:09:13 +02:00
Tomasz Drwięga bfcf4c4281
Merge branch 'master' into td-ui-2 2017-10-19 15:46:15 +02:00
GitLab Build Bot 58db82dbe2 [ci skip] js-precompiled 20171019-130316 2017-10-19 13:08:11 +00:00
Arkadiy Paronyan b4c4fddb10 devp2p snappy compression (#6683) 2017-10-19 14:41:10 +02:00
Jaco Greeff fdbf6bf7d6 Refresh cached tokens based on registry info & random balances (#6818)
* Refresh cached tokens based on registry info & random balances

* Don't display errored token images
2017-10-19 14:18:21 +02:00
Tomasz Drwięga 490f771faf
Fix tests. 2017-10-19 12:02:13 +02:00
Fredrik Harrysson c1288810c6 Change keypath derivation logic (#6815)
While the standard defined by Trezor as the default derivation path here
https://blog.trezor.io/trezor-integration-with-myetherwallet-3e217a652e08
says that it should be `m/44'/60'/0`, in practice they don't have an
implementation of a wallet for Ethereum themselves and refer customers
to MEW.

MEW has a custom implementation of the path derivation logic that allows them to
generate multiple addresses by essentially adding `/0`, `/1` etc to the path.

In my initial implementation of Trezor I didn't take this into
consideration unfortunately and just used the keypath that Trezor
themselves recommended. However, given that it's seemingly standard
practice to append `/0` for a "sub-address" (and this is what we've done
for Ledger as well) it seems like a mistake on my part to not take that
into consideration.

Unfortunately, anyone who has used their Trezor device with Parity
previously would now see a different address when they connect the
Trezor device the next time. The only way they would have to access the
old address is to use an old version, or by going through MEW and
selecting the Ledger keypath.

Also see #6811
2017-10-19 11:47:53 +02:00
Tomasz Drwięga 195305ce2e
Merge branch 'master' into td-ui-2 2017-10-18 16:45:37 +02:00
Tomasz Drwięga da6bd4168b
Update build scripts. 2017-10-18 16:38:11 +02:00
Tomasz Drwięga 48ac6cbcf8
Enable access to WebSockets for dapps. 2017-10-18 16:28:45 +02:00
Marek Kotewicz 5281e09828 Merge pull request #6801 from paritytech/refactoring/journal-6693
Refactors journaldb as a separate crate
2017-10-18 16:10:28 +02:00
GitLab Build Bot b1df272f4c [ci skip] js-precompiled 20171018-123105 2017-10-18 12:35:51 +00:00
Tomasz Drwięga 51caf97705 Trigger UI build. (#6817) 2017-10-18 14:19:45 +02:00
Tomasz Drwięga 2472a2be0c
Merge branch 'ui-2' into td-ui-2 2017-10-18 14:13:08 +02:00
Jaco Greeff 9e04be754c Update dependencies (should fix account) 2017-10-18 11:51:29 +02:00
GitLab Build Bot 62fa1ed524 [ci skip] js-precompiled 20171017-174801 2017-10-17 17:53:06 +00:00
Tomasz Drwięga 304b067417
Support both versions. 2017-10-17 18:10:59 +02:00
Jaco Greeff fc2b58a4eb Updated dependencies 2017-10-17 18:02:17 +02:00
Dmitry Kashitsyn 153b8572dd Fixes tests 2017-10-17 22:24:47 +07:00
Arkadiy Paronyan a2fe7def1f Bumped version (#6809) 2017-10-17 16:48:38 +02:00
Kirill Pimenov 540c93955e Merge pull request #6808 from paritytech/td-rpc-warnings
Fix RPC compilation warnings.
2017-10-17 16:15:32 +02:00
Tomasz Drwięga 0f8fb62581
Integrate old UI. 2017-10-17 16:09:43 +02:00
Tomasz Drwięga 1d9542fe88
Fix RPC compilation warnings. 2017-10-17 15:41:32 +02:00
Tomasz Drwięga 2d10cd0ecc
Fixing JSON WiP. Refactor & Write tests. 2017-10-17 14:54:56 +02:00
Kirill Pimenov 86c2633280 Migrate to Futures in SigningQueue (#6689)
* oneshot channels instead of custom promises

* Future instead of handle_dispatch

* Even less copying

* Those explicit waits were a mistake, thanks, @tomusdrw

* No more unsafe polling

* Test for the new `is_done()` method

* Mark Futures as `#[must_use]`

* Solve most compilation warnings

* `try_ready!` is more ideomatic

* Turn spaces into tabs

* Documentation and visibility improvements

* Minor code style improvements

* Make Futures run on an explisit reactor

* Another round of code style issues

* Simplify ConfirmationReceiver type

* Flatten ConfirmationOutcome into a plain Result type

* Get rid of a separate `pending` set, it was a stupid idea

* Clarify `add_request` docs

* No need to reduce the scope of the mutex here
2017-10-17 14:50:53 +02:00
Jaco Greeff 9a62119a82 Updated dependencies 2017-10-17 12:41:31 +02:00
debris 0e912bca5b bring back accidently removed whitespace 2017-10-17 10:44:05 +02:00
debris 607cc6c782 fixed compiling util tests 2017-10-17 10:40:45 +02:00
Jaco Greeff d852e6b063 Merge branch 'master' into ui-2
# Conflicts:
#	js/src/views/Signer/components/SignRequest/signRequest.js
2017-10-17 09:55:13 +02:00
Jaco Greeff 9c5b96ccbe Updated dependencies 2017-10-17 09:09:54 +02:00
Dmitry Kashitsyn 7fe7b6d9a4 Fixes import in test 2017-10-17 12:12:46 +07:00
Dmitry Kashitsyn f9e588dd7b Refactors parity/parity to use journaldb crate (#6693) 2017-10-17 11:46:54 +07:00
Dmitry Kashitsyn c0fc83988f Refactors ethcore to use journaldb crate (#6693) 2017-10-17 11:46:07 +07:00
Dmitry Kashitsyn e2b96e1fe0 Moves journaldb sources to a separate crate (#6693) 2017-10-17 11:44:52 +07:00
Marek Kotewicz 98d0ef3fff Merge pull request #6795 from paritytech/ipc_cleanup
remove internal ipc
2017-10-16 23:22:47 +02:00
debris 3830f9b464 fixed failing test 2017-10-16 22:12:17 +02:00
debris 95f0384510 Merge branch 'master' into ipc_cleanup 2017-10-16 18:19:41 +02:00
Marek Kotewicz bb1be15dc4 Merge pull request #6792 from paritytech/kvdb_error
consistent KeyValueDB errors
2017-10-16 18:19:18 +02:00
debris 16d84f8ecf finished removing ipc 2017-10-16 18:18:43 +02:00
Jaco Greeff a76f768077 Updated dependencies 2017-10-16 18:06:40 +02:00
debris fa019bd03e remove ipc codegen from ethcore 2017-10-16 17:50:25 +02:00
debris 6f914d1851 remove ipc codegen from stratum 2017-10-16 17:32:15 +02:00
debris f1c50e5648 remove ipc codegen from updater 2017-10-16 17:28:59 +02:00
debris c83e9d0f1b remove ipc codegen from secretstore 2017-10-16 17:12:02 +02:00
Jaco Greeff 9e4c1fe6af Update warning layout 2017-10-16 15:51:55 +02:00
Jaco Greeff de6066d6b0 Add babel-polyfill entry 2017-10-16 15:45:30 +02:00
Jaco Greeff b49d7ee29c Rebuild after master merge 2017-10-16 15:20:30 +02:00
debris 7661e93a56 fixed secret_store conversion from kvdb error 2017-10-16 14:55:11 +02:00
Jaco Greeff 8453dda7ef Merge branch 'master' into ui-2
# Conflicts:
#	js/package-lock.json
#	js/package.json
#	js/src/api/api.js
#	js/src/api/local/accounts/accounts.js
#	js/src/api/local/localAccountsMiddleware.js
#	js/src/api/local/transactions.js
#	js/src/api/pubsub/signer/signer.js
#	js/src/api/subscriptions/signer.js
#	js/src/api/transport/jsonRpcBase.js
#	js/src/api/transport/middleware.js
#	js/src/api/util/format.js
#	js/src/api/util/format.spec.js
#	js/src/contracts/abi/index.js
#	js/src/contracts/badgereg.js
#	js/src/dapps/tokenreg/Application/application.css
#	js/src/dapps/tokenreg/Application/application.js
#	js/src/modals/CreateWallet/WalletDetails/walletDetails.js
#	js/src/modals/CreateWallet/WalletDetails/walletDetails.spec.js
#	js/src/modals/CreateWallet/createWalletStore.js
#	js/src/modals/DeployContract/ParametersStep/parametersStep.js
#	js/src/modals/DeployContract/deployContract.js
#	js/src/modals/ExecuteContract/DetailsStep/detailsStep.js
#	js/src/modals/WalletSettings/walletSettings.js
#	js/src/redux/providers/certifications/actions.js
#	js/src/redux/providers/certifications/middleware.js
#	js/src/redux/providers/certifications/reducer.js
#	js/src/redux/providers/requestsActions.js
#	js/src/redux/providers/tokensActions.js
#	js/src/ui/AccountCard/accountCard.css
#	js/src/ui/Balance/balance.js
#	js/src/ui/Balance/balance.spec.js
#	js/src/ui/DappCard/dappCard.js
#	js/src/ui/Form/AddressSelect/addressSelect.js
#	js/src/ui/Form/AddressSelect/addressSelectStore.js
#	js/src/ui/Form/InputAddressSelect/inputAddressSelect.js
#	js/src/ui/Form/TypedInput/typedInput.js
#	js/src/ui/IdentityIcon/identityIcon.js
#	js/src/ui/MethodDecoding/tokenValue.js
#	js/src/util/tx.js
#	js/src/util/wallets.js
#	js/src/util/wallets/consensys-wallet.js
#	js/src/util/wallets/foundation-wallet.js
#	js/src/views/Account/account.js
#	js/src/views/Accounts/List/list.js
#	js/src/views/Contract/Queries/inputQuery.js
#	js/src/views/Contract/Queries/queries.js
#	js/src/views/Contract/contract.js
#	js/src/views/Signer/components/SignRequest/signRequest.css
#	js/src/views/Signer/components/SignRequest/signRequest.js
#	js/src/views/Signer/components/SignRequest/signRequest.spec.js
2017-10-16 12:41:41 +02:00
Arkadiy Paronyan 5b29b6d064 Squash remaining warnings (#6789)
* Fixed comment warnings

* Fixed remaining warnings
2017-10-16 12:31:52 +02:00
debris 8ecdab68c2 add missing space to TrieError description 2017-10-16 12:17:06 +02:00
debris 5e61f3493e require stable error-chain 2017-10-16 12:15:19 +02:00
debris 6dc50d01b5 KeyValueDB trait uses errors instead of strings 2017-10-16 12:11:35 +02:00
Marek Kotewicz 44db0c55c5 Merge pull request #6720 from paritytech/kvdb_split
separated kvdb into 3 crates: kvdb, kvdb-memorydb && kvdb-rocksdb
2017-10-16 10:57:27 +02:00
Afri Schoedon 774598974e Forward-port #6754 #6755 (#6785) 2017-10-16 10:56:23 +02:00
Marek Kotewicz aa4bc50c6b removed duplicated versions of clippy (#6776) 2017-10-16 10:22:02 +02:00
Marek Kotewicz 8365f4d80e updated ethabi to version 4.0 (#6742)
* updated ethabi to version 4.0

* ethabi 4.0.1
2017-10-16 10:21:35 +02:00
Marek Kotewicz 9fa639ede9 updated rpc_cli and parity to rpassword 1.0 (#6774) 2017-10-16 10:20:55 +02:00
Afri Schoedon b63c3a66ca Fix sign data typo, ref #6737 (#6750) 2017-10-16 10:08:36 +02:00
debris fbad6b5514 removed redundant mut from kvdb-memorydb 2017-10-16 10:02:26 +02:00
debris 2ce0eae406 Merge branch 'master' into kvdb_split 2017-10-16 10:01:12 +02:00
Marek Kotewicz d1c9acf439 Merge pull request #6772 from paritytech/refactoring/cache-6693
Refactoring/cache 6693
2017-10-16 09:58:48 +02:00
Afri Schoedon 832879e5c8 Fix CHANGLOG for 1.8.0 (#6751)
* Fix CHANGLOG for 1.8.0

* Update changelog for 1.8.0

* Add changelog for 1.7.7
2017-10-16 09:35:02 +02:00
Dmitry Kashitsyn 92a9fd3359 Uses dash instead of underscore in crate name 2017-10-16 11:05:54 +07:00
Dmitry Kashitsyn b03117b262 Removes redundant `mut` in service.rs.in (#6775) 2017-10-15 17:41:40 +02:00
Dmitry Kashitsyn e7690ab658 Removes redundant dependencies (#6693) 2017-10-15 21:47:06 +07:00
Dmitry Kashitsyn 4df541e47a Refactors references to MemoryLruCache in ethcore (#6693) 2017-10-15 21:47:06 +07:00
Dmitry Kashitsyn 51b61ccdbf Extracts MemoryLruCache to a separate crate (#6693) 2017-10-15 21:47:06 +07:00
debris db3ff67182 Merge branch 'master' into kvdb_split 2017-10-15 16:40:20 +02:00
Marek Kotewicz 82c8dccddf Merge pull request #6773 from paritytech/refactoring/redundant-mut
Remove redundant `mut`
2017-10-15 16:38:26 +02:00
debris fa4e5c98d0 docs 2017-10-15 16:18:45 +02:00
debris 616cafb04a renamed kvdb_memorydb::in_memory -> kvdb_memorydb::create 2017-10-15 16:17:15 +02:00
debris d88ec35a6a Merge branch 'master' into kvdb_split 2017-10-15 15:55:44 +02:00
Dmitry Kashitsyn 96b4467f86 Removes redundant `mut` in util 2017-10-15 20:11:34 +07:00
Dmitry Kashitsyn 74876fd410 Removes redundant `mut` in sync 2017-10-15 20:11:20 +07:00
Dmitry Kashitsyn dab40e832c Removes redundant `mut` in rpc 2017-10-15 20:11:07 +07:00
Dmitry Kashitsyn b49baed696 Removes redundant `mut` in hw 2017-10-15 20:10:59 +07:00
Dmitry Kashitsyn 3df67b376b Removes redundant `mut` in ethcore 2017-10-15 20:10:20 +07:00
Arkadiy Paronyan b0c15497e1 Fixed kovan chain validation (#6758)
* Fixed kovan chain validation

* Fork detection

* Fixed typo
2017-10-14 21:59:26 +02:00
Marek Kotewicz 190c1dcede removed redundant evm deps (#6757) 2017-10-14 19:29:09 +02:00
Afri Schoedon 1294572907 Update CHANGELOG for 1.7.4, 1.7.5, and 1.8.0 (#6716)
* Update CHANGELOG for 1.7.4

* Update CHANGELOG for 1.7.5

* Update CHANGELOG for 1.7.5

* Move stable changelog to docs/

* Prepare CHANGELOG for 1.8.0

* Update CHANGELOG for 1.8.0

* Add changelog for 1.7.6

* Update CHANGELOG for 1.8.0

* Describe CHANGELOG for 1.8.0
2017-10-13 17:30:51 +02:00
debris da8bf76c15 util tests use kvdb_memorydb instead of kvdb_rocksdb, closes #6739 2017-10-13 17:12:17 +02:00
debris b277c3810f Merge branch 'master' into kvdb_split 2017-10-13 16:27:12 +02:00
Arkadiy Paronyan 691e93834c Fixed modexp gas calculation overflow (#6741) 2017-10-13 16:06:53 +02:00
Marek Kotewicz fcd81a7b86 Merge pull request #6733 from paritytech/cc1.0
use cc 1.0 instead of gcc
2017-10-13 14:30:03 +02:00
Axel Chalon d77dabadbb CLI: Reject invalid argument values rather than ignore them (#6723)
* CLI: Reject invalid argument values rather than ignore them

* Fix grumbles
2017-10-13 12:20:57 +02:00
debris 5c220ab64b Merge branch 'master' into kvdb_split 2017-10-13 12:18:49 +02:00
GitLab Build Bot ba6594e30a [ci skip] js-precompiled 20171013-002644 2017-10-13 00:31:48 +00:00
Arkadiy Paronyan f3ea2f354e v1.9.0 (#6727) 2017-10-12 23:44:02 +02:00
Robert Habermeier a2d9b6f9ce remove RPC parameter leniency now that mist formats correctly (#6651) 2017-10-12 23:35:52 +02:00
debris 8c1e402e02 use cc 1.0 instead of gcc 2017-10-12 23:23:50 +02:00
GitLab Build Bot df39f5e7fc [ci skip] js-precompiled 20171012-210804 2017-10-12 21:19:11 +00:00
Nicolas Gotchac 78146e903d Fix badges not showing up (#6730)
* Fix badges not showing up

* Always fetch meta data first [badges]
2017-10-12 22:17:59 +02:00
GitLab Build Bot 7472bc3570 [ci skip] js-precompiled 20171012-181858 2017-10-12 18:24:04 +00:00
Nicolas Gotchac 3e7b775961 Fix tokens and badges (#6725)
* Update new token fetching

* Working Certifications Monitoring

* Update on Certification / Revoke

* Fix none-fetched tokens value display

* Fix tests
2017-10-12 20:09:44 +02:00
Jaco Greeff edbbd42d80 Check vouch status on appId in addition to contentHash (#6719)
* Check vouch status on appId in addition to contentHash

* Simplify var expansion
2017-10-12 19:28:56 +02:00
debris f36b4e0fca fixed wrong kvdb import in json_tests 2017-10-12 17:05:32 +02:00
Marek Kotewicz e51e54eeeb Merge pull request #6694 from paritytech/no-sleep
Prevent going offline when restoring or taking a snapshot
2017-10-12 15:54:29 +02:00
Marek Kotewicz fee68a5331 Merge pull request #6711 from paritytech/cli-unknownarguments-6485
Graceful exit when invalid CLI flags are passed (#6485)
2017-10-12 15:52:22 +02:00
Marek Kotewicz 761ba164ee Merge pull request #6718 from paritytech/returndata-bounds-fix
Fixed RETURNDATA out of bounds check
2017-10-12 15:46:10 +02:00
debris c05fd9607c fixed kvdb-memorydb && kvdb-rocksdb authors 2017-10-12 15:38:38 +02:00
debris eb526b7769 separated kvdb into 3 crates: kvdb, kvdb-memorydb && kvdb-rocksdb, #6693 2017-10-12 15:36:27 +02:00
arkpar 301190a16f
Fixed RETURNDATA out of bounds check 2017-10-12 12:57:27 +02:00
arkpar 99143c5872
Prevent going offline when restoring or taking snapshot 2017-10-12 12:37:03 +02:00
GitLab Build Bot 1d2319207a [ci skip] js-precompiled 20171011-214450 2017-10-11 21:49:51 +00:00
GitLab Build Bot 0b666f605f [ci skip] js-precompiled 20171011-192355 2017-10-11 19:29:28 +00:00
Jaco Greeff 7feb82c242 Display vouched overlay on dapps (#6710)
* Remove .only

* Add vouch overlays to dapps

* Cleanup address

* Only run where we have a contentHash

* GitLab kickstart
2017-10-11 21:05:50 +02:00
Tomasz Drwięga 34c65f60ef Fix estimate gas if from is not provided. (#6714) 2017-10-11 21:05:38 +02:00
GitLab Build Bot df19b8df69 [ci skip] js-precompiled 20171011-183646 2017-10-11 18:43:16 +00:00
Maciej Hirsz 1fec0b1833 Merge pull request #6708 from paritytech/mh-pubnode-fix-signer
Emulate signer pubsub on public node
2017-10-11 20:24:12 +02:00
Marek Kotewicz bfff19ca9f Merge pull request #6705 from paritytech/serde-migration
Removes  dependency on rustc_serialize (#5988)
2017-10-11 18:17:40 +02:00
Axel Chalon a101a23ba3 Graceful exit when invalid CLI flags are passed (#6485) 2017-10-11 17:38:56 +02:00
Dmitry Kashitsyn 4f86f5b76d Removes rustc-serialize references from Cargo.toml and Cargo.lock 2017-10-11 22:01:00 +07:00
Arkadiy Paronyan 7029dda87c Fixed potential exp len overflow (#6686) 2017-10-11 16:41:28 +02:00
maciejhirsz 0c86357187 Emulate signer pubsub on public node 2017-10-11 16:21:44 +02:00
GitLab Build Bot 0bb845a05c [ci skip] js-precompiled 20171011-121439 2017-10-11 12:19:40 +00:00
Jaco Greeff f238c97c6f Fix asciiToHex for characters < 0x10 (#6702) 2017-10-11 13:58:40 +02:00
Nicolas Gotchac 3a9b3b4729 Fix default values for address input (#6701) 2017-10-11 13:57:06 +02:00
Jaco Greeff 2bfb510554 Allow sign display of markdown (#6707) 2017-10-11 13:56:13 +02:00
Dmitry Kashitsyn 604cdde71d Fixes bench and removes rustc_serialize dependency (#5988) 2017-10-11 17:39:12 +07:00
Arkadiy Paronyan 690f32c298 Fixed build warnings (#6664)
* Fixed build warnings

* Suppress warning

* Suppress warning for sure
2017-10-11 09:55:10 +02:00
Dmitry Kashitsyn 504b2de4a8 Migrating util/network from rust_serialize to serde (#5988) 2017-10-11 14:34:23 +07:00
Marek Kotewicz e3fa460374 Merge pull request #6691 from paritytech/warp-options
Fix warp sync blockers detection
2017-10-10 21:51:18 +02:00
Marek Kotewicz 3c4fa5583a Merge pull request #6687 from paritytech/difficulty-tests
Difficulty tests
2017-10-10 21:50:53 +02:00
debris 025c5aebc9 Merge branch 'master' into difficulty-tests 2017-10-10 20:10:24 +02:00
Marek Kotewicz 6279ff32f5 Separate migrations from util (#6690)
* separate migration from util and make its dependencies into libs:

* snappy
* kvdb
* error
* common

* renamed common -> macros

* util error does not depend on snappy module

* ethsync does not depend on util nor ethcore_error

* nibbleslice and nibblevec merged with patricia_trie crate

* removed unused dependencies from util

* util journaldb traits does not need to be public

* util_error

* fixed ethcore compile error

* ignore .swo files

* Update chain.rs
2017-10-10 20:01:27 +02:00
arkpar cc681c623f
Fixed tests after rename 2017-10-10 17:48:37 +02:00
arkpar 007629464a
Fix warp sync blockers detection 2017-10-10 17:42:20 +02:00
arkpar e5a7a674f9
Get rid of blockchain test warnings 2017-10-10 16:56:03 +02:00
arkpar 7234a7c630
Difficulty tests 2017-10-10 14:51:12 +02:00
Afri Schoedon 4e8853c9f7 Changelog for 1.7.3 (#6678)
* Prepare CHANGELOG for 1.7.3

* Update CHANGELOG for 1.7.3

* Update CHANGELOG for 1.7.3

* Split changelog(s) by major releases.

* Link previous release's changelogs in main

* Update CHANGELOG for 1.7.3

* More verbose changelog for 1.7.3
2017-10-10 10:51:12 +02:00
Jaco Greeff afb9647f0d Update lint 2017-10-09 14:42:26 +02:00
Jaco Greeff c116e064d8 Merge master 2017-10-09 14:27:59 +02:00
GitLab Build Bot dbd1976fc1 [ci skip] js-precompiled 20171009-121402 2017-10-09 12:19:46 +00:00
Nikolay Volf 1601030081 WASM gas schedule (#6638)
* some failing tests

* finalize

* fallable -> fallible

* alter mul/div/static_i64

* Update schedule.rs

* to u32

* balance charge also

* review fixes

* remove redundant line
2017-10-09 13:12:58 +02:00
Nicolas Gotchac 8d1964bc3b Fix wallet view (#6597)
* Add safe fail for empty logs

* Filter transactions

* Add more logging

* Fix Wallet Creation and wallet tx list

* Remove logs

* Prevent selecting twice same wallet owner

* Fix tests

* Remove unused props

* Remove unused props
2017-10-09 13:11:18 +02:00
Marek Kotewicz 65ca2f9a07 Merge pull request #6660 from paritytech/byzantium-fork
Byzantium fork block number
2017-10-09 11:25:49 +02:00
Marek Kotewicz de0d12d73c Merge pull request #6652 from paritytech/returndatasize-builtin-fix
Fixed RETURNDATA size for built-ins
2017-10-09 11:24:34 +02:00
Jaco Greeff 439eb294bb Merge branch 'master' into ui-2 2017-10-09 10:23:21 +02:00
GitLab Build Bot ca6d5660c1 [ci skip] js-precompiled 20171008-172308 2017-10-08 17:28:31 +00:00
Robert Habermeier b010fb5004 Light Client: fetch transactions/receipts by transaction hash (#6641)
* rpc: transaction/receipt requests made async

* rpc: light client fetches transaction and uncle by hash/index

* on_demand: request type for transaction index

* serve transaction index requests in light protocol

* add a test for transaction index serving

* fetch transaction and receipts by hash on light client

* fix decoding tests

* light: more lenient cost table parsing (backwards compatible)

* fix tests and warnings

* LES -> PIP

* Update provider.rs

* proper doc comments for public functions
2017-10-08 18:19:27 +02:00
Afri Schoedon 360ecd3728 Add Musicoin and MCIP-3 UBI hardfork. (#6621)
* Add musicoin chain spec.

* Add musicoin to parity node

* Add musicoin to the wallet

* Add i18n for musicoin

* Align musicoin chain spec with 1.8, ref #6134

* Update musicoin bootnodes

* Prepare MCIP-3 in musicoin chain spec.

* Update musicoin chain spec with contract addresses for MCIP-3

* Extend ethash params by MCIP-3

* Fix musicoin chain spec json

* Use U256 for block rewards.

* Update musicoin registrar

* Fix merge leftovers

* Update musicoin chain spec for latest master

* Bestow MCIP-3 block reward(s).

* Update musicoin registry once and for all

* Align MCIP-3 block reward with go implementation

* Remove mcip3 test chain spec from repository

* Update MCIP-3 block rewards

* Musicoin homestead transition is at 1_150_000

* Expect mcip3 transtion to be properly defined in chain spec.

* Panic handling for mcip to default to regular block rewards if not specified

* Giving mcip3 rewards a useful default value.

* Fix ethjson tests.

* Update musicoin chain spec

* Fix tests 0:)

* Add musicoin mcip3 era test spec.

* Update musicoin chain spec(s)

* Add tests for mcip3 era block rewards

* Fix tests

* Disable byzantium for musicoin

* Pass miner reward to the tracer.

* Allow modifying blockreward in MCIP-3 transition.
2017-10-08 18:17:59 +02:00
Robert Habermeier 59365b0133 fix aura backcompat: revert to manual encoding/decoding of transition proofs (#6665) 2017-10-06 17:36:26 +02:00
Arkadiy Paronyan 1b45870af8 Tweaked block download timeouts (#6595) (#6655) 2017-10-06 13:46:11 +02:00
arkpar 07c63c14f3
Byzantium fork block number 2017-10-06 09:47:04 +02:00
Arkadiy Paronyan 77a2c77c45 Renamed RPC receipt statusCode field to status (#6650) 2017-10-06 09:11:17 +02:00
Svyatoslav Nikolsky 4e9d439f39 SecretStore: session level timeout (#6631)
* SecretStore: session level timeout

* removed obsolete TODO
2017-10-05 22:38:23 +02:00
Svyatoslav Nikolsky 6431459bcf SecretStore: ShareRemove of 'isolated' nodes (#6630)
* SecretStore: ShareRemove from isolated nodes

* SecretStore: ServersSetChange && isolated nodes

* SecretStore: added threshold check + lost file

* SecretStore: remove isolated nodes before other sessions in ServersSetChange

* removed obsolete TODO
2017-10-05 22:37:41 +02:00
arkpar 6a1eea1b3d
Fixed RETURNDATA size for built-ins 2017-10-05 19:31:29 +02:00
Marek Kotewicz d8094e0629 Merge pull request #6624 from paritytech/secretstore_exclusive_sessions
SecretStore: exclusive sessions
2017-10-05 18:44:44 +02:00
Robert Habermeier 77933aa8a1 Merge pull request #6649 from paritytech/eip8-fix
Fixed network protocol version negotiation
2017-10-05 18:07:45 +02:00
Robert Habermeier 7dc281ff2f Merge pull request #6598 from AntoniosHadji/systemd
Updated systemd files for linux (Resolves #6592)
2017-10-05 18:06:52 +02:00
arkpar c4c2c77a40
Fixed network protocol version negotiation 2017-10-05 17:20:23 +02:00
Robert Habermeier 223467c816 Merge pull request #6646 from paritytech/restore-additional-info
move additional_params to machine, fixes registry on non-ethash chains
2017-10-05 16:19:15 +02:00
Jaco Greeff 0be532640a SyncWarning store 2017-10-05 15:52:44 +02:00
Robert Habermeier bae6a5eeec move additional_info to engines, fixes registry on non-ethash chains 2017-10-05 15:34:30 +02:00
Jaco Greeff 4f082da02b Lint fixes 2017-10-05 15:26:20 +02:00
Jaco Greeff 21c95bbec5 Update after merge 2017-10-05 15:04:45 +02:00
GitLab Build Bot 3f520b864b [ci skip] js-precompiled 20171005-120001 2017-10-05 12:04:49 +00:00
GitLab Build Bot c7ea25227a [ci skip] js-precompiled 20171005-114154 2017-10-05 11:46:58 +00:00
Nicolas Gotchac fb65732076 Fix Token Transfer in transaction list (#6589)
* Fix Token Transfer in TX LIST

* Add TokenReg logs logging
2017-10-05 13:03:31 +02:00
Tomasz Drwięga e8b418ca03 Update jsonrpc dependencies and rewrite dapps to futures. (#6522)
* Bump version.

* Fix RPC crate.

* Fix BoxFuture in crates.

* Compiles and passes tests!

* Get rid of .boxed()

* Fixing issues with the UI.

* Remove minihttp. Support threads.

* Reimplement files serving to do it in chunks.

* Increase chunk size.

* Remove some unecessary copying.

* Fix tests.

* Fix stratum warning and ipfs todo.

* Switch to proper branch of jsonrpc.

* Update Cargo.lock.

* Update docs.

* Include dapps-glue in workspace.

* fixed merge artifacts

* Fix test compilation.
2017-10-05 12:35:01 +02:00
Svyatoslav Nikolsky 8961d987a9 fixed port offset in test 2017-10-04 22:12:45 +03:00
Svyatoslav Nikolsky 492da38d67 Merge pull request #6639 from paritytech/wasm-ext-balance
Balance queries implemented in WASM runtime
2017-10-04 22:09:00 +03:00
fro 6956d218b5 address balance extern provided for wasm 2017-10-04 19:09:18 +03:00
Arkadiy Paronyan b7c2a30d7d Don't expose port 80 for parity anymore (#6633) 2017-10-04 14:58:31 +02:00
Jaco Greeff 290060e6c4 Add sync warning to top 2017-10-04 14:49:41 +02:00
Nikolay Volf 4260910db6 WASM Runtime refactoring (#6596)
* refactoring to new pwasm-std

* pass reference

* remove ref

* missing underscores
2017-10-04 13:15:59 +02:00
Jaco Greeff 55b0b09d6a Merge branch 'master' into ui-2 2017-10-04 12:31:09 +02:00
Svyatoslav Nikolsky 1b1548f539 removed obsolete TODO 2017-10-04 12:16:45 +03:00
Jaco Greeff 9f00159228 Rebuild 2017-10-04 08:26:26 +02:00
Svyatoslav Nikolsky 0092417b85 Merge branch 'master' into secretstore_exclusive_sessions 2017-10-03 13:39:42 +03:00
Svyatoslav Nikolsky ec1a892f44 Merge pull request #6625 from paritytech/fix_compilation
Fix compilation
2017-10-03 13:39:12 +03:00
Svyatoslav Nikolsky 5e83ff8835 fix compilation 2017-10-03 12:59:48 +03:00
Svyatoslav Nikolsky 3091552504 fix indentation 2017-10-03 12:49:43 +03:00
Svyatoslav Nikolsky fb38c20c16 SecretStore: exclusive sessions 2017-10-03 11:35:31 +03:00
Tomasz Drwięga f8d256dafa Downgrade futures. (#6620) 2017-10-03 10:04:07 +02:00
Anton Gavrilov 0a5c9b0465 Add pagination for trace_filter rpc method (#6312)
* Optional offset and count added on client level

* Rpc interface extended

* Tests corrected

* Filtering code refactored a little bit

* Offset type was changed to usize

* Handling of block hash in offset added

* Offset reworked to number

* Trailing comma removed

* Import for Quantity type added

* Offset and count moved into filter object

* Lost comma removed

* Return empty vec instead of None in case of incorrect range
2017-10-03 10:03:46 +02:00
Afri Schoedon 41c3b05a20 Disallow pasting recovery phrases on first run (#6602)
* Fix disallowing paste of recovery phrase on first run, ref #6581

* Allow the leader of CATS pasting recovery phrases.
2017-10-03 10:03:24 +02:00
GitLab Build Bot 931a7a2210 [ci skip] js-precompiled 20171002-143145 2017-10-02 14:37:01 +00:00
vacuum-car fee056a251 fix typo: Unkown => Unknown (#6559) 2017-10-02 15:27:59 +02:00
Svyatoslav Nikolsky 9a086face4 SecretStore: administrative sessions prototypes (#6605)
* generate random channel encryption key on restart

* session-level nonces

* fixed warning after rebase

* session_nonce -> nonce

* full_generation_math_session_with_refreshing_shares && full_generation_math_session_with_adding_new_node

* add serveral secret shares at once

* SecretStore: initial ShareAdd session prototype

* SecretStore: ServersSetChange jobs

* SecretStore: servers set change session continued

* SecretStore: servers set change session continued

* SecretStore: servers set change session continued

* SecretStore: known_sessions iterator

* SecretStore: implemented SessionsQueue

* SecretStore: UnknownSessionsJobTransport

* SecretStore: node_added_using_servers_set_change almost done

* SecretStore: continue adding tests

* SecretStore: node_added_using_servers_set_change + node_added_using_share_add

* SecretStore: node_added_using_server_set_change_from_this_node

* SecretStore: node_moved_using_share_move

* SecretStore: node_moved_using_servers_set_change

* SecretStore: node_removed_using_share_remove

* SecretStore: node_removed_using_servers_set_change

* SecretStore: different folders for client && admin sessions

* SecretStore: started adding share change consensus (flush)

* SecretStore: fixed spurious tests failures

* enum JobPartialRequestAction

* SecretStore: started adding consensus layer to ShareAdd session

* SecretStore: starting external consensus for ShareAdd

* SecretStore: started restoring node_added_using_servers_set_change

* SecretStore: node_added_using_servers_set_change works with external consensus

* SecretStore: node_added_using_server_set_change_from_this_node works with external consensus

* removed debug comments/printlns

* SecretStore: share move session supports consensus

* SecretStore: share remove with external consensus

* SecretStore: started adding basic ShareAdd tests

* SecretStore: added ShareAdd tests

* SecretStore: added ShareAdd session to cluster

* SecretStore: added share move && remove sessions to cluster

* SecretStore: ShareMove session tests cleanup

* SecretStore: ShareRemove session tests cleanup

* SecretStore: added check_secret_is_preserved check

* SecretStore: added servers set change to cluster

* SecretStore: cleaned up ServersSetChange session tests

* SecretStore: cleaning + added tests for ShareRemove

* SecretStore: cleaning up

* SecretStore: propagated admin_public

* SecretStore: fixed persistent_key_storage test

* SecretStore: upgrade_db_from_1

* SecretStore: fixed ServersSetChange session completion

* SecretStore: check polynom1 in ShareAdd sessions (error for pre-v2 shares)

* SecretStore: fixing TODOs

* SecretStore: fixing TODOs

* SecretStore: check share change plan on 'old' slave nodes

* SecretStore: fixing TODOs

* SecretStore: store all admin sessions in single container to avoid overlaps

* SecretStore: do not update nodes set during admin sessions

* SecretStore: moved TODOs to appropriate methods

* SecretStore: TODOs

* SecretStore: added admin_public arg && fixed warnigs

* SecretStore: added shares_to_move_reversed to ShareMove session

* SecretStore: additional checks during consensus establishing

* license

* SecretStore: added TODO about starting ServersSetChange session

* SecretStore: redundant clones + docs + lsot unimplemented-s

* SecretStore: generation_session_completion_signalled_if_failed_on_master

* SecretStore: updated obsolete comment

* SecretStore: added type alias for current DocumentKeyShare serialization format

* SecretStore: fixed typo

* SecretStore; fixed warnings for futures 0.1.15

* fixed warning
2017-10-02 15:27:31 +02:00
Jaco Greeff 341697630d Fix form submission issues 2017-10-02 11:30:20 +02:00
Leopold Joy 561e8b42a8 fix parity.io link in readme (#6617) 2017-10-02 11:21:12 +02:00
Svyatoslav Nikolsky 3a60d723d8 SecretStore: add node to existing session poc + discussion (#6480)
* full_generation_math_session_with_refreshing_shares && full_generation_math_session_with_adding_new_node

* add serveral secret shares at once
2017-10-02 11:07:18 +02:00
Jaco Greeff 39b5e5b98a Signer-plugin-based approach (plugins available) 2017-09-29 15:04:57 +02:00
Svyatoslav Nikolsky 7cc43893d8 Revert "SecretStore; fixed warnings for futures 0.1.15"
This reverts commit 61daa5f3e7.
2017-09-28 14:43:51 +03:00
Svyatoslav Nikolsky 61daa5f3e7 SecretStore; fixed warnings for futures 0.1.15 2017-09-28 14:43:05 +03:00
Antonios Hadjigeorgalis a56c5e6ba8 Updated systemd files for linux (#6592)
Previous version put $BASE directory in root directory.
This version clearly explains how to run as root or as specific user.

Additional configuration:

* send SIGHUP for clean exit,

* restart on fail.

Tested on Ubuntu 16.04.3 LTS with 4.10.0-33-generic x86_64 kernel
2017-09-26 18:03:18 -04:00
GitLab Build Bot cc759530fe [ci skip] js-precompiled 20170926-133548 2017-09-26 13:40:38 +00:00
Robert Habermeier bc167a211b Generalize engine trait (#6591)
* move common forks and parameters to common params

* port specs over to new format

* fix RPC tests

* parity-machine skeleton

* remove block type

* extract out ethereum-specific methods into EthereumMachine

* beginning to integrate Machine into engines. dealing with stale transitions in Ethash

* initial porting to machine

* move block reward back into engine

* abstract block reward logic

* move last hash and DAO HF logic into machine

* begin making engine function parameters generic

* abstract epoch verifier and ethash block reward logic

* instantiate special ethereummachine for ethash in spec

* optional full verification in verify_block_family

* re-instate tx_filter in a way that works for all engines

* fix warnings

* fix most tests, further generalize engine trait

* uncomment nullengine, get ethcore tests compiling

* fix warnings

* update a bunch of specs

* re-enable engine signer, validator set, and transition handler

* migrate basic_authority engine

* move last hashes into executedblock

* port tendermint

* make all ethcore tests pass

* json-tests compilation

* fix RPC tests: change in gas limit for new block changed PoW hash

* fix minor grumbles

* validate chainspecs

* fix broken import

* fix transaction verification for pre-homestead
2017-09-26 14:19:08 +02:00
Wei Tang d8af9f4e7b Add RPC eth_chainId for querying the current blockchain chain ID (#6329)
* Add RPC eth_chainId for querying the current blockchain chain ID

Currently although we can use `net_version` RPC call to get the
current network ID, there's no RPC for querying the chain ID. This
makes it impossible to determine the current actual blockchain using
the RPC. An ETH/ETC client can accidentally connect to an ETC/ETH RPC
endpoint without knowing it unless it tries to sign a transaction or
it fetch a transaction that is known to have signed with a chain
ID. This has since caused trouble for application developers, such as
MetaMask, to add multi-chain support.

The same RPC endpoint is also about to be merged for ETC's
go-ethereum: https://github.com/ethereumproject/go-ethereum/pull/336

* Add eth_chainId to js's web3 interface

* Add a mocked test for eth_chainId

* Add chainId in js's jsonrpc interfaces

* Change return type for eth_chainId to `Option<u64>`

* Change name eth_chainId to parity_chainId

* Wrong test name and missed var for rpc_parity_chain_id test

* Use U256 to return chainId and fix for master

u64 returns decimal integer, and there seems to be no type called
U64. So here I use U256 to return the hex integer.

* Fix chainID test

Before EIP155 fork number, chainID should be null.

* Change both parity_chainId and transaction::chainId to use U64

This makes it consistent that all chain ids returned are hex string.

* Fix wrong U64 serialization
2017-09-26 14:17:07 +02:00
Tomasz Drwięga 59d946bf00 Debounce sync status. (#6572) 2017-09-26 13:05:41 +02:00
GitLab Build Bot 6840df4c09 [ci skip] js-precompiled 20170926-093714 2017-09-26 09:43:21 +00:00
Maciej Hirsz 04e36456bd Merge pull request #6588 from paritytech/mh-pubnode-hardware-wallets
[Public Node] Disable tx scheduling and hardware wallets
2017-09-26 10:37:47 +02:00
Jaco Greeff 9daa884699 Update dependencies 2017-09-26 09:07:22 +02:00
Jef 5c08698fa0 Use memmap for dag cache (#6193)
* Rebase and fix compilation errors (tests not yet fixed)

* Use `debug_assert` over `assert`

* Fix tests

* Assert safety, clean up

* Fix up stale cache removal, move one assert to debug_assert

* Remove printlns

* Add licenses

* Fix benches

* Inline some no-ops in a hot loop that weren't being inlined

* Add spooky comment to make sure no-one removes the inlining annotations

* Minor cleanup

* Add option to switch between mmap and ram

* Flag ethash to use less memory when running light client

* Fix tests

* Remove todo comment (it's done)

* Replace assertion with error return

* Fix indentation

* Use union instead of `transmute`

* Fix benches

* Extract to constants

* Clean up and fix soundness holes

* Fix formatting

* Ignore missing-file errors

* Make incorrect cache size an error condition instead of a panic, remove dead code

* Fix compilation errors from rebase

* Fix compilation errors in tests

* Fix compilation errors in tests
2017-09-25 19:45:33 +02:00
maciejhirsz 0e43ce6e07 Disable time conditions in Tx UI #6445 2017-09-25 17:08:09 +02:00
Robert Habermeier 70be064aa5 Merge pull request #6582 from asymmetric/batch
Rename Requests to Batch
2017-09-25 15:26:18 +02:00
GitLab Build Bot f576926fa2 [ci skip] js-precompiled 20170925-101032 2017-09-25 10:15:30 +00:00
Maciej Hirsz b74065a471 Merge pull request #6566 from paritytech/td-rpc-url-fix
Use host as ws/dapps url if present.
2017-09-25 11:25:00 +02:00
Lorenzo Manacorda aab1cf020c
Rename builder module to batch 2017-09-24 20:09:40 +02:00
Lorenzo Manacorda 5f025cc1b8
Rename Requests to Batch 2017-09-24 20:09:30 +02:00
Jaco Greeff 81c71ff4ab Update submodules to master version
# Conflicts:
#	js/src/api/contract/contract.js
#	js/src/redux/providers/requestsActions.js
2017-09-22 14:15:14 +02:00
Jaco Greeff ab902bfb66 Update packages 2017-09-22 14:03:26 +02:00
maciejhirsz 339f63a61a Fix :NaN port returned by dappsUrl 2017-09-22 13:48:09 +02:00
maciejhirsz 1b7c90e9e1 Remove public node hacks 2017-09-21 16:52:00 +02:00
Tomasz Drwięga 965e8ae74e
Use host as ws/dapps url if present. 2017-09-21 15:11:15 +02:00
Jaco Greeff 61bbc19b0b Merge branch 'master' into ui-2 2017-09-21 14:05:27 +02:00
Arkadiy Paronyan 684b142711 Sync progress and error handling fixes (#6560) 2017-09-21 10:12:27 +02:00
Arkadiy Paronyan 4dc7d3dc45 Fixed receipt serialization and RPC (#6555) 2017-09-21 10:11:53 +02:00
Nicolas Gotchac 2b39c43e81 Fix number of confirmations for transaction (#6552)
* 1 confirmation when tx is mined

* Spelling mistake
2017-09-21 10:10:21 +02:00
Travis Jacobs 9e0d2c15cd Fix #6540 (#6556)
* Fix #6540
- just skip the checkRequest call if result of postTransaction is a tx ID

* Fix requestId naming
2017-09-21 10:10:09 +02:00
Jaco Greeff 9ed8178dff Adjust Requests position 2017-09-20 15:49:03 +02:00
Jaco Greeff 4fa4dd8fc8 Update status plugins 2017-09-20 15:01:30 +02:00
Jaco Greeff dfe45338c0 Move status to the top (alignment/overlaps) 2017-09-20 13:08:38 +02:00
Jaco Greeff 32a29c11a0 CSS lint fixes 2017-09-20 12:55:47 +02:00
Jaco Greeff d02c696030 Update failing tests 2017-09-20 12:48:03 +02:00
Jaco Greeff f9b7be7576 Merge branch 'master' into ui-2 2017-09-20 12:14:46 +02:00
GitLab Build Bot 65ca9afce2 [ci skip] js-precompiled 20170920-093438 2017-09-20 09:39:32 +00:00
Jaco Greeff abb94c8bf3 Update ParityBar (container in Status) 2017-09-20 11:24:19 +02:00
Jaco Greeff 99e981abcf Fix failing hardware tests (#6553) 2017-09-20 10:43:14 +02:00
Jaco Greeff 206abaebb9 Add latest @parity/ui 2017-09-20 09:45:28 +02:00
Jaco Greeff ac3d548079 Empty block 2017-09-20 09:09:05 +02:00
Jaco Greeff 7e1cb97c7e Make status always visible 2017-09-20 09:04:39 +02:00
Jaco Greeff 51674f2cc4 Update dependencies 2017-09-19 20:48:05 +02:00
Jaco Greeff 413da805b5 Update status styling 2017-09-19 14:28:33 +02:00
Nicolas Gotchac 8a21cde188 Required validators >= num owners (#6551) 2017-09-19 11:58:04 +02:00
Marek Kotewicz f38d34919b Random cleanups / improvements to a state (#6472) 2017-09-19 11:34:13 +02:00
Jaco Greeff 2eac4f6606 Align request overlay styling 2017-09-18 15:20:10 +02:00
Afri Schoedon 9196c7268a Changelog for 1.7.2 (#6363)
* Prepare changelog for 1.7.1

* Update changelog for 1.7.1

* Prepare changelog for 1.7.2

* Update CHANGELOG

* Update changelog for 1.7.2

* Snapshot sync kicks in after 10k blocks

* Add ropsten fork to changelog

* Add Gnosis multi-sig support to Changelog

* Update final changelog for 1.7.2
2017-09-18 14:40:28 +02:00
Jaco Greeff 3795a4869e Update with master merged packages 2017-09-18 14:03:34 +02:00
Jaco Greeff 2b48668327 Fix merge linting issues 2017-09-18 11:56:08 +02:00
Jaco Greeff 312360ef4e Update master merge packages 2017-09-18 11:52:21 +02:00
Jaco Greeff db9a70d008 Merge branch 'master' into ui-2
# Conflicts:
#	js/package-lock.json
#	js/src/Application/application.js
#	js/src/api/rpc/parity/parity.js
#	js/src/api/subscriptions/manager.spec.js
#	js/src/api/subscriptions/personal.spec.js
#	js/src/jsonrpc/interfaces/parity.js
#	js/src/mobx/hardwareStore.js
#	js/src/mobx/hardwareStore.spec.js
#	js/src/modals/index.js
#	js/src/redux/providers/signerMiddleware.spec.js
#	js/src/ui/SelectionList/selectionList.css
#	js/src/views/Account/account.spec.js
#	js/src/views/Accounts/accounts.spec.js
#	js/src/views/Application/Extension/store.js
#	js/src/views/Signer/components/SignRequest/signRequest.spec.js
2017-09-18 11:44:09 +02:00
Arkadiy Paronyan 1b6d840ada Ropsten fork (#6533) 2017-09-18 11:12:42 +02:00
Jaco Greeff afec8358d3 Update dependencies 2017-09-18 10:56:09 +02:00
Jaco Greeff 1e1137a6f7 Update dependencies 2017-09-18 10:35:00 +02:00
Jaco Greeff 935d1476e9 Update test execution 2017-09-18 10:15:36 +02:00
Arkadiy Paronyan 25b35ebddd Byzantium updates (#5855)
* EIP-211 updates

* benchmarks

* blockhash instruction gas cost updated

* More benches

* EIP-684

* EIP-649

* EIP-658

* Updated some tests

* Modexp fixes

* STATICCALL fixes

* Pairing fixes

* More STATICALL fixes

* Use paritytech/bn

* Fixed REVERTing of contract creation

* Fixed more tests

* Fixed more tests

* Blockchain tests

* Enable previously broken tests

* Transition test

* Updated tests

* Fixed modexp reading huge numbers

* Enabled max_code_size test

* Review fixes

* Updated pairing pricing

* missing commas (style)

* Update test.rs

* Small improvements

* eip161abc
2017-09-15 21:07:54 +02:00
Tomasz Drwięga b602fb4a5e Fix extension detection (#6452)
* Fix extension detection.

* Fix mobx quirks.

* Update submodule.
2017-09-15 15:06:42 +02:00
Tomasz Drwięga 54bd7d26dc Downgrade futures. (#6521) 2017-09-15 14:45:55 +02:00
Marek Kotewicz d69dd17d3c Merge pull request #6478 from Hawstein/trie-separated-from-util
separate trie from util and make its dependencies into libs
2017-09-15 09:39:10 +02:00
Hawstein dd7a60c7a8 rename trie to patricia-trie 2017-09-15 11:49:26 +08:00
Hawstein ade37be25b separate trie from util and make its dependencies into libs:
* bytes
* hashdb
* memorydb
* nibbleslice
* nibblevec
2017-09-15 11:03:53 +08:00
Alexey 79659bdc76 WASM sha3 test (#6512)
* sha3 test for empty input implemented

* rename sha3-> keccak

* update keccak test. Now it expects input to hash

* fix gas_left in tests
2017-09-14 19:32:29 +02:00
Tomasz Drwięga 06ff866e9d Fix broken JavaScript tests (#6498)
* Fixing/removing failing JS tests.

* Fix javascript tests.
2017-09-14 19:32:06 +02:00
Svyatoslav Nikolsky e3fc3ccada SecretStore: use random key to encrypt channel + session-level nonce (#6470)
* generate random channel encryption key on restart

* session-level nonces

* fixed warning after rebase

* session_nonce -> nonce
2017-09-14 19:29:01 +02:00
Fredrik Harrysson 75b6a31e87 Trezor Support (#6403)
* Copy modal from keepkey branch and generalize

The keepkey PinMatrix modal needs to be the same for Trezor, but we
should probably try to keep it general since it can be used for both.

* Add trezor communication code

This is a result of much trial-and-error and a couple of dead-ends in
how to communicate and wire everything up.

Code here is still a bit WIP with lots of debug prints and stuff.

The test works though, it is possible to sign a transaction.

* Extend the basic lib to allow Trezor

This is kind of ugly and needs some cleanup and generalization. I’ve
just copy-pasted some things to bring in the trezor wallets. I’ve also
had to add a lock to the USB API so that only one thing talks to the
USB at once.

* Add RPC plumbing needed

We need to be able to get “locked” devices from the frontend to figure
out if we’re going to display the PinMatrix or not. Then we need to be
able to send a pin to a device.

* Add logic to query backend for Trezor and display PinMatrix

There’s a bug somewhere here because signing a transaction fails if you
take too long to press the confirm button on the device.

* Change back to paritytech branch

As my fork has been merged in.

* Converting spaces to tabs, as it should be

* Incorporate correct handling of EIP-155

Turns out the Trezor was adjusting the v part of the signature, and
we’re already doing that so it was done twice.

* Some circular logic here that was incorrect

BE-encoded U256 is almost the same as RLP encoded without the
size-byte, except for <u8 sized values. What’s really done is
BE-encoded U256 and then left-trimmed to the smallest size. Kind of
obvious in hindsight.

* Resolve issue where not clicking fast enough fails

The device will not repeat a ButtonRequest when you read from it, so
you need to have a blocking `read` for whatever amount of time that you
want to give the user to click. You could also have a shorter timeout
but keep retrying for some amount of time, but it would amount to the
same thing.

* Scan after pin entry to make accepting it faster

* Remove ability to cancel pin request

* Some slight cleanup

* Probe for the correct HID Version to determine padding

* Move the PinMatrix from Accounts to Application

* Removing unused dependencies

* Mistake in copying over stuff from keepkey branch

* Simplify FormattedMessage

* Move generated code to external crate

* Remove ethcore-util dependency

* Fix broken import in test

This test is useless without a connected Trezor, not sure how to make
it useful without one.

* Merge branch 'master' into fh-4500-trezor-support

# Conflicts:
#	rpc/src/v1/helpers/dispatch.rs

* Ignore test that can't be run without trezor device

* Fixing grumbles

* Avoiding owning data in RPC method
* Checking for overflow in v part of signature
* s/network_id/chain_id
* Propagating an error from the HID Api
* Condensing code a little bit

* Fixing UI.

* Debugging trezor.

* Minor styling tweak

* Make message type into an actual type

This makes the message type that the RPC message accepts into an actual
type as opposed to just a string, based on feedback. Although I’m not
100% sure this has actually improved the situation.

Overall I think the hardware wallet interface needs some refactoring
love.

* Split the trezor RPC endpoint

It’s split into two more generic endpoints that should be suitable for
any hardware wallets with the same behavior to sit behind.

* Reflect RPC method split in javascript

* Fix bug with pin entry

* Fix deadlock for Ledger

* Avoid having a USB lock in just listing locked wallets

* Fix javascript issue (see #6509)

* Replace Mutex with RwLock

* Update Ledger test

* Fix typo causing faulty signatures (sometimes)

* *Actually* fix tests

* Update git submodule

Needed to make tests pass

* Swap line orders to prevent possible deadlock

* Make setPinMatrixRequest an @action
2017-09-14 19:28:43 +02:00
Jaco Greeff baeab01357 Current @parity/shared (required dapp-* rebuild) 2017-09-13 17:51:38 +02:00
Jaco Greeff 4a184dbbe6 Merge branch 'master' into ui-2 2017-09-13 15:51:02 +02:00
Jaco Greeff 5d774d360e Update with latest dependencies 2017-09-13 13:09:32 +02:00
Jaco Greeff 94df97a5ae Update packages 2017-09-12 15:58:13 +02:00
Jaco Greeff 6e2e122288 Update with recent @parity/ui 2017-09-12 13:32:21 +02:00
ivegotasthma e9abcb2f6d Fix compiler warning (#6491) 2017-09-12 09:16:39 +02:00
Liu-Cheng Xu 8fda8e2071 Fix typo (#6505) 2017-09-12 09:15:37 +02:00
Jaco Greeff dc85c66052 file: protocol updates 2017-09-11 14:47:34 +02:00
Svyatoslav Nikolsky 03e039b13d wasm: math_sub_with_overflow test (#6474) 2017-09-11 11:43:33 +02:00
Jaco Greeff 2bcdb07b62 Run electron (dev) from build directory 2017-09-11 10:37:09 +02:00
Jaco Greeff ceb1dd8d83 Electron app should not display extension install message 2017-09-11 10:00:51 +02:00
Jaco Greeff 093eb3915a Disable signer plugin 2017-09-11 09:31:28 +02:00
GitLab Build Bot dcea17f8c6 [ci skip] js-precompiled 20170910-175532 2017-09-10 18:00:22 +00:00
Nicolas Gotchac f1a050366f Fix slow balances (#6471)
* Update token updates

* Update token info fetching

* Update logger

* Minor fixes to updates and notifications for balances

* Use Pubsub

* Fix timeout.

* Use pubsub for status.

* Fix signer subscription.

* Process tokens in chunks.

* Fix tokens loaded by chunks

* Linting

* Dispatch tokens asap

* Fix chunks processing.

* Better filter options

* Parallel log fetching.

* Fix signer polling.

* Fix initial block query.

* Token balances updates : the right(er) way

* Better tokens info fetching

* Fixes in token data fetching

* Only fetch what's needed (tokens)

* Fix linting issues

* Revert "Transaction permissioning (#6441)"

This reverts commit eed0e8b03a.

* Revert "Revert "Transaction permissioning (#6441)""

This reverts commit 8f96415e58dde652e5828706eb2639d43416f448.

* Update wasm-tests.

* Fixing balances fetching

* Fix requests tracking in UI

* Fix request watching

* Update the Logger

* PR Grumbles Fixes

* PR Grumbles fixes

* Linting...
2017-09-10 18:03:35 +02:00
Nikolay Volf ee14a3fb31 WASM runtime update (#6467)
* refactor to new parity-wasm

* more errors refactoring

* final test

* update tests

* fix merge bugs
2017-09-10 18:02:31 +02:00
Robert Habermeier 375668bc40 Compatibility with whisper v6 (#6179)
* compatibility with whisper v6

* separate subprotocol for parity extensions

* kill version field
2017-09-10 18:02:14 +02:00
Robert Habermeier 246b5282e5 Merge pull request #6468 from paritytech/light-poa-2
light-poa round 2: allow optional casting of engine client to full client
2017-09-08 14:07:52 +02:00
Jaco Greeff 6d8b511d25 Merge master 2017-09-07 13:32:45 +02:00
Jaco Greeff ee4f370bdb Update CSS linting 2017-09-07 12:51:57 +02:00
Jaco Greeff afb101e234 Cleanup handler determination 2017-09-07 12:31:32 +02:00
Svyatoslav Nikolsky 8f434cd02c secretstore: attributes under docs (#6475) 2017-09-06 11:09:22 +02:00
Robert Habermeier ffced4e17f fix test build 2017-09-05 21:24:15 +02:00
Robert Habermeier 7d1c7a0474 allow optional casting of engine client to full client 2017-09-05 17:55:14 +02:00
Robert Habermeier ad39446e87 Revert "fixed master (#6465)"
This reverts commit 899538ae25.
2017-09-05 17:54:05 +02:00
Marek Kotewicz 7e3c081007 Merge pull request #6464 from paritytech/util_deps_cleanup
cleanup util dependencies
2017-09-05 16:21:05 +02:00
Marek Kotewicz 78c264769e Merge pull request #6463 from paritytech/earlymergedb_traces
removed redundant earlymergedb trace guards
2017-09-05 16:20:43 +02:00
Marek Kotewicz b6a1e29d11 Merge pull request #6461 from paritytech/util_error_chain
UtilError utilizes error_chain!
2017-09-05 16:20:19 +02:00
debris 4e66d3ca21 fixed old import in json-tests 2017-09-05 15:25:06 +02:00
debris 8b5ce1a772 Merge branch 'master' into util_deps_cleanup 2017-09-05 14:59:42 +02:00
debris 118081c45a Merge branch 'master' into earlymergedb_traces 2017-09-05 14:59:07 +02:00
debris 14d00a7f72 Merge branch 'master' into util_error_chain 2017-09-05 14:58:35 +02:00
Marek Kotewicz 899538ae25 fixed master (#6465)
* fixed master

* Revert "Merge pull request #6370 from paritytech/light-poa"

This reverts commit 3c60f99def, reversing
changes made to b731ccea18.
2017-09-05 14:53:09 +02:00
GitLab Build Bot e5bbabb2ba [ci skip] js-precompiled 20170905-115347 2017-09-05 11:58:41 +00:00
Jaco Greeff 1d8886fa7d Adjust Signer title colours 2017-09-05 13:33:57 +02:00
Axel Chalon be745f711f Refactor and port CLI from Docopt to Clap (#2066) (#6356)
* Refactor and port CLI from Docopt to Clap (#2066)

* Add --can-restart and --force-direct to help

* Add flag support to subc & move import/export options to subcommand

* Reorder subcommand args (put positional args last in CLI help message)
2017-09-05 12:30:22 +01:00
Nicolas Gotchac a62238c19d Add language selector in production (#6317)
* Add language selector in PRODUCTIN

* Fix wrong i18n keys

* Update the default i18n files
2017-09-05 12:26:29 +01:00
Tomasz Drwięga 7462a69583 eth_call returns output of contract creations (#6420)
* eth_call returns output of contract creations

* Fix parameters order.

* Save outputs for light client as well.
2017-09-05 12:22:19 +01:00
debris 4d0e05a8c1 cleanup util dependencies 2017-09-05 13:08:32 +02:00
debris 2b11448b45 removed redundant earlymergedb trace guards 2017-09-05 12:54:00 +02:00
debris 0a71ee95af Merge branch 'master' of github.com:paritytech/parity into util_error_chain 2017-09-05 12:38:15 +02:00
Marek Kotewicz c49beccadc Merge pull request #6459 from paritytech/fo-6418-dont-export-bigint
Refactor: Don't reexport bigint from util
2017-09-05 12:38:03 +02:00
debris 3497eab26c Merge branch 'fo-6418-dont-export-bigint' of github.com:paritytech/parity into util_error_chain 2017-09-05 12:15:39 +02:00
debris 236b6f1c3e UtilError uses error_chain!, moved OutOfBounds and Mismatched to unexpected crate 2017-09-05 12:14:03 +02:00
Fredrik 2b39af1f09 Updating imports that were introduced with merge 2017-09-05 12:08:02 +02:00
Arkadiy Paronyan eed0e8b03a Transaction permissioning (#6441) 2017-09-05 10:39:50 +01:00
debris ccd6ad52cc Merge branch 'fo-6418-dont-export-bigint' of github.com:paritytech/parity into util_error_chain 2017-09-05 11:15:39 +02:00
debris c623e5f232 ethcore-network does not use UtilError 2017-09-05 11:14:28 +02:00
Fredrik Harrysson dccdedc001 Merge branch 'master' into fo-6418-dont-export-bigint 2017-09-05 10:48:54 +02:00
Fredrik d1930ac708 Fix missing imports in tests I had missed 2017-09-05 10:18:21 +02:00
Fredrik a688370c9d Remove now unnecessary util glob imports 2017-09-05 10:18:07 +02:00
Svyatoslav Nikolsky 2df61d0a8c Merge pull request #6411 from paritytech/secretstore_tests
Added missing SecretStore tests - signing session
2017-09-05 10:35:21 +03:00
Robert Habermeier 3c60f99def Merge pull request #6370 from paritytech/light-poa
Light-client sync for contract-based PoA
2017-09-04 21:20:29 +02:00
Fredrik e54784bfeb Merge branch 'master' into fo-6418-dont-export-bigint
# Conflicts:
#	dapps/src/tests/helpers/registrar.rs
#	ethcore/evm/src/interpreter/shared_cache.rs
#	ethcore/light/src/client/header_chain.rs
#	ethcore/light/src/client/mod.rs
#	ethcore/light/src/net/mod.rs
#	ethcore/light/src/on_demand/request.rs
#	ethcore/light/src/on_demand/tests.rs
#	ethcore/light/src/provider.rs
#	ethcore/node_filter/src/lib.rs
#	ethcore/src/block.rs
#	ethcore/src/blockchain/blockchain.rs
#	ethcore/src/client/test_client.rs
#	ethcore/src/engines/authority_round/mod.rs
#	ethcore/src/engines/basic_authority.rs
#	ethcore/src/engines/mod.rs
#	ethcore/src/engines/tendermint/mod.rs
#	ethcore/src/engines/validator_set/contract.rs
#	ethcore/src/engines/validator_set/multi.rs
#	ethcore/src/engines/validator_set/safe_contract.rs
#	ethcore/src/engines/vote_collector.rs
#	ethcore/src/miner/external.rs
#	ethcore/src/miner/miner.rs
#	ethcore/src/miner/service_transaction_checker.rs
#	ethcore/src/miner/work_notify.rs
#	ethcore/src/pod_account.rs
#	ethcore/src/pod_state.rs
#	ethcore/src/snapshot/block.rs
#	ethcore/src/snapshot/consensus/work.rs
#	ethcore/src/snapshot/mod.rs
#	ethcore/src/snapshot/service.rs
#	ethcore/src/spec/spec.rs
#	ethcore/src/state/backend.rs
#	ethcore/src/trace/db.rs
#	ethcore/src/verification/queue/mod.rs
#	ethcore/src/verification/verification.rs
#	parity/informant.rs
#	rpc/src/v1/helpers/dispatch.rs
#	rpc/src/v1/helpers/light_fetch.rs
#	rpc/src/v1/helpers/signing_queue.rs
#	rpc/src/v1/impls/eth.rs
#	rpc/src/v1/impls/eth_filter.rs
#	rpc/src/v1/impls/eth_pubsub.rs
#	rpc/src/v1/impls/light/eth.rs
#	rpc/src/v1/impls/signing.rs
#	rpc/src/v1/tests/helpers/miner_service.rs
#	rpc/src/v1/tests/helpers/snapshot_service.rs
#	rpc/src/v1/tests/helpers/sync_provider.rs
#	rpc/src/v1/tests/mocked/eth.rs
#	stratum/src/lib.rs
#	sync/src/blocks.rs
#	sync/src/chain.rs
#	sync/src/light_sync/mod.rs
#	sync/src/tests/helpers.rs
#	sync/src/tests/snapshot.rs
#	updater/src/updater.rs
#	util/src/lib.rs
#	util/triehash/src/lib.rs
2017-09-04 18:32:55 +02:00
Fredrik 308f36a532 Don't reexport bigint from util 2017-09-04 16:36:49 +02:00
Jaco Greeff a5cc14ce8c Signer plugin attachment 2017-09-04 16:17:39 +02:00
Robert Habermeier 06e97d107b fix rwlock import 2017-09-04 14:52:39 +02:00
Robert Habermeier 7ac3dd0889 Merge branch 'light-poa' of github.com:paritytech/parity into light-poa 2017-09-04 12:49:06 +02:00
Robert Habermeier ffde22e711 move genesis_epoch_data function to spec 2017-09-04 12:46:32 +02:00
Robert Habermeier e69e8254db instantiate genesis epoch data if nonexistant in header_chain 2017-09-04 12:37:03 +02:00
Robert Habermeier 372779915f Merge branch 'master' into light-poa 2017-09-04 12:30:37 +02:00
Jaco Greeff 7818ed98c7 Add status bar extension plugins 2017-09-04 12:24:46 +02:00
NikVolf e00de28556 proper update 2017-09-03 19:54:18 +02:00
Marek Kotewicz b731ccea18 triehash is separated from util (#6428) 2017-09-03 09:11:14 +02:00
Gav Wood 0309462b36 Update signing_session.rs 2017-09-03 09:06:41 +02:00
Gav Wood b4cd7ca49a Update consensus_session.rs 2017-09-03 09:06:19 +02:00
Hawstein 7b8af30590 remove re-export of parking_lot in util (#6435) 2017-09-02 20:09:13 +02:00
Hawstein 1d95fe481f fix modexp bug: return 0 if base=0 (#6424) 2017-09-02 20:08:34 +02:00
Hawstein 2faa28ce9b separate semantic_version from util (#6438) 2017-09-02 13:14:21 +02:00
Hawstein 0b5285c282 move timer.rs to ethcore (#6437) 2017-09-02 10:54:39 +02:00
Arkadiy Paronyan ffae847b48 spacing around comas 2017-09-02 09:57:53 +02:00
GitLab Build Bot 6b8c9cac23 [ci skip] js-precompiled 20170901-161931 2017-09-01 16:33:31 +00:00
Marek Kotewicz 6d98f6fc9a Merge pull request #6433 from Hawstein/not-reexport-ansi_term
remove re-export of ansi_term in util
2017-09-01 17:43:33 +02:00
Hawstein cf366bdb29 util should not reexport ansi_term 2017-09-01 22:57:57 +08:00
Jaco Greeff fb7b11553a Test-drive extensions, status first 2017-09-01 14:29:57 +02:00
Jaco Greeff a1bde406de Don't clobber window.parity, extend 2017-09-01 13:03:00 +02:00
Craig O'Connor 56f46edab8 Pub sub blocks (#6139)
* fun start

* playin

* linting

* cleanup kk 1

* cleanup kk 2

* package

* oops

* grumbles

* lint

* lint 2

* all-possible-cases

* conflict resolution

* conflict resolution

* ready

* lint

* remove package-lock

* Restart subscription on transport close.

* Bring back the formatter.

* Fix formatter.
2017-09-01 12:23:41 +02:00
Robert Habermeier 47f7366a5c Merge pull request #6423 from paritytech/keccak_fn
replace trait Hashable with fn keccak
2017-08-31 17:20:05 +02:00
Jaco Greeff d0d8002b66 Override uiUrl 2017-08-31 15:36:57 +02:00
debris e9cc4c848b replace sha3 with keccak in few comments 2017-08-31 15:25:30 +02:00
Hawstein d31b7d8968 add more hash backward compatibility test for bloom (#6425) 2017-08-31 14:50:06 +02:00
Jaco Greeff d957a10f47 Update to cater for token URL 2017-08-31 14:08:15 +02:00
debris ba3b2712a1 fixed grumbles 2017-08-31 12:38:53 +02:00
Jaco Greeff 0238295654 Merge branch 'master' into ui-2 2017-08-31 12:16:27 +02:00
debris 94f717a255 Merge branch 'master' into keccak_fn 2017-08-31 11:53:26 +02:00
debris 7849fff41e finished 2017-08-31 11:35:41 +02:00
debris f0e8abb07b Hashable::sha3 -> fn keccak for ethcore 2017-08-30 19:18:28 +02:00
Hawstein e04d58f647 use one hasher in Bloom (#6404)
* remove the redundant hasher in Bloom

* add the test to check the hash backward compatibility
2017-08-30 18:38:05 +02:00
Robert Habermeier abfa8e95a2 Merge branch 'master' into light-poa 2017-08-30 18:18:52 +02:00
debris e120c75d17 Hashable::sha3 -> fn keccak for ethcore-network 2017-08-30 17:14:52 +02:00
debris 0e088d783d Hashable::sha3 -> fn keccak for ethcore-util 2017-08-30 16:20:21 +02:00
Axel Chalon 6b5ad69c22 Remove reexport of HeapSizeOf in util (#6419) 2017-08-30 16:04:47 +02:00
Marek Kotewicz f7e15f2450 Merge pull request #6194 from paritytech/Fix-4858
Rewards on closing blocks
2017-08-30 15:07:38 +02:00
debris 8a420d6580 fixed merge 2017-08-30 14:37:02 +02:00
debris 88200a1193 Merge branch 'master' into Fix-4858 2017-08-30 14:30:39 +02:00
Jaco Greeff 5b8236cdbd Update for non HTTP use 2017-08-30 12:47:14 +02:00
Marek Kotewicz b47e76a1a5 Merge pull request #6413 from paritytech/immediate-transitions-fix-2
ensure balances of constructor accounts are kept
2017-08-30 12:27:37 +02:00
Jaco Greeff be56a06790 Basic electron interface 2017-08-30 11:59:38 +02:00
Robert Habermeier 4e1fefc8ea test balance of spec-constructed account is kept 2017-08-30 11:57:48 +02:00
Jaco Greeff d7de40ab4c Init history in dapp module 2017-08-30 11:29:15 +02:00
Marek Kotewicz da91a07906 Merge pull request #6394 from paritytech/trie_recursion
removed recursion from triedbmut::lookup
2017-08-30 10:07:44 +02:00
Jaco Greeff b1428c2b56 Update packages 2017-08-30 09:29:28 +02:00
Robert Habermeier c1c7d7a3e2 ensure balances of constructor accounts are kept 2017-08-29 17:02:38 +02:00
Robert Habermeier 36d046f3ca do not activate genesis epoch in immediate transition validator contract (#6349) 2017-08-29 15:16:24 +02:00
Robert Habermeier d3c3e0b164 Merge branch 'master' into light-poa 2017-08-29 15:14:58 +02:00
Leo Arias 53401d6962 Use git for the snap version (#6271)
For commits with an annotated tag, that tag will be the version. For other commits, a git identifier will be used.
This way, there is no need to manually edit the snap version.
2017-08-29 15:14:07 +02:00
Gav Wood e3666457cf Consistent use of `,`s 2017-08-29 15:12:58 +02:00
Jaco Greeff 35202e28c2 Update webpack 2017-08-29 15:11:09 +02:00
Gav Wood 50495c6898 Merge branch 'master' into Fix-4858 2017-08-29 15:11:05 +02:00
Arkadiy Paronyan d520aa2633 Connection filter (#6359) 2017-08-29 14:38:01 +02:00
Svyatoslav Nikolsky a3eceb0c6c added missing SecretStore tests 2017-08-29 15:35:39 +03:00
Jaco Greeff 2593477151 Don't show tags for dapps 2017-08-29 13:03:06 +02:00
debris 100d1c7bf6 make triedbmut lookup shorter 2017-08-29 12:31:40 +02:00
debris e390e6b0af Merge branch 'master' into trie_recursion 2017-08-29 12:23:37 +02:00
Robert Habermeier 96e9a73a1b Merge pull request #6408 from paritytech/txqueue
Don't accept transactions above block gas limit.
2017-08-29 12:13:16 +02:00
Jaco Greeff c2f0778e80 Merge branch 'master' into ui-2 2017-08-29 11:58:53 +02:00
Jaco Greeff 39cf190db7 Update dependencies 2017-08-29 10:50:47 +02:00
Tomasz Drwięga b8e6799d67
Don't accept transactions above block gas limit. 2017-08-29 10:50:13 +02:00
Jaco Greeff 2a0820278b Update 2017-08-29 10:18:02 +02:00
Marek Kotewicz e7cc0477fb Merge pull request #6399 from paritytech/evm-trace-fix
Fix memory tracing.
2017-08-28 18:53:22 +02:00
Marek Kotewicz 17fa7edbbf Merge pull request #6393 from paritytech/earlymergedb_optimizations
earlydb optimizations
2017-08-28 18:46:41 +02:00
Marek Kotewicz c6b3faca64 Merge pull request #6321 from paritytech/plain_hasher
Optimized PlainHasher hashing. Trie insertions are >15% faster
2017-08-28 18:46:04 +02:00
Marek Kotewicz 8ead8061ee Merge pull request #6389 from paritytech/trie
Trie optimizations
2017-08-28 18:45:30 +02:00
Marek Kotewicz bf68c87a08 Merge pull request #6392 from paritytech/triehash
small optimizations for triehash
2017-08-28 18:44:47 +02:00
Tomasz Drwięga d90ec3d192 Bring back IPFS tests. (#6398) 2017-08-28 15:22:59 +02:00
debris 322da07010 Merge branch 'master' into trie 2017-08-28 15:08:22 +02:00
debris 8019d222a7 fixed TrieDb::seek accordingly to review suggestions 2017-08-28 15:08:16 +02:00
Tomasz Drwięga f9a08e285c Running state test using parity-evm (#6355)
* Initial version of state tests.

* Refactor state to support tracing.

* Unify TransactResult.

* Add test.
2017-08-28 14:25:16 +02:00
Nikolay Volf abecd80f54 Wasm math tests extended (#6354)
* extend math tests

* use latest wasm-tests

* cleanup

* avoid overflow

* use correct gas-

* and division
2017-08-28 14:12:40 +02:00
Tomasz Drwięga 3226e1ca33 Expose health status over RPC (#6274)
* Node-health to a separate crate.

* Initialize node_health outside of dapps.

* Expose health over RPC.

* Bring back 412 and fix JS.

* Add health to workspace and tests.

* Fix compilation without default features.

* Fix borked merge.

* Revert to generics to avoid virtual calls.

* Fix node-health tests.

* Add missing trailing comma.
2017-08-28 14:11:55 +02:00
debris 752dad6829 commit plain_hasher to util 2017-08-28 12:40:29 +02:00
Tomasz Drwięga 4f69ee0437
Add test to cover that. 2017-08-28 12:32:19 +02:00
debris e0c2995f78 Merge branch 'master' into plain_hasher 2017-08-28 12:30:05 +02:00
Jaco Greeff 1b0efa97b2 Merge branch 'master' into ui-2 2017-08-28 10:09:54 +02:00
Hawstein 622632616c fix bloom bitvecjournal storage allocation (#6390) 2017-08-28 09:19:04 +02:00
debris 4ac95b44e2 earlydb optimizations 2017-08-27 18:17:55 +02:00
debris 9cb4c99e5b removed triedbmut recursion 2017-08-27 17:33:03 +02:00
debris 301a4720b7 small optimizations for triehash 2017-08-27 16:50:22 +02:00
Marek Kotewicz 15c3233376 Merge pull request #6391 from paritytech/pending_panic
fixed pending block panic
2017-08-27 14:46:49 +02:00
debris faf0428b60 fixed pending block panic, closes #6239 2017-08-27 13:10:08 +02:00
Tomasz Drwięga dd3b6d49ee
Fix memory tracing. 2017-08-26 21:53:41 +02:00
debris 7246c9c74b removed redundant * 2017-08-26 19:16:08 +02:00
debris 5395f13528 optimized hashdb keys 2017-08-26 19:09:32 +02:00
debris 9083923f27 optimized memorydb insert, remove and emplace 2017-08-26 18:34:16 +02:00
debris 5d6c53c9bd triedb seek and descend is not recursive 2017-08-26 18:33:43 +02:00
Jaco Greeff 7438cfc47d Merge branch 'master' into ui-2 2017-08-25 12:14:56 +02:00
GitLab Build Bot b6024adf85 [ci skip] js-precompiled 20170825-090654 2017-08-25 09:11:39 +00:00
Jon Choi 5b6d47aeef Infoline less opaque for UI/visibility (#6364) 2017-08-25 16:31:48 +08:00
Robert Habermeier c79ecee094 only load ancestry from chain closure in engine 2017-08-24 16:29:31 +02:00
Robert Habermeier b953f9b66a glue for fetching epoch proofs from network 2017-08-24 15:17:48 +02:00
Jaco Greeff 10a7750027 Merge branch 'master' into ui-2 2017-08-24 13:49:34 +02:00
Tomasz Drwięga 5c0f9f1c40 Fix eth_call. (#6365)
* Fix eth_call.

* Fix warning spam.
2017-08-24 13:13:01 +02:00
Jaco Greeff d97f6b3812 Add @parity/jsonrpc explicitly 2017-08-24 13:07:22 +02:00
Jaco Greeff 3e08829c39 Merge branch 'master' into ui-2 2017-08-24 12:02:23 +02:00
Jaco Greeff ae66b98aac Update dependencies 2017-08-24 12:01:47 +02:00
Robert Habermeier 871a9c063e Merge branch 'master' into light-poa 2017-08-23 15:49:02 +02:00
Robert Habermeier 2ff3dff6ea serve epoch signals over network and check them 2017-08-23 15:37:35 +02:00
Marek Kotewicz 4bda7bf175 updated bigint (#6341) 2017-08-22 17:05:28 +02:00
Jaco Greeff 21e8c31aec Update dependencies 2017-08-22 16:51:40 +02:00
Jaco Greeff 630118b5a5 Merge branch 'master' into ui-2 2017-08-22 15:12:30 +02:00
Robert Habermeier 7f3e718851 EngineClient implementation for light client 2017-08-22 21:02:40 +08:00
Marek Kotewicz 5dac15fa85 Merge pull request #6347 from paritytech/trieiter
Optimize trie iter by avoiding redundant copying
2017-08-22 11:26:25 +02:00
Marek Kotewicz 6e8f97667a Merge pull request #6346 from paritytech/a5-rocksdb-logging
Only keep a single rocksdb debug log file
2017-08-22 11:26:06 +02:00
Arkadiy Paronyan d41dd13918 Tweaked snapshot params (#6344) 2017-08-22 11:24:56 +02:00
Robert Habermeier b4d3f78d67 Merge pull request #6345 from paritytech/networkid
Rename network_id to chain_id where applicable.
2017-08-22 17:01:23 +08:00
Robert Habermeier 9ae2ed39ec only use engineclient trait for engines, separated from client trait 2017-08-22 16:00:44 +08:00
debris 6c00dc71c1 Optimize trie iter by avoiding redundant copying 2017-08-21 18:35:39 +02:00
Marek Kotewicz 6f03c2bfd1 Merge pull request #6322 from paritytech/itertools
Itertools are no longer reexported from util, optimized triedb iter
2017-08-21 15:58:46 +02:00
5chdn 98f86d553a
Only keep a single debug log file, ref #1100 2017-08-21 15:33:31 +02:00
debris 10914c8346 avoid runtime underflow if nibbles are empty 2017-08-21 14:36:59 +02:00
Tomasz Drwięga 73644adf69
Rename network_id to chain_id where applicable. 2017-08-21 14:23:10 +02:00
GitLab Build Bot f3e7d7c725 [ci skip] js-precompiled 20170821-094253 2017-08-21 09:48:30 +00:00
Robert Habermeier 2985561012 detect epoch changes in light client 2017-08-21 18:31:25 +09:00
Marek Kotewicz e8841ae9e2 Merge pull request #6331 from paritytech/fix-startup-wizard
Better check the created accounts before showing Startup Wizard
2017-08-21 10:44:54 +02:00
debris b68375d462 less unsafe code 2017-08-21 10:19:53 +02:00
debris a247d5b2dc Merge branch 'master' into itertools 2017-08-21 09:12:36 +02:00
Tomasz Drwięga f79159a69c Improve some RPC error messages. (#6311) 2017-08-20 12:13:00 +08:00
cdetrio 4ccc82be92 fix panic in parity-evm json tracer (#6338) 2017-08-20 12:03:47 +08:00
Nikolay Volf 9e4c122cf3 WASM math test (#6305)
* wasm tests initial

* fix bug in bitswap
2017-08-20 12:02:59 +08:00
Marek Kotewicz 407c8c3fb9 rlp_derive (#6125)
* rlp_derive

* RlpEncodableWrapper, RlpDecodableWrapper

* use rlp_derive in parity

* fixed broken transaction Action serialization
2017-08-20 12:01:46 +08:00
Robert Habermeier 6ab0fc4e14 epoch transitions in the header chain DB 2017-08-19 17:07:31 +09:00
Tomasz Drwięga 5ed14c1064 Fix --chain parsing in evmbin. (#6314) 2017-08-18 17:44:40 +02:00
GitLab Build Bot 2c0a1b652c [ci skip] js-precompiled 20170818-143526 2017-08-18 14:40:04 +00:00
Tomasz Drwięga 010be34660 Unexpose methods on UI RPC. (#6295) 2017-08-18 15:58:45 +02:00
Tomasz Drwięga cd0c77dc5c Ignore errors from dappsUrl when starting UI. (#6296)
* Ignore errors from dappsUrl when starting UI.

* Fix linter.
2017-08-18 15:51:52 +02:00
Nicolas Gotchac 444233bd1b Better check the created accounts before showing Startup Wizard 2017-08-18 15:28:41 +02:00
debris 7de4a3a2df move plain hasher to a crate 2017-08-17 20:40:10 +02:00
Marek Kotewicz 2129edaae9 Merge pull request #6323 from paritytech/updated_bigint
updated bigint with optimized mul and from_big_indian
2017-08-17 19:09:03 +02:00
debris 209e8eff35 updated bigint with optimized mul and from_big_indian 2017-08-17 18:11:34 +02:00
debris 32d2cd74d4 ping ci 2017-08-17 17:35:00 +02:00
debris 4cb610d9ae Itertools are no longer reexported from util, optimized triedb iter 2017-08-17 16:05:26 +02:00
debris 697d17ae9b Optimized PlainHasher hashing 2017-08-17 14:59:43 +02:00
Robert Habermeier fefc756870 Merge pull request #6168 from paritytech/secretstore_stresstest
SecretStore: bunch of fixes and improvements
2017-08-16 21:20:22 +09:00
Afri febf774b4e Master requires rust 1.19 (#6308) 2017-08-16 12:24:42 +02:00
Svyatoslav Nikolsky a02db13278 moved attributes under docs 2017-08-16 09:40:00 +03:00
Robert Habermeier f19911660d Merge pull request #6302 from paritytech/ledger-sign
Add more descriptive error when signing/decrypting using hw wallet.
2017-08-16 05:55:28 +02:00
Robert Habermeier d5252ddf64 Merge pull request #6299 from paritytech/callgas
Increase default gas limit for eth_call.
2017-08-16 05:55:16 +02:00
Tomasz Drwięga 67a07adb0b
Add more descriptive error when signing/decrypting using hw wallet. 2017-08-15 12:11:34 +02:00
Tomasz Drwięga 5ff771b125
Cap gas limit for dapp-originating requests. 2017-08-15 10:38:49 +02:00
Tomasz Drwięga a34bea1dad
Fix balance increase. 2017-08-15 10:07:00 +02:00
Robert Habermeier 1e269c94a6 prove_transaction function on state 2017-08-15 00:12:40 +02:00
Tomasz Drwięga 60f6a3fed3
Increase default gas limit for eth_call. 2017-08-14 16:59:46 +02:00
Marek Kotewicz b9c1d0bd18 rust-toolchain file on master (#6266) 2017-08-14 13:47:53 +02:00
Nikolay Volf 4ab607d4de wasm-std refactoring (#6278) 2017-08-14 12:33:52 +03:00
GitLab Build Bot d115006597 [ci skip] js-precompiled 20170813-184308 2017-08-13 18:48:32 +00:00
Tomasz Drwięga 10068cee72 Extension fixes (#6284)
* Fix token symbols in extension.

* Allow connections from firefox extension.
2017-08-13 17:41:50 +02:00
Tomasz Drwięga b5b6e3dd2a Fix a hash displayed in tooltip when signing arbitrary data (#6283)
* Allow connections from firefox extension.

* Displaying actual data that will be signed on hover.

* Display a tooltip.

* Revert "Allow connections from firefox extension."

This reverts commit d3323b76fe28564c2366ceec3d891de19884192f.
2017-08-13 17:41:08 +02:00
Jaco Greeff f0e20142af Rebuild 2017-08-11 03:19:28 +02:00
Tomasz Drwięga 604ea5d684 Time should not contribue to overall status. (#6276) 2017-08-10 18:48:03 +02:00
Tomasz Drwięga 146feea4a6 Add --to and --gas-price (#6277) 2017-08-10 18:47:23 +02:00
Tomasz Drwięga 65482c5e9d Fix dapps CSP when UI is exposed externally (#6178)
* Allow embeding on any page when ui-hosts=all and fix dev_ui

* Fix tests.
2017-08-10 18:32:10 +02:00
Anton Gavrilov bfd238e000 Style fixed after review 2017-08-10 12:36:29 +02:00
GitLab Build Bot ecd880c8e7 [ci skip] js-precompiled 20170810-101054 2017-08-10 10:16:01 +00:00
Tomasz Drwięga 30be0972b9 Add warning to web browser and fix links. (#6232) 2017-08-10 11:16:02 +02:00
GitLab Build Bot b21932687a [ci skip] js-precompiled 20170809-182421 2017-08-09 18:29:28 +00:00
Björn Wagner e128285a77 Replace 'home.parity' with 'parity.web3.site' (#4771) 2017-08-09 19:07:15 +02:00
Craig O'Connor 7d17d77254 Dapp refresh (#5752)
* RwLock

* getting there

* argh

* parking_lot

* rpc

* wax on wax off

* almost there

* remove lock

* write over read

* works

* linting

* small updates

* dissapearing act

* router update

* complete

* one m

* grumbles1

* grumbles part II

* parking_lot->util

* missed test case

* fied package-lock.json

* small fixes

* 404 tests failing

* cleanup

* cleanup 2

* updates and the likes

* play

* simplify filter

* f-ing bugs

* read->write

* Address own grumbles.

* Fix test.
2017-08-09 19:06:40 +02:00
Nicolas Gotchac d6eb053826 Add support for ConsenSys multisig wallet (#6153)
* First draft of ConsenSys wallet

* Fix transfer store // WIP Consensys Wallet

* Rename walletABI JSON file

* Fix linting

* Fix wrong daylimit in wallet modal

* Confirm/Revoke ConsensysWallet txs

* Linting

* Change of settings for the Multisig Wallet
2017-08-09 19:06:14 +02:00
Svyatoslav Nikolsky cc95edf4dc fixed grumbles 2017-08-09 18:17:28 +03:00
Marek Kotewicz a8a11e56db updated jsonrpc (#6264) 2017-08-09 17:40:52 +03:00
Jaco Greeff 039729a074 Export default function for shellMiddleware 2017-08-09 13:17:52 +02:00
Jaco Greeff 4176936d34 Move shell APIs to middleware 2017-08-09 13:03:26 +02:00
Svyatoslav Nikolsky 45087599ef lost commit 2017-08-09 12:33:41 +03:00
Svyatoslav Nikolsky 9b34c77f98 Merge branch 'master' into secretstore_stresstest 2017-08-09 12:29:29 +03:00
Svyatoslav Nikolsky 33ba5b63f3 SecretStore: encrypt messages using private key from key store (#6146)
* do not cache ACL storage contract

* when error comes before initialization

* initial KeyServerSet commit

* update_nodes_set in maintain

* do not connect to self

* fixed connection establishing

* removed println

* improved KeyServerSet tracing

* moved parsing to KeyServerSet

* re-read only when blockchain is changed

* do not try to connect if not a part of cluster

* improved logging

* fixed tests

* NodeKeyPAir trait

* fixed parity to use new trait

* continue integrating with parity

* updated parity for NodeKeyPair

* completed KeyStoreNodeKeyPair

* removed comment

* removed dependency && style
2017-08-09 11:09:40 +02:00
Jaco Greeff f967bc4ac0 Don't mask top-level params 2017-08-09 11:01:34 +02:00
Alexey d209100a60 Wasm storage read test (#6255)
* Test for read from prepopulated storage implemented

* wasm-tests submodule update

* fix identation

* comment for storage_read added
2017-08-09 10:57:54 +02:00
Marek Kotewicz 78b3d71745 propagate stratum submit share error upstream, fixes #6258 (#6260) 2017-08-09 10:57:23 +02:00
Jaco Greeff 2d5541f533 Add shell_loadApp API 2017-08-09 10:55:15 +02:00
Jaco Greeff 9aae4614a1 Update with latest package versions 2017-08-09 09:43:02 +02:00
Jaco Greeff 317addb7e3 Remove ~ alias 2017-08-09 09:36:40 +02:00
Jaco Greeff a11e9acd12 Merge branch 'master' into ui-2 2017-08-09 09:32:22 +02:00
Tomasz Drwięga e93466c897 Using multiple NTP servers (#6173)
* Small improvements to time estimation.

* Allow multiple NTP servers to be used.

* Removing boxing.

* Be nice.

* Be nicer.

* Update list of servers and add reference.
2017-08-09 08:45:07 +02:00
Afri 72fa6a79a2 Add GitHub issue templates. (#6259)
* Prepare GH templates for contributors

* Add GH issue template

* Add homebrew as option
2017-08-09 08:43:40 +02:00
Marek Kotewicz e7a7bd6695 Merge pull request #6241 from paritytech/poa-proof-fix
format instant change proofs correctly
2017-08-08 20:58:26 +02:00
Marek Kotewicz 80db43442e Merge pull request #6231 from paritytech/price_info_util
price-info does not depend on util
2017-08-08 20:56:12 +02:00
Marek Kotewicz f2929f3b19 Merge pull request #6233 from paritytech/native_contracts_util
native-contracts crate does not depend on util any more
2017-08-08 20:55:36 +02:00
Afri afbda7baa8 Bump master to 1.8.0 (#6256)
* Bump master to 1.8.0

* Use jsonrpc-core to avoid breaking master

* Update Cargo.lock
2017-08-08 20:18:00 +02:00
Svyatoslav Nikolsky 872e5537bb SecretStore: do not cache ACL contract + on-chain key servers configuration (#6107)
* do not cache ACL storage contract

* when error comes before initialization

* initial KeyServerSet commit

* update_nodes_set in maintain

* do not connect to self

* fixed connection establishing

* removed println

* improved KeyServerSet tracing

* moved parsing to KeyServerSet

* re-read only when blockchain is changed

* do not try to connect if not a part of cluster

* improved logging

* fixed tests
2017-08-07 18:54:05 +02:00
Afri a20892e5e6 Fix the README badges (#6229)
* Update README.md

* Set latest release to 1.7
2017-08-07 18:12:00 +02:00
Jaco Greeff b0228e66a0 Update/rebuild after merge 2017-08-07 12:27:10 +02:00
Jaco Greeff a48f321fac Merge branch 'master' into ui-2 2017-08-07 12:02:39 +02:00
GitLab Build Bot 67ccfa1da1 [ci skip] js-precompiled 20170807-093816 2017-08-07 09:43:01 +00:00
Marek Kotewicz bdeea80032 Merge pull request #6248 from paritytech/tiny_keccak_up
updated tiny-keccak to 1.3
2017-08-07 10:58:36 +02:00
Jaco Greeff 0371dcb7bd Explicityly serve via /index.html 2017-08-07 10:20:27 +02:00
debris 455ecf700c updated tiny-keccak to 1.3 2017-08-07 10:06:02 +02:00
GitLab Build Bot 82f90085ee [ci skip] js-precompiled 20170807-004826 2017-08-07 00:53:11 +00:00
Robert Habermeier 66ab102111 Merge pull request #6244 from pietervdvn/master
Small grammatical error
2017-08-07 02:15:06 +02:00
Pieter Vander Vennet 2adc25eec7 Merge pull request #1 from pietervdvn/pietervdvn-patch-1
Fixed typo (s/seems is/seems)
2017-08-06 18:35:19 +02:00
Pieter Vander Vennet ee07bf29ce Fixed typo (s/seems is/seems) 2017-08-06 18:33:54 +02:00
Robert Habermeier e43b1084c3 format instant change proofs correctly 2017-08-04 21:43:31 +02:00
Jaco Greeff 28e2383778 Update build 2017-08-04 16:23:54 +02:00
Anton Gavrilov dd91121017 Common method for tracing refactored due to comments on review 2017-08-04 16:06:12 +02:00
Jaco Greeff b7ebfab575 Allow webpack to parse modules 2017-08-04 15:58:33 +02:00
Tomasz Drwięga f157461ee1 Multi-call RPC (#6195)
* Removing duplicated pending state accessors in miner.

* Merge miner+client call.

* Multicall & multicall RPC.

* Sensible defaults.

* Fix tests.
2017-08-04 15:58:14 +02:00
debris 35bfbc39f8 native-contracts crate does not depend on util any more 2017-08-04 15:45:47 +02:00
Jaco Greeff 49a4499d52 Update webpack 2017-08-04 14:28:55 +02:00
debris 7ddfd2f030 revert fetch is_success changes 2017-08-04 14:12:27 +02:00
Jaco Greeff 44a7c3d0b6 Re-add modules path 2017-08-04 13:50:51 +02:00
Jaco Greeff 1bf851ad91 Really excluse node_modules 2017-08-04 13:44:38 +02:00
debris f72196f1bb a bit more idiomatic price-info 2017-08-04 13:39:57 +02:00
Jaco Greeff 2df7a5fe51 Cheap source-maps for development 2017-08-04 13:26:56 +02:00
Jaco Greeff 0892bc90ed Update sourcemap types 2017-08-04 13:24:03 +02:00
debris 63f8cc3503 price-info does not depend on util 2017-08-04 13:06:01 +02:00
Marek Kotewicz 62153b1ff0 Merge pull request #6223 from paritytech/instant_seal_fix
InstantSeal fix
2017-08-04 12:47:05 +02:00
Jaco Greeff c088a9a660 Update dependencies 2017-08-04 11:57:05 +02:00
Anton Gavrilov 655ed93ee8 Common engine method for bestowing rewards created 2017-08-04 11:28:26 +02:00
Robert Habermeier ae9f35668e Merge pull request #6227 from paritytech/rlp-check
Untrusted RLP length overflow check
2017-08-03 21:20:38 +02:00
NikVolf d30e47a50e add test 2017-08-03 21:49:40 +03:00
NikVolf 6b3f5c977a overflow check in addition 2017-08-03 21:35:51 +03:00
Robert Habermeier 0abf2abc81 checking for signals in the light client 2017-08-03 18:18:19 +02:00
Jaco Greeff e7641e38d8 Update build 2017-08-03 16:50:35 +02:00
debris b0f9d73f6a InstantSeal fix 2017-08-03 16:42:56 +02:00
Anton Gavrilov 30434325a2 Modification of traces moved to engines 2017-08-03 15:55:58 +02:00
Jaco Greeff 34f9e69bff Update file-loader 2017-08-03 13:30:17 +02:00
Anton Gavrilov 01a02a8985 Wasm test link changed 2017-08-02 19:02:01 +02:00
Jaco Greeff e99f86a052 Update locked versions 2017-08-02 17:54:21 +02:00
Jaco Greeff f94f69c05c Import UI components directly 2017-08-02 17:34:16 +02:00
Anton Gavrilov 01ea968d4f Merge with master 2017-08-02 17:24:34 +02:00
Jaco Greeff 696089c479 Update with latest dapps 2017-08-02 17:16:26 +02:00
Anton Gavrilov 2e840bc89c Fixed comments after the review 2017-08-02 17:10:06 +02:00
Jaco Greeff 45f91facf1 Don't copy source window 2017-08-02 13:56:09 +02:00
Marek Kotewicz 0c7c34e609 Chainspec validation (#6197)
* chainspec validation

* better error formatting for chainspec

* lint validate_chainspecs.sh

* quit takes &str instead of S: AsRef<str>

* push CI

* don't double check spec validity
2017-08-02 12:50:36 +02:00
Tomasz Drwięga 8de1e92b99 Fix cache path when using --base-path (#6212) 2017-08-02 12:38:58 +02:00
Jaco Greeff ffd53edf89 Update build 2017-08-02 11:15:36 +02:00
Svyatoslav Nikolsky 47c058a337 fixed warning 2017-08-02 12:05:47 +03:00
Jaco Greeff 0a3a860b27 Add dapp-develop 2017-08-02 10:02:53 +02:00
Jaco Greeff cbd32035c8 Cleanup webpack config 2017-08-02 08:44:56 +02:00
Jaco Greeff aa95c09a88 Re-add happypack for babel builds 2017-08-01 18:11:35 +02:00
GitLab Build Bot 191f409741 [ci skip] js-precompiled 20170801-155944 2017-08-01 16:06:06 +00:00
Jaco Greeff 34a8daa629 Add addresses dapp 2017-08-01 17:42:04 +02:00
Jaco Greeff 1d96ba7dfc Update 2017-08-01 17:35:17 +02:00
Marek Kotewicz b24053f4df Merge pull request #6187 from paritytech/split
removed std reexports from util && fixed broken tests
2017-08-01 17:19:02 +02:00
debris 7f85c0ce2a Fixed evmbin 2017-08-01 16:41:33 +02:00
Jaco Greeff 3006ab9253 Updated with working accounts 2017-08-01 16:07:35 +02:00
debris af8c5bb31a fix for util on linux 2017-08-01 15:53:50 +02:00
Jaco Greeff 67db54d765 Update webpack config for semantic 2017-08-01 15:51:03 +02:00
Jaco Greeff dea25b194e Update build (yes, external dapps launch) 2017-08-01 15:36:32 +02:00
Jaco Greeff 9b678a58e8 Use serviceWorker from shared 2017-08-01 15:05:44 +02:00
Jaco Greeff 52828c0444 Update inject 2017-08-01 15:04:07 +02:00
Jaco Greeff f8bf4a1522 Update build to pull from external repos 2017-08-01 14:41:13 +02:00
debris a2c05123fd Merge branch 'master' into split 2017-08-01 14:24:47 +02:00
Marek Kotewicz 5b0eeb75ef Merge pull request #6132 from paritytech/wasm-mvp
WASM MVP continued
2017-08-01 14:08:58 +02:00
NikVolf d82c2c8cc6 add targets to the CI 2017-08-01 14:42:31 +03:00
NikVolf c1108da6e9 fixed wasm tests 2017-08-01 14:35:43 +03:00
NikVolf 017430e803 fixed evm tests 2017-08-01 14:33:49 +03:00
Jaco Greeff c509733a30 Split all packages/* to external repos 2017-08-01 12:51:41 +02:00
Nikolay Volf b7006034b1 Decouple virtual machines (#6184)
* work in progress for splitting vms

* evm working

* Evm -> Vm

* wasm converted

* ethcore working

* test fixes
2017-08-01 13:37:57 +03:00
debris 6e5a563c06 fixed scripts and reverted ipfs comment 2017-08-01 12:32:34 +02:00
Marek Kotewicz c4025622de Merge pull request #6177 from paritytech/wasm-realloc-test
Realloc test added
2017-08-01 11:04:59 +02:00
Jaco Greeff b5f4c40406 Re-add webpack-dev-server 2017-08-01 08:12:21 +02:00
Jaco Greeff 317a59d550 Build update 2017-08-01 08:02:28 +02:00
GitLab Build Bot a6891e9f9f [ci skip] js-precompiled 20170731-215156 2017-07-31 21:57:18 +00:00
Jaco Greeff 0e7c115b73 Update build 2017-07-31 22:53:29 +02:00
debris bfbeda4ede fixed tests 2017-07-31 20:17:19 +02:00
debris 3c7ba5045d Merge branch 'master' into split 2017-07-31 19:40:33 +02:00
Maciej Hirsz 46126b5fb6 Merge pull request #6196 from paritytech/mh-pubnode-extacc
Re-enable wallets, fixed forgetting accounts
2017-07-31 18:14:50 +02:00
Anton Gavrilov 141c2fd34a Fixed comments after review and test after rebase 2017-07-31 18:10:06 +02:00
Jaco Greeff 0b71baac4a Remove embed (for now) 2017-07-31 17:56:33 +02:00
maciejhirsz 2ca4adb62c Re-enable wallets, fixed forgetting accounts 2017-07-31 17:51:23 +02:00
Jaco Greeff 7f6e2a3a35 Build with parallel-webpack 2017-07-31 17:08:51 +02:00
debris 81b57ceddb Merge branch 'master' into split 2017-07-31 16:19:59 +02:00
fro fe6bdc870c realloc test contract submodule update 2017-07-31 16:54:26 +03:00
Jaco Greeff fdebeaf95b Update webpack 2017-07-31 13:58:18 +02:00
Anton Gavrilov 8826fdb03a Merge with head 2017-07-31 13:49:44 +02:00
Anton Gavrilov e8095826bf Tabs corrected 2017-07-31 13:42:40 +02:00
Anton Gavrilov 9374e31072 Miner field renamed to author 2017-07-31 13:42:40 +02:00
Anton Gavrilov 1a3f3ffdbf Transaction ids made optional in order to reflect not transactional traces 2017-07-31 13:42:40 +02:00
Anton Gavrilov 45043c3f52 Fixed errors after merge with master 2017-07-31 13:42:40 +02:00
Anton Gavrilov f2d12aebef Unit tests for tracing reward added 2017-07-31 13:42:40 +02:00
Anton Gavrilov 3fdb912db6 Complete version of tracing test with reward 2017-07-31 13:42:40 +02:00
Anton Gavrilov 5086dc3024 Working test with block reward added 2017-07-31 13:42:34 +02:00
Anton Gavrilov 204a63a00e Warnings removed 2017-07-31 13:40:45 +02:00
Anton Gavrilov 06862c7dee Tracing for rewards added. Without tests for now 2017-07-31 13:40:37 +02:00
Robert Habermeier 003eef982b Move more params to the common section. (#6134)
* move common forks and parameters to common params

* port specs over to new format

* fix RPC tests
2017-07-31 12:34:29 +02:00
Anton Gavrilov bb043ba2fd Tabs corrected 2017-07-31 12:23:47 +02:00
Anton Gavrilov 94efa3ac19 Miner field renamed to author 2017-07-31 12:06:38 +02:00
Jaco Greeff 58c3948316 Remove extra options 2017-07-31 12:06:21 +02:00
Jaco Greeff ec62d6f7e0 Additional compose removed 2017-07-31 11:30:46 +02:00
Jaco Greeff 6a51ff22d0 Cleanup unused vars 2017-07-31 11:24:54 +02:00
Jaco Greeff 6349da22ac Fix NODE_ENV=production build 2017-07-31 11:24:25 +02:00
kaikun213 9c5ef1f776 Merge pull request #6161 from paritytech/whisper-js
Whisper js
2017-07-31 11:23:52 +02:00
kaikun213 32fafd7a24 CI fix: Interface shh subscribe params 2017-07-31 10:58:49 +02:00
debris 88cc4cd17a Merge branch 'master' into split 2017-07-29 23:44:55 +02:00
debris 48f28fe29c fixed json_tests 2017-07-29 23:19:33 +02:00
debris 2b02651bbf alway test --all (temporary exclude ipfs and evmjit) 2017-07-29 22:54:04 +02:00
debris c4989ddc44 removed util::common 2017-07-29 22:49:10 +02:00
debris eecd823d32 util reexports less std 2017-07-29 21:10:14 +02:00
Robert Habermeier fbb9affadb Merge pull request #6185 from Grix/master
typo in uninstaller
2017-07-29 18:59:47 +02:00
Gitle Mikkelsen 9f0bfa01ca typo in uninstaller 2017-07-28 23:18:02 +02:00
Robert Habermeier 2bd5c3dba7 checking proofs in safe contract 2017-07-28 19:38:52 +02:00
Nicolas Ochem f212ae6322 fix #6052. honor --no-color for signer command (#6100)
* fix #6052. honor --no-color for signer command

* replace call to paint closure with the body, apply to generate_new_token too
2017-07-28 19:07:38 +02:00
Joseph Mark b5f1524e78 Refactor --allow-ips to handle custom ip-ranges (#6144)
* Add checks for additional reserved ip addresses

100.64.0.0/10 and 240.0.0.0/4 are both reserved but not currently
filtered.

* Add check for special purpose addresses

192.0.0.0/24 - Used for the IANA IPv4 Special Purpose Address Registry

* Refactor ip_utils (#5872)

* Add checks for all ipv4 special use addresses
* Add comprehensive ipv4 test cases

* Refactor Ipv6 address checks (#5872)

* Refactor AllowIP (#5872)

* Add IpFilter struct to wrap predefined filter (AllowIP) with custom
allow/block filters.
* Refactor parsing of --allow-ips to handle custom filters.
* Move AllowIP/IpFilter from ethsync to ethcore-network where they
are used.

* Revert Cargo.lock

* Tests for custom ip filters (#5872)

* Add "none" as a valid argument for --allow-ips to allow narrow
custom ranges, eg.: --allow-ips="none 10.0.0.0/8"
* Add tests for parsing filter arguments and node endpoints.
* Add ipnetwork crate to dev dependencies for testing.

* Add ipv6 filter tests (#5872)

* Revert parity-ui-precompiled to master

* Fix minor detail in usage.txt (#5872)

* Spaces to tabs

* Rename IpFilter::new() to ::default()

* Small readability improvements

* Test (#5872)

* Revert "Test (#5872)"

This reverts commit 7a8906430a6dad633fe29df3dca57f1630851fa9.
2017-07-28 19:06:39 +02:00
Afri ad30a6899b Update Changelog for 1.6.10 and 1.7.0 (#6183)
* Update changelog for 1.6.10

* Update changelog for 1.7.0

* Move 1.7.0 to top

* Rephrase contract warp

* Update final 1.7.0 changelog

* Update beta backports in Changelog
2017-07-28 18:15:04 +02:00
Jaco Greeff abb62d5c2a Ui 2 parity build fixes (#6182)
* Update API reference

* Deprecation warning

* Add missing parity-reactive-ui

* Add dapps to packages/dapps

* Add parity.js dependency

* Update with js-ui with compiled bundle.js
2017-07-28 17:56:48 +02:00
fro e234b7fdbf realloc test added 2017-07-28 16:38:03 +03:00
Jaco Greeff 4000ec681f Ui 2 js build fixes (#6176)
* Update API reference

* Deprecation warning

* Add missing parity-reactive-ui

* Add dapps to packages/dapps

* Add parity.js dependency
2017-07-28 15:37:58 +02:00
Jef e84f308264 Fix unsoundness in ethash's unsafe code (#6140)
* Fix benchmarks

* Fix unsoundness in uses of unsafety

* Remove most uses of unsafe indexing and ptr::copy_nonoverlapping

This commit also includes a completely absurd optimisation that I
promise is an honest win. You can check the benchmarks, I barely
believe it myself.

* Add safety comment

* Add more safety comments
2017-07-28 14:26:22 +02:00
Anton Gavrilov 1f3f91136c Transaction ids made optional in order to reflect not transactional traces 2017-07-28 13:41:51 +02:00
kaikun213 e70d5c52e4 Updated semantic-ui-react version (js-ui) 2017-07-28 11:51:59 +02:00
Jaco Greeff a1b8fabd99 Ui 2 packages (#6169)
* Ensure all internal dapps have package.json

* Update compilation rules

# Conflicts:
#	js/src/redux/providers/balancesActions.js
#	js/src/ui/Form/TypedInput/typedInput.js

* Remove SignerIcon

* Cleanup providers

* Enable request of new token from app

* Queue when no token (yet)

* Add location & token request

* Cleanup send logic

* Request token

* Request comms token

* Remove yarn.lock (not updated)

* Update version to 1.99.99 (publish prepare)

* Move jsonrpc to seperate repo

* Update jsonrpc references

* Update repo info

* Update repo info

* Additional debugging

* Update repo references

* Move ABI to js-abi repo

* Move webWorker to shared

* Fix package reference

* Worker location

* Move js-ui & js-shared components

* Update file references

* Update package repo locations

* Remove debugging info

* Cleanup debug

* Split api into own repo

* Update api local references

* Update app loading

* Update dependencies

* Allow serving of /parity-utils

* Error when EthereumProvider has not been attached

* Use inject.js

* Correct appId retrieval
2017-07-28 10:25:34 +02:00
Jaco Greeff 5830767273 Add oo7 deps 2017-07-27 20:23:36 +02:00
Anton Gavrilov b1935340c8 Fixed errors after merge with master 2017-07-27 19:15:25 +02:00
GitLab Build Bot 671ed1b9db [ci skip] js-precompiled 20170727-163754 2017-07-27 16:42:35 +00:00
Anton Gavrilov af1fbb39ca Unit tests for tracing reward added 2017-07-27 18:23:17 +02:00
Anton Gavrilov 53c3b772dd Complete version of tracing test with reward 2017-07-27 18:21:43 +02:00
Anton Gavrilov 73128039a6 Working test with block reward added 2017-07-27 18:21:36 +02:00
Anton Gavrilov 16f39487ba Warnings removed 2017-07-27 18:20:11 +02:00
Anton Gavrilov ab6153853b Tracing for rewards added. Without tests for now 2017-07-27 18:19:46 +02:00
Jaco Greeff 53bde282bb Link dapp-develop/account 2017-07-27 18:12:42 +02:00
kaikun213 7a810def28 Shh documentation (jsonrpc interface) 2017-07-27 18:07:25 +02:00
Jaco Greeff 0bdd4a93b8 Add missing dependencies 2017-07-27 17:57:47 +02:00
Jaco Greeff 3e85bebc66 Add missing package dependencies 2017-07-27 17:53:26 +02:00
Tomasz Drwięga 9902714fb4 Don't display an overlay in case the time sync check fails. (#6164)
* Small improvements to time estimation.

* Temporarily disable NTP time check by default.
2017-07-27 17:36:23 +02:00
Tomasz Drwięga 0209c6e0ff Fix connecting to wildcard addresses. (#6167) 2017-07-27 17:35:05 +02:00
Robert Habermeier d53028d0a8 Merge pull request #6162 from paritytech/fix-whisper-sub-name
fix subscription name
2017-07-27 15:51:47 +02:00
kaikun213 f245d66c8a shh_subscription added 2017-07-27 15:48:49 +02:00
Jutta Steiner 98e0618750 Update SECURITY.md 2017-07-27 15:46:26 +02:00
Jutta Steiner 2d9a15324d Including legal disclaimer 2017-07-27 15:44:39 +02:00
Svyatoslav Nikolsky c345bc3d85 cli option to disable SS ACL check 2017-07-27 15:48:07 +03:00
fro 8238fb37f3 new env exports added
___syscall140
___syscall146
___syscall54
_llvm_trap
2017-07-27 15:37:59 +03:00
Robert Habermeier 70ef33f6fe Light client improvements (#6156)
* no seal checking

* import command and --no-seal-check for light client

* fix eth_call

* tweak registry dapps lookup

* ignore failed requests to non-server peers
2017-07-27 13:50:12 +02:00
kaikun213 31a0f5ef28 contractDevelop Debugger (Bonds) in progress 2017-07-27 13:24:23 +02:00
kaikun213 e317fcf1d8 accounts.js -> Parity-reactive-ui accountCard 2017-07-27 13:24:00 +02:00
kaikun213 cd0fbbe948 whisper-js 2017-07-27 13:16:56 +02:00
Robert Habermeier 18fbf3c174 only add pubsub if generic pubsub off 2017-07-27 12:55:08 +02:00
Robert Habermeier 1be3e5ec5e fix subscription name 2017-07-27 12:51:12 +02:00
Svyatoslav Nikolsky 7c05a906d0 cli option to disable SS HTTP API 2017-07-27 13:29:09 +03:00
kaikun213 b13cd0d484 getFilterChanges -> getFilterMessages , subscribe & unsubscribe
subscription is currently not working (method not found)
2017-07-27 12:18:07 +02:00
Svyatoslav Nikolsky c466def1e8 improved logging 2017-07-27 11:33:09 +03:00
Feynman Liang 5eb8cea6e7 Tendermint epoch transitions (#6085)
* Adds signals_epoch_end to tendermint

* Adds is_epoch_end

* Adds snapshot_components

* Adds tendermint Epoch Verifier

* Fix documentation typos

* Change check_finality_proof to panic

* Fix compilation

* Adds Unconfirmed path to epoch_verifier

* Verify if address is validator in EpochVerifier

* check_finality_proof errors on failure

* Don't share combine/destructure_proofs

* Remove invalid import

* Remove duplicate epoch verifier trait

* Fix docs

* Adds recover stub to tendermint EpochVerifier

* Adds verify_light test

* Avoid boxed closure

* Style fixes
2017-07-26 16:25:32 +01:00
Jaco Greeff a068f72f08 Ui 2 pubsub components (#6152)
* Remove Application.orig from merge

* Disable i18n extraction for development

* Retrieve blockNumber via pubsub

* Chain via pubsub

* StatusIndicator with health

* WIP

* WIP

* s/BlockStatus/BlockNumber/

* Adjust BlockNumber display

* Cleanup debug

* Fix statusbar indicator

* NetPeers component

* Add BlockTimestamp

* Export statics on observer

* Cleanup debug logs

* Update references
2017-07-26 16:54:47 +02:00
Robert Habermeier 7d348e2260 light client fixes (#6148)
* light client fixes

* fix memory-lru-cache

* clear pending reqs on disconnect
2017-07-26 15:48:00 +02:00
Svyatoslav Nikolsky dcfb8c1a10 fixed generation session lags 2017-07-26 14:09:52 +03:00
Svyatoslav Nikolsky 417a037ac5 improved logging 2017-07-26 14:09:41 +03:00
Jaco Greeff 09e40c2f0d Upgrade webpack 2017-07-26 12:08:34 +02:00
Jaco Greeff decc5922de Fix previous merge 2017-07-26 11:57:14 +02:00
Jaco Greeff 715fb688d3 Merge branch 'master' into ui-2 2017-07-26 11:54:54 +02:00
kaikun213 689993a592 whisper parity.js api 2017-07-25 17:58:52 +02:00
Svyatoslav Nikolsky 4938dfd971 removed comment 2017-07-25 17:57:27 +03:00
Svyatoslav Nikolsky eb895fbb31 completed KeyStoreNodeKeyPair 2017-07-25 17:54:32 +03:00
Svyatoslav Nikolsky 2e9df2c39d updated parity for NodeKeyPair 2017-07-25 16:30:24 +03:00
Robert Habermeier ee1dfb5605 Merge pull request #6044 from paritytech/issues/4673
`--config` option handles bundled presets
2017-07-25 13:05:49 +02:00
kaikun213 55bef6ec2f Merge remote-tracking branch 'origin/master' 2017-07-25 11:13:39 +02:00
Svyatoslav Nikolsky 9e30d85fdc continue integrating with parity 2017-07-25 10:19:48 +03:00
GitLab Build Bot aa09cb266d [ci skip] js-precompiled 20170725-071056 2017-07-25 07:16:04 +00:00
Svyatoslav Nikolsky fb68b0924a fixed parity to use new trait 2017-07-25 09:56:23 +03:00
Enrique Fynn 985b0fbf7f Render correctly when query input is false in a contract (#6137) 2017-07-25 08:45:14 +02:00
Nicolas Gotchac 58fec9181f Filter tokens logs from current block, not genesis (#6128)
* Filter tokens logs from current block, not genesis

* Fix linting
2017-07-25 08:39:41 +02:00
Gav Wood 0b46cce95f Deduplicate help text. 2017-07-25 08:38:20 +02:00
Svyatoslav Nikolsky 45f2b82411 NodeKeyPAir trait 2017-07-25 09:24:54 +03:00
Joseph Mark 8b3ec61151
Merge branch 'master' into issues/4673 2017-07-25 09:03:21 +07:00
Joseph Mark c522f564a9
Update usage doc for --config (#4673) 2017-07-25 09:02:37 +07:00
Jaco Greeff de76b8a465 Merge branch 'master' into ui-2 2017-07-24 17:48:25 +02:00
kaikun213 c894f7ac1f relocate to packages (+ Tab semantic ui v.7.1) 2017-07-24 17:35:10 +02:00
Evan 78fab4e471 Add a snapcraft badge (#6135)
Congrats on the snap of Parity! Here's a shiny green build status badge :)
2017-07-24 17:27:27 +02:00
Nikolay Volf 2d6a1160d5 don't return 412 (#6133) 2017-07-24 17:26:49 +02:00
NikVolf 5180919e52 wasm mvp continued 2017-07-24 17:45:15 +03:00
kaikun213 381ed505a0 postMessage and store (merge..) 2017-07-24 16:21:54 +02:00
kaikun213 a562f2c434 Merge remote-tracking branch 'origin/ui-2' into ui-2 2017-07-24 16:14:02 +02:00
kaikun213 13b96ae7c8 Pubsub for postMessage Provider (UI2)
Proper method-name displaying on request approval is missing
2017-07-24 16:08:24 +02:00
Nikolay Volf 5fb32229f9 bump jsonrpc (#6129) 2017-07-24 13:44:42 +02:00
Robert Habermeier 079b24175c Merge pull request #6080 from Vurich/ethash
Unroll loops in light_compute
2017-07-24 13:09:31 +02:00
Svyatoslav Nikolsky b31b067743 fixed tests 2017-07-24 12:36:31 +03:00
Afri e33f9c1d11 Changelog for 1.6.9, 1.6.10, and 1.7.0 (#6075)
* Update CHANGELOG for 1.6.9 stable release.

* [WIP] Prepare CHANGELOG for 1.7.0 beta release.

* Contract warp

* Update changes for 1.7.0

* Update description for 1.7.0 in changelog

* Update Changelog for 1.7.0 beta and 1.6.10 stable

* Address reviews for the Changelog.

* Fix blog URL in changelog.

* Fix typo in Changelog.

* Update changelog for 1.7.0 beta and 1.6.10 stable
2017-07-23 15:18:58 +02:00
Vurich 0fa9c93f6f Style reungrumble 2017-07-22 14:49:02 +02:00
Robert Habermeier abe7518424 add security policy (#6121) 2017-07-22 07:41:58 +02:00
Joseph Mark 17e6d2d51c
Descriptive error for invalid preset (#4673) 2017-07-22 11:09:59 +07:00
Joseph Mark 6ae93cf14e
Roll preset command into --config option (#4673)
* --config takes either toml file or bundled preset eg. '--config=dev'
* Maintains consistency with --chain arguments
2017-07-22 10:37:38 +07:00
GitLab Build Bot c72c020182 [ci skip] js-precompiled 20170721-201403 2017-07-21 20:18:51 +00:00
Jaco Greeff c369bba03b Fix QR scanner returning null on confirm (#6122) 2017-07-21 21:19:38 +02:00
GitLab Build Bot 3605593d37 [ci skip] js-precompiled 20170721-165246 2017-07-21 16:58:58 +00:00
Jaco Greeff e3a8780da7 Check QR before lowercase (#6119) 2017-07-21 18:23:41 +02:00
Robert Habermeier 2d0d7150cc remove chunk to restore from pending set only upon successful import (#6112) 2017-07-21 17:24:53 +02:00
Joseph Mark ae3dfe9327
Revert Cargo.lock 2017-07-21 21:19:34 +07:00
Jaco Greeff 49fdd23d58 Ui 2 move to packages/* (#6113)
* Move secureApi to shell

* Extract isTestnet test

* Use mobx + subscriptions for status

* Re-add status indicator

* Add lerna

* Move intial packages to js/packages

* Move 3rdparty/{email,sms}-verification to correct location

* Move package.json & README to library src

* Move tests for library packages

* Move views & dapps to packages

* Move i18n to root

* Move shell to actual src (main app)

* Remove ~ references

* Change ~ to root (explicit imports)

* Finalise convert of ~

* Move views into dapps as well

* Move dapps to packages/

* Fix references

* Update css

* Update test spec locations

* Update tests

* Case fix

* Skip flakey tests

* Update enzyme

* Skip previously ignored tests

* Allow empty api for hw

* Re-add theme for embed
2017-07-21 15:46:53 +02:00
Joseph Mark db0d20e17b
Update Cargo.lock 2017-07-21 20:30:35 +07:00
Joseph Mark 0ec917e980
Merge branch 'master' into issues/4673 2017-07-21 19:47:14 +07:00
Arkadiy Paronyan 99f4bc76d7 Fix for building with --no-default-features (#6110) 2017-07-21 12:14:47 +02:00
Svyatoslav Nikolsky 5fb9652af5 improved logging 2017-07-21 11:25:26 +03:00
Svyatoslav Nikolsky 023e5b4b90 do not try to connect if not a part of cluster 2017-07-21 10:49:10 +03:00
Jaco Greeff 7f3bb37b96 Merge branch 'master' into ui-2 2017-07-21 09:33:05 +02:00
GitLab Build Bot 797e7d98d3 [ci skip] js-precompiled 20170720-175801 2017-07-20 18:02:30 +00:00
Nicolas Gotchac 96ff69e7ef Update wallet library binaries (#6108)
* Update wallet library binaries

* Update the links
2017-07-20 19:30:25 +02:00
Robert Habermeier e7f82cf62e Merge pull request #5980 from brson/panic-hook
Add custom panic hook
2017-07-20 17:11:08 +02:00
Svyatoslav Nikolsky c94c799347 re-read only when blockchain is changed 2017-07-20 13:28:31 +03:00
Svyatoslav Nikolsky b9ad093d06 moved parsing to KeyServerSet 2017-07-20 13:15:16 +03:00
Svyatoslav Nikolsky a35db9f454 improved KeyServerSet tracing 2017-07-20 12:55:52 +03:00
Svyatoslav Nikolsky 9a9c4f6ad6 removed println 2017-07-20 12:25:41 +03:00
Svyatoslav Nikolsky 80b9e931f5 fixed connection establishing 2017-07-20 12:19:29 +03:00
Robert Habermeier 02d462e263 update wallet library modifiers (#6103) 2017-07-20 00:02:36 +02:00
GitLab Build Bot 10efc7e2d3 [ci skip] js-precompiled 20170719-205509 2017-07-19 20:59:31 +00:00
Gav Wood b640df8fbb Fix initialisation bug. (#6102) 2017-07-19 22:29:58 +02:00
Brian Anderson 6345b54034 Add custom panic hook
The panic hook prints a backtrace, the panic message, file, and line
number, and a plea to report bugs.
2017-07-19 17:50:48 +00:00
Vurich 7208b9b525 Small fixes 2017-07-19 18:14:10 +02:00
Vurich ad1835e87c Unroll 1 more loop 2017-07-19 16:21:55 +02:00
Arkadiy Paronyan 4c32177ef3 Fixed node address detection on incoming connection (#6093) 2017-07-19 15:44:08 +02:00
Robert Habermeier 253bc333c7 Merge pull request #6092 from paritytech/returndata-fix
Place RETURNDATA behind block number gate
2017-07-19 15:26:28 +02:00
arkpar 9ad0ff960e Place RETURNDATA behind block number gate 2017-07-19 14:34:59 +02:00
Svyatoslav Nikolsky 7664ff5acd do not connect to self 2017-07-19 15:14:37 +03:00
Vurich 7d35f994d2 Style ungrumble 2017-07-19 12:09:45 +02:00
Vurich 2cc1c92901 Unroll one more loop
I also tried unrolling the 256-iteration loop further below, but it actually caused a
slowdown (my guess is either branch prediction stopped kicking in or the instruction
cache was being maculated).
2017-07-19 12:07:34 +02:00
Svyatoslav Nikolsky 5080cc3c9e update_nodes_set in maintain 2017-07-19 12:36:40 +03:00
GitLab Build Bot e5042d0d38 [ci skip] js-precompiled 20170719-084508 2017-07-19 08:49:29 +00:00
Svyatoslav Nikolsky 81de7e1075 initial KeyServerSet commit 2017-07-19 11:35:17 +03:00
Arkadiy Paronyan d9101b9559 Fixed ethkey CLI build (#6086) 2017-07-19 10:18:30 +02:00
Jaco Greeff 49a55886d3 Bump package.json for master 1.8 (#6074) 2017-07-19 10:13:43 +02:00
Robert Habermeier 298ea1d748 Bump snap version and tweak importing detection logic (#6079)
* bump last tick just before printing info and restore sync detection

* bump kovan snapshot version

* Fixed sync tests

* Fixed rpc tests
2017-07-18 16:59:33 +02:00
Denis S. Soldatov aka General-Beck d157930f2c chmod +x *scripts 2017-07-18 16:45:58 +03:00
Denis S. Soldatov aka General-Beck 88145752ff [ci skip] move Aura test https://github.com/paritytech/parity-import-tests in `nightly` build 2017-07-18 16:45:58 +03:00
Giuseppe Bertone 319a01b34f User_defaults now contains serialization for is_first_launch parameter; (#6068)
Solved the "TraceDB resync required" issue when trying to use "--tracing on" option just after a DB kill operation;
2017-07-18 15:38:38 +02:00
Vurich d51958dbf5 Speed up light_compute by ~9% 2017-07-18 15:38:10 +02:00
Denis S. Soldatov aka General-Beck 801fcf3271 fix docker build in master 2017-07-18 16:17:33 +03:00
Denis S. Soldatov aka General-Beck df144a6fcb fix docker build 2017-07-18 16:12:16 +03:00
Vurich 410ded5d45 Remove dead code from benchmarks 2017-07-18 14:17:01 +02:00
Vurich d994d7a10c Add benchmarks 2017-07-18 14:14:42 +02:00
Denis S. Soldatov aka General-Beck 649552e0f0 Update snapcraft.yaml
fix for builds.snapcraft.io
2017-07-17 21:31:12 +03:00
Jaco Greeff 36f94fde05 Ui 2 package upgrades (#6076)
* Upgrade to React 15.6

* Import PropTypes from prop-types

* Update package.json

* UI version in built version

* Cleanup /api/health status failures

* Check reponse.ok

* Add icons to view dapps

* Adjust layout for dapps

* Slightly darker balance background

* Adjust shadows
2017-07-17 18:37:33 +02:00
Jaco Greeff fcdaa0d05b Upated dependencies 2017-07-17 11:54:13 +02:00
Jaco Greeff aaff34364d Merge branch 'master' into ui-2 2017-07-17 11:49:03 +02:00
Denis S. Soldatov aka General-Beck 69561da15f fix docker build and snapcraft 2017-07-17 12:06:32 +03:00
arkpar 04b641ff5f Fixed build 2017-07-17 10:45:34 +02:00
Joseph Mark fefeb50cae
Fix minor merge issue 2017-07-17 13:33:26 +07:00
Joseph Mark d93a5d3da1
Merge branch 'master' into issues/4673 2017-07-17 13:07:00 +07:00
Joseph Mark 360f1fa34f
Add insecure presets and tests 2017-07-17 13:03:57 +07:00
Andre Silva c7af702270 Refactor price_info (#6003)
* refactor PriceInfo to use Fetch and reuse the client

* forget Fetch future to keep it running in the background

* update Debug message for price_info::Client

* wrap underlying errors in price_info client

* use debug_struct in price_info client debug implementation

* use global fetch service in price_info client

* rename gas_pricer parameter in RunCmd

* move price_info to its own crate

* fix price_info tests

* replace rustc_serialize with serde_json in price_info

* add documentation for price_info

* remove unused rustc-serialize dependency from ethcore

* fix price_info formatting

* re-export fetch crate in price_info

* remove unused cfg attributes in price_info

* add tests for price_info
2017-07-16 18:22:45 +02:00
Robert Habermeier fec4ccbbb8 acquire client report under lock in informant (#6072) 2017-07-16 17:43:43 +02:00
GitLab Build Bot 30f2057bdf [ci skip] js-precompiled 20170716-095403 2017-07-16 10:02:50 +00:00
Arkadiy Paronyan bb893daf7d Removed Aura tests 2017-07-16 11:30:58 +02:00
Jaco Greeff 4fc16a9eec Show busy indicator on Address forget (#6066)
* Shw busy indicator on Address forget

* Remove debug logs
2017-07-16 11:05:36 +02:00
Nikolay Volf 895350e77c fix error message (#6065) 2017-07-15 19:58:52 +02:00
kaikun213 b5cbe34a2a Merge remote-tracking branch 'origin/master' 2017-07-15 12:15:29 +02:00
kaikun213 ea14290f52 Merge remote-tracking branch 'origin/master' 2017-07-15 12:14:26 +02:00
Denis S. Soldatov aka General-Beck c647963911 fix path aura test 2017-07-14 22:02:45 +03:00
Robert Habermeier 99075ad22a Initial Whisper implementation (#6009)
* whisper skeleton

* basic message store

* rallying and message logic

* pass host info to network protocol handlers

* choose who starts rally based on node key

* module reshuffling

* mining messages

* prune messages by low PoW until below size target

* associated error type for ethkey generators and `OsRng` generator

* beginnings of RPC

* generic message handler for whisper

* reshuffle code order

* standard payload encoding and decoding

* basic crypto

* minor restructuring of net code

* implement shh_post

* merge?

* implement filters

* rand trait for hash types

* filter RPCs for whisper

* symmetric encryption of payload

* pub-sub

* filter tests

* use only secure random IDs

* attach arbitrary protocols to network

* basic integration of whisper into Parity

* eagerly prune low PoW entries

* broadcast messages with salted topics

* node info RPC

* fix import

* fix leading zeros calculation

* address minor grumbles
2017-07-14 20:40:28 +02:00
Jaco Greeff a4fa6a3ac7 Add CSP for worker-src (#6059)
* Specify worker-src seperately, add blob:

* Upgrade react-qr-scan to latest version
2017-07-14 18:50:19 +02:00
Denis S. Soldatov aka General-Beck 3308c40440 fix aura test 2017-07-14 18:02:39 +03:00
Denis S. Soldatov aka General-Beck 69d45f8ce4 add Parity Import Tests
https://github.com/paritytech/parity-import-tests
2017-07-14 17:44:43 +03:00
Svyatoslav Nikolsky 5cc40d4525 when error comes before initialization 2017-07-14 14:51:24 +03:00
Svyatoslav Nikolsky 18582d7b65 do not cache ACL storage contract 2017-07-14 13:41:25 +03:00
Joseph Mark b975efa2bb
Add non-standard-ports preset and test 2017-07-14 10:42:56 +07:00
Joseph Mark 4fea18d945
Add mining preset and test 2017-07-14 10:15:39 +07:00
Joseph Mark 0f37261dbf
Change --min-gas-price to u64 2017-07-14 09:40:47 +07:00
GitLab Build Bot 3fb8a85f83 [ci skip] js-precompiled 20170713-162224 2017-07-13 16:27:01 +00:00
Jaco Greeff 2dc92fc245 Merge branch 'master' into ui-2 2017-07-13 17:28:51 +02:00
Robert Habermeier 664dcc063a Merge pull request #6051 from paritytech/v1.8
v1.8
2017-07-13 17:24:39 +02:00
arkpar debbfc117a Bumped version 2017-07-13 15:52:01 +02:00
Tomasz Drwięga 1aaafa2d11 Limit transaction queue memory & limit future queue (#6038)
* Remove confusing gas_limit in the pool.

* Change defaults

* Limit transaction queue by memory usage.

* Change defaults to something lower.

* Fix rpc test.

* Fix js issues.

* Renamed block_gas_limit
2017-07-13 15:12:25 +02:00
Jaco Greeff 58307479ad Fix lint/build issue (#6050) 2017-07-13 14:37:35 +02:00
Joseph Mark 9c3bd83d3b
Merge branch 'master' into issues/4673 2017-07-13 19:30:52 +07:00
Joseph Mark e0b15116a5
Replace dev chain special case with preset
Add --min-gas-price (does the same as legacy --gasprice) and tweak
gas_pricer_config() and test cases.  Dev preset will still be
overridden by CLI arguments, including --gasprice.
2017-07-13 19:25:41 +07:00
Jaco Greeff e36a7fab2d Update tests to master version 2017-07-13 11:54:52 +02:00
Jaco Greeff 2007de3241 Fix lint issue. 2017-07-13 11:06:51 +02:00
Jaco Greeff d8c3c247f8 Merge branch 'master' into ui-2 2017-07-13 10:56:12 +02:00
keorn 22261bc2d1 New contract PoA sync fixes (#5991)
* generate proofs on newly-created state

* report only missed steps after first block

* dont report skipped if not signer

* test

* finality tracing and passing valid header to `commit_block`

* avoid proposing multiple times on the same step when validator set changes

* limit benign reports

* Ordering -> AtomicOrdering

* reinstate warning now that spam is reduced

* flush pending transition changes when necessary

* ensure epochs aren't re-zoomed on every block
2017-07-13 09:48:00 +02:00
Marek Kotewicz 40e29c92bc make Multisig Wallet walletSourceUrl point to the latest version of solidity contract (#5984) 2017-07-13 09:47:51 +02:00
Robert Habermeier d365281cce Ethcore crate split part 1 (#6041)
* split out types into separate crate

* split out evm into its own crate
2017-07-12 13:09:17 +02:00
Joseph Mark 451ef7f09b
Add preset cmd/arg to test args 2017-07-12 16:31:28 +07:00
Joseph Mark 2d52c7b42f
Merge branch 'master' into issues/4673 2017-07-12 16:06:23 +07:00
Joseph Mark d4175ca6c6
Add preset command to parity CLI
Preset configs are loaded from bundled toml files and overridden by
CLI options.
2017-07-12 16:03:21 +07:00
Tomasz Drwięga 24c8510932 Fix status icon (#6039)
* Fix status icon when zooming out.

* Fix health errors.
2017-07-12 08:52:50 +02:00
Joseph Mark 0fca4f95d6 Errors & warnings for inappropriate RPCs (#6029)
* Clarify function name

Function checks if sealing is currently underway, not to be confused
with checking whether the engine performs internal sealing.

* Error when work called on internal sealing engine

* Error submitting work for internal sealing engine

* Fix inverted bool and style grumbles

* Add can_produce_work_package to TestMinerService

* Error when setting engine signer on PoW chain

* Unit tests for engine signing

Setting engine signer should fail if chain does not seal internally
or client lacks account provider.

* Tweak TestMinerService

* Fix minor style grumbles
2017-07-12 08:52:18 +02:00
Robert Habermeier 02f2c611d4 Merge pull request #5992 from paritytech/csp-fix
Add missing CSP for web3.site
2017-07-11 16:12:03 +02:00
kaikun213 0ad0c7882f Merge remote-tracking branch 'origin/csp-fix' 2017-07-11 15:25:58 +02:00
Tomasz Drwięga a30f43b36c
Fix ui-no-validation. 2017-07-11 14:49:35 +02:00
Tomasz Drwięga ba4d8ceaf3
Merge branch 'master' into csp-fix 2017-07-11 13:45:23 +02:00
GitLab Build Bot 45d44bedef [ci skip] js-precompiled 20170711-113031 2017-07-11 11:36:24 +00:00
Robert Habermeier cd0b62338b Merge pull request #6037 from paritytech/a5-docs-install
Remove cargo install --git from README.md
2017-07-11 13:14:58 +02:00
5chdn b844c8a29a Remove cargo install git from README.md, ref #6007 2017-07-11 13:08:53 +02:00
Jaco Greeff 92a9ff3c1a Update after merge 2017-07-11 12:47:22 +02:00
Jaco Greeff a1a8181913 Merge branch 'master' into ui-2 2017-07-11 12:38:51 +02:00
Joseph Mark 9c1030878e
Add config preset files 2017-07-11 17:29:34 +07:00
Tomasz Drwięga 4936e99f30 Node Health warnings (#5951)
* Health endpoint.

* Asynchronous health endpoint.

* Configure time api URL via CLI.

* Tests for TimeChecker.

* Health indication on Status page.

* Adding status indication to tab titles.

* Add status to ParityBar.

* Fixing lints.

* Add health status on SyncWarning.

* Fix health URL for embed.

* Nicer messages.

* Fix tests.

* Fixing JS tests.

* NTP time sync (#5956)

* use NTP to check time drift

* update time module documentation

* replace time_api flag with ntp_server

* fix TimeChecker tests

* fix ntp-server flag usage

* hide status tooltip if there's no message to show

* remove TimeProvider trait

* use Cell in FakeNtp test trait

* share fetch client and ntp client cpu pool

* Add documentation to public method.

* Removing peer count from status.

* Remove unknown upgrade status.

* Send two time requests at the time.

* Revert "Send two time requests at the time."

This reverts commit f7b754b1155076a5a5d8fdafa022801fae324452.

* Defer reporting time synchronization issues.

* Fix tests.

* Fix linting.
2017-07-11 12:23:46 +02:00
Tomasz Drwięga 7fb46bff06 RPC cpu pool (#6023)
* RPC cpu pool.

* introduce optional thread pool when processing RPC requests.

* Bump jsonrpc.

* Removing boxes.

* Fix CLI tests.
2017-07-11 12:22:19 +02:00
Nikolay Volf dc51dde112 update deps (#6036) 2017-07-11 12:06:35 +03:00
arkpar c05924a713 Fixed build 2017-07-11 10:21:23 +02:00
kaikun213 f1dcdab75d Merge remote-tracking branch 'origin/csp-fix' 2017-07-11 09:58:42 +02:00
Axel Chalon d970237658 Add test for loading the chain specs (#6028)
* Add test for loading the json chain specs

* Remove test on Ethereum specs as it already exists
2017-07-10 19:26:10 +02:00
Jaco Greeff 03b0ea6139 Merge branch 'master' into ui-2 2017-07-10 17:43:37 +02:00
Tomasz Drwięga 56c275b0cb Whitelist APIs for generic Pub-Sub (#5840)
* Whitelisting generic pub-sub APIs.

* Clone enums instead of allocating a vec.
2017-07-10 17:42:29 +02:00
Nikolay Volf 62210fb932 WASM contracts MVP (#5679)
* lifetime issues

* refactor to new 'native env'

* descriptors and such

* wasm mvp continued

* finalized env/ext bindings

* descriptor -> call_args

* inject gas counter

* result processing and engine activation

* tabify some source files

* needs return new

* wasm tests initial

* erradicate warnings

* origin in the descriptor

* update test repo

* payload verification tests

* identity return payload test

* some test description

* dispersion test

* check length here

* suicidal contract

* engine params

* fix typo

* review fixes

* submodule update

* update - purge reserved space

* doc effort

* more review fixes

* fix error message

* fix dependency url

* reorg error handling

* update submodule

* update utils

* update to latest parity-wasm

* tabify

* fix wasm magic header

* update dependencies

* external create and tests

* update to latest tests

* extra trace info

* Update parity-wasm

* update wasm-utils also

* few traces and result handle change

* alter trace content

* fix issues with optimizer, update to latest parity with validator, etc

* static initialization

* license preamble

* update wasm crates and gas costs

* fix grumbles

* bring back lifetime

* fix compilation
2017-07-10 17:42:10 +02:00
Jaco Greeff b49c039f41 Set observable on component (#6033) 2017-07-10 17:38:40 +02:00
Jaco Greeff 3d24ae0981 Merge branch 'master' into ui-2 2017-07-10 17:36:55 +02:00
Jaco Greeff 801b6e0ded UI 2 dapp configuration dapps (#6032)
* Add shell_ APIs

* Allow handling of shell_ calls

* Retrieve API info via call

* Split Dapp Method config into dapp

* Allow shell API for configuring dapps

* Move dapp toggles to dapp itself

* Align provider naming

* Selection of default accounts via dapp

* Remove duplicated spec
2017-07-10 17:03:16 +02:00
Jaco Greeff 4dd68f1ef3 Ui 2 provider rename (web3Provider -> ethereum) (#6031)
* Rename web3Provider -> ethereumProvider

* ethereumProvider -> ethereum
2017-07-10 15:56:43 +02:00
Arkadiy Paronyan 15aebacbe7 --reseal-on-uncle (#5940)
* --reseal-on-uncle

* Optimized uncle check

* Additional uncle check

* Updated comment
2017-07-10 13:36:42 +02:00
Axel Chalon 7599e3998f Support comments in reserved nodes file (#6004) (#6012) 2017-07-10 13:24:40 +02:00
Jaco Greeff 204fe44b29 Add new md tnc (#5937)
* Add new md tnc

* Skip markdown import in test
2017-07-10 13:23:59 +02:00
Tomasz Drwięga f4453f77b8 Fix output of parity-evm in case of bad instruction (#5955)
* Fix output of evmbin.

* Use foundation chain settings by default.
2017-07-10 13:23:40 +02:00
Tomasz Drwięga ed5efebec1 Don't send to old subscriptions. (#5960) 2017-07-10 13:23:19 +02:00
Robert Habermeier 67c1f71b6e Proper light client informant and more verification of imported headers (#5897)
* do more validation of imported headers in light client

* generalize informant with traits

* informant implementation for light client

* make comment into TODO

* fix broken test

* disable full checking of headers in light client in sync tests
2017-07-10 13:21:11 +02:00
keorn f0a6b5d401 azure nodes (#6017) 2017-07-10 13:05:05 +02:00
Tomasz Drwięga a24b6ad983 Use standard paths for Ethash cache (#5881)
* Use cache path to store ethash files.

* Fixing tests, more flexible API.

* Use AsRef<Path> everywhere.

* Fixing ethcore tests.

* Fix RPC tests.
2017-07-10 12:57:40 +02:00
Jaco Greeff 699aab0b80 Update package-lock.json 2017-07-10 11:40:45 +02:00
Jaco Greeff 84f11278ba Merge branch 'master' into ui-2 2017-07-10 11:33:07 +02:00
Jaco Greeff cbcda140ec Ui 2 updates subscribe (#6027)
* Add account & vault APIs

* Additional status methods

* Move permission modals into Dapp

* Adjust display position

* Don't publish invalid events

* Cleanup Wallet display

* Update package-lock

* Align icon buttons center

* Adjust account selectors

* Adjust wallet white

* Allow display of boolean/false values

* Pass value through correctly for disabled inputs

* Split requests into sections

* onClict -> onClick

* Update label

* Update skip step

* Connect provider interfaces
2017-07-10 11:04:29 +02:00
Tomasz Drwięga b0f1f8307d
X-Frame-Options removed. 2017-07-10 09:42:35 +02:00
Tomasz Drwięga ad67ea0eb5
Merge branch 'master' into csp-fix 2017-07-09 14:10:53 +02:00
Robert Habermeier 125aa0aeb4 Merge pull request #5959 from paritytech/dont-compute-hash
Defer code hash calculation.
2017-07-06 19:00:19 +02:00
GitLab Build Bot df0ef6618d [ci skip] js-precompiled 20170706-164115 2017-07-06 16:47:59 +00:00
Robert Habermeier 0409e95d1e Merge pull request #6000 from paritytech/new-acc
Fix first run wizard.
2017-07-06 18:02:47 +02:00
Robert Habermeier 104367ce24 Merge pull request #5996 from paritytech/serdeup
migration to serde 1.0
2017-07-06 18:02:11 +02:00
debris 5f2cb5e52f push CI 2017-07-06 16:48:58 +02:00
debris 8118444442 fixed rpc tests 2017-07-06 15:25:51 +02:00
debris 9e185030e6 push CI 2017-07-06 14:49:10 +02:00
debris f4f8b411f5 fixed parity tests with new serde and toml 2017-07-06 14:10:41 +02:00
Svyatoslav Nikolsky 6334893561 SecretStore: generating signatures (#5764)
* refactoring traits

* separate generation session

* generalized ClusterSessions

* signing session prototype

* full_signature_math_session

* consensus session prototype

* continue signing session

* continue signing session

* continue signing session

* continue signing session

* isolated consensus logic

* started work on signing test

* complete_gen_sign_session works

* consensus tests

* get rid of duplicated data in SigningSession

* TODOs in signing session

* fixing tests

* fixed last test

* signing session in http listener

* new key server tests

* fix after merge

* enabled warnings

* fixed possible race

* ignore previous jobs responses

* include sef node in consensus when confirmed

* fixed warning

* removed extra clones

* consensus_restarts_after_node_timeout

* encrypt signature before return

* return error text along with HTTP status

* fix for odd-of-N (share check fails + not equal to local sign)

* fixed t-of-N for odd t

* fixed test cases in complete_gen_sign_session

* fixed mistimed response reaction

* jobs draft

* DecryptionJob

* consensus session tets

* fixed decryption tests

* signing job implementation

* siginng_session using new consensus_session

* added license preambles

* same_consensus_group_returned_after_second_selection

* database upgrade v0 -> v1

* typo

* fixed grumbles
2017-07-06 14:02:10 +02:00
kaikun213 76f0247f5d Tests still warn because of old provider in some tests 2017-07-06 12:42:10 +02:00
debris 44ae70e9ec Merge branch 'serdeup' of github.com:paritytech/parity into serdeup 2017-07-06 11:44:37 +02:00
debris 1c2a4c116a Merge branch 'master' into serdeup 2017-07-06 11:43:46 +02:00
debris 61d8f90530 updated serde to version 1.0 2017-07-06 11:36:15 +02:00
Marek Kotewicz 46183b1cdd bigint upgraded to version 3.0 (#5986)
* bigint upgraded to version 3.0

* fixed missing FromHex import in ethcore tests

* fixed missing FromHex import in rpc tests
2017-07-06 11:26:14 +02:00
Marek Kotewicz a78a89b13a Merge pull request #5965 from guanqun/fix-force-seal
config: don't allow dev chain with force sealing option
2017-07-06 11:20:06 +02:00
Marek Kotewicz e91025282e Merge pull request #5969 from brson/lockfile
Update lockfile for miniz-sys and gcc
2017-07-06 11:18:52 +02:00
Marek Kotewicz a3a4a37ec7 Merge pull request #5995 from paritytech/rpc-errors-naming-3204
Clean up function naming in RPC error module
2017-07-06 11:18:04 +02:00
debris 687a542260 Merge branch 'bigint3' into serdeup 2017-07-06 11:15:19 +02:00
debris e7d3036ace fixed missing FromHex import in rpc tests 2017-07-06 10:46:40 +02:00
GitLab Build Bot 33f1d2af1e [ci skip] js-precompiled 20170706-081457 2017-07-06 08:21:42 +00:00
debris 1d386f60e9 Merge branch 'bigint3' into serdeup 2017-07-06 10:19:35 +02:00
debris 7dcbcb5c31 fixed missing FromHex import in ethcore tests 2017-07-06 10:18:48 +02:00
Jef 981854d5ae Merge pull request #5975 from Vurich/fix-underflow
Fix underflow in gas calculation
2017-07-06 10:10:06 +02:00
kaikun213 349316f70e PubSub for parity-js (#5830)
* PubSub Integration WebSocket

* PubSub Provider API

* Parity License and fix switch statement

* Minor fix: use parameter api

* Exclude subscriptionId return

* Unsubscribe parameters as array

* secureProvider API added

* isSecure check

* Refractor: Formatting in callback (no Promise)

* Tests for parityProvider

* Refractor: Formatting in callback (secure API)

* Updated transaction documentation

* Module instead of API-Names, Options always as array (e.g. empty)

'parity' instead of 'parity_subscribe' calls
params with empty array as options. If eth_subscribe includes empty array parity-core will send invalid request (eth api doesn't have options)

* Removed isSecure transport check, because APIs are configurable

* Refractor Provider API to single Pubsub

* Modify transport layer to have single identifier for subscriptions

* FIX: Display pubsub errors

* Discard Messages after unsubscribing

* Fix: display error normal messages correctly

* Simplified code, removed unnecessary pubsub methods

* trace_call API 2nd argument blockNumber, first whatTrace

https://github.com/paritytech/parity/wiki/JSONRPC-trace-module#trace_call

* Separate namespaces pubsub. eth, parity, net

* Keep error for messages from unsubscribed topics.

* Fix: Unsubscribe Promise

* Add Test: Unsubscribe promise resolved

* Fix: 'error' in params
2017-07-06 09:50:27 +02:00
Tomasz Drwięga 58a27b3334
Fix first run wizard. 2017-07-05 12:25:07 +02:00
debris 2d69c7ecf6 finished migration to serde 1.0 2017-07-05 10:34:23 +02:00
debris 2c4f55a8fb migrated rpc to serde 1.0 2017-07-05 10:27:56 +02:00
debris 2e5f7f1632 migrated ethcore engine to new ethabi interface 2017-07-05 10:18:19 +02:00
debris e448b84845 migrated ethcore-network to bytes 0.4 2017-07-04 18:12:39 +02:00
debris 972d30c288 migrated ethcore, ethstore, secret_store, updater and hash-fetch to serde 1.0 2017-07-04 17:23:06 +02:00
Axel Chalon 59e87b6a51 Clean up function naming in RPC error module 2017-07-04 17:01:06 +02:00
debris 9c911c7a28 migrated ethjson to serde 1.0 2017-07-04 17:00:42 +02:00
Tomasz Drwięga 949086baa5
Add missing frame-ancestors. 2017-07-04 16:43:53 +02:00
debris 286526072f migrated ethkey, ethstore, evmbin and parity executables to serde 1.0 2017-07-04 14:31:16 +02:00
debris a9aaacd88b bigint upgraded to version 3.0 2017-07-04 12:19:11 +02:00
Vurich 2e90e02a2c Fix underflow 2017-07-03 17:43:03 +02:00
Jaco Greeff c33ff96bb6 Merge branch 'master' into ui-2 2017-07-03 17:39:46 +02:00
Jaco Greeff 15a9e56b09 Ui 2 expand method filters (#5974)
* Add account & vault APIs

* Additional status methods

* Move permission modals into Dapp

* Adjust display position

* Don't publish invalid events
2017-07-03 17:05:56 +02:00
Robert Habermeier cc718bb108 Merge pull request #5958 from Vurich/peer-status
Report whether a peer was kept from `Handler::on_connect`
2017-07-03 16:22:50 +02:00
Robert Habermeier 826a4ca0a2 Implement skeleton for transaction index and epoch transition proof PIP messages (#5908)
* add transaction index message without implementing

* add epoch proof fetch and response messages
2017-07-03 12:25:10 +02:00
Jaco Greeff 7f77e6004c Cleanup selector (#5971) 2017-07-03 10:36:34 +02:00
Jaco Greeff 15d4bc9d6d Save permissions (#5970) 2017-07-03 10:03:29 +02:00
Jaco Greeff 9f8467aa80 Merge branch 'master' into ui-2 2017-07-03 09:56:54 +02:00
Jaco Greeff 1896c2720b Use qrcode-generator directly from package 2017-07-03 09:48:17 +02:00
Brian Anderson 7240eee5a8 Update lockfile for miniz-sys and gcc
Fixes build with VS 2017.
2017-07-03 01:44:20 +01:00
Guanqun Lu 9241c6a9b5 config: don't allow dev chain with force sealing option 2017-07-01 23:20:49 +08:00
Vurich 17de29e69a Prevent disconnect from within handler (and style cleanup) 2017-06-30 12:10:12 +02:00
Tomasz Drwięga f22745eb0a TransactionQueue improvements (#5917)
* Order by id instead of hash.

* Minimal gas price bump.

* Avoid to construct oversized transaction packets.

* Fix RPC.

* Never construct oversized transactions packet.

* Never construct oversized packets.
2017-06-30 11:57:48 +02:00
Tomasz Drwięga 5d9f5e3509
Defer code hash calculation. 2017-06-30 11:30:32 +02:00
Vurich 5eba9078fc Report whether a peer was kept from `Handler::on_connect` 2017-06-30 11:00:32 +02:00
Robert Habermeier a3e693d5c3 Merge pull request #5952 from paritytech/constant-time-mac-compare
constant time HMAC comparison and clarify docs in ethkey
2017-06-29 22:21:12 +02:00
Robert Habermeier 36c91e4ed5 Merge pull request #5954 from paritytech/evm-defer
Avoid pre-computing jump destinations
2017-06-29 21:18:16 +02:00
Robert Habermeier 83690fdb90 Merge branch 'master' into constant-time-mac-compare 2017-06-29 21:15:20 +02:00
Tomasz Drwięga 38c00fae88
Merge branch 'master' into evm-defer 2017-06-29 18:42:58 +02:00
Tomasz Drwięga 465c7eeaa2
Defer construction valid_jump_destinations. 2017-06-29 17:43:34 +02:00
Robert Habermeier a4195f2780 Merge pull request #5949 from Vurich/upgrade-elastic-array
Upgrade elastic array
2017-06-29 17:12:53 +02:00
Robert Habermeier 8a3e82d99a constant time HMAC comparison and clarify docs in ethkey 2017-06-29 13:44:24 +02:00
Vurich 01ce28bc9a Fix tests 2017-06-29 13:05:33 +02:00
Vurich 3d8dc11442 Upgrade `elastic-array` to 0.9.0
This is a huge change, which includes some changes to replace code that
originally cloned to reuse allocations instead. The updated
`elastic-array` crate renames its consuming `Vec`-conversion method to
`into_vec`, which means that I can do a simple
`sed -i 's/to_vec/into_vec/'` and then fix the compilation errors.

This commit is probably a minor performance win and definitely a
significant readability win.
2017-06-29 13:05:33 +02:00
arkpar 826bf28196 Fixed build 2017-06-28 16:11:18 +02:00
Jaco Greeff 8798ed4499 Merge branch 'master' into ui-2 2017-06-28 14:27:25 +02:00
Robert Habermeier d069b98b45 PoA: Wait for transition finality before applying (#5774)
* final engine changes

* migration to v13

* adding and removing pending transitions

* epoch_transition_for

* port snapshot to new engine methods

* final validator set interface

* fix compiler errors

* revert v13/epoch_depth transition

* make call on new epoch

* rolling finality checker

* tests for finality checker

* constructing finality proof upon pending transition

* fix warnings and finality proof checking

* fix compiler warnings in tests

* test fixes

* don't include genesis in finality checking

* change snapshot test chain building logic

* minor refactorings

* fetch epoch transition based on parent, fix divide-by-zero in SimpleList

* fix formatting

* fix ABIs and finality checking in snapshot restoration

* encode signal number in proof

* create more blocks at the end of tests

* update gist to accurate contract code

* test for epoch_transition_for

* fix tests with immediateTransitions parameter

* disable force flag after forcing

* rename ValidatorsChanged to InitiateChange and finalizeSignal to finalizeChange

* a few more validator set tests
2017-06-28 13:17:36 +02:00
Denis S. Soldatov aka General-Beck 3637c14da5 fix Windows and MacOS build
add `cargo clean`
2017-06-28 14:03:17 +03:00
Denis S. Soldatov aka General-Beck 201f34620a CI build
add evmbin, ethstore, ethkey
2017-06-28 13:54:05 +03:00
Tomasz Drwięga 71c68cc000 Logs Pub-Sub (#5705)
* Logs subscription.

* Add test.

* lock -> write
2017-06-28 12:21:13 +02:00
Leo Arias bcc84a31b7 Add the command to install the parity snap (#5945)
Putting the installation instructions for the snap will help getting more testers, and then publish it in the stable channel with more confidence.
2017-06-28 09:37:47 +02:00
Jef 72094a8bee Reduce unnecessary allocations (#5944) 2017-06-28 09:36:42 +02:00
Tomasz Drwięga 944f9d7fb5 Clarify confusing messages. (#5935) 2017-06-28 09:35:25 +02:00
Tomasz Drwięga c7a043b864 Content Security Policy (#5790)
* Adding CSP headers.

* Adding Content-Security-Policy headers.

* Fixing test.

* CSP in ws server responses.
2017-06-28 09:12:02 +02:00
Arkadiy Paronyan 57626b60e7 EIP-168, 169: Dust protection (#4757)
* Dust protection

* Track touched accounts in the substate

* Minor alterations
2017-06-28 09:10:57 +02:00
GitLab Build Bot 6b16fe3f14 [ci skip] js-precompiled 20170627-213135 2017-06-27 21:35:37 +00:00
Arkadiy Paronyan 4a7bcfe4f0 CLI: Export error message and less verbose peer counter. (#5870)
* Removed numbed of active connections from informant

* Print error message when fatdb is required

* Remove peers from UI
2017-06-27 22:40:46 +02:00
Guanqun Lu 59488769cf network: make it more explicit about StreamToken and TimerToken (#5939) 2017-06-27 18:24:18 +02:00
Guanqun Lu 547031aa0e sync: make it more idiomatic rust (#5938) 2017-06-27 18:23:53 +02:00
arkpar 196c3e7e9b Fixed profile 2017-06-27 11:53:10 +02:00
David Dorgan 16caf032bd Only use -cli for the build, not binary itself. 2017-06-27 09:23:16 +02:00
Denis S. Soldatov aka General-Beck 4900e90112 build ethkey & ethstore
add -cli
2017-06-26 22:06:00 +03:00
Maciej Hirsz 02edc958d7 Merge pull request #5909 from paritytech/mh-always-show-accounts
Prioritize accounts over address book
2017-06-23 16:31:52 +02:00
maciejhirsz 2c254e3b32 Prioritize accounts over address book 2017-06-23 16:29:45 +02:00
Tomasz Drwięga e73569c84d Fixing RPC test. (#5916) 2017-06-23 16:17:04 +02:00
GitLab Build Bot cf772ef555 [ci skip] js-precompiled 20170623-115250 2017-06-23 11:56:57 +00:00
Jaco Greeff 0f41121556 Empty local middleware, until explicitly requested (#5912)
* Empty local middleware, until explicitly requested

* Remove previous empty overrides (unneeded now)

* Re-add over-zealous keyethereum removal
2017-06-23 13:40:16 +02:00
Jaco Greeff 6dfa097752 Update 2017-06-23 11:57:33 +02:00
Jaco Greeff d9cb2c7781 Update 2017-06-23 11:53:20 +02:00
Jaco Greeff 72f3576c78 Merge branch 'master' into ui-2 2017-06-23 11:48:12 +02:00
Craig O'Connor 614a80bd23 Cancel propagated TX (#5899)
* lgtm

* linting

* Slight shortening
2017-06-23 10:32:19 +02:00
Robert Habermeier 796482c129 fix minor race condition in aura seal generation (#5910) 2017-06-22 20:44:04 +02:00
Robert Habermeier b6fd18a9ca Merge pull request #5833 from paritytech/pubsub-docs
Docs for Pub-Sub, optional parameter for parity_subscribe
2017-06-22 20:17:02 +02:00
Jaco Greeff 64e6d36944 Fix gas editor doubling-up on gas (#5820) 2017-06-22 20:14:04 +02:00
Anton Gavrilov f9033facd3 Information about used paths added to general output block (#5904)
* Information about used paths added to general output block

* Print was added into execute light also
2017-06-22 20:08:56 +02:00
Tomasz Drwięga 53609f703e Domain-locked web tokens. (#5894)
* Domain-locking web tokens.

* JS part.

* Fix linting issues.
2017-06-22 20:05:40 +02:00
Arkadiy Paronyan 4d5280e43c removed panic handlers (#5895) 2017-06-22 19:00:53 +02:00
Anton Gavrilov dc548315b8 Merge pull request #5905 from paritytech/Merge-RocksDB
Latest changes from Rust RocksDB binding merged
2017-06-22 16:30:19 +03:00
Anton Gavrilov 7489a2b36f Latest changes from RocksDB binding merged 2017-06-22 15:54:08 +03:00
GitLab Build Bot 91f1c84048 [ci skip] js-precompiled 20170622-115440 2017-06-22 11:58:47 +00:00
Jaco Greeff e1cd60987b Adjust keyethereum/secp256 aliasses (#5903)
* Alias keyethereum to empty for libraries/npm

* Alias long-standing vertx warning to empty

* Alias secp256k1

* remove package-lock.json (not active atm)
2017-06-22 13:29:12 +02:00
GitLab Build Bot df51cad7e2 [ci skip] js-precompiled 20170622-101935 2017-06-22 10:23:53 +00:00
Jaco Greeff a60c5527c7 Keyethereum fs dependency (#5902)
* Set process.browser

* Empty fs module (keyethereum dep)

* !==
2017-06-22 11:49:44 +02:00
Jaco Greeff a6d3d4ea4c Secure API access via single-use tokens (#5892)
* Single use token for dapp permissions

* Add accountsInfo & allAccountsInfo

* Covert token -> dappName in requests
2017-06-21 15:15:23 +02:00
Jaco Greeff 97c67bc259 Merge branch 'master' into ui-2 2017-06-21 11:15:29 +02:00
Stewart Mackenzie d152fa3e85 Ethereum Classic Monetary Policy (#5741)
* Ethereum Classic Monetary Policy

Create a new parameter `ecip1017EraRounds`. When the block number
passes one era rounds, the reward is reduced by 20%.

See https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1017.md

* Update rewards for uncle miners for ECIP1017

In the monetary policy, the rewards are changed from "up to 7/8 of the
reward" to "1/32 of the reward".

* Fix an off-by-one error in ECIP1017 era calculation

According to
https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1017.md,
when in block number 5,000,000, it should still be in Era 1 (which in
our code `era == 0`). So we need to check whether the `rem` equals to
zero and act accordingly when calculating the era.

* `ecip1017_era_rounds` missing from EthashParams when run in build bot

* strip out ecip1017_eras_block_reward function and add unit test
2017-06-19 18:56:37 +02:00
Tomasz Drwięga a19be3cb51 Initial token should allow full access. (#5873) 2017-06-19 18:35:56 +02:00
Maciej Hirsz e871b7a0ac Merge pull request #5856 from paritytech/mh-pubnode-dappsigner
Fixed account selection for Dapps on public node
2017-06-19 18:29:06 +02:00
Robert Habermeier c8e176b2e3 Merge pull request #5874 from paritytech/track-bad-snapshot-hashes
blacklist bad snapshot manifest hashes upon failure
2017-06-19 17:57:06 +02:00
Jaco Greeff e479260e1f Method intercept dialog selection (#5875)
* Cleanup filter config

* Show single request of type (at a time)

* Align packages

* DappFilter -> DappRequests

* Methods dialog (WIP)

* Initial dapp methods modal

* Align dialog & popup permissions

* appname -> token mapping TODOs

* Case
2017-06-19 17:25:17 +02:00
GitLab Build Bot 367a5c998d [ci skip] js-precompiled 20170619-145413 2017-06-19 14:58:49 +00:00
Maciej Hirsz b824bc29b5 Merge pull request #5838 from paritytech/ng-fix-timeouts
Fix wrongly called timeouts
2017-06-19 16:30:30 +02:00
Robert Habermeier d168479a85 blacklist bad manifest hashes upon failure 2017-06-19 16:24:07 +02:00
Robert Habermeier bedce59a6f Merge pull request #5867 from guanqun/small-fixes
ArchiveDB and other small fixes
2017-06-19 14:03:48 +02:00
Robert Habermeier b84be93bb7 Merge pull request #5866 from guanqun/remove-try
convert try!() to ?
2017-06-19 14:02:58 +02:00
Saulius Valatka a7da8eb593 Make config file optional (#5847) 2017-06-19 11:42:29 +02:00
Marek Kotewicz 575c51f5a0 eip214, #4833 (#4851) 2017-06-19 11:41:46 +02:00
Marek Kotewicz c50dacff17 all executables are workspace members (#5865)
* ethstore-cli and ethkey-cli are workspace projects

* evmbin is now a workspace project
2017-06-19 11:29:09 +02:00
Jaco Greeff d4532fac18 Updated after merge 2017-06-19 10:42:17 +02:00
Jaco Greeff 4dd26c0d7c Merge branch 'master' into ui-2 2017-06-19 10:39:05 +02:00
Jaco Greeff acf9096a83 Updated 2017-06-19 10:38:32 +02:00
Robert Habermeier a99d4c3dd3 Merge pull request #5860 from paritytech/minor-modexp-optimization
minor optimizations of the modexp builtin
2017-06-18 18:20:59 +02:00
Guanqun Lu c1e5c36f7e EthStore: add a Chinese path to tests in ethstore 2017-06-18 23:13:27 +08:00
Guanqun Lu 4eff7abf3b StateDB: change spaces to tab 2017-06-18 23:13:27 +08:00
Guanqun Lu a5531e83fd ArchiveDB: add a new test case 2017-06-18 23:13:27 +08:00
Guanqun Lu 7f07f7d567 ArchiveDB: add a contains() test for long history test case 2017-06-18 23:13:27 +08:00
Guanqun Lu 41fed96d96 convert try!() to ? 2017-06-18 22:16:34 +08:00
Robert Habermeier ed20fa4da1 Merge pull request #5766 from guanqun/db-tests
three small commits for HashDB and MemoryDB
2017-06-18 04:24:45 +02:00
Robert Habermeier e06d1dbb0c Merge pull request #5801 from guanqun/use-retain-for-memorydb
use rust 1.18's retain to boost the purge performance
2017-06-18 04:24:17 +02:00
Guanqun Lu 1efa7e7b10 add one more test case for consolidate, both are negative 2017-06-18 09:02:44 +08:00
Guanqun Lu ce8f8f40d7 move MemoryDB's tests into tests module 2017-06-18 09:02:44 +08:00
Guanqun Lu 4efd673c19 add a bit clarification to HashDB's remove() interface 2017-06-18 09:02:44 +08:00
Robert Habermeier ca27234a59 minor optimizations of the modexp builtin 2017-06-17 21:18:52 +02:00
Denis S. Soldatov aka General-Beck 3111421866 Update .gitlab-ci.yml
snap update
2017-06-17 22:03:12 +03:00
GitLab Build Bot 42dcdde4e8 [ci skip] js-precompiled 20170616-172546 2017-06-16 17:30:14 +00:00
Robert Habermeier d6a0792bd9 Merge pull request #5858 from paritytech/mh-ipfs-allow-post
Allow IPFS server to accept POST requests
2017-06-16 18:46:53 +02:00
Robert Habermeier 7931d6a02a Merge pull request #5836 from paritytech/a5-ui-terminology
Dutch i18n from #5802 for master
2017-06-16 18:45:42 +02:00
Robert Habermeier 07e150a147 Merge pull request #5851 from trappist/typos
Typos in token deploy dapp ui
2017-06-16 18:45:27 +02:00
maciejhirsz 649de53382 Allow IPFS server to accept POST requests 2017-06-16 16:29:15 +02:00
maciejhirsz ba6e41cf07 Fixed account selection for Dapps on public node 2017-06-16 14:00:30 +02:00
Rocco Stanzione ba35d69831 Typos in token deploy dapp ui 2017-06-15 20:06:46 -05:00
Robert Habermeier 8d04dffe69 Merge pull request #5778 from paritytech/unlock
A CLI flag to allow fast transaction signing when account is unlocked.
2017-06-15 15:54:51 +02:00
Jaco Greeff df52394871 UI 2 Approve-all for Filters (#5846)
* Approve all requests or type for token

* Approve all functionality

* Remove extra console.log
2017-06-15 11:59:14 +02:00
Jaco Greeff 58f15f1674 Filter request popups (#5843)
* Formatting

* Update dapps to use web3Provider

* Remove secure flag from config

* Basic request approve/reject popup

* Lenient provider checks

* Case sensitivity fix
2017-06-14 17:12:13 +02:00
Nicolas Gotchac 8cb4bc2127 Fix wrongly called timeouts 2017-06-14 12:35:36 +02:00
Tomasz Drwięga 963bcba267
Merge branch 'master' into unlock 2017-06-14 12:06:27 +02:00
Tomasz Drwięga efc46e78f1
Fix description of AccountProvider setting. 2017-06-14 12:06:15 +02:00
Tomasz Drwięga 00b58d1206
Merge branch 'master' into pubsub-docs
# Conflicts:
#	rpc/src/v1/tests/mocked/pubsub.rs
2017-06-14 11:46:30 +02:00
Tomasz Drwięga f7fb1bfa1d
Fix linting. 2017-06-14 11:45:44 +02:00
Jaco Greeff 38b4ba8d33 Update package-lock 2017-06-14 10:27:33 +02:00
Jaco Greeff 121b742482 Merge branch 'master' into ui-2
# Conflicts:
#	Cargo.lock
#	ethcore/src/evm/instructions.rs
#	js/package.json
#	js/src/modals/CreateAccount/AccountDetails/accountDetails.js
#	js/src/modals/FirstRun/TnC/tnc.js
#	js/src/modals/FirstRun/Welcome/welcome.js
#	js/src/ui/Form/Input/input.js
#	js/src/views/Accounts/accounts.js
#	js/src/views/Settings/Views/defaults.js
#	js/src/views/Settings/Views/views.js
#	js/webpack/app.js
#	js/webpack/libraries.js
2017-06-14 10:16:42 +02:00
GitLab Build Bot 8aa2ed175e [ci skip] js-precompiled 20170613-162317 2017-06-13 16:31:45 +00:00
Tomasz Drwięga fb3668f903 Adding missing documentation. (#5821) 2017-06-13 18:38:10 +03:00
Nicolas Gotchac e4c7a7f30a Don't fail on wrong log decoding (#5813) 2017-06-13 18:36:51 +03:00
Tomasz Drwięga 57479dac27 Use randomized subscription ids for PubSub (#5756)
* Use randomized subscription ids for PubSub

* Use H64 instead of H128.

* iflet instead of match.

* Adding 0x.
2017-06-13 18:36:39 +03:00
Tomasz Drwięga 47e1e18e7e
Ignoring some methods in test. 2017-06-13 16:47:58 +02:00
Tomasz Drwięga 172300158d
Merge branch 'master' into pubsub-docs 2017-06-13 16:30:08 +02:00
Tomasz Drwięga df910277a2
Make empty params array optional for parity_subscribe. 2017-06-13 16:29:35 +02:00
Tomasz Drwięga 9994133446
Adding docs. 2017-06-13 14:07:39 +02:00
Jaco Greeff 8f5a863468 Package updates 2017-06-13 13:23:16 +02:00
Jaco Greeff 6ea932b1de Update test for packages 2017-06-13 12:09:32 +02:00
Jaco Greeff a2fdf38316 Additional merge fixes 2017-06-13 11:34:43 +02:00
Denis S. Soldatov aka General-Beck 6afe0b0612 fix builds
darwin rustup default stable
snap - allow failure
2017-06-13 12:21:44 +03:00
Jaco Greeff 7bbd48a2bd Merge branch 'master' into ui-2
# Conflicts:
#	js/package.json
#	js/src/api/local/ethkey/worker.js
#	js/src/modals/FirstRun/TnC/tnc.js
#	js/src/modals/FirstRun/Welcome/welcome.js
#	js/src/ui/Form/Input/input.js
#	js/src/ui/VaultCard/Accounts/accounts.spec.js
#	js/src/views/Accounts/accounts.js
#	js/src/views/Application/TabBar/tabBar.js
#	js/src/views/Settings/Views/defaults.js
#	js/src/views/Settings/Views/views.js
#	js/webpack/app.js
#	js/webpack/libraries.js
2017-06-13 11:02:38 +02:00
Marek Kotewicz ca6e1aeb1b Merge pull request #5827 from paritytech/mem-fix
Fixed mem write for empty slice
2017-06-13 09:39:58 +02:00
Denis S. Soldatov aka General-Beck 03de333de1 fix verify 2017-06-13 02:35:07 +03:00
Denis S. Soldatov aka General-Beck 42ad8bbdb0 Create cov.sh
add --verify
add RUSTFLAGS="-C link-dead-code"
2017-06-13 02:22:37 +03:00
Denis S. Soldatov aka General-Beck 2501334ed7 add CI variable 2017-06-13 01:37:03 +03:00
GitLab Build Bot 15f19fc026 [ci skip] js-precompiled 20170612-222804 2017-06-12 22:32:43 +00:00
Afri f3874ffaf2 Fix party technologies (#5810) 2017-06-12 22:52:34 +02:00
arkpar 4b74f65ed8 Fixed mem write for empty slice v2 2017-06-12 22:45:57 +02:00
Arkadiy Paronyan 033a75888c Revert "Fixed mem write for empty slice (#5825)" (#5826)
This reverts commit 6b874cedb8.
2017-06-12 22:43:20 +02:00
Arkadiy Paronyan 6b874cedb8 Fixed mem write for empty slice (#5825) 2017-06-12 22:42:58 +02:00
Denis S. Soldatov aka General-Beck 5f01fb7f1a remove nodejs 8 test stage
switch to RUST 1.18 and NodeJS 8.1
2017-06-12 23:40:57 +03:00
GitLab Build Bot 8eda5fcbbf [ci skip] js-precompiled 20170612-164938 2017-06-12 16:53:40 +00:00
Maciej Hirsz c768c302da Merge pull request #5822 from paritytech/fix-tests
Fix JS tests
2017-06-12 18:12:13 +02:00
maciejhirsz c7c05552f3 Fix rust, skip WASM till CI switches to Node 8+ 2017-06-12 17:43:23 +02:00
maciejhirsz 788dd04600 Merge branch 'master' into fix-tests 2017-06-12 17:07:07 +02:00
Tomasz Drwięga f55a69841d Bump native-tls and openssl crates. (#5817) 2017-06-12 16:56:14 +02:00
maciejhirsz 41df8413fc fix JS tests 2017-06-12 16:44:59 +02:00
Maciej Hirsz b2a42f03eb Public node WASM, performance and fixes (#5734) 2017-06-12 15:57:16 +02:00
Robert Habermeier edea41d35e enforce block signer == author field in PoA (#5808) 2017-06-12 12:54:34 +03:00
Tomasz Drwięga 75ac263961 Fix stack display in evmbin. (#5733)
* Fix stack display.

* Additional compatiblity fixes.
2017-06-09 12:31:03 +02:00
Tomasz Drwięga 4c516e1f6f Disable UI if it's not compiled in. (#5773)
* Disable UI if it's not compiled in.

* Properly enabled/disable ui server depending on features.
2017-06-09 12:26:57 +02:00
Tomasz Drwięga 5c3ea4ec29 Require phrase confirmation. (#5731)
* Require phrase confirmation.

* Linting issues.

* Fix dialog title.

* Confirm a backup phrase.

* Confirm recovery phrase on fist run as well.
2017-06-09 12:25:14 +02:00
Anton Gavrilov 06eb561af5 Duration limit made optional for EthashParams (#5777)
* Duration limit made optional for EthashParams

* Forgotten space added
2017-06-09 12:24:23 +02:00
Afri 51ef847c64 Update Changelog for 1.6.8 (#5798)
* Update changelog for 1.6.8

* Add more changelog details for 1.6.8

* Fix date
2017-06-09 12:22:17 +02:00
Afri 1349b4ba07 Replace Ethcore comany name in T&C and some other places (#5796)
* Replace ethcore in terms and conditions

* Replace ethcore company name in various places

* Fix casing in t&c
2017-06-09 12:21:35 +02:00
Bas 4f63377ff2 Fix terminology distributed -> decentralized for Dutch i18n (#5802) 2017-06-09 12:21:10 +02:00
Tomasz Drwięga f86457ffd1 PubSub for IPC. (#5800) 2017-06-09 12:20:37 +02:00
Afri d368006526 Fix terminology distributed -> decentralized (#5797) 2017-06-09 12:20:08 +02:00
Guanqun Lu cd3a1c1a94 use rust 1.18's new feature to boost the purge performance 2017-06-09 01:34:10 +08:00
Maciej Hirsz dabd5b2cc8 Update required rust version 2017-06-08 19:25:35 +02:00
Arkadiy Paronyan 9418fcafb6 Disable compression for RLP strings (#5786) 2017-06-08 17:24:23 +02:00
Jaco Greeff 7f4a7abf49 Ui 2 provider for dapps (#5799)
* Import web3Provider

* Import api

* {Transport,Provider}/Ws -> WsSecure

* PostMessage provider with filters

* PromiseWrapper -> PromiseProvider
2017-06-08 17:14:02 +02:00
5chdn ae8ff941f9 Fix terminology distributed -> decentralized 2017-06-08 14:10:35 +02:00
Jaco Greeff c1599a3d85 Merge branch 'master' into ui-2
# Conflicts:
#	js/src/ui/Balance/balance.js
2017-06-08 11:51:46 +02:00
Tomasz Drwięga 2e7f29cc9f
Merge branch 'master' into unlock 2017-06-08 09:21:04 +02:00
Tomasz Drwięga c2a8415f78
Fix test. 2017-06-08 09:20:50 +02:00
Denis S. Soldatov aka General-Beck 0e36deec81 Merge pull request #5781 from elopio/update-snapcraft-source
update the source for the snapcraft package
2017-06-08 01:14:40 +03:00
Denis S. Soldatov aka General-Beck 317df7e6a6 fix CI lint 2017-06-07 22:05:44 +03:00
Denis S. Soldatov aka General-Beck 1fb11c23d8 port snap build 2017-06-07 21:53:36 +03:00
Tomasz Drwięga 52f7978d4d
Merge branch 'master' into unlock 2017-06-07 17:07:32 +02:00
Arkadiy Paronyan b9b5c84417 Fixed default UI port for mac installer (#5782) 2017-06-07 16:27:26 +02:00
Jaco Greeff 882f963e6b Block invalid account name creation (#5784)
* Additional non-empty phrase check (fromNew)

* Explicit canCreate check in create (not only on UI)

* BN instance check (fixes Geth imports)

* Fixup tests after better checks

* PR comments (Thanks @tomusdrw )

* Typo
2017-06-07 16:27:01 +02:00
Jaco Greeff dec0c8ddd6 Merge branch 'master' into ui-2 2017-06-07 14:14:32 +02:00
Tomasz Drwięga 9773aa4c76 Update Cid/multihash/ring/tinykeccak (#5785)
* Updating ring,multihash,tiny-keccak

* Updating CID in ipfs.
2017-06-07 12:31:12 +02:00
Guanqun Lu 05aa960c25 use NULL_RLP, remove NULL_RLP_STATIC (#5742) 2017-06-07 11:58:39 +02:00
Tomasz Drwięga 19f01194b1 Blacklist empty phrase account. (#5730) 2017-06-07 11:34:53 +02:00
Leo Arias 6dd5297f8a update the source for the snapcraft package 2017-06-07 05:21:10 +00:00
Tomasz Drwięga 139ee17d39
Small typos. 2017-06-06 18:45:33 +02:00
Tomasz Drwięga f5d0fa2c21
Merge branch 'master' into unlock 2017-06-06 18:41:00 +02:00
Tomasz Drwięga a5299bdb1a
Unlocking with secrets. 2017-06-06 18:06:40 +02:00
Arkadiy Paronyan 99bfef2801 EIP-211 RETURNDATACOPY and RETURNDATASIZE (#5678)
* EIP-211

* Optimized memory usage

* Optimized truncation
2017-06-06 18:47:12 +03:00
Denis S. Soldatov aka General-Beck 241de230bb Update .gitlab-ci.yml
add snap build to tags, triggers
2017-06-06 16:19:11 +03:00
Jaco Greeff bba1688981 Master merge updates (conflicts) 2017-06-06 11:24:43 +02:00
Jaco Greeff 6a480ffb5b Merge branch 'master' into ui-2 2017-06-06 09:35:22 +02:00
Arkadiy Paronyan ad6ea4fa49 Bump mio (#5763)
* Bump mio

* Fixed warnings

* Update mio to crates.
2017-06-05 20:40:40 +02:00
Denis S. Soldatov aka General-Beck 815f427c95 Update .gitlab-ci.yml
add rust beta&nigthly test for master
add more triggers
2017-06-05 15:44:37 +03:00
GitLab Build Bot 754abdb861 [ci skip] js-precompiled 20170604-110515 2017-06-04 11:09:12 +00:00
Tomasz Drwięga 8a364bbfaa Fixing UI issues after UI server refactor (#5710)
* Self-sufficient secureApi.

* Updating embed.

* Linting issues.
2017-06-04 12:34:03 +02:00
GitLab Build Bot e89d49d958 [ci skip] js-precompiled 20170603-131456 2017-06-03 13:18:47 +00:00
Tomasz Drwięga 68c8948294 fix WS server expose issue. (#5728) 2017-06-03 15:41:42 +03:00
Tomasz Drwięga 5ec5d2fa0b Fix local transactions without condition. (#5716) 2017-06-03 15:41:31 +03:00
Tomasz Drwięga 45d8cc706c Bump wordlist. (#5748) 2017-06-02 13:06:41 +02:00
Denis S. Soldatov aka General-Beck d7e531c373 JS test Node 7 -> 8 2017-06-01 00:05:11 +03:00
DevOps Parity c5c1978584 initial support snapcraft.io
create snapcraft.yaml  for snapcraft.io
2017-05-31 21:17:44 +03:00
Jaco Greeff a328eef8d9 UI 2 Api providers (#5714)
* Add providers

* Convert rpc calls to use provider

* Update SecureApi for provider
2017-05-31 12:08:04 +02:00
Guanqun Lu 5a20c63b70 two small changes in evm (#5700)
* add a simple test for is_push so that every small utility has a corresponding unit test

* split evm/factory.rs into two files as the TODO suggests

* style fixes according to review comments
2017-05-30 19:31:43 +02:00
Tomasz Drwięga 480741894b JSON format printing pre-state. (#5712) 2017-05-30 19:30:15 +02:00
Nicolas Gotchac c2c7231cad Recover from empty phrase in dev mode (#5698)
* Add dev chain to isTest

* Fix signer

* Fix no condfition transactions

* Fix case : old parity

* Fix propTypes.
2017-05-30 19:28:50 +02:00
Jaco Greeff 265618f306 Merge branch 'master' into ui-2 2017-05-30 13:43:38 +02:00
Jaco Greeff fd3c8bced7 UI2 fixes for Signer popup (#5711)
* Fix new origin shape

* Pass input types through (<input /> tag)

* Update build
2017-05-30 13:41:30 +02:00
Arkadiy Paronyan e6a31e7543 EIP-210 BLOCKHASH changes (#5505)
* EIP-210

* comment
2017-05-30 11:52:33 +02:00
Jaco Greeff d888190637 Merge branch 'master' into ui-2
# Conflicts:
#	js/src/modals/FirstRun/Welcome/welcome.js
2017-05-30 10:45:48 +02:00
GitLab Build Bot de4c9507e6 [ci skip] js-precompiled 20170529-225538 2017-05-29 22:59:31 +00:00
Robert Habermeier 158ebef566 Merge pull request #5708 from patrick99e99/master
fixes typo
2017-05-30 00:36:28 +02:00
Patrick Collins b14145f23b fixes typo 2017-05-29 14:29:55 -07:00
Arkadiy Paronyan 7c2c39cb11 bump rocksdb (#5707) 2017-05-29 18:37:35 +03:00
Arkadiy Paronyan a4aec56d18 Fixed --datadir option (#5697)
* Fixed --datadir

* Removed evmbin lib
2017-05-29 15:15:54 +02:00
Jaco Greeff fce0167991 Merge branch 'master' into ui-2 2017-05-29 09:42:47 +02:00
Craig O'Connor 3991178b8d rpc -> weak to arc (#5688)
* helpers-1

* helpers2-impls1

* small adjustments1

* cleanup-2

* small changes

* helper-impl-cleanup-finished

* test-update

* merge fix

* merge fix

* merge fix2

* fix tests

* fix tests2

* fix tests3
2017-05-28 08:40:36 -04:00
Guanqun Lu a246278727 typo fix (#5699) 2017-05-27 23:35:18 +03:00
Denis S. Soldatov aka General-Beck 1f0f27bc65 Dockerfile for hub.docker.com 2017-05-26 15:18:17 +03:00
Denis S. Soldatov aka General-Beck a4a36422d4 Add Installed-Size to deb build
https://github.com/paritytech/parity/issues/4937
2017-05-26 14:56:51 +03:00
Tomasz Drwięga 543965411e Revamping parity-evmbin (#5696)
* Revamping evmbin to support spec files, json format and subcalls.

* Fix formatting of usage.
2017-05-26 11:06:48 +02:00
Jaco Greeff 37c3f51f6e Update deps for console refactor 2017-05-24 14:45:10 +02:00
Jaco Greeff 45c6cc6ac0 Merge branch 'master' into ui-2 2017-05-24 14:09:51 +02:00
Jaco Greeff d33d54dbf9 Merge pre-update 2017-05-24 14:05:34 +02:00
GitLab Build Bot bbbdd02a00 [ci skip] js-precompiled 20170524-104640 2017-05-24 10:50:29 +00:00
Nikolay Volf e1fef5c732 Update dependencies and bigint api (#5685)
* update to latest bigint

* bump elastic array and deps

* fix rlp tests

* also update all smallvec deps

* fix doc test

* reduce parking in attempt to fix CI bug

* fix from/into electum bug

* remove duplicate imports
2017-05-24 12:31:33 +02:00
Tomasz Drwięga cbcc369a2d UI server refactoring (#5580)
* Full API in Authenticated WS server.

* Replacing UI server with Hyper.

* Solving CLI, RPCs and tests.

* Porting signer tests.

* Fixing origin recognition for dapps/rpc.

* Fixing tests. Adding parity-rpc-client to test.

* Dapps exposed as RPC method.

* JS code to support new connection scheme.

* Fixing dapps tests.

* Updating allowed origins/hosts to support web3.site.

* Fixing tests, fixing UI.

* Fixing tests.

* Removing invalid tests.

* Fixing merge.

* 404 fallback for UI

* Improve ContentFetcher constructor readability.

* Naming.

* Update .gitlab-ci.yml

fix CI lint error

* Fixing tests and linting issues.

* Fixing new tests.

* UI hosts.

* Submodules fix.
2017-05-24 12:24:07 +02:00
Nikolay Volf 7499efecf6 fix from/into electum bug (#5686) 2017-05-24 11:53:02 +02:00
Robert Habermeier 18c3e90dbf Merge pull request #5671 from paritytech/guanqun-add-unit-tests
Guanqun add unit tests
2017-05-23 15:18:11 -04:00
Tomasz Drwięga 00cdc52323 Parity-PubSub as a separate API. (#5676)
* Parity-PubSub as a separate API.

* Fix tests.

* Fixes after merge.
2017-05-23 19:05:17 +03:00
Arkadiy Paronyan dd004aba9f EIP-140 (#5477) 2017-05-23 16:49:17 +03:00
Afri 2ab21acf11 Update CHANGELOG for 1.6.7 (#5683) 2017-05-23 15:28:41 +02:00
GitLab Build Bot 6b6555852c [ci skip] js-precompiled 20170523-130314 2017-05-23 13:07:10 +00:00
Gav 8a54c91431 Merge branch 'add-unit-tests' of https://github.com/guanqun/parity into guanqun-add-unit-tests 2017-05-23 08:48:04 -04:00
Micah Zoltu 2092b805b6 Updated docs slightly. (#5674)
These docs _really_ need a lot of improvement (like what are the options that go in `{}`, but at least they are now not outright incorrect.
2017-05-23 08:37:27 -04:00
Nikolay Volf 53add78a28 Fix build (#5684)
* missing feature

* dapps update
2017-05-23 08:35:34 -04:00
Robert Habermeier 386cdb830d Back-references for the on-demand service (#5573)
* header back-references for on demand

* initial back-reference implementation for on demand requests

* answer requests from cache

* answer requests from cache, add tests

* strongly typed responses for vectors of homogeneous requests

* fix fallout in RPC without optimizing
2017-05-23 12:39:25 +02:00
Robert Habermeier aa41b48ba0 Dynamically adjust PIP request costs based on gathered data (#5603)
* beginnings of load timer

* initial load timer implementation

* saturating adds

* create flow params from distribution

* update request credits and acknowledgement

* mark cumulative cost dead code

* fix compilation

* tests

* supply load share and other params to  lightprotocol params

* add file store

* fix ethsync compilation

* reshuffle constants
2017-05-23 12:31:09 +02:00
Marek Kotewicz a8d99ae465 use cargo workspace (#5601)
* use cargo workspace

* removed profiles for non root packages
2017-05-23 12:28:22 +02:00
Tomasz Drwięga f38cc8e182 Latest headers Pub-Sub (#5655)
* Signer subscription.

* Fixing RPC tests.

* Block Headers eth-pubsub.

* PubSub for light client.

* Fixing tests.

* Updating to proper jsonrpc version.

* Update to correct tests.

* Fixing tests.
2017-05-23 12:26:39 +02:00
Marek Kotewicz 92f5aa7e10 improved dockerfile builds (#5659)
* docker builds current branch instead of cloning the repo

* moved ADD command right before RUN cd parity in Dockerfiles

* update docker/README.md

* removed --no-cache from docker/README.md
2017-05-23 12:25:41 +02:00
Tomasz Drwięga f47cbe0be6 Adding CLI options: port shift and unsafe expose. (#5677)
* Adding CLI option for port shift and unsafe expose.

* Fixing IPC path.

* Fix hosts when attempting to expose on all interfaces.

* Fixing test.

* Fix typo.
2017-05-23 12:24:32 +02:00
Jaco Greeff 368e3d1f51 Merge branch 'master' into ui-2 2017-05-22 11:50:15 +02:00
Craig O'Connor 7a4eb15b4c Form fixes (#5664)
* label fix

* label-tx-row

* form fixes
2017-05-22 11:00:37 +02:00
keorn 532801f9d6 Report missing author in Aura (#5583)
* report missing block

* add a test validator set

* add a skip test

* clean up test

* report all skipped
2017-05-22 08:21:34 +02:00
Guanqun Lu 14b715bdc7 fix not build issue, only detect pure js folder 2017-05-21 10:44:20 +08:00
Gav 0a62117851 Merge branch 'add-unit-tests' of https://github.com/guanqun/parity into guanqun-add-unit-tests 2017-05-20 11:24:58 +02:00
Guanqun Lu 86b00a9271 typo fix (#5669) 2017-05-20 11:22:35 +02:00
Guanqun Lu d35da909db add asserts in ethash.rs 2017-05-20 12:12:16 +08:00
Guanqun Lu 73ad575306 add asserts in genesis.rs 2017-05-20 12:12:16 +08:00
Guanqun Lu 292eb1de62 add asserts in engine.rs 2017-05-20 12:12:16 +08:00
GitLab Build Bot 99a1636c62 [ci skip] js-precompiled 20170519-161414 2017-05-19 16:18:02 +00:00
Jaco Greeff c944b2e632 Remove public middleware (temporary) (#5665) 2017-05-19 18:05:44 +02:00
GitLab Build Bot ae0841598f [ci skip] js-precompiled 20170519-154153 2017-05-19 15:45:53 +00:00
Jaco Greeff 637730996a Remove additional polyfill (#5663) 2017-05-19 17:30:54 +02:00
Tomasz Drwięga 1a1d5e4a73 Importing accounts from files. (#5644)
* Importing accounts from files.

* whitespace

[ci:skip]
2017-05-19 17:14:47 +02:00
Guanqun Lu d10ade1963 remove the deprecated options in rustfmt.toml (#5616)
* remove the deprecated options in rustfmt.toml

* add chain_one_line_max

* fix two issues spot by rustfmt
2017-05-19 17:12:20 +02:00
Nicolas Gotchac 84cab18120 Update the Console dapp (#5602)
* Init Console Dapp structure

* Watches and status

* First REPL and display

* Attaching console

* Selectable autocomplete

* working console // Display objects nicely

* Multilines in Console Dapps

* Better UI

* Eval on window object

* Save console gistory

* Adding views

* Add settings to the console dapp

* Add / remove Watches

* Add Snippets Cmponent

* Semi Working Snippets

* Working Snippets

* Adding CodeMirror features

* Removing old Console

* Add Static folder
2017-05-19 17:07:59 +02:00
Tomasz Drwięga 3ff72794e5 Create an account for chain=dev (#5612)
* implement From<&'static str> for Secret

* Dev account.

* Fix Secret semantics.
2017-05-19 17:06:36 +02:00
Jaco Greeff e7abd3510a Use babel-runtime as opposed to babel-polyfill (#5662)
* Add babel-runtime

* Add babel-transform-runtime plugin

* Remove babel-polyfill imports

* Remove babel-polyfill package

* Transform exports to work around webpack 2.2
2017-05-19 16:51:15 +02:00
Guanqun Lu f96731c82b add assets for seal.rs 2017-05-19 22:48:23 +08:00
Guanqun Lu 5c7c30cc4b add asserts in spec param.rs 2017-05-19 22:48:23 +08:00
Guanqun Lu a61b249d57 add asserts in tendermint.rs 2017-05-19 22:48:23 +08:00
Guanqun Lu 0b4eef48c5 add asserts in instantseal 2017-05-19 22:48:23 +08:00
Guanqun Lu 90b8b612cc add asserts for spec::basic_authority 2017-05-19 22:48:23 +08:00
Guanqun Lu c0a8eaa3bf add asserts in spec::authority_round's unit test 2017-05-19 22:48:23 +08:00
Guanqun Lu a0dd77ca01 add asserts in spec::validatorset's unit test 2017-05-19 22:48:23 +08:00
Guanqun Lu f90802498f add two asserts in unit tests for spec::authority_round 2017-05-19 22:48:23 +08:00
Guanqun Lu cf0b8b7681 add several new tests for spec::account 2017-05-19 22:48:23 +08:00
Jaco Greeff 602115d81e Merge branch 'master' into ui-2
# Conflicts:
#	js/src/shell/Connection/connection.js
#	js/src/ui/Icons/index.js
#	js/src/views/Accounts/CreateAccount/RecoveryPhrase/recoveryPhrase.js
2017-05-19 14:55:13 +02:00
Denis S. Soldatov aka General-Beck 2fd44e6ce4 CI add test stage with node 7.x 2017-05-18 21:22:52 +03:00
GitLab Build Bot 23a4a22869 [ci skip] js-precompiled 20170518-113124 2017-05-18 11:35:53 +00:00
Jaco Greeff aa9894711b Connection dialog timestamp info (#5554)
* Timetsamp adjustment note

* Type & unneeded values
2017-05-18 12:46:30 +02:00
Guanqun Lu 6d81b8a49a use copy_from_slice instead of for loop (#5647) 2017-05-18 12:46:14 +02:00
Robert Habermeier b1eab698d2 Light friendly dapps (#5634)
* move native_contracts ABIs to JSON files, add urlhint

* port hash-fetch to futures, fix tests

* fix dapps compilation, defer async port to later

* activate dapps server in the light client

* better formatting
2017-05-18 12:44:09 +02:00
Craig O'Connor 6978e38752 style-fix (#5649) 2017-05-18 12:33:01 +02:00
GitLab Build Bot 95d9706fe1 [ci skip] js-precompiled 20170518-101141 2017-05-18 10:15:33 +00:00
Nicolas Gotchac 8b1f0b7cf4 Add Recover button to Accounts and warnings (#5645)
* Add Recover button to Accounts // Add Warnings

* Change to 11

* Add test net checks for empty recovery phrase

* Fix failing tests
2017-05-18 11:50:15 +02:00
Jaco Greeff 20bda5f5a0 Ui 2 components cleanups (#5653)
* Add autoFocus for search

* Remove old/unused renderer

* LabelComponent -> LabelWrapper

* Consistent LabelWrapper usage
2017-05-18 11:48:53 +02:00
Jaco Greeff e0927f099e Merge branch 'master' into ui-2 2017-05-18 11:26:09 +02:00
Jaco Greeff 4b5a1d01ce Merge remote-tracking branch 'origin/ui-2' into ui-2 2017-05-18 10:07:35 +02:00
Craig O'Connor 78461d8a74 flow (#5606)
* FLOW

* ui-2-one more fix
2017-05-18 10:06:59 +02:00
GitLab Build Bot 2ec51fc0ad [ci skip] js-precompiled 20170517-144631 2017-05-17 14:50:24 +00:00
Tomasz Drwięga 379b920d49 Update eth_sign docs. (#5631) 2017-05-17 16:21:39 +02:00
Tomasz Drwięga 240704fb54 Proper signer Pub-Sub for pending requests. (#5594)
* Signer subscription.

* Fixing RPC tests.

* Improve notification performance.
2017-05-17 16:20:41 +02:00
Jaco Greeff ab86f9e696 Merge branch 'master' into ui-2 2017-05-17 14:20:07 +02:00
Marek Kotewicz da8be072fa Merge pull request #5641 from paritytech/bigint-bump
Bump bigint to 1.0.5
2017-05-17 13:33:05 +02:00
Robert Habermeier 4c5e4ac8da PoA warp implementation (#5488)
* separate modules for consensus snapshot chunks

* bulk of authority warp logic

* finish authority warp implementation

* squash warnings and enable authority snapshot mode

* test harness for PoA

* fiddle with harness

* epoch generation proof fixes

* update constructor code

* store epoch transition proof after block commit

* basic snap and restore test

* use keyvaluedb in state restoration

* decompress chunks

* fix encoding issues

* fixed-to-contract-to-contract test

* implement ancient block import

* restore genesis transition in PoW snapshot

* add format version method to snapshot components

* supported version numbers in snapshot_components

* allow returning of ancient epoch transitions

* genesis hash mismatch check

* remove commented code
2017-05-17 12:41:33 +02:00
Robert Habermeier 5d973f8ef5 Merge pull request #5419 from paritytech/on-demand-priority
Improve on-demand dispatch and add support for batch requests
2017-05-17 12:28:27 +02:00
Tomasz Drwięga fa4426c814
Bump bigint. 2017-05-17 10:07:20 +02:00
Robert Habermeier c7cf43d1c1 improve assertion 2017-05-16 17:24:12 +02:00
GitLab Build Bot 7626ddc9c3 [ci skip] js-precompiled 20170516-145955 2017-05-16 15:03:40 +00:00
Jaco Greeff f7ea667140 Merge branch 'master' into ui-2 2017-05-16 17:03:17 +02:00
Nicolas Gotchac 8642300d74 Use default account for sending transactions (#5588)
* Add default account for Wallet Creation

* Use default account by default, save current used account

* Fix tests
2017-05-16 15:38:16 +01:00
Jaco Greeff 673cde3c0b Ui 2 cleanups (unused components, shared assets) (#5636)
* Remove unused components

* Move to dapp/index.js

* Move assets to @parity/shared
2017-05-16 16:01:11 +02:00
Jaco Greeff 95f6f70d8f Ui 2 complete MUI removal (#5635)
* Convert DateTime input component

* Remove muiTheme context
2017-05-16 14:46:48 +02:00
GitLab Build Bot 48ddd8b312 [ci skip] js-precompiled 20170516-115901 2017-05-16 12:04:56 +00:00
Jaco Greeff 31be9d25f3 Merge branch 'master' into ui-2
# Conflicts:
#
js/src/shell/Signer/components/TransactionPendingFormConfirm/transaction
PendingFormConfirm.js
#	js/src/ui/Container/Title/title.js
#	js/src/views/Application/Snackbar/snackbar.js
#	js/src/views/Status/Peers/peers.js
2017-05-16 13:30:19 +02:00
Jaco Greeff 665998e797 Ui 2 mui to sui conversion (#5633)
* Split chip rendering from input

* Slider component

* Render Chip without MUI

* Adjust InputChip styling

* Remove mui chip input

* Remove mui-chip-input from build

* Convert input to sui
2017-05-16 12:25:47 +02:00
Nicolas Gotchac 0f1a857576 Add peer management to the Status tab (#5566)
* Add peer management to the Status tab

* Fix propTypes issue
2017-05-16 11:01:55 +01:00
keorn 945c1a9478 add monotonic transition to kovan (#5587) 2017-05-15 21:34:01 +01:00
Tomasz Drwięga 879195397e Decrypting for external accounts. (#5581) 2017-05-15 18:59:41 +02:00
Jaco Greeff c27d96a4f1 Ui 2 additional MUI replacements (#5623)
* Loader spinner

* Progressbar conversion

* Update Progress

* Transfer operational again

* Remove List/ListItem from features

* Remove extra animation

* Remove iconButton

* Remove underline(input to be replaced)

* Convert Sort to Popup

* Remove unused AutoComplete component

* Simplify ModalBox

* Allow empty Actionbar

* Adjust shapeshift icon

* Simplify MUI theme (before removal)

* Update tests
2017-05-15 14:49:47 +02:00
Jaco Greeff c5fa9844f2 Merge branch 'master' into ui-2 2017-05-15 10:03:51 +02:00
Robert Habermeier 4df1772078 Merge pull request #5595 from paritytech/no-warp-if-disabled
only enable warp sync when engine supports it
2017-05-13 15:04:06 +02:00
Robert Habermeier f8279bb7bb code cleanup with macro 2017-05-12 18:00:01 +02:00
Robert Habermeier 2a6f38c587 removing slienced warning 2017-05-12 17:53:10 +02:00
Robert Habermeier 909f3d76d8 optimize back-reference filling 2017-05-12 17:25:02 +02:00
Jaco Greeff 9bc82543ee Merge branch 'master' into ui-2 2017-05-12 17:19:50 +02:00
Robert Habermeier 2d87f562f6 address grumbles 2017-05-12 17:16:38 +02:00
Jaco Greeff 7cdddd344b Ui 2 remove mui from views & shell (#5613)
* Stepper from semantic-ui

* Tabs component

* ui/Tabs in loadContract

* Adapt Dropdown events

* Remove direct use of semantic-ui

* Remove IconButton & Subheader

* Remove IconMenu

* ui/List & List.Item

* Be explicit in context props
2017-05-12 17:06:53 +02:00
Marek Kotewicz b1f6112c5c Merge pull request #5586 from guanqun/doc-fix
fix the doc of installing rust
2017-05-12 16:35:47 +02:00
Marek Kotewicz c38e33ca8b Merge pull request #5584 from guanqun/small-fixes
Small fixes
2017-05-12 16:34:49 +02:00
Svyatoslav Nikolsky e6ecd05308 SecretStore: remove session on master node (#5545)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem

* secretstore network transport

* encryption_session_works_over_network

* network errors processing

* connecting to KeyServer

* licenses

* get rid of debug println-s

* fixed secretstore args

* encryption results are stored in KS database

* decryption protocol works over network

* enc/dec Session traits

* fixing warnings

* fix after merge

* on-chain ACL checker proto

* fixed compilation

* fixed compilation

* finally fixed <odd>-of-N-scheme

* temporary commented test

* 1-of-N works in math

* scheme 1-of-N works

* updated AclStorage with real contract ABI

* remove unnecessary unsafety

* fixed grumbles

* wakeup on access denied

* encrypt secretstore messages

* 'shadow' decryption

* fix grumbles

* lost files

* secretstore cli-options

* decryption seccion when ACL check failed on master

* disallow regenerating key for existing document

* removed obsolete TODO

* fix after merge

* switched to tokio_io

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fixed test

* fix after merge

* encryption session errors are now fatal

* session timeouts

* autorestart decryption session

* remove sessions on completion

* exclude disconnected nodes from decryption session

* test for enc/dec session over network with 1 node

* remove debug printlns

* fixed 1-of-1 scheme

* drop for KeyServerHttpListener

* Use standard encryption and decryption (as in RPC)

* added some tests

* moved DEFAULT_MAC to ethcrypto

* rpc_secretstore_encrypt_and_decrypt

* serialization with "0x" prefix (RPC compatibility)

* secretstore RPC API

* fix after merge

* fixed typo

* secretstore_shadowDecrypt RPC

* enable secretstore RPCs by default

* fixed test

* SecStore RPCs available without SecStore feature

* fixed grumbles

* lost files

* added password argument to Parity RPCs

* update docs

* remove enc/dec session on master node

* lost file

* pass weak instead of arc
2017-05-12 14:36:19 +02:00
GitLab Build Bot 83a13ee0e6 [ci skip] js-precompiled 20170512-102851 2017-05-12 10:32:43 +00:00
Craig O'Connor 662a8317a5 run-clean (#5607) 2017-05-12 12:10:24 +02:00
Jaco Greeff 1243728725 Merge remote-tracking branch 'origin/ui-2' into ui-2 2017-05-12 12:06:58 +02:00
Jaco Greeff 5da7c32bdf Ui 2 radios & imports (#5609)
* Remove mui IconButton

* Token type selection

* Convert RadioButtons

* RadioButtons consistency

* Import @parity/ui

* Import @parity/ui

* Explicit name for RadioButtons

* Convert to semantic Radio
2017-05-12 12:06:16 +02:00
Jaco Greeff 79e991d8a6 Merge branch 'master' into ui-2 2017-05-12 12:04:57 +02:00
Robert Habermeier 38ed39ebe0 Merge pull request #5591 from paritytech/relicense-rlp
relicense RLP to MIT/Apache2
2017-05-11 16:54:43 +02:00
Robert Habermeier 83325b5b72 Merge pull request #5597 from paritytech/ethsign
Fix eth_sign signature encoding.
2017-05-11 16:43:39 +02:00
Robert Habermeier 79f9e9b061 fix dependency graph 2017-05-11 15:37:11 +02:00
Robert Habermeier 8c86bd1b31 bump RLP version 2017-05-11 15:35:38 +02:00
Robert Habermeier f299190e46 relicense ethcore-bigint 2017-05-11 15:34:35 +02:00
Tomasz Drwięga feb7ac7ba8
Fix ethkey test. 2017-05-11 14:58:24 +02:00
Jaco Greeff 78b6de55b3 Ui 2 Select component conversion (#5598)
* Remove mui/Paper from PasswordManager

* Aliasses for @parity packages

* Remove mui/Card from contract queries

* Toggle component replacement (mui-only)

* Semantic-ui toggle component

* LabelComponent warpper for Toggle

* Convert Selectors

* Test fixes

* Fix case
2017-05-11 14:02:27 +02:00
Tomasz Drwięga fc3e1a4f18
Fix eth_sign signature encoding. 2017-05-11 12:47:47 +02:00
Jaco Greeff b1a390983b Merge branch 'master' into ui-2 2017-05-11 09:57:39 +02:00
Craig O'Connor 85cf93e65d Merge pull request #5559 from paritytech/menu
dropdowns
2017-05-10 23:48:40 -04:00
Denis S. Soldatov aka General-Beck 28b66d1b58 Update deb-build.sh
Ethcore -> Parity Technologies
2017-05-10 23:19:08 +03:00
GitLab Build Bot 2b30e0b5e0 [ci skip] js-precompiled 20170510-155435 2017-05-10 15:58:15 +00:00
Jaco Greeff 7c78dff386 Updates after merge (last remaining middleware nigglies) 2017-05-10 17:50:23 +02:00
Nicolas Gotchac 8146cbdae7 Check pending request on Node local transactions (#5564)
* Check pending request on Node

* Linting

* Liting

* Fix tests
2017-05-10 17:33:53 +02:00
Jaco Greeff 566b6a1967 Merge branch 'master' into ui-2
# Conflicts:
#	js/src/shared/redux/middleware.js
#	js/src/shared/redux/providers/registry/middleware.js
#	js/src/shell/Application/application.js
#	js/src/ui/Actionbar/actionbar.js
#	js/src/ui/Button/button.js
#	js/src/ui/Form/AddressSelect/addressSelect.js
#	js/src/ui/Form/Input/input.js
#	js/src/ui/MethodDecoding/methodDecoding.js
2017-05-10 17:29:07 +02:00
Robert Habermeier 56768ff237 only try to warp when engine supports it 2017-05-10 17:12:00 +02:00
GitLab Build Bot 710339d0a8 [ci skip] js-precompiled 20170510-143939 2017-05-10 14:43:30 +00:00
Nicolas Gotchac eff4cde738 Add tooltips capabilities to buttons (#5562)
Add tooltips for buttons on ActionBar if text not visible
2017-05-10 16:19:01 +02:00
GitLab Build Bot 3e86b2e666 [ci skip] js-precompiled 20170510-134918 2017-05-10 13:52:55 +00:00
Nicolas Gotchac 0a16c350d1 Can't deploy without compiling Contract (#5593) 2017-05-10 15:24:24 +02:00
GitLab Build Bot c58c253cbf [ci skip] js-precompiled 20170510-131400 2017-05-10 13:17:46 +00:00
Nicolas Gotchac 5baccafb23 Add a warning when node is syncing (#5565)
* Add a warning when node is syncing

* Linting

* Linting

* PR Grumbles
2017-05-10 15:02:47 +02:00
Nicolas Gotchac 076b602343 Update registry middleware (#5585) 2017-05-10 14:42:26 +02:00
Nicolas Gotchac 860d6c01ed Set block condition to BigNumber in MethodDecoding (#5592)
* Set block condition to BigNumber in MethodDecoding

* Add gt(0)
2017-05-10 14:41:52 +02:00
Jaco Greeff 35a5c4787b Revert to original label (everything lowercase atm UI-wide) 2017-05-10 14:38:28 +02:00
Jaco Greeff 7799883adc Fix tests 2017-05-10 14:31:55 +02:00
Jaco Greeff c3ee7f04e5 Simplify Dropdown, pass label correctly 2017-05-10 14:27:04 +02:00
Jaco Greeff 1c262b2172 Merge branch 'ui-2' into menu 2017-05-10 13:47:36 +02:00
Jaco Greeff b9c4e5b36c Ui 2 depends & fixes (#5590)
* File paths

* Align balance overlays & sizes

* Copy works as expected

* Re-arrange imports

* Icon props

* Move packages to their original dependencies

* Dependencies to packages

* Update test babel overrides
2017-05-10 13:23:14 +02:00
Robert Habermeier a2fe46f8b3 use bigint on crates.io 2017-05-10 13:16:24 +02:00
Robert Habermeier bccf58df51 relicense RLP to MIT/Apache2 2017-05-10 13:03:30 +02:00
Robert Habermeier 0fd3e36c23 Merge branch 'master' into on-demand-priority 2017-05-10 12:18:30 +02:00
Guanqun Lu a4b0e0c93c fix the doc of installing rust
multirust is deprecated.
2017-05-10 17:13:40 +08:00
oconnorct1 4944f59118 style fix 2017-05-09 21:13:04 -04:00
oconnorct1 a0929c4c90 style fix 2017-05-09 21:12:41 -04:00
oconnorct1 66843a349d SemanticButton 2017-05-09 21:08:05 -04:00
oconnorct1 f014891288 Merge branch 'menu' of github.com:paritytech/parity into menu 2017-05-09 21:07:10 -04:00
oconnorct1 19d97136a5 grumbles 2017-05-09 21:06:11 -04:00
oconnorct1 68cbd87bc2 grumbles 2017-05-09 21:04:56 -04:00
Guanqun Lu 04eef37cad remove the extra $ in front of a flag 2017-05-09 23:47:34 +08:00
Guanqun Lu cd693dcf3e typo fix 2017-05-09 23:46:46 +08:00
Jaco Greeff 861cbb874b Ui 2 ui (#5582)
Ui 2 small UI fixes
2017-05-09 17:31:48 +02:00
Robert Habermeier 9358f81ac1 fix indentation 2017-05-09 14:24:45 +02:00
Jaco Greeff 4007865bec Merge branch 'ui-2-fixes' into ui-2 2017-05-09 14:23:03 +02:00
Jaco Greeff 7623455cb6 Snackbar update 2017-05-09 14:20:36 +02:00
Jaco Greeff 9f91c0490c Merge branch 'master' into ui-2 2017-05-09 14:10:24 +02:00
Jaco Greeff 7785fa3938 Fix JS header (// comments for JS) 2017-05-09 14:06:06 +02:00
Jaco Greeff 36b437270b Remove Card completely 2017-05-09 14:04:58 +02:00
GitLab Build Bot 518b6e647b [ci skip] js-precompiled 20170509-115458 2017-05-09 11:58:48 +00:00
Jaco Greeff c37c579585 Merge branch 'ui-2' into menu 2017-05-09 13:50:47 +02:00
Jaco Greeff 40744d1bd2 Merge branch 'master' into ui-2 2017-05-09 13:47:29 +02:00
GitLab Build Bot 9947493977 [ci skip] js-precompiled 20170509-112134 2017-05-09 11:25:44 +00:00
Nicolas Gotchac e5ff36f1f1 Load the sources immediatly in Contract Dev (#5575) 2017-05-09 12:56:35 +02:00
Nicolas Gotchac d83d938ee3 Remove formal verification messages (#5574) 2017-05-09 12:56:20 +02:00
Nicolas Gotchac c5116e5049 Fix event params decoding when no names for parameters #5409 (#5567) 2017-05-09 12:56:08 +02:00
Nicolas Gotchac 1288b4b28f Do not convert to Dates twice (#5563)
* Don't convert Dates twice

* Take string dates into account
2017-05-09 12:55:52 +02:00
Nicolas Gotchac df9096df80 Fix Multisig wallet settings (#5560)
* Improve add/remove owner in Wallet (use changeOwner)

* fix linting
2017-05-09 12:55:35 +02:00
Jaco Greeff 0a36ba54dc Merge branch 'ui-2-move' into ui-2 2017-05-09 12:46:23 +02:00
Jaco Greeff af53a8da83 Add missing package files 2017-05-09 12:46:00 +02:00
Jaco Greeff 4c28ef40b7 Ui 2 shared package (redux, mobx, utils) (#5579)
* Create @parity/shared

* Move ~/util to shared/util

* Move ~/contracts to shared/contracts

* Move ~/config to shared/config

* Move ~/environment to shared/environment

* Updated paths

* Move ~/mobx to shared/mobx

* Move ~/redux to shared/redux

* Add shared to test babel compile
2017-05-09 12:01:44 +02:00
Jaco Greeff 073564b508 Merge branch 'master' into ui-2 2017-05-09 10:11:13 +02:00
YaNing Zhang 0bd4d5bb0c Typo (#5547) 2017-05-07 14:33:52 +02:00
oconnorct1 43629d0fd4 card / update dropdown 2017-05-07 02:17:31 -04:00
Tomasz Drwięga 1617264b69 Generic PubSub implementation (#5456)
* Generic PubSub

* Adding more tests.

* Fix submodules.

* Remove PartialEq

* Actually remove the implementation.

* Update mod.rs

* Update mod.rs
2017-05-06 13:24:18 +02:00
Gav Wood 91d6f14e3c Fix CI paths. (#5570) 2017-05-06 13:24:00 +02:00
Robert Habermeier 6dd1fe0312 reorg into blocks before minimum history (#5558) 2017-05-05 15:01:19 +01:00
Arkadiy Paronyan ed7c366b90 EIP-86 fixes (#5506) 2017-05-05 15:00:40 +01:00
Svyatoslav Nikolsky 8b9adb4d74 Secretstore RPCs + integration (#5439)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem

* secretstore network transport

* encryption_session_works_over_network

* network errors processing

* connecting to KeyServer

* licenses

* get rid of debug println-s

* fixed secretstore args

* encryption results are stored in KS database

* decryption protocol works over network

* enc/dec Session traits

* fixing warnings

* fix after merge

* on-chain ACL checker proto

* fixed compilation

* fixed compilation

* finally fixed <odd>-of-N-scheme

* temporary commented test

* 1-of-N works in math

* scheme 1-of-N works

* updated AclStorage with real contract ABI

* remove unnecessary unsafety

* fixed grumbles

* wakeup on access denied

* encrypt secretstore messages

* 'shadow' decryption

* fix grumbles

* lost files

* secretstore cli-options

* decryption seccion when ACL check failed on master

* disallow regenerating key for existing document

* removed obsolete TODO

* fix after merge

* switched to tokio_io

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fixed test

* fix after merge

* encryption session errors are now fatal

* session timeouts

* autorestart decryption session

* remove sessions on completion

* exclude disconnected nodes from decryption session

* test for enc/dec session over network with 1 node

* remove debug printlns

* fixed 1-of-1 scheme

* drop for KeyServerHttpListener

* Use standard encryption and decryption (as in RPC)

* added some tests

* moved DEFAULT_MAC to ethcrypto

* rpc_secretstore_encrypt_and_decrypt

* serialization with "0x" prefix (RPC compatibility)

* secretstore RPC API

* fix after merge

* fixed typo

* secretstore_shadowDecrypt RPC

* enable secretstore RPCs by default

* fixed test

* SecStore RPCs available without SecStore feature

* fixed grumbles

* lost files

* added password argument to Parity RPCs

* update docs

* lost file
2017-05-05 14:57:29 +01:00
Jaco Greeff d91fae4e54 UI 2 tests & webpack dapp build updates/fixes (#5561)
* Tests are executing again

* Fix tests

* Add missing contextTypes

* IdentityIcon without Connect()

* Update ~/ui tests

* Update spec locations

* Filename case

* Fix playground dapp build
2017-05-05 15:14:05 +02:00
GitLab Build Bot 0d8920347a [ci skip] js-precompiled 20170505-084643 2017-05-05 08:50:23 +00:00
GitLab Build Bot 4a2ad9fc2a [ci skip] js-precompiled 20170505-083410 2017-05-05 08:38:11 +00:00
Jaco Greeff 9b025cf8c1 Merge branch 'master' into ui-2
# Conflicts:
#	js/src/views/ContractDevelop/store.js
2017-05-05 10:08:10 +02:00
Nicolas Gotchac 25853b915e Fixes Parity Bar position (#5557) 2017-05-05 10:00:45 +02:00
Nicolas Gotchac d4dc58eafe Fix #4277 (#5556) 2017-05-05 10:00:31 +02:00
Nicolas Gotchac eb316fcb9c Fix issues in Contract Development view (#5555)
* Better errors in contract dev

* Use RAW Git instead of Github Raw URLs (better CORS support)

* Network first for Solc list

* Don't use importScript n Worker // update rawgit to use CDN
2017-05-05 10:00:16 +02:00
oconnorct1 34bdf61cf0 dropdowns 2017-05-05 03:04:48 -04:00
Denis S. Soldatov aka General-Beck 951dc757f8 fix docker build (ethcore+parity hub's) 2017-05-04 23:46:25 +03:00
GitLab Build Bot f5bfb208e7 [ci skip] js-precompiled 20170504-161940 2017-05-04 16:23:12 +00:00
Maciej Hirsz d5683d2016 Added missing methods (#5542)
* Added missing methods

* Adding to Parity.js
2017-05-04 17:58:01 +02:00
Jaco Greeff 5d78488fef Merge branch 'master' into ui-2 2017-05-04 13:58:40 +02:00
Robert Habermeier de1f7ee39b option to disable persistent txqueue (#5544)
* option to disable persistent txqueue

* New option goes with kin
2017-05-04 12:13:50 +02:00
Craig O'Connor c1f07c3329 Mui-be-gone-3 (#5546)
* mui-be-gone

* second

* mui-be-gone-3

* updates

* ups and ups

* oops

* Revert to changes in removed files from ui-2

* Revert to stateless component
2017-05-04 11:03:55 +02:00
Jaco Greeff f34a0346bc Cleanup ~/util (#5553) 2017-05-04 10:40:52 +02:00
Jaco Greeff c7949e2fc3 Merge branch 'master' into ui-2 2017-05-04 10:39:46 +02:00
Nikolay Volf 74044f4821 bump jsonrpc & bytes (#5552) 2017-05-04 10:21:33 +03:00
Denis S. Soldatov aka General-Beck 8fdda2f5b7 Update .gitlab-ci.yml
fix nightly test
- rustup default nightly
2017-05-03 17:56:10 +03:00
Denis S. Soldatov aka General-Beck 15c89a8fff add docker build for hub.docker.com/r/parity 2017-05-03 17:31:56 +03:00
GitLab Build Bot 160183b6e8 [ci skip] js-precompiled 20170503-123121 2017-05-03 12:34:57 +00:00
Jaco Greeff 539164945a Merge branch 'master' into ui-2 2017-05-03 14:19:47 +02:00
Jaco Greeff 70e87677b3 Retrieve block headers only for header-only info (#5480)
* Add parity_getBlockHeaderByNumber

* Use parity_getBlockHeaderByNumber for retrieval
2017-05-03 14:12:06 +02:00
Jaco Greeff 2f9e05830b Create ~/ui/Form/Checkbox component (#5543) 2017-05-03 13:37:32 +02:00
Denis S. Soldatov aka General-Beck 0658e42dad fix nightly published
add `nightly` to S3_BUCKET=builds-parity-published
2017-05-03 13:50:08 +03:00
Denis S. Soldatov aka General-Beck 7fd2051d2c Merge pull request #5519 from paritytech/snap
add snap to CI
2017-05-03 13:43:07 +03:00
Craig O'Connor c39952a727 Mui be gone 2 (#5540)
* mui-be-gone

* second

* Revert ~/dapp mui removal

* Overlay text color
2017-05-03 12:25:16 +02:00
Craig O'Connor 5323fb5e08 mui-be-gone (#5539)
* mui-be-gone

* Revert ~/dapp mui removal
2017-05-03 12:16:20 +02:00
Jaco Greeff 1c2580b4a6 Ui 2 shell updates (#5541)
* Stateless components

* Adjust borders

* Stateless for status

* Externalise link colors

* css lint

* stateless

* Create ui/IconCache, replacing redux

* Update Signer buttons

* Requests background

* Adjust request styling

* Stateless components

* ParityBar background alignment

* Shell updates

* Remove Tooltip
2017-05-03 10:46:09 +02:00
Jaco Greeff a1502738f1 Merge branch 'master' into ui-2 2017-05-03 10:40:53 +02:00
keorn a3d9cce7c5 Pass additional data when reporting (#5527)
* pass additional data when reporting

* checkout correct tests
2017-05-03 09:01:24 +02:00
Robert Habermeier 60bb0de9d6 Calculate post-constructors state root in spec at load time (#5523)
* apply contract constructors at spec load time

* debugging

* do trie updates in two stages

* add lint exception to newly-dead constructor

* squash warning in RPC tests

* kill dead accountdb constructors

* restore accountdb constructors under test configuration

* use provided state root in spec, if it exists
2017-05-03 09:00:02 +02:00
Denis S. Soldatov aka General-Beck 9cfb50f90f Update .gitlab-ci.yml
build snap beta
2017-05-03 03:12:45 +03:00
Denis S. Soldatov aka General-Beck 5fd5c9e85c Update .gitlab-ci.yml
fix typo arm64
2017-05-03 03:03:39 +03:00
Denis S. Soldatov aka General-Beck 2bb6546ed6 replace CI docker images to hub.docker.com/r/parity 2017-05-02 21:29:36 +03:00
Denis S. Soldatov aka General-Beck 09bd3a9642 update CI docker images
switch to hub.docker.com/r/parity
2017-05-02 20:45:19 +03:00
GitLab Build Bot b17c6ec054 [ci skip] js-precompiled 20170502-161232 2017-05-02 16:16:27 +00:00
Nicolas Gotchac a56b2f5993 Fix utf8 decoding (#5533)
* Fixes #5492

* Linting
2017-05-02 17:52:49 +02:00
Jaco Greeff e7484d07aa Ui 2 styling adjustments (#5534)
* Stateless components

* Adjust borders

* Stateless for status

* Externalise link colors

* css lint

* stateless

* Create ui/IconCache, replacing redux

* Update Signer buttons

* Requests background

* Adjust request styling

* Stateless components

* ParityBar background alignment
2017-05-02 17:50:44 +02:00
Jaco Greeff b57e8f6f0d Merge branch 'master' into ui-2 2017-05-02 13:40:05 +02:00
GitLab Build Bot b0e4c913c0 [ci skip] js-precompiled 20170502-103844 2017-05-02 10:42:38 +00:00
Afri 77c8d588fa Add CHANGELOG.md (#5513)
* Add CHANGELOG.md

* Add some more verbose CHANGELOG information for beta and stable releases

* Add dates to releases
2017-05-02 12:08:48 +02:00
Rien 02b54ff7e8 find . -type f -not -path './.*' -exec sed -i -e "s/ethcore\.io/parity.io/g" {} \; (#5528) 2017-05-02 11:41:09 +02:00
Arkadiy Paronyan da2f684f18 Memory usage optimization (#5526) 2017-05-02 11:40:03 +02:00
Tomasz Drwięga c39da9643e Compose transaction RPC. (#5524) 2017-05-02 11:39:48 +02:00
Jaco Greeff fa243cdf89 UI 2 Status dapp fixes (#5531)
* Stateless components

* Adjust borders

* Stateless for status
2017-05-02 11:14:18 +02:00
Denis S. Soldatov aka General-Beck 2ecdf111b0 fix path to artefacts 2017-04-28 16:45:59 +03:00
Jaco Greeff 4781d2e15a Merge branch 'ui-2-styling' into ui-2 2017-04-28 15:33:49 +02:00
Denis S. Soldatov aka General-Beck e9ebb2498b parity_master_amd64.snap 2017-04-28 15:52:58 +03:00
Denis S. Soldatov aka General-Beck a1aaead6a9 fix CI lint 2017-04-28 15:19:10 +03:00
Denis S. Soldatov aka General-Beck e989e2f12c add artifacts for snap 2017-04-28 15:16:40 +03:00
Craig O'Connor bccb231899 Icons set two (#5521)
* semantic addition

* semantic addition

* icons

* iconset

* Fix lint from merge

* Remove extra file/moved

* Moved packages (ui dep)

* Change dapps to import from ~/ui/Icons

* Additional icons converted

* Typo

* Add, Send, Delete, Edit & Send icons

* set two
2017-04-28 13:51:20 +02:00
Jaco Greeff dddefa9a72 panel background (develop) 2017-04-28 12:43:44 +02:00
Jaco Greeff 0745c019a3 AccountCard uses Container 2017-04-28 12:17:19 +02:00
Jaco Greeff 85711ca66d Adjust Portal background mask 2017-04-28 12:03:20 +02:00
Jaco Greeff 278dfcdcc5 Merge remote-tracking branch 'origin/ui-2' into ui-2 2017-04-28 11:26:34 +02:00
Jaco Greeff 4c04b61f8a Merge branch 'master' into ui-2 2017-04-28 11:26:24 +02:00
Jaco Greeff 37dd488579 UI 2 component & modal splits (#5525)
* Remove mui from Actionbar

* Add semantic-ui to vendor.js

* Stateless components

* Multi-item spacing

* Stateless components

* Stateless components

* Default font

* Context passing

* Move Vault modals into Vault dapp

* Move modals to their respective views
2017-04-28 11:21:05 +02:00
Denis S. Soldatov aka General-Beck 81c449fc99 update CentOS dockerfile
https://github.com/paritytech/parity/issues/5463
2017-04-28 01:17:20 +03:00
GitLab Build Bot 1ed0fedfd5 [ci skip] js-precompiled 20170427-165204 2017-04-27 16:56:27 +00:00
Tomasz Drwięga 28dcbc6426 Support external eth_sign (#5481)
* Display a QR for eth_sign requests.

* Support raw confirmation of eth_sign

* Fix ethkey issue on nightly.

* Fixing test.

* Fixing test.
2017-04-27 18:23:22 +02:00
Gav Wood 43175f17e4 Treat clock numbers as strings, not BigNums. (#5449) 2017-04-27 18:22:55 +02:00
Denis S. Soldatov aka General-Beck e439b53652 switch to docker runner 2017-04-27 17:20:00 +03:00
Denis S. Soldatov aka General-Beck 011f6102a5 update gitlab-ci 2017-04-27 16:27:28 +03:00
Denis S. Soldatov aka General-Beck 2245863f04 add snap to CI
initial build snap package for parity
2017-04-27 16:14:51 +03:00
Jaco Greeff d16cfc736d UI 2 styling (#5518)
* [ci skip] js-precompiled 20170426-110849

* export topNavigate function

* Stateless components in shell

* Connection icon fill

* Parity overlay only in dapps

* Additional buttons

* Adjust toolbar styles

* Adjust ParityBar button styling

* Complete icon conversion
2017-04-27 13:28:02 +02:00
Craig O'Connor c9d41beb28 Icons (#5509)
* semantic addition

* semantic addition

* icons

* iconset

* Fix lint from merge

* Remove extra file/moved

* Moved packages (ui dep)

* Change dapps to import from ~/ui/Icons

* Additional icons converted

* Typo

* Add, Send, Delete, Edit & Send icons
2017-04-27 11:32:59 +02:00
Jaco Greeff d2cf1cbd0e Fix shell links 2017-04-26 17:59:16 +02:00
Jaco Greeff a33dd0108d Merge branch 'ui-2-mui' into ui-2 2017-04-26 16:31:54 +02:00
Jaco Greeff 549367fcd6 Simplify 2017-04-26 16:31:13 +02:00
Jaco Greeff 6c702c7b6a Correct import 2017-04-26 16:27:35 +02:00
Jaco Greeff aabf08fd75 LinearProgress -> Progress 2017-04-26 16:23:41 +02:00
Jaco Greeff 34d68ccb73 CircularProgress -> Loading 2017-04-26 16:08:30 +02:00
Jaco Greeff 02eeefd73b Last couple of dangling icons 2017-04-26 15:56:18 +02:00
Jaco Greeff 555e5b24f3 Adjust ActionBar (#5514) 2017-04-26 15:00:30 +02:00
Jaco Greeff bdcf2a9c61 Fix CSS overrides 2017-04-26 14:22:08 +02:00
GitLab Build Bot 30b3b5e2a7 [ci skip] js-precompiled 20170426-110849 2017-04-26 11:12:52 +00:00
Craig O'Connor 2badd9778b Semantic ui (#5507)
* semantic addition

* semantic addition

* semantic-ui into @parity/ui dependency

* Merge updates

* Update missing imports to use ~

* Clean @parity modules with clean

* Updated yarn.lock
2017-04-26 13:12:50 +02:00
Jaco Greeff 6797172ad4 Updated yarn.lock 2017-04-26 13:08:31 +02:00
Jaco Greeff 95eeca09b7 Merge branch 'master' into ui-2 2017-04-26 12:39:28 +02:00
Jaco Greeff 3d9deb7770 npm cleanups (#5512)
* Cleanup @parity modules in npm run clean

* Remove top-level yarn files (only in js)
2017-04-26 12:38:21 +02:00
Jaco Greeff 1cd0350f83 Merge branch 'master' into ui-2 2017-04-26 12:31:10 +02:00
GitLab Build Bot 012615ae46 [ci skip] js-precompiled 20170426-101558 2017-04-26 10:19:53 +00:00
Jaco Greeff 17448b370c Merge branch 'master' into ui-2 2017-04-26 11:35:49 +02:00
Craig O'Connor cf904b6b2f Export acc js (#4973)
* Export account RPC

* Removing GethDirectory and ParityDirectory

* js export accounts as json

* js export accounts as json

* api - then - catch

* final touches

* pass

* oops

* individual accounts

* refactoring

* refactor one

* refactor one

* refactor two

* some grumble fixes

* file name changes

* constructor

* constructor

* git recognize file name change

* spec and updates

* specs

* one tiny fix

* one tiny fix

* grumbles

* more grumbles

* sliders

* ff

* pointer default

* grumbles

* almost ready

* lots of updates

* accountList

* stupid debuglog

* bug fix

* bug fix

* some more good ol fashioned updates

* filter accounts

* clean

* update spec

* ff

* ff-f

* balances fix
2017-04-26 11:34:48 +02:00
Craig O'Connor 3be3b78c90 YARN (#5395)
* YARN

* update package.json

* update package.json

* yarn updates

* npm
2017-04-26 11:33:29 +02:00
Jaco Greeff 8fc453658b Fix linting issues (#5511) 2017-04-26 11:10:36 +02:00
Shaoping 3344d96329 Chinese Translation (#5460)
* Update account.js

* Update accounts.js

* finished writeContract.js translate

* translated web, walletSetting

* 添加注释

* 添加注释

* 翻译1

* 翻译1,存疑1

* 翻译1,没毛病

* 翻译1,存疑1

* Translated addAddress & addContract

* 翻译1

* Translated connection.js

* Translated contract.js

* Translated contracts.js

* translated dapps.js

* translated deleteAccount

* Translated createWallet.js

* Translated editMeta.js

* Translated errors.js

* Translated extension.js

* translated deployContract

* Translated executeContract.js

* Update home.js

* Translated home.js

* Translated loadContract.js

* Translated parityBar.js

* translated faucet

* Translated passwordChange.js

* Translated saveContract.js

* translated firstRun

* translated tabBar

* Commented out all ENG

* translated transfer.js

* translated txEditor.js

* Translated settings.js

* translated ui.js

* Translated shapeshift.js

* translated wallet.js

* Translated signer.js

* translated upgradParity.js

* Translated status.js

* translated verification.js

* Translated vaults.js

* translated ui.js

* zh-tw translation

* translated account.js

* translated accounts.js

* translated accounts.js

* translated address.js

* translated addressSelect.js

* translated addresses.js

* translated application.js

* translated dapp.js

* translated ui.js

* translated txEditor.js

* update zh-Hant-TW translation

* enable zh-Hant-TW
2017-04-26 10:57:19 +02:00
Jaco Greeff 2f0ce06cc1 Ui 2 shell (#5510)
* Split application into ~/shell

* reset.css back to index
2017-04-26 10:56:31 +02:00
Svyatoslav Nikolsky 1a262048a6 Fixing secretstore TODOs - part 2 (#5416)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem

* secretstore network transport

* encryption_session_works_over_network

* network errors processing

* connecting to KeyServer

* licenses

* get rid of debug println-s

* fixed secretstore args

* encryption results are stored in KS database

* decryption protocol works over network

* enc/dec Session traits

* fixing warnings

* fix after merge

* on-chain ACL checker proto

* fixed compilation

* fixed compilation

* finally fixed <odd>-of-N-scheme

* temporary commented test

* 1-of-N works in math

* scheme 1-of-N works

* updated AclStorage with real contract ABI

* remove unnecessary unsafety

* fixed grumbles

* wakeup on access denied

* encrypt secretstore messages

* 'shadow' decryption

* fix grumbles

* lost files

* secretstore cli-options

* decryption seccion when ACL check failed on master

* disallow regenerating key for existing document

* removed obsolete TODO

* fix after merge

* switched to tokio_io

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fixed test

* fix after merge

* encryption session errors are now fatal

* session timeouts

* autorestart decryption session

* remove sessions on completion

* exclude disconnected nodes from decryption session

* test for enc/dec session over network with 1 node

* remove debug printlns

* fixed 1-of-1 scheme

* drop for KeyServerHttpListener

* added some tests

* fixed typo
2017-04-25 21:34:03 +02:00
cdetrio 87ce264926 fix json format of state snapshot (#5504) 2017-04-25 19:08:28 +02:00
Nikolay Volf 9d6c50ea2f Bump jsonrpc version (#5489)
* bump jsonrpc version

* also dependant crates

* tokio_uds also
2017-04-25 19:48:31 +03:00
Robert Habermeier 35958a0965 Merge pull request #5454 from paritytech/aura-contract-warp
Groundwork for generalized warp sync
2017-04-25 17:58:13 +02:00
Jaco Greeff cdab1ebc04 Default font color 2017-04-25 17:18:23 +02:00
Leo Arias 80a58eea7b Add the packaging metadata to build the parity snap (#5496)
* Add the packaging metadata to build the parity snap

* Move the snapcraft.yaml to scripts
2017-04-25 16:20:57 +02:00
Jaco Greeff 851003c07c UI 2 light styling (placeholder until component move) (#5503)
* Adjust cards

* Clickable TxRow

* Modal background adjustment (stop-gap)

* Adjust container to light

* UI light updates
2017-04-25 15:41:46 +02:00
Jaco Greeff ac138f6a4c Remove ParityBackground (#5501) 2017-04-25 11:53:19 +02:00
Jaco Greeff b749718feb Merge branch 'master' into ui-2
# Conflicts:
#	js/src/views/Signer/RequestsPage/requestsPage.js
2017-04-25 11:10:23 +02:00
Jaco Greeff 234b8dd592 Dapp with params (Account, Address & Contract) (#5500)
* Allow passing hash through to dapp

* Add allet view

* Add Contract & Address links
2017-04-25 11:07:11 +02:00
GitLab Build Bot c9b2a7a980 [ci skip] js-precompiled 20170425-082717 2017-04-25 08:31:15 +00:00
Craig O'Connor f7d5d6c0cd Cancel tx JS (#4958)
* Remove transaction RPC

* Bumping multihash and libc

* Updating nanomsg

* bump nanomsg

* cancel tx

* cancel-tx-js

* cancel-tx-js

* cancel-tx-js

* cancel-tx-hs

* cancel-tx-js

* cancel-tx-js

* cancel-tx-js

* small fixes

* edit & time till submit

* edit & time till submit

* updates

* updates

* udpates

* udpates

* grumbles

* step 1

* Wonderful updates

* ready

* small refact

* small refact

* grumbles 1

* ffx2

* good ol' fashioned updates

* latest and greatest

* removeHash

* removeHash

* spec

* fix 1

* fix 1

* fix 2

* fix 2

* ff

* ff

* ff

* updates
2017-04-25 10:08:09 +02:00
Jaco Greeff 22497e5133 Update after source move 2017-04-24 17:45:53 +02:00
Jaco Greeff 719023e949 Navigate to dapp from dapp (WIP) 2017-04-24 17:41:47 +02:00
Jaco Greeff 2e1b05940f Router/Route usage consistency between dapps 2017-04-24 15:37:53 +02:00
Jaco Greeff 1d566a85b2 Convert missing icons for ~/ui import 2017-04-24 15:15:25 +02:00
Jaco Greeff 831e52ea07 Request view as dapp completed 2017-04-24 14:59:22 +02:00
Jaco Greeff 1725c708fe Requests (WIP) 2017-04-24 13:40:23 +02:00
Jaco Greeff 0c70cee503 Contracts & Contract develop as dapp 2017-04-24 13:21:22 +02:00
Robert Habermeier 6a5702f27c address grumbles 2017-04-24 13:14:50 +02:00
Jaco Greeff 84d1151a1f Accounts as dapp 2017-04-24 12:45:01 +02:00
Jaco Greeff 3ce9071eb9 Addresses as dapp 2017-04-24 12:20:12 +02:00
Jaco Greeff ec37cf6700 Settings running as dapp 2017-04-24 11:21:04 +02:00
Jaco Greeff cda12ec995 Remove unused RpcCalls 2017-04-24 10:52:08 +02:00
Jaco Greeff bc0ea154df Remove html background 2017-04-24 10:05:45 +02:00
Jaco Greeff a2269a477e Split views into own section 2017-04-24 09:53:40 +02:00
Jaco Greeff 262169c8a4 Add Vaults as dapp 2017-04-24 09:53:27 +02:00
Robert Habermeier 7ab92f0807 epoch generation proof fixes 2017-04-22 18:56:34 +02:00
Jaco Greeff c044534d6a Allow status updates on 2nd API instance 2017-04-21 16:03:50 +02:00
Jaco Greeff fcdd19e105 Merge branch 'master' into ui-2 2017-04-21 15:42:23 +02:00
Jaco Greeff 5fc6a5627e First iteration of Status page (WIP) 2017-04-21 15:20:43 +02:00
Jaco Greeff 2459501f4e Home as dapp 2017-04-21 13:14:07 +02:00
Robert Habermeier 0768ce3600 Merge pull request #5307 from paritytech/eip-212
EIP-212 (bn128 curve pairing)
2017-04-21 13:10:57 +02:00
Jaco Greeff 23469a99e8 Fix API references to @parity/api 2017-04-21 11:40:22 +02:00
Jaco Greeff b3dfc0b6db Merge branch 'jg-split-abi-api' into ui-2 2017-04-21 11:21:54 +02:00
Jaco Greeff 2ffb6496f4 Merge branch 'master' into ui-2 2017-04-21 11:19:40 +02:00
NikVolf 7a1db0852b fix typo 2017-04-21 12:10:41 +03:00
GitLab Build Bot 70c82c0f61 [ci skip] js-precompiled 20170420-192450 2017-04-20 19:28:34 +00:00
Robert Habermeier f18f81ec58 Merge pull request #5479 from paritytech/fix-tree-route-panic
fix panickers in tree-route
2017-04-20 18:31:16 +02:00
Dmitriy Startsev 6c33b781c3 Update links to etherscan.io (#5455) 2017-04-20 18:03:43 +02:00
Robert Habermeier 023c45f302 checkout correct tests submodule 2017-04-20 17:34:04 +02:00
Jaco Greeff ba03ed4eea Refresh UI on nodeKind changes, e.g. personal -> public (#5312)
* Poll details based on nodeKind

* Delay long polling when public/light

* Reload UI when nodeKind changed

* Fix tests (not using dispatch, reload instead)

* PR grumbles/cleanups
2017-04-20 17:31:15 +02:00
Robert Habermeier ee25249729 Merge pull request #5473 from paritytech/eip86
Correct contract address for EIP-86
2017-04-20 17:21:16 +02:00
Robert Habermeier 167d06d727 fix panickers in tree-route 2017-04-20 16:21:53 +02:00
Robert Habermeier 468a7a4a77 bloom check test 2017-04-20 16:09:43 +02:00
Jaco Greeff 4b403266ea Merge branch 'master' into jg-split-abi-api 2017-04-20 15:47:24 +02:00
Jaco Greeff 89e5601ec0 blockies dep -> api 2017-04-20 15:47:20 +02:00
Jaco Greeff 9652c0fabb UI packages to ui 2017-04-20 15:45:31 +02:00
Robert Habermeier a33b4cc73b fix tests 2017-04-20 15:04:07 +02:00
Jaco Greeff 11bcfa05e3 Update remaining ../abi to @parity/abi 2017-04-20 12:03:07 +02:00
Jaco Greeff 75d9fa3fe9 mocha babel ignores (@parity modules) 2017-04-20 11:56:13 +02:00
Jaco Greeff 887b7b5090 Update maintainers 2017-04-20 11:48:42 +02:00
Jaco Greeff bb628bca88 Add missing npm aliasses 2017-04-20 11:42:32 +02:00
Jaco Greeff 8a46a4b567 Move API dependencies 2017-04-20 11:24:49 +02:00
Jaco Greeff 8b144bedd1 Shared build rules 2017-04-20 11:17:58 +02:00
Jaco Greeff 94c8cceb42 Add @parity/jsonrpc 2017-04-20 10:41:06 +02:00
Jaco Greeff 0d9e849162 Build with @parity/(abi|api) packages 2017-04-20 10:34:23 +02:00
Jaco Greeff 4568300d9b Use @parity/abi 2017-04-20 10:34:00 +02:00
Jaco Greeff b3056cd0ab Add ABI/API package.json 2017-04-20 10:33:37 +02:00
Afri a16fb04280 Force two decimals for USD conversion rate (#5471) 2017-04-19 22:59:02 +02:00
Robert Habermeier 240c111ebb fix indent 2017-04-19 20:44:11 +02:00
Robert Habermeier 6652df03df Merge branch 'master' into aura-contract-warp 2017-04-19 20:43:24 +02:00
Robert Habermeier 2ec3397b7d snapshot chunk and restore traits 2017-04-19 20:31:53 +02:00
arkpar 97052f3912 null_sign with network id 2017-04-19 19:10:12 +02:00
GitLab Build Bot 0d40df937b [ci skip] js-precompiled 20170419-162101 2017-04-19 16:24:42 +00:00
GitLab Build Bot 7d07c550ba [ci skip] js-precompiled 20170419-161237 2017-04-19 16:16:20 +00:00
Nicolas Gotchac 37690cfde2 Refactoring of Tokens & Balances (#5372)
* Remove ETH filter

* Remove unused Blockchain reducer+actions

* Simpler Token updates and fetching

* Cleanup use of balances

* Cleanup of balances

* Cleanup of Balances

* Linting

* Update List Component

* Separate tokens from balances

* Refactoring balance fetchin and storing - Part I

* Linting

* Better ETH token description and use

* Working Transfer with new logic

* Add debugging

* Querying the tokens filter on new block

* Fixing the tests - PART I

* Fix txCount
2017-04-19 18:00:05 +02:00
Jaco Greeff fc18299869 Background-repeat round (#5475) 2017-04-19 17:47:30 +02:00
GitLab Build Bot 770c7e5878 [ci skip] js-precompiled 20170419-142847 2017-04-19 14:32:38 +00:00
Robert Habermeier 4d3f137e1e iterate over all epochs 2017-04-19 16:28:16 +02:00
Bas 23e7b53c13 nl i18n updated (#5461)
* Sync nl i18n to default

* Syntax fix in nl i18n

Tested locally

* nl translation improvements
2017-04-19 16:08:47 +02:00
Nicolas Gotchac e1e2674cd2 Show ETH value (even 0) if ETH transfert in transaction list (#5406) 2017-04-19 16:02:24 +02:00
GitLab Build Bot 8310877f25 [ci skip] js-precompiled 20170419-133906 2017-04-19 13:42:54 +00:00
Robert Habermeier af868a7439 ensure genesis validator set in DB 2017-04-19 15:35:12 +02:00
Nicolas Gotchac e83de5cde2 Store the pending requests per network version (#5405)
* Store the requests in LS per network version

* Fixing tests

* Add network switching test

* Fixes
2017-04-19 15:15:43 +02:00
Robert Habermeier a278dd5a0a store epoch transition proofs in DB 2017-04-19 14:58:19 +02:00
arkpar 04e581db61 Correct contract address for EIP-86 2017-04-19 14:50:56 +02:00
Arkadiy Paronyan b50fb71dd1 EIP-86 (#4697)
* EIP-86

* Disable EIP-86 auto activation for now
2017-04-19 14:30:00 +02:00
Robert Habermeier 6da6c755a5 iterate DB by prefix 2017-04-18 15:45:15 +02:00
Gav Wood 0180b21dd1 Update README.md 2017-04-18 14:55:25 +02:00
Robert Habermeier f6f9816ef4 epoch verifier rename 2017-04-18 14:19:10 +02:00
Marek Kotewicz cc3adcc2c1 Merge pull request #5451 from paritytech/temp-state-fix
Use in-memory database for tests
2017-04-14 08:24:26 +02:00
Robert Habermeier e1fa4ab8ec verify_external in verifier trait 2017-04-13 20:34:16 +02:00
Robert Habermeier 715d5daafe ChainVerifier for memoizing validator sets 2017-04-13 20:24:21 +02:00
Robert Habermeier fd4d7c4b68 correct state test checkout 2017-04-13 17:21:12 +02:00
Robert Habermeier a98052fe74 Merge branch 'master' into on-demand-priority 2017-04-13 16:44:47 +02:00
Tomasz Drwięga ea09aa584d WebSockets RPC server (#5425)
* Basic WS server.

* CLI for WS server.

* Bump jsonrpc

* Fixing test.
2017-04-13 16:32:07 +02:00
Svyatoslav Nikolsky 1df30ee83e added missing docs (#5452) 2017-04-13 14:26:07 +02:00
arkpar 314af4cdae Use in-memory database in tests 2017-04-13 12:17:53 +02:00
GitLab Build Bot 1e6674f804 [ci skip] js-precompiled 20170413-083353 2017-04-13 08:37:35 +00:00
Maciej Hirsz df5f722885 Merge pull request #5417 from paritytech/mh-publicnode-tests
Tests and tweaks for public node middleware
2017-04-13 10:13:07 +02:00
Robert Habermeier b4f3e30cd6 detect changes in safe_contract 2017-04-12 22:10:18 +02:00
Robert Habermeier 34a1512ff0 skeleton for proof checking 2017-04-12 18:55:38 +02:00
Robert Habermeier ec922ee5e4 supply optional call context to validator sets 2017-04-12 16:42:19 +02:00
Robert Habermeier 0f80c57dca use native contracts in `ValidatorSet` 2017-04-12 16:15:35 +02:00
Robert Habermeier 2f5a774325 add validator contracts to native_contracts bin 2017-04-12 15:54:23 +02:00
Tomasz Drwięga c58fd744ee Fix removal of hash-mismatched files. (#5440) 2017-04-12 15:04:53 +02:00
Robert Habermeier 2d8a8bd3e5 engine changes 2017-04-12 14:41:19 +02:00
Robert Habermeier 13633414a3 Merge pull request #5383 from paritytech/block_header_rpc
parity_getBlockHeaderByNumber and LightFetch utility
2017-04-12 14:39:50 +02:00
GitLab Build Bot d99f1e5f1f [ci skip] js-precompiled 20170412-114838 2017-04-12 11:52:33 +00:00
Arkadiy Paronyan 15ae24b541 New state tests (#5418)
* General state tests

* Allow dir name for a test
2017-04-12 13:33:49 +02:00
Gav Wood 1b36a381e8 Fix buffer length for QR code gen. (#5447) 2017-04-12 13:20:22 +02:00
Robert Habermeier e094043b80 Merge branch 'master' into block_header_rpc 2017-04-12 13:00:32 +02:00
GitLab Build Bot a0d83537e5 [ci skip] js-precompiled 20170412-104510 2017-04-12 10:48:49 +00:00
Robert Habermeier 7723d6281b starting memoized validatorset 2017-04-12 12:46:25 +02:00
keorn 52eae66c72 Add raw hash signing (#5423)
* add sign any

* Add RPC signMessage call to JS API

* Add signMessage to JSON RPC docs

* PostSignTransaction -> EthSignMessage

* fix doc typo

* revert incorect naming
2017-04-12 12:15:13 +02:00
Robert Habermeier daf1495c4e Filters and block RPCs for the light client (#5320)
* block_hash method for LightChainClient

* abstraction and futures-based eth_filter

* log fetching for light client

* add eth-filter delegate

* eth_block fetching RPCs

* return default accounts from on_demand

* fix early exit

* BlockNumber -> BlockId

* early exit for no known block number.
2017-04-12 12:07:54 +02:00
GitLab Build Bot e84d03f31d [ci skip] js-precompiled 20170411-150514 2017-04-11 15:08:42 +00:00
Robert Habermeier a254b2098f more useful Engine::verify_seal 2017-04-11 17:07:04 +02:00
Jaco Greeff bb8adcce92 Work around mismatch for QR checksum (#5374)
* Work around current native-signer encoding

* Avoid trying to use non-existant util function.
2017-04-11 16:43:15 +02:00
Marek Kotewicz 4f8e61dce9 easy to use conversion from and to string for ethstore::Crypto (#5437)
* easy to use conversion from and to string for ethstore::Crypto

* ethstore uses tempdir instead of devtools

* ethstore does not depend on ethcore-util
2017-04-11 10:24:56 +02:00
keorn d3b2bcdd79 Tendermint fixes (#5415)
* more resilience

* refactor commit

* fix proposal broadcast

* list encoding

* address grumbles

* to into
2017-04-10 20:03:18 +02:00
Robert Habermeier bbe0eb96f4 Merge branch 'master' into on-demand-priority 2017-04-10 19:53:53 +02:00
Robert Habermeier 95808f51f1 Merge pull request #5403 from adrianbrink/adrian-lightclientcache
Add caching to HeaderChain struct
2017-04-10 19:46:02 +02:00
Robert Habermeier cc6cf8d7ce address grumble 2017-04-10 18:06:36 +02:00
Robert Habermeier 5b65f10828 Merge branch 'master' into block_header_rpc 2017-04-10 18:06:28 +02:00
GitLab Build Bot a2bec1edb4 [ci skip] js-precompiled 20170410-094150 2017-04-10 09:45:12 +00:00
maciejhirsz b11a84a347 Unlock transaction on RPC errors 2017-04-10 11:22:32 +02:00
Nicolas Gotchac 0aaf236ad1 Add decryption to the UI (in the Signer) (#5422)
* Add decryption to the UI in signer + Fix Signing style

* Proper out format function for singing methods

* name
2017-04-10 11:21:06 +02:00
keorn 20d4e7139f Add CIDv0 RPC (#5414)
* add cid rpc

* add light

* clean up
2017-04-08 13:35:23 +02:00
GitLab Build Bot bca0c6c172 [ci skip] js-precompiled 20170408-095429 2017-04-08 09:57:43 +00:00
Tomasz Drwięga 4e498790d4 Updating documentation for RPCs (#5392)
* Removing minBlocks occurrencies

* Docs for new RPCs.

* Fixing linting issues, updating *withToken documentatiojn.

* Adding missing RPCs. Fixing tests.

* Fixing lint issues.
2017-04-08 11:28:04 +02:00
Svyatoslav Nikolsky 93a6047912 Fixing secretstore TODOs - part 1 (#5386)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem

* secretstore network transport

* encryption_session_works_over_network

* network errors processing

* connecting to KeyServer

* licenses

* get rid of debug println-s

* fixed secretstore args

* encryption results are stored in KS database

* decryption protocol works over network

* enc/dec Session traits

* fixing warnings

* fix after merge

* on-chain ACL checker proto

* fixed compilation

* fixed compilation

* finally fixed <odd>-of-N-scheme

* temporary commented test

* 1-of-N works in math

* scheme 1-of-N works

* updated AclStorage with real contract ABI

* remove unnecessary unsafety

* fixed grumbles

* wakeup on access denied

* encrypt secretstore messages

* 'shadow' decryption

* fix grumbles

* lost files

* secretstore cli-options

* decryption seccion when ACL check failed on master

* disallow regenerating key for existing document

* removed obsolete TODO

* fix after merge

* switched to tokio_io

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fix after merge

* fixed test

* fix after merge
2017-04-08 11:26:16 +02:00
Adrian Brink 144d6c2379 Update light_sync test to include cache dependency 2017-04-07 21:35:42 +02:00
Adrian Brink 645b8e4b0b Fix failing tests 2017-04-07 21:35:42 +02:00
Adrian Brink d6bc60f968 Ensure that OnDemand and HeaderChain share the same cache 2017-04-07 21:35:41 +02:00
Adrian Brink 2ce5a656e7 Ensure that OnDemand and HeaderChain share the same cache 2017-04-07 21:35:41 +02:00
Adrian Brink fa88ee148a Add header to cache 2017-04-07 21:35:41 +02:00
Adrian Brink 5e33fe0aa7 Add cache to HeaderChain struct. 2017-04-07 21:35:41 +02:00
Adrian Brink 9552ca7bb3 Change to snakecase 2017-04-07 21:35:41 +02:00
Adrian Brink 3632a98062 Clean up 2017-04-07 21:35:41 +02:00
Adrian Brink 23c76caafa Add header to cache 2017-04-07 21:35:41 +02:00
Adrian Brink 8a7ca6f0ba Add caching to block_header() 2017-04-07 21:34:29 +02:00
Adrian Brink 8ea25eeb3c Add cache to HeaderChain struct. 2017-04-07 21:34:29 +02:00
Adrian Brink e004e05037 Spelling fixes and link addition about LRU cache in the docs. 2017-04-07 21:34:29 +02:00
Robert Habermeier d0e057cabd Merge pull request #5399 from paritytech/dapps-content-bug
Fixing disappearing content.
2017-04-07 19:45:48 +02:00
Robert Habermeier 68ec7ae41e tests for on_demand 2017-04-07 19:35:39 +02:00
Gav Wood 81f48c0001 Merge branch 'master' into dapps-content-bug 2017-04-07 18:26:55 +02:00
Robert Habermeier 50886fcb31 Merge pull request #5318 from paritytech/snapshot-v2
Snapshot chunks packed by size
2017-04-07 14:45:42 +02:00
Robert Habermeier 5793bb8fac typestrong API 2017-04-06 20:01:09 +02:00
Tomasz Drwięga f223ed21a5 APIs wildcards and simple arithmetic. (#5402) 2017-04-06 19:38:33 +02:00
Tomasz Drwięga d74e044be4 Fixing compilation without dapps. (#5410) 2017-04-06 19:32:30 +02:00
Robert Habermeier cf75a19e8d Merge branch 'block_header_rpc' into on-demand-priority 2017-04-06 17:59:55 +02:00
Robert Habermeier 528dbf909a fix RPC fallout 2017-04-06 17:44:31 +02:00
maciejhirsz a45791d2c0 Handle invalid passwords 2017-04-06 17:36:21 +02:00
Robert Habermeier d19232a848 use cache in on-demand again 2017-04-06 17:22:05 +02:00
maciejhirsz 564a1b0fbb Tests and tweaks for public node middleware 2017-04-06 17:13:53 +02:00
Robert Habermeier 574cfae470 dispatch batched requests 2017-04-06 15:34:48 +02:00
NikVolf 9bcd1245d9 fix typo 2017-04-06 11:04:28 +03:00
Denis S. Soldatov aka General-Beck 89a4cb08e8 Update .gitlab-ci.yml 2017-04-05 21:40:12 +03:00
Denis S. Soldatov aka General-Beck 91dbf3c09d init switch to parity docker hub
https://hub.docker.com/r/parity/rust/
2017-04-05 21:35:53 +03:00
Robert Habermeier 3eea77709b convert Request to CheckedRequest 2017-04-05 19:19:04 +02:00
Robert Habermeier 08d8709ef6 checked request for OnDemand 2017-04-05 18:56:01 +02:00
GitLab Build Bot 5ebd38f1d6 [ci skip] js-precompiled 20170405-145308 2017-04-05 14:58:00 +00:00
arkpar 03ec27be66 Removed assert 2017-04-05 16:50:06 +02:00
Nicolas Gotchac 455f994673 Don't use port 8080 anymore (#5397) 2017-04-05 16:27:44 +02:00
Robert Habermeier 4f843ada3c Merge github.com:paritytech/parity into block_header_rpc 2017-04-05 16:27:32 +02:00
Robert Habermeier 35740456a4 generalize RequestBuilder 2017-04-05 15:02:44 +02:00
Robert Habermeier 8486e79cad Merge pull request #5002 from paritytech/lightcli
Quick'n'dirty CLI for the light client
2017-04-05 13:50:17 +02:00
Robert Habermeier 6b7a286158 Merge pull request #5401 from paritytech/state-proof-gas-limit
set gas limit before proving transactions
2017-04-05 13:50:04 +02:00
arkpar 81db3461fe Added an assert 2017-04-05 12:27:37 +02:00
Robert Habermeier e2dfea8c12 set gas limit before proving transactions 2017-04-05 12:05:55 +02:00
Tomasz Drwięga 6165eda356
Fixing disappearing content. 2017-04-05 11:37:45 +02:00
Robert Habermeier 0d8a2c8c44 CHT key optimization 2017-04-05 11:30:51 +02:00
GitLab Build Bot 8d0fde6f60 [ci skip] js-precompiled 20170405-090226 2017-04-05 09:06:09 +00:00
Maciej Hirsz 237bac4500 Merge pull request #5390 from paritytech/mh-publicnode-perf
Public node: perf and fixes
2017-04-05 10:42:59 +02:00
Arkadiy Paronyan 5f9dc13207 Straight download path in the readme (#5393) 2017-04-04 15:46:42 +03:00
Denis S. Soldatov aka General-Beck 9b212dc518 Update cov.sh
remove src/test from EXCLUDE
2017-04-04 12:51:54 +03:00
maciejhirsz 94bfe116aa CR fixes 2017-04-04 11:49:36 +02:00
maciejhirsz 50e0221dd1 Perf and fixes 2017-04-03 18:50:11 +02:00
Svyatoslav Nikolsky abec06f50c On-chain ACL checker for secretstore (#5015)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem

* secretstore network transport

* encryption_session_works_over_network

* network errors processing

* connecting to KeyServer

* licenses

* get rid of debug println-s

* fixed secretstore args

* encryption results are stored in KS database

* decryption protocol works over network

* enc/dec Session traits

* fixing warnings

* fix after merge

* on-chain ACL checker proto

* fixed compilation

* fixed compilation

* finally fixed <odd>-of-N-scheme

* temporary commented test

* 1-of-N works in math

* scheme 1-of-N works

* updated AclStorage with real contract ABI

* remove unnecessary unsafety

* fixed grumbles

* wakeup on access denied

* fix after merge

* fix after merge

* moved contract to native-contracts lib
2017-04-03 17:46:51 +02:00
GitLab Build Bot ee4f9da385 [ci skip] js-precompiled 20170403-112007 2017-04-03 11:24:51 +00:00
Jaco Greeff 848779e465 Allow empty-encoded values from encoding (#5385) 2017-04-03 12:56:07 +02:00
Robert Habermeier 60ce0aee1a Merge branch 'lightcli' into light-filters 2017-04-03 12:55:31 +02:00
Robert Habermeier 0f65779d29 fix indentation in usage.txt 2017-04-03 12:54:27 +02:00
Robert Habermeier 394040e22c Merge branch 'master' into lightcli 2017-04-03 12:44:52 +02:00
GitLab Build Bot 0a90f235de [ci skip] js-precompiled 20170403-103604 2017-04-03 10:39:53 +00:00
Jaco Greeff 2447875b26 Update npm build for new inclusions (#5381)
* Update npm build for new inclusions

* Add dummy interface for secp256k1
2017-04-03 12:16:41 +02:00
NikVolf df72c9c6cc fold multiplication 2017-04-03 12:57:18 +03:00
Robert Habermeier 6aa9005785 parity_getBlockHeaderByNumber and LightFetch 2017-04-03 11:37:07 +02:00
Denis S. Soldatov aka General-Beck c3769b8874 Merge pull request #5356 from loadaverage/dockerfile_fix
Fix for Ubuntu Dockerfile
2017-04-03 16:15:49 +07:00
Svyatoslav Nikolsky c0c06fdc53 Secretstore over network (#4974)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem

* secretstore network transport

* encryption_session_works_over_network

* network errors processing

* connecting to KeyServer

* licenses

* get rid of debug println-s

* fixed secretstore args

* encryption results are stored in KS database

* decryption protocol works over network

* enc/dec Session traits

* fixing warnings

* fix after merge

* finally fixed <odd>-of-N-scheme

* temporary commented test

* 1-of-N works in math

* scheme 1-of-N works

* remove unnecessary unsafety

* fixed grumbles

* fix grumbles

* lost files
2017-04-03 11:13:51 +02:00
Tomasz Drwięga 2df4532d50 Dapps and RPC server merge (#5365)
* Dapps server as a middleware.

* Dapps RPC - Work in Progress

* Merging Dapps and RPC server.

* Fast HTTP server configuration.

* Bump jsonrpc

* Fixing test target

* Re-implementing commented-out tests.
2017-04-03 10:27:37 +02:00
Jaco Greeff 6a05967bef trigger js build release (#5379) 2017-04-03 10:25:21 +02:00
Christopher Franko 41700a6996 Update expanse json with fork at block 600000 (#5351)
* Update expanse json with fork at block 600000

* update exp chainID to 2
2017-04-03 09:59:08 +02:00
Robert Habermeier c9c8f920d2 Futures-based native wrappers for contract ABIs (#5341)
* initial native contract generator

* get generated code compiling

* unit tests for type codegen

* autogenerate registry contract

* native_contracts entry for registry

* service_transaction_checker

* fixed indentation
2017-04-03 09:40:18 +02:00
Robert Habermeier 8c715e025a Merge branch 'lightcli' into light-filters 2017-04-03 09:03:12 +02:00
Robert Habermeier 3eece20967 Merge branch 'master' into lightcli 2017-04-03 08:58:20 +02:00
Robert Habermeier 21e21f1e02 Merge pull request #5337 from paritytech/kovan-receipt-fix
Kovan warp sync fixed
2017-04-02 18:26:49 +02:00
keorn 84abf5d84f Aura eip155 validation transition (#5362)
* add eip155 validation

* add transition block
2017-04-01 13:21:22 +02:00
Tomasz Drwięga 83fea78d38 Wordlist from crate (#5331) 2017-04-01 13:26:44 +07:00
Jaco Greeff 1987dad527 Allow signing via Qr (#4881)
* QR code scanning in-place

* QrScan component

* Update tests

* s/store/createStore/ in props

* Create of actual accountsInfo entry

* Exteral/hardware forget, no password change

* Add external accounts to accounts list

* Render external accounts in section (along with hw)

* Manul test bugfixes

* Display Qr code for tx signing

* Align QR code

* Hints for QR operations

* Generate actual qr codes based on tx data

* Add leading 0x if not found

* Update tests for 0x leading addition

* from & rpl without leading 0x

* Auto-detect QR code size (input length)

* Confirm raw

* WIP (lots of logging)

* WIP

* Chain-replay protection

* Readability

* Re-add r: chainId

* s = 0, r = 0, v = chainId

* Update eth_signTransaction to send transaction object

* And it actually works.

* Externalise createUnsigned/createSigned

* Check for nonce updates (future: subscriptions)

* Allow gas overrides

* Expose formatted condition

* Extract calculation (cap at 40)

* Remove debug log

* Fix rename linting

* Allow for signing hash & rlp (App support forthcoming)

* WIP

* User original qrcode-generator package

* Complete hash + rlp signing

* Accurate QR code size calculation

* Simplify type calculation

* R-eactivate current mobile interface (TODO for new)

* Move napa to dep

* Allow external accounts visibility in dapps

* Allow napa install on CI

* Allow new signTransaction & signTransactionHash functionality
2017-03-31 23:36:24 +02:00
Jaco Greeff cbaa7fdee6 Allow entry of url or hash for DappReg meta (#5360)
* Allow DappReg to handle contentHash & url inputs

* Add tests
2017-03-31 23:33:55 +02:00
Jaco Greeff 73dc52980e Adjust tx overlay colours (#5353)
* Adjust tx overlay colours

* Adjust sizes to be consistent

* Formatting
2017-03-31 23:32:03 +02:00
Jaco Greeff 8b0f9759ec Add ability to disallow API subscriptions (#5366) 2017-03-31 22:30:39 +02:00
NikVolf d6baadbaf2 fix doc comment about failing 2017-03-31 17:53:26 +03:00
NikVolf 569d63d0c9 fix assertions 2017-03-31 17:46:44 +03:00
NikVolf a529427bc9 bump bn lib 2017-03-31 17:38:31 +03:00
NikVolf 2f30b03060 some tests 2017-03-31 17:38:31 +03:00
NikVolf d34aec29ed finalize 2017-03-31 17:38:30 +03:00
NikVolf 9271dd0cc7 wip 2017-03-31 17:38:30 +03:00
NikVolf 3d2e9efb1e P1, P2 definition 2017-03-31 17:38:30 +03:00
arkpar b840ab8f8b Compact chunks 2017-03-31 16:31:12 +02:00
arkpar deef600caf Download unique receipts only 2017-03-31 15:20:27 +02:00
Robert Habermeier d146ae7275 Merge pull request #4999 from paritytech/eip-213
EIP-213 (bn128 curve operations)
2017-03-31 14:54:07 +02:00
Jaco Greeff 801a2339ee Fix analize output file name (#5357) 2017-03-31 10:38:57 +02:00
Vadim Sloun 2f757babb9 fix for Ubuntu Dockerfile 2017-03-30 23:18:06 +03:00
keorn 2398311455 add eip155 validation (#5346) 2017-03-30 20:01:19 +02:00
Jan Ziniewicz 5d6dac495e Add new seed nodes (#5345) 2017-03-30 14:49:11 +02:00
arkpar 3915943f57 Kovan warp sync fixed 2017-03-30 13:13:43 +02:00
Maciej Hirsz e0d5eedff7 Merge pull request #5336 from paritytech/mh-wordlist-fe
Shared wordlist for frontend
2017-03-30 12:28:52 +02:00
Maciej Hirsz 4e1ef482ad Merge pull request #5338 from paritytech/mh-fixtests
fix rpc tests
2017-03-30 09:23:05 +02:00
maciejhirsz 6b0b8078e9 fix rpc tests 2017-03-29 20:44:08 +02:00
maciejhirsz 377f20ed49 Fix ci:build 2017-03-29 20:20:03 +02:00
maciejhirsz 2cc111ad5d use `@parity/wordlist` 2017-03-29 19:48:29 +02:00
Maciej Hirsz ab2c3468d5 Merge pull request #5304 from paritytech/mh-webserver
Public node with accounts and signing in Frontend
2017-03-29 17:48:47 +02:00
maciejhirsz 54196a8d4f Skip timing out tests 2017-03-29 17:38:20 +02:00
maciejhirsz 9bd3f10f41 Squashed: Public Node 2017-03-29 17:07:58 +02:00
GitLab Build Bot 93ee2a9b64 [ci skip] js-precompiled 20170329-145217 2017-03-29 14:55:09 +00:00
Jaco Greeff a4c433c749 Rename Status/Status -> Status/NodeStatus (#5332) 2017-03-29 16:31:33 +02:00
GitLab Build Bot 858c974440 [ci skip] js-precompiled 20170329-134148 2017-03-29 13:44:40 +00:00
Tomasz Drwięga d2394d3ac3 Updating paths to repos. (#5330)
* Updating paths to repos.

* Updating rotor and libusb

* Fixing other occurrences
2017-03-29 15:17:27 +02:00
Tomasz Drwięga d4684d6302 Separate status for canceled local transactions. (#5319) 2017-03-29 14:43:55 +02:00
Nicolas Gotchac 5fa088114c Cleanup the Status View (#5317)
* Better view of Settings and Mining Settings

* Cleanup Status view

* Node Logs refactoring

* Cleanup Status

* Move RPC Calls files

* Basic Peers view

* Add Peers table

* style table header
2017-03-29 14:38:07 +02:00
Nicolas Gotchac 8930f510fc Update requests (#5324) 2017-03-29 14:34:21 +02:00
GitLab Build Bot 7134b44f5b [ci skip] js-precompiled 20170328-172957 2017-03-28 17:32:58 +00:00
Jaco Greeff 86bc784e41 Order signer FIFO (#5321) 2017-03-28 19:06:26 +02:00
Marek Kotewicz 64c098627e updating dependencies (#5028)
* updated docopt, env_logger, semver and regex crates

* updated parking_lot to 0.4

* fixed compiling on linux

* updated igd to 0.6

* updated jsonrpc

* fixed regex related compiler error on linux
2017-03-28 19:06:08 +02:00
Robert Habermeier 1b0a369889 return default accounts from on_demand 2017-03-28 18:55:23 +02:00
Robert Habermeier 73fa0cdc31 eth_block fetching RPCs 2017-03-28 17:15:36 +02:00
Robert Habermeier d8893b959d add eth-filter delegate 2017-03-28 15:56:51 +02:00
Robert Habermeier f409168126 log fetching for light client 2017-03-28 15:42:23 +02:00
GitLab Build Bot 843d95966e [ci skip] js-precompiled 20170328-125352 2017-03-28 12:56:58 +00:00
Nicolas Gotchac a99721004b Minimise transactions progress (#4942)
* Watch the requests and display them throughout the app

* Linting

* Showing Requests

* Fully working Transaction Requests Display

* Add FormattedMessage to Requests

* Clean-up the Transfer dialog

* Update Validations

* Cleanup Create Wallet

* Clean Deploy Contract Dialog

* Cleanup Contract Execution

* Fix Requests

* Cleanup Wallet Settings

* Don't show stepper in Portal if less than 2 steps

* WIP local storage requests

* Caching requests and saving contract deployments

* Add Historic prop to Requests MethodDecoding

* Fix tests

* Add Contract address to MethodDecoding

* PR Grumbles - Part I

* PR Grumbles - Part II

* Use API Subscription methods

* Linting

* Move SavedRequests and add tests

* Added tests for Requests Actions

* Fixing tests

* PR Grumbles + Playground fix

* Revert Playground changes

* PR Grumbles

* Better showEth in MethodDecoding
2017-03-28 14:34:31 +02:00
Robert Habermeier a6b6c312b8 abstraction and futures-based eth_filter 2017-03-28 14:19:21 +02:00
GitLab Build Bot e28c477075 [ci skip] js-precompiled 20170328-094309 2017-03-28 09:46:03 +00:00
Jaco Greeff 8e91f7b701 Fix eth_sign showing as wallet account (#5309)
* defaultProps for account

* Pass signing account

* Update tests for Connect(...)
2017-03-28 11:24:07 +02:00
Robert Habermeier da3dd65726 block_hash method for LightChainClient 2017-03-28 11:23:43 +02:00
Arkadiy Paronyan c7d99c37fb Ropsten revival (#5302) 2017-03-28 10:47:21 +02:00
keorn a61b1567d0 Strict validation transitions (#4988)
* ability to make validation stricter

* fix consensus

* remove logger
2017-03-28 10:46:52 +02:00
GitLab Build Bot 7039eaf995 [ci skip] js-precompiled 20170328-065931 2017-03-28 07:02:31 +00:00
Nicolas Gotchac d99aa3192c Fix default list sorting (#5303)
* Fix default sorting for lists views

* Linting
2017-03-28 08:35:10 +02:00
Nicolas Gotchac 8a664c524c Use uniq owners for multi sig wallets (#5298) 2017-03-28 08:34:54 +02:00
GitLab Build Bot d6110d7332 [ci skip] js-precompiled 20170327-200527 2017-03-27 20:08:17 +00:00
Jaco Greeff 1db72ad6e2 Copy all existing i18n strings into zh (as-is translation aid) (#5305)
* Copy available strings into zh

* Update after lint

* Force rebuild (upstream package update)
2017-03-27 21:46:39 +02:00
GitLab Build Bot 6d5bfcfe44 [ci skip] js-precompiled 20170327-161452 2017-03-27 16:17:42 +00:00
Nicolas Gotchac fb88e5d652 Fix booleans in Typedinput (#5295)
* Register new playground component onMount

* No need of observer

* getValue returns falsy values

* Fix tests
2017-03-27 17:56:08 +02:00
GitLab Build Bot f5bce0cd9e [ci skip] js-precompiled 20170327-155051 2017-03-27 15:53:33 +00:00
Robert Habermeier 62158601fb node kind RPC (#5025)
* node kind RPC

* JS interface for parity_nodeKind
2017-03-27 17:30:19 +02:00
Nicolas Gotchac a12583f762 Fix the use of MobX in playground (#5294)
* Register new playground component onMount

* No need of observer

* Fix tests
2017-03-27 17:27:35 +02:00
NikVolf efe0f8449c Merge remote-tracking branch 'origin/master' into eip-213 2017-03-27 18:18:22 +03:00
NikVolf c313857485 fix error handling 2017-03-27 18:17:49 +03:00
Robert Habermeier 1ca1a4b1cc Merge pull request #5019 from paritytech/snapshot-v2
Fine grained snapshot chunking
2017-03-27 16:57:02 +02:00
GitLab Build Bot 90746bd8c9 [ci skip] js-precompiled 20170327-144027 2017-03-27 14:43:26 +00:00
Jaco Greeff a4c5375a63 Add lint:i18n to find missing & extra keys (#5290)
* Add npm run lint:i18n (missing keys check)

* Check extraneous keys
2017-03-27 16:27:25 +02:00
Jaco Greeff 986762a0bc Scaffolding for zh translations, including first-round by @btceth (#5289)
* Initial import of #5023

* Language naming

* Update 简体中文
2017-03-27 16:19:30 +02:00
GitLab Build Bot 7707f7557a [ci skip] js-precompiled 20170327-102018 2017-03-27 10:23:02 +00:00
GitLab Build Bot 9e02271a68 [ci skip] js-precompiled 20170327-100522 2017-03-27 10:08:02 +00:00
Jaco Greeff eb1f76d8bd JS package bumps (#5287)
* Update to React 15.4.2

* Update deprecated UglifyJS version
2017-03-27 11:43:09 +02:00
Jaco Greeff e8c64b802d Auto-extract new i18n strings (update) (#5288)
* Update passwordHint chain

* Update auto-extracted strings
2017-03-27 11:42:59 +02:00
Marek Kotewicz 23d3b79d9a eip100b (#5027)
* eip100b

* fix eip100b build and tests

* Conventional comparison order
2017-03-27 11:42:40 +02:00
arkpar 387a5fb03b Doc 2017-03-26 13:26:20 +02:00
NikVolf 34fb39da5b avoid allocating string 2017-03-25 23:30:11 +03:00
arkpar b0a9c1e0fa Limit by entry count 2017-03-25 15:25:20 +01:00
arkpar b52c7bba4b Fewer allocations 2017-03-25 13:22:25 +01:00
arkpar 56ba9a30ac Fixed sync tests 2017-03-25 13:22:25 +01:00
arkpar 4ef89b5ccb Fine grained snapshot chunking 2017-03-25 13:22:25 +01:00
Robert Habermeier 109012cae8 force earliest era set in snapshot restore (#5021) 2017-03-25 10:00:50 +01:00
Gav Wood 7e78480840 Avoid clogging up tmp when updater dir has bad permissions. (#5024) 2017-03-24 19:03:59 +01:00
Arkadiy Paronyan 3b54b49b0b Resilient warp sync (#5018) 2017-03-24 18:55:57 +01:00
NikVolf 434ed1b91c remove alt_ 2017-03-24 15:35:00 +03:00
Robert Habermeier ac057ebe93 fix test build 2017-03-23 22:36:15 +01:00
Robert Habermeier a78068cbe9 queue culling and informant 2017-03-23 22:20:00 +01:00
Robert Habermeier 3708b3be63 fix RPC tests 2017-03-23 20:49:17 +01:00
Robert Habermeier e0a79699ea transaction propagation on a timer 2017-03-23 20:31:20 +01:00
Robert Habermeier b76860fd2b add signing RPC methods in light cli 2017-03-23 19:42:11 +01:00
Robert Habermeier 45c0a97142 fix body encoding 2017-03-23 18:52:54 +01:00
Robert Habermeier 5700f4ac81 fix block response decoding 2017-03-23 18:31:16 +01:00
GitLab Build Bot 9efab789aa [ci skip] js-precompiled 20170323-150743 2017-03-23 15:10:28 +00:00
GitLab Build Bot 35a43a1e82 [ci skip] js-precompiled 20170323-150033 2017-03-23 15:03:35 +00:00
Robert Habermeier 974f89d5bf correct workaround for RLP issue 2017-03-23 16:00:00 +01:00
Jaco Greeff df76f010da Create webpack analysis files (size) (#5009) 2017-03-23 15:47:42 +01:00
Robert Habermeier 10a470a5fa better bookkeeping of requests in light sync 2017-03-23 15:44:16 +01:00
Nicolas Gotchac 1490ba179c Dispatch an open event on drag of Parity Bar (#4987)
* Dispatch an open event on drag of Parity Bar

* Bette id for ParityBar position // Replace on dapp unload

* Fix PairtyBar Positionning
2017-03-23 15:39:13 +01:00
Robert Habermeier c75b49667e workaround for #5008 2017-03-23 14:49:02 +01:00
Robert Habermeier 1485dd07ae use prev credits in tracing 2017-03-23 14:38:32 +01:00
Robert Habermeier 54eb575000 request tests that demonstrate broken RLP behavior 2017-03-23 14:38:23 +01:00
Robert Habermeier ac7f1f6719 fix header chain tests 2017-03-23 14:15:13 +01:00
Robert Habermeier da837fa9d8 Merge branch 'master' into lightcli 2017-03-23 14:12:42 +01:00
Robert Habermeier a1df49ef3e add test for request vec deserialization 2017-03-23 14:04:26 +01:00
Arkadiy Paronyan f5ea47a7b2 Various installer and tray apps fixes (#4970)
* Mac tray app fixes

* Windows restarting fixed
2017-03-23 13:25:31 +01:00
Robert Habermeier ec52a4a235 more tracing in on-demand 2017-03-23 13:24:04 +01:00
Tomasz Drwięga bb1bbebfd6 Export account RPC (#4967)
* Export account RPC

* Removing GethDirectory and ParityDirectory

* Updating ethstore-cli help.
2017-03-23 13:23:03 +01:00
keorn 9fdd0e3a0a Switching ValidatorSet (#4961)
* add multi validator set

* nicer comment

* validate in constructor

* reporting
2017-03-23 13:19:28 +01:00
Robert Habermeier 64cec5ff7d Implement PIP messages, request builder, and handlers (#4945)
* return errors on database corruption

* fix tests, json tests

* fix remainder of build

* buffer flow -> request credits

* proving state backend

* generate transaction proofs from provider

* network messages for transaction proof

* transaction proof test

* test for transaction proof message

* fix call bug

* request transaction proofs from on_demand

* most of proved_execution rpc

* proved execution future

* initial request definitions

* RLP encoding and decoding for requests

* proofs of non-existance in ProvingBlockChainClient

* new requests in provider.

* encode and decode responses

* complete initial request changes

* handle request packet in LightProtocol

* handle response packets

* implement requesting from

* re-do cost table

* get tests compiling

* fix cost table RLP encoding

* roundtrip tests for request types

* request builder tests

* move request_builder -> request::builder

* get network tests working

* return only complete headers responses

* request builder improvements

* New version of jsonrpc.

* split request filling into fill,complete

* Better invalid encoding messages

* Fixing deprecated methods of tokio_core

* use PIP messages in on_demand, old API

* migrate oneshot::complete to send in on_demand

* get on_demand tests to compile

* port ethsync to PIP messages

* adjust to minor on_demand API changes in RPC

* Using dedicated branch for jsonrpc

* Bump
2017-03-23 13:17:05 +01:00
GitLab Build Bot b931a225ba [ci skip] js-precompiled 20170323-093322 2017-03-23 09:36:34 +00:00
Craig O'Connor e5c2b25351 auto lint (#5003)
* auto lint

* Usage consistency update
2017-03-23 10:14:32 +01:00
Robert Habermeier 77f036ee21 fix capabilities-interpreting error in on_demand 2017-03-23 04:38:08 +01:00
Robert Habermeier 4eb69dc0fe reintroduce credits recharging 2017-03-23 04:36:49 +01:00
Robert Habermeier 0d110ed47c apply pending changes to chain after DB commit 2017-03-23 04:00:22 +01:00
Robert Habermeier b96eb45877 eth_syncing RPC for light client 2017-03-23 03:23:53 +01:00
Robert Habermeier a55001ad1d fix deadlock in on_demand 2017-03-23 02:55:25 +01:00
Robert Habermeier 23a6b19985 fix import 2017-03-22 22:10:02 +01:00
Robert Habermeier 0abbd7ac97 Merge branch 'pip-msg' into lightcli 2017-03-22 22:08:39 +01:00
Robert Habermeier 83911a7290 complete quick'n'dirty light CLI 2017-03-22 22:00:52 +01:00
Robert Habermeier 73b2dd7a59 light client RPC dependencies 2017-03-22 21:09:43 +01:00
Robert Habermeier 35d9a9815e mild abstraction of RPC dependencies 2017-03-22 20:14:40 +01:00
Robert Habermeier e3d6525d83 store cumulative cost in pending request set. 2017-03-22 19:30:42 +01:00
Robert Habermeier c718b5618e initial light CLI 2017-03-22 18:32:04 +01:00
GitLab Build Bot 41f66f33d5 [ci skip] js-precompiled 20170322-161945 2017-03-22 16:22:41 +00:00
GitLab Build Bot 5255b72f67 [ci skip] js-precompiled 20170322-160703 2017-03-22 16:10:12 +00:00
Robert Habermeier a9d75e2223 CLI options for light client 2017-03-22 16:45:50 +01:00
Jaco Greeff 6b4cb35149 Fix FireFox overflows (#5000)
* Max width for container

* Set min-width
2017-03-22 16:39:57 +01:00
Jaco Greeff 5df3f5d136 Show busy indicator, focus first field (#4997) 2017-03-22 16:39:49 +01:00
Jaco Greeff 1879dbca8a Consistent store naming in the Signer components (#4996) 2017-03-22 16:39:40 +01:00
NikVolf 2de67538a2 updating deps 2017-03-22 18:07:41 +03:00
Robert Habermeier dd1a3fc60a migration to light client mode 2017-03-22 15:58:43 +01:00
Robert Habermeier a0619fc101 Merge branch 'master' into pip-msg 2017-03-22 15:56:09 +01:00
NikVolf 9d23101c9a update for rv 2017-03-22 17:43:19 +03:00
Marek Kotewicz 044d070667 rlp deserialization refactor, 30% faster (#4901)
* fixed naming of rlp modules

* RlpStream cleanup

* appending short rlp lists (0...55 bytes) is 25% faster

* RlpStream does not use bytes module, nor trait Stream

* removed unused code from rlp module

* compiling ethcore-util with new rlp serialization

* compiling parity with new rlp serialization

* fixed compiling ethcore-light with new rlp serialization

* fixed compiling ethsync with new rlp serialization

* moved rlp benches and rlp tests

* rlp deserialization refactor, 30% faster

* removed redundant comment, print

* fixed compiling parity with new rlp deserialization

* removed redundant double-space

* fixed failing test

* updated rlp docs, removed unused traits

* fixed rlp benchmarks

* replace usage of WriteBytesExt with ByteOrder

* removed unused, commented out code

* fixed merge conflict
2017-03-22 14:41:46 +01:00
NikVolf 436ae1333c trace mapping fix 2017-03-22 16:40:44 +03:00
NikVolf 8a4537fc73 no-input test 2017-03-22 16:31:43 +03:00
NikVolf d1293d9fb0 fix warnings 2017-03-22 15:54:19 +03:00
NikVolf 3e7dc57289 some tests for simple cases 2017-03-22 15:41:32 +03:00
Robert Habermeier 219eddf33e Merge branch 'master' into pip-msg 2017-03-22 13:14:28 +01:00
GitLab Build Bot b6f9cf4ba7 [ci skip] js-precompiled 20170322-112932 2017-03-22 11:32:23 +00:00
GitLab Build Bot 07ee7a341b [ci skip] js-precompiled 20170322-111524 2017-03-22 11:18:36 +00:00
Nicolas Gotchac 67c225f971 Double click to select account creation type (#4986)
* Extend links to whole container

* Add doubleClick to Account Creator
2017-03-22 12:12:21 +01:00
Nicolas Gotchac a028e445fe Fixes to the Registry dapp (#4984)
* Don't show fee warning when there is none

* Hide Warning in Registry onclick

* Use the default account in the Registry

* Fix Etherscan links in Regsitry
2017-03-22 11:56:52 +01:00
GitLab Build Bot b725829bfd [ci skip] js-precompiled 20170322-095443 2017-03-22 09:57:28 +00:00
Jaco Greeff e1f2ccd138 Extend api.util (#4979)
* cleanupValue

* abiUnencode & abiSignature

* Export new functions
2017-03-22 10:36:41 +01:00
Tomasz Drwięga 7e87e9e8ad Updating JSON-RPC crates (#4934)
* New version of jsonrpc.

* Better invalid encoding messages

* Fixing deprecated methods of tokio_core

* Using dedicated branch for jsonrpc

* Bump
2017-03-22 07:02:14 +01:00
Marek Kotewicz d530cc86f3 splitting part of util into smaller crates (#4956)
* split path module from util

* moved RotatingLogger from util to logger crate

* fix tests

* fix tests

* use only one version of ansi_term crate
2017-03-22 06:23:40 +01:00
NikVolf 5e34235a36 initial, fallable built-ins 2017-03-22 04:01:46 +03:00
GitLab Build Bot 63f1ca9243 [ci skip] js-precompiled 20170321-204617 2017-03-21 20:48:59 +00:00
Tomasz Drwięga 498d5c0660 Updating syntex et al (#4983)
* Migrating to new syntex

* Updating to latest syntex

* Another fix for nightly
2017-03-21 23:26:05 +03:00
Robert Habermeier 384aeda645 Merge branch 'pip-msg' into lightcli 2017-03-21 21:15:24 +01:00
Robert Habermeier 7ad36ee36c Merge remote-tracking branch 'upstream/new-jsonrpc' into pip-msg 2017-03-21 21:15:06 +01:00
Robert Habermeier e99884d0c0 Merge branch 'master' into pip-msg 2017-03-21 21:05:01 +01:00
Robert Habermeier 9fcaea2235 Merge branch 'pip-msg' of github.com:paritytech/parity into pip-msg 2017-03-21 21:02:22 +01:00
Robert Habermeier dd1f8295c4 fix sync test compilation 2017-03-21 21:00:31 +01:00
Robert Habermeier bc9c1d4824 use a database in ethcore-light 2017-03-21 20:57:13 +01:00
Robert Habermeier 21771aa1a6 don't keep headers in memory to avoid DoS 2017-03-21 20:23:58 +01:00
Robert Habermeier d013a13be6 header_chain writes to database 2017-03-21 19:45:52 +01:00
Robert Habermeier 797a3e1cd9 EIP198 and built-in activation (#4926)
* EIP198 and built-in activation

* address review
2017-03-21 19:36:38 +03:00
GitLab Build Bot 3687a7c717 [ci skip] js-precompiled 20170321-162716 2017-03-21 16:30:00 +00:00
Nicolas Gotchac 030d01102c Fix MethodDecoding for Arrays (#4977)
* Fix TypedInputs

* Remove unused code in inputQueries

* Use TypedInputs in Contract Events

* Linting

* Don't re-render events every second...
2017-03-21 17:02:41 +01:00
Nicolas Gotchac c7e6992239 Try to fix WS race condition connection (#4976)
* Try to fix wrong token logic

* Linting
2017-03-21 17:01:32 +01:00
Jaco Greeff cb881108c3 eth_sign where account === undefined (#4964)
* Update for case where account === undefined

* Update tests to not mask account === undefined

* default account = {} where undefined (thanks @tomusdrw)
2017-03-21 16:58:52 +01:00
GitLab Build Bot 1a6f23ad2b [ci skip] js-precompiled 20170321-145513 2017-03-21 14:58:06 +00:00
Nicolas Gotchac 9b9cd451d1 Fix references to api outside of `parity.js` (#4981) 2017-03-21 15:36:47 +01:00
Robert Habermeier fe52e969b6 Merge branch 'master' into pip-msg 2017-03-21 15:24:47 +01:00
GitLab Build Bot 213f61e826 [ci skip] js-precompiled 20170321-131503 2017-03-21 13:17:48 +00:00
Nicolas Gotchac 37ece36685 Fix Password Dialog forms style issue (#4968) 2017-03-21 13:56:32 +01:00
Tomasz Drwięga 958a8f66a0
Merge branch 'master' into new-jsonrpc 2017-03-21 09:35:50 +01:00
Tomasz Drwięga badb3729c9 Changing Mutex into RwLock for transaction queue (#4951)
* Changing Mutex into RwLock for transaction queue

* Fixing merge

* little fix
2017-03-20 19:15:02 +01:00
keorn e228de18e2 Disable max seal period for external sealing (#4927)
* no max sealing when external

* force internal sealing
2017-03-20 19:14:49 +01:00
Jaco Greeff 05cd715c39 Attach hardware wallets already in addressbook (#4912)
* Attach hardware wallets already in addressbook

* Only set values changed
2017-03-20 19:14:39 +01:00
Marek Kotewicz a555686bcd rlp serialization refactor (#4873)
* fixed naming of rlp modules

* RlpStream cleanup

* appending short rlp lists (0...55 bytes) is 25% faster

* RlpStream does not use bytes module, nor trait Stream

* removed unused code from rlp module

* compiling ethcore-util with new rlp serialization

* compiling parity with new rlp serialization

* fixed compiling ethcore-light with new rlp serialization

* fixed compiling ethsync with new rlp serialization

* removed redundant comment, print

* removed redundant double-space

* replace usage of WriteBytesExt with ByteOrder
2017-03-20 19:14:29 +01:00
Arkadiy Paronyan 16860c3f79 Bump nanomsg (#4965) 2017-03-20 16:03:16 +01:00
Tomasz Drwięga 1d87f24715
Bump 2017-03-20 12:06:42 +01:00
Tomasz Drwięga 6fa9393a25
Merge branch 'master' into new-jsonrpc 2017-03-20 10:30:53 +01:00
Arkadiy Paronyan 354ec19e3b Always send full chunks (#4960) 2017-03-19 18:34:31 +01:00
GitLab Build Bot 99c247fe9f [ci skip] js-precompiled 20170319-171327 2017-03-19 17:16:05 +00:00
Denis S. Soldatov aka General-Beck 2d477946ea alow failure to coverage 2017-03-19 19:10:18 +03:00
Nicolas Gotchac c009a289d5 Fix outputs in Contract Constant Queries (#4953) 2017-03-19 08:52:14 +01:00
Michael Egger 4ebd597354 start parity after network.target (#4952) 2017-03-19 08:52:00 +01:00
Tomasz Drwięga 34d28189ea Remove transaction RPC (#4949) 2017-03-19 08:46:51 +01:00
Callum Macdonald 124ab28c9e Swap out ethcore.io url (#4947)
It throws a certificate error on HTTPS because the certificate is only valid on parity.io.
2017-03-19 08:45:39 +01:00
Marek Kotewicz c36f4266d2 Merge pull request #4933 from paritytech/signing-fix
Don't remove confirmed requests to early.
2017-03-18 15:19:48 +01:00
Marek Kotewicz 91ab91cfb9 Merge pull request #4930 from paritytech/notify-sealing-master
Ensure sealing work enabled in miner once subscribers added
2017-03-18 15:19:02 +01:00
Jaco Greeff e756b09e5b Add z-index to small modals as well (#4923) 2017-03-18 10:30:18 +01:00
debris 701e116dde Merge branch 'master' of github.com:ethcore/parity into pip-msg 2017-03-17 23:38:49 +01:00
debris aa6ee10759 Merge branch 'master' of github.com:ethcore/parity into notify-sealing-master 2017-03-17 23:37:56 +01:00
debris 97e0df1363 Merge branch 'master' into signing-fix 2017-03-17 23:25:38 +01:00
Marek Kotewicz 1dddbf35d6 Merge pull request #4946 from paritytech/multihash
Bump nanomsg
2017-03-17 14:31:30 +01:00
Robert Habermeier 8be41ad946 Merge branch 'master' into pip-msg 2017-03-17 14:13:10 +01:00
arkpar 7e9936a3cd bump nanomsg 2017-03-17 14:10:09 +01:00
Marek Kotewicz 83f56c3ad9 Merge pull request #4943 from paritytech/multihash
Bumping multihash and libc
2017-03-17 14:02:56 +01:00
Tomasz Drwięga 8c98ddb843
Updating nanomsg 2017-03-17 13:47:05 +01:00
Tomasz Drwięga 0c051fb78e
Bumping multihash and libc 2017-03-17 13:20:10 +01:00
Tomasz Drwięga c13f01c4f9
Using dedicated branch for jsonrpc 2017-03-17 10:13:47 +01:00
Robert Habermeier 2ee3a7282b adjust to minor on_demand API changes in RPC 2017-03-17 00:14:29 +01:00
Robert Habermeier fa42b6acec port ethsync to PIP messages 2017-03-16 23:51:47 +01:00
Robert Habermeier b5527415d6 get on_demand tests to compile 2017-03-16 20:33:45 +01:00
Robert Habermeier 04f106aad8 migrate oneshot::complete to send in on_demand 2017-03-16 20:29:06 +01:00
Robert Habermeier cbb9314531 use PIP messages in on_demand, old API 2017-03-16 20:23:59 +01:00
Tomasz Drwięga 44052e7d8d
Merge branch 'master' into new-jsonrpc 2017-03-16 16:04:30 +01:00
Tomasz Drwięga 579cff478d
Fixing deprecated methods of tokio_core 2017-03-16 15:48:08 +01:00
GitLab Build Bot f84fcfee04 [ci skip] js-precompiled 20170316-124008 2017-03-16 12:42:56 +00:00
Nicolas Gotchac 7846544c1b Edit ETH value, gas and gas price in Contract Deployment (#4919)
* Fix typo

* Add Value capabilities to Contract Deployment

* Add Extras settings for Contract Deployment (#4483)

* Fix deploy in API
2017-03-16 13:18:28 +01:00
Tomasz Drwięga 930c8b63db
Don't remove confirmed requests to early. 2017-03-16 13:15:56 +01:00
Tomasz Drwięga 491eeb9878
Better invalid encoding messages 2017-03-16 12:48:51 +01:00
NikVolf daca82bdfc fix condition check 2017-03-16 04:16:05 +03:00
NikVolf 131aa14afa ensure sealing work enabled if notifier registed 2017-03-16 03:38:50 +03:00
Denis S. Soldatov aka General-Beck 57d718fde1 add coverage to master 2017-03-16 01:24:23 +03:00
Denis S. Soldatov aka General-Beck cb79859c0e Update cov.sh
update coverage for RUST&JS
[ci skip]
2017-03-16 01:21:58 +03:00
GitLab Build Bot 790bd87bc3 [ci skip] js-precompiled 20170315-182430 2017-03-15 18:27:17 +00:00
Nicolas Gotchac ba07c32300 Add ability to configure Secure API (for #4885) (#4922) 2017-03-15 19:15:05 +01:00
GitLab Build Bot 8d16cdf12f [ci skip] js-precompiled 20170315-155713 2017-03-15 16:00:18 +00:00
Nicolas Gotchac a25d935a1d Add Token image from URL (#4916) 2017-03-15 16:49:47 +01:00
Nicolas Gotchac f8aec7571f Use the registry fee in Token Deployment dapp (#4915) 2017-03-15 16:49:26 +01:00
keorn 1f7fb1591d Add reseal max period (#4903)
* add reseal max period

* fix rpc
2017-03-15 14:04:42 +01:00
Marek Kotewicz 5f103ee33d Detect rust compiler version in Parity build script, closes 4742 (#4907)
* Detect rust compiler version in Parity build script, closes #4742

* updated required compiler version message

* fixed typo
2017-03-15 14:03:11 +01:00
GitLab Build Bot 240ea8a136 [ci skip] js-precompiled 20170315-124802 2017-03-15 12:50:47 +00:00
Nicolas Gotchac e4c61a5fab Add Vaults logic to First Run (#4894) (#4914) 2017-03-15 13:40:18 +01:00
Marek Kotewicz b27138e93f Updated gcc crate to remove one of duplicated dependencies (#4909) 2017-03-15 12:13:19 +01:00
Denis S. Soldatov aka General-Beck 1959f0ae12 fix docker-build
[ci skip]
2017-03-14 20:21:51 +03:00
Tomasz Drwięga 57770ce84c Renaming evm binary to avoid conflicts. (#4899) 2017-03-14 13:08:55 +01:00
Tomasz Drwięga 2dca24cc28 Traces error handling (#4849) 2017-03-14 13:04:32 +01:00
Jaco Greeff 7c45178076 Add intitial max-width to sections (#4895) 2017-03-14 13:04:00 +01:00
Jaco Greeff e12bde8e5a Move background z-index to -1 (#4893) 2017-03-14 13:03:44 +01:00
Arkadiy Paronyan 5031221369 Removed libudev-dev 2017-03-14 13:02:46 +01:00
GitLab Build Bot 43d391501e [ci skip] js-precompiled 20170314-110423 2017-03-14 11:06:46 +00:00
Maciej Hirsz 7df4ff2606 Merge pull request #4900 from ethcore/mh-guide
Spelling :)
2017-03-14 11:57:46 +01:00
Tomasz Drwięga b51d7e9f6a
Merge branch 'master' into new-jsonrpc 2017-03-14 11:48:09 +01:00
Arkadiy Paronyan 43871e393c Additional kovan params (#4892) 2017-03-14 11:41:56 +01:00
maciejhirsz ef3569741c Spelling :) 2017-03-14 11:39:01 +01:00
GitLab Build Bot 84fcefba1b [ci skip] js-precompiled 20170314-103037 2017-03-14 10:32:58 +00:00
Jaco Greeff 7525cb5ee4 trigger js-precompiled build (#4898) 2017-03-14 11:23:50 +01:00
Arkadiy Paronyan e0d554e0ca Recalculate receipt roots in close_and_lock (#4884) 2017-03-13 17:47:43 +01:00
Robert Habermeier 599f81daa9 split request filling into fill,complete 2017-03-13 16:06:58 +01:00
Tomasz Drwięga 8bf5be0cc4
New version of jsonrpc. 2017-03-13 15:49:52 +01:00
Robert Habermeier f0a587d310 request builder improvements 2017-03-13 13:36:03 +01:00
GitLab Build Bot 29bed6ff69 [ci skip] js-precompiled 20170313-122643 2017-03-13 12:32:24 +00:00
Nicolas Gotchac 8a37f9599f Reload UI on network switch (#4864)
* Reload UI on network switch

* Don't bither with timeout.
2017-03-13 13:19:43 +01:00
Svyatoslav Nikolsky fddbc9e5cb Secretstore DKG protocol draft + distributed encryption/decryption tests (#4725)
* ECDKG protocol prototype

* added test for enc/dec math

* get rid of decryption_session

* added licenses

* fix after merge

* get rid of unused serde dependency

* doc

* decryption session [without commutative enc]

* failed_dec_session

* fixed tests

* added commen

* added more decryption session tests

* helper to localize an issue

* more computations to localize error

* decryption_session::SessionParams

* added tests for EC math to localize problem
2017-03-13 12:54:56 +01:00
Jaco Greeff b7862ac23a Update parity-ui-precompiled with branch (#4850)
* Update parity-ui-precompiled with branch

* In-place sed via -i

* Explicitly specify branch

* Only in-place edit branch (thanks @ngotchac)

* Add override & single-line comment
2017-03-13 12:52:02 +01:00
Jaco Greeff 90a5c9e489 Base infrastructure/contracts deployment dapp (#4726)
* Add deploy dapp

* Filter by dapp id

* WIP

* Contract deployment operational

* Additional contracts

* unicode icons

* Column layout

* app deployment

* DRY up lists

* Remove unused function

* Add basiccoin deployment & tokenreg

* Externalise code

* Check for code versions

* Gavcoin, Email & SMS contracts

* Update to latest email contract

* Deploy & register badges

* Add jg external apps

* Check owner for deleted registry entries

* DRY estimate/post

* Add wallet library to deployment
2017-03-13 12:49:26 +01:00
Arkadiy Paronyan 2924d0a20f OSX Installer is no longer experimental (#4882)
* OSX Installer is no longer experimental

* osx -> macos
2017-03-13 12:36:55 +01:00
Gav Wood 3041c95408 Chain-selection from UI (#4859)
* First little bits for chain-selection.

* Provide RPCs and get settings through to user defaults.

* Hasty stash.

* Fix updater accidentally redownloading.

* Finish up.

* Add JS tests.

* Hypervisor should never run a binary modified before itself.

* Style.

* Help tweak.

* Fix test compile.

* Fix JS test

* Build fix for tests.

* Revert default chain name

* Another test

* Use spec name via client.

* Fix mock up.

* whitespace

[ci:skip]

* whitespace

[ci:skip]

* remove exit/restart endpoints.
2017-03-13 12:10:53 +01:00
Marek Kotewicz 8a67a0a80a removed redundant (and unused) FromJson trait (#4871) 2017-03-13 11:42:27 +01:00
GitLab Build Bot 2ee8f07432 [ci skip] js-precompiled 20170312-211107 2017-03-12 21:17:02 +00:00
gregg dourgarian 18b29832ac fix typos and grammar (#4880) 2017-03-12 22:02:00 +01:00
Nikolay Volf 4af49038cd Remove old experimental remote db code (#4872) 2017-03-12 23:49:33 +04:00
Marek Kotewicz 3fe3353696 removed redundant FixedHash trait, fixes #4029 (#4866) 2017-03-11 22:58:15 +04:00
Marek Kotewicz 5d5e45ec0d Merge pull request #4870 from ethcore/jsonrpc-dep
Reference JSON-RPC more changes-friendly
2017-03-11 18:41:11 +01:00
GitLab Build Bot 79afe2d7fb [ci skip] js-precompiled 20170311-150617 2017-03-11 15:12:20 +00:00
NikVolf 429e1c7a27 bind to branch 2017-03-11 17:44:39 +03:00
Nicolas Gotchac e73d867dab Better handling of Solidity compliation (#4860)
* Better use of SW

* Safe-guard against pending SW register bug (in Chrome)

* Added a simple Worker for Solidity compilation
2017-03-11 15:25:45 +01:00
Nicolas Gotchac 1c37ea5860 Go through contract links in Transaction List display (#4863)
* Go through contract links (#4822)

* Fix tests, add one for /contracts/<address>
2017-03-11 15:25:36 +01:00
Nicolas Gotchac 96f4033a40 Fix Gas Price Selector Tooltips (#4865) 2017-03-11 15:25:27 +01:00
Gav Wood 5684906d3e Fix auto-updater. (#4867) 2017-03-11 14:45:50 +01:00
GitLab Build Bot b0264a6af2 [ci skip] js-precompiled 20170310-184737 2017-03-10 18:53:39 +00:00
Nicolas Gotchac e2069d2e29 Don't check for enode, don't fail if no enode (#4495) (#4861) 2017-03-10 19:40:47 +01:00
GitLab Build Bot 45414e6cfe [ci skip] js-precompiled 20170310-151240 2017-03-10 15:18:28 +00:00
Nicolas Gotchac dd529575f6 Subscribe to accounts info in Signer / ParityBar (#4738) (#4856) 2017-03-10 15:46:13 +01:00
Arkadiy Paronyan bc9464fcbd Removed link directive (#4841) 2017-03-10 15:25:02 +01:00
Nicolas Gotchac 95745ef4c8 Fix paste in Inputs (#4854)
* Wait for the value to have changed in the input

* Better onPaste handler // Use ESC to revert to initial value
2017-03-10 14:08:21 +01:00
GitLab Build Bot e5defeaada [ci skip] js-precompiled 20170310-123911 2017-03-10 12:45:42 +00:00
Nicolas Gotchac eebb8b87a4 Refactoring of the Dapp Registry (#4589)
* Add React Hot Loader to DappReg dapp

* Updated colours

* Add DappCards

* Dapp Modal with manifest displayed

* Add input to the Dapp Modal

* WIP // Editing a Dapp

* Clean-Up

* Linting

* CleanUp and separate dapp from dappS

* Semi-working updates

* Working Editing of a Dapp

* OCD

* Linting

* Add a Dapp -- WIP

* Register a new Dapp

* WIP Dapps

* Working update / delete / register

* Better promises

* Working updates for DappReg

* Fully functional again !

* Generic Card Component

* Dashed Register Card

* Cleanups

* Cleanups

* Add Actions to Modal

* Clean-Up

* Better Close Icon

* Single place for Registry version // Fetch meta-data from Registry

* Fixing test

* Fix saving changes in dapp reg

* PR Grumbles - Part I

* PR Grumble - Part I

* PR Grumble - Part II

* DappReg Contract owner can delete dapps
2017-03-10 13:31:57 +01:00
GitLab Build Bot e15f60b819 [ci skip] js-precompiled 20170310-111654 2017-03-10 11:25:12 +00:00
Jaco Greeff 4e5fd92e67 Extract i18n from shared UI components (#4834)
* Actionbar i18n

* ui Errors i18n

* Features i18n

* GapPriceSelector i18n

* WIP

* WIP #2

* Update methodDecoding

* ModalBox -> functional

* Signer pages i18n (missed previously)

* Update ModalBox tests

* Update variable
2017-03-10 12:04:40 +01:00
Nicolas Gotchac d98b7aab61 Wait for the value to have changed in the input (#4844) 2017-03-10 11:52:27 +01:00
Jaco Greeff 8edee76f8b Pull steps from actual available steps (#4848) 2017-03-10 11:38:27 +01:00
Denis S. Soldatov aka General-Beck ca963137e9 Update README.md
[ci skip]
2017-03-10 13:24:18 +03:00
Denis S. Soldatov aka General-Beck 6eefecf31e build docker with custom branch or tag
[ci -skip]
2017-03-10 13:23:34 +03:00
Arkadiy Paronyan 9047b4b487 Supress USB error message (#4839) 2017-03-10 10:25:40 +01:00
Tomasz Drwięga 0ab0cb1173 Fix RPC errors. Implement geth-compatibility option to return correct pending nonce. (#4837) 2017-03-10 10:25:13 +01:00
Denis S. Soldatov aka General-Beck 608c0dc613 CI: test coverage (for core) (#4832)
* test coverage

* update gitlab

add `git submodule update --init --recursive`

* test exec coverage in docker runner

* tags kcov
2017-03-10 10:12:16 +01:00
Tomasz Drwięga aedc473f64 Lowering threshold for transactions above gas limit (#4831) 2017-03-10 10:11:37 +01:00
Nicolas Gotchac be87151f1c Fix TxViewer when no `to` (contract deployment) (#4847)
* Added React Hot Reload to dapps + TokenDeplpoy fix

* Fixes to the LocalTx dapp

* Don't send the nonce for mined transactions

* Don't encode empty to values for options
2017-03-10 10:08:16 +01:00
GitLab Build Bot 5e54c0fa91 [ci skip] js-precompiled 20170309-190359 2017-03-09 19:09:36 +00:00
Nicolas Gotchac 3bb66d03ee Fix method decoding (#4845)
* Fix contract deployment method decoding in Signer

* Linting
2017-03-09 19:56:10 +01:00
Nicolas Gotchac 3478c16e10 Added React Hot Reload to dapps + TokenDeplpoy fix (#4846) 2017-03-09 19:55:48 +01:00
Nicolas Gotchac bd00256e0c Uniq array of ids (#4843) 2017-03-09 19:55:11 +01:00
Robert Habermeier 64342d200c return only complete headers responses 2017-03-09 17:28:49 +01:00
GitLab Build Bot b196635816 [ci skip] js-precompiled 20170309-160350 2017-03-09 16:09:29 +00:00
Nicolas Gotchac 5342a482b5 Fixes to the Registry dapp (#4838)
* Fix wrong ABI methods

* Fix
2017-03-09 16:55:57 +01:00
Robert Habermeier 391eb4b66c get network tests working 2017-03-09 16:55:13 +01:00
Denis S. Soldatov aka General-Beck ea020948fc push-release<->build 2017-03-09 01:34:00 +03:00
Denis S. Soldatov aka General-Beck 6062aa5dcd fix windows build
rm parity.pdb
2017-03-08 23:49:34 +03:00
Robert Habermeier 8fb0a2d417 move request_builder -> request::builder 2017-03-08 20:11:22 +01:00
Robert Habermeier aea9b1d6cc request builder tests 2017-03-08 20:07:45 +01:00
Robert Habermeier d9087dd2b6 roundtrip tests for request types 2017-03-08 19:50:26 +01:00
Robert Habermeier 868f83e6ca Merge branch 'master' into pip-msg 2017-03-08 18:55:21 +01:00
Robert Habermeier a1186727af fix cost table RLP encoding 2017-03-08 18:38:25 +01:00
Robert Habermeier 9268a1f59c get tests compiling 2017-03-08 18:27:29 +01:00
Jaco Greeff ca1efc3d77 Show token icons on list summary pages (#4826)
* Adjust balance overlay margins (no jumps)

* Img only balances, small verifications

* Invalid tests removed

* Always wrap display (Thanks @ngotchac)

* Update tests to reflect reality
2017-03-08 18:07:14 +01:00
Robert Habermeier 9692616958 re-do cost table 2017-03-08 18:01:41 +01:00
Robert Habermeier bb39f104f4 implement requesting from 2017-03-08 17:37:07 +01:00
keorn be21671c1c Calibrate step before rejection (#4800)
* calibrate before rejection

* change flag name

* fix merge
2017-03-08 17:25:50 +01:00
Robert Habermeier ee034185a5 handle response packets 2017-03-08 15:28:46 +01:00
keorn a84a10ff03 Add replay protection (#4808)
* add eip155

* make network_id default
2017-03-08 14:44:07 +01:00
Arkadiy Paronyan 731f28a8c0 Better windows icon (#4804) 2017-03-08 14:42:56 +01:00
keorn 98be191b25 Fix validator contract syncing (#4789)
* make validator set aware of various states

* fix updater build

* clean up contract call

* failing sync test

* adjust tests

* nicer indent [ci skip]

* revert bound divisor
2017-03-08 14:41:24 +01:00
Robert Habermeier 8a3b5c6332 Remote transaction execution (#4684)
* return errors on database corruption

* fix tests, json tests

* fix remainder of build

* buffer flow -> request credits

* proving state backend

* generate transaction proofs from provider

* network messages for transaction proof

* transaction proof test

* test for transaction proof message

* fix call bug

* request transaction proofs from on_demand

* most of proved_execution rpc

* proved execution future
2017-03-08 14:39:44 +01:00
GitLab Build Bot 5bbcf0482b [ci skip] js-precompiled 20170308-122756 2017-03-08 12:38:37 +00:00
Nicolas Gotchac 02c51c83cd Better logic for contract deployments (#4821) 2017-03-08 13:21:39 +01:00
Nicolas Gotchac 94a39619b5 Fix default values for contract queries (#4819) 2017-03-08 12:26:03 +01:00
Jaco Greeff f16b53d92a Adjust selection colours/display (#4811)
* Adjust selection colours to match with mui

* allow -> disable (simplify selections)

* Only use top-border

* Overlay selection line

* Slightly more muted unselected

* Restore address icon
2017-03-08 12:00:27 +01:00
Nicolas Gotchac f0f2d00924 Update the key (#4817) 2017-03-08 12:00:04 +01:00
GitLab Build Bot 81b57a57c7 [ci skip] js-precompiled 20170307-211202 2017-03-07 21:17:27 +00:00
Nicolas Gotchac 48e5d82186 Fix SectionList hovering issue (#4749)
* Fix SectionList Items hover when <3 items

* Even easier...
2017-03-07 22:03:52 +01:00
GitLab Build Bot 7638b2c9e8 [ci skip] js-precompiled 20170307-195934 2017-03-07 20:06:34 +00:00
Robert Habermeier dbd05e6c92 handle request packet in LightProtocol 2017-03-07 20:58:23 +01:00
Nicolas Gotchac a587815ddc Re-Introducing HappyPack (#4669)
* Updating Dev Dependencies (minor version updates)

* Re-introduce HappyPack

* Added Yarn Lock file

* Use HappyPack

* Linting

* Delete yarn lock file
2017-03-07 20:39:36 +01:00
Jaco Greeff c3c83086bc SMS Faucet (#4774)
* Faucet

* Remove flakey button-index testing

* Only display faucet when sms verified (mainnet)

* simplify availability checks

* WIP

* Resuest from verified -> verified

* Update endpoint, display response text

* Error icon on errors

* Parse hash text response

* Use /api/:address endpoint

* hash -> data

* Adjust sms-certified message
2017-03-07 20:21:07 +01:00
Nicolas Gotchac 4d08e7b0ae Update Wallet to new Wallet Code (#4805)
* Update Wallet Version

* Update Wallet Library

* Update Wallets Bytecodes

* Typo

* Separate Deploy in Contract API

* Use the new Wallet ABI // Update wallet code

* WIP .// Deploy from Wallet

* Update Wallet contract

* Contract Deployment for Wallet

* Working deployments for Single Owned Wallet contracts

* Linting

* Create a Wallet from a Wallet

* Linting

* Fix Signer transactions // Add Gas Used for transactions

* Deploy wallet contract fix

* Fix too high gas estimate for Wallet Contract Deploys

* Final piece ; deploying from Wallet owned by wallet

* Update Wallet Code

* Updated the Wallet Codes

* Fixing Wallet Deployments

* Add Support for older wallets

* Linting
2017-03-07 20:19:55 +01:00
Robert Habermeier 04291fe71e complete initial request changes 2017-03-07 19:48:07 +01:00
Denis S. Soldatov aka General-Beck 973bb63dca update gitlab-ci
remove temp kcov cmd
[ci skip]
2017-03-07 22:33:08 +04:00
Tomasz Drwięga 4868f758bf Allow specifying extra cors headers for dapps (#4710) 2017-03-07 17:33:28 +01:00
Arkadiy Paronyan ae3f85bd5b v1.7 (#4730) 2017-03-07 17:29:27 +01:00
Jaco Greeff 3fb8466c40 Bump package.json for master 1.7 (#4731)
* Bump package.json for master 1.7

* Update contributors
2017-03-07 17:29:15 +01:00
Robert Habermeier b396b56e34 encode and decode responses 2017-03-07 17:18:26 +01:00
Igor Artamonov 63bc942e41 update ETC bootnodes (#4794) 2017-03-07 05:34:48 +01:00
Denis S. Soldatov aka General-Beck 2f7f95d519 update gitlab-ci
add `kcov` cmd
2017-03-07 03:21:11 +04:00
Denis S. Soldatov aka General-Beck 4e1816cd00 test coverage 2017-03-07 03:16:32 +04:00
Denis S. Soldatov aka General-Beck 374d7c879e push-release after build 2017-03-07 01:56:19 +04:00
Gav Wood cec37207be Update comments and reg ABI (#4787)
* Update comments.

* Fix up new ABI.
2017-03-06 21:37:38 +01:00
Denis S. Soldatov aka General-Beck 344b5b120f update Dockerfile for hub
add BUILD_TAG ARG
[ci skip]
2017-03-06 22:46:35 +04:00
Denis S. Soldatov aka General-Beck 38884cdf82 update docker-build
add arg
[ci skip]
2017-03-06 22:44:41 +04:00
Robert Habermeier 87f3d53607 new requests in provider. 2017-03-06 17:36:56 +01:00
Robert Habermeier 8e9faa416d proofs of non-existance in ProvingBlockChainClient 2017-03-06 17:03:58 +01:00
GitLab Build Bot 24aac8fa89 [ci skip] js-precompiled 20170306-142052 2017-03-06 14:26:42 +00:00
Tomasz Drwięga 4f934cf2c2 Optimize signature for fallback function. (#4780) 2017-03-06 15:11:39 +01:00
Robert Habermeier 41effadb94 RLP encoding and decoding for requests 2017-03-06 12:21:06 +01:00
GitLab Build Bot 0de8771007 [ci skip] js-precompiled 20170306-093959 2017-03-06 09:45:14 +00:00
Tomasz Drwięga 4d203d563c Rephrasing token generation screen. (#4777) 2017-03-06 10:32:41 +01:00
GitLab Build Bot a02063f348 [ci skip] js-precompiled 20170306-080251 2017-03-06 08:08:05 +00:00
Jaco Greeff 0b24a3d7f6 Etherscan links based on netVersion identifier (#4772)
* Use netVersion to determine external links

* Update additional isTest references
2017-03-06 08:54:59 +01:00
Jerome de Tychey 944dcdc010 Update README.md (#4762)
Fix for cargo fail when building from source
2017-03-06 08:49:52 +01:00
GitLab Build Bot cabf251280 [ci skip] js-precompiled 20170305-093606 2017-03-05 09:41:41 +00:00
Jaco Greeff 5a7cbb3e5b Fix invalid props (#4766) 2017-03-05 10:27:18 +01:00
keorn d68ea777a2 Extend authority round consensus test (#4756)
* add auth round test case

* correct fork assertion
2017-03-03 22:32:22 +01:00
GitLab Build Bot 2e0d005487 [ci skip] js-precompiled 20170303-190450 2017-03-03 19:10:54 +00:00
Tomasz Drwięga edecd951ba Revert last hyper "fix" (#4752) 2017-03-03 19:52:08 +01:00
Jaco Greeff 1548201551 Vault Management UI (round 3) (#4652)
* Render Dapps via SectionList

* Initial rendering of accounts via SectionList

* Width vars

* Allow classNames in certifications & tags

* Overlay of info on hover

* Adjust hover balances

* Large owner icons (align with vaults)

* Consistent block mined at message

* Attach ParityBackground to html

* Adjust page padding to align

* Lint fixes

* Link to different types of addresses

* Make content parts clickable only (a within a)

* Force Chrome hardware acceleration

* Trust the vendors... don't go crazy with transform :)

* Use faster & default transitions

* Add VaultMeta edit dialog

* Updated (WIP)

* Meta & password edit completed

* Added SelectionList component for selections

* Use SelectionList in DappPermisions

* AddDapps uses SelectionList

* Fix AccountCard to consistent height

* Display type icons in creation dialog

* Complimentary colours

* Convert Signer defaults to SelectionList

* Fix Geth import - actually pass addresses through

* Work from addresses returned via RPC

* Display actual addresses imported (not selected)

* Update tests to cover bug fixed

* Prettyfy Geth import

* Description on selection actions

* SelectionList as entry point

* Update failing tests

* Subtle selection border

* Styling updates for account details

* Add ModalBox summary

* AddAddress updated

* Display account vault information

* Allow invalid addresses to display icons (e.g. vaults)

* Display vault on edit meta

* Convert VaultAccounts to SelectionList

* Allow editing of Vault in meta

* Add tests for SectionList component

* Add tests for ModalBox component

* Add tests for VaultSelector component

* Add vaultsOpened in store

* Add ~/ui/Form/VaultSelect

* WIP

* Fix failing tests

* Move account to vault when selected

* Fix circular build deps

* EditMeta uses Form/VaultSelect

* Vault move into meta store (alignment)

* Re-apply stretch fix

* Display vault in account summary

* Add busy indicators to relevant modals

* Auto-focus description field (aligns with #4657)

* Remove extra container (double scrolling)

* Remove unused container style

* Apply scroll fixes from lates commit in #4621

* Remove unneeded logs

* Remove extra div, fixing ParityBar overflow

* Make dapp iframe background white

* Stop event propgation on tag click

* ChangeVault component (re-usable)

* Use ChangeVault component

* Pass vaultStores in

* Icon highlight colour

* Tag-ify vault name display

* ChangeVault location

* Bothced merge, selector rendering twice

* Value can be undefined (no vault)

* Close selector on Select bug

* Fix toggle botched merge

* Update tests

* Add Vault Tags to Account Header
2017-03-03 19:50:54 +01:00
Jaco Greeff cb118f1936 Update SelectionList indicators (#4736)
* Move selector indicators to the left

* Only display default account selection icon
2017-03-03 19:50:25 +01:00
Jaco Greeff 9b6170a37b Update testnet detection (#4746) 2017-03-03 19:49:46 +01:00
Nicolas Gotchac ec0e8f9dd6 Add StackEventListener (#4745) 2017-03-03 19:49:36 +01:00
Robert Habermeier bbb50caa89 initial request definitions 2017-03-03 19:25:29 +01:00
GitLab Build Bot ead40a8b97 [ci skip] js-precompiled 20170303-140210 2017-03-03 14:07:22 +00:00
Maciej Hirsz d297ddbfe5 Update wiki (#4743)
- Added missing `creates` field.
- Removed deprecated methods.
2017-03-03 14:55:04 +01:00
GitLab Build Bot 4024100e74 [ci skip] js-precompiled 20170303-134752 2017-03-03 13:53:17 +00:00
Jaco Greeff 6760ae0e84 Account selector close operations (#4728)
* Close when clicking anywhere on body pane

* Allow click to propagate on address click

* Rename noCopy -> allowAddressClick

* Handle i18n strings in input

* Close on pasted addresses (valid entry)

* allowAddressClick default

* Don't do onClick on AccountCard if text is selected

* Reset filter value on close for address selection

* Better close on click for AccountSelection
2017-03-03 14:38:40 +01:00
Nicolas Gotchac 5559374676 Fix Account Selection in Signer (#4744)
* Can pass FormattedMessage to Input (eg. Status // RPC Enabled)

* Simple fixed-width fix for Accoutn Selection in Parity Signer
2017-03-03 14:32:52 +01:00
GitLab Build Bot fd19f6f449 [ci skip] js-precompiled 20170303-130222 2017-03-03 13:07:34 +00:00
Jaco Greeff 495e5790e9 Support both V1 & V2 DataChanged events in registry (#4734)
* Add info on forks.

* Add new registry ABI

* Import registry2 & fix exports

* Select ABI based on code hash

* Render new event types (owner not available)

* New registry.

* Rename old chain.

* Fix test.

* Another fix.

* Finish rename.
2017-03-03 13:33:49 +01:00
Gav Wood 3a0c4b6539 Add info on forks. (#4733) 2017-03-03 08:20:25 +01:00
keorn 810c71dd66 Merge pull request #4732 from ethcore/new-chains
Add registry addr
2017-03-03 00:16:47 +01:00
GitLab Build Bot 0432b8410c [ci skip] js-precompiled 20170302-230110 2017-03-02 23:07:35 +00:00
Jaco Greeff b11caaf071 UI support for hardware wallets (#4539)
* Add parity_hardwareAccountsInfo

* Ledger Promise interface wrapper

* Initial hardwarestore

* Move ~/views/historyStore to ~/mobx

* split scanLedger

* test createEntry

* Also scan via parity_hardwareAccountsInfo

* Explanation for scanning options

* react-intl-inify tooltips

* add hwstore

* Listen for hw walet updates

* Return arrays from scanning

* Readability

* add u2f-api polyfill

* check response.errorCode

* Support hardware types in state.personal

* Tooltips (to be split into sep. PR)

* Tooltips support intl strings

* FormattedMessage for strings to Tooltip

* Fix TabBar tooltip display

* signLedger

* Use wallets as an object map

* PendingForm -> FormattedMessage

* Pending form doesn't render password for hardware

* Groundwork for JS API signing

* Show hardware accounts in list

* Cleanup rendering conditions

* Update RequestPending rendering tests (verification)

* Tests for extended signer middleware

* sign properly & handle response, error

* Align outputs between Parity & Ledger u2f

* Ledger returns checksummed addresses

* Update ethereum-tx for EIP155 support

* Update construction of tx

* Updates after sanity checks (thanks @tomusdrw)

* Allow display for disabled IdentityIcon

* Disabled accounts

* Disabled auto-disabling

* Password button ebaled for hardware

* Don't display password hint for hardware

* Disable non-applicable options when not connected

* Fix failing test

* Confirmation via ledger (u2f)

* Confirm on device message

* Cleanups & support checks

* Mark u2f as unsupported (until https)

* rewording

* Pass account & disabled flags

* Render attach device message

* Use isConnected for checking availability

* Show hardware accounts in defaults list

* Pass signerstore

* Update u2f to correct version

* remove debug u2f lib

* Update test (prop name change)

* Add ETC path (future work)

* new Buffer -> Buffer.from (thanks @derhuerst)
2017-03-02 23:51:56 +01:00
Gav 40526c5270 Merge remote-tracking branch 'origin/master' into new-chains 2017-03-02 23:49:24 +01:00
Gav 71d3fa8707 Add registry. 2017-03-02 23:47:56 +01:00
GitLab Build Bot 96d74543fc [ci skip] js-precompiled 20170302-204757 2017-03-02 20:52:50 +00:00
Jaco Greeff 036ef77373 s/delete/forget/ for wallets (#4729) 2017-03-02 21:40:29 +01:00
Gav Wood 2862b3c21a New chains (#4720)
* Add Kovan chain.

* Fix up --testnet.

* Fix tests.

* Fix test.

* fix test

* Fix test.
2017-03-02 20:24:27 +01:00
Arkadiy Paronyan 591eb76a93 Enable --warp by default (#4719)
* Enable --warp by default

* Disable warp if non-standard chain options are selected

* Add warnings if warp is specified

* Fixed tests
2017-03-02 20:04:17 +01:00
Gav 9c38ff3907 Merge branch 'new-chains' of github.com:ethcore/parity into new-chains 2017-03-02 19:58:10 +01:00
Gav 8ad6107f13 Fix test. 2017-03-02 19:53:15 +01:00
keorn 9ff6195f50 fix test 2017-03-02 17:46:47 +00:00
Gav 89910c0174 Fix test. 2017-03-02 16:09:30 +01:00
Gav 90562c1331 Fix tests. 2017-03-02 15:43:11 +01:00
Gav bb3b2311bf Merge remote-tracking branch 'origin/master' into new-chains 2017-03-02 15:42:03 +01:00
GitLab Build Bot eb37d26154 [ci skip] js-precompiled 20170302-143357 2017-03-02 14:38:43 +00:00
Jaco Greeff 7653cfd88e Fix to UglifyJS 2.8.2 to fix app build issues (#4723) 2017-03-02 15:26:07 +01:00
Gav 52cf44d71a Fix up --testnet. 2017-03-02 14:46:35 +01:00
Gav c662d1cb0a Add Kovan chain. 2017-03-02 14:33:59 +01:00
GitLab Build Bot 5fef950503 [ci skip] js-precompiled 20170302-123938 2017-03-02 12:44:34 +00:00
Jaco Greeff 5f51fa23ea Extract i18n strings in modals/* (#4706)
* DeployContract formatting

* PasswordManager i18n

* SaveContract i18n

* Transfer i18n

* Verification i18n

* Fix spacing on label
2017-03-02 13:29:32 +01:00
Robert Habermeier 31302e057f provide uncle size where available (#4713) 2017-03-02 12:29:18 +01:00
Svyatoslav Nikolsky cb168828a2 EC math functions (#4696)
* EC math functions

* moved math funs -> Secret methods
2017-03-02 12:27:41 +01:00
keorn ade5a13f5b Add registrar fields (#4716)
* add registrar field

* use constructor for dev registrar

* fix test
2017-03-02 12:25:55 +01:00
Jaco Greeff 5dd406a19a Extract i18n strings in views/* (#4695)
* i18n for writecontract

* i18n for writecontract store

* wallet i18n

* wallet confirmations i18n

* wallet details i18n

* wallet transactions i18n

* status i18n

* status calls i18n

* status callstoolbar i18n

* status debug i18n

* status editableValue i18n

* status miningSettings i18n

* status rpcCalls i18n

* status rpcDocs i18n

* status status i18n

* signer i18n

* signer origin i18n

* signer signRequest i18n

* signer transactionMainDetails i18n

* sign transactionPending i18n

* signer transactionPending i18n

* Fix duplicate ids

* Typo

* Adapt tests for i18n

* Actionbar i18n

* contracts i18n

* contract i18n

* contract/queries i18n

* contract/events i18n

* application/frameError i18n

* Actionbar key naming

* addresses i18n

* address i18n

* accounts i18n (tooltip)

* Plural strings for owner numbers

* IdentityIcon placement

* Re-apply s/actiobar/actionbar/ after merge
2017-03-02 12:24:54 +01:00
Tomasz Drwięga 36468f3fc7 Removing network=disable from config files (#4715) 2017-03-02 12:23:54 +01:00
Denis S. Soldatov aka General-Beck d436f62eb8 update gitlab-ci
docker build beta-release->latest
[ci skip]
2017-03-01 15:57:06 +04:00
Robert Habermeier 655c7ae7ae Merge pull request #4687 from ethcore/fast-migrate
Fast in-place migration for adding and removing column families
2017-02-28 17:18:36 +01:00
GitLab Build Bot 54aee9db9b [ci skip] js-precompiled 20170228-153914 2017-02-28 15:44:30 +00:00
Jaco Greeff 4534590f39 Display badges on summary view (#4689) 2017-02-28 16:31:22 +01:00
GitLab Build Bot ea877cb91e [ci skip] js-precompiled 20170228-132909 2017-02-28 13:35:38 +00:00
Jaco Greeff 190ed76e30 Consistent file uploads (#4699)
* FileSelect component

* Use FileSelect component in Actionbar

* Convert CreateAccount/Import to FileSelect
2017-02-28 14:24:12 +01:00
Jaco Greeff 88449671a1 Rename https://mkr.market -> https://oasisdex.com (#4701) 2017-02-28 14:21:19 +01:00
Jaco Greeff ab98ec3bf7 Stop onClick propagation after click (#4700) 2017-02-28 14:20:43 +01:00
Jaco Greeff 1b8a47fa4a Display ... for address summary overflows (#4691) 2017-02-28 14:15:48 +01:00
GitLab Build Bot 689fe9c689 [ci skip] js-precompiled 20170227-213540 2017-02-27 21:40:33 +00:00
Jaco Greeff 5e480e9fc0 Less agressive grayscale/opacity (#4688) 2017-02-27 22:28:21 +01:00
Robert Habermeier b487f00173 address rightward drift 2017-02-27 19:05:02 +01:00
Robert Habermeier da3c13f0a2 split adding and dropping columns tests 2017-02-27 18:57:22 +01:00
Denis S. Soldatov aka General-Beck b13a446d82 update docker-build
fix path
2017-02-27 01:14:23 +04:00
Denis S. Soldatov aka General-Beck 2f15c75fa2 update gitlab-ci
fix path to Dockerfile
[ci skip]
2017-02-27 01:13:27 +04:00
Robert Habermeier 868624c6a9 return correct path for in-place migration 2017-02-26 19:30:54 +01:00
Robert Habermeier ac82a838b8 test case and handle in-place migration correctly 2017-02-26 19:22:51 +01:00
Robert Habermeier ed0a2567d8 docs 2017-02-26 19:11:19 +01:00
Robert Habermeier c2c699abb9 change migration to v11 to be faster 2017-02-26 18:41:40 +01:00
Robert Habermeier 3cc007b4d6 add and remove column families dynamically 2017-02-26 18:29:35 +01:00
Robert Habermeier af235e564e proved execution future 2017-02-26 15:05:33 +01:00
Robert Habermeier 1ff0abc661 Merge branch 'master' into remote-tx-exec 2017-02-26 13:55:29 +01:00
Robert Habermeier 645011427a most of proved_execution rpc 2017-02-26 13:48:56 +01:00
Robert Habermeier 1bf2b27708 Propagate trie errors upwards from State (#4655)
* state backend trait mirroring state_db API

* minimal state backend trait

make state module public

* fix json tests

* return errors on database corruption

* fix tests, json tests

* fix remainder of build

* add Backend bound on state
2017-02-26 13:10:50 +01:00
Robert Habermeier 69e82e15a3 request transaction proofs from on_demand 2017-02-25 20:10:38 +01:00
Robert Habermeier 7c541117b3 fix call bug 2017-02-25 19:01:41 +01:00
Robert Habermeier eb9ee35d6c Merge pull request #4632 from ethcore/state-backend
Generic state backend
2017-02-25 16:22:42 +01:00
Robert Habermeier 4cf62e816e Merge branch 'state-backend' into remote-tx-exec 2017-02-25 14:31:27 +01:00
Robert Habermeier 7863d1e978 add Backend bound on state 2017-02-25 14:28:26 +01:00
Robert Habermeier 2b671b8476 test for transaction proof message 2017-02-25 12:43:43 +01:00
Robert Habermeier 32f906fe9f transaction proof test 2017-02-25 11:54:32 +01:00
Robert Habermeier 4158693470 network messages for transaction proof 2017-02-25 11:07:38 +01:00
Robert Habermeier 92e5982127 generate transaction proofs from provider 2017-02-25 00:27:48 +01:00
Denis S. Soldatov aka General-Beck 714b46dfef update gitlab-ci
add triggers to docker-build
2017-02-24 23:54:41 +04:00
Robert Habermeier ee7779df17 proving state backend 2017-02-24 20:16:32 +01:00
Denis S. Soldatov aka General-Beck bef33a0958 update gitlab-ci
[ci skip] fix `docker-build`
2017-02-24 22:00:08 +04:00
GitLab Build Bot 8bee714452 [ci skip] js-precompiled 20170224-171258 2017-02-24 17:18:20 +00:00
Jaco Greeff 609e24ef04 Enhance dialog layouts (round 1) (#4637)
* Added SelectionList component for selections

* Use SelectionList in DappPermisions

* AddDapps uses SelectionList

* Fix AccountCard to consistent height

* Display type icons in creation dialog

* Complimentary colours

* Convert Signer defaults to SelectionList

* Fix Geth import - actually pass addresses through

* Work from addresses returned via RPC

* Display actual addresses imported (not selected)

* Update tests to cover bug fixed

* Prettyfy Geth import

* Description on selection actions

* SelectionList as entry point

* Update failing tests

* Subtle selection border

* Styling updates for account details

* Add ModalBox summary

* AddAddress updated

* Convert VaultAccounts to SelectionList

* Add tests for SectionList component

* Add tests for ModalBox component

* Re-apply stretch fix

* Apply scroll fixes from lates commit in #4621

* Clear name on switch (test in #4652, not pulling in)

* Remove refs (cleanup)
2017-02-24 18:05:39 +01:00
Jaco Greeff 570e6f32b0 Vault Management UI (round 2) (#4631)
* Add VaultMeta edit dialog

* Updated (WIP)

* Meta & password edit completed

* Added SelectionList component for selections

* Use SelectionList in DappPermisions

* AddDapps uses SelectionList

* Fix AccountCard to consistent height

* Convert Signer defaults to SelectionList

* Subtle selection border

* Display account vault information

* Allow invalid addresses to display icons (e.g. vaults)

* Display vault on edit meta

* Convert VaultAccounts to SelectionList

* Allow editing of Vault in meta

* Add tests for SectionList component

* Add tests for VaultSelector component

* Auto-focus description field (aligns with #4657)

* Apply scroll fixes from lates commit in #4621

* Remove unneeded logs

* Remove extra div, fixing ParityBar overflow

* Disable save if password don't match

* s/disabled/readOnly/

* string -> bool
2017-02-24 18:05:04 +01:00
Nicolas Gotchac 9ff427caaf Fix Portal broad event stopper (#4674) 2017-02-24 18:04:26 +01:00
keorn 7a773b42bf custom dev presets (#4671) 2017-02-24 17:36:52 +01:00
Arkadiy Paronyan ef7998f473 Max gas limit and min gas price (#4661)
* Max gas limit and min gas price

* Tests

* Limit gas limit ceiling
2017-02-24 17:34:32 +01:00
GitLab Build Bot af45d05aee [ci skip] js-precompiled 20170224-142855 2017-02-24 14:33:38 +00:00
Jaco Greeff f670b180d7 Align list displays with SectionList (UI consistency) (#4621)
* Render Dapps via SectionList

* Initial rendering of accounts via SectionList

* Width vars

* Allow classNames in certifications & tags

* Overlay of info on hover

* Adjust hover balances

* Large owner icons (align with vaults)

* Consistent block mined at message

* Attach ParityBackground to html

* Adjust page padding to align

* Lint fixes

* Link to different types of addresses

* Make content parts clickable only (a within a)

* Force Chrome hardware acceleration

* Trust the vendors... don't go crazy with transform :)

* Use faster & default transitions

* Remove extra container (double scrolling)

* Remove unused container style

* Make dapp iframe background white

* Stop event propgation on tag click
2017-02-24 15:21:36 +01:00
GitLab Build Bot afecf5b148 [ci skip] js-precompiled 20170224-134503 2017-02-24 13:50:10 +00:00
Jaco Greeff a6ed3dc5dc Add SelectionList component to DRY up (#4639)
* Added SelectionList component for selections

* Use SelectionList in DappPermisions

* AddDapps uses SelectionList

* Fix AccountCard to consistent height

* Convert Signer defaults to SelectionList

* Subtle selection border

* Convert VaultAccounts to SelectionList

* Add tests for SectionList component

* Apply scroll fixes from lates commit in #4621

* Remove unneeded logs

* Remove extra div, fixing ParityBar overflow
2017-02-24 14:37:56 +01:00
GitLab Build Bot 5817cfdf41 [ci skip] js-precompiled 20170224-115159 2017-02-24 11:58:15 +00:00
Jaco Greeff 38cf7d2639 Linting updates (#4662) 2017-02-24 12:44:38 +01:00
Jaco Greeff 0b214450e3 Misc. small UI fixes (#4657)
* Shorten menu items (accounts)

* Shorten menu items (addresses)

* Shorten menu items (contracts)

* Shorten menu items (account)

* Shorten menu items (address)

* Shorten menu items (contract)

* Auto-focus & perform default action

* Auto-focus & default action

* Auto focus for first fields (create account)

* Clear phrase & auto-focus field

* Auto-focus name fields

* Add autoFocus (Add Address)

* autoFocus address (Add Contract)

* Auto focus name field

* Auto-focus name field for EditMeta

* Auto-focus modifications (WalletSettings)

* Verification auto focus

* typo

* Double-up on keys
2017-02-24 12:26:30 +01:00
Maciej Hirsz f97e775498 More CLI settings for IPFS API (#4608)
* TEMP: Bind to 0.0.0.0, don't check Origin

* More CLI options for IPFS

* CORS and Hosts filtering

* Allow current interface as origin

* Correctly handle CORS settings

* fix grumbles
2017-02-24 10:32:42 +01:00
keorn 9b5bcb81fd Fix Tendermint deadlock (#4654)
* scope read

* consistent step
2017-02-24 10:26:56 +01:00
Bas 56d0ad869a nl translations (#4649)
* translation stings copied from _default to nl

* First batch of nl translations

* Second batch of nl translations

* Syntax fix

* include new nl translation files to index
2017-02-24 10:25:28 +01:00
GitLab Build Bot c7b3b9a565 [ci skip] js-precompiled 20170224-084932 2017-02-24 08:54:34 +00:00
Jaco Greeff 92fa4249d3 Update condition documentation (Thanks @arkpar) (#4659) 2017-02-24 09:40:38 +01:00
Tomasz Drwięga daf36739ce Bump hyper versions (#4645) 2017-02-24 09:22:29 +01:00
Gav Wood 76ade2fc2d Sane updater (#4658)
* Make updater avoid downloading earlier versions.

* Disable if files can't be moved.
2017-02-24 01:06:35 +01:00
Robert Habermeier ddbdfafc05 buffer flow -> request credits 2017-02-23 23:10:29 +01:00
Robert Habermeier 3f78c945d7 Merge pull request #4594 from ethcore/lightrpc
Remainder of RPC APIs implemented for the light client
2017-02-23 19:58:27 +01:00
Robert Habermeier f169c8dbb0 fix remainder of build 2017-02-23 19:26:20 +01:00
Svyatoslav Nikolsky 88cdc92ed4 preserve vault meta when changing pwd (#4650) 2017-02-23 19:01:12 +01:00
Robert Habermeier 91753c53cd fix tests, json tests 2017-02-23 18:41:01 +01:00
Robert Habermeier 3655601693 return errors on database corruption 2017-02-23 17:40:03 +01:00
GitLab Build Bot 496a6dcfa0 [ci skip] js-precompiled 20170223-141355 2017-02-23 14:21:06 +00:00
Jaco Greeff 3651095651 Fix Geth account import (#4641)
* Fix Geth import - actually pass addresses through

* Work from addresses returned via RPC

* Display actual addresses imported (not selected)

* Update tests to cover bug fixed
2017-02-23 15:04:58 +01:00
Denis S. Soldatov aka General-Beck e60fa751eb [ci skip] 2017-02-23 03:36:03 +04:00
Denis S. Soldatov aka General-Beck 5c57b42259 [ci skip] 2017-02-23 03:31:43 +04:00
Gav Wood 3182540d9f Tweak some checks. (#4633)
* Tweak some checks.

* Fixed build and added a difficulty test
2017-02-22 18:24:22 +01:00
GitLab Build Bot f3b5e2074b [ci skip] js-precompiled 20170222-165052 2017-02-22 16:55:55 +00:00
Jannis Redmann 94fa2db986 attempt to fix subscribeToEvents test (#4638) 2017-02-22 17:44:11 +01:00
GitLab Build Bot cb3c6b1bec [ci skip] js-precompiled 20170222-150433 2017-02-22 15:09:15 +00:00
Jaco Greeff e66d54910a Fix selection value from RadioButtons (#4636)
* Fix selection value from RadioButtons

* Fix outdated test
2017-02-22 15:57:21 +01:00
GitLab Build Bot 3df1adc3f5 [ci skip] js-precompiled 20170222-143551 2017-02-22 14:40:40 +00:00
Jaco Greeff 6938a7a202 Convert all remaining Modals to use Portal (UI consistency) (#4625)
* FirstRun dialog -> Portal

* CreateAccount Modal -> Portal

* CreateWallet dialog -> Portal

* Transfer dialog -> Portal

* Fix failing tests

* ShapeShift dialog -> Portal

* Verification dialog -> Portal

* EditMeta dialog -> Portal

* PasswordManager dialog -> Portal

* WalletSettings dialog -> Portal

* AddAddress dialog -> Portal

* s/delete address/forget address/

* AddContract dialog -> Portal

* DeployContract dialog -> Portal

* ExceuteContract dialog -> Portal

* LoadContract dialog -> Portal

* SaveContract dialog -> Portal

* UpgradeParity dialog -> Portal

* Convert inline modals (tsk, tsk)

* Remove ui/Modal

* Import dialog i18n

* Button array returns (thanks @derhuerst)

* Unneeded debug

* Typo

* Readability formatting
2017-02-22 15:26:58 +01:00
GitLab Build Bot 49675483c3 [ci skip] js-precompiled 20170222-095134 2017-02-22 09:56:05 +00:00
Robert Habermeier 636b2deb2e fix json tests 2017-02-22 10:52:58 +01:00
Jaco Greeff 5337bf6413 Default account selection update (#4609)
* Default accounts setting - account provider

* RPC support for default accounts

* Updating JS code

* Rename whitelist to addresses

* Set the defaults using default, allowing for null/full lists

* Update failing tests (after merge)

* Fix merge with wrong rpc call names

* One account needs to be selected
2017-02-22 10:43:02 +01:00
Jaco Greeff 0a85fc7a3e Display ETH balance in overlay account selector (#4588)
* Add account balance display from ParityBar

* Ellipsis with title

* Balance display in Dapp permissions

* Add balance to vault account selector

* Add key prop to accounts in Vault

* Fix failing test (missing redux prop)
2017-02-22 10:42:42 +01:00
Robert Habermeier fba4bda0ff Merge pull request #4627 from raingloom/patch-1
fixed minor grammar mistake in readme
2017-02-22 08:56:14 +01:00
Rain Gloom df414c8186 fixed minor grammar mistake in readme 2017-02-21 18:08:47 +01:00
Denis S. Soldatov aka General-Beck 502af0e29b [ci skip] update gitlab-ci
fix path to `tools`
add `tools` in `linux-stable-debian`
2017-02-21 16:42:18 +04:00
GitLab Build Bot 80155ef93a [ci skip] js-precompiled 20170221-120741 2017-02-21 12:12:14 +00:00
Jaco Greeff 61e3d036d9 Extract new available i18n strings (#4623) 2017-02-21 12:59:36 +01:00
Robert Habermeier 1fba73c15e minimal state backend trait
make state module public
2017-02-21 12:35:21 +01:00
Robert Habermeier ac9716a5ce state backend trait mirroring state_db API 2017-02-21 11:13:02 +01:00
Robert Habermeier d8b1cfe082 Merge branch 'master' into lightrpc 2017-02-20 18:01:29 +01:00
Robert Habermeier 62b340f2b9 Save pending local transactions in the database (#4566)
* Create new column family for local node info

* remove DBTransaction::new reliance on DB

* KeyValueDB trait

* InMemory KeyValueDB implementation

* journaldb generic over KVDB

* make most of `ethcore` generic over KVDB

* fix json tests compilation

* get all tests compiling

* implement local store (just for transactions)

* finish local store API, test

* put everything into place

* better test for skipping bad transactions

* fix warning

* update local store every 15 minutes

* remove superfluous `{}`s
2017-02-20 17:21:55 +01:00
GitLab Build Bot 00351374e4 [ci skip] js-precompiled 20170220-160616 2017-02-20 16:12:01 +00:00
Maciej Hirsz 0af2fb2a48 Merge pull request #4614 from ethcore/mh-bump-cid
Bump CID version to allow compilation on all platforms
2017-02-20 16:44:11 +01:00
maciejhirsz 649cedd818 Updated Cargo.lock 2017-02-20 16:42:09 +01:00
Jaco Greeff 9e210e5eda Vault Management UI (first round) (#4446)
* Add RPCs for parity_vault (create, open, list, etc.)

* WIP

* WIP

* WIP

* WIP (create should create)

* Create & close working

* WIP

* WIP

* WIP

* Open & Close now working

* WIP

* WIP

* Merge relevant changes from js-home

* Hover actions

* WIP (start of account assignment)

* Open, Close & Account assignment works

* Fix margins

* UI updates

* Update tests

* Add the parity_{get|set}VaultMeta calls

* Handle metadata

* Adjust padding in Open/Close modals

* moveAccounts take both in and out

* Adjust padding

* Fix stretch

* Optimize hover stretch

* pre-merge

* Cleanup variable naming (duplication)

* Rename Vault{Close,Open} -> Vault{Lock,Unlock}

* clearVaultFields uses setters

* TODO for small Portal sizes

* Vaults rendering tests

* .only

* libusb compile

* VaultCard rendering tests

* Update message keys (rename gone rouge)

* Display passwordHint op vault unlock

* Update failing tests

* Manually dispatch allAccountsInfo when move completed

* Open/Close always shows vault image in colour

* Password submit submits modal (PR comment)

* Add link to account
2017-02-20 16:40:01 +01:00
keorn ac6180a6fe seals_internally (#4613) 2017-02-20 16:35:53 +01:00
Jaco Greeff 44769fcd4a Show only known accounts/wallets/addresses on Home (#4612)
* Don't render unknown entries

* Only render non-null items

* Remove (now) invalid failing test
2017-02-20 16:34:38 +01:00
maciejhirsz 348559491a Bump CID version to allow compilation on all platforms 2017-02-20 16:34:16 +01:00
Tomasz Drwięga 72998d3ce3 Proper default accounts RPCs (#4580)
* Default accounts setting - account provider

* RPC support for default accounts

* Updating JS code

* Rename whitelist to addresses
2017-02-20 16:33:12 +01:00
Tomasz Drwięga 1949d44d0c Hash-fetch errors in case upstream returns non-200 (#4599) 2017-02-20 16:30:14 +01:00
Arkadiy Paronyan 0aad8a87ae Added pending transaction info to eth_getTransactionByHash (#4570)
* Return condition info for pending transactions

* Fixed warnings
2017-02-20 16:19:43 +01:00
Svyatoslav Nikolsky b9665c7cfe Secret store - initial version (#4567)
* initial secret store commit

* various fixes

* license

* (sstore, secstore) -> secretstore

* marked KeyServer trait as IPC-ready

* fixed style

* ignore requests with Origin header

* fixed tests

* fixed Origin header check
2017-02-20 16:13:21 +01:00
Denis S. Soldatov aka General-Beck 68a25d9e14 fix path to `tools` 2017-02-20 17:16:11 +04:00
GitLab Build Bot 31f5a1d205 [ci skip] js-precompiled 20170220-124210 2017-02-20 12:48:32 +00:00
Jaco Greeff 3fc29b9ae4 Handle invalid ABI retrieved from address_book gracefully (#4606)
* Handle invalid ABI gracefully

* Also include failed abi in log
2017-02-20 13:34:33 +01:00
Denis S. Soldatov aka General-Beck e86837b878 target `evmbin` -> `evm` 2017-02-20 15:25:53 +04:00
Robert Habermeier 998cb0d209 Merge pull request #4583 from ethcore/sstore-opt
Optimize key directory reloads
2017-02-17 22:27:07 +01:00
Robert Habermeier 4de208786d trace API stubs 2017-02-17 22:21:43 +01:00
Robert Habermeier 9e761ba2ea ParitySet stubs 2017-02-17 21:45:06 +01:00
Robert Habermeier 9316eb4ad3 (most of) parity RPC for light client 2017-02-17 21:38:43 +01:00
Denis S. Soldatov aka General-Beck 32023f1ea0 fix build path to `tools` 2017-02-17 23:33:14 +04:00
Denis S. Soldatov aka General-Beck 163e2af568 update Dockerfile for hub
nightly->latest
2017-02-17 22:11:35 +04:00
GitLab Build Bot 8c9c6744fc [ci skip] js-precompiled 20170217-171830 2017-02-17 17:24:47 +00:00
Nicolas Gotchac 04f3ee90d8 Revert Double Click (#4590) 2017-02-17 18:11:10 +01:00
Robert Habermeier 39237e9d15 Merge pull request #4545 from ethcore/mh-ipfs
IPFS MVP
2017-02-17 17:19:56 +01:00
Robert Habermeier 3b023c82b7 fetch gas price corpus from network when needed 2017-02-17 17:08:46 +01:00
Robert Habermeier 7a857a24ae use new histogram/corpus 2017-02-17 16:18:31 +01:00
Denis S. Soldatov aka General-Beck a3bbdce613 update Dockerfile for hub
refactoring + small fix
2017-02-17 19:03:40 +04:00
Robert Habermeier 59315b0cb7 stats utility in its own crate 2017-02-17 15:16:28 +01:00
Denis S. Soldatov aka General-Beck b35e852cb6 cargo fix 2017-02-17 15:46:43 +04:00
Arkadiy Paronyan c2540dc215 Check for matching session before deregistering (#4563) 2017-02-17 12:20:25 +01:00
Robert Habermeier 54c48d14ec Deprecate eth_compile* RPCs (#4577)
* Deprecate eth_compile* RPCs

* Add deprecation doc comments
2017-02-17 12:00:33 +01:00
Denis S. Soldatov aka General-Beck aca808b021 update Dockerfile
ENTRYPOINT ["/parity/parity"]
2017-02-17 13:48:37 +04:00
Denis S. Soldatov aka General-Beck 164f1cef81 remove `git pul` from hub Docker
[ci-skip]
2017-02-17 03:56:09 +04:00
NikVolf 92d8edc1a6 unique_repr, no default impl 2017-02-16 23:04:39 +03:00
NikVolf 444065e294 refactor hashing 2017-02-16 22:53:58 +03:00
Robert Habermeier 48cf591e66 integrate cache in on-demand 2017-02-16 20:46:59 +01:00
NikVolf 513cc6261a plug to store 2017-02-16 22:10:29 +03:00
Denis S. Soldatov aka General-Beck a9cc9ce140 docker build `no-cache`
[ci-skip]
2017-02-16 22:58:41 +04:00
maciejhirsz da696e4a1f Added support for contract code by hash.
This is done by requests sending CID with raw binary codec (0x55).
Note: this functionality is exactly the same as fetching state-trie
due to how db internals work in Parity atm.
2017-02-16 18:39:13 +01:00
Robert Habermeier 3b9741e9d8 Implement the basic data cache 2017-02-16 18:07:28 +01:00
GitLab Build Bot 062c55d51b [ci skip] js-precompiled 20170216-165434 2017-02-16 17:06:15 +00:00
Arkadiy Paronyan 301a707eaa Ledger signing fixed (#4578) 2017-02-16 17:45:12 +01:00
Jannis Redmann 7d890c0687 remove vertx from Webpack config (#4576) 2017-02-16 17:43:27 +01:00
Nicolas Gotchac b825c8e074 Better display of tags (#4564)
* WIP

* Update accounts on whitelist change in Parity Bar

* Fix AccountCard width in Parity Bar (Signer)

* Added AccountCard Example

* Use horizontal tags

* Better Tags display

* Scrollable tags

* Update PR Grumbles

* Fix tests (add tags)

* PR Grumble
2017-02-16 17:42:19 +01:00
Svyatoslav Nikolsky 00c843afea Added vaults support to `ethstore-cli` (#4532)
* added vaults support to ethstore-cli

* improved error message
2017-02-16 17:42:01 +01:00
Denis S. Soldatov aka General-Beck aa83603af8 typo fix in Dockerfile 2017-02-16 20:04:28 +04:00
Denis S. Soldatov aka General-Beck 4cd4572417 add tag ENV in Dockerfile 2017-02-16 20:03:13 +04:00
GitLab Build Bot 5bd1cf352b [ci skip] js-precompiled 20170216-154550 2017-02-16 15:50:43 +00:00
NikVolf 43ce5bef7e file list hash and test 2017-02-16 18:47:58 +03:00
Arkadiy Paronyan f2027c02ef Fixed fonts URLs (#4579) 2017-02-16 16:37:40 +01:00
NikVolf d4149b965e files list separate fn, sha3 of the list 2017-02-16 18:20:24 +03:00
Robert Habermeier 2b91c922c1 get signing network ID for light client 2017-02-16 16:08:58 +01:00
maciejhirsz 8d6275bf07 Only allow requests from Origin 127.0.0.1 2017-02-16 16:08:54 +01:00
maciejhirsz c4b4a22203 Rename `parity-ipfs` to `parity-ipfs-api` 2017-02-16 14:51:33 +01:00
maciejhirsz ad8e3f0230 Added CLI flags 2017-02-16 14:41:33 +01:00
GitLab Build Bot 39d4e46073 [ci skip] js-precompiled 20170216-125519 2017-02-16 12:59:57 +00:00
Jaco Greeff c14ecefa1d Explicitly set seconds to 0 from selector (#4559)
* Explicitly set seconds/milli to 0

* Use condition time & block setters consistently

* Fix failing test

* test for 0 ms & sec

* It cannot hurt, clone date before setting

* Prettier date test constants (OCD)
2017-02-16 13:47:51 +01:00
maciejhirsz 451cf42452 Adding CLI flags for IPFS 2017-02-15 20:29:29 +01:00
maciejhirsz 9cfa27830c Write output as chunks 2017-02-15 19:25:57 +01:00
Denis S. Soldatov aka General-Beck c808954413 clean Docker
[ci-skip]
2017-02-15 21:40:23 +04:00
Denis S. Soldatov aka General-Beck 34d8498a2c clean Docker
remove RUST tools from Docker
[ci-ckip]
2017-02-15 21:37:23 +04:00
maciejhirsz d005410e1a No .expect on mime types 2017-02-15 18:26:35 +01:00
Denis S. Soldatov aka General-Beck ff2c4d1178 add tools
add `evmbin`, `ethstore`, `ethkey` to the CI
2017-02-15 21:14:07 +04:00
maciejhirsz eb327338e8 Tests and grumbles 2017-02-15 18:07:30 +01:00
Denis S. Soldatov aka General-Beck 06937be74b add libudev-dev in deb
[ci-skip]
2017-02-15 20:09:47 +04:00
Tomasz Drwięga efb95a59be Fixing evmbin compilation and added standard build. (#4561) 2017-02-15 16:58:42 +01:00
Tomasz Drwięga 895298fc49 Alias for personal_sendTransaction (#4554) 2017-02-15 16:57:27 +01:00
Nikolay Volf 494a0de1e2 Key derivation in ethstore & rpc (#4515)
* initial in secret store

* generation

* test

* refactor of the derivation

* signing

* account provider

* tests for account provider

* rpc types

* rpc types converts

* rpc tests

* fix warnings

* some extra docs

* derivate -> derive

* secret() -> as_raw()

* secret() -> as_raw() in rpc

* fix merge bug

* align with new serde changes
2017-02-15 16:56:15 +01:00
GitLab Build Bot 4889cff310 [ci skip] js-precompiled 20170215-135145 2017-02-15 13:56:12 +00:00
Nicolas Gotchac 0d289c7732 Skip OOG check for simple transfers (#4550) (#4558) 2017-02-15 14:44:14 +01:00
Robert Habermeier 36ea5550ba Merge pull request #4501 from ethcore/light-txq
Light Client transaction queue, initial LightDispatcher
2017-02-15 14:06:31 +01:00
GitLab Build Bot b38a874b18 [ci skip] js-precompiled 20170215-124941 2017-02-15 12:54:04 +00:00
Nicolas Gotchac 4bae2c751c Fixes BadgeReg Middleware (#4547) (#4556) 2017-02-15 13:42:55 +01:00
Nicolas Gotchac 8aaa18d75d Fix pasting of value in Input fields (#4555)
* Fix logging and logger issues

* onPaste submit value + pasted text (#4553)
2017-02-15 13:37:58 +01:00
GitLab Build Bot 3218c365e9 [ci skip] js-precompiled 20170215-110429 2017-02-15 11:08:57 +00:00
Jaco Greeff efe76d7004 Tooltips with react-intl (#4549)
* Tooltips support intl strings

* FormattedMessage for strings to Tooltip

* Fix TabBar tooltip display

* r after o (PR comment)
2017-02-15 11:56:51 +01:00
GitLab Build Bot 812017f9b3 [ci skip] js-precompiled 20170214-215513 2017-02-14 22:00:39 +00:00
Nicolas Gotchac ac27806a43 Close on double-click for Signer Account selection (#4540)
* Close on double-click + Optimistic UX (#4525)

* PR Gumble + Tests
2017-02-14 22:47:34 +01:00
Tomasz Drwięga 5369a129ae Signer provenance (#4477)
* Signer - Tracking Request Provenance

* Basic UI

* Changing messages

* VecDeque::from

* Fix dapps tests

* Addressing UI grumbles
2017-02-14 22:45:43 +01:00
Tomasz Drwięga d925cc05da Fix console dapp (#4544)
* Fixing linting issues. Better support for console as secure app

* Fixing linting issues
2017-02-14 22:45:29 +01:00
maciejhirsz 2ee2d2ea45 Added missing GPL header 2017-02-14 20:03:25 +01:00
maciejhirsz 9256aa766b Lock file 2017-02-14 19:58:46 +01:00
maciejhirsz 3c634701dd Squashed 2017-02-14 19:30:37 +01:00
Robert Habermeier e591b4481b warning on detected inconsistency 2017-02-14 19:16:46 +01:00
GitLab Build Bot e9eed5206e [ci skip] js-precompiled 20170214-123602 2017-02-14 12:41:22 +00:00
Jaco Greeff 71c0cc867a Extract i18n string into i18n/_defaults (base of translations) (#4514)
* Build script to pull i18n into i18n/_default

* Fix header

* Current strings as extracted

* details_windows without prefix

* clean before build

* Alwasy extract babel strings

* clean & run build before extraction

* Update settings messages

* Put back template string (PR comment)

* PR comment cleanups & logging

* Less complicated string type check (PR comment)

* Remove node cache to extract all keys (Thanks @ngotchac)

* Merge in defaults from i18n/en (Comment by @h3ll0fr13nd)

* Unique index keys only

* Update with latest master strings

* _.defaultsDeep (Thanks to @dehurst)

* Use to-source for string formatting

* Sync with toSource output on latest master

* Updated to use/output sorted objects
2017-02-14 13:16:39 +01:00
Denis S. Soldatov aka General-Beck 7d12e383b2 windows build
switch to RUST stable
2017-02-14 16:09:19 +04:00
Nicolas Gotchac e8597e2e91 Fix contract queries bug (#4534)
* Fix contract queries and multiple Address Selector issues

* Linting

* Use standard new Error
2017-02-14 13:08:38 +01:00
Robert Habermeier 1d9db578ff ready transactions order documentation 2017-02-14 12:14:02 +01:00
Robert Habermeier 63ad8cb086 store pending transactions only once 2017-02-14 12:12:26 +01:00
Robert Habermeier e911fc2db9 address grumbles 2017-02-14 12:05:24 +01:00
GitLab Build Bot fefd53d4f4 [ci skip] js-precompiled 20170214-101112 2017-02-14 10:15:36 +00:00
Tomasz Drwięga bccd0991f6 Fixing namespace of couple methods in console. (#4538) 2017-02-14 13:03:23 +03:00
GitLab Build Bot dd0ef6b5ec [ci skip] js-precompiled 20170214-073623 2017-02-14 07:40:43 +00:00
Jaco Greeff 63d2cfcbfc Home landing page (#4178)
* Home entry point (basics)

* WIP store for web

* Add DappUrlInput component

* Updated tests

* WIP store update

* Adjust styling

* Add home tab

* Collapse first/last without extra divs

* Navigation actually navigates

* styling

* Encoding of ethlink.io URLs

* encodedUrl setup

* base58 encoded URLs

* Added decoding, updated tests to Parity-compliant

* Base32 (synced with Rust implementation via tests)

* Split URL into 63 character chunks

* Fix store test

* Cleanups

* s/ethlink/dapplink/

* Display app navigation & histroy

* Start on /accounts (for now, until expanded fully)

* Update tests

* ethlink.io -> web3.site

* Basic list layout

* Store history on navigation

* Show Accounts & Dapps

* Add skeleton for DappIcon (WIP)

* DappIcon WIP

* DappIcon in place

* Split into maneable sub-components

* WIP

* Tests for views/Home

* Swap default entry-point to /home

* Expose registry.get via lookupMeta

* Add getEntry interface, fix instance retrieval (with tests)

* Add news display component

* Add tests for added contracts/registry methods

* Fix GHH test refactoring

* render news via SectionList

* News items store directly

* Images

* News & Urls has new layout

* Convert remainder

* First run-through of MVP for SectionList

* Update tests

* Deploycontract should not override global p styles

* Allow styles overrides for head & body

* Adjust layout styling

* revert Container>flex

* Adjust sizes of history items

* Cleanups

* HistoryStore for tracking relevant routes

* Default route is still /accounts

* Fix tests

* Update 2015-2017

* Add lookupMeta & tests

* Add getEntry & tests

* Split Dapp icon into ui/DappIcon

* Update copyright dates

* Encoding for *.web3.site urls

* Dapp history retrieval

* Grow to only 40% on hover

* Update description

* Add DappUrlInput component

* Update Web views with store

* Update spec description

* Update spec description

* edited url does not allow in-place store edits

* Use /web/<hash> urls for iframe

* Removed (now) unused _list.css

* Mistamtched merge fixed

* Tab split (WIP)

* Split Tab component

* Update tests after merge

* typo

* Remove background !important

* Set item width to parent

* Set width, remove overflow-x: hidden

* Align hover overlays

* Container defaults to some opacity

* Display history from listRecentDapps

* Override styles for a tags

* Open URLs in new window when extension is available

* Fix tests after update

* AccountCard width 100%

* Re-add opening correct url in tab

* Cleanup link rendering

* Remove hardcoded news URL

* pre-merge

* Extra padding at Home bottom (Pr grumble)

* Match js-vaults stretch

* s/Web Apps via URL/Web Apps/ (PR grumble)

* Store recent wallets (PR grumble)

* Simplify inline style matching (PR comment)

* Add store for new retrieval

* Add missing observer

* Auto-link based on account type

* Fix UI overlaps

* Extra spacing

* Only show account when accountInfo is available

* Align timestamp line-heights

* Fix tests

* Update tests

* Really fix failing test (check for Connect(Account))
2017-02-14 08:29:32 +01:00
Nikolay Volf 78917d728d Bump JSON RPC crates versions (#4530)
* json rpc bump

* some error message deviations
2017-02-13 21:34:16 +03:00
Robert Habermeier 443e8d2aed Merge pull request #4531 from ethcore/bump-readme
Update rust version in README
2017-02-13 17:44:42 +01:00
Nikolay Volf 83a8ceb09b Update rust version in readme [ci skip] 2017-02-13 19:39:46 +03:00
Robert Habermeier 073ed1a87c lower default pruning history and memory (#4528)
--pruning-history: 1200 -> 64
--pruning-memory: 150 -> 75
2017-02-13 17:15:25 +01:00
Robert Habermeier 4f1afccf97 best_block_header function 2017-02-13 16:51:40 +01:00
Tomasz Drwięga f1e99ea2e4 Serde 0.9 (#4508)
* Porting json

* Dapps

* Rpc & Ethstore

* New ethabi

* Last bunch of fixes

* Fixing last test

* Removing build script

* Adding ethcore-ipc-tests back

* Fixing grumbles

* Fixing blockchain tests (inference regression?)
2017-02-13 18:38:47 +03:00
GitLab Build Bot a2c6cd8f7b [ci skip] js-precompiled 20170213-125552 2017-02-13 13:00:14 +00:00
Nicolas Gotchac b561ae7b12 Fixes to Token Deploy dapp (#4513)
* Renaming Basiccoin => Tokendeploy

* Rename Basiccoin => Tokendeploy

* UI and bug fixes to the TokenDeploy dapp

* Use decimals for Token Deployment #4311

* Typo

* PR Gumbles
2017-02-13 13:47:11 +01:00
Arkadiy Paronyan 1fa830d19b Fixed receipt decoding (#4521) 2017-02-13 12:14:05 +03:00
Denis S. Soldatov aka General-Beck 5f154b9f4b update Dockerfile
add libudev-dev
2017-02-11 20:48:45 +04:00
GitLab Build Bot 88b91b7e13 [ci skip] js-precompiled 20170210-173450 2017-02-10 17:39:23 +00:00
Nicolas Gotchac ace5c27211 Several fixes to the Wallet in general (#4504)
* Fix address non-ellipsis on Wallet view

* Add warning if daily limit has been reached

* Add OOG warnings to TxHash

* Fixes to the Warning

* Added stringified version of the changes

* Add wallet link for notifications

* Fix tests

* Use Formatted Messages

* React Intl

* s/ui.walletSettings/walletSettings in React Intl
2017-02-10 18:27:18 +01:00
Nicolas Gotchac da2e28dad1 Use the current contract name for Solidity compilation (#4510) 2017-02-10 18:26:52 +01:00
Robert Habermeier c7d83bd88a Merge branch 'master' into light-txq 2017-02-10 17:21:38 +01:00
Robert Habermeier 48ae38eaf9 Merge pull request #4485 from ethcore/lightrpc
Preparation for Light client RPC
2017-02-10 17:15:03 +01:00
GitLab Build Bot 51f74f8d80 [ci skip] js-precompiled 20170210-135944 2017-02-10 14:04:00 +00:00
Bas 325cd0ec0b Fix Dutch translation (#4509)
After compiling + running the recently added Dutch translation I found it didn't work as I had forgotten to add nl to store.js. Now it is working.
2017-02-10 14:52:36 +01:00
Robert Habermeier 2c43b02e13 Merge branch 'lightrpc' into light-txq 2017-02-10 14:31:17 +01:00
Robert Habermeier b8881215f1 Merge branch 'master' into lightrpc 2017-02-10 13:47:27 +01:00
Arkadiy Paronyan 8fd694ea47 Fixed a warning and bumbed libusb-sys (#4507) 2017-02-10 12:28:57 +01:00
GitLab Build Bot d36303365f [ci skip] js-precompiled 20170210-075200 2017-02-10 07:56:35 +00:00
Nicolas Gotchac aebb289ea9 Fix overflow on small screens (#4505) 2017-02-10 08:43:59 +01:00
Robert Habermeier 6bf97de9d8 Merge branch 'master' into lightrpc 2017-02-10 02:44:12 +01:00
GitLab Build Bot cb772acec7 [ci skip] js-precompiled 20170210-001706 2017-02-10 00:22:18 +00:00
Nicolas Gotchac 515f30eea9 Fix no data sent in TxQueue dapp (#4502)
* Fix wrong PropType req for Embedded Signer

* Fix wrong data for tx #4499
2017-02-09 19:07:35 -05:00
Arkadiy Paronyan a7e6d8727a Ledger wallet support (#4486)
* Ledger devices support

* structs for RPC types
2017-02-09 19:07:06 -05:00
Robert Habermeier 5e65081d4f remove accidental gap in next nonce 2017-02-09 22:37:56 +01:00
Robert Habermeier e53d023a8a implement light dispatcher 2017-02-09 21:12:28 +01:00
Robert Habermeier 53774d4792 Merge branch 'lightrpc' into light-txq 2017-02-09 20:41:42 +01:00
Robert Habermeier 0d09a473a7 remove let inner pattern with take_weakf and try_bf 2017-02-09 20:38:47 +01:00
Robert Habermeier 7be2c145de LightDispatcher definition 2017-02-09 20:22:31 +01:00
Robert Habermeier 325c6aaf6a verify raw transactions against Engine 2017-02-09 19:58:29 +01:00
Robert Habermeier a559dfe9a1 implement send_raw_transaction 2017-02-09 19:17:37 +01:00
Robert Habermeier baf0dbc6bf LightProvider struct using light transaction queue 2017-02-09 18:42:18 +01:00
Robert Habermeier 6a924770be add several tests + minor bugfixes 2017-02-09 18:10:59 +01:00
GitLab Build Bot 395a44e4a8 [ci skip] js-precompiled 20170209-165020 2017-02-09 16:54:35 +00:00
Nicolas Gotchac 71f84067d9 Add new Componennt for Token Images (#4496) (#4498) 2017-02-09 17:41:27 +01:00
Nicolas Gotchac 48eac51c8a Fix address and accounts links (#4491)
* Add proper links to TxRows (#4314)

* Add proper link to the Signer (#4314)

* Fix and add tests
2017-02-09 17:41:17 +01:00
Nicolas Gotchac 867a593988 Fix Token Reg Dapp issues in Firefox (#4489)
* Fix overflow issues in Firefox (#4348)

* Fix wrong Promise inferance

* Add new Componennt for Token Images (#4496)

* Revert "Add new Componennt for Token Images (#4496)"

This reverts commit 6ffbdab891f85e4d988e3e8e96fc2c651bd68e04.
2017-02-09 17:41:01 +01:00
Robert Habermeier 33266f78d1 initial transaction queue implementation 2017-02-09 17:36:12 +01:00
GitLab Build Bot 2043123db0 [ci skip] js-precompiled 20170209-161356 2017-02-09 16:17:57 +00:00
Jaco Greeff 7a627f88cb parity.js interfaces for vaults (#4497) 2017-02-09 11:07:08 -05:00
GitLab Build Bot c69f515597 [ci skip] js-precompiled 20170209-155632 2017-02-09 16:02:22 +00:00
Bas 8f6108fdc9 Initial Dutch translations (#4484)
* Create settings.js

* Create index.js

* Update constants.js

* Update languages.js
2017-02-09 10:48:36 -05:00
Svyatoslav Nikolsky 1534bbb7cb Fix key.meta.vault for root dir keys && read vault.meta without vault key (#4482)
* fix vault for root && read vault meta without key

* support for old vaults (wthout meta field)
2017-02-09 10:47:22 -05:00
Nikolay Volf fea76c07f0 Arbitrary labels for extended keys (u32, H256 built-in) (#4438)
* extend derivatino to arbitrary labels

* fix review

* fix more obsolete comments

* hard test for h256

* fix using only 4 bytes from hash
2017-02-09 10:44:28 -05:00
Arkadiy Paronyan 3da3e8453b Fixing ethstore build (#4492) 2017-02-09 10:42:49 -05:00
Svyatoslav Nikolsky f35517e213 fixed compilation (#4493) 2017-02-09 15:41:58 +01:00
GitLab Build Bot 1e47133b3f [ci skip] js-precompiled 20170209-143704 2017-02-09 14:41:10 +00:00
Nicolas Gotchac e8175f4cca Build embedded Parity JS properly and separatly (#4426)
* Add a specific embed webpack build // output assets in JSON

* WIP Embed

* Updated Webpack

* Update exports // Webpack config

* Fix app build fail

* Fix NPm scripts

* Reduce Embed dependencies

* Fix NPM exports

* remvoe stats

* Lazy-Load worker (not to load in embed)

* PR Grumbles + Fix tests
2017-02-09 15:30:57 +01:00
Robert Habermeier c83d27420c address grumbles 2017-02-09 15:10:14 +01:00
Robert Habermeier bce6bf92d9 simplify code 2017-02-09 15:01:15 +01:00
Robert Habermeier bcf0e23a4b take_weakf 2017-02-09 13:24:03 +01:00
Robert Habermeier 656c08976f Merge pull request #4487 from ethcore/snappy-static
Static link for snappy
2017-02-09 00:56:59 +01:00
arkpar cdc09a6d8a Static link for snappy 2017-02-08 22:43:23 +01:00
Robert Habermeier 869d193d21 Merge branch 'lightrpc' into light-txq 2017-02-08 20:51:11 +01:00
Robert Habermeier 49f49194c5 use Dispatcher when starting RPCs 2017-02-08 20:44:40 +01:00
Robert Habermeier 028dbe5fe2 rename get_header to block_header by convention 2017-02-08 20:22:41 +01:00
Robert Habermeier b3440babe3 light txq skeleton 2017-02-08 19:21:12 +01:00
Robert Habermeier 0246d5c734 Merge branch 'master' into lightrpc 2017-02-08 19:20:35 +01:00
Robert Habermeier dd9e3f21ad silence errors temporarily 2017-02-08 19:09:52 +01:00
Denis S. Soldatov aka General-Beck 8773889532 downgrade rust (windows build) 2017-02-08 22:06:09 +04:00
Robert Habermeier 3669d17390 fix tests with loop hack 2017-02-08 17:57:18 +01:00
Robert Habermeier 2ca61151ac squash some warnings 2017-02-08 16:59:04 +01:00
Robert Habermeier 5223e25aa6 use generic dispatcher everywhere, squash errors 2017-02-08 16:55:06 +01:00
Robert Habermeier e73ea80954 dispatcher abstraction, port most things to it 2017-02-08 15:36:53 +01:00
GitLab Build Bot 68b8724440 [ci skip] js-precompiled 20170208-134350 2017-02-08 13:49:08 +00:00
Jaco Greeff 0b3f97f792 Work with string numbers in contract (Fixes #4472) (#4478) 2017-02-08 08:38:27 -05:00
Svyatoslav Nikolsky a92bf65181 parity_getVaultMeta && parity_setVaultMeta (#4475) 2017-02-08 07:53:39 -05:00
keorn b0248cad0b sort corpus when hitting genesis (#4470) 2017-02-08 08:55:56 +01:00
Tomasz Drwięga 5fe993f658 Fixing CORS headers for parity.web3.site (#4461) 2017-02-07 18:11:42 -05:00
Robert Habermeier 4bb45c4f64 use new error-less on_demand 2017-02-07 23:25:17 +01:00
Arkadiy Paronyan 0e8b96a268 Update Dockerfile 2017-02-07 22:15:01 +01:00
Arkadiy Paronyan b171076215 Update Dockerfile 2017-02-07 22:14:34 +01:00
Arkadiy Paronyan 86dbd50957 Update README.md 2017-02-07 22:13:52 +01:00
Gav Wood 810ec3558a Make signing compatible with geth. (#4468) 2017-02-07 22:09:59 +01:00
GitLab Build Bot 428e8361ce [ci skip] js-precompiled 20170207-191009 2017-02-07 19:16:17 +00:00
Jaco Greeff 2411e674eb Fixing histogram again (#4464) (#4467) 2017-02-07 19:55:58 +01:00
Jaco Greeff 7bca4aa24f Handle registry not found errors (Fixes #4463) (#4465) 2017-02-07 19:42:21 +01:00
Robert Habermeier 1fa5b07321 Merge branch 'master' into lightrpc 2017-02-07 17:13:18 +01:00
Robert Habermeier 6c06a1a5ec expunge error types from OnDemand 2017-02-07 17:06:22 +01:00
Robert Habermeier 04fe72face reassign requests indefinitely 2017-02-07 16:49:14 +01:00
Robert Habermeier b37124991c enforce validity of on_demand requests 2017-02-07 16:13:56 +01:00
Robert Habermeier 9524ebbff1 on-demand contract code request 2017-02-07 15:29:38 +01:00
Robert Habermeier d253a9c864 uncle and tx count RPCs 2017-02-07 14:45:48 +01:00
GitLab Build Bot d341b49bad [ci skip] js-precompiled 20170207-120734 2017-02-07 12:11:54 +00:00
Jaco Greeff 83cf5fc068 Fix Portal scrolling getting stuck (#4455)
* Fix Portal scrolling getting stuck

* DappCard container flex

* Container height to 100%
2017-02-07 13:02:19 +01:00
GitLab Build Bot 1d774835de [ci skip] js-precompiled 20170207-075234 2017-02-07 07:56:44 +00:00
Jaco Greeff 66df4f6410 Fix AccountCard stretch to 100% (#4450) 2017-02-07 08:46:17 +01:00
Robert Habermeier 66692bc0e2 fast paths for block and receipts on_demand 2017-02-06 18:28:13 +01:00
Robert Habermeier 4172a5369c Include total difficulty in CHTs and hide implementation details from consumers (#4428)
* CHT builder and prover

* use CHT abstraction in provider

* hide CHT internals from header chain

* fix itertools conflict by updating all to 0.5

* cht proof checker, use it in on_demand
2017-02-06 17:21:35 +01:00
Robert Habermeier b32cb7a97d make total difficulty field optional 2017-02-06 15:28:16 +01:00
Maciej Hirsz 127baed385 Merge pull request #4362 from ethcore/mh-tendermintrlpfix
Fix RLP encoding for types recursively calling `RlpStream::append`
2017-02-06 11:13:40 +01:00
GitLab Build Bot d7e87dbe19 [ci skip] js-precompiled 20170206-083224 2017-02-06 08:36:28 +00:00
Tomasz Drwięga 4ac91b3284 Open popup without attempting inline (#4440)
* Open popup without attempting inline

* Cater for all .web3.site addresses
2017-02-06 09:26:11 +01:00
Svyatoslav Nikolsky 2f340a547a Vaults RPCs (#4366)
* vaults RPCs

* vault.password != vault_account.password

* moved vault RPCs to parityAccounts NS

* parity_listVaults + parity_listOpenedVaults
2017-02-05 10:17:56 -05:00
Nikolay Volf e257e4e3bd Ethkey - extended keys (#4377)
* data structures initial

* hard derivation

* tabs, docs

* more docs

* soft private derivation

* public derivation

* finalize api, fix warnings

* use simple new()

* keypair api

* bump byteorder

* doc tweaks

* remove heavyness from tests

* added test vector infrastructure and examples

* initialization from seed to key pair

* add comment about panic
2017-02-05 10:17:03 -05:00
Robert Habermeier def47b4042 make light module public 2017-02-05 15:22:15 +01:00
GitLab Build Bot f646ffbe61 [ci skip] js-precompiled 20170205-101133 2017-02-05 10:15:32 +00:00
Sebastian Kippe bcd3cd8467 Use secure websocket from HTTPS clients (#4436)
Currently, the unsecure `ws://` scheme is hardcoded. With this change,
the scheme will dynamically change to the secure `wss://` when the
frontend is requested from an HTTPS origin.
2017-02-05 11:04:17 +01:00
Denis S. Soldatov aka General-Beck 4fa1717a99 Update Dockerfile
remove --verbose from hub build
2017-02-05 02:56:19 +04:00
Denis S. Soldatov aka General-Beck c5cc5e30ec Update Dockerfile
fix build for docker hub
[ci skip]
2017-02-05 02:39:22 +04:00
Robert Habermeier 7c9064c856 Merge branch 'master' into lightrpc 2017-02-04 22:30:20 +01:00
Robert Habermeier 1e123f1b4d handle TD info in RPC layer 2017-02-04 22:22:57 +01:00
Tomasz Drwięga 248cd5e036 RPC middleware: Informant & Client.keep_alive (#4384)
* Adding RPC informant structs

* RPC informant

* Middleware counting RPC requests

* Moving client keep_alive to middleware
2017-02-04 22:18:19 +01:00
Robert Habermeier 3a7248b964 cht proof checker, use it in on_demand 2017-02-04 17:48:02 +01:00
Robert Habermeier 197695414e correct ready transaction condition 2017-02-04 17:19:39 +01:00
Robert Habermeier 484b93abdc Merge branch 'cht-td' into lightrpc 2017-02-04 17:14:47 +01:00
Robert Habermeier ca11138ce8 fix itertools conflict by updating all to 0.5 2017-02-04 17:07:39 +01:00
GitLab Build Bot d7b937fe88 [ci skip] js-precompiled 20170204-152807 2017-02-04 15:32:05 +00:00
Gav Wood 4553f517ce Fix eth_sign/parity_postSign (#4432)
* Fix dispatch for signing.

* Remove console log

* Fix signing & tests.
2017-02-04 16:00:28 +01:00
Jaco Greeff b4c24d5ab3 Web view with web3.site support (#4313)
* Web-domain based routing

* Support base32-encoded urls

* Proper support for non-domain based routing

* Handling long domain names

* Switching to web3.site

* Encoding for *.web3.site urls

* Add DappUrlInput component

* Update Web views with store

* Update spec description

* Update spec description

* edited url does not allow in-place store edits

* Fixing dapps access on 127.0.0.1:8180

* Use /web/<hash> urls for iframe

* Redirecting to parity.web3.site

* Disabling the redirection
2017-02-04 09:52:14 +01:00
GitLab Build Bot c9d38cac6e [ci skip] js-precompiled 20170203-221154 2017-02-03 22:18:13 +00:00
Jaco Greeff c7f5ee481d Extend Portal component with title, buttons & steps (as per Modal) (#4392)
* Allow Portal to take title & buttons props

* Fix tests

* Portal consistent in screen center

* Allow hiding of Close (e.g. FirstRun usage)

* Set overflow style on body based on open

* Don't lock scroll for child popups (overlaps)

* Override buttons to be white

* Expose ~/ui/Modal/Title as re-usable component

* Use ~/ui/Title to render the Title

* Update tests

* Added a portal example with buttons and steps

* Address PR comments

* Fix AddressSelect with new container withing container

* Move legend to "buttons"

* AddressSelect extra padding
2017-02-03 22:44:43 +01:00
GitLab Build Bot a68ca7444e [ci skip] js-precompiled 20170203-191721 2017-02-03 19:22:26 +00:00
GitLab Build Bot a39324632d [ci skip] js-precompiled 20170203-190642 2017-02-03 19:12:35 +00:00
Jaco Greeff f48d8b0ef6 Extension installation overlay (#4423)
* Extension installation overlay

* Pr gumbles

* Spelling

* Update Chrome URL
2017-02-03 20:01:49 +01:00
Jaco Greeff cd4d489b57 Add block & timestamp conditions to Signer (#4411)
* WIP

* WIP (with lint)

* Update ui/RadioButtons

* transaction.condition

* Date & Time selection in-place

* Swap to condition-only

* Fix tests, align naming

* Pick error properly from validation

* Update tests

* condition: time sent withough ms

* Format numbers as base-10

* override popup styles (zIndex)

* Pass condition to signer

* Update expectation (failing test typo)

* Adjust min/max height for expanded bar

* Fix address display

* Fix name display

* Number inputs for gas/gasPrice/blockNumber

* Default blockNumber to 1 (align with min setting)

* Update tests with min value

* Add Block Number

* Fix failing tests (after blockNumber intro)
2017-02-03 20:01:09 +01:00
Robert Habermeier 02142e3a57 Merge branch 'master' into cht-td 2017-02-03 19:56:52 +01:00
Robert Habermeier e874df5155 hide CHT internals from header chain 2017-02-03 19:50:23 +01:00
Arkadiy Paronyan 312aa72747 Transaction timestamp condition (#4419)
* Transaction timestamp condtiion

* Updated docs

* Updated docs

* Check agains last block timestamp
2017-02-03 19:32:10 +01:00
Robert Habermeier 1baa824d1e use CHT abstraction in provider 2017-02-03 18:47:03 +01:00
Robert Habermeier fc8e9e39ec CHT builder and prover 2017-02-03 18:38:28 +01:00
Robert Habermeier e460421deb generic basic account fetcher, nonce RPC 2017-02-03 17:53:48 +01:00
Robert Habermeier 024e69138a get it compiling 2017-02-03 17:41:25 +01:00
Robert Habermeier 9328067eac start eth RPC API for light client 2017-02-03 16:20:43 +01:00
Robert Habermeier 1dc957e3a5 allow genesis block to be latest 2017-02-03 16:11:09 +01:00
Robert Habermeier 83de16da88 use encoded::Header in HeaderChain 2017-02-03 15:32:22 +01:00
GitLab Build Bot 85e9091b29 [ci skip] js-precompiled 20170203-133154 2017-02-03 13:36:20 +00:00
Jaco Greeff f48a2df6e5 Poll for defaultAccount to update dapp & overlay subscriptions (#4417)
* Poll for defaultAccount (Fixes #4413)

* Fix nextTimeout on catch

* Store timers

* Re-enable default updates on change detection
2017-02-03 14:24:23 +01:00
GitLab Build Bot d1728cca28 [ci skip] js-precompiled 20170203-131026 2017-02-03 13:16:08 +00:00
Tomasz Drwięga 853aae2b92 Validate dapps accounts with address book (#4407)
* Parametrize address book

* Improving types in account_provider

* Filtering dapps_accounts

* Fixing RPC tests
2017-02-03 13:56:47 +01:00
Jaco Greeff acf41d6f27 Dapps use defaultAccount instead of own selectors (#4386)
* Remove account selection from GitHubHint

* Fix naming

* Update to match BasicCoin

* BasicCoin defaultAddress

* typo

* method registry without selector

* Update after manual tests

* IdentityIcon for localtx

* Fix non-secure personal subscriptions

* Query defaultAccount for non-secure apps on send
2017-02-03 13:54:53 +01:00
Denis S. Soldatov aka General-Beck 3af45c6ad9 update depends
Depends: libssl1.0.0 (>=1.0.0)
[ci skip]
2017-02-03 14:47:29 +04:00
Denis S. Soldatov aka General-Beck 0bf9f6c444 change depends
libssl (>=1.0.0)
[ci skip]
2017-02-03 13:17:10 +04:00
keorn 76c39e3e66 Fix lock and rename tracing (#4403)
* tracing, timeouts

* remove env_logger
2017-02-02 19:11:43 +01:00
Tomasz Drwięga 015425d447 Restarting fetch client every now and then (#4399) 2017-02-02 19:11:28 +01:00
GitLab Build Bot 4961422523 [ci skip] js-precompiled 20170202-163010 2017-02-02 16:33:24 +00:00
Maciej Hirsz 1b1d3a297c Perform a sync between Rust and JS when generating markdown instead of in spec tests (#4408)
* Sync RPC on npm run build:markdown

* Helpers

* Added GPL headers
2017-02-02 17:24:15 +01:00
Jannis Redmann d5aa139e46 registry dapp: make lookup use lower case (#4409) 2017-02-02 17:23:58 +01:00
Robert Habermeier 3b9ac7648c with_context on LightSync 2017-02-02 17:02:46 +01:00
GitLab Build Bot a0ffb3df20 [ci skip] js-precompiled 20170202-150718 2017-02-02 15:11:11 +00:00
Jaco Greeff 535ebb1f2f Available Dapp selection alignment with Permissions (Portal) (#4374)
* Manage default accounts

* Portal

* Portal

* Allow Portal to be used in as both top-level and popover

* modal/popover variable naming

* Move to Portal

* export Portal in ~/ui

* WIP

* Tags handle empty values

* Export AccountCard in ~/ui

* Allow ETH-only & zero display

* Use ui/Balance for balance display

* Add tests for Balance & Tags component availability

* WIP

* Default overlay display to block (not flex)

* Revert block

* WIP

* Add className, optional handlers only

* WIP

* Properly handle optional onKeyDown

* Selection updated

* Align margins

* Remove old code

* Remove debug logging

* TransitionGroup for animations

* No anim

* Cleanups

* Revert addons removal

* Fix tests

* WIP

* Add onClick to Container

* Create ui/DappCard component

* WIP

* Pass dummy displayApps

* Rename DappsVisible back to AddDapps (easier git diff)

* Rename CSS

* Fix tests after merge
2017-02-02 16:02:45 +01:00
Jannis Redmann 1547af191b more permissive verification process (#4317)
* style fixes 

* verification: find last request

* verification: don't request again if same input

* didRequestWithSameValues -> shallRequestAgain

* bugfixes 🐛, update SMS verification ABI

* verification: hasRequested -> accountHasRequested

* verification: hasIsVerified -> accountIsVerified

* verification: shallRequestAgain -> shallSkipRequest

* verification: show if unable to send req

* email verification: check if email already used

* address style grumbles 🎨
2017-02-02 16:01:37 +01:00
Robert Habermeier fd44dcda15 rename LES protocol ID 2017-02-02 15:22:38 +01:00
GitLab Build Bot 8e82b2f631 [ci skip] js-precompiled 20170202-125420 2017-02-02 12:57:45 +00:00
Jaco Greeff 12bd207e53 Fix ParityBar account selection overflows (#4405) 2017-02-02 13:30:36 +01:00
arkpar 2b26f0cc28 Fixing yaml script 2017-02-02 13:24:44 +01:00
Arkadiy Paronyan 5817acb582 Mac binaries signing (#4397) 2017-02-02 11:55:20 +01:00
Denis S. Soldatov aka General-Beck 0a28b167a2 Merge pull request #4398 from ethcore/revert-4381-js-ci-skip
Revert "remove [ci skip]"
2017-02-02 13:47:17 +04:00
Denis S. Soldatov aka General-Beck bc704283a4 Revert "remove [ci skip]" 2017-02-02 13:35:34 +04:00
GitLab Build Bot 3d4545fa91 js-precompiled 20170201-231534 2017-02-01 23:19:04 +00:00
GitLab Build Bot 85f75d39b3 js-precompiled 20170201-225215 2017-02-01 22:55:51 +00:00
GitLab Build Bot 52f40042b0 js-precompiled 20170201-222816 2017-02-01 22:31:43 +00:00
GitLab Build Bot b8c0d657b4 js-precompiled 20170201-220650 2017-02-01 22:10:13 +00:00
GitLab Build Bot ffb5ddc08b js-precompiled 20170201-214512 2017-02-01 21:48:38 +00:00
GitLab Build Bot 35e267c4fe js-precompiled 20170201-212208 2017-02-01 21:25:32 +00:00
GitLab Build Bot 43baa461b0 js-precompiled 20170201-205737 2017-02-01 21:01:07 +00:00
GitLab Build Bot 7fae67785c js-precompiled 20170201-203408 2017-02-01 20:37:33 +00:00
GitLab Build Bot 09e933a450 js-precompiled 20170201-200611 2017-02-01 20:09:34 +00:00
GitLab Build Bot 71190f6068 js-precompiled 20170201-194205 2017-02-01 19:45:25 +00:00
Jaco Greeff bd0891c93c Typo, fixes #4271 (#4391) 2017-02-01 20:36:05 +01:00
GitLab Build Bot 2f299d20e8 js-precompiled 20170201-185153 2017-02-01 18:55:16 +00:00
GitLab Build Bot bc73416e45 js-precompiled 20170201-182335 2017-02-01 18:27:32 +00:00
GitLab Build Bot 22f0d648c7 js-precompiled 20170201-174728 2017-02-01 17:50:56 +00:00
GitLab Build Bot 6b77d10cac js-precompiled 20170201-172305 2017-02-01 17:26:30 +00:00
GitLab Build Bot 12c1434f09 js-precompiled 20170201-165339 2017-02-01 16:58:21 +00:00
GitLab Build Bot 653bb112bf js-precompiled 20170201-162404 2017-02-01 16:27:37 +00:00
Tomasz Drwięga 4462c18690 Fixing invalid address in docs (#4388) 2017-02-01 17:14:16 +01:00
arkpar dbafbc29be Killed travis and appveyor 2017-02-01 17:06:44 +01:00
Denis S. Soldatov aka General-Beck 1a8ce3e1f3 Merge pull request #4381 from ethcore/js-ci-skip
remove [ci skip]
2017-02-01 19:59:26 +04:00
GitLab Build Bot 8e35b2c39a [ci skip] js-precompiled 20170201-152542 2017-02-01 15:29:43 +00:00
Tomasz Drwięga fb7c6c2867 Fixing estimate gas in case histogram is not available (#4387) 2017-02-01 16:18:22 +01:00
Jaco Greeff 3bdd32f9ec Default Account selector in Signer overlay (#4375)
* Manage default accounts

* Portal

* Portal

* Allow Portal to be used in as both top-level and popover

* modal/popover variable naming

* Move to Portal

* export Portal in ~/ui

* WIP

* Tags handle empty values

* Export AccountCard in ~/ui

* Allow ETH-only & zero display

* Use ui/Balance for balance display

* Add tests for Balance & Tags component availability

* WIP

* Default overlay display to block (not flex)

* Revert block

* WIP

* Add className, optional handlers only

* WIP

* Properly handle optional onKeyDown

* Selection updated

* Align margins

* Remove old code

* Remove debug logging

* TransitionGroup for animations

* No anim

* Cleanups

* Revert addons removal

* Fix tests

* defaultAccount

* Selection actually selects

* WIP tests

* tests WIP

* Expand tests

* Container for scrollbars

* Add parity_defaultAccount RPC (with subscription)

* Add jsonrpc interface
2017-02-01 16:18:11 +01:00
GitLab Build Bot a414729de9 [ci skip] js-precompiled 20170201-142626 2017-02-01 14:29:49 +00:00
Tomasz Drwięga 5526a3a228 Fixing web3 in console (#4382) 2017-02-01 15:19:23 +01:00
GitLab Build Bot f4a761edb7 [ci skip] js-precompiled 20170201-140028 2017-02-01 14:05:19 +00:00
Jaco Greeff 04fb2afba1 Add parity_defaultAccount RPC (with subscription) (#4383)
* Add parity_defaultAccount RPC (with subscription)

* Add jsonrpc interface
2017-02-01 14:52:15 +01:00
Denis S. Soldatov aka General-Beck 0a7aef1872 remove [ci skip]
remove tag [ci skip] for `js-precompiled`
2017-02-01 15:09:13 +04:00
Maciej Hirsz ed09a76c91 Full JSON-RPC docs + sync tests. (#4335)
* Extended Markdown generator

* Synced and extended all JSON-RPC interfaces

* Fix linter errors

* Format `parity_listAccounts` output in API

* typo

* Check if interfaces are synced in JS spec tests

* Fixing missing interface errors

* Better #[rpc] attribute parsing

* Fixed RPC JS spec tests

* More examples

* Refactored how dummy data appears in examples

* Complete trace docs!

* fix typo

* Less copy-paste

* All the docs!

* Fix differences between CallRequest and TransactionRequest

* Fix differences between CallRequest and TransactionRequest

* Missing examples

* Grumble fixes
2017-02-01 10:58:09 +01:00
maciejhirsz 687ae4d7fa Removed fixed TODO 2017-02-01 10:38:01 +01:00
Denis S. Soldatov aka General-Beck b2ecf1c5a4 Update gitlab-ci.yml
try to add `nightly` tag
2017-01-31 20:39:11 +04:00
GitLab Build Bot 867ca0f96c [ci skip] js-precompiled 20170131-163220 2017-01-31 16:35:42 +00:00
Jannis Redmann 5217469e85 expose util as Api.util (#4372) 2017-01-31 17:25:42 +01:00
GitLab Build Bot f1995b3fb0 [ci skip] js-precompiled 20170131-161018 2017-01-31 16:13:39 +00:00
Jaco Greeff a935a04449 Dapp Account Selection & Defaults (#4355)
* Manage default accounts

* Portal

* Portal

* Allow Portal to be used in as both top-level and popover

* modal/popover variable naming

* Move to Portal

* export Portal in ~/ui

* WIP

* Tags handle empty values

* Export AccountCard in ~/ui

* Allow ETH-only & zero display

* Use ui/Balance for balance display

* Add tests for Balance & Tags component availability

* WIP

* Default overlay display to block (not flex)

* Revert block

* WIP

* Add className, optional handlers only

* WIP

* Properly handle optional onKeyDown

* Selection updated

* Align margins

* Remove old code

* Remove debug logging

* TransitionGroup for animations

* No anim

* Cleanups

* Revert addons removal

* Fix tests

* Pr gumbles
2017-01-31 17:04:41 +01:00
GitLab Build Bot 12aadc3e2a [ci skip] js-precompiled 20170131-155752 2017-01-31 16:01:16 +00:00
Jaco Greeff d3ee15c6fb Publish @parity/jsonrpc (#4365)
* Add npm/jsonrpc

* Allow ci:build:jsonrpc

* Publish @parity/jsonrpc
2017-01-31 16:52:48 +01:00
GitLab Build Bot 983a0e3d0b [ci skip] js-precompiled 20170131-132131 2017-01-31 13:24:45 +00:00
Gav Wood 75ecabbd28 Fix signing (#4363)
* Fix signing.

* Fix linting.

* Fix linting.

* Address grumble.
2017-01-31 14:15:08 +01:00
GitLab Build Bot 27d00f6eca [ci skip] js-precompiled 20170131-113939 2017-01-31 11:42:56 +00:00
Tomasz Drwięga aaed67cfaf Fixing embedded bar not closing in chrome extension (#4367) 2017-01-31 12:34:55 +01:00
GitLab Build Bot b864d0f6ec [ci skip] js-precompiled 20170131-112711 2017-01-31 11:30:36 +00:00
Jaco Greeff 223c474487 Update AccountCard for re-use (#4350)
* Tags handle empty values

* Export AccountCard in ~/ui

* Allow ETH-only & zero display

* Use ui/Balance for balance display

* Add tests for Balance & Tags component availability

* Add className, optional handlers only

* Remove debug logging

* AccountCard UI update
2017-01-31 12:21:50 +01:00
GitLab Build Bot ee906467ad [ci skip] js-precompiled 20170131-104521 2017-01-31 10:50:22 +00:00
Nicolas Gotchac b3a23480de Add proper event listener to Portal (#4359) 2017-01-31 11:38:53 +01:00
Tomasz Drwięga 9fb2be8f2b Optional from field in Transaction Requests (#4332)
* Infering default account when sending transactions if not provided

* Fixing test

* Fixing tests code

* Fixes.

* More fixes.

* Final fix.
2017-01-30 21:08:36 +01:00
maciejhirsz 681fa10d4b Tests checking item sizes for changed types 2017-01-30 20:01:32 +01:00
maciejhirsz 6795068ea4 Fixed other types 2017-01-30 19:13:35 +01:00
Nikolay Volf 4a404a6f33 Update README.md (#4361) 2017-01-30 18:47:12 +01:00
maciejhirsz 5fe54901e7 Fix `Step` encoding 2017-01-30 18:13:14 +01:00
Robert Habermeier 5b2b4717f6 fix earliest_era on empty db (#4316) 2017-01-30 17:20:41 +01:00
GitLab Build Bot 00c4c71176 [ci skip] js-precompiled 20170130-161417 2017-01-30 16:17:36 +00:00
Arkadiy Paronyan 43cc4ea13d Fixed deadlock in external_url (#4354) 2017-01-30 17:08:21 +01:00
Jaco Greeff 15ffd9a09c Allow Portal to be used as top-level modal (#4338)
* Portal

* Allow Portal to be used in as both top-level and popover

* modal/popover variable naming

* export Portal in ~/ui

* Properly handle optional onKeyDown

* Add simple Playground Example
2017-01-30 17:08:08 +01:00
GitLab Build Bot 4e7b8652c8 [ci skip] js-precompiled 20170130-142718 2017-01-30 14:30:42 +00:00
Gav Wood ca196d683e Fix postsign (#4347)
* Fix whitespace.

* Fix post sign.

* Fix message.

* Fix tests.

* Rest of the problems.

* All hail the linter and its omniscience.

* ...and its divine omniscience.

* Grumbles and wording.
2017-01-30 15:08:02 +01:00
GitLab Build Bot 5a18ed7c3e [ci skip] js-precompiled 20170130-121240 2017-01-30 12:16:02 +00:00
Tomasz Drwięga 3fb445e198 Renaming signAndSendTransaction to sendTransaction (#4351) 2017-01-30 12:49:08 +01:00
GitLab Build Bot f627bef08b [ci skip] js-precompiled 20170130-110455 2017-01-30 11:08:16 +00:00
Jaco Greeff c0468faf58 Add api.util.encodeMethodCall to parity.js (#4330)
* Add api.util.encodeMethodCall

* Update spec description path, strip hex

* Remove options, add encodeMethodCall(name, inputs) signature

* Simplify interface with types-only inputs

* Add abiEncode & abiDecode functions
2017-01-30 11:57:55 +01:00
Svyatoslav Nikolsky 9ac4d83ca3 Initial commit for vaults (#4312)
* initial commit for vaults

* fixed TODO

* public docs

* vault_file.json now contains enc(pwd hash)

* removed doc
2017-01-30 13:44:09 +03:00
Tomasz Drwięga bf1e7ecfcb Returning default account as coinbase + allow altering sender in signer (#4323)
* Returning first address as coinbase

* Allowing sender alteration in signer

* Adding default account RPC
2017-01-30 11:10:58 +01:00
Tomasz Drwięga cf348dae60 Persistent tracking of dapps (#4302)
* Tests for RPC

* Extracting dapp_id from Origin and x-parity-origin

* Separate type for DappId

* Persistent tracking of recent dapps

* Fixing tests

* Exposing dapp timestamps

* Fixing import to work on stable

* Fixing test again
2017-01-30 10:59:46 +01:00
Tomasz Drwięga 47e1c5e2f1 Exposing all RPCs over dapps port as CLI option (#4346)
* Exposing all RPC over dapps port as CLI option

* Fix test.
2017-01-30 10:46:50 +01:00
Arkadiy Paronyan 089da2a24a New macOS App (#4345) 2017-01-29 20:22:45 +01:00
GitLab Build Bot b4dab67f83 [ci skip] js-precompiled 20170127-210258 2017-01-27 21:06:16 +00:00
Jaco Greeff aef699ebf2 Display QrCode for accounts, addresses & contracts (#4329)
* Display QrCode for accounts, addresses & contracts

* Default size 4

* Fix layouts
2017-01-27 21:55:20 +01:00
GitLab Build Bot 5246d51a1a [ci skip] js-precompiled 20170127-143849 2017-01-27 14:42:01 +00:00
Jaco Greeff cb8fea3b5a Add QrCode & Copy to ShapeShift (#4322)
* Extract CopyIcon to ~/ui/Icons

* Add copy & QrCode address

* Default size 4

* Add bitcoin: link

* use protocol links applicable to coin exchanged

* Remove .only
2017-01-27 15:33:02 +01:00
GitLab Build Bot e81787da34 [ci skip] js-precompiled 20170127-134933 2017-01-27 13:53:09 +00:00
Jaco Greeff 076c8b9de7 parity.js api.parity.chainStatus should handle { blockGap: null } (#4327)
* Add tests for null blockGap values

* Handle null blockGap values
2017-01-27 14:42:22 +01:00
Jaco Greeff 1940809dd4 DeleteAccount & LoadContract modal updates (#4320)
* i18n & tests for DeleteAccount

* i18n & tests for LoadContract
2017-01-27 14:42:06 +01:00
Jaco Greeff b51b7849dc Split Tab from TabBar (#4318)
* Tab split (WIP)

* Split Tab component
2017-01-27 14:41:41 +01:00
GitLab Build Bot da032e950f [ci skip] js-precompiled 20170126-165810 2017-01-26 17:01:54 +00:00
Jaco Greeff b74f2d8831 Contracts interface expansion (#4307)
* Add lookupMeta & tests

* Add getEntry & tests

* Formatting

* Remove unneeded .then(console.log)
2017-01-26 17:51:35 +01:00
GitLab Build Bot f5a73ff4c8 [ci skip] js-precompiled 20170126-164625 2017-01-26 16:49:41 +00:00
Jaco Greeff 7f3b1bd31e HistoryStore for tracking relevant routes (#4305)
* HistoryStore for tracking relevant routes

* Default route is still /accounts

* Fix copyright date-merge issue
2017-01-26 17:37:52 +01:00
GitLab Build Bot 3e2d95b272 [ci skip] js-precompiled 20170126-152421 2017-01-26 15:28:00 +00:00
Jaco Greeff 5ad50ab1e3 Split Dapp icon into ui/DappIcon (#4308) 2017-01-26 16:17:30 +01:00
Nicolas Gotchac e19c28bb8e Add a Playground for the UI Components (#4301)
* Playground // WIP

* Linting

* Add Examples with code

* CSS Linting

* Linting

* Add Connected Currency Symbol

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017

* Added `renderSymbol` tests

* PR grumbles

* Add Eth and Btc QRCode examples

* 2015-2017

* Add tests for playground

* Fixing tests
2017-01-26 16:15:49 +01:00
Jaco Greeff 2ac7655355 Update CreateWallet with FormattedMessage (#4298)
* Allow FormattedMessage as hint & label

* tests for basic rendering

* convert component messages

* Typo

* id typos (insubstantial, but annoying)

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017

* 2015-2017
2017-01-26 16:11:04 +01:00
Denis S. Soldatov aka General-Beck 82a7a17e6e Update README.MD
Remove Travis CI badge
2017-01-26 19:06:48 +04:00
Denis S. Soldatov aka General-Beck b5f46f3976 Update README.MD
Update Gitlab CI badge
2017-01-26 17:03:37 +04:00
GitLab Build Bot 79481b8ab5 [ci skip] js-precompiled 20170126-082319 2017-01-26 08:26:31 +00:00
Jaco Greeff 63e7379d5b Update copyright dates (#4306) 2017-01-26 09:17:38 +01:00
Arkadiy Paronyan c012dfc3ef EIP-98: Optional transaction state root (#4296)
* EIP98: Optional receipt state root

* Use if-else

* Fixing tests
2017-01-25 20:22:48 +01:00
Denis S. Soldatov aka General-Beck f5a4b55dae Update gitlab-ci
Fix CI lint errors
2017-01-25 23:01:28 +04:00
Denis S. Soldatov aka General-Beck c03be11303 Update gitlab-ci
[ci skip] Add `docker` build stage for automated build tagged images and push it to hub.docker.com
2017-01-25 22:48:36 +04:00
Denis S. Soldatov aka General-Beck 0fe6b40e68 Dockerfile for docker hub
[ci skip] automated build on docker hub. tags only
2017-01-25 22:25:52 +04:00
GitLab Build Bot 0c913b45b2 [ci skip] js-precompiled 20170125-181524 2017-01-25 18:18:28 +00:00
Gav Wood 8404edb656 Fix whitespace (#4299)
* Fix whitespace.

* Update copyright years/owner.

* Push release only for tags.
2017-01-25 18:51:41 +01:00
Denis S. Soldatov aka General-Beck e672e6c5d6 Update gitlab-ci
[ci-skip] Remove `triggers` from stage `push-release`
2017-01-25 19:03:28 +04:00
GitLab Build Bot 33b02febed [ci skip] js-precompiled 20170125-132524 2017-01-25 13:28:44 +00:00
Gav Wood 3125e2d2cc Attempt to fix console. (#4294)
* Attempt to fix console.

* Fixing couple of possible exceptions
2017-01-25 14:10:35 +01:00
GitLab Build Bot afa1edbeee [ci skip] js-precompiled 20170125-112240 2017-01-25 11:25:48 +00:00
Jaco Greeff 380c0773d1 ui/SectionList component (#4292)
* array chunking utility

* add SectionList component

* Add TODOs to indicate possible future work

* Add missing overlay style (as used in dapps at present)
2017-01-25 12:16:04 +01:00
Nikolay Volf 1acc8031ce Stratum up (#4233)
* flush work

* flush work

* flush work

* flush work

* generalized notifiers

* general setup with modules

* general setup with modules

* all binded

* catch up with master

* all dependencies injected

* stratum another up

* tcp update

* submitwork routine

* finalize & fix warnings

* merge bugs, review fixes

* merge bugs, review fixes

* new cli mess cleanup

* usage.txt swap

* flush work

* cli adopt

* compilation with new cli sorted

* subid space in json

* serialization issues

* grumbles addressed

* more grumbles

* remove last_work note for now

* fix compilation

* fix tests

* merge bugs

* no obliged ipc

* moving notifiers

* no optional feature now

* refactored again

* working on tests

* refactor to new tcp/ip

* stratum lib ok

* ethcore crate ok

* wip on tests

* final test working

* fix warnings, \n-terminated response

* new compatibility

* re-pushing work once anybody submitted

* various review and general fixes

* reviewe fixes

* remove redundant notifier

* one symbol -> huge bug

* ensure write lock isn't held when calling handlers

* extern declarations moved

* options to stratum mod, SocketAddr strongly-typed instantiation

* Minor style fix.

* Whitespace and phrasing

* Whitespace
2017-01-25 11:03:36 +01:00
Tomasz Drwięga 67284cc1a2 Logging transaction duration (#4297)
* Logging transaction duration

* Printing time also on heavy transactions [ci:skip]
2017-01-25 11:02:03 +01:00
GitLab Build Bot 5e18daf29e [ci skip] js-precompiled 20170124-211147 2017-01-24 21:15:10 +00:00
keorn e9251a9325 Generic engine utilities (#4258)
* move modules up

* make structs generic

* reound to view and tests

* fix
2017-01-24 22:03:03 +01:00
Maciej Hirsz a58fad06a7 JSON-RPC interfaces with documentation (#4276)
* Extended Markdown generator

* Synced and extended all JSON-RPC interfaces

* Fix linter errors

* Format `parity_listAccounts` output in API

* typo
2017-01-24 22:02:52 +01:00
keorn c460aec646 Dont decode seal fields (#4263)
* dont decode seal

* add get_block test
2017-01-24 21:57:29 +01:00
GitLab Build Bot b0e7cd5c9d [ci skip] js-precompiled 20170124-194135 2017-01-24 19:44:54 +00:00
Jaco Greeff 75c2588920 Skip misbehaving test until properly fixed (#4283) 2017-01-24 19:35:01 +00:00
Tomasz Drwięga fa02b3ae54 Additional logs for own transactions (#4278) 2017-01-24 19:18:52 +00:00
Robert Habermeier b739704902 ensure write lock isn't held when calling handlers (#4285) 2017-01-24 19:15:59 +00:00
Gav Wood 73b67da3cf No need for geth compat by default. 2017-01-24 20:11:42 +01:00
GitLab Build Bot 7b7b552ed4 [ci skip] js-precompiled 20170124-162740 2017-01-24 16:30:59 +00:00
Jaco Greeff 155bbc328f Feature selector (#4074)
* WIP

* ParityBar verification

* import from index.js

* i18n expansion & tests

* Features component

* Adapt language selector to use features

* Add features to settings view

* typo

* Convert logging

* Fix earlier merge issues resulting in test failures

* Lint failure fixes (new rules)

* Fix additional listing rules

* Re-add FormattedMessage (missing after merge), fix tests

* Fix loader overrides

* grumble: split item rendering (& test)

* grumble: allow enable/disable while testing (default on)

* grumble: move LanguageSelector below Features

* grumble: don't pass visiblity prop (& update tests)

* grumble: missing observable (onClick misbehaving)

* grumble: don't reset to defaults per session

* Fix to single store instance
2017-01-24 17:20:10 +01:00
GitLab Build Bot 5b2dd8deb2 [ci skip] js-precompiled 20170124-152454 2017-01-24 15:28:00 +00:00
Jaco Greeff 06433033d9 AccountCreate updates (#3988)
* Add esjify for mocha + ejs

* First pass through, intl + basic smoketests

* Create store

* Update for renames

* Pass store around

* createType into store

* Move stage into store

* Update labels

* Define stages

* address into store

* Add @observer

* Retrieve name from store

* Store phrase in store

* isWindowsPhrase into store

* gethAddresses to store

* Store manages geth addresses

* passwordHint into store

* Fix build

* rawKey into store

* import json files

* name set direct from component

* No parent change callbacks

* canCreate from store

* createAccounts into store

* expand create tests

* Windows phrase testcases

* Properly bind newError

* FirstRun use of new CreateAccount

* Add fix & test for selectedAddress match

* Call into store from props

* onChangeIdentity fix & test

* Phrase set fix & test

* RecoveryPhrase tested manually (issues addressed via tests)

* Hex import manual test (& tests added for errors)

* New eslint update fixes

* grumble: set default type from store (with test)

* grumble: pass copy of accounts (observable injection)

* grumble: Summary owners can be array or array-like
2017-01-24 16:18:23 +01:00
GitLab Build Bot 153f2ca2f2 [ci skip] js-precompiled 20170124-151134 2017-01-24 15:14:38 +00:00
Maciej Hirsz a30a108ac9 Extended JS interface -> Markdown generator (#4275)
* Extended Markdown generator

* Fix linter errors

* Review fixes
2017-01-24 16:05:21 +01:00
Konstantin 9d0278e0f8 added 3 warpnodes for ropsten (#4289)
* added 3 warpnodes for ropsten

* Fixed indentation
2017-01-24 14:35:52 +01:00
GitLab Build Bot 7aafa8a7ec [ci skip] js-precompiled 20170124-105551 2017-01-24 10:59:12 +00:00
Jaco Greeff 53bbc76d06 Ledger Communication toolkit (#4268) 2017-01-24 11:46:59 +01:00
keorn ba0209678b ValidatorSet reporting (#4208)
* remove register_account_provider

* build rpc module

* new dummy client

* common EngineSigner struct

* from -> into

* initial report via call

* separate safe from regular contract

* transact_contract

* fix build

* return Signature, docs

* add sign method to some engines

* add safeContract spec

* update specs to new contracts

* use AuthorityRound for contract spec

* add more reporting

* add reporting test

* use gas floor

* shorter
2017-01-24 12:03:58 +03:00
GitLab Build Bot b6575cb230 [ci skip] js-precompiled 20170123-184530 2017-01-23 18:48:32 +00:00
Jaco Greeff ea44555f44 Add parity_accountsInfo as available subscription (#4273) 2017-01-23 19:39:49 +01:00
GitLab Build Bot 1c6e9bc772 [ci skip] js-precompiled 20170123-164245 2017-01-23 16:47:50 +00:00
Jaco Greeff 183efe9d19 Display AccountCard name via IdentityName (#4235)
* Display AccountCard name via IdentityName

* Pass name through (catches registry reverse display)
2017-01-23 17:33:03 +01:00
GitLab Build Bot f4149cc089 [ci skip] js-precompiled 20170123-160350 2017-01-23 16:06:59 +00:00
GitLab Build Bot 5fce415ac3 [ci skip] js-precompiled 20170123-155126 2017-01-23 15:54:58 +00:00
Jaco Greeff 3d1162e3d9 Dapp visibility save/load tests (#4150)
* Start of tests to replicate issue

* Expand visibility tests

* Cleanups

* typo

* Extend saving tests as requested (pre-emptive)

* tests for new setDisplayApps action

* Address PR oversights
2017-01-23 16:45:56 +01:00
GitLab Build Bot 512612424c [ci skip] js-precompiled 20170123-153219 2017-01-23 15:35:49 +00:00
Nicolas Gotchac b5a53284cf Fix wrong output format of peers (#4270)
* Fix wrong output format of peers

* Add outPeer tests
2017-01-23 16:25:20 +01:00
keorn b7f9b304c1 Chain scoring (#4218)
* chain scoring

* use current steps
2017-01-23 17:27:11 +03:00
Nikolay Volf 2034595652 Rust 1.14 for windows builds (#4269) 2017-01-23 15:13:02 +01:00
GitLab Build Bot 9994ca93f7 [ci skip] js-precompiled 20170123-124637 2017-01-23 12:49:32 +00:00
Jaco Greeff 66e540edf8 Eslint formatting updates (#4234)
* Eslint updated (newline-after-var)

* Fix newline-after-var

* Eslint updated (one-var-declaration-per-line)

* Fix one-var-declaration-per-line

* Fix additional errors

* Lint after merge
2017-01-23 13:39:52 +01:00
GitLab Build Bot cff64233b4 [ci skip] js-precompiled 20170123-121125 2017-01-23 12:14:45 +00:00
Tomasz Drwięga 3e70e886a0 Embeddable ParityBar (#4222)
* Embeddable ParityBar

* Replacing storage with store

* Fixing  references.

* Addressing style issues

* Supporting parity background
2017-01-23 13:04:08 +01:00
Lukas Maerdian 275fd5096c Update deb-build.sh to fix libssl dependency (#4260) 2017-01-22 16:16:15 +01:00
Svyatoslav Nikolsky 092e24b9f2 Integration with zgp whitelist contract (#4215)
* zgp-transactions checker

* polishing

* rename + refactor

* refuse-service-transactions cl option

* fixed tests compilation
2017-01-22 16:15:22 +01:00
GitLab Build Bot 220084d77d [ci skip] js-precompiled 20170121-134923 2017-01-21 13:53:01 +00:00
Nicolas Gotchac 6b52ed4dfa Adjust the location of the signer snippet (#4155)
* Move signer tab

* WIP

* Better movments

* Save Parity Bar position per dapp

* Add position to Dapp Manifest

* Stick Parity Bar to the four corners
2017-01-21 14:44:13 +01:00
GitLab Build Bot ebe9072836 [ci skip] js-precompiled 20170120-185430 2017-01-20 18:57:26 +00:00
Nicolas Gotchac 8edaab806e Fix wrong token handling (#4254)
* Fixing wrong token displayed

* Linting

* Revert filtering out

* Revert the revert
2017-01-20 19:49:09 +01:00
GitLab Build Bot 6c5167ebb3 [ci skip] js-precompiled 20170120-184412 2017-01-20 18:47:09 +00:00
Jaco Greeff e9e63a4a88 Additional building-block UI components (#4239)
* Currency WIP

* Expand tests

* Pass className

* Add QrCode

* Export new components in ~/ui

* s/this.props.netSymbol/netSymbol/

* Fix import case
2017-01-20 19:38:18 +01:00
GitLab Build Bot 9ea7ec0252 [ci skip] js-precompiled 20170120-153650 2017-01-20 15:39:49 +00:00
Jaco Greeff ca2983b407 Bump package.json to 0.3.0 (1.6 track) (#4244) 2017-01-20 16:31:03 +01:00
GitLab Build Bot 888ce1ca3d [ci skip] js-precompiled 20170120-145411 2017-01-20 14:57:00 +00:00
Jaco Greeff 29e91f80d1 Disable notifications (#4243) 2017-01-20 15:48:14 +01:00
Robert Habermeier 203fd8a471 Memory-based pruning history size (#4114)
* prune states based on memory param

* pruning memory CLI and usage in sync

* return purged value from memorydb

* calculate memory used incrementally in overlayrecentdb

* refactor shared history pruning code in client

* Fixed usage alignment

* journal_size function for fast memory calculation
2017-01-20 13:25:53 +01:00
keorn 97a60ceab1 Common EngineSigner (#4189)
* remove register_account_provider

* build rpc module

* new dummy client

* common EngineSigner struct

* from -> into

* return Signature, docs
2017-01-20 13:25:17 +01:00
Jannis Redmann 1f77c4301a verification: don't request a code twice (#4221)
* verification: check if user has received code

* verification: don't request a code twice

* code style :lint:
2017-01-20 13:23:21 +01:00
Jaco Greeff 4e35fd215e s/Delete Contract/Forget Contract/ (#4237) 2017-01-20 13:21:51 +01:00
Robert Habermeier a791cb50a6 Light protocol syncing improvements (#4212)
* remove old lint silencer

* dispatch requests only to peers with higher TD

* dynamic target for sync rounds

* use round pivots instead of frames, fix test

* fix total difficulty calculation for test client

* fix broken reorg algorithm

* fork test, fix ancestor search
2017-01-20 12:41:59 +01:00
Robert Habermeier 3ff9324ec0 LES Peer Info (#4195)
* connected peers function for network service

* get LES peer info in sync API

* new peer info in RPC
2017-01-20 12:41:49 +01:00
Arkadiy Paronyan 35666f718b Don't panic on uknown git commit hash (#4231) 2017-01-20 10:18:26 +01:00
GitLab Build Bot 685c630b4d [ci skip] js-precompiled 20170120-091224 2017-01-20 09:15:30 +00:00
Jannis Redmann df9110dd5e cache registry reverses in local storage (#4182)
* cache reverses in localStorage

* bugfixes 🐛, linting fixes 👕

* registry caching: store last block

* registry caching: store per chain

* localStorage -> store

* code style 

* code style 👕
2017-01-20 10:07:47 +01:00
Denis S. Soldatov aka General-Beck f12bd17c20 update gitlab-ci
revert to 1337
[ci skip]
2017-01-20 02:28:04 +04:00
Denis S. Soldatov aka General-Beck 3e8d5dbe23 update gitlab-ci
comment to curl 1337
[ci skip]
2017-01-20 00:47:53 +04:00
Denis S. Soldatov aka General-Beck 71ed9f5fff update gitlab-ci
fix build docker image in debian
[ci skip]
2017-01-20 00:33:27 +04:00
Denis S. Soldatov aka General-Beck 0e99e527bf update gitlab-ci
add debian build win openssl 1.0.1
[ci skip]
2017-01-19 23:32:52 +04:00
Robert Habermeier 33680f5b82 Merge pull request #4223 from ethcore/rh-readme
update version numbers in README
2017-01-19 18:16:29 +01:00
Robert Habermeier 1be9f9eb1b update version numbers in README
[ci skip]
2017-01-19 17:38:50 +01:00
Robert Habermeier 5830e03201 Merge pull request #4181 from ethcore/cht-full-nodes
CHT calculations for full nodes
2017-01-19 15:12:44 +01:00
Gav 42886fed5a Dont push-release for beta/stable changes 2017-01-19 14:30:52 +01:00
GitLab Build Bot 6db17eb908 [ci skip] js-precompiled 20170119-131530 2017-01-19 13:19:21 +00:00
Jaco Greeff e62cda36c7 Use single source of info for dapp meta (build & display) (#4217)
* Add skipBuild flag

* Only use builtin.json to specify location

* Re-remove dapps/index.js
2017-01-19 14:07:41 +01:00
GitLab Build Bot ab073efbd9 [ci skip] js-precompiled 20170119-100631 2017-01-19 10:09:51 +00:00
Jaco Greeff 46081de886 Non-secure for DappReg (#4216) 2017-01-19 10:59:49 +01:00
GitLab Build Bot a6365577e5 [ci skip] js-precompiled 20170119-093724 2017-01-19 09:41:00 +00:00
Gav Wood 0826bf75d1 Console now has admin (#4220)
Fixes #4210
2017-01-19 10:24:34 +01:00
GitLab Build Bot f9509cc8b8 [ci skip] js-precompiled 20170119-075016 2017-01-19 07:53:32 +00:00
Jannis Redmann b9031953e0 verification: add mainnet BadgeReg ids (#4190)
* verification: mainnet BadgeReg ids

* verification: fetch contracts by name

* verification: better wording

* typo

* reregistered badges
2017-01-19 08:45:32 +01:00
Tomasz Drwięga 24aec5191a Fixing minimal transaction queue price (#4204)
* Fixing minimal transaction queue price

* Fixing tests
2017-01-18 19:44:24 +01:00
keorn 73b80869f5 Remove unnecessary Engine method (#4184)
* remove register_account_provider

* build rpc module

* new dummy client
2017-01-18 18:49:50 +01:00
Arkadiy Paronyan 61bfe42d1d Fixed --base-path on windows (#4193)
* Fixed --base-path on windows

* Add support for optional args with default text
2017-01-18 18:45:30 +01:00
Tomasz Drwięga b4ff08beb8 Fixing etherscan price parsing (#4202)
* Fixing etherscan price parsing

* Handling all errors
2017-01-18 17:56:21 +01:00
Robert Habermeier 3040a1c83e Merge pull request #4093 from ethcore/better-timeouts
LES: Better timeouts + Track failed requests
2017-01-18 15:04:48 +01:00
GitLab Build Bot 779440450f [ci skip] js-precompiled 20170118-121219 2017-01-18 12:15:38 +00:00
Jaco Greeff 08f80f2695 ESLint additional rules (#4186)
* Add eslint rule for consistent block padding

* Fix padding consistency issues

* Eslint test for duplicate imports

* Eslint closing bracket location

* Fix eslint jsx closing bracket

* missed a file

* Formatting

* Manual overrides for auto

* Manual overrides for auto

* More minor auto-override manual adjustments
2017-01-18 13:05:01 +01:00
Arkadiy Paronyan d608ad2011 jsonr rpc bump for IPC fix (#4200) 2017-01-18 12:54:35 +01:00
GitLab Build Bot 1cb37e53c0 [ci skip] js-precompiled 20170118-114926 2017-01-18 11:52:24 +00:00
Jaco Greeff c1ce65c870 Poll for upgrades as part of global status (long) (#4197)
* Poll for upgrades as part of global status (long)

* Fix path
2017-01-18 12:44:18 +01:00
Arkadiy Paronyan 7cab6ac263 Updater fixes (#4196)
* Minor typo to ensure it updates only when synced.

* Fix deadlock.

* Skip unneeded arg in making list.

* Allow auto-restart even when not running an update.

* Fix trace.

* Update update info on each loop.

* Fix build.

* Shutdown all sockets

* Remove superfluous use.
2017-01-17 23:34:46 +01:00
Arkadiy Paronyan 8852a05301 Prevent duplicate incoming connections (#4180) 2017-01-17 16:02:29 +01:00
Gav Wood e95d66832c Minor typo to ensure it updates only when synced. (#4188) 2017-01-17 13:05:02 +01:00
GitLab Build Bot 6339b3c88a [ci skip] js-precompiled 20170117-102646 2017-01-17 10:34:02 +00:00
Evan Saulpaugh 7dde80fdf3 Minor refactor for clarity (#4174)
* Spelling & grammar in TxQueue Viewer description

* minor refactor for clarity

* Fix lint.
2017-01-17 11:17:38 +01:00
Björn Wagner 581604aae4 current release: 1.3 -> 1.4 (#4183) 2017-01-16 19:02:35 +01:00
Robert Habermeier 536df809c6 tests + documentation 2017-01-16 17:42:39 +01:00
Robert Habermeier b960152d5b CHT calculations for full nodes 2017-01-16 17:10:30 +01:00
Robert Habermeier 31aae4ed78 move cht module up a level 2017-01-16 16:55:23 +01:00
Nikolay Volf f807aa65a1 Secret - from hash function, also validate data (#4159)
* from hash for secret

* checked from_slice

* move assert

* remove fromhash
2017-01-16 16:50:20 +01:00
Svyatoslav Nikolsky bac6293309 gas_limit for blocks, mined by Parity will be divisible by 37 (#4154)
* gas_limit for new blocks will divide evenly by 13

* increased PARITY_GAS_LIMIT_DETERMINANT to 37

* separate method for marking mined block

* debug_asserts(gas_limit within protocol range)

* round_block_gas_limit method is now static

* made round_block_gas_limit free-function

* multiplier->multiple [ci skip]
2017-01-16 14:29:51 +01:00
Tomasz Drwięga 76daf50876 Support HTML5-routed dapps (#4173) 2017-01-16 10:49:27 +01:00
Jannis Redmann 1d618faaa6 fix subscribeToEvents test (#4166)
* try to fix freaking test

* fix subscribeToEvents test

This fix is a workaround. I would have used sinon fake timers, but I
couldn't get them to work.

* subscribeToEvent test: simplify code
2017-01-16 10:48:20 +01:00
GitLab Build Bot aee70c4f16 [ci skip] js-precompiled 20170116-033453 2017-01-16 03:37:54 +00:00
GitLab Build Bot d6ed42bff5 [ci skip] js-precompiled 20170115-041925 2017-01-15 04:22:19 +00:00
GitLab Build Bot 4b85e3ee57 [ci skip] js-precompiled 20170114-041818 2017-01-14 04:21:24 +00:00
GitLab Build Bot af00986456 [ci skip] js-precompiled 20170113-172058 2017-01-13 17:23:57 +00:00
Nicolas Gotchac 51ac34f1cc Fix dapps not loading (#4170)
* Add secure to dappsreg

* Remove trailing slash // fix dapps
2017-01-13 18:14:56 +01:00
Nicolas Gotchac 42ddb4f26c Fix token images // Error in Contract Queries (#4169) 2017-01-13 18:14:25 +01:00
Tomasz Drwięga d0cebc3982 Bumping hyper (#4167) 2017-01-13 16:30:49 +01:00
Gav Wood c2f4716ee2 icarus -> update, increase web timeout. (#4165)
* icarus -> update, increase web timeout.

* Fix estimate gas
2017-01-13 16:30:16 +01:00
GitLab Build Bot 7611bbd3ee [ci skip] js-precompiled 20170113-145733 2017-01-13 15:00:41 +00:00
Nicolas Gotchac 4a714d4a3e Add a password strength component (#4153)
* Added new PasswordStrength Component

* Added tests

* PR Grumbles
2017-01-13 15:52:42 +01:00
Nicolas Gotchac 57ce845e4c Stop flickering + added loader in AddressSelector (#4149)
* Stop UI flickering + added loader to AddressSelector #4103

* PR Grumbles
2017-01-13 15:52:24 +01:00
Robert Habermeier f0eab337d8 Merge pull request #4036 from ethcore/on-demand-les-request
On demand LES request
2017-01-13 14:36:48 +01:00
Arkadiy Paronyan cdc525449a Ropsten fork detection (#4163) 2017-01-13 14:28:10 +01:00
Denis S. Soldatov aka General-Beck d4cab20425 remove `icarus`
[ci skip]
2017-01-13 16:27:03 +04:00
GitLab Build Bot f3717b96ff [ci skip] js-precompiled 20170113-090039 2017-01-13 09:03:30 +00:00
Jaco Greeff ee4ede915a Pull in console dapp as builtin (#4145)
* Copy static dapps from static (no build)

* Console sources

* Add console to builtins

* Remove console assets

* Disable eslint on console.js

* Enable eslint after disable

* Webpack copy
2017-01-13 08:53:57 +00:00
Arkadiy Paronyan cfb6dd2ea8 Optimized hash lookups (#4144)
* Optimize hash comparison

* Use libc
2017-01-13 08:52:23 +00:00
Tomasz Drwięga e11353f94c UnverifiedTransaction type (#4134)
* Introducing ValidSignedTransaction

* Verifiying transactions in engines

* Widening use of VerifiedSignedTransaction

* Renaming Transactions

* Uncommenting banning queue & Fixing tests

* Fixing json tests

* Fixing pre-homestead test

* Fixing imports

* Addressing grumbles

* Fixing test
2017-01-13 08:51:36 +00:00
Jannis Redmann 6f1c55ef5d verification: check if server is running (#4140)
* verification: check if server is running

See also ethcore/email-verification#67c6466 and ethcore/sms-verification#a585e42.

* verification: show in the UI if server is running

* verification: code style , more i18n

* fix i18n key
2017-01-13 08:51:25 +00:00
GitLab Build Bot 3d06456fa5 [ci skip] js-precompiled 20170113-042838 2017-01-13 04:31:31 +00:00
GitLab Build Bot 54b06cea16 [ci skip] js-precompiled 20170112-222827 2017-01-12 22:31:32 +00:00
GitLab Build Bot 887e5f730e [ci skip] js-precompiled 20170112-142354 2017-01-12 14:26:49 +00:00
Jaco Greeff bff0f8ec5d Remove onSubmit of current (no auto-change on password edit) (#4151)
* Remove onSubmit from current password

* Remove onSubmit from hint
2017-01-12 15:18:16 +01:00
GitLab Build Bot b4eea05bd3 [ci skip] js-precompiled 20170112-133204 2017-01-12 13:35:58 +00:00
Jaco Greeff 0de34774b1 Trim spaces from InputAddress (#4126)
* Trim spaces for addresses

* onSubmit has only value, not event

* onSubmit (again)

* Length check on trimmed value
2017-01-12 14:25:41 +01:00
Nicolas Gotchac 81beec1352 Don't pop-up notifications after network switch (#4076)
* Better notifications

* Don't pollute with notifs if switched networks

* Better connection close/open events / No more notifs on change network

* PR Grumbles

* Add close and open events to HTTP // Add tests

* Fix tests

* WIP Signer Fix

* Fix Signer // Better reconnection handling

* PR Grumbles

* PR Grumbles

* Fixes wrong fetching of balances + Notifications

* Secure API WIP

* Updated Secure API Connection + Status

* Linting

* Linting

* Updated Secure API Logic

* Proper handling of token updates // Fixing poping notifications

* PR Grumbles

* PR Grumbles

* Fixing tests
2017-01-12 14:25:32 +01:00
GitLab Build Bot bc2ebdc564 [ci skip] js-precompiled 20170112-130413 2017-01-12 13:07:28 +00:00
Jaco Greeff 389e4e3bc0 Use estimateGas error (as per updated implementation) (#4131)
* Use estimateGas error (as per updated implementation)

* EXCEPTION_ERROR as per #4142
2017-01-12 13:56:37 +01:00
Robert Habermeier 7dde02b25d Merge branch 'master' into on-demand-les-request 2017-01-12 11:23:47 +01:00
Gav Wood 311730ea95 Improvements and optimisations to estimate_gas (#4142)
* Return 0 instead of error with out of gas on estimate_gas

* Fix stuff up.

* Another estimate gas fix.

* Alter balance to maximum possible rather than GP=0.

* Only increase to amount strictly necessary.

* Improvements and optimisations to estimate_gas.

- Introduce proper error type
- Avoid building costly traces

* Fix tests.

* Actually fix testsActually fix tests
2017-01-12 11:06:12 +01:00
Tomasz Drwięga 41da1a0a79 New jsonrpc-core with futures and metadata support (#3859)
* Bumping serde & serde_json

* Super-initial usage of new jsonrpc

* Single event loop for jsonrpc

* Metadata

* Supporting metadata extraction for eth_accounts

* Fixing Cargo.lock

* Removing uneccessary clones

* Fixing unused import

* Unused import

* Fixing test
2017-01-11 20:02:27 +01:00
Gav Wood c4d96a64a2 Reenable mainnet update server. (#4137) 2017-01-11 20:01:45 +01:00
Jannis Redmann f0c831d63f temporarily skip failing test (#4138) 2017-01-11 20:01:19 +01:00
Robert Habermeier 78e670812c fix test compilation 2017-01-11 18:57:38 +01:00
Robert Habermeier e88c62d37d Merge branch 'master' into better-timeouts 2017-01-11 18:55:16 +01:00
Robert Habermeier 7b3c648d3e Merge branch 'master' into better-timeouts 2017-01-11 18:47:09 +01:00
keorn 844b1f8c0d Refactor VoteCollector (#4101)
* dir

* simple validator list

* stub validator contract

* make the engine hold Weak<Client> instead of IoChannel

* validator set factory

* register weak client with ValidatorContract

* check chain security

* add address array to generator

* register provider contract

* update validator set on notify

* add validator contract spec

* simple list test

* split update and contract test

* contract change

* use client in tendermint

* fix deadlock

* step duration in params

* adapt tendermint tests

* add storage fields to test spec

* constructor spec

* execute under wrong address

* create under correct address

* revert

* validator contract constructor

* move genesis block lookup

* add removal ability to contract

* validator contract adding validators

* fix basic authority

* validator changing test

* more docs

* update sync tests

* remove env_logger

* another env_logger

* cameltoe

* hold EngineClient instead of Client

* return error on misbehaviour

* nicer return

* sprinkle docs
2017-01-11 17:56:50 +01:00
Gav Wood 56c546f465 Another minor estimation fix (#4133)
* Return 0 instead of error with out of gas on estimate_gas

* Fix stuff up.

* Another estimate gas fix.

* Alter balance to maximum possible rather than GP=0.

* Only increase to amount strictly necessary.
2017-01-11 17:51:48 +01:00
Nicolas Gotchac 8d3d76c107 Add proper label to method decoding inputs (#4136) 2017-01-11 17:44:56 +01:00
GitLab Build Bot a4b93b4b88 [ci skip] js-precompiled 20170111-160821 2017-01-11 16:11:45 +00:00
Jaco Greeff 3e74d46a06 Remove bindActionCreators({}, dispatch) (empty) (#4135) 2017-01-11 17:02:53 +01:00
Jaco Greeff 32dbf9958e Better error log reporting & handling (#4128) 2017-01-11 17:02:39 +01:00
Nicolas Gotchac b54709605a Fix broken transfer total balance (#4127) 2017-01-11 17:01:35 +01:00
Robert Habermeier 7123f19a75 Test harness for lightsync (#4109)
* make on_connect/disconnect public

* free flow params constructor

* Shared ownership of LES handlers

* light provider impl for test client

* skeleton for testing light sync

* have test_client use actual genesis

* fix underflow in provider

* test harnesses for lightsync

* fix tests

* fix test failure caused by test_client changes
2017-01-11 14:39:03 +01:00
Gav Wood 7286d42b7d Fix call/estimate_gas (#4121)
* Return 0 instead of error with out of gas on estimate_gas

* Fix stuff up.
2017-01-11 14:28:27 +01:00
GitLab Build Bot 2edd893f23 [ci skip] js-precompiled 20170111-112556 2017-01-11 11:28:45 +00:00
Tomasz Drwięga 26500af8c0 Fixing decoding API with signatures in names (#4125) 2017-01-11 12:17:04 +01:00
Tomasz Drwięga 21006da125 Get rid of unsafe code in ethkey, propagate incorrect Secret errors. (#4119)
* Implementing secret

* Fixing tests
2017-01-11 12:16:47 +01:00
Jannis Redmann 4ecd9da6e4 basic tests for subscribeToEvents (#4115)
* subscribeToEvent fixtures 

* subscribeToEvent tests 
2017-01-11 12:14:04 +01:00
Robert Habermeier 5b8a7259c1 Merge branch 'master' into on-demand-les-request 2017-01-11 11:39:43 +01:00
GitLab Build Bot 6f3cefe17f [ci skip] js-precompiled 20170110-180532 2017-01-10 18:09:09 +00:00
Tomasz Drwięga 7aa2af3e21 Auto-detect hex encoded bytes in sha3 (#4108)
* Auto-detect hex encoded bytes in sha3

* Using types/isHex

* Removing unused imports
2017-01-10 18:56:56 +01:00
Gav Wood 23feb7998f Use binary chop to estimate gas accurately (#4100)
* Initial sketch.

* Building.

* Fix a few things.

* Fix issue, add tracing.

* Address grumbles

* Raise upper limit if needed

* Fix test.
2017-01-10 18:56:41 +01:00
Denis S. Soldatov aka General-Beck baa754cc52 Update gitlab-ci
fix curl in arm
2017-01-10 20:26:15 +04:00
Arkadiy Paronyan 148ea37687 v1.6 in master (#4113) 2017-01-10 15:41:59 +01:00
Gav Wood ae144b7f62 Ignore get_price_info test by default. (#4112) 2017-01-10 15:41:48 +01:00
Robert Habermeier d515ef9a2a test for id_guard behavior 2017-01-09 12:20:44 +01:00
Robert Habermeier 54058e3712 ensure failed requests considered unfulfilled 2017-01-09 11:29:06 +01:00
Robert Habermeier 75b5acf21d use common BasicAccount type 2017-01-05 13:26:14 +01:00
Robert Habermeier 8446a8354b Merge branch 'master' into on-demand-les-request 2017-01-05 13:18:24 +01:00
Robert Habermeier f63faea308 test for request_set and remove idle flag 2017-01-04 18:43:11 +01:00
Robert Habermeier 04282be721 use request set to provide better timeouts 2017-01-04 18:00:12 +01:00
Robert Habermeier 6ad0a0baaa fix test imports 2017-01-04 16:12:58 +01:00
Robert Habermeier 5060370c70 Merge branch 'lightsync' into on-demand-les-request 2017-01-04 15:18:22 +01:00
Robert Habermeier ed98c389ca no_peers test 2017-01-04 14:54:50 +01:00
Robert Habermeier 62bc92ff4d Merge branch 'master' into on-demand-les-request 2017-01-04 14:33:45 +01:00
Robert Habermeier 38ac84f0c7 reassign requests on failure 2017-01-04 14:33:32 +01:00
Robert Habermeier ca35b345ca separate request dispatch from creation 2017-01-04 13:58:26 +01:00
Robert Habermeier 1d51b6f7e5 handle incoming LES requests 2017-01-04 13:34:50 +01:00
Robert Habermeier 4e94f43644 tests for request module 2017-01-04 12:48:07 +01:00
Robert Habermeier 01977e60aa finish request module, basic dispatch 2017-01-03 19:13:40 +01:00
Robert Habermeier 4dbbc3bc88 beginnings of on_demand request module + verification 2017-01-03 16:18:57 +01:00
Robert Habermeier ddf2b944b5 on demand request dispatch 2016-12-28 21:46:55 +01:00
Robert Habermeier 4daa645789 dispatch header requests 2016-12-28 16:20:46 +01:00
Robert Habermeier 5309ba45a8 update peer status from announcement 2016-12-28 16:20:35 +01:00
Robert Habermeier c2ad769fb7 Merge branch 'master' into on-demand-les-request 2016-12-28 14:00:33 +01:00
Robert Habermeier 428d5db9d1 beginning of on_demand 2016-12-27 16:43:28 +01:00
Robert Habermeier 9b4f90718f Display impl for ReqId 2016-12-27 13:54:51 +01:00
2882 changed files with 241897 additions and 293737 deletions

3
.cargo/config Normal file
View File

@ -0,0 +1,3 @@
[target.x86_64-pc-windows-msvc]
# Link the C runtime statically ; https://github.com/openethereum/parity-ethereum/issues/6643
rustflags = ["-Ctarget-feature=+crt-static"]

22
.dockerignore Normal file
View File

@ -0,0 +1,22 @@
# Generated by Cargo
# will have compiled files and executables
target
*.swp
*.swo
*.swn
*.DS_Store
# Visual Studio Code stuff
.vscode
# GitEye stuff
.project
# idea ide
.idea
# git stuff
.git
ethcore/res/ethereum/tests

View File

@ -9,7 +9,7 @@ trim_trailing_whitespace=true
max_line_length=120
insert_final_newline=true
[.travis.yml]
[*.{yml,sh}]
indent_style=space
indent_size=2
tab_width=8

2
.git-blame-ignore-revs Normal file
View File

@ -0,0 +1,2 @@
# Reformat the source code
610d9baba4af83b5767c659ca2ccfed337af1056

84
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@ -0,0 +1,84 @@
# Code of Conduct
## 1. Purpose
A primary goal of OpenEthereum is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).
This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.
We invite all those who participate in OpenEthereum to help us create safe and positive experiences for everyone.
## 2. Open Source Citizenship
A supplemental goal of this Code of Conduct is to increase open source citizenship by encouraging participants to recognize and strengthen the relationships between our actions and their effects on our community.
Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.
If you see someone who is making an extra effort to ensure our community is welcoming, friendly, and encourages all participants to contribute to the fullest extent, we want to know.
## 3. Expected Behavior
The following behaviors are expected and requested of all community members:
* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
* Exercise consideration and respect in your speech and actions.
* Attempt collaboration before conflict.
* Refrain from demeaning, discriminatory, or harassing behavior and speech.
* Be mindful of your surroundings and of your fellow participants. Alert community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential.
* Remember that community event venues may be shared with members of the public; please be respectful to all patrons of these locations.
## 4. Unacceptable Behavior
The following behaviors are considered harassment and are unacceptable within our community:
* Violence, threats of violence or violent language directed against another person.
* Sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language.
* Posting or displaying sexually explicit or violent material.
* Posting or threatening to post other peoples personally identifying information ("doxing").
* Personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
* Inappropriate photography or recording.
* Inappropriate physical contact. You should have someones consent before touching them.
* Unwelcome sexual attention. This includes, sexualized comments or jokes; inappropriate touching, groping, and unwelcomed sexual advances.
* Deliberate intimidation, stalking or following (online or in person).
* Advocating for, or encouraging, any of the above behavior.
* Sustained disruption of community events, including talks and presentations.
## 5. Consequences of Unacceptable Behavior
Unacceptable behavior from any community member, including sponsors and those with decision-making authority, will not be tolerated.
Anyone asked to stop unacceptable behavior is expected to comply immediately.
If a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning (and without refund in the case of a paid event).
## 6. Reporting Guidelines
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify a community organizer as soon as possible. community@parity.io.
Link to reporting guidelines: [CONTRIBUTING.md](CONTRIBUTING.md)
Link to security policy: [SECURITY.md](../SECURITY.md)
Additionally, community organizers are available to help community members engage with local law enforcement or to otherwise help those experiencing unacceptable behavior feel safe. In the context of in-person events, organizers will also provide escorts as desired by the person experiencing distress.
## 7. Addressing Grievances
If you feel you have been falsely or unfairly accused of violating this Code of Conduct, you should notify OpenEthereum Technologies with a concise description of your grievance. Your grievance will be handled in accordance with our existing governing policies.
## 8. Scope
We expect all community participants (contributors, paid or otherwise; sponsors; and other guests) to abide by this Code of Conduct in all community venuesonline and in-personas well as in all one-on-one communications pertaining to community business.
This code of conduct and its related procedures also applies to unacceptable behavior occurring outside the scope of community activities when such behavior has the potential to adversely affect the safety and well-being of community members.
## 9. Contact info
You can contact OpenEthereum via Email: community@parity.io
## 10. License and attribution
This Code of Conduct is distributed under a [Creative Commons Attribution-ShareAlike license](http://creativecommons.org/licenses/by-sa/3.0/).
Portions of text derived from the [Django Code of Conduct](https://www.djangoproject.com/conduct/) and the [Geek Feminism Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Conference_anti-harassment/Policy).
Retrieved on November 22, 2016 from [http://citizencodeofconduct.org/](http://citizencodeofconduct.org/)

68
.github/CONTRIBUTING.md vendored Normal file
View File

@ -0,0 +1,68 @@
# Contributing Guidelines
## Do you have a question?
Check out our [Beginner Introduction](https://openethereum.github.io/Beginner-Introduction), [Configuration](https://openethereum.github.io//Configuring-OpenEthereum), and [FAQ](https://openethereum.github.io/FAQ) articles on our [wiki](https://openethereum.github.io/)!
See also frequently asked questions [tagged with `parity`](https://ethereum.stackexchange.com/questions/tagged/parity?sort=votes&pageSize=50) on Stack Exchange.
## Report bugs!
Do **not** open an issue on Github if you think your discovered bug could be a **security-relevant vulnerability**. Please, read our [security policy](../SECURITY.md) instead.
Otherwise, just create a [new issue](https://github.com/openethereum/openethereum/issues/new) in our repository and state:
- What's your OpenEthereum version?
- What's your operating system and version?
- How did you install OpenEthereum?
- Is your node fully synchronized?
- Did you try turning it off and on again?
Also, try to include **steps to reproduce** the issue and expand on the **actual versus expected behavior**.
## Contribute!
If you would like to contribute to OpenEthereum, please **fork it**, fix bugs or implement features, and [propose a pull request](https://github.com/openethereum/openethereum/compare).
### Labels & Milestones
We use [labels](https://github.com/openethereum/openethereum/labels) to manage PRs and issues and communicate the state of a PR. Please familiarize yourself with them. Furthermore we are organizing issues in [milestones](https://github.com/openethereum/openethereum/milestones). Best way to get started is to a pick a ticket from the current milestone tagged [`easy`](https://github.com/openethereum/openethereum/labels/Q2-easy%20%F0%9F%92%83) and get going, or [`mentor`](https://github.com/openethereum/openethereum/labels/Q1-mentor%20%F0%9F%95%BA) and get in contact with the mentor offering their support on that larger task.
### Rules
There are a few basic ground-rules for contributors (including the maintainer(s) of the project):
* **No pushing directly to the master branch**.
* **All modifications** must be made in a **pull-request** to solicit feedback from other contributors.
* Pull-requests cannot be merged before CI runs green and two reviewers have given their approval.
* All code changed should be formated by running `cargo fmt -- --config=merge_imports=true`
### Recommendations
* **Non-master branch names** *should* be prefixed with a short name moniker, followed by the associated Github Issue ID (if any), and a brief description of the task using the format `<GITHUB_USERNAME>-<ISSUE_ID>-<BRIEF_DESCRIPTION>` (e.g. `gavin-123-readme`). The name moniker helps people to inquiry about their unfinished work, and the GitHub Issue ID helps your future self and other developers (particularly those who are onboarding) find out about and understand the original scope of the task, and where it fits into Parity Ethereum [Projects](https://github.com/openethereum/openethereum/projects).
* **Remove stale branches periodically**
### Preparing Pull Requests
* If your PR does not alter any logic (e.g. comments, dependencies, docs), then it may be tagged [`insubstantial`](https://github.com/openethereum/openethereum/pulls?q=is%3Aopen+is%3Apr+label%3A%22A2-insubstantial+%F0%9F%91%B6%22).
* Once a PR is ready for review please add the [`pleasereview`](https://github.com/openethereum/openethereum/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+label%3A%22A0-pleasereview+%F0%9F%A4%93%22+) label.
### Reviewing Pull Requests*:
* At least two reviewers are required to review PRs (even for PRs tagged [`insubstantial`](https://github.com/openethereum/openethereum/pulls?q=is%3Aopen+is%3Apr+label%3A%22A2-insubstantial+%F0%9F%91%B6%22)).
When doing a review, make sure to look for any:
* Buggy behavior.
* Undue maintenance burden.
* Breaking with house coding style.
* Pessimization (i.e. reduction of speed as measured in the projects benchmarks).
* Breaking changes should be carefuly reviewed and tagged as such so they end up in the [changelog](../CHANGELOG.md).
* Uselessness (i.e. it does not strictly add a feature or fix a known issue).
## License.
By contributing to Parity Ethereum, you agree that your contributions will be licensed under the [GPLv3 License](../LICENSE).
Each contributor has to sign our Contributor License Agreement. The purpose of the CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen license. You can read and sign our full Contributor License Agreement at [cla.parity.io](https://cla.parity.io) before submitting a pull request.

13
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,13 @@
For questions please use https://discord.io/openethereum, issues are for bugs and feature requests.
_Before filing a new issue, please **provide the following information**._
- **OpenEthereum version (>=3.1.0)**: 0.0.0
- **Operating system**: Windows / MacOS / Linux
- **Installation**: homebrew / one-line installer / built from source
- **Fully synchronized**: no / yes
- **Network**: ethereum / ropsten / kovan / ...
- **Restarted**: no / yes
_Your issue description goes here below. Try to include **actual** vs. **expected behavior** and **steps to reproduce** the issue._

View File

@ -0,0 +1,33 @@
name: Build and Test Suite on Windows
on:
push:
branches:
- main
- dev
jobs:
build-tests:
name: Test and Build
strategy:
matrix:
platform:
- windows2019 # custom runner
toolchain:
- 1.52.1
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout sources
uses: actions/checkout@main
with:
submodules: true
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- name: Build tests
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --all --release --features "json-tests" --verbose --no-run

40
.github/workflows/build-test.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Build and Test Suite
on:
pull_request:
push:
branches:
- main
- dev
jobs:
build-tests:
name: Test and Build
strategy:
matrix:
platform:
- ubuntu-16.04
- macos-latest
toolchain:
- 1.52.1
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout sources
uses: actions/checkout@main
with:
submodules: true
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- name: Build tests
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --all --release --features "json-tests" --verbose --no-run
- name: Run tests for ${{ matrix.platform }}
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --all --release --features "json-tests" --verbose

285
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,285 @@
name: Build Release Suite
on:
push:
tags:
- v*
# Global vars
env:
AWS_REGION: "us-east-1"
AWS_S3_ARTIFACTS_BUCKET: "openethereum-releases"
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
build:
name: Build Release
strategy:
matrix:
platform:
- ubuntu-16.04
- macos-latest
toolchain:
- 1.52.1
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout sources
uses: actions/checkout@main
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
# ==============================
# Windows Build
# ==============================
# - name: Install LLVM for Windows
# if: matrix.platform == 'windows2019'
# run: choco install llvm
# - name: Build OpenEthereum for Windows
# if: matrix.platform == 'windows2019'
# run: sh scripts/actions/build-windows.sh ${{matrix.platform}}
# - name: Upload Windows build
# uses: actions/upload-artifact@v2
# if: matrix.platform == 'windows2019'
# with:
# name: windows-artifacts
# path: artifacts
# ==============================
# Linux/Macos Build
# ==============================
- name: Build OpenEthereum for ${{matrix.platform}}
if: matrix.platform != 'windows2019'
run: sh scripts/actions/build-linux.sh ${{matrix.platform}}
- name: Upload Linux build
uses: actions/upload-artifact@v2
if: matrix.platform == 'ubuntu-16.04'
with:
name: linux-artifacts
path: artifacts
- name: Upload MacOS build
uses: actions/upload-artifact@v2
if: matrix.platform == 'macos-latest'
with:
name: macos-artifacts
path: artifacts
zip-artifacts-creator:
name: Create zip artifacts
needs: build
runs-on: ubuntu-16.04
steps:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
# ==============================
# Create ZIP files
# ==============================
# - name: Download Windows artifacts
# uses: actions/download-artifact@v2
# with:
# name: windows-artifacts
# path: windows-artifacts
- name: Download Linux artifacts
uses: actions/download-artifact@v2
with:
name: linux-artifacts
path: linux-artifacts
- name: Download MacOS artifacts
uses: actions/download-artifact@v2
with:
name: macos-artifacts
path: macos-artifacts
- name: Display structure of downloaded files
run: ls
- name: Create zip Linux
id: create_zip_linux
run: |
cd linux-artifacts/
zip -rT openethereum-linux-${{ env.RELEASE_VERSION }}.zip *
ls openethereum-linux-${{ env.RELEASE_VERSION }}.zip
cd ..
mv linux-artifacts/openethereum-linux-${{ env.RELEASE_VERSION }}.zip .
echo "Setting outputs..."
echo ::set-output name=LINUX_ARTIFACT::openethereum-linux-${{ env.RELEASE_VERSION }}.zip
echo ::set-output name=LINUX_SHASUM::$(shasum -a 256 openethereum-linux-${{ env.RELEASE_VERSION }}.zip | awk '{print $1}')
- name: Create zip MacOS
id: create_zip_macos
run: |
cd macos-artifacts/
zip -rT openethereum-macos-${{ env.RELEASE_VERSION }}.zip *
ls openethereum-macos-${{ env.RELEASE_VERSION }}.zip
cd ..
mv macos-artifacts/openethereum-macos-${{ env.RELEASE_VERSION }}.zip .
echo "Setting outputs..."
echo ::set-output name=MACOS_ARTIFACT::openethereum-macos-${{ env.RELEASE_VERSION }}.zip
echo ::set-output name=MACOS_SHASUM::$(shasum -a 256 openethereum-macos-${{ env.RELEASE_VERSION }}.zip | awk '{print $1}')
# - name: Create zip Windows
# id: create_zip_windows
# run: |
# cd windows-artifacts/
# zip -rT openethereum-windows-${{ env.RELEASE_VERSION }}.zip *
# ls openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# cd ..
# mv windows-artifacts/openethereum-windows-${{ env.RELEASE_VERSION }}.zip .
# echo "Setting outputs..."
# echo ::set-output name=WINDOWS_ARTIFACT::openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# echo ::set-output name=WINDOWS_SHASUM::$(shasum -a 256 openethereum-windows-${{ env.RELEASE_VERSION }}.zip | awk '{print $1}')
# =======================================================================
# Upload artifacts
# This is required to share artifacts between different jobs
# =======================================================================
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: openethereum-linux-${{ env.RELEASE_VERSION }}.zip
path: openethereum-linux-${{ env.RELEASE_VERSION }}.zip
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: openethereum-macos-${{ env.RELEASE_VERSION }}.zip
path: openethereum-macos-${{ env.RELEASE_VERSION }}.zip
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# path: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# =======================================================================
# Upload artifacts to S3
# This is required by some software distribution systems which require
# artifacts to be downloadable, like Brew on MacOS.
# =======================================================================
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Copy files to S3 with the AWS CLI
run: |
# Deploy zip artifacts to S3 bucket to a directory whose name is the tagged release version.
# Deploy macos binary artifact (if required, add more `aws s3 cp` commands to deploy specific OS versions)
aws s3 cp macos-artifacts/openethereum s3://${{ env.AWS_S3_ARTIFACTS_BUCKET }}/${{ env.RELEASE_VERSION }}/macos/ --region ${{ env.AWS_REGION }}
outputs:
linux-artifact: ${{ steps.create_zip_linux.outputs.LINUX_ARTIFACT }}
linux-shasum: ${{ steps.create_zip_linux.outputs.LINUX_SHASUM }}
macos-artifact: ${{ steps.create_zip_macos.outputs.MACOS_ARTIFACT }}
macos-shasum: ${{ steps.create_zip_macos.outputs.MACOS_SHASUM }}
# windows-artifact: ${{ steps.create_zip_windows.outputs.WINDOWS_ARTIFACT }}
# windows-shasum: ${{ steps.create_zip_windows.outputs.WINDOWS_SHASUM }}
draft-release:
name: Draft Release
needs: zip-artifacts-creator
runs-on: ubuntu-16.04
steps:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
# ==============================
# Download artifacts
# ==============================
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: openethereum-linux-${{ env.RELEASE_VERSION }}.zip
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: openethereum-macos-${{ env.RELEASE_VERSION }}.zip
# - name: Download artifacts
# uses: actions/download-artifact@v2
# with:
# name: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
- name: Display structure of downloaded files
run: ls
# ==============================
# Create release draft
# ==============================
- name: Create Release Draft
id: create_release_draft
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: OpenEthereum ${{ github.ref }}
body: |
This release contains <ADD_TEXT>
| System | Architecture | Binary | Sha256 Checksum |
|:---:|:---:|:---:|:---|
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/apple.png" alt="Apple Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [${{ needs.zip-artifacts-creator.outputs.macos-artifact }}](https://github.com/openethereum/openethereum/releases/download/${{ env.RELEASE_VERSION }}/${{ needs.zip-artifacts-creator.outputs.macos-artifact }}) | `${{ needs.zip-artifacts-creator.outputs.macos-shasum }}` |
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/linux.png" alt="Linux Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [${{ needs.zip-artifacts-creator.outputs.linux-artifact }}](https://github.com/openethereum/openethereum/releases/download/${{ env.RELEASE_VERSION }}/${{ needs.zip-artifacts-creator.outputs.linux-artifact }}) | `${{ needs.zip-artifacts-creator.outputs.linux-shasum }}` |
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/windows.png" alt="Windows Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | x64 | [${{ needs.zip-artifacts-creator.outputs.windows-artifact }}](https://github.com/openethereum/openethereum/releases/download/${{ env.RELEASE_VERSION }}/${{ needs.zip-artifacts-creator.outputs.windows-artifact }}) | `${{ needs.zip-artifacts-creator.outputs.windows-shasum }}` |
| | | | |
| **System** | **Option** | - | **Resource** |
| <img src="https://gist.github.com/5chdn/1fce888fde1d773761f809b607757f76/raw/44c4f0fc63f1ea8e61a9513af5131ef65eaa6c75/settings.png" alt="Settings Icon by Pixel Perfect from https://www.flaticon.com/authors/pixel-perfect" style="width: 32px;"/> | Docker | - | [hub.docker.com/r/openethereum/openethereum](https://hub.docker.com/r/openethereum/openethereum) |
draft: true
prerelease: true
- name: Upload Release Asset - Linux
id: upload_release_asset_linux
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release_draft.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./openethereum-linux-${{ env.RELEASE_VERSION }}.zip
asset_name: openethereum-linux-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip
- name: Upload Release Asset - MacOS
id: upload_release_asset_macos
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release_draft.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./openethereum-macos-${{ env.RELEASE_VERSION }}.zip
asset_name: openethereum-macos-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip
# - name: Upload Release Asset - Windows
# id: upload_release_asset_windows
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release_draft.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: ./openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# asset_name: openethereum-windows-${{ env.RELEASE_VERSION }}.zip
# asset_content_type: application/zip

50
.github/workflows/check.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: Check
on:
pull_request:
push:
branches:
- main
- dev
jobs:
check:
name: Check
runs-on: ubuntu-16.04
steps:
- name: Checkout sources
uses: actions/checkout@main
with:
submodules: true
- name: Install 1.52.1 toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.52.1
profile: minimal
override: true
- name: Run cargo check 1/3
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --no-default-features --verbose
- name: Run cargo check 2/3
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --manifest-path crates/runtime/io/Cargo.toml --no-default-features --verbose
- name: Run cargo check 3/3
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --manifest-path crates/runtime/io/Cargo.toml --features "mio" --verbose
- name: Run cargo check evmbin
uses: actions-rs/cargo@v1
with:
command: check
args: --locked -p evmbin --verbose
- name: Run cargo check benches
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --all --benches --verbose
- name: Run validate chainspecs
run: ./scripts/actions/validate-chainspecs.sh

View File

@ -0,0 +1,29 @@
name: Docker Image Nightly Release
# Run "nightly" build on each commit to "dev" branch.
on:
push:
branches:
- dev
jobs:
deploy-docker:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@master
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.52.1
profile: minimal
override: true
- name: Deploy to docker hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: openethereum/openethereum
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: scripts/docker/alpine/Dockerfile
tags: "nightly"

30
.github/workflows/deploy-docker-tag.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Docker Image Tag and Latest Release
on:
push:
tags:
- v*
jobs:
deploy-docker:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@master
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.52.1
profile: minimal
override: true
- name: Deploy to docker hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: openethereum/openethereum
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: scripts/docker/alpine/Dockerfile
tags: "latest,${{ env.RELEASE_VERSION }}"

30
.github/workflows/deploy-docker.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Docker Image Release
on:
push:
branches:
- main
tags:
- v*
jobs:
deploy-docker:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@master
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.52.1
profile: minimal
override: true
- name: Deploy to docker hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: openethereum/openethereum
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: scripts/docker/alpine/Dockerfile
tag_names: true

20
.github/workflows/fmt.yml vendored Normal file
View File

@ -0,0 +1,20 @@
on: [push, pull_request]
name: rustfmt
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.52.1
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check --config merge_imports=true

13
.gitignore vendored
View File

@ -15,10 +15,18 @@
# vim stuff
*.swp
*.swo
# mac stuff
.DS_Store
# npm stuff
npm-debug.log
node_modules
# js build artifacts
.git-release.log
# gdb files
.gdb_history
@ -32,5 +40,8 @@
out/
.vscode
rls/
/parity.*
# cargo remote artifacts
remote-target

View File

@ -1,541 +0,0 @@
stages:
- test
- js-build
- push-release
- build
variables:
GIT_DEPTH: "3"
SIMPLECOV: "true"
RUST_BACKTRACE: "1"
RUSTFLAGS: ""
CARGOFLAGS: ""
cache:
key: "$CI_BUILD_STAGE/$CI_BUILD_REF_NAME"
untracked: true
linux-stable:
stage: build
image: ethcore/rust:stable
only:
- beta
- tags
- stable
- triggers
script:
- cargo build -j $(nproc) --release --features final $CARGOFLAGS
- strip target/release/parity
- export SHA3=$(target/release/parity tools hash target/release/parity)
- md5sum target/release/parity > parity.md5
- sh scripts/deb-build.sh amd64
- cp target/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_amd64.deb"
- md5sum "parity_"$VER"_amd64.deb" > "parity_"$VER"_amd64.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity --body target/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/"parity_"$VER"_amd64.deb" --body "parity_"$VER"_amd64.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu/"parity_"$VER"_amd64.deb.md5" --body "parity_"$VER"_amd64.deb.md5"
# - curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/x86_64-unknown-linux-gnu
tags:
- rust
- rust-stable
artifacts:
paths:
- target/release/parity
name: "stable-x86_64-unknown-linux-gnu_parity"
linux-beta:
stage: build
image: ethcore/rust:beta
only:
- beta
- tags
- stable
- triggers
script:
- cargo build -j $(nproc) --release $CARGOFLAGS
- strip target/release/parity
tags:
- rust
- rust-beta
artifacts:
paths:
- target/release/parity
name: "beta-x86_64-unknown-linux-gnu_parity"
allow_failure: true
linux-nightly:
stage: build
image: ethcore/rust:nightly
only:
- beta
- tags
- stable
- triggers
script:
- cargo build -j $(nproc) --release $CARGOFLAGS
- strip target/release/parity
tags:
- rust
- rust-nightly
artifacts:
paths:
- target/release/parity
name: "nigthly-x86_64-unknown-linux-gnu_parity"
allow_failure: true
linux-centos:
stage: build
image: ethcore/rust-centos:latest
only:
- beta
- tags
- stable
- triggers
script:
- export CXX="g++"
- export CC="gcc"
- export PLATFORM=x86_64-unknown-centos-gnu
- cargo build -j $(nproc) --release --features final $CARGOFLAGS
- strip target/release/parity
- md5sum target/release/parity > parity.md5
- export SHA3=$(target/release/parity tools hash target/release/parity)
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu/parity --body target/release/parity
- aws s3api put-object --bucket builds-parity --key $CI_BUILD_REF_NAME/x86_64-unknown-centos-gnu/parity.md5 --body parity.md5
# - curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-centos
artifacts:
paths:
- target/release/parity
name: "x86_64-unknown-centos-gnu_parity"
linux-i686:
stage: build
image: ethcore/rust-i686:latest
only:
- beta
- tags
- stable
- triggers
script:
- export HOST_CC=gcc
- export HOST_CXX=g++
- export COMMIT=$(git rev-parse HEAD)
- export PLATFORM=i686-unknown-linux-gnu
- cargo build -j $(nproc) --target i686-unknown-linux-gnu --features final --release $CARGOFLAGS
- strip target/$PLATFORM/release/parity
- md5sum target/$PLATFORM/release/parity > parity.md5
- export SHA3=$(target/$PLATFORM/release/parity tools hash target/$PLATFORM/release/parity)
- sh scripts/deb-build.sh i386
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_i386.deb"
- md5sum "parity_"$VER"_i386.deb" > "parity_"$VER"_i386.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_i386.deb" --body "parity_"$VER"_i386.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_i386.deb.md5" --body "parity_"$VER"_i386.deb.md5"
# - curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-i686
artifacts:
paths:
- target/i686-unknown-linux-gnu/release/parity
name: "i686-unknown-linux-gnu"
allow_failure: true
linux-armv7:
stage: build
image: ethcore/rust-armv7:latest
only:
- beta
- tags
- stable
- triggers
script:
- export CC=arm-linux-gnueabihf-gcc
- export CXX=arm-linux-gnueabihf-g++
- export HOST_CC=gcc
- export HOST_CXX=g++
- export PLATFORM=armv7-unknown-linux-gnueabihf
- rm -rf .cargo
- mkdir -p .cargo
- echo "[target.$PLATFORM]" >> .cargo/config
- echo "linker= \"arm-linux-gnueabihf-gcc\"" >> .cargo/config
- cat .cargo/config
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
- arm-linux-gnueabihf-strip target/$PLATFORM/release/parity
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
- md5sum target/$PLATFORM/release/parity > parity.md5
- sh scripts/deb-build.sh armhf
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_armhf.deb"
- md5sum "parity_"$VER"_armhf.deb" > "parity_"$VER"_armhf.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_armhf.deb" --body "parity_"$VER"_armhf.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_armhf.deb.md5" --body "parity_"$VER"_armhf.deb.md5"
# - curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-arm
artifacts:
paths:
- target/armv7-unknown-linux-gnueabihf/release/parity
name: "armv7_unknown_linux_gnueabihf_parity"
allow_failure: true
linux-arm:
stage: build
image: ethcore/rust-arm:latest
only:
- beta
- tags
- stable
- triggers
script:
- export CC=arm-linux-gnueabihf-gcc
- export CXX=arm-linux-gnueabihf-g++
- export HOST_CC=gcc
- export HOST_CXX=g++
- export PLATFORM=arm-unknown-linux-gnueabihf
- rm -rf .cargo
- mkdir -p .cargo
- echo "[target.$PLATFORM]" >> .cargo/config
- echo "linker= \"arm-linux-gnueabihf-gcc\"" >> .cargo/config
- cat .cargo/config
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
- arm-linux-gnueabihf-strip target/$PLATFORM/release/parity
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
- md5sum target/$PLATFORM/release/parity > parity.md5
- sh scripts/deb-build.sh armhf
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_armhf.deb"
- md5sum "parity_"$VER"_armhf.deb" > "parity_"$VER"_armhf.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_armhf.deb" --body "parity_"$VER"_armhf.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_armhf.deb.md5" --body "parity_"$VER"_armhf.deb.md5"
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://icarus.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-arm
artifacts:
paths:
- target/arm-unknown-linux-gnueabihf/release/parity
name: "arm-unknown-linux-gnueabihf_parity"
allow_failure: true
linux-armv6:
stage: build
image: ethcore/rust-armv6:latest
only:
- beta
# - tags
# - stable
# - triggers
script:
- export CC=arm-linux-gnueabi-gcc
- export CXX=arm-linux-gnueabi-g++
- export HOST_CC=gcc
- export HOST_CXX=g++
- export PLATFORM=arm-unknown-linux-gnueabi
- rm -rf .cargo
- mkdir -p .cargo
- echo "[target.$PLATFORM]" >> .cargo/config
- echo "linker= \"arm-linux-gnueabi-gcc\"" >> .cargo/config
- cat .cargo/config
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
- arm-linux-gnueabi-strip target/$PLATFORM/release/parity
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
- md5sum target/$PLATFORM/release/parity > parity.md5
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/$PLATFORM/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
# - curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-arm
artifacts:
paths:
- target/arm-unknown-linux-gnueabi/release/parity
name: "arm-unknown-linux-gnueabi_parity"
allow_failure: true
linux-aarch64:
stage: build
image: ethcore/rust-aarch64:latest
only:
- beta
- tags
- stable
- triggers
script:
- export CC=aarch64-linux-gnu-gcc
- export CXX=aarch64-linux-gnu-g++
- export HOST_CC=gcc
- export HOST_CXX=g++
- export PLATFORM=aarch64-unknown-linux-gnu
- rm -rf .cargo
- mkdir -p .cargo
- echo "[target.$PLATFORM]" >> .cargo/config
- echo "linker= \"aarch64-linux-gnu-gcc\"" >> .cargo/config
- cat .cargo/config
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
- aarch64-linux-gnu-strip target/$PLATFORM/release/parity
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
- md5sum target/$PLATFORM/release/parity > parity.md5
- sh scripts/deb-build.sh arm64
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- dpkg-deb -b deb "parity_"$VER"_arm64.deb"
- md5sum "parity_"$VER"_arm64.deb" > "parity_"$VER"_arm64.deb.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_arm64.deb" --body "parity_"$VER"_arm64.deb"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity_"$VER"_arm64.deb.md5" --body "parity_"$VER"_arm64.deb.md5"
# - curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- rust
- rust-arm
artifacts:
paths:
- target/aarch64-unknown-linux-gnu/release/parity
name: "aarch64-unknown-linux-gnu_parity"
allow_failure: true
darwin:
stage: build
only:
- beta
- tags
- stable
- triggers
script:
- export COMMIT=$(git rev-parse HEAD)
- export PLATFORM=x86_64-apple-darwin
- cargo build -j 8 --features final --release #$CARGOFLAGS
- cargo build -j 8 --features final --release -p ethstore #$CARGOFLAGS
- rm -rf parity.md5
- md5sum target/release/parity > parity.md5
- export SHA3=$(target/release/parity tools hash target/release/parity)
- packagesbuild -v mac/Parity.pkgproj
- export VER=$(grep -m 1 version Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n")
- mv target/release/Parity\ Ethereum.pkg "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg"
- md5sum "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg" >> "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg.md5"
- aws configure set aws_access_key_id $s3_key
- aws configure set aws_secret_access_key $s3_secret
- if [[ $CI_BUILD_REF_NAME =~ ^(master|beta|stable)$ ]]; then export S3_BUCKET=builds-parity-published; else export S3_BUCKET=builds-parity; fi
- aws s3 rm --recursive s3://$S3_BUCKET/$CI_BUILD_REF_NAME/$PLATFORM
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity --body target/release/parity
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/parity.md5 --body parity.md5
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity-"$VER"-osx-installer-EXPERIMENTAL.pkg" --body "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg"
- aws s3api put-object --bucket $S3_BUCKET --key $CI_BUILD_REF_NAME/$PLATFORM/"parity-"$VER"-osx-installer-EXPERIMENTAL.pkg.md5" --body "parity-"$VER"-osx-installer-EXPERIMENTAL.pkg.md5"
# - curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1337/push-build/$CI_BUILD_REF_NAME/$PLATFORM
- curl --data "commit=$CI_BUILD_REF&sha3=$SHA3&filename=parity&secret=$RELEASES_SECRET" http://update.parity.io:1338/push-build/$CI_BUILD_REF_NAME/$PLATFORM
tags:
- osx
artifacts:
paths:
- target/release/parity
name: "x86_64-apple-darwin_parity"
windows:
cache:
key: "%CI_BUILD_STAGE%/%CI_BUILD_REF_NAME%"
untracked: true
stage: build
only:
- beta
- tags
- stable
- triggers
script:
- set PLATFORM=x86_64-pc-windows-msvc
- set INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
- set LIB=C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64
- set RUST_BACKTRACE=1
- set RUSTFLAGS=%RUSTFLAGS%
- rustup default stable-x86_64-pc-windows-msvc
- cargo build --features final --release #%CARGOFLAGS%
- signtool sign /f %keyfile% /p %certpass% target\release\parity.exe
- target\release\parity.exe tools hash target\release\parity.exe > parity.sha3
- set /P SHA3=<parity.sha3
- curl -sL --url "https://github.com/ethcore/win-build/raw/master/SimpleFC.dll" -o nsis\SimpleFC.dll
- curl -sL --url "https://github.com/ethcore/win-build/raw/master/vc_redist.x64.exe" -o nsis\vc_redist.x64.exe
- msbuild windows\ptray\ptray.vcxproj /p:Platform=x64 /p:Configuration=Release
- signtool sign /f %keyfile% /p %certpass% windows\ptray\x64\release\ptray.exe
- cd nsis
- makensis.exe installer.nsi
- copy installer.exe InstallParity.exe
- signtool sign /f %keyfile% /p %certpass% InstallParity.exe
- md5sums InstallParity.exe > InstallParity.exe.md5
- zip win-installer.zip InstallParity.exe InstallParity.exe.md5
- md5sums win-installer.zip > win-installer.zip.md5
- cd ..\target\release\
- md5sums parity.exe parity.pdb > parity.md5
- md5sums parity.exe > parity.exe.md5
- zip parity.zip parity.exe parity.pdb parity.md5
- md5sums parity.zip > parity.zip.md5
- cd ..\..
- aws configure set aws_access_key_id %s3_key%
- aws configure set aws_secret_access_key %s3_secret%
- echo %CI_BUILD_REF_NAME%
- echo %CI_BUILD_REF_NAME% | findstr /R "master" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
- echo %CI_BUILD_REF_NAME% | findstr /R "beta" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
- echo %CI_BUILD_REF_NAME% | findstr /R "stable" >nul 2>&1 && set S3_BUCKET=builds-parity-published || set S3_BUCKET=builds-parity
- echo %S3_BUCKET%
- aws s3 rm --recursive s3://%S3_BUCKET%/%CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.exe --body target\release\parity.exe
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.exe.md5 --body target\release\parity.exe.md5
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.zip --body target\release\parity.zip
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/parity.zip.md5 --body target\release\parity.zip.md5
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/InstallParity.exe --body nsis\InstallParity.exe
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/InstallParity.exe.md5 --body nsis\InstallParity.exe.md5
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/win-installer.zip --body nsis\win-installer.zip
- aws s3api put-object --bucket %S3_BUCKET% --key %CI_BUILD_REF_NAME%/x86_64-pc-windows-msvc/win-installer.zip.md5 --body nsis\win-installer.zip.md5
# - curl --data "commit=%CI_BUILD_REF%&sha3=%SHA3%&filename=parity.exe&secret=%RELEASES_SECRET%" http://update.parity.io:1337/push-build/%CI_BUILD_REF_NAME%/%PLATFORM%
- curl --data "commit=%CI_BUILD_REF%&sha3=%SHA3%&filename=parity.exe&secret=%RELEASES_SECRET%" http://update.parity.io:1338/push-build/%CI_BUILD_REF_NAME%/%PLATFORM%
tags:
- rust-windows
artifacts:
paths:
- target/release/parity.exe
- target/release/parity.pdb
- nsis/InstallParity.exe
name: "x86_64-pc-windows-msvc_parity"
test-darwin:
stage: test
only:
- triggers
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)
script:
- 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
tags:
- osx
allow_failure: true
test-windows:
stage: test
only:
- triggers
before_script:
- git submodule update --init --recursive
script:
- set RUST_BACKTRACE=1
- echo cargo test --features json-tests -p rlp -p ethash -p ethcore -p ethcore-bigint -p ethcore-dapps -p ethcore-rpc -p ethcore-signer -p ethcore-util -p ethcore-network -p ethcore-io -p ethkey -p ethstore -p ethsync -p ethcore-ipc -p ethcore-ipc-tests -p ethcore-ipc-nano -p parity %CARGOFLAGS% --verbose --release
tags:
- rust-windows
allow_failure: true
test-rust-stable:
stage: test
image: ethcore/rust:stable
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)
script:
- 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
tags:
- rust
- rust-stable
js-test:
stage: test
image: ethcore/rust:stable
before_script:
- git submodule update --init --recursive
- export JS_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep ^js/ | wc -l)
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS deps install since no JS files modified."; else ./js/scripts/install-deps.sh;fi
script:
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS lint since no JS files modified."; else ./js/scripts/lint.sh && ./js/scripts/test.sh && ./js/scripts/build.sh; fi
tags:
- rust
- rust-stable
test-rust-beta:
stage: test
only:
- triggers
image: ethcore/rust:beta
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)
script:
- 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
tags:
- rust
- rust-beta
allow_failure: true
test-rust-nightly:
stage: test
only:
- triggers
image: ethcore/rust:nightly
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)
script:
- 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
tags:
- rust
- rust-nightly
allow_failure: true
js-release:
stage: js-build
only:
- master
- beta
- stable
image: ethcore/rust:stable
before_script:
- export JS_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep ^js/ | wc -l)
- echo $JS_FILES_MODIFIED
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS deps install since no JS files modified."; else ./js/scripts/install-deps.sh;fi
script:
- echo $JS_FILES_MODIFIED
- if [ $JS_FILES_MODIFIED -eq 0 ]; then echo "Skipping JS rebuild since no JS files modified."; else ./js/scripts/build.sh && ./js/scripts/release.sh; fi
tags:
- javascript
push-release:
stage: push-release
only:
- beta
- tags
- stable
- triggers
image: ethcore/rust:stable
script:
# - curl --data "secret=$RELEASES_SECRET" http://update.parity.io:1337/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF
- curl --data "secret=$RELEASES_SECRET" http://update.parity.io:1338/push-release/$CI_BUILD_REF_NAME/$CI_BUILD_REF
tags:
- curl

5
.gitmodules vendored
View File

@ -1,4 +1,3 @@
[submodule "ethcore/res/ethereum/tests"]
path = ethcore/res/ethereum/tests
[submodule "crates/ethcore/res/json_tests"]
path = crates/ethcore/res/json_tests
url = https://github.com/ethereum/tests.git
branch = develop

View File

@ -1,85 +0,0 @@
sudo: required
dist: trusty
language: rust
branches:
only:
- master
- /^beta-.*$/
- /^stable-.*$/
- /^beta$/
- /^stable$/
git:
depth: 3
matrix:
include:
- rust: stable
env: RUN_TESTS="true" TEST_OPTIONS=""
- rust: stable
env: RUN_COVERAGE="true"
- rust: stable
env: RUN_DOCS="true"
env:
global:
- CXX="g++-4.8"
- CC="gcc-4.8"
- RUST_BACKTRACE="1"
- RUN_TESTS="false"
- RUN_COVERAGE="false"
- RUN_DOCS="false"
- TEST_OPTIONS=""
- RUSTFLAGS="-D warnings"
- TRAVIS_NODE_VERSION="6"
# GH_TOKEN for documentation
- secure: bumJASbZSU8bxJ0EyPUJmu16AiV9EXOpyOj86Jlq/Ty9CfwGqsSXt96uDyE+OUJf34RUFQMsw0nk37/zC4lcn6kqk2wpuH3N/o85Zo/cVZY/NusBWLQqtT5VbYWsV+u2Ua4Tmmsw8yVYQhYwU2ZOejNpflL+Cs9XGgORp1L+/gMRMC2y5Se6ZhwnKPQlRJ8LGsG1dzjQULxzADIt3/zuspNBS8a2urJwlHfGMkvHDoUWCviP/GXoSqw3TZR7FmKyxE19I8n9+iSvm9+oZZquvcgfUxMHn8Gq/b44UbPvjtFOg2yam4xdWXF/RyWCHdc/R9EHorSABeCbefIsm+zcUF3/YQxwpSxM4IZEeH2rTiC7dcrsKw3XsO16xFQz5YI5Bay+CT/wTdMmJd7DdYz7Dyf+pOvcM9WOf/zorxYWSBOMYy0uzbusU2iyIghQ82s7E/Ahg+WARtPgkuTLSB5aL1oCTBKHqQscMr7lo5Ti6RpWLxEdTQMBznc+bMr+6dEtkEcG9zqc6cE9XX+ox3wTU6+HVMfQ1ltCntJ4UKcw3A6INEbw9wgocQa812CIASQ2fE+SCAbz6JxBjIAlFUnD1lUB7S8PdMPwn9plfQgKQ2A5YZqg6FnBdf0rQXIJYxQWKHXj/rBHSUCT0tHACDlzTA+EwWggvkP5AGIxRxm8jhw=
- KCOV_CMD="./kcov-master/tmp/usr/local/bin/kcov"
cache:
apt: true
directories:
- $TRAVIS_BUILD_DIR/target
- $TRAVIS_BUILD_DIR/kcov-master
- $TRAVIS_BUILD_DIR/js/node_modules
- $HOME/.cargo
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- gcc-4.8
- g++-4.8
install:
- ([ "$RUN_COVERAGE" = "false" ]) || (test -x $KCOV_CMD) || (
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
mkdir -p kcov-master/build &&
cd kcov-master/build &&
cmake .. &&
make && make install DESTDIR=../tmp &&
cd
)
- nvm install $TRAVIS_NODE_VERSION && nvm use $TRAVIS_NODE_VERSION && ./js/scripts/install-deps.sh
script:
- if [ "$RUN_TESTS" = "true" ]; then
./js/scripts/lint.sh &&
travis_wait 40 ./test.sh $TEST_OPTIONS;
fi
- if [ "$RUN_COVERAGE" = "true" ]; then ./scripts/cov.sh "$KCOV_CMD"; fi
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
[ "$RUN_DOCS" = "true" ] &&
./scripts/doc.sh &&
pip install --user ghp-import &&
/home/travis/.local/bin/ghp-import -n target/doc &&
git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages

208
CHANGELOG.md Normal file
View File

@ -0,0 +1,208 @@
## OpenEthereum v3.3.3
Enhancements:
* Implement eip-3607 (#593)
Bug fixes:
* Add type field for legacy transactions in RPC calls (#580)
* Makes eth_mining to return False if not is not allowed to seal (#581)
* Made nodes data concatenate as RLP sequences instead of bytes (#598)
## OpenEthereum v3.3.2
Enhancements:
* London hardfork block: Sokol (24114400)
Bug fixes:
* Fix for maxPriorityFeePerGas overflow
## OpenEthereum v3.3.1
Enhancements:
* Add eth_maxPriorityFeePerGas implementation (#570)
* Add a bootnode for Kovan
Bug fixes:
* Fix for modexp overflow in debug mode (#578)
## OpenEthereum v3.3.0
Enhancements:
* Add `validateServiceTransactionsTransition` spec option to be able to enable additional checking of zero gas price transactions by block verifier
## OpenEthereum v3.3.0-rc.15
* Revert eip1559BaseFeeMinValue activation on xDai at London hardfork block
## OpenEthereum v3.3.0-rc.14
Enhancements:
* Add eip1559BaseFeeMinValue and eip1559BaseFeeMinValueTransition spec options
* Activate eip1559BaseFeeMinValue on xDai at London hardfork block (19040000), set it to 20 GWei
* Activate eip1559BaseFeeMinValue on POA Core at block 24199500 (November 8, 2021), set it to 10 GWei
* Delay difficulty bomb to June 2022 for Ethereum Mainnet (EIP-4345)
## OpenEthereum v3.3.0-rc.13
Enhancements:
* London hardfork block: POA Core (24090200)
## OpenEthereum v3.3.0-rc.12
Enhancements:
* London hardfork block: xDai (19040000)
## OpenEthereum v3.3.0-rc.11
Bug fixes:
* Ignore GetNodeData requests only for non-AuRa chains
## OpenEthereum v3.3.0-rc.10
Enhancements:
* Add eip1559FeeCollector and eip1559FeeCollectorTransition spec options
## OpenEthereum v3.3.0-rc.9
Bug fixes:
* Add service transactions support for EIP-1559
* Fix MinGasPrice config option for POSDAO and EIP-1559
Enhancements:
* min_gas_price becomes min_effective_priority_fee
* added version 4 for TxPermission contract
## OpenEthereum v3.3.0-rc.8
Bug fixes:
* Ignore GetNodeData requests (#519)
## OpenEthereum v3.3.0-rc.7
Bug fixes:
* GetPooledTransactions is sent in invalid form (wrong packet id)
## OpenEthereum v3.3.0-rc.6
Enhancements:
* London hardfork block: kovan (26741100) (#502)
## OpenEthereum v3.3.0-rc.4
Enhancements:
* London hardfork block: mainnet (12,965,000) (#475)
* Support for eth/66 protocol version (#465)
* Bump ethereum/tests to v9.0.3
* Add eth_feeHistory
Bug fixes:
* GetNodeData from eth63 is missing (#466)
* Effective gas price not omitting (#477)
* London support in openethereum-evm (#479)
* gasPrice is required field for Transaction object (#481)
## OpenEthereum v3.3.0-rc.3
Bug fixes:
* Add effective_gas_price to eth_getTransactionReceipt #445 (#450)
* Update eth_gasPrice to support EIP-1559 #449 (#458)
* eth_estimateGas returns "Requires higher than upper limit of X" after London Ropsten Hard Fork #459 (#460)
## OpenEthereum v3.3.0-rc.2
Enhancements:
* EIP-1559: Fee market change for ETH 1.0 chain
* EIP-3198: BASEFEE opcode
* EIP-3529: Reduction in gas refunds
* EIP-3541: Reject new contracts starting with the 0xEF byte
* Delay difficulty bomb to December 2021 (EIP-3554)
* London hardfork blocks: goerli (5,062,605), rinkeby (8,897,988), ropsten (10,499,401)
* Add chainspecs for aleut and baikal
* Bump ethereum/tests to v9.0.2
## OpenEthereum v3.2.6
Enhancement:
* Berlin hardfork blocks: poacore (21,364,900), poasokol (21,050,600)
## OpenEthereum v3.2.5
Bug fixes:
* Backport: Block sync stopped without any errors. #277 (#286)
* Strict memory order (#306)
Enhancements:
* Executable queue for ancient blocks inclusion (#208)
* Backport AuRa commits for xdai (#330)
* Add Nethermind to clients that accept service transactions (#324)
* Implement the filter argument in parity_pendingTransactions (#295)
* Ethereum-types and various libs upgraded (#315)
* [evmbin] Omit storage output, now for std-json (#311)
* Freeze pruning while creating snapshot (#205)
* AuRa multi block reward (#290)
* Improved metrics. DB read/write. prometheus prefix config (#240)
* Send RLPx auth in EIP-8 format (#287)
* rpc module reverted for RPC JSON api (#284)
* Revert "Remove eth/63 protocol version (#252)"
* Support for eth/65 protocol version (#366)
* Berlin hardfork blocks: kovan (24,770,900), xdai (16,101,500)
* Bump ethereum/tests to v8.0.3
devops:
* Upgrade docker alpine to `v1.13.2`. for rust `v1.47`.
* Send SIGTERM instead of SIGHUP to OE daemon (#317)
## OpenEthereum v3.2.4
* Fix for Typed transaction broadcast.
## OpenEthereum v3.2.3
* Hotfix for berlin consensus error.
## OpenEthereum v3.2.2-rc.1
Bug fixes:
* Backport: Block sync stopped without any errors. #277 (#286)
* Strict memory order (#306)
Enhancements:
* Executable queue for ancient blocks inclusion (#208)
* Backport AuRa commits for xdai (#330)
* Add Nethermind to clients that accept service transactions (#324)
* Implement the filter argument in parity_pendingTransactions (#295)
* Ethereum-types and various libs upgraded (#315)
* Bump ethereum/tests to v8.0.2
* [evmbin] Omit storage output, now for std-json (#311)
* Freeze pruning while creating snapshot (#205)
* AuRa multi block reward (#290)
* Improved metrics. DB read/write. prometheus prefix config (#240)
* Send RLPx auth in EIP-8 format (#287)
* rpc module reverted for RPC JSON api (#284)
* Revert "Remove eth/63 protocol version (#252)"
devops:
* Upgrade docker alpine to `v1.13.2`. for rust `v1.47`.
* Send SIGTERM instead of SIGHUP to OE daemon (#317)
## OpenEthereum v3.2.1
Hot fix issue, related to initial sync:
* Initial sync gets stuck. (#318)
## OpenEthereum v3.2.0
Bug fixes:
* Update EWF's chains with Istanbul transition block numbers (#11482) (#254)
* fix Supplied instant is later than self (#169)
* ethcore/snapshot: fix double-lock in Service::feed_chunk (#289)
Enhancements:
* Berlin hardfork blocks: mainnet (12,244,000), goerli (4,460,644), rinkeby (8,290,928) and ropsten (9,812,189)
* yolo3x spec (#241)
* EIP-2930 RPC support
* Remove eth/63 protocol version (#252)
* Snapshot manifest block added to prometheus (#232)
* EIP-1898: Allow default block parameter to be blockHash
* Change ProtocolId to U64
* Update ethereum/tests

6026
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,96 +1,133 @@
[package]
description = "Parity Ethereum client"
name = "parity"
version = "1.5.0"
description = "OpenEthereum"
name = "openethereum"
# NOTE Make sure to update util/version/Cargo.toml as well
version = "3.3.3"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
[build-dependencies]
rustc_version = "0.1"
ethcore-ipc-codegen = { path = "ipc/codegen" }
ethcore-ipc-tests = { path = "ipc/tests" }
authors = [
"OpenEthereum developers",
"Parity Technologies <admin@parity.io>"
]
[dependencies]
log = "0.3"
env_logger = "0.3"
rustc-serialize = "0.3"
docopt = "0.6"
time = "0.1"
num_cpus = "0.2"
blooms-db = { path = "crates/db/blooms-db" }
log = "0.4"
rustc-hex = "1.0"
docopt = "1.0"
clap = "2"
term_size = "0.3"
textwrap = "0.9"
num_cpus = "1.2"
number_prefix = "0.2"
rpassword = "0.2.1"
semver = "0.5"
ansi_term = "0.7"
lazy_static = "0.2"
regex = "0.1"
isatty = "0.1"
toml = "0.2"
serde = "0.8.0"
serde_json = "0.8.0"
app_dirs = "1.1.1"
hyper = { version = "0.9", default-features = false }
ctrlc = { git = "https://github.com/ethcore/rust-ctrlc.git" }
rpassword = "1.0"
semver = "0.9"
ansi_term = "0.10"
parking_lot = "0.11.1"
regex = "1.0"
atty = "0.2.8"
toml = "0.4"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
futures = "0.1"
hyper = { version = "0.12" }
fdlimit = "0.1"
clippy = { version = "0.0.103", optional = true}
rlp = { path = "util/rlp" }
ethsync = { path = "sync" }
ethcore = { path = "ethcore" }
ethcore-util = { path = "util" }
ethcore-io = { path = "util/io" }
ethcore-devtools = { path = "devtools" }
ethcore-rpc = { path = "rpc" }
ethcore-signer = { path = "signer" }
ethcore-ipc = { path = "ipc/rpc" }
ethcore-ipc-nano = { path = "ipc/nano" }
ethcore-ipc-hypervisor = { path = "ipc/hypervisor" }
ethcore-logger = { path = "logger" }
ethcore-stratum = { path = "stratum" }
ethcore-dapps = { path = "dapps", optional = true }
rpc-cli = { path = "rpc_cli" }
parity-rpc-client = { path = "rpc_client" }
ethcore-light = { path = "ethcore/light" }
parity-hash-fetch = { path = "hash-fetch" }
parity-updater = { path = "updater" }
parity-reactor = { path = "util/reactor" }
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
jsonrpc-core = "15.0.0"
parity-bytes = "0.1"
common-types = { path = "crates/ethcore/types" }
ethcore = { path = "crates/ethcore", features = ["parity"] }
ethcore-accounts = { path = "crates/accounts", optional = true }
ethcore-blockchain = { path = "crates/ethcore/blockchain" }
ethcore-call-contract = { path = "crates/vm/call-contract"}
ethcore-db = { path = "crates/db/db" }
ethcore-io = { path = "crates/runtime/io" }
ethcore-logger = { path = "bin/oe/logger" }
ethcore-miner = { path = "crates/concensus/miner" }
ethcore-network = { path = "crates/net/network" }
ethcore-service = { path = "crates/ethcore/service" }
ethcore-sync = { path = "crates/ethcore/sync" }
ethereum-types = "0.9.2"
ethkey = { path = "crates/accounts/ethkey" }
ethstore = { path = "crates/accounts/ethstore" }
fetch = { path = "crates/net/fetch" }
node-filter = { path = "crates/net/node-filter" }
parity-crypto = { version = "0.6.2", features = [ "publickey" ] }
rlp = { version = "0.4.6" }
cli-signer= { path = "crates/util/cli-signer" }
parity-daemonize = "0.3"
parity-local-store = { path = "crates/concensus/miner/local-store" }
parity-runtime = { path = "crates/runtime/runtime" }
parity-rpc = { path = "crates/rpc" }
parity-version = { path = "crates/util/version" }
parity-path = "0.1"
dir = { path = "crates/util/dir" }
panic_hook = { path = "crates/util/panic-hook" }
keccak-hash = "0.5.0"
migration-rocksdb = { path = "crates/db/migration-rocksdb" }
kvdb = "0.1"
kvdb-rocksdb = "0.1.3"
journaldb = { path = "crates/db/journaldb" }
stats = { path = "crates/util/stats" }
prometheus = "0.9.0"
# ethcore-secretstore = { path = "crates/util/secret-store", optional = true }
[build-dependencies]
rustc_version = "0.2"
[dev-dependencies]
pretty_assertions = "0.1"
ipnetwork = "0.12.6"
tempdir = "0.3"
fake-fetch = { path = "crates/net/fake-fetch" }
lazy_static = "1.2.0"
[target.'cfg(windows)'.dependencies]
winapi = "0.2"
[target.'cfg(not(windows))'.dependencies]
daemonize = "0.2"
winapi = { version = "0.3.4", features = ["winsock2", "winuser", "shellapi"] }
[features]
default = ["ui-precompiled"]
ui = [
"dapps",
"ethcore-dapps/ui",
"ethcore-signer/ui",
]
ui-precompiled = [
"dapps",
"ethcore-signer/ui-precompiled",
"ethcore-dapps/ui-precompiled",
]
dapps = ["ethcore-dapps"]
ipc = ["ethcore/ipc", "ethsync/ipc"]
jit = ["ethcore/jit"]
dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev", "ethcore-dapps/dev", "ethcore-signer/dev"]
default = ["accounts"]
accounts = ["ethcore-accounts", "parity-rpc/accounts"]
miner-debug = ["ethcore/miner-debug"]
json-tests = ["ethcore/json-tests"]
ci-skip-tests = ["ethcore/ci-skip-tests"]
test-heavy = ["ethcore/test-heavy"]
stratum = ["ipc"]
ethkey-cli = ["ethcore/ethkey-cli"]
ethstore-cli = ["ethcore/ethstore-cli"]
evm-debug = ["ethcore/evm-debug"]
evm-debug-tests = ["ethcore/evm-debug-tests"]
slow-blocks = ["ethcore/slow-blocks"]
final = ["ethcore-util/final"]
final = ["parity-version/final"]
deadlock_detection = ["parking_lot/deadlock_detection"]
# to create a memory profile (requires nightly rust), use e.g.
# `heaptrack /path/to/parity <parity params>`,
# to visualize a memory profile, use `heaptrack_gui`
# or
# `valgrind --tool=massif /path/to/parity <parity params>`
# and `massif-visualizer` for visualization
memory_profiling = []
[lib]
path = "bin/oe/lib.rs"
[[bin]]
path = "parity/main.rs"
name = "parity"
path = "bin/oe/main.rs"
name = "openethereum"
[profile.test]
lto = false
opt-level = 3 # makes tests slower to compile, but faster to run
[profile.release]
debug = false
lto = false
panic = "abort"
lto = true
[workspace]
# This should only list projects that are not
# in the dependency tree in any other way
# (i.e. pretty much only standalone CLI tools)
members = [
"bin/ethkey",
"bin/ethstore",
"bin/evmbin",
"bin/chainspec"
]

365
README.md
View File

@ -1,131 +1,318 @@
# [Parity](https://ethcore.io/parity.html)
### Fast, light, and robust Ethereum implementation
# OpenEthereum
[![Build Status][travis-image]][travis-url] [![build status](https://gitlab.ethcore.io/Mirrors/ethcore-parity/badges/master/build.svg)](https://gitlab.ethcore.io/Mirrors/ethcore-parity/commits/master) [![Coverage Status][coveralls-image]][coveralls-url] [![GPLv3][license-image]][license-url]
Fast and feature-rich multi-network Ethereum client.
### Join the chat!
[» Download the latest release «](https://github.com/openethereum/openethereum/releases/latest)
Parity [![Join the chat at https://gitter.im/ethcore/parity][gitter-image]][gitter-url] and
parity.js [![Join the chat at https://gitter.im/ethcore/parity.js](https://badges.gitter.im/ethcore/parity.js.svg)](https://gitter.im/ethcore/parity.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![GPL licensed][license-badge]][license-url]
[![Build Status][ci-badge]][ci-url]
[![Discord chat][chat-badge]][chat-url]
[Internal Documentation][doc-url]
[license-badge]: https://img.shields.io/badge/license-GPL_v3-green.svg
[license-url]: LICENSE
[ci-badge]: https://github.com/openethereum/openethereum/workflows/Build%20and%20Test%20Suite/badge.svg
[ci-url]: https://github.com/openethereum/openethereum/actions
[chat-badge]: https://img.shields.io/discord/669192218728202270.svg?logo=discord
[chat-url]: https://discord.io/openethereum
## Table of Contents
1. [Description](#chapter-001)
2. [Technical Overview](#chapter-002)
3. [Building](#chapter-003)<br>
3.1 [Building Dependencies](#chapter-0031)<br>
3.2 [Building from Source Code](#chapter-0032)<br>
3.3 [Starting OpenEthereum](#chapter-0034)
4. [Testing](#chapter-004)
5. [Documentation](#chapter-005)
6. [Toolchain](#chapter-006)
7. [Contributing](#chapter-008)
8. [License](#chapter-009)
Be sure to check out [our wiki][wiki-url] for more information.
## 1. Description <a id="chapter-001"></a>
[travis-image]: https://travis-ci.org/ethcore/parity.svg?branch=master
[travis-url]: https://travis-ci.org/ethcore/parity
[coveralls-image]: https://coveralls.io/repos/github/ethcore/parity/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/github/ethcore/parity?branch=master
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg
[gitter-url]: https://gitter.im/ethcore/parity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[license-image]: https://img.shields.io/badge/license-GPL%20v3-green.svg
[license-url]: https://www.gnu.org/licenses/gpl-3.0.en.html
[doc-url]: https://ethcore.github.io/parity/ethcore/index.html
[wiki-url]: https://github.com/ethcore/parity/wiki
**Built for mission-critical use**: Miners, service providers, and exchanges need fast synchronisation and maximum uptime. OpenEthereum provides the core infrastructure essential for speedy and reliable services.
**Parity requires Rust version 1.12.0 to build**
- Clean, modular codebase for easy customisation
- Advanced CLI-based client
- Minimal memory and storage footprint
- Synchronise in hours, not days with Warp Sync
- Modular for light integration into your service or product
----
## 2. Technical Overview <a id="chapter-002"></a>
OpenEthereum's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing OpenEthereum using the **Rust programming language**. OpenEthereum is licensed under the GPLv3 and can be used for all your Ethereum needs.
## About Parity
By default, OpenEthereum runs a JSON-RPC HTTP server on port `:8545` and a Web-Sockets server on port `:8546`. This is fully configurable and supports a number of APIs.
Parity's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity using the sophisticated and
cutting-edge Rust programming language. Parity is licensed under the GPLv3, and can be used for all your Ethereum needs.
If you run into problems while using OpenEthereum, check out the [old wiki for documentation](https://openethereum.github.io/), feel free to [file an issue in this repository](https://github.com/openethereum/openethereum/issues/new), or hop on our [Discord](https://discord.io/openethereum) chat room to ask a question. We are glad to help!
Parity comes with a built-in wallet. To access [Parity Wallet](http://127.0.0.1:8080/) this simply go to http://127.0.0.1:8080/. It
includes various functionality allowing you to:
- create and manage your Ethereum accounts;
- manage your Ether and any Ethereum tokens;
- create and register your own tokens;
- and much more.
You can download OpenEthereum's latest release at [the releases page](https://github.com/openethereum/openethereum/releases) or follow the instructions below to build from source. Read the [CHANGELOG.md](CHANGELOG.md) for a list of all changes between different versions.
By default, Parity will also run a JSONRPC server on `127.0.0.1:8545`. This is fully configurable and supports a number
of RPC APIs.
## 3. Building <a id="chapter-003"></a>
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!
### 3.1 Build Dependencies <a id="chapter-0031"></a>
Parity's current release is 1.3. You can download it at https://ethcore.io/parity.html or follow the instructions
below to build from source.
OpenEthereum requires **latest stable Rust version** to build.
----
## Build dependencies
Parity is fully compatible with Stable Rust.
We recommend installing Rust through [rustup](https://www.rustup.rs/). If you don't already have rustup, you can install it like this:
We recommend installing Rust through [rustup](https://www.rustup.rs/). If you don't already have `rustup`, you can install it like this:
- Linux:
```bash
$ curl https://sh.rustup.rs -sSf | sh
```
Parity also requires `gcc`, `g++`, `libssl-dev`/`openssl` and `pkg-config` packages to be installed.
```bash
$ curl https://sh.rustup.rs -sSf | sh
```
OpenEthereum also requires `clang` (>= 9.0), `clang++`, `pkg-config`, `file`, `make`, and `cmake` packages to be installed.
- OSX:
```bash
$ curl https://sh.rustup.rs -sSf | sh
```
```bash
$ curl https://sh.rustup.rs -sSf | sh
```
`clang` is required. It comes with Xcode command line tools or can be installed with homebrew.
- Windows
`clang` is required. It comes with Xcode command line tools or can be installed with homebrew.
Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the rustup installer from
https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the msvc toolchain:
```
$ rustup default stable-x86_64-pc-windows-msvc
```
- Windows:
Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the `rustup` installer from
https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the `msvc` toolchain:
```bash
$ rustup default stable-x86_64-pc-windows-msvc
```
Once you have rustup, install parity or download and build from source
Once you have `rustup` installed, then you need to install:
* [Perl](https://www.perl.org)
* [Yasm](https://yasm.tortall.net)
----
Make sure that these binaries are in your `PATH`. After that, you should be able to build OpenEthereum from source.
## Quick install
### 3.2 Build from Source Code <a id="chapter-0032"></a>
```bash
cargo install --git https://github.com/ethcore/parity.git parity
```
----
## Build from source
```bash
# download Parity code
$ git clone https://github.com/ethcore/parity
$ cd parity
# download OpenEthereum code
$ git clone https://github.com/openethereum/openethereum
$ cd openethereum
# build in release mode
$ cargo build --release
$ cargo build --release --features final
```
This will produce an executable in the `./target/release` subdirectory.
This produces an executable in the `./target/release` subdirectory.
----
## Simple one-line installer for Mac and Ubuntu
Note: if cargo fails to parse manifest try:
```bash
bash <(curl https://get.parity.io -Lk)
$ ~/.cargo/bin/cargo build --release
```
## Start Parity
### Manually
To start Parity manually, just run
Note, when compiling a crate and you receive errors, it's in most cases your outdated version of Rust, or some of your crates have to be recompiled. Cleaning the repository will most likely solve the issue if you are on the latest stable version of Rust, try:
```bash
$ ./target/release/parity
$ cargo clean
```
and Parity will begin syncing the Ethereum blockchain.
This always compiles the latest nightly builds. If you want to build stable, do a
### Using systemd service file
To start Parity as a regular user using systemd init:
```bash
$ git checkout stable
```
1. Copy `parity/scripts/parity.service` to your
systemd user directory (usually `~/.config/systemd/user`).
2. To pass any argument to Parity, write a `~/.parity/parity.conf` file this way:
`ARGS="ARG1 ARG2 ARG3"`.
### 3.3 Starting OpenEthereum <a id="chapter-0034"></a>
Example: `ARGS="ui --geth --identity MyMachine"`.
#### Manually
To start OpenEthereum manually, just run
```bash
$ ./target/release/openethereum
```
so OpenEthereum begins syncing the Ethereum blockchain.
#### Using `systemd` service file
To start OpenEthereum as a regular user using `systemd` init:
1. Copy `./scripts/openethereum.service` to your
`systemd` user directory (usually `~/.config/systemd/user`).
2. Copy release to bin folder, write `sudo install ./target/release/openethereum /usr/bin/openethereum`
3. To configure OpenEthereum, see [our wiki](https://openethereum.github.io/Configuring-OpenEthereum) for details.
## 4. Testing <a id="chapter-004"></a>
Download the required test files: `git submodule update --init --recursive`. You can run tests with the following commands:
* **All** packages
```
cargo test --all
```
* Specific package
```
cargo test --package <spec>
```
Replace `<spec>` with one of the packages from the [package list](#package-list) (e.g. `cargo test --package evmbin`).
You can show your logs in the test output by passing `--nocapture` (i.e. `cargo test --package evmbin -- --nocapture`)
## 5. Documentation <a id="chapter-005"></a>
Be sure to [check out our wiki](https://openethereum.github.io/) for more information.
### Viewing documentation for OpenEthereum packages
You can generate documentation for OpenEthereum Rust packages that automatically opens in your web browser using [rustdoc with Cargo](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html#using-rustdoc-with-cargo) (of the The Rustdoc Book), by running the the following commands:
* **All** packages
```
cargo doc --document-private-items --open
```
* Specific package
```
cargo doc --package <spec> -- --document-private-items --open
```
Use`--document-private-items` to also view private documentation and `--no-deps` to exclude building documentation for dependencies.
Replacing `<spec>` with one of the following from the details section below (i.e. `cargo doc --package openethereum --open`):
<a id="package-list"></a>
**Package List**
<details><p>
* OpenEthereum Client Application
```bash
openethereum
```
* OpenEthereum Account Management, Key Management Tool, and Keys Generator
```bash
ethcore-accounts, ethkey-cli, ethstore, ethstore-cli
```
* OpenEthereum Chain Specification
```bash
chainspec
```
* OpenEthereum CLI Signer Tool & RPC Client
```bash
cli-signer parity-rpc-client
```
* OpenEthereum Ethash & ProgPoW Implementations
```bash
ethash
```
* EthCore Library
```bash
ethcore
```
* OpenEthereum Blockchain Database, Test Generator, Configuration,
Caching, Importing Blocks, and Block Information
```bash
ethcore-blockchain
```
* OpenEthereum Contract Calls and Blockchain Service & Registry Information
```bash
ethcore-call-contract
```
* OpenEthereum Database Access & Utilities, Database Cache Manager
```bash
ethcore-db
```
* OpenEthereum Virtual Machine (EVM) Rust Implementation
```bash
evm
```
* OpenEthereum Light Client Implementation
```bash
ethcore-light
```
* Smart Contract based Node Filter, Manage Permissions of Network Connections
```bash
node-filter
```
* OpenEthereum Client & Network Service Creation & Registration with the I/O Subsystem
```bash
ethcore-service
```
* OpenEthereum Blockchain Synchronization
```bash
ethcore-sync
```
* OpenEthereum Common Types
```bash
common-types
```
* OpenEthereum Virtual Machines (VM) Support Library
```bash
vm
```
* OpenEthereum WASM Interpreter
```bash
wasm
```
* OpenEthereum WASM Test Runner
```bash
pwasm-run-test
```
* OpenEthereum EVM Implementation
```bash
evmbin
```
* OpenEthereum JSON Deserialization
```bash
ethjson
```
* OpenEthereum State Machine Generalization for Consensus Engines
```bash
parity-machine
```
* OpenEthereum Miner Interface
```bash
ethcore-miner parity-local-store price-info ethcore-stratum using_queue
```
* OpenEthereum Logger Implementation
```bash
ethcore-logger
```
* OpenEthereum JSON-RPC Servers
```bash
parity-rpc
```
* OpenEthereum Updater Service
```bash
parity-updater parity-hash-fetch
```
* OpenEthereum Core Libraries (`util`)
```bash
accounts-bloom blooms-db dir eip-712 fake-fetch fastmap fetch ethcore-io
journaldb keccak-hasher len-caching-lock memory-cache memzero
migration-rocksdb ethcore-network ethcore-network-devp2p panic_hook
patricia-trie-ethereum registrar rlp_compress stats
time-utils triehash-ethereum unexpected parity-version
```
</p></details>
## 6. Toolchain <a id="chapter-006"></a>
In addition to the OpenEthereum client, there are additional tools in this repository available:
- [evmbin](./bin/evmbin) - OpenEthereum EVM Implementation.
- [ethstore](./crates/accounts/ethstore) - OpenEthereum Key Management.
- [ethkey](./crates/accounts/ethkey) - OpenEthereum Keys Generator.
The following tools are available in a separate repository:
- [ethabi](https://github.com/openethereum/ethabi) - OpenEthereum Encoding of Function Calls. [Docs here](https://crates.io/crates/ethabi)
- [whisper](https://github.com/openethereum/whisper) - OpenEthereum Whisper-v2 PoC Implementation.
## 7. Contributing <a id="chapter-007"></a>
An introduction has been provided in the ["So You Want to be a Core Developer" presentation slides by Hernando Castano](http://tiny.cc/contrib-to-parity-eth). Additional guidelines are provided in [CONTRIBUTING](./.github/CONTRIBUTING.md).
### Contributor Code of Conduct
[CODE_OF_CONDUCT](./.github/CODE_OF_CONDUCT.md)
## 8. License <a id="chapter-008"></a>
[LICENSE](./LICENSE)

View File

@ -1,52 +0,0 @@
environment:
matrix:
- TARGET: x86_64-pc-windows-msvc
cert:
secure: ESPpYVVAMG1fbJx6kq4ct/g9SQTXac4Hs6xXr6Oh4Zrk2dwYglNjxmzErdPnvu7gs/gekzrJ6KEQHYRc+5+4dKg6rRADQ681NLVx9vOggBs=
certpass:
secure: 0BgXJqxq9Ei34/hZ7121FQ==
keyfile: C:\users\appveyor\Certificates.p12
RUSTFLAGS: -D warnings
branches:
only:
- master
- /^beta-.*$/
- /^stable-.*$/
- /^beta$/
- /^stable$/
install:
- git submodule update --init --recursive
- ps: Install-Product node 6
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-1.13.0-x86_64-pc-windows-msvc.exe"
- ps: Start-FileDownload "https://github.com/ethcore/win-build/raw/master/SimpleFC.dll" -FileName nsis\SimpleFC.dll
- ps: Start-FileDownload "https://github.com/ethcore/win-build/raw/master/vc_redist.x64.exe" -FileName nsis\vc_redist.x64.exe
- rust-1.13.0-x86_64-pc-windows-msvc.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
- SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin;C:\Program Files (x86)\NSIS;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin
- rustc -V
- cargo -V
- node -v
- npm -v
build: off
test_script:
- cargo test --verbose --release
after_test:
- cargo build --verbose --release
- ps: if($env:cert) { Start-FileDownload $env:cert -FileName $env:keyfile }
- ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass target\release\parity.exe }
- msbuild windows\ptray\ptray.vcxproj /p:Platform=x64 /p:Configuration=Release
- ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass windows\ptray\x64\release\ptray.exe }
- makensis.exe nsis\installer.nsi
- ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass nsis\installer.exe }
artifacts:
- path: nsis\installer.exe
name: Windows Installer (x86_64)
cache:
- target
- C:\users\appveyor\.cargo -> appveyor.yml

9
bin/chainspec/Cargo.toml Normal file
View File

@ -0,0 +1,9 @@
[package]
description = "Parity Ethereum Chain Specification"
name = "chainspec"
version = "0.1.0"
authors = ["Marek Kotewicz <marek@parity.io>"]
[dependencies]
ethjson = { path = "../../crates/ethjson" }
serde_json = "1.0"

51
bin/chainspec/src/main.rs Normal file
View File

@ -0,0 +1,51 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
extern crate ethjson;
extern crate serde_json;
use ethjson::spec::Spec;
use std::{env, fs, process};
fn quit(s: &str) -> ! {
println!("{}", s);
process::exit(1);
}
fn main() {
let mut args = env::args();
if args.len() != 2 {
quit(
"You need to specify chainspec.json\n\
\n\
./chainspec <chainspec.json>",
);
}
let path = args.nth(1).expect("args.len() == 2; qed");
let file = match fs::File::open(&path) {
Ok(file) => file,
Err(_) => quit(&format!("{} could not be opened", path)),
};
let spec: Result<Spec, _> = serde_json::from_reader(file);
if let Err(err) = spec {
quit(&format!("{} {}", path, err.to_string()));
}
println!("{} is valid", path);
}

22
bin/ethkey/Cargo.toml Normal file
View File

@ -0,0 +1,22 @@
[package]
description = "Parity Ethereum Keys Generator CLI"
name = "ethkey-cli"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
docopt = "1.0"
env_logger = "0.5"
ethkey = { path = "../../crates/accounts/ethkey" }
panic_hook = { path = "../../crates/util/panic-hook" }
parity-crypto = { version = "0.6.2", features = [ "publickey" ] }
parity-wordlist="1.3"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
threadpool = "1.7"
[[bin]]
name = "ethkey"
path = "src/main.rs"
doc = false

493
bin/ethkey/src/main.rs Normal file
View File

@ -0,0 +1,493 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
extern crate docopt;
extern crate env_logger;
extern crate ethkey;
extern crate panic_hook;
extern crate parity_crypto as crypto;
extern crate parity_wordlist;
extern crate rustc_hex;
extern crate serde;
extern crate threadpool;
#[macro_use]
extern crate serde_derive;
use std::{env, fmt, io, num::ParseIntError, process, sync};
use crypto::publickey::{
sign, verify_address, verify_public, Error as EthkeyError, Generator, KeyPair, Random,
};
use docopt::Docopt;
use ethkey::{brain_recover, Brain, BrainPrefix, Prefix};
use rustc_hex::{FromHex, FromHexError};
const USAGE: &'static str = r#"
Parity Ethereum keys generator.
Copyright 2015-2019 Parity Technologies (UK) Ltd.
Usage:
ethkey info <secret-or-phrase> [options]
ethkey generate random [options]
ethkey generate prefix <prefix> [options]
ethkey sign <secret> <message>
ethkey verify public <public> <signature> <message>
ethkey verify address <address> <signature> <message>
ethkey recover <address> <known-phrase>
ethkey [-h | --help]
Options:
-h, --help Display this message and exit.
-s, --secret Display only the secret key.
-p, --public Display only the public key.
-a, --address Display only the address.
-b, --brain Use parity brain wallet algorithm. Not recommended.
Commands:
info Display public key and address of the secret.
generate random Generates new random Ethereum key.
generate prefix Random generation, but address must start with a prefix ("vanity address").
sign Sign message using a secret key.
verify Verify signer of the signature by public key or address.
recover Try to find brain phrase matching given address from partial phrase.
"#;
#[derive(Debug, Deserialize)]
struct Args {
cmd_info: bool,
cmd_generate: bool,
cmd_random: bool,
cmd_prefix: bool,
cmd_sign: bool,
cmd_verify: bool,
cmd_public: bool,
cmd_address: bool,
cmd_recover: bool,
arg_prefix: String,
arg_secret: String,
arg_secret_or_phrase: String,
arg_known_phrase: String,
arg_message: String,
arg_public: String,
arg_address: String,
arg_signature: String,
flag_secret: bool,
flag_public: bool,
flag_address: bool,
flag_brain: bool,
}
#[derive(Debug)]
enum Error {
Ethkey(EthkeyError),
FromHex(FromHexError),
ParseInt(ParseIntError),
Docopt(docopt::Error),
Io(io::Error),
}
impl From<EthkeyError> for Error {
fn from(err: EthkeyError) -> Self {
Error::Ethkey(err)
}
}
impl From<FromHexError> for Error {
fn from(err: FromHexError) -> Self {
Error::FromHex(err)
}
}
impl From<ParseIntError> for Error {
fn from(err: ParseIntError) -> Self {
Error::ParseInt(err)
}
}
impl From<docopt::Error> for Error {
fn from(err: docopt::Error) -> Self {
Error::Docopt(err)
}
}
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 {
Error::Ethkey(ref e) => write!(f, "{}", e),
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),
}
}
}
enum DisplayMode {
KeyPair,
Secret,
Public,
Address,
}
impl DisplayMode {
fn new(args: &Args) -> Self {
if args.flag_secret {
DisplayMode::Secret
} else if args.flag_public {
DisplayMode::Public
} else if args.flag_address {
DisplayMode::Address
} else {
DisplayMode::KeyPair
}
}
}
fn main() {
panic_hook::set_abort();
env_logger::try_init().expect("Logger initialized only once.");
match execute(env::args()) {
Ok(ok) => println!("{}", ok),
Err(Error::Docopt(ref e)) => e.exit(),
Err(err) => {
eprintln!("{}", err);
process::exit(1);
}
}
}
fn display(result: (KeyPair, Option<String>), mode: DisplayMode) -> String {
let keypair = result.0;
match mode {
DisplayMode::KeyPair => match result.1 {
Some(extra_data) => format!("{}\n{}", extra_data, keypair),
None => format!("{}", keypair),
},
DisplayMode::Secret => format!("{:x}", keypair.secret()),
DisplayMode::Public => format!("{:x}", keypair.public()),
DisplayMode::Address => format!("{:x}", keypair.address()),
}
}
fn execute<S, I>(command: I) -> Result<String, Error>
where
I: IntoIterator<Item = S>,
S: AsRef<str>,
{
let args: Args = Docopt::new(USAGE).and_then(|d| d.argv(command).deserialize())?;
return if args.cmd_info {
let display_mode = DisplayMode::new(&args);
let result = if args.flag_brain {
let phrase = args.arg_secret_or_phrase;
let phrase_info = validate_phrase(&phrase);
let keypair = Brain::new(phrase).generate();
(keypair, Some(phrase_info))
} else {
let secret = args
.arg_secret_or_phrase
.parse()
.map_err(|_| EthkeyError::InvalidSecretKey)?;
(KeyPair::from_secret(secret)?, None)
};
Ok(display(result, display_mode))
} else if args.cmd_generate {
let display_mode = DisplayMode::new(&args);
let result = if args.cmd_random {
if args.flag_brain {
let mut brain = BrainPrefix::new(vec![0], usize::max_value(), BRAIN_WORDS);
let keypair = brain.generate()?;
let phrase = format!("recovery phrase: {}", brain.phrase());
(keypair, Some(phrase))
} else {
(Random.generate(), None)
}
} else if args.cmd_prefix {
let prefix = args.arg_prefix.from_hex()?;
let brain = args.flag_brain;
in_threads(move || {
let iterations = 1024;
let prefix = prefix.clone();
move || {
let prefix = prefix.clone();
let res = if brain {
let mut brain = BrainPrefix::new(prefix, iterations, BRAIN_WORDS);
let result = brain.generate();
let phrase = format!("recovery phrase: {}", brain.phrase());
result.map(|keypair| (keypair, Some(phrase)))
} else {
let result = Prefix::new(prefix, iterations).generate();
result.map(|res| (res, None))
};
Ok(res.map(Some).unwrap_or(None))
}
})?
} else {
return Ok(format!("{}", USAGE));
};
Ok(display(result, display_mode))
} else if args.cmd_sign {
let secret = args
.arg_secret
.parse()
.map_err(|_| EthkeyError::InvalidSecretKey)?;
let message = args
.arg_message
.parse()
.map_err(|_| EthkeyError::InvalidMessage)?;
let signature = sign(&secret, &message)?;
Ok(format!("{}", signature))
} else if args.cmd_verify {
let signature = args
.arg_signature
.parse()
.map_err(|_| EthkeyError::InvalidSignature)?;
let message = args
.arg_message
.parse()
.map_err(|_| EthkeyError::InvalidMessage)?;
let ok = if args.cmd_public {
let public = args
.arg_public
.parse()
.map_err(|_| EthkeyError::InvalidPublicKey)?;
verify_public(&public, &signature, &message)?
} else if args.cmd_address {
let address = args
.arg_address
.parse()
.map_err(|_| EthkeyError::InvalidAddress)?;
verify_address(&address, &signature, &message)?
} else {
return Ok(format!("{}", USAGE));
};
Ok(format!("{}", ok))
} else if args.cmd_recover {
let display_mode = DisplayMode::new(&args);
let known_phrase = args.arg_known_phrase;
let address = args
.arg_address
.parse()
.map_err(|_| EthkeyError::InvalidAddress)?;
let (phrase, keypair) = in_threads(move || {
let mut it =
brain_recover::PhrasesIterator::from_known_phrase(&known_phrase, BRAIN_WORDS);
move || {
let mut i = 0;
while let Some(phrase) = it.next() {
i += 1;
let keypair = Brain::new(phrase.clone()).generate();
if keypair.address() == address {
return Ok(Some((phrase, keypair)));
}
if i >= 1024 {
return Ok(None);
}
}
Err(EthkeyError::Custom("Couldn't find any results.".into()))
}
})?;
Ok(display((keypair, Some(phrase)), display_mode))
} else {
Ok(format!("{}", USAGE))
};
}
const BRAIN_WORDS: usize = 12;
fn validate_phrase(phrase: &str) -> String {
match Brain::validate_phrase(phrase, BRAIN_WORDS) {
Ok(()) => format!("The recovery phrase looks correct.\n"),
Err(err) => format!("The recover phrase was not generated by Parity: {}", err),
}
}
fn in_threads<F, X, O>(prepare: F) -> Result<O, EthkeyError>
where
O: Send + 'static,
X: Send + 'static,
F: Fn() -> X,
X: FnMut() -> Result<Option<O>, EthkeyError>,
{
let pool = threadpool::Builder::new().build();
let (tx, rx) = sync::mpsc::sync_channel(1);
let is_done = sync::Arc::new(sync::atomic::AtomicBool::default());
for _ in 0..pool.max_count() {
let is_done = is_done.clone();
let tx = tx.clone();
let mut task = prepare();
pool.execute(move || {
loop {
if is_done.load(sync::atomic::Ordering::SeqCst) {
return;
}
let res = match task() {
Ok(None) => continue,
Ok(Some(v)) => Ok(v),
Err(err) => Err(err),
};
// We are interested only in the first response.
let _ = tx.send(res);
}
});
}
if let Ok(solution) = rx.recv() {
is_done.store(true, sync::atomic::Ordering::SeqCst);
return solution;
}
Err(EthkeyError::Custom("No results found.".into()))
}
#[cfg(test)]
mod tests {
use super::execute;
#[test]
fn info() {
let command = vec![
"ethkey",
"info",
"17d08f5fe8c77af811caa0c9a187e668ce3b74a99acc3f6d976f075fa8e0be55",
]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();
let expected =
"secret: 17d08f5fe8c77af811caa0c9a187e668ce3b74a99acc3f6d976f075fa8e0be55
public: 689268c0ff57a20cd299fa60d3fb374862aff565b20b5f1767906a99e6e09f3ff04ca2b2a5cd22f62941db103c0356df1a8ed20ce322cab2483db67685afd124
address: 26d1ec50b4e62c1d1a40d16e7cacc6a6580757d5".to_owned();
assert_eq!(execute(command).unwrap(), expected);
}
#[test]
fn brain() {
let command = vec!["ethkey", "info", "--brain", "this is sparta"]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();
let expected =
"The recover phrase was not generated by Parity: The word 'this' does not come from the dictionary.
secret: aa22b54c0cb43ee30a014afe5ef3664b1cde299feabca46cd3167a85a57c39f2
public: c4c5398da6843632c123f543d714d2d2277716c11ff612b2a2f23c6bda4d6f0327c31cd58c55a9572c3cc141dade0c32747a13b7ef34c241b26c84adbb28fcf4
address: 006e27b6a72e1f34c626762f3c4761547aff1421".to_owned();
assert_eq!(execute(command).unwrap(), expected);
}
#[test]
fn secret() {
let command = vec!["ethkey", "info", "--brain", "this is sparta", "--secret"]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();
let expected =
"aa22b54c0cb43ee30a014afe5ef3664b1cde299feabca46cd3167a85a57c39f2".to_owned();
assert_eq!(execute(command).unwrap(), expected);
}
#[test]
fn public() {
let command = vec!["ethkey", "info", "--brain", "this is sparta", "--public"]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();
let expected = "c4c5398da6843632c123f543d714d2d2277716c11ff612b2a2f23c6bda4d6f0327c31cd58c55a9572c3cc141dade0c32747a13b7ef34c241b26c84adbb28fcf4".to_owned();
assert_eq!(execute(command).unwrap(), expected);
}
#[test]
fn address() {
let command = vec!["ethkey", "info", "-b", "this is sparta", "--address"]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();
let expected = "006e27b6a72e1f34c626762f3c4761547aff1421".to_owned();
assert_eq!(execute(command).unwrap(), expected);
}
#[test]
fn sign() {
let command = vec![
"ethkey",
"sign",
"17d08f5fe8c77af811caa0c9a187e668ce3b74a99acc3f6d976f075fa8e0be55",
"bd50b7370c3f96733b31744c6c45079e7ae6c8d299613246d28ebcef507ec987",
]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();
let expected = "c1878cf60417151c766a712653d26ef350c8c75393458b7a9be715f053215af63dfd3b02c2ae65a8677917a8efa3172acb71cb90196e42106953ea0363c5aaf200".to_owned();
assert_eq!(execute(command).unwrap(), expected);
}
#[test]
fn verify_valid_public() {
let command = vec!["ethkey", "verify", "public", "689268c0ff57a20cd299fa60d3fb374862aff565b20b5f1767906a99e6e09f3ff04ca2b2a5cd22f62941db103c0356df1a8ed20ce322cab2483db67685afd124", "c1878cf60417151c766a712653d26ef350c8c75393458b7a9be715f053215af63dfd3b02c2ae65a8677917a8efa3172acb71cb90196e42106953ea0363c5aaf200", "bd50b7370c3f96733b31744c6c45079e7ae6c8d299613246d28ebcef507ec987"]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();
let expected = "true".to_owned();
assert_eq!(execute(command).unwrap(), expected);
}
#[test]
fn verify_valid_address() {
let command = vec!["ethkey", "verify", "address", "26d1ec50b4e62c1d1a40d16e7cacc6a6580757d5", "c1878cf60417151c766a712653d26ef350c8c75393458b7a9be715f053215af63dfd3b02c2ae65a8677917a8efa3172acb71cb90196e42106953ea0363c5aaf200", "bd50b7370c3f96733b31744c6c45079e7ae6c8d299613246d28ebcef507ec987"]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();
let expected = "true".to_owned();
assert_eq!(execute(command).unwrap(), expected);
}
#[test]
fn verify_invalid() {
let command = vec!["ethkey", "verify", "public", "689268c0ff57a20cd299fa60d3fb374862aff565b20b5f1767906a99e6e09f3ff04ca2b2a5cd22f62941db103c0356df1a8ed20ce322cab2483db67685afd124", "c1878cf60417151c766a712653d26ef350c8c75393458b7a9be715f053215af63dfd3b02c2ae65a8677917a8efa3172acb71cb90196e42106953ea0363c5aaf200", "bd50b7370c3f96733b31744c6c45079e7ae6c8d299613246d28ebcef507ec986"]
.into_iter()
.map(Into::into)
.collect::<Vec<String>>();
let expected = "false".to_owned();
assert_eq!(execute(command).unwrap(), expected);
}
}

25
bin/ethstore/Cargo.toml Normal file
View File

@ -0,0 +1,25 @@
[package]
description = "Parity Ethereum Key Management CLI"
name = "ethstore-cli"
version = "0.1.1"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
docopt = "1.0"
env_logger = "0.5"
num_cpus = "1.6"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
parking_lot = "0.11.1"
ethstore = { path = "../../crates/accounts/ethstore" }
dir = { path = '../../crates/util/dir' }
panic_hook = { path = "../../crates/util/panic-hook" }
[[bin]]
name = "ethstore"
path = "src/main.rs"
doc = false
[dev-dependencies]
tempdir = "0.3.5"

66
bin/ethstore/src/crack.rs Normal file
View File

@ -0,0 +1,66 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use parking_lot::Mutex;
use std::{cmp, collections::VecDeque, sync::Arc, thread};
use ethstore::{ethkey::Password, Error, PresaleWallet};
use num_cpus;
pub fn run(passwords: VecDeque<Password>, wallet_path: &str) -> Result<(), Error> {
let passwords = Arc::new(Mutex::new(passwords));
let mut handles = Vec::new();
for _ in 0..num_cpus::get() {
let passwords = passwords.clone();
let wallet = PresaleWallet::open(&wallet_path)?;
handles.push(thread::spawn(move || {
look_for_password(passwords, wallet);
}));
}
for handle in handles {
handle
.join()
.map_err(|err| Error::Custom(format!("Error finishing thread: {:?}", err)))?;
}
Ok(())
}
fn look_for_password(passwords: Arc<Mutex<VecDeque<Password>>>, wallet: PresaleWallet) {
let mut counter = 0;
while !passwords.lock().is_empty() {
let package = {
let mut passwords = passwords.lock();
let len = passwords.len();
passwords.split_off(cmp::min(len, 32))
};
for pass in package {
counter += 1;
match wallet.decrypt(&pass) {
Ok(_) => {
println!("Found password: {}", pass.as_str());
passwords.lock().clear();
return;
}
_ if counter % 100 == 0 => print!("."),
_ => {}
}
}
}
}

363
bin/ethstore/src/main.rs Normal file
View File

@ -0,0 +1,363 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
extern crate dir;
extern crate docopt;
extern crate ethstore;
extern crate num_cpus;
extern crate panic_hook;
extern crate parking_lot;
extern crate rustc_hex;
extern crate serde;
extern crate env_logger;
#[macro_use]
extern crate serde_derive;
use std::{collections::VecDeque, env, fmt, fs, io::Read, process};
use docopt::Docopt;
use ethstore::{
accounts_dir::{KeyDirectory, RootDiskDirectory},
ethkey::{Address, Password},
import_accounts, EthStore, PresaleWallet, SecretStore, SecretVaultRef, SimpleSecretStore,
StoreAccountRef,
};
mod crack;
pub const USAGE: &'static str = r#"
Parity Ethereum key management tool.
Copyright 2015-2019 Parity Technologies (UK) Ltd.
Usage:
ethstore insert <secret> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
ethstore change-pwd <address> <old-pwd> <new-pwd> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
ethstore list [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
ethstore import [<password>] [--src DIR] [--dir DIR]
ethstore import-wallet <path> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
ethstore find-wallet-pass <path> <password>
ethstore remove <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
ethstore sign <address> <password> <message> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
ethstore public <address> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
ethstore list-vaults [--dir DIR]
ethstore create-vault <vault> <password> [--dir DIR]
ethstore change-vault-pwd <vault> <old-pwd> <new-pwd> [--dir DIR]
ethstore move-to-vault <address> <vault> <password> [--dir DIR] [--vault VAULT] [--vault-pwd VAULTPWD]
ethstore move-from-vault <address> <vault> <password> [--dir DIR]
ethstore [-h | --help]
Options:
-h, --help Display this message and exit.
--dir DIR Specify the secret store directory. It may be either
parity, parity-(chain), geth, geth-test
or a path [default: parity].
--vault VAULT Specify vault to use in this operation.
--vault-pwd VAULTPWD Specify vault password to use in this operation. Please note
that this option is required when vault option is set.
Otherwise it is ignored.
--src DIR Specify import source. It may be either
parity, parity-(chain), geth, geth-test
or a path [default: geth].
Commands:
insert Save account with password.
change-pwd Change password.
list List accounts.
import Import accounts from src.
import-wallet Import presale wallet.
find-wallet-pass Tries to open a wallet with list of passwords given.
remove Remove account.
sign Sign message.
public Displays public key for an address.
list-vaults List vaults.
create-vault Create new vault.
change-vault-pwd Change vault password.
move-to-vault Move account to vault from another vault/root directory.
move-from-vault Move account to root directory from given vault.
"#;
#[derive(Debug, Deserialize)]
struct Args {
cmd_insert: bool,
cmd_change_pwd: bool,
cmd_list: bool,
cmd_import: bool,
cmd_import_wallet: bool,
cmd_find_wallet_pass: bool,
cmd_remove: bool,
cmd_sign: bool,
cmd_public: bool,
cmd_list_vaults: bool,
cmd_create_vault: bool,
cmd_change_vault_pwd: bool,
cmd_move_to_vault: bool,
cmd_move_from_vault: bool,
arg_secret: String,
arg_password: String,
arg_old_pwd: String,
arg_new_pwd: String,
arg_address: String,
arg_message: String,
arg_path: String,
arg_vault: String,
flag_src: String,
flag_dir: String,
flag_vault: String,
flag_vault_pwd: String,
}
enum Error {
Ethstore(ethstore::Error),
Docopt(docopt::Error),
}
impl From<ethstore::Error> for Error {
fn from(err: ethstore::Error) -> Self {
Error::Ethstore(err)
}
}
impl From<docopt::Error> for Error {
fn from(err: docopt::Error) -> Self {
Error::Docopt(err)
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Error::Ethstore(ref err) => fmt::Display::fmt(err, f),
Error::Docopt(ref err) => fmt::Display::fmt(err, f),
}
}
}
fn main() {
panic_hook::set_abort();
if env::var("RUST_LOG").is_err() {
env::set_var("RUST_LOG", "warn")
}
env_logger::try_init().expect("Logger initialized only once.");
match execute(env::args()) {
Ok(result) => println!("{}", result),
Err(Error::Docopt(ref e)) => e.exit(),
Err(err) => {
eprintln!("{}", err);
process::exit(1);
}
}
}
fn key_dir(location: &str, password: Option<Password>) -> Result<Box<dyn KeyDirectory>, Error> {
let dir: RootDiskDirectory = match location {
path if path.starts_with("parity") => {
let chain = path.split('-').nth(1).unwrap_or("ethereum");
let mut path = dir::default_data_pathbuf();
path.push("keys");
path.push(chain);
RootDiskDirectory::create(path)?
}
path => RootDiskDirectory::create(path)?,
};
Ok(Box::new(dir.with_password(password)))
}
fn open_args_vault(store: &EthStore, args: &Args) -> Result<SecretVaultRef, Error> {
if args.flag_vault.is_empty() {
return Ok(SecretVaultRef::Root);
}
let vault_pwd = load_password(&args.flag_vault_pwd)?;
store.open_vault(&args.flag_vault, &vault_pwd)?;
Ok(SecretVaultRef::Vault(args.flag_vault.clone()))
}
fn open_args_vault_account(
store: &EthStore,
address: Address,
args: &Args,
) -> Result<StoreAccountRef, Error> {
match open_args_vault(store, args)? {
SecretVaultRef::Root => Ok(StoreAccountRef::root(address)),
SecretVaultRef::Vault(name) => Ok(StoreAccountRef::vault(&name, address)),
}
}
fn format_accounts(accounts: &[Address]) -> String {
accounts
.iter()
.enumerate()
.map(|(i, a)| format!("{:2}: 0x{:x}", i, a))
.collect::<Vec<String>>()
.join("\n")
}
fn format_vaults(vaults: &[String]) -> String {
vaults.join("\n")
}
fn load_password(path: &str) -> Result<Password, Error> {
let mut file = fs::File::open(path).map_err(|e| {
ethstore::Error::Custom(format!("Error opening password file '{}': {}", path, e))
})?;
let mut password = String::new();
file.read_to_string(&mut password).map_err(|e| {
ethstore::Error::Custom(format!("Error reading password file '{}': {}", path, e))
})?;
// drop EOF
let _ = password.pop();
Ok(password.into())
}
fn execute<S, I>(command: I) -> Result<String, Error>
where
I: IntoIterator<Item = S>,
S: AsRef<str>,
{
let args: Args = Docopt::new(USAGE).and_then(|d| d.argv(command).deserialize())?;
let store = EthStore::open(key_dir(&args.flag_dir, None)?)?;
return if args.cmd_insert {
let secret = args
.arg_secret
.parse()
.map_err(|_| ethstore::Error::InvalidSecret)?;
let password = load_password(&args.arg_password)?;
let vault_ref = open_args_vault(&store, &args)?;
let account_ref = store.insert_account(vault_ref, secret, &password)?;
Ok(format!("0x{:x}", account_ref.address))
} else if args.cmd_change_pwd {
let address = args
.arg_address
.parse()
.map_err(|_| ethstore::Error::InvalidAccount)?;
let old_pwd = load_password(&args.arg_old_pwd)?;
let new_pwd = load_password(&args.arg_new_pwd)?;
let account_ref = open_args_vault_account(&store, address, &args)?;
let ok = store
.change_password(&account_ref, &old_pwd, &new_pwd)
.is_ok();
Ok(format!("{}", ok))
} else if args.cmd_list {
let vault_ref = open_args_vault(&store, &args)?;
let accounts = store.accounts()?;
let accounts: Vec<_> = accounts
.into_iter()
.filter(|a| &a.vault == &vault_ref)
.map(|a| a.address)
.collect();
Ok(format_accounts(&accounts))
} else if args.cmd_import {
let password = match args.arg_password.as_ref() {
"" => None,
_ => Some(load_password(&args.arg_password)?),
};
let src = key_dir(&args.flag_src, password)?;
let dst = key_dir(&args.flag_dir, None)?;
let accounts = import_accounts(&*src, &*dst)?;
Ok(format_accounts(&accounts))
} else if args.cmd_import_wallet {
let wallet = PresaleWallet::open(&args.arg_path)?;
let password = load_password(&args.arg_password)?;
let kp = wallet.decrypt(&password)?;
let vault_ref = open_args_vault(&store, &args)?;
let account_ref = store.insert_account(vault_ref, kp.secret().clone(), &password)?;
Ok(format!("0x{:x}", account_ref.address))
} else if args.cmd_find_wallet_pass {
let passwords = load_password(&args.arg_password)?;
let passwords = passwords
.as_str()
.lines()
.map(|line| str::to_owned(line).into())
.collect::<VecDeque<_>>();
crack::run(passwords, &args.arg_path)?;
Ok(format!("Password not found."))
} else if args.cmd_remove {
let address = args
.arg_address
.parse()
.map_err(|_| ethstore::Error::InvalidAccount)?;
let password = load_password(&args.arg_password)?;
let account_ref = open_args_vault_account(&store, address, &args)?;
let ok = store.remove_account(&account_ref, &password).is_ok();
Ok(format!("{}", ok))
} else if args.cmd_sign {
let address = args
.arg_address
.parse()
.map_err(|_| ethstore::Error::InvalidAccount)?;
let message = args
.arg_message
.parse()
.map_err(|_| ethstore::Error::InvalidMessage)?;
let password = load_password(&args.arg_password)?;
let account_ref = open_args_vault_account(&store, address, &args)?;
let signature = store.sign(&account_ref, &password, &message)?;
Ok(format!("0x{}", signature))
} else if args.cmd_public {
let address = args
.arg_address
.parse()
.map_err(|_| ethstore::Error::InvalidAccount)?;
let password = load_password(&args.arg_password)?;
let account_ref = open_args_vault_account(&store, address, &args)?;
let public = store.public(&account_ref, &password)?;
Ok(format!("0x{:x}", public))
} else if args.cmd_list_vaults {
let vaults = store.list_vaults()?;
Ok(format_vaults(&vaults))
} else if args.cmd_create_vault {
let password = load_password(&args.arg_password)?;
store.create_vault(&args.arg_vault, &password)?;
Ok("OK".to_owned())
} else if args.cmd_change_vault_pwd {
let old_pwd = load_password(&args.arg_old_pwd)?;
let new_pwd = load_password(&args.arg_new_pwd)?;
store.open_vault(&args.arg_vault, &old_pwd)?;
store.change_vault_password(&args.arg_vault, &new_pwd)?;
Ok("OK".to_owned())
} else if args.cmd_move_to_vault {
let address = args
.arg_address
.parse()
.map_err(|_| ethstore::Error::InvalidAccount)?;
let password = load_password(&args.arg_password)?;
let account_ref = open_args_vault_account(&store, address, &args)?;
store.open_vault(&args.arg_vault, &password)?;
store.change_account_vault(SecretVaultRef::Vault(args.arg_vault), account_ref)?;
Ok("OK".to_owned())
} else if args.cmd_move_from_vault {
let address = args
.arg_address
.parse()
.map_err(|_| ethstore::Error::InvalidAccount)?;
let password = load_password(&args.arg_password)?;
store.open_vault(&args.arg_vault, &password)?;
store.change_account_vault(
SecretVaultRef::Root,
StoreAccountRef::vault(&args.arg_vault, address),
)?;
Ok("OK".to_owned())
} else {
Ok(format!("{}", USAGE))
};
}

33
bin/evmbin/Cargo.toml Normal file
View File

@ -0,0 +1,33 @@
[package]
description = "Parity EVM Implementation"
name = "evmbin"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
[[bin]]
name = "openethereum-evm"
path = "./src/main.rs"
[dependencies]
common-types = { path = "../../crates/ethcore/types", features = ["test-helpers"] }
docopt = "1.0"
env_logger = "0.5"
ethcore = { path = "../../crates/ethcore", features = ["test-helpers", "json-tests", "to-pod-full"] }
ethereum-types = "0.9.2"
ethjson = { path = "../../crates/ethjson" }
evm = { path = "../../crates/vm/evm" }
panic_hook = { path = "../../crates/util/panic-hook" }
parity-bytes = "0.1"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
vm = { path = "../../crates/vm/vm" }
[dev-dependencies]
criterion = "0.3.0"
pretty_assertions = "0.1"
tempdir = "0.3"
[features]
evm-debug = ["ethcore/evm-debug-tests"]

60
bin/evmbin/README.md Normal file
View File

@ -0,0 +1,60 @@
## evmbin
EVM implementation for OpenEthereum.
### Usage
```
EVM implementation for Parity.
Copyright 2015-2020 Parity Technologies (UK) Ltd.
Usage:
openethereum-evm state-test <file> [--json --std-json --std-dump-json --only NAME --chain CHAIN --std-out-only --std-err-only --omit-storage-output --omit-memory-output]
openethereum-evm stats [options]
openethereum-evm stats-jsontests-vm <file>
openethereum-evm [options]
openethereum-evm [-h | --help]
Commands:
state-test Run a state test from a json file.
stats Execute EVM runtime code and return the statistics.
stats-jsontests-vm Execute standard json-tests format VMTests and return
timing statistics in tsv format.
Transaction options:
--code CODE Contract code as hex (without 0x).
--to ADDRESS Recipient address (without 0x).
--from ADDRESS Sender address (without 0x).
--input DATA Input data as hex (without 0x).
--gas GAS Supplied gas as hex (without 0x).
--gas-price WEI Supplied gas price as hex (without 0x).
State test options:
--chain CHAIN Run only from specific chain name (i.e. one of EIP150, EIP158,
Frontier, Homestead, Byzantium, Constantinople,
ConstantinopleFix, Istanbul, EIP158ToByzantiumAt5, FrontierToHomesteadAt5,
HomesteadToDaoAt5, HomesteadToEIP150At5, Berlin, Yolo3).
--only NAME Runs only a single test matching the name.
General options:
--json Display verbose results in JSON.
--std-json Display results in standardized JSON format.
--std-err-only With --std-json redirect to err output only.
--std-out-only With --std-json redirect to out output only.
--omit-storage-output With --std-json omit storage output.
--omit-memory-output With --std-json omit memory output.
--std-dump-json Display results in standardized JSON format
with additional state dump.
Display result state dump in standardized JSON format.
--chain CHAIN Chain spec file path.
-h, --help Display this message and exit.
```
## OpenEthereum toolchain
_This project is a part of the OpenEthereum toolchain._
- [evmbin](https://github.com/openethereum/openethereum/blob/master/evmbin/) - EVM implementation for OpenEthereum
- [ethabi](https://github.com/openethereum/ethabi) - OpenEthereum function calls encoding.
- [ethstore](https://github.com/openethereum/openethereum/blob/master/accounts/ethstore) - OpenEthereum key management.
- [ethkey](https://github.com/openethereum/openethereum/blob/master/accounts/ethkey) - OpenEthereum keys generator.

98
bin/evmbin/benches/mod.rs Normal file
View File

@ -0,0 +1,98 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! benchmarking for EVM
//! should be started with:
//! ```bash
//! cargo bench
//! ```
#[macro_use]
extern crate criterion;
extern crate ethcore;
extern crate ethereum_types;
extern crate evm;
extern crate rustc_hex;
extern crate vm;
use criterion::{black_box, Criterion};
use std::sync::Arc;
use ethereum_types::U256;
use evm::Factory;
use rustc_hex::FromHex;
use vm::{tests::FakeExt, ActionParams, Ext};
criterion_group!(
evmbin,
bench_simple_loop_usize,
bench_simple_loop_u256,
bench_rng_usize,
bench_rng_u256
);
criterion_main!(evmbin);
fn bench_simple_loop_usize(c: &mut Criterion) {
simple_loop(U256::from(::std::usize::MAX), c, "simple_loop_usize")
}
fn bench_simple_loop_u256(c: &mut Criterion) {
simple_loop(!U256::zero(), c, "simple_loop_u256")
}
fn simple_loop(gas: U256, c: &mut Criterion, bench_id: &str) {
let code = black_box(
"606060405260005b620042408112156019575b6001016007565b600081905550600680602b6000396000f3606060405200".from_hex().unwrap()
);
c.bench_function(bench_id, move |b| {
b.iter(|| {
let mut params = ActionParams::default();
params.gas = gas;
params.code = Some(Arc::new(code.clone()));
let mut ext = FakeExt::new();
let evm = Factory::default().create(params, ext.schedule(), ext.depth());
let _ = evm.exec(&mut ext);
})
});
}
fn bench_rng_usize(c: &mut Criterion) {
rng(U256::from(::std::usize::MAX), c, "rng_usize")
}
fn bench_rng_u256(c: &mut Criterion) {
rng(!U256::zero(), c, "rng_u256")
}
fn rng(gas: U256, c: &mut Criterion, bench_id: &str) {
let code = black_box(
"6060604052600360056007600b60005b62004240811215607f5767ffe7649d5eca84179490940267f47ed85c4b9a6379019367f8e5dd9a5c994bba9390930267f91d87e4b8b74e55019267ff97f6f3b29cda529290920267f393ada8dd75c938019167fe8d437c45bb3735830267f47d9a7b5428ffec019150600101600f565b838518831882186000555050505050600680609a6000396000f3606060405200".from_hex().unwrap()
);
c.bench_function(bench_id, move |b| {
b.iter(|| {
let mut params = ActionParams::default();
params.gas = gas;
params.code = Some(Arc::new(code.clone()));
let mut ext = FakeExt::new();
let evm = Factory::default().create(params, ext.schedule(), ext.depth());
let _ = evm.exec(&mut ext);
})
});
}

View File

@ -0,0 +1,38 @@
{
"name": "lab",
"engine": {
"Ethash": {
"params": {
"minimumDifficulty": "0x1",
"difficultyBoundDivisor": "0x800"
}
}
},
"accounts": {
"0000000000000000000000000000000000000020": {
"nonce": "0x0",
"balance": "0x64",
"code": "0x62aaaaaa60aa60aa5060aa60aa60aa60aa60aa60aa"
}
},
"params":{
"networkID": "0x42",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1",
"gasLimitBoundDivisor": "0x400"
},
"genesis": {
"gasLimit": "0x8000000",
"seal": {
"ethereum": {
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000042"
}
},
"difficulty": "0x400",
"extraData": "0x0",
"author": "0x3333333333333333333333333333333333333333",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
}

View File

@ -0,0 +1,40 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Config used by display informants
#[derive(Default, Copy, Clone, Debug)]
pub struct Config {
omit_storage_output: bool,
omit_memory_output: bool,
}
impl Config {
pub fn new(omit_storage_output: bool, omit_memory_output: bool) -> Config {
Config {
omit_storage_output,
omit_memory_output,
}
}
pub fn omit_storage_output(&self) -> bool {
self.omit_storage_output
}
pub fn omit_memory_output(&self) -> bool {
self.omit_memory_output
}
}

View File

@ -0,0 +1,425 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! JSON VM output.
use std::{collections::HashMap, mem};
use super::config::Config;
use bytes::ToPretty;
use display;
use ethcore::trace;
use ethereum_types::{BigEndianHash, H256, U256};
use info as vm;
/// JSON formatting informant.
#[derive(Default)]
pub struct Informant {
code: Vec<u8>,
depth: usize,
pc: usize,
instruction: u8,
gas_cost: U256,
gas_used: U256,
mem_written: Option<(usize, usize)>,
store_written: Option<(U256, U256)>,
stack: Vec<U256>,
memory: Vec<u8>,
storage: HashMap<H256, H256>,
traces: Vec<String>,
subtraces: Vec<String>,
subinfos: Vec<Informant>,
subdepth: usize,
unmatched: bool,
config: Config,
}
impl Informant {
pub fn new(config: Config) -> Informant {
let mut def = Informant::default();
def.config = config;
def
}
fn with_informant_in_depth<F: Fn(&mut Informant)>(
informant: &mut Informant,
depth: usize,
f: F,
) {
if depth == 0 {
f(informant);
} else {
Self::with_informant_in_depth(
informant
.subinfos
.last_mut()
.expect("prepare/done_trace are not balanced"),
depth - 1,
f,
);
}
}
fn informant_trace(informant: &Informant, gas_used: U256) -> String {
let memory = if informant.config.omit_memory_output() {
"".to_string()
} else {
format!("0x{}", informant.memory.to_hex())
};
let storage = if informant.config.omit_storage_output() {
None
} else {
Some(&informant.storage)
};
let info = ::evm::Instruction::from_u8(informant.instruction).map(|i| i.info());
json!({
"pc": informant.pc,
"op": informant.instruction,
"opName": info.map(|i| i.name).unwrap_or(""),
"gas": format!("{:#x}", gas_used.saturating_add(informant.gas_cost)),
"gasCost": format!("{:#x}", informant.gas_cost),
"memory": memory,
"stack": informant.stack,
"storage": storage,
"depth": informant.depth,
})
.to_string()
}
}
impl vm::Informant for Informant {
type Sink = Config;
fn before_test(&mut self, name: &str, action: &str) {
println!("{}", json!({"action": action, "test": name}));
}
fn set_gas(&mut self, gas: U256) {
self.gas_used = gas;
}
fn clone_sink(&self) -> Self::Sink {
self.config
}
fn finish(result: vm::RunResult<Self::Output>, config: &mut Self::Sink) {
match result {
Ok(success) => {
for trace in success.traces.unwrap_or_else(Vec::new) {
println!("{}", trace);
}
let success_msg = json!({
"output": format!("0x{}", success.output.to_hex()),
"gasUsed": format!("{:#x}", success.gas_used),
"time": display::as_micros(&success.time),
});
println!("{}", success_msg)
}
Err(failure) => {
if !config.omit_storage_output() {
for trace in failure.traces.unwrap_or_else(Vec::new) {
println!("{}", trace);
}
}
let failure_msg = json!({
"error": &failure.error.to_string(),
"gasUsed": format!("{:#x}", failure.gas_used),
"time": display::as_micros(&failure.time),
});
println!("{}", failure_msg)
}
}
}
}
impl trace::VMTracer for Informant {
type Output = Vec<String>;
fn trace_next_instruction(&mut self, pc: usize, instruction: u8, _current_gas: U256) -> bool {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant| {
informant.pc = pc;
informant.instruction = instruction;
informant.unmatched = true;
});
true
}
fn trace_prepare_execute(
&mut self,
pc: usize,
instruction: u8,
gas_cost: U256,
mem_written: Option<(usize, usize)>,
store_written: Option<(U256, U256)>,
) {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant| {
informant.pc = pc;
informant.instruction = instruction;
informant.gas_cost = gas_cost;
informant.mem_written = mem_written;
informant.store_written = store_written;
});
}
fn trace_executed(&mut self, gas_used: U256, stack_push: &[U256], mem: &[u8]) {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant| {
let store_diff = informant.store_written.clone();
let info = ::evm::Instruction::from_u8(informant.instruction).map(|i| i.info());
let trace = Self::informant_trace(informant, gas_used);
informant.traces.push(trace);
informant.unmatched = false;
informant.gas_used = gas_used;
let len = informant.stack.len();
let info_args = info.map(|i| i.args).unwrap_or(0);
informant
.stack
.truncate(if len > info_args { len - info_args } else { 0 });
informant.stack.extend_from_slice(stack_push);
// TODO [ToDr] Align memory?
if let Some((pos, size)) = informant.mem_written.clone() {
if informant.memory.len() < (pos + size) {
informant.memory.resize(pos + size, 0);
}
informant.memory[pos..(pos + size)].copy_from_slice(&mem[pos..(pos + size)]);
}
if let Some((pos, val)) = store_diff {
informant.storage.insert(
BigEndianHash::from_uint(&pos),
BigEndianHash::from_uint(&val),
);
}
if !informant.subtraces.is_empty() {
informant
.traces
.extend(mem::replace(&mut informant.subtraces, vec![]));
}
});
}
fn prepare_subtrace(&mut self, code: &[u8]) {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant| {
let mut vm = Informant::default();
vm.config = informant.config;
vm.depth = informant.depth + 1;
vm.code = code.to_vec();
vm.gas_used = informant.gas_used;
informant.subinfos.push(vm);
});
self.subdepth += 1;
}
fn done_subtrace(&mut self) {
self.subdepth -= 1;
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant| {
if let Some(subtraces) = informant
.subinfos
.pop()
.expect("prepare/done_subtrace are not balanced")
.drain()
{
informant.subtraces.extend(subtraces);
}
});
}
fn drain(mut self) -> Option<Self::Output> {
if self.unmatched {
// print last line with final state:
self.gas_cost = 0.into();
let gas_used = self.gas_used;
let subdepth = self.subdepth;
Self::with_informant_in_depth(&mut self, subdepth, |informant: &mut Informant| {
let trace = Self::informant_trace(informant, gas_used);
informant.traces.push(trace);
});
} else if !self.subtraces.is_empty() {
self.traces
.extend(mem::replace(&mut self.subtraces, vec![]));
}
Some(self.traces)
}
}
#[cfg(test)]
mod tests {
use super::*;
use info::tests::run_test;
use serde_json;
#[derive(Serialize, Deserialize, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
struct TestTrace {
pc: usize,
#[serde(rename = "op")]
instruction: u8,
op_name: String,
#[serde(rename = "gas")]
gas_used: U256,
gas_cost: U256,
memory: String,
stack: Vec<U256>,
storage: Option<HashMap<H256, H256>>,
depth: usize,
}
fn assert_traces_eq(a: &[String], b: &[String]) {
let mut ita = a.iter();
let mut itb = b.iter();
loop {
match (ita.next(), itb.next()) {
(Some(a), Some(b)) => {
// Compare both without worrying about the order of the fields
let actual: TestTrace = serde_json::from_str(a).unwrap();
let expected: TestTrace = serde_json::from_str(b).unwrap();
assert_eq!(actual, expected);
println!("{}", a);
}
(None, None) => return,
e => {
panic!("Traces mismatch: {:?}", e);
}
}
}
}
fn compare_json(traces: Option<Vec<String>>, expected: &str) {
let expected = expected
.split("\n")
.map(|x| x.trim())
.map(|x| x.to_owned())
.filter(|x| !x.is_empty())
.collect::<Vec<_>>();
assert_traces_eq(&traces.unwrap(), &expected);
}
#[test]
fn should_trace_failure() {
run_test(
Informant::default(),
&compare_json,
"60F8d6",
0xffff,
r#"
{"pc":0,"op":96,"opName":"PUSH1","gas":"0xffff","gasCost":"0x3","memory":"0x","stack":[],"storage":{},"depth":1}
{"pc":2,"op":214,"opName":"","gas":"0xfffc","gasCost":"0x0","memory":"0x","stack":["0xf8"],"storage":{},"depth":1}
"#,
);
run_test(
Informant::default(),
&compare_json,
"F8d6",
0xffff,
r#"
{"pc":0,"op":248,"opName":"","gas":"0xffff","gasCost":"0x0","memory":"0x","stack":[],"storage":{},"depth":1}
"#,
);
run_test(
Informant::default(),
&compare_json,
"5A51",
0xfffff,
r#"
{"depth":1,"gas":"0xfffff","gasCost":"0x2","memory":"0x","op":90,"opName":"GAS","pc":0,"stack":[],"storage":{}}
{"depth":1,"gas":"0xffffd","gasCost":"0x0","memory":"0x","op":81,"opName":"MLOAD","pc":1,"stack":["0xffffd"],"storage":{}}
"#,
);
}
#[test]
fn should_trace_create_correctly() {
run_test(
Informant::default(),
&compare_json,
"32343434345830f138343438323439f0",
0xffff,
r#"
{"pc":0,"op":50,"opName":"ORIGIN","gas":"0xffff","gasCost":"0x2","memory":"0x","stack":[],"storage":{},"depth":1}
{"pc":1,"op":52,"opName":"CALLVALUE","gas":"0xfffd","gasCost":"0x2","memory":"0x","stack":["0x0"],"storage":{},"depth":1}
{"pc":2,"op":52,"opName":"CALLVALUE","gas":"0xfffb","gasCost":"0x2","memory":"0x","stack":["0x0","0x0"],"storage":{},"depth":1}
{"pc":3,"op":52,"opName":"CALLVALUE","gas":"0xfff9","gasCost":"0x2","memory":"0x","stack":["0x0","0x0","0x0"],"storage":{},"depth":1}
{"pc":4,"op":52,"opName":"CALLVALUE","gas":"0xfff7","gasCost":"0x2","memory":"0x","stack":["0x0","0x0","0x0","0x0"],"storage":{},"depth":1}
{"pc":5,"op":88,"opName":"PC","gas":"0xfff5","gasCost":"0x2","memory":"0x","stack":["0x0","0x0","0x0","0x0","0x0"],"storage":{},"depth":1}
{"pc":6,"op":48,"opName":"ADDRESS","gas":"0xfff3","gasCost":"0x2","memory":"0x","stack":["0x0","0x0","0x0","0x0","0x0","0x5"],"storage":{},"depth":1}
{"pc":7,"op":241,"opName":"CALL","gas":"0xfff1","gasCost":"0x61d0","memory":"0x","stack":["0x0","0x0","0x0","0x0","0x0","0x5","0x0"],"storage":{},"depth":1}
{"pc":8,"op":56,"opName":"CODESIZE","gas":"0x9e21","gasCost":"0x2","memory":"0x","stack":["0x1"],"storage":{},"depth":1}
{"pc":9,"op":52,"opName":"CALLVALUE","gas":"0x9e1f","gasCost":"0x2","memory":"0x","stack":["0x1","0x10"],"storage":{},"depth":1}
{"pc":10,"op":52,"opName":"CALLVALUE","gas":"0x9e1d","gasCost":"0x2","memory":"0x","stack":["0x1","0x10","0x0"],"storage":{},"depth":1}
{"pc":11,"op":56,"opName":"CODESIZE","gas":"0x9e1b","gasCost":"0x2","memory":"0x","stack":["0x1","0x10","0x0","0x0"],"storage":{},"depth":1}
{"pc":12,"op":50,"opName":"ORIGIN","gas":"0x9e19","gasCost":"0x2","memory":"0x","stack":["0x1","0x10","0x0","0x0","0x10"],"storage":{},"depth":1}
{"pc":13,"op":52,"opName":"CALLVALUE","gas":"0x9e17","gasCost":"0x2","memory":"0x","stack":["0x1","0x10","0x0","0x0","0x10","0x0"],"storage":{},"depth":1}
{"pc":14,"op":57,"opName":"CODECOPY","gas":"0x9e15","gasCost":"0x9","memory":"0x","stack":["0x1","0x10","0x0","0x0","0x10","0x0","0x0"],"storage":{},"depth":1}
{"pc":15,"op":240,"opName":"CREATE","gas":"0x9e0c","gasCost":"0x9e0c","memory":"0x32343434345830f138343438323439f0","stack":["0x1","0x10","0x0","0x0"],"storage":{},"depth":1}
{"pc":0,"op":50,"opName":"ORIGIN","gas":"0x210c","gasCost":"0x2","memory":"0x","stack":[],"storage":{},"depth":2}
{"pc":1,"op":52,"opName":"CALLVALUE","gas":"0x210a","gasCost":"0x2","memory":"0x","stack":["0x0"],"storage":{},"depth":2}
{"pc":2,"op":52,"opName":"CALLVALUE","gas":"0x2108","gasCost":"0x2","memory":"0x","stack":["0x0","0x0"],"storage":{},"depth":2}
{"pc":3,"op":52,"opName":"CALLVALUE","gas":"0x2106","gasCost":"0x2","memory":"0x","stack":["0x0","0x0","0x0"],"storage":{},"depth":2}
{"pc":4,"op":52,"opName":"CALLVALUE","gas":"0x2104","gasCost":"0x2","memory":"0x","stack":["0x0","0x0","0x0","0x0"],"storage":{},"depth":2}
{"pc":5,"op":88,"opName":"PC","gas":"0x2102","gasCost":"0x2","memory":"0x","stack":["0x0","0x0","0x0","0x0","0x0"],"storage":{},"depth":2}
{"pc":6,"op":48,"opName":"ADDRESS","gas":"0x2100","gasCost":"0x2","memory":"0x","stack":["0x0","0x0","0x0","0x0","0x0","0x5"],"storage":{},"depth":2}
{"pc":7,"op":241,"opName":"CALL","gas":"0x20fe","gasCost":"0x0","memory":"0x","stack":["0x0","0x0","0x0","0x0","0x0","0x5","0xbd770416a3345f91e4b34576cb804a576fa48eb1"],"storage":{},"depth":2}
"#,
);
run_test(
Informant::default(),
&compare_json,
"3260D85554",
0xffff,
r#"
{"pc":0,"op":50,"opName":"ORIGIN","gas":"0xffff","gasCost":"0x2","memory":"0x","stack":[],"storage":{},"depth":1}
{"pc":1,"op":96,"opName":"PUSH1","gas":"0xfffd","gasCost":"0x3","memory":"0x","stack":["0x0"],"storage":{},"depth":1}
{"pc":3,"op":85,"opName":"SSTORE","gas":"0xfffa","gasCost":"0x1388","memory":"0x","stack":["0x0","0xd8"],"storage":{},"depth":1}
{"pc":4,"op":84,"opName":"SLOAD","gas":"0xec72","gasCost":"0x0","memory":"0x","stack":[],"storage":{"0x00000000000000000000000000000000000000000000000000000000000000d8":"0x0000000000000000000000000000000000000000000000000000000000000000"},"depth":1}
"#,
);
}
#[test]
fn should_omit_storage_and_memory_flag() {
// should omit storage
run_test(
Informant::new(Config::new(true, true)),
&compare_json,
"3260D85554",
0xffff,
r#"
{"pc":0,"op":50,"opName":"ORIGIN","gas":"0xffff","gasCost":"0x2","memory":"","stack":[],"storage":null,"depth":1}
{"pc":1,"op":96,"opName":"PUSH1","gas":"0xfffd","gasCost":"0x3","memory":"","stack":["0x0"],"storage":null,"depth":1}
{"pc":3,"op":85,"opName":"SSTORE","gas":"0xfffa","gasCost":"0x1388","memory":"","stack":["0x0","0xd8"],"storage":null,"depth":1}
{"pc":4,"op":84,"opName":"SLOAD","gas":"0xec72","gasCost":"0x0","memory":"","stack":[],"storage":null,"depth":1}
"#,
)
}
}

View File

@ -0,0 +1,34 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! VM Output display utils.
use std::time::Duration;
pub mod config;
pub mod json;
pub mod simple;
pub mod std_json;
/// Formats duration into human readable format.
pub fn format_time(time: &Duration) -> String {
format!("{}.{:.9}s", time.as_secs(), time.subsec_nanos())
}
/// Formats the time as microseconds.
pub fn as_micros(time: &Duration) -> u64 {
time.as_secs() * 1_000_000 + time.subsec_nanos() as u64 / 1_000
}

View File

@ -0,0 +1,74 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Simple VM output.
use super::config::Config;
use bytes::ToPretty;
use ethcore::trace;
use display;
use info as vm;
/// Simple formatting informant.
#[derive(Default)]
pub struct Informant {
config: Config,
}
impl Informant {
pub fn new(config: Config) -> Informant {
Informant { config }
}
}
impl vm::Informant for Informant {
type Sink = Config;
fn before_test(&mut self, name: &str, action: &str) {
println!("Test: {} ({})", name, action);
}
fn clone_sink(&self) -> Self::Sink {
self.config
}
fn finish(result: vm::RunResult<Self::Output>, _sink: &mut Self::Sink) {
match result {
Ok(success) => {
println!("Output: 0x{}", success.output.to_hex());
println!("Gas used: {:x}", success.gas_used);
println!("Time: {}", display::format_time(&success.time));
}
Err(failure) => {
println!("Error: {}", failure.error);
println!("Time: {}", display::format_time(&failure.time));
}
}
}
}
impl trace::VMTracer for Informant {
type Output = ();
fn prepare_subtrace(&mut self, _code: &[u8]) {
Default::default()
}
fn done_subtrace(&mut self) {}
fn drain(self) -> Option<()> {
None
}
}

View File

@ -0,0 +1,413 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Standardized JSON VM output.
use std::{collections::HashMap, io};
use super::config::Config;
use bytes::ToPretty;
use display;
use ethcore::{pod_state, trace};
use ethereum_types::{BigEndianHash, H256, U256};
use info as vm;
pub trait Writer: io::Write + Send + Sized {
fn clone(&self) -> Self;
fn default() -> Self;
}
impl Writer for io::Stdout {
fn clone(&self) -> Self {
io::stdout()
}
fn default() -> Self {
io::stdout()
}
}
impl Writer for io::Stderr {
fn clone(&self) -> Self {
io::stderr()
}
fn default() -> Self {
io::stderr()
}
}
/// JSON formatting informant.
pub struct Informant<Trace, Out> {
code: Vec<u8>,
instruction: u8,
depth: usize,
stack: Vec<U256>,
storage: HashMap<H256, H256>,
subinfos: Vec<Informant<Trace, Out>>,
subdepth: usize,
trace_sink: Trace,
out_sink: Out,
config: Config,
}
impl Default for Informant<io::Stderr, io::Stdout> {
fn default() -> Self {
Self::new(io::stderr(), io::stdout(), Config::default())
}
}
impl Informant<io::Stdout, io::Stdout> {
/// std json informant using out only.
pub fn out_only(config: Config) -> Self {
Self::new(io::stdout(), io::stdout(), config)
}
}
impl Informant<io::Stderr, io::Stderr> {
/// std json informant using err only.
pub fn err_only(config: Config) -> Self {
Self::new(io::stderr(), io::stderr(), config)
}
}
impl Informant<io::Stderr, io::Stdout> {
pub fn new_default(config: Config) -> Self {
let mut informant = Self::default();
informant.config = config;
informant
}
}
impl<Trace: Writer, Out: Writer> Informant<Trace, Out> {
pub fn new(trace_sink: Trace, out_sink: Out, config: Config) -> Self {
Informant {
code: Default::default(),
instruction: Default::default(),
depth: Default::default(),
stack: Default::default(),
storage: Default::default(),
subinfos: Default::default(),
subdepth: 0,
trace_sink,
out_sink,
config,
}
}
fn with_informant_in_depth<F: Fn(&mut Informant<Trace, Out>)>(
informant: &mut Informant<Trace, Out>,
depth: usize,
f: F,
) {
if depth == 0 {
f(informant);
} else {
Self::with_informant_in_depth(
informant
.subinfos
.last_mut()
.expect("prepare/done_trace are not balanced"),
depth - 1,
f,
);
}
}
fn dump_state_into(
trace_sink: &mut Trace,
root: H256,
end_state: &Option<pod_state::PodState>,
) {
if let Some(ref end_state) = end_state {
let dump_data = json!({
"root": root,
"accounts": end_state,
});
writeln!(trace_sink, "{}", dump_data).expect("The sink must be writeable.");
}
}
}
impl<Trace: Writer, Out: Writer> vm::Informant for Informant<Trace, Out> {
type Sink = (Trace, Out, Config);
fn before_test(&mut self, name: &str, action: &str) {
let out_data = json!({
"action": action,
"test": name,
});
writeln!(&mut self.out_sink, "{}", out_data).expect("The sink must be writeable.");
}
fn set_gas(&mut self, _gas: U256) {}
fn clone_sink(&self) -> Self::Sink {
(
self.trace_sink.clone(),
self.out_sink.clone(),
self.config.clone(),
)
}
fn finish(
result: vm::RunResult<<Self as trace::VMTracer>::Output>,
(ref mut trace_sink, ref mut out_sink, _): &mut Self::Sink,
) {
match result {
Ok(success) => {
let trace_data = json!({"stateRoot": success.state_root});
writeln!(trace_sink, "{}", trace_data).expect("The sink must be writeable.");
Self::dump_state_into(trace_sink, success.state_root, &success.end_state);
let out_data = json!({
"output": format!("0x{}", success.output.to_hex()),
"gasUsed": format!("{:#x}", success.gas_used),
"time": display::as_micros(&success.time),
});
writeln!(out_sink, "{}", out_data).expect("The sink must be writeable.");
}
Err(failure) => {
let out_data = json!({
"error": &failure.error.to_string(),
"gasUsed": format!("{:#x}", failure.gas_used),
"time": display::as_micros(&failure.time),
});
Self::dump_state_into(trace_sink, failure.state_root, &failure.end_state);
writeln!(out_sink, "{}", out_data).expect("The sink must be writeable.");
}
}
}
}
impl<Trace: Writer, Out: Writer> trace::VMTracer for Informant<Trace, Out> {
type Output = ();
fn trace_next_instruction(&mut self, pc: usize, instruction: u8, current_gas: U256) -> bool {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant<Trace, Out>| {
let storage = if informant.config.omit_storage_output() {
None
} else {
Some(&informant.storage)
};
let info = ::evm::Instruction::from_u8(instruction).map(|i| i.info());
informant.instruction = instruction;
let trace_data = json!({
"pc": pc,
"op": instruction,
"opName": info.map(|i| i.name).unwrap_or(""),
"gas": format!("{:#x}", current_gas),
"stack": informant.stack,
"storage": storage,
"depth": informant.depth,
});
writeln!(&mut informant.trace_sink, "{}", trace_data)
.expect("The sink must be writeable.");
});
true
}
fn trace_prepare_execute(
&mut self,
_pc: usize,
_instruction: u8,
_gas_cost: U256,
_mem_written: Option<(usize, usize)>,
store_written: Option<(U256, U256)>,
) {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant<Trace, Out>| {
if let Some((pos, val)) = store_written {
informant.storage.insert(
BigEndianHash::from_uint(&pos),
BigEndianHash::from_uint(&val),
);
}
});
}
fn trace_executed(&mut self, _gas_used: U256, stack_push: &[U256], _mem: &[u8]) {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant<Trace, Out>| {
let info = ::evm::Instruction::from_u8(informant.instruction).map(|i| i.info());
let len = informant.stack.len();
let info_args = info.map(|i| i.args).unwrap_or(0);
informant
.stack
.truncate(if len > info_args { len - info_args } else { 0 });
informant.stack.extend_from_slice(stack_push);
});
}
fn prepare_subtrace(&mut self, code: &[u8]) {
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant<Trace, Out>| {
let mut vm = Informant::new(
informant.trace_sink.clone(),
informant.out_sink.clone(),
informant.config,
);
vm.depth = informant.depth + 1;
vm.code = code.to_vec();
informant.subinfos.push(vm);
});
self.subdepth += 1;
}
fn done_subtrace(&mut self) {
self.subdepth -= 1;
let subdepth = self.subdepth;
Self::with_informant_in_depth(self, subdepth, |informant: &mut Informant<Trace, Out>| {
informant.subinfos.pop();
});
}
fn drain(self) -> Option<Self::Output> {
None
}
}
#[cfg(test)]
pub mod tests {
use super::*;
use info::tests::run_test;
use std::sync::{Arc, Mutex};
#[derive(Debug, Clone, Default)]
pub struct TestWriter(pub Arc<Mutex<Vec<u8>>>);
impl Writer for TestWriter {
fn clone(&self) -> Self {
Clone::clone(self)
}
fn default() -> Self {
Default::default()
}
}
impl io::Write for TestWriter {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.0.lock().unwrap().write(buf)
}
fn flush(&mut self) -> io::Result<()> {
self.0.lock().unwrap().flush()
}
}
pub fn informant(config: Config) -> (Informant<TestWriter, TestWriter>, Arc<Mutex<Vec<u8>>>) {
let trace_writer: TestWriter = Default::default();
let out_writer: TestWriter = Default::default();
let res = trace_writer.0.clone();
(Informant::new(trace_writer, out_writer, config), res)
}
#[test]
fn should_trace_failure() {
let (inf, res) = informant(Config::default());
run_test(
inf,
move |_, expected| {
let bytes = res.lock().unwrap();
assert_eq!(expected, &String::from_utf8_lossy(&**bytes))
},
"60F8d6",
0xffff,
r#"{"depth":1,"gas":"0xffff","op":96,"opName":"PUSH1","pc":0,"stack":[],"storage":{}}
{"depth":1,"gas":"0xfffc","op":214,"opName":"","pc":2,"stack":["0xf8"],"storage":{}}
"#,
);
let (inf, res) = informant(Config::default());
run_test(
inf,
move |_, expected| {
let bytes = res.lock().unwrap();
assert_eq!(expected, &String::from_utf8_lossy(&**bytes))
},
"F8d6",
0xffff,
r#"{"depth":1,"gas":"0xffff","op":248,"opName":"","pc":0,"stack":[],"storage":{}}
"#,
);
}
#[test]
fn should_trace_create_correctly() {
let (informant, res) = informant(Config::default());
run_test(
informant,
move |_, expected| {
let bytes = res.lock().unwrap();
assert_eq!(expected, &String::from_utf8_lossy(&**bytes))
},
"32343434345830f138343438323439f0",
0xffff,
r#"{"depth":1,"gas":"0xffff","op":50,"opName":"ORIGIN","pc":0,"stack":[],"storage":{}}
{"depth":1,"gas":"0xfffd","op":52,"opName":"CALLVALUE","pc":1,"stack":["0x0"],"storage":{}}
{"depth":1,"gas":"0xfffb","op":52,"opName":"CALLVALUE","pc":2,"stack":["0x0","0x0"],"storage":{}}
{"depth":1,"gas":"0xfff9","op":52,"opName":"CALLVALUE","pc":3,"stack":["0x0","0x0","0x0"],"storage":{}}
{"depth":1,"gas":"0xfff7","op":52,"opName":"CALLVALUE","pc":4,"stack":["0x0","0x0","0x0","0x0"],"storage":{}}
{"depth":1,"gas":"0xfff5","op":88,"opName":"PC","pc":5,"stack":["0x0","0x0","0x0","0x0","0x0"],"storage":{}}
{"depth":1,"gas":"0xfff3","op":48,"opName":"ADDRESS","pc":6,"stack":["0x0","0x0","0x0","0x0","0x0","0x5"],"storage":{}}
{"depth":1,"gas":"0xfff1","op":241,"opName":"CALL","pc":7,"stack":["0x0","0x0","0x0","0x0","0x0","0x5","0x0"],"storage":{}}
{"depth":1,"gas":"0x9e21","op":56,"opName":"CODESIZE","pc":8,"stack":["0x1"],"storage":{}}
{"depth":1,"gas":"0x9e1f","op":52,"opName":"CALLVALUE","pc":9,"stack":["0x1","0x10"],"storage":{}}
{"depth":1,"gas":"0x9e1d","op":52,"opName":"CALLVALUE","pc":10,"stack":["0x1","0x10","0x0"],"storage":{}}
{"depth":1,"gas":"0x9e1b","op":56,"opName":"CODESIZE","pc":11,"stack":["0x1","0x10","0x0","0x0"],"storage":{}}
{"depth":1,"gas":"0x9e19","op":50,"opName":"ORIGIN","pc":12,"stack":["0x1","0x10","0x0","0x0","0x10"],"storage":{}}
{"depth":1,"gas":"0x9e17","op":52,"opName":"CALLVALUE","pc":13,"stack":["0x1","0x10","0x0","0x0","0x10","0x0"],"storage":{}}
{"depth":1,"gas":"0x9e15","op":57,"opName":"CODECOPY","pc":14,"stack":["0x1","0x10","0x0","0x0","0x10","0x0","0x0"],"storage":{}}
{"depth":1,"gas":"0x9e0c","op":240,"opName":"CREATE","pc":15,"stack":["0x1","0x10","0x0","0x0"],"storage":{}}
{"depth":2,"gas":"0x210c","op":50,"opName":"ORIGIN","pc":0,"stack":[],"storage":{}}
{"depth":2,"gas":"0x210a","op":52,"opName":"CALLVALUE","pc":1,"stack":["0x0"],"storage":{}}
{"depth":2,"gas":"0x2108","op":52,"opName":"CALLVALUE","pc":2,"stack":["0x0","0x0"],"storage":{}}
{"depth":2,"gas":"0x2106","op":52,"opName":"CALLVALUE","pc":3,"stack":["0x0","0x0","0x0"],"storage":{}}
{"depth":2,"gas":"0x2104","op":52,"opName":"CALLVALUE","pc":4,"stack":["0x0","0x0","0x0","0x0"],"storage":{}}
{"depth":2,"gas":"0x2102","op":88,"opName":"PC","pc":5,"stack":["0x0","0x0","0x0","0x0","0x0"],"storage":{}}
{"depth":2,"gas":"0x2100","op":48,"opName":"ADDRESS","pc":6,"stack":["0x0","0x0","0x0","0x0","0x0","0x5"],"storage":{}}
{"depth":2,"gas":"0x20fe","op":241,"opName":"CALL","pc":7,"stack":["0x0","0x0","0x0","0x0","0x0","0x5","0xbd770416a3345f91e4b34576cb804a576fa48eb1"],"storage":{}}
"#,
)
}
#[test]
fn should_omit_storage_and_memory_flag() {
// should omit storage
let (informant, res) = informant(Config::new(true, true));
run_test(
informant,
move |_, expected| {
let bytes = res.lock().unwrap();
assert_eq!(expected, &String::from_utf8_lossy(&**bytes))
},
"3260D85554",
0xffff,
r#"{"depth":1,"gas":"0xffff","op":50,"opName":"ORIGIN","pc":0,"stack":[],"storage":null}
{"depth":1,"gas":"0xfffd","op":96,"opName":"PUSH1","pc":1,"stack":["0x0"],"storage":null}
{"depth":1,"gas":"0xfffa","op":85,"opName":"SSTORE","pc":3,"stack":["0x0","0xd8"],"storage":null}
{"depth":1,"gas":"0xec72","op":84,"opName":"SLOAD","pc":4,"stack":[],"storage":null}
"#,
)
}
}

316
bin/evmbin/src/info.rs Normal file
View File

@ -0,0 +1,316 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! VM runner.
use ethcore::{
client::{self, EvmTestClient, EvmTestError, TransactErr, TransactSuccess},
pod_state, spec, state, state_db, trace, TrieSpec,
};
use ethereum_types::{H256, U256};
use ethjson;
use std::time::{Duration, Instant};
use types::transaction;
use vm::ActionParams;
/// VM execution informant
pub trait Informant: trace::VMTracer {
/// Sink to use with finish
type Sink;
/// Display a single run init message
fn before_test(&mut self, test: &str, action: &str);
/// Set initial gas.
fn set_gas(&mut self, _gas: U256) {}
/// Clone sink.
fn clone_sink(&self) -> Self::Sink;
/// Display final result.
fn finish(result: RunResult<Self::Output>, &mut Self::Sink);
}
/// Execution finished correctly
#[derive(Debug)]
pub struct Success<T> {
/// State root
pub state_root: H256,
/// Used gas
pub gas_used: U256,
/// Output as bytes
pub output: Vec<u8>,
/// Time Taken
pub time: Duration,
/// Traces
pub traces: Option<T>,
/// Optional end state dump
pub end_state: Option<pod_state::PodState>,
}
/// Execution failed
#[derive(Debug)]
pub struct Failure<T> {
/// State root
pub state_root: H256,
/// Used gas
pub gas_used: U256,
/// Internal error
pub error: EvmTestError,
/// Duration
pub time: Duration,
/// Traces
pub traces: Option<T>,
/// Optional end state dump
pub end_state: Option<pod_state::PodState>,
}
/// EVM Execution result
pub type RunResult<T> = Result<Success<T>, Failure<T>>;
/// Execute given `ActionParams` and return the result.
pub fn run_action<T: Informant>(
spec: &spec::Spec,
mut params: ActionParams,
mut informant: T,
trie_spec: TrieSpec,
) -> RunResult<T::Output> {
informant.set_gas(params.gas);
// if the code is not overwritten from CLI, use code from spec file.
if params.code.is_none() {
if let Some(acc) = spec.genesis_state().get().get(&params.code_address) {
params.code = acc.code.clone().map(::std::sync::Arc::new);
params.code_hash = None;
}
}
run(
spec,
trie_spec,
params.gas,
spec.genesis_state(),
|mut client| {
let result = match client.call(params, &mut trace::NoopTracer, &mut informant) {
Ok(r) => (Ok(r.return_data.to_vec()), Some(r.gas_left)),
Err(err) => (Err(err), None),
};
(result.0, H256::zero(), None, result.1, informant.drain())
},
)
}
/// Execute given Transaction and verify resulting state root.
pub fn run_transaction<T: Informant>(
name: &str,
idx: usize,
spec: &ethjson::spec::ForkSpec,
pre_state: &pod_state::PodState,
post_root: H256,
env_info: &client::EnvInfo,
transaction: transaction::SignedTransaction,
mut informant: T,
trie_spec: TrieSpec,
) {
let spec_name = format!("{:?}", spec).to_lowercase();
let spec = match EvmTestClient::spec_from_json(spec) {
Some(spec) => {
informant.before_test(&format!("{}:{}:{}", name, spec_name, idx), "starting");
spec
}
None => {
informant.before_test(
&format!("{}:{}:{}", name, spec_name, idx),
"skipping because of missing spec",
);
return;
}
};
informant.set_gas(env_info.gas_limit);
let mut sink = informant.clone_sink();
let result = run(
&spec,
trie_spec,
transaction.tx().gas,
pre_state,
|mut client| {
let result = client.transact(env_info, transaction, trace::NoopTracer, informant);
match result {
Ok(TransactSuccess {
state_root,
gas_left,
output,
vm_trace,
end_state,
..
}) => {
if state_root != post_root {
(
Err(EvmTestError::PostCondition(format!(
"State root mismatch (got: {:#x}, expected: {:#x})",
state_root, post_root,
))),
state_root,
end_state,
Some(gas_left),
None,
)
} else {
(Ok(output), state_root, end_state, Some(gas_left), vm_trace)
}
}
Err(TransactErr {
state_root,
error,
end_state,
}) => (
Err(EvmTestError::PostCondition(format!(
"Unexpected execution error: {:?}",
error
))),
state_root,
end_state,
None,
None,
),
}
},
);
T::finish(result, &mut sink)
}
fn dump_state(state: &state::State<state_db::StateDB>) -> Option<pod_state::PodState> {
state.to_pod_full().ok()
}
/// Execute VM with given `ActionParams`
pub fn run<'a, F, X>(
spec: &'a spec::Spec,
trie_spec: TrieSpec,
initial_gas: U256,
pre_state: &'a pod_state::PodState,
run: F,
) -> RunResult<X>
where
F: FnOnce(
EvmTestClient,
) -> (
Result<Vec<u8>, EvmTestError>,
H256,
Option<pod_state::PodState>,
Option<U256>,
Option<X>,
),
{
let do_dump = trie_spec == TrieSpec::Fat;
let mut test_client =
EvmTestClient::from_pod_state_with_trie(spec, pre_state.clone(), trie_spec).map_err(
|error| Failure {
gas_used: 0.into(),
error,
time: Duration::from_secs(0),
traces: None,
state_root: H256::default(),
end_state: None,
},
)?;
if do_dump {
test_client.set_dump_state_fn(dump_state);
}
let start = Instant::now();
let result = run(test_client);
let time = start.elapsed();
match result {
(Ok(output), state_root, end_state, gas_left, traces) => Ok(Success {
state_root,
gas_used: gas_left
.map(|gas_left| initial_gas - gas_left)
.unwrap_or(initial_gas),
output,
time,
traces,
end_state,
}),
(Err(error), state_root, end_state, gas_left, traces) => Err(Failure {
gas_used: gas_left
.map(|gas_left| initial_gas - gas_left)
.unwrap_or(initial_gas),
error,
time,
traces,
state_root,
end_state,
}),
}
}
#[cfg(test)]
pub mod tests {
use super::*;
use ethereum_types::Address;
use rustc_hex::FromHex;
use std::sync::Arc;
use tempdir::TempDir;
pub fn run_test<T, I, F>(informant: I, compare: F, code: &str, gas: T, expected: &str)
where
T: Into<U256>,
I: Informant,
F: FnOnce(Option<I::Output>, &str),
{
let mut params = ActionParams::default();
params.code = Some(Arc::new(code.from_hex().unwrap()));
params.gas = gas.into();
let tempdir = TempDir::new("").unwrap();
let spec = ::ethcore::ethereum::new_foundation(&tempdir.path());
let result = run_action(&spec, params, informant, TrieSpec::Secure);
match result {
Ok(Success { traces, .. }) => compare(traces, expected),
Err(Failure { traces, .. }) => compare(traces, expected),
}
}
#[test]
fn should_call_account_from_spec() {
use display::{config::Config, std_json::tests::informant};
let (inf, res) = informant(Config::default());
let mut params = ActionParams::default();
params.code_address = Address::from_low_u64_be(0x20);
params.gas = 0xffff.into();
let spec = ::ethcore::ethereum::load(None, include_bytes!("../res/testchain.json"));
let _result = run_action(&spec, params, inf, TrieSpec::Secure);
assert_eq!(
&String::from_utf8_lossy(&**res.lock().unwrap()),
r#"{"depth":1,"gas":"0xffff","op":98,"opName":"PUSH3","pc":0,"stack":[],"storage":{}}
{"depth":1,"gas":"0xfffc","op":96,"opName":"PUSH1","pc":4,"stack":["0xaaaaaa"],"storage":{}}
{"depth":1,"gas":"0xfff9","op":96,"opName":"PUSH1","pc":6,"stack":["0xaaaaaa","0xaa"],"storage":{}}
{"depth":1,"gas":"0xfff6","op":80,"opName":"POP","pc":8,"stack":["0xaaaaaa","0xaa","0xaa"],"storage":{}}
{"depth":1,"gas":"0xfff4","op":96,"opName":"PUSH1","pc":9,"stack":["0xaaaaaa","0xaa"],"storage":{}}
{"depth":1,"gas":"0xfff1","op":96,"opName":"PUSH1","pc":11,"stack":["0xaaaaaa","0xaa","0xaa"],"storage":{}}
{"depth":1,"gas":"0xffee","op":96,"opName":"PUSH1","pc":13,"stack":["0xaaaaaa","0xaa","0xaa","0xaa"],"storage":{}}
{"depth":1,"gas":"0xffeb","op":96,"opName":"PUSH1","pc":15,"stack":["0xaaaaaa","0xaa","0xaa","0xaa","0xaa"],"storage":{}}
{"depth":1,"gas":"0xffe8","op":96,"opName":"PUSH1","pc":17,"stack":["0xaaaaaa","0xaa","0xaa","0xaa","0xaa","0xaa"],"storage":{}}
{"depth":1,"gas":"0xffe5","op":96,"opName":"PUSH1","pc":19,"stack":["0xaaaaaa","0xaa","0xaa","0xaa","0xaa","0xaa","0xaa"],"storage":{}}
"#
);
}
}

511
bin/evmbin/src/main.rs Normal file
View File

@ -0,0 +1,511 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! OpenEthereum EVM interpreter binary.
#![warn(missing_docs)]
extern crate common_types as types;
extern crate ethcore;
extern crate ethjson;
extern crate rustc_hex;
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate serde_json;
extern crate docopt;
extern crate env_logger;
extern crate ethereum_types;
extern crate evm;
extern crate panic_hook;
extern crate parity_bytes as bytes;
extern crate vm;
#[cfg(test)]
#[macro_use]
extern crate pretty_assertions;
#[cfg(test)]
extern crate tempdir;
use bytes::Bytes;
use docopt::Docopt;
use ethcore::{json_tests, spec, TrieSpec};
use ethereum_types::{Address, U256};
use ethjson::spec::ForkSpec;
use evm::EnvInfo;
use rustc_hex::FromHex;
use std::{fmt, fs, path::PathBuf, sync::Arc};
use vm::{ActionParams, CallType};
mod display;
mod info;
use info::Informant;
const USAGE: &'static str = r#"
EVM implementation for Parity.
Copyright 2015-2020 Parity Technologies (UK) Ltd.
Usage:
openethereum-evm state-test <file> [--json --std-json --std-dump-json --only NAME --chain CHAIN --std-out-only --std-err-only --omit-storage-output --omit-memory-output]
openethereum-evm stats [options]
openethereum-evm stats-jsontests-vm <file>
openethereum-evm [options]
openethereum-evm [-h | --help]
Commands:
state-test Run a state test from a json file.
stats Execute EVM runtime code and return the statistics.
stats-jsontests-vm Execute standard json-tests format VMTests and return
timing statistics in tsv format.
Transaction options:
--code CODE Contract code as hex (without 0x).
--to ADDRESS Recipient address (without 0x).
--from ADDRESS Sender address (without 0x).
--input DATA Input data as hex (without 0x).
--gas GAS Supplied gas as hex (without 0x).
--gas-price WEI Supplied gas price as hex (without 0x).
State test options:
--chain CHAIN Run only from specific chain name (i.e. one of EIP150, EIP158,
Frontier, Homestead, Byzantium, Constantinople,
ConstantinopleFix, Istanbul, EIP158ToByzantiumAt5, FrontierToHomesteadAt5,
HomesteadToDaoAt5, HomesteadToEIP150At5, Berlin, Yolo3).
--only NAME Runs only a single test matching the name.
General options:
--json Display verbose results in JSON.
--std-json Display results in standardized JSON format.
--std-err-only With --std-json redirect to err output only.
--std-out-only With --std-json redirect to out output only.
--omit-storage-output With --std-json omit storage output.
--omit-memory-output With --std-json omit memory output.
--std-dump-json Display results in standardized JSON format
with additional state dump.
Display result state dump in standardized JSON format.
--chain CHAIN Chain spec file path.
-h, --help Display this message and exit.
"#;
fn main() {
panic_hook::set_abort();
env_logger::init();
let args: Args = Docopt::new(USAGE)
.and_then(|d| d.deserialize())
.unwrap_or_else(|e| e.exit());
let config = args.config();
if args.cmd_state_test {
run_state_test(args)
} else if args.cmd_stats_jsontests_vm {
run_stats_jsontests_vm(args)
} else if args.flag_json {
run_call(args, display::json::Informant::new(config))
} else if args.flag_std_dump_json || args.flag_std_json {
if args.flag_std_err_only {
run_call(args, display::std_json::Informant::err_only(config))
} else if args.flag_std_out_only {
run_call(args, display::std_json::Informant::out_only(config))
} else {
run_call(args, display::std_json::Informant::new_default(config))
};
} else {
run_call(args, display::simple::Informant::new(config))
}
}
fn run_stats_jsontests_vm(args: Args) {
use json_tests::HookType;
use std::{
collections::HashMap,
time::{Duration, Instant},
};
let file = args.arg_file.expect("FILE (or PATH) is required");
let mut timings: HashMap<String, (Instant, Option<Duration>)> = HashMap::new();
{
let mut record_time = |name: &str, typ: HookType| match typ {
HookType::OnStart => {
timings.insert(name.to_string(), (Instant::now(), None));
}
HookType::OnStop => {
timings.entry(name.to_string()).and_modify(|v| {
v.1 = Some(v.0.elapsed());
});
}
};
for file_path in json_tests::find_json_files_recursive(&file) {
let json_data = std::fs::read(&file_path).unwrap();
json_tests::json_executive_test(&file_path, &json_data, &mut record_time);
}
}
for (name, v) in timings {
println!(
"{}\t{}",
name,
display::as_micros(&v.1.expect("All hooks are called with OnStop; qed"))
);
}
}
fn run_state_test(args: Args) {
use ethjson::state::test::Test;
let config = args.config();
let file = args.arg_file.expect("FILE is required");
let mut file = match fs::File::open(&file) {
Err(err) => die(format!("Unable to open: {:?}: {}", file, err)),
Ok(file) => file,
};
let state_test = match Test::load(&mut file) {
Err(err) => die(format!("Unable to load the test file: {}", err)),
Ok(test) => test,
};
let only_test = args.flag_only.map(|s| s.to_lowercase());
let only_chain = args.flag_chain.map(|s| s.to_lowercase());
for (name, test) in state_test {
if let Some(false) = only_test
.as_ref()
.map(|only_test| &name.to_lowercase() == only_test)
{
continue;
}
let multitransaction = test.transaction;
let env_info: EnvInfo = test.env.into();
let pre = test.pre_state.into();
for (spec, states) in test.post_states {
//hardcode base fee for part of the london tests, that miss base fee field in env
let mut test_env = env_info.clone();
if spec >= ForkSpec::London {
if test_env.base_fee.is_none() {
test_env.base_fee = Some(0x0a.into());
}
}
if let Some(false) = only_chain
.as_ref()
.map(|only_chain| &format!("{:?}", spec).to_lowercase() == only_chain)
{
continue;
}
for (idx, state) in states.into_iter().enumerate() {
let post_root = state.hash.into();
let transaction = multitransaction.select(&state.indexes);
let trie_spec = if args.flag_std_dump_json {
TrieSpec::Fat
} else {
TrieSpec::Secure
};
if args.flag_json {
info::run_transaction(
&name,
idx,
&spec,
&pre,
post_root,
&test_env,
transaction,
display::json::Informant::new(config),
trie_spec,
)
} else if args.flag_std_dump_json || args.flag_std_json {
if args.flag_std_err_only {
info::run_transaction(
&name,
idx,
&spec,
&pre,
post_root,
&test_env,
transaction,
display::std_json::Informant::err_only(config),
trie_spec,
)
} else if args.flag_std_out_only {
info::run_transaction(
&name,
idx,
&spec,
&pre,
post_root,
&test_env,
transaction,
display::std_json::Informant::out_only(config),
trie_spec,
)
} else {
info::run_transaction(
&name,
idx,
&spec,
&pre,
post_root,
&test_env,
transaction,
display::std_json::Informant::new_default(config),
trie_spec,
)
}
} else {
info::run_transaction(
&name,
idx,
&spec,
&pre,
post_root,
&test_env,
transaction,
display::simple::Informant::new(config),
trie_spec,
)
}
}
}
}
}
fn run_call<T: Informant>(args: Args, informant: T) {
let from = arg(args.from(), "--from");
let to = arg(args.to(), "--to");
let code = arg(args.code(), "--code");
let spec = arg(args.spec(), "--chain");
let gas = arg(args.gas(), "--gas");
let gas_price = arg(args.gas_price(), "--gas-price");
let data = arg(args.data(), "--input");
if code.is_none() && to == Address::default() {
die("Either --code or --to is required.");
}
let mut params = ActionParams::default();
if spec.engine.params().eip2929_transition == 0 {
params.access_list.enable();
params.access_list.insert_address(from);
params.access_list.insert_address(to);
for (builtin, _) in spec.engine.builtins() {
params.access_list.insert_address(*builtin);
}
}
params.call_type = if code.is_none() {
CallType::Call
} else {
CallType::None
};
params.code_address = to;
params.address = to;
params.sender = from;
params.origin = from;
params.gas = gas;
params.gas_price = gas_price;
params.code = code.map(Arc::new);
params.data = data;
let mut sink = informant.clone_sink();
let result = if args.flag_std_dump_json {
info::run_action(&spec, params, informant, TrieSpec::Fat)
} else {
info::run_action(&spec, params, informant, TrieSpec::Secure)
};
T::finish(result, &mut sink);
}
#[derive(Debug, Deserialize)]
struct Args {
cmd_stats: bool,
cmd_state_test: bool,
cmd_stats_jsontests_vm: bool,
arg_file: Option<PathBuf>,
flag_only: Option<String>,
flag_from: Option<String>,
flag_to: Option<String>,
flag_code: Option<String>,
flag_gas: Option<String>,
flag_gas_price: Option<String>,
flag_input: Option<String>,
flag_chain: Option<String>,
flag_json: bool,
flag_std_json: bool,
flag_std_dump_json: bool,
flag_std_err_only: bool,
flag_std_out_only: bool,
flag_omit_storage_output: bool,
flag_omit_memory_output: bool,
}
impl Args {
pub fn gas(&self) -> Result<U256, String> {
match self.flag_gas {
Some(ref gas) => gas.parse().map_err(to_string),
None => Ok(U256::from(u64::max_value())),
}
}
pub fn gas_price(&self) -> Result<U256, String> {
match self.flag_gas_price {
Some(ref gas_price) => gas_price.parse().map_err(to_string),
None => Ok(U256::zero()),
}
}
pub fn from(&self) -> Result<Address, String> {
match self.flag_from {
Some(ref from) => from.parse().map_err(to_string),
None => Ok(Address::default()),
}
}
pub fn to(&self) -> Result<Address, String> {
match self.flag_to {
Some(ref to) => to.parse().map_err(to_string),
None => Ok(Address::default()),
}
}
pub fn code(&self) -> Result<Option<Bytes>, String> {
match self.flag_code {
Some(ref code) => code.from_hex().map(Some).map_err(to_string),
None => Ok(None),
}
}
pub fn data(&self) -> Result<Option<Bytes>, String> {
match self.flag_input {
Some(ref input) => input.from_hex().map_err(to_string).map(Some),
None => Ok(None),
}
}
pub fn spec(&self) -> Result<spec::Spec, String> {
Ok(match self.flag_chain {
Some(ref spec_name) => {
let fork_spec: Result<ethjson::spec::ForkSpec, _> =
serde_json::from_str(&format!("{:?}", spec_name));
if let Ok(fork_spec) = fork_spec {
ethcore::client::EvmTestClient::spec_from_json(&fork_spec)
.expect("this forkspec is not defined")
} else {
let file = fs::File::open(spec_name).map_err(|e| format!("{}", e))?;
spec::Spec::load(&::std::env::temp_dir(), file)?
}
}
None => ethcore::ethereum::new_foundation(&::std::env::temp_dir()),
})
}
pub fn config(&self) -> display::config::Config {
display::config::Config::new(self.flag_omit_storage_output, self.flag_omit_memory_output)
}
}
fn arg<T>(v: Result<T, String>, param: &str) -> T {
v.unwrap_or_else(|e| die(format!("Invalid {}: {}", param, e)))
}
fn to_string<T: fmt::Display>(msg: T) -> String {
format!("{}", msg)
}
fn die<T: fmt::Display>(msg: T) -> ! {
println!("{}", msg);
::std::process::exit(-1)
}
#[cfg(test)]
mod tests {
use super::{Args, USAGE};
use docopt::Docopt;
use ethereum_types::Address;
fn run<T: AsRef<str>>(args: &[T]) -> Args {
Docopt::new(USAGE)
.and_then(|d| d.argv(args.into_iter()).deserialize())
.unwrap()
}
#[test]
fn should_parse_all_the_options() {
let args = run(&[
"openethereum-evm",
"--json",
"--std-json",
"--std-dump-json",
"--gas",
"1",
"--gas-price",
"2",
"--from",
"0000000000000000000000000000000000000003",
"--to",
"0000000000000000000000000000000000000004",
"--code",
"05",
"--input",
"06",
"--chain",
"./testfile",
"--std-err-only",
"--std-out-only",
]);
assert_eq!(args.flag_json, true);
assert_eq!(args.flag_std_json, true);
assert_eq!(args.flag_std_dump_json, true);
assert_eq!(args.flag_std_err_only, true);
assert_eq!(args.flag_std_out_only, true);
assert_eq!(args.gas(), Ok(1.into()));
assert_eq!(args.gas_price(), Ok(2.into()));
assert_eq!(args.from(), Ok(Address::from_low_u64_be(3)));
assert_eq!(args.to(), Ok(Address::from_low_u64_be(4)));
assert_eq!(args.code(), Ok(Some(vec![05])));
assert_eq!(args.data(), Ok(Some(vec![06])));
assert_eq!(args.flag_chain, Some("./testfile".to_owned()));
}
#[test]
fn should_parse_state_test_command() {
let args = run(&[
"openethereum-evm",
"state-test",
"./file.json",
"--chain",
"homestead",
"--only=add11",
"--json",
"--std-json",
"--std-dump-json",
]);
assert_eq!(args.cmd_state_test, true);
assert!(args.arg_file.is_some());
assert_eq!(args.flag_json, true);
assert_eq!(args.flag_std_json, true);
assert_eq!(args.flag_std_dump_json, true);
assert_eq!(args.flag_chain, Some("homestead".to_owned()));
assert_eq!(args.flag_only, Some("add11".to_owned()));
}
}

141
bin/oe/account.rs Normal file
View File

@ -0,0 +1,141 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use crate::params::SpecType;
use std::num::NonZeroU32;
#[derive(Debug, PartialEq)]
pub enum AccountCmd {
New(NewAccount),
List(ListAccounts),
Import(ImportAccounts),
}
#[derive(Debug, PartialEq)]
pub struct ListAccounts {
pub path: String,
pub spec: SpecType,
}
#[derive(Debug, PartialEq)]
pub struct NewAccount {
pub iterations: NonZeroU32,
pub path: String,
pub spec: SpecType,
pub password_file: Option<String>,
}
#[derive(Debug, PartialEq)]
pub struct ImportAccounts {
pub from: Vec<String>,
pub to: String,
pub spec: SpecType,
}
#[cfg(not(feature = "accounts"))]
pub fn execute(_cmd: AccountCmd) -> Result<String, String> {
Err("Account management is deprecated. Please see #9997 for alternatives:\nhttps://github.com/openethereum/openethereum/issues/9997".into())
}
#[cfg(feature = "accounts")]
mod command {
use super::*;
use crate::{
accounts::{AccountProvider, AccountProviderSettings},
helpers::{password_from_file, password_prompt},
};
use ethstore::{accounts_dir::RootDiskDirectory, import_account, import_accounts, EthStore};
use std::path::PathBuf;
pub fn execute(cmd: AccountCmd) -> Result<String, String> {
match cmd {
AccountCmd::New(new_cmd) => new(new_cmd),
AccountCmd::List(list_cmd) => list(list_cmd),
AccountCmd::Import(import_cmd) => import(import_cmd),
}
}
fn keys_dir(path: String, spec: SpecType) -> Result<RootDiskDirectory, String> {
let spec = spec.spec(&::std::env::temp_dir())?;
let mut path = PathBuf::from(&path);
path.push(spec.data_dir);
RootDiskDirectory::create(path).map_err(|e| format!("Could not open keys directory: {}", e))
}
fn secret_store(
dir: Box<RootDiskDirectory>,
iterations: Option<NonZeroU32>,
) -> Result<EthStore, String> {
match iterations {
Some(i) => EthStore::open_with_iterations(dir, i),
_ => EthStore::open(dir),
}
.map_err(|e| format!("Could not open keys store: {}", e))
}
fn new(n: NewAccount) -> Result<String, String> {
let password = match n.password_file {
Some(file) => password_from_file(file)?,
None => password_prompt()?,
};
let dir = Box::new(keys_dir(n.path, n.spec)?);
let secret_store = Box::new(secret_store(dir, Some(n.iterations))?);
let acc_provider = AccountProvider::new(secret_store, AccountProviderSettings::default());
let new_account = acc_provider
.new_account(&password)
.map_err(|e| format!("Could not create new account: {}", e))?;
Ok(format!("0x{:x}", new_account))
}
fn list(list_cmd: ListAccounts) -> Result<String, String> {
let dir = Box::new(keys_dir(list_cmd.path, list_cmd.spec)?);
let secret_store = Box::new(secret_store(dir, None)?);
let acc_provider = AccountProvider::new(secret_store, AccountProviderSettings::default());
let accounts = acc_provider.accounts().map_err(|e| format!("{}", e))?;
let result = accounts
.into_iter()
.map(|a| format!("0x{:x}", a))
.collect::<Vec<String>>()
.join("\n");
Ok(result)
}
fn import(i: ImportAccounts) -> Result<String, String> {
let to = keys_dir(i.to, i.spec)?;
let mut imported = 0;
for path in &i.from {
let path = PathBuf::from(path);
if path.is_dir() {
let from = RootDiskDirectory::at(&path);
imported += import_accounts(&from, &to)
.map_err(|e| format!("Importing accounts from {:?} failed: {}", path, e))?
.len();
} else if path.is_file() {
import_account(&path, &to)
.map_err(|e| format!("Importing account from {:?} failed: {}", path, e))?;
imported += 1;
}
}
Ok(format!("{} account(s) imported", imported))
}
}
#[cfg(feature = "accounts")]
pub use self::command::execute;

263
bin/oe/account_utils.rs Normal file
View File

@ -0,0 +1,263 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::sync::Arc;
use crypto::publickey;
use dir::Directories;
use ethereum_types::{Address, H160};
use ethkey::Password;
use crate::params::{AccountsConfig, SpecType};
#[cfg(not(feature = "accounts"))]
mod accounts {
use super::*;
/// Dummy AccountProvider
pub struct AccountProvider;
impl ::ethcore::miner::LocalAccounts for AccountProvider {
fn is_local(&self, _address: &Address) -> bool {
false
}
}
pub fn prepare_account_provider(
_spec: &SpecType,
_dirs: &Directories,
_data_dir: &str,
_cfg: AccountsConfig,
_passwords: &[Password],
) -> Result<AccountProvider, String> {
warn!("Note: Your instance of OpenEthereum is running without account support. Some CLI options are ignored.");
Ok(AccountProvider)
}
pub fn miner_local_accounts(_: Arc<AccountProvider>) -> AccountProvider {
AccountProvider
}
pub fn miner_author(
_spec: &SpecType,
_dirs: &Directories,
_account_provider: &Arc<AccountProvider>,
_engine_signer: Address,
_passwords: &[Password],
) -> Result<Option<::ethcore::miner::Author>, String> {
Ok(None)
}
pub fn accounts_list(
_account_provider: Arc<AccountProvider>,
) -> Arc<dyn Fn() -> Vec<Address> + Send + Sync> {
Arc::new(|| vec![])
}
}
#[cfg(feature = "accounts")]
mod accounts {
use super::*;
use crate::{ethereum_types::H256, upgrade::upgrade_key_location};
use std::str::FromStr;
pub use crate::accounts::AccountProvider;
/// Pops along with error messages when a password is missing or invalid.
const VERIFY_PASSWORD_HINT: &str = "Make sure valid password is present in files passed using `--password` or in the configuration file.";
/// Initialize account provider
pub fn prepare_account_provider(
spec: &SpecType,
dirs: &Directories,
data_dir: &str,
cfg: AccountsConfig,
passwords: &[Password],
) -> Result<AccountProvider, String> {
use crate::accounts::AccountProviderSettings;
use ethstore::{accounts_dir::RootDiskDirectory, EthStore};
let path = dirs.keys_path(data_dir);
upgrade_key_location(&dirs.legacy_keys_path(cfg.testnet), &path);
let dir = Box::new(
RootDiskDirectory::create(&path)
.map_err(|e| format!("Could not open keys directory: {}", e))?,
);
let account_settings = AccountProviderSettings {
unlock_keep_secret: cfg.enable_fast_unlock,
blacklisted_accounts: match *spec {
SpecType::Morden
| SpecType::Ropsten
| SpecType::Kovan
| SpecType::Goerli
| SpecType::Sokol
| SpecType::Dev => vec![],
_ => vec![H160::from_str("00a329c0648769a73afac7f9381e08fb43dbea72")
.expect("the string is valid hex; qed")],
},
};
let ethstore = EthStore::open_with_iterations(dir, cfg.iterations)
.map_err(|e| format!("Could not open keys directory: {}", e))?;
if cfg.refresh_time > 0 {
ethstore.set_refresh_time(::std::time::Duration::from_secs(cfg.refresh_time));
}
let account_provider = AccountProvider::new(Box::new(ethstore), account_settings);
// Add development account if running dev chain:
if let SpecType::Dev = *spec {
insert_dev_account(&account_provider);
}
for a in cfg.unlocked_accounts {
// Check if the account exists
if !account_provider.has_account(a) {
return Err(format!(
"Account {} not found for the current chain. {}",
a,
build_create_account_hint(spec, &dirs.keys)
));
}
// Check if any passwords have been read from the password file(s)
if passwords.is_empty() {
return Err(format!(
"No password found to unlock account {}. {}",
a, VERIFY_PASSWORD_HINT
));
}
if !passwords.iter().any(|p| {
account_provider
.unlock_account_permanently(a, (*p).clone())
.is_ok()
}) {
return Err(format!(
"No valid password to unlock account {}. {}",
a, VERIFY_PASSWORD_HINT
));
}
}
Ok(account_provider)
}
pub struct LocalAccounts(Arc<AccountProvider>);
impl ::ethcore::miner::LocalAccounts for LocalAccounts {
fn is_local(&self, address: &Address) -> bool {
self.0.has_account(*address)
}
}
pub fn miner_local_accounts(account_provider: Arc<AccountProvider>) -> LocalAccounts {
LocalAccounts(account_provider)
}
pub fn miner_author(
spec: &SpecType,
dirs: &Directories,
account_provider: &Arc<AccountProvider>,
engine_signer: Address,
passwords: &[Password],
) -> Result<Option<::ethcore::miner::Author>, String> {
use ethcore::engines::EngineSigner;
// Check if engine signer exists
if !account_provider.has_account(engine_signer) {
return Err(format!(
"Consensus signer account not found for the current chain. {}",
build_create_account_hint(spec, &dirs.keys)
));
}
// Check if any passwords have been read from the password file(s)
if passwords.is_empty() {
return Err(format!(
"No password found for the consensus signer {}. {}",
engine_signer, VERIFY_PASSWORD_HINT
));
}
let mut author = None;
for password in passwords {
let signer = parity_rpc::signer::EngineSigner::new(
account_provider.clone(),
engine_signer,
password.clone(),
);
// sign dummy msg to check if password and account can be used.
if signer.sign(H256::from_low_u64_be(1)).is_ok() {
author = Some(::ethcore::miner::Author::Sealer(Box::new(signer)));
}
}
if author.is_none() {
return Err(format!(
"No valid password for the consensus signer {}. {}",
engine_signer, VERIFY_PASSWORD_HINT
));
}
Ok(author)
}
pub fn accounts_list(
account_provider: Arc<AccountProvider>,
) -> Arc<dyn Fn() -> Vec<Address> + Send + Sync> {
Arc::new(move || account_provider.accounts().unwrap_or_default())
}
fn insert_dev_account(account_provider: &AccountProvider) {
let secret = publickey::Secret::from_str(
"4d5db4107d237df6a3d58ee5f70ae63d73d7658d4026f2eefd2f204c81682cb7",
)
.expect("Valid account;qed");
let dev_account = publickey::KeyPair::from_secret(secret.clone())
.expect("Valid secret produces valid key;qed");
if !account_provider.has_account(dev_account.address()) {
match account_provider.insert_account(secret, &Password::from(String::new())) {
Err(e) => warn!("Unable to add development account: {}", e),
Ok(address) => {
let _ = account_provider
.set_account_name(address.clone(), "Development Account".into());
let _ = account_provider.set_account_meta(
address,
::serde_json::to_string(
&(vec![
(
"description",
"Never use this account outside of development chain!",
),
("passwordHint", "Password is empty string"),
]
.into_iter()
.collect::<::std::collections::HashMap<_, _>>()),
)
.expect("Serialization of hashmap does not fail."),
);
}
}
}
}
// Construct an error `String` with an adaptive hint on how to create an account.
fn build_create_account_hint(spec: &SpecType, keys: &str) -> String {
format!("You can create an account via RPC, UI or `openethereum account new --chain {} --keys-path {}`.", spec, keys)
}
}
pub use self::accounts::{
accounts_list, miner_author, miner_local_accounts, prepare_account_provider, AccountProvider,
};

551
bin/oe/blockchain.rs Normal file
View File

@ -0,0 +1,551 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::{fs, io, sync::Arc, time::Instant};
use crate::{
bytes::ToPretty,
cache::CacheConfig,
db,
hash::{keccak, KECCAK_NULL_RLP},
helpers::{execute_upgrades, to_client_config},
informant::{FullNodeInformantData, Informant, MillisecondDuration},
params::{fatdb_switch_to_bool, tracing_switch_to_bool, Pruning, SpecType, Switch},
types::data_format::DataFormat,
user_defaults::UserDefaults,
};
use ansi_term::Colour;
use dir::Directories;
use ethcore::{
client::{
Balance, BlockChainClient, BlockChainReset, BlockId, DatabaseCompactionProfile,
ImportExportBlocks, Mode, Nonce, VMType,
},
miner::Miner,
verification::queue::VerifierSettings,
};
use ethcore_service::ClientService;
use ethereum_types::{Address, H256, U256};
#[derive(Debug, PartialEq)]
pub enum BlockchainCmd {
Kill(KillBlockchain),
Import(ImportBlockchain),
Export(ExportBlockchain),
ExportState(ExportState),
Reset(ResetBlockchain),
}
#[derive(Debug, PartialEq)]
pub struct ResetBlockchain {
pub dirs: Directories,
pub spec: SpecType,
pub pruning: Pruning,
pub pruning_history: u64,
pub pruning_memory: usize,
pub tracing: Switch,
pub fat_db: Switch,
pub compaction: DatabaseCompactionProfile,
pub cache_config: CacheConfig,
pub num: u32,
}
#[derive(Debug, PartialEq)]
pub struct KillBlockchain {
pub spec: SpecType,
pub dirs: Directories,
pub pruning: Pruning,
}
#[derive(Debug, PartialEq)]
pub struct ImportBlockchain {
pub spec: SpecType,
pub cache_config: CacheConfig,
pub dirs: Directories,
pub file_path: Option<String>,
pub format: Option<DataFormat>,
pub pruning: Pruning,
pub pruning_history: u64,
pub pruning_memory: usize,
pub compaction: DatabaseCompactionProfile,
pub tracing: Switch,
pub fat_db: Switch,
pub vm_type: VMType,
pub check_seal: bool,
pub with_color: bool,
pub verifier_settings: VerifierSettings,
pub max_round_blocks_to_import: usize,
}
#[derive(Debug, PartialEq)]
pub struct ExportBlockchain {
pub spec: SpecType,
pub cache_config: CacheConfig,
pub dirs: Directories,
pub file_path: Option<String>,
pub format: Option<DataFormat>,
pub pruning: Pruning,
pub pruning_history: u64,
pub pruning_memory: usize,
pub compaction: DatabaseCompactionProfile,
pub fat_db: Switch,
pub tracing: Switch,
pub from_block: BlockId,
pub to_block: BlockId,
pub check_seal: bool,
pub max_round_blocks_to_import: usize,
}
#[derive(Debug, PartialEq)]
pub struct ExportState {
pub spec: SpecType,
pub cache_config: CacheConfig,
pub dirs: Directories,
pub file_path: Option<String>,
pub format: Option<DataFormat>,
pub pruning: Pruning,
pub pruning_history: u64,
pub pruning_memory: usize,
pub compaction: DatabaseCompactionProfile,
pub fat_db: Switch,
pub tracing: Switch,
pub at: BlockId,
pub storage: bool,
pub code: bool,
pub min_balance: Option<U256>,
pub max_balance: Option<U256>,
pub max_round_blocks_to_import: usize,
}
pub fn execute(cmd: BlockchainCmd) -> Result<(), String> {
match cmd {
BlockchainCmd::Kill(kill_cmd) => kill_db(kill_cmd),
BlockchainCmd::Import(import_cmd) => execute_import(import_cmd),
BlockchainCmd::Export(export_cmd) => execute_export(export_cmd),
BlockchainCmd::ExportState(export_cmd) => execute_export_state(export_cmd),
BlockchainCmd::Reset(reset_cmd) => execute_reset(reset_cmd),
}
}
fn execute_import(cmd: ImportBlockchain) -> Result<(), String> {
let timer = Instant::now();
// load spec file
let spec = cmd.spec.spec(&cmd.dirs.cache)?;
// load genesis hash
let genesis_hash = spec.genesis_header().hash();
// database paths
let db_dirs = cmd.dirs.database(genesis_hash, None, spec.data_dir.clone());
// user defaults path
let user_defaults_path = db_dirs.user_defaults_path();
// load user defaults
let mut user_defaults = UserDefaults::load(&user_defaults_path)?;
// select pruning algorithm
let algorithm = cmd.pruning.to_algorithm(&user_defaults);
// check if tracing is on
let tracing = tracing_switch_to_bool(cmd.tracing, &user_defaults)?;
// check if fatdb is on
let fat_db = fatdb_switch_to_bool(cmd.fat_db, &user_defaults, algorithm)?;
// prepare client and snapshot paths.
let client_path = db_dirs.client_path(algorithm);
let snapshot_path = db_dirs.snapshot_path();
// execute upgrades
execute_upgrades(&cmd.dirs.base, &db_dirs, algorithm, &cmd.compaction)?;
// create dirs used by parity
cmd.dirs.create_dirs(false, false)?;
// prepare client config
let mut client_config = to_client_config(
&cmd.cache_config,
spec.name.to_lowercase(),
Mode::Active,
tracing,
fat_db,
cmd.compaction,
cmd.vm_type,
"".into(),
algorithm,
cmd.pruning_history,
cmd.pruning_memory,
cmd.check_seal,
12,
);
client_config.queue.verifier_settings = cmd.verifier_settings;
let restoration_db_handler = db::restoration_db_handler(&client_path, &client_config);
let client_db = restoration_db_handler
.open(&client_path)
.map_err(|e| format!("Failed to open database {:?}", e))?;
// build client
let service = ClientService::start(
client_config,
&spec,
client_db,
&snapshot_path,
restoration_db_handler,
&cmd.dirs.ipc_path(),
// TODO [ToDr] don't use test miner here
// (actually don't require miner at all)
Arc::new(Miner::new_for_tests(&spec, None)),
)
.map_err(|e| format!("Client service error: {:?}", e))?;
// free up the spec in memory.
drop(spec);
let client = service.client();
let instream: Box<dyn io::Read> = match cmd.file_path {
Some(f) => {
Box::new(fs::File::open(&f).map_err(|_| format!("Cannot open given file: {}", f))?)
}
None => Box::new(io::stdin()),
};
let informant = Arc::new(Informant::new(
FullNodeInformantData {
client: client.clone(),
sync: None,
net: None,
},
None,
None,
cmd.with_color,
));
service
.register_io_handler(informant)
.map_err(|_| "Unable to register informant handler".to_owned())?;
client.import_blocks(instream, cmd.format)?;
// save user defaults
user_defaults.pruning = algorithm;
user_defaults.tracing = tracing;
user_defaults.fat_db = fat_db;
user_defaults.save(&user_defaults_path)?;
let report = client.report();
let ms = timer.elapsed().as_milliseconds();
info!("Import completed in {} seconds, {} blocks, {} blk/s, {} transactions, {} tx/s, {} Mgas, {} Mgas/s",
ms / 1000,
report.blocks_imported,
(report.blocks_imported * 1000) as u64 / ms,
report.transactions_applied,
(report.transactions_applied * 1000) as u64 / ms,
report.gas_processed / 1_000_000,
(report.gas_processed / (ms * 1000)).low_u64(),
);
Ok(())
}
fn start_client(
dirs: Directories,
spec: SpecType,
pruning: Pruning,
pruning_history: u64,
pruning_memory: usize,
tracing: Switch,
fat_db: Switch,
compaction: DatabaseCompactionProfile,
cache_config: CacheConfig,
require_fat_db: bool,
max_round_blocks_to_import: usize,
) -> Result<ClientService, String> {
// load spec file
let spec = spec.spec(&dirs.cache)?;
// load genesis hash
let genesis_hash = spec.genesis_header().hash();
// database paths
let db_dirs = dirs.database(genesis_hash, None, spec.data_dir.clone());
// user defaults path
let user_defaults_path = db_dirs.user_defaults_path();
// load user defaults
let user_defaults = UserDefaults::load(&user_defaults_path)?;
// select pruning algorithm
let algorithm = pruning.to_algorithm(&user_defaults);
// check if tracing is on
let tracing = tracing_switch_to_bool(tracing, &user_defaults)?;
// check if fatdb is on
let fat_db = fatdb_switch_to_bool(fat_db, &user_defaults, algorithm)?;
if !fat_db && require_fat_db {
return Err("This command requires OpenEthereum to be synced with --fat-db on.".to_owned());
}
// prepare client and snapshot paths.
let client_path = db_dirs.client_path(algorithm);
let snapshot_path = db_dirs.snapshot_path();
// execute upgrades
execute_upgrades(&dirs.base, &db_dirs, algorithm, &compaction)?;
// create dirs used by OpenEthereum.
dirs.create_dirs(false, false)?;
// prepare client config
let client_config = to_client_config(
&cache_config,
spec.name.to_lowercase(),
Mode::Active,
tracing,
fat_db,
compaction,
VMType::default(),
"".into(),
algorithm,
pruning_history,
pruning_memory,
true,
max_round_blocks_to_import,
);
let restoration_db_handler = db::restoration_db_handler(&client_path, &client_config);
let client_db = restoration_db_handler
.open(&client_path)
.map_err(|e| format!("Failed to open database {:?}", e))?;
let service = ClientService::start(
client_config,
&spec,
client_db,
&snapshot_path,
restoration_db_handler,
&dirs.ipc_path(),
// It's fine to use test version here,
// since we don't care about miner parameters at all
Arc::new(Miner::new_for_tests(&spec, None)),
)
.map_err(|e| format!("Client service error: {:?}", e))?;
drop(spec);
Ok(service)
}
fn execute_export(cmd: ExportBlockchain) -> Result<(), String> {
let service = start_client(
cmd.dirs,
cmd.spec,
cmd.pruning,
cmd.pruning_history,
cmd.pruning_memory,
cmd.tracing,
cmd.fat_db,
cmd.compaction,
cmd.cache_config,
false,
cmd.max_round_blocks_to_import,
)?;
let client = service.client();
let out: Box<dyn io::Write> = match cmd.file_path {
Some(f) => Box::new(
fs::File::create(&f).map_err(|_| format!("Cannot write to file given: {}", f))?,
),
None => Box::new(io::stdout()),
};
client.export_blocks(out, cmd.from_block, cmd.to_block, cmd.format)?;
info!("Export completed.");
Ok(())
}
fn execute_export_state(cmd: ExportState) -> Result<(), String> {
let service = start_client(
cmd.dirs,
cmd.spec,
cmd.pruning,
cmd.pruning_history,
cmd.pruning_memory,
cmd.tracing,
cmd.fat_db,
cmd.compaction,
cmd.cache_config,
true,
cmd.max_round_blocks_to_import,
)?;
let client = service.client();
let mut out: Box<dyn io::Write> = match cmd.file_path {
Some(f) => Box::new(
fs::File::create(&f).map_err(|_| format!("Cannot write to file given: {}", f))?,
),
None => Box::new(io::stdout()),
};
let mut last: Option<Address> = None;
let at = cmd.at;
let mut i = 0usize;
out.write_fmt(format_args!("{{ \"state\": {{",))
.expect("Couldn't write to stream.");
loop {
let accounts = client
.list_accounts(at, last.as_ref(), 1000)
.ok_or("Specified block not found")?;
if accounts.is_empty() {
break;
}
for account in accounts.into_iter() {
let balance = client
.balance(&account, at.into())
.unwrap_or_else(U256::zero);
if cmd.min_balance.map_or(false, |m| balance < m)
|| cmd.max_balance.map_or(false, |m| balance > m)
{
last = Some(account);
continue; //filtered out
}
if i != 0 {
out.write(b",").expect("Write error");
}
out.write_fmt(format_args!(
"\n\"0x{:x}\": {{\"balance\": \"{:x}\", \"nonce\": \"{:x}\"",
account,
balance,
client.nonce(&account, at).unwrap_or_else(U256::zero)
))
.expect("Write error");
let code = client
.code(&account, at.into())
.unwrap_or(None)
.unwrap_or_else(Vec::new);
if !code.is_empty() {
out.write_fmt(format_args!(", \"code_hash\": \"0x{:x}\"", keccak(&code)))
.expect("Write error");
if cmd.code {
out.write_fmt(format_args!(", \"code\": \"{}\"", code.to_hex()))
.expect("Write error");
}
}
let storage_root = client.storage_root(&account, at).unwrap_or(KECCAK_NULL_RLP);
if storage_root != KECCAK_NULL_RLP {
out.write_fmt(format_args!(", \"storage_root\": \"0x{:x}\"", storage_root))
.expect("Write error");
if cmd.storage {
out.write_fmt(format_args!(", \"storage\": {{"))
.expect("Write error");
let mut last_storage: Option<H256> = None;
loop {
let keys = client
.list_storage(at, &account, last_storage.as_ref(), 1000)
.ok_or("Specified block not found")?;
if keys.is_empty() {
break;
}
for key in keys.into_iter() {
if last_storage.is_some() {
out.write(b",").expect("Write error");
}
out.write_fmt(format_args!(
"\n\t\"0x{:x}\": \"0x{:x}\"",
key,
client
.storage_at(&account, &key, at.into())
.unwrap_or_else(Default::default)
))
.expect("Write error");
last_storage = Some(key);
}
}
out.write(b"\n}").expect("Write error");
}
}
out.write(b"}").expect("Write error");
i += 1;
if i % 10000 == 0 {
info!("Account #{}", i);
}
last = Some(account);
}
}
out.write_fmt(format_args!("\n}}}}")).expect("Write error");
info!("Export completed.");
Ok(())
}
fn execute_reset(cmd: ResetBlockchain) -> Result<(), String> {
let service = start_client(
cmd.dirs,
cmd.spec,
cmd.pruning,
cmd.pruning_history,
cmd.pruning_memory,
cmd.tracing,
cmd.fat_db,
cmd.compaction,
cmd.cache_config,
false,
0,
)?;
let client = service.client();
client.reset(cmd.num)?;
info!("{}", Colour::Green.bold().paint("Successfully reset db!"));
Ok(())
}
pub fn kill_db(cmd: KillBlockchain) -> Result<(), String> {
let spec = cmd.spec.spec(&cmd.dirs.cache)?;
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 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(())
}
#[cfg(test)]
mod test {
use super::DataFormat;
#[test]
fn test_data_format_parsing() {
assert_eq!(DataFormat::Binary, "binary".parse().unwrap());
assert_eq!(DataFormat::Binary, "bin".parse().unwrap());
assert_eq!(DataFormat::Hex, "hex".parse().unwrap());
}
}

142
bin/oe/cache.rs Normal file
View File

@ -0,0 +1,142 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::cmp::max;
const MIN_BC_CACHE_MB: u32 = 4;
const MIN_DB_CACHE_MB: u32 = 8;
const MIN_BLOCK_QUEUE_SIZE_LIMIT_MB: u32 = 16;
const DEFAULT_DB_CACHE_SIZE: u32 = 128;
const DEFAULT_BC_CACHE_SIZE: u32 = 8;
const DEFAULT_BLOCK_QUEUE_SIZE_LIMIT_MB: u32 = 40;
const DEFAULT_TRACE_CACHE_SIZE: u32 = 20;
const DEFAULT_STATE_CACHE_SIZE: u32 = 25;
/// Configuration for application cache sizes.
/// All values are represented in MB.
#[derive(Debug, PartialEq)]
pub struct CacheConfig {
/// Size of rocksDB cache. Almost all goes to the state column.
db: u32,
/// Size of blockchain cache.
blockchain: u32,
/// Size of transaction queue cache.
queue: u32,
/// Size of traces cache.
traces: u32,
/// Size of the state cache.
state: u32,
}
impl Default for CacheConfig {
fn default() -> Self {
CacheConfig::new(
DEFAULT_DB_CACHE_SIZE,
DEFAULT_BC_CACHE_SIZE,
DEFAULT_BLOCK_QUEUE_SIZE_LIMIT_MB,
DEFAULT_STATE_CACHE_SIZE,
)
}
}
impl CacheConfig {
/// Creates new cache config with cumulative size equal `total`.
pub fn new_with_total_cache_size(total: u32) -> Self {
CacheConfig {
db: total * 7 / 10,
blockchain: total / 10,
queue: DEFAULT_BLOCK_QUEUE_SIZE_LIMIT_MB,
traces: DEFAULT_TRACE_CACHE_SIZE,
state: total * 2 / 10,
}
}
/// Creates new cache config with gitven details.
pub fn new(db: u32, blockchain: u32, queue: u32, state: u32) -> Self {
CacheConfig {
db: db,
blockchain: blockchain,
queue: queue,
traces: DEFAULT_TRACE_CACHE_SIZE,
state: state,
}
}
/// Size of db cache.
pub fn db_cache_size(&self) -> u32 {
max(MIN_DB_CACHE_MB, self.db)
}
/// Size of block queue size limit
pub fn queue(&self) -> u32 {
max(self.queue, MIN_BLOCK_QUEUE_SIZE_LIMIT_MB)
}
/// Size of the blockchain cache.
pub fn blockchain(&self) -> u32 {
max(self.blockchain, MIN_BC_CACHE_MB)
}
/// Size of the traces cache.
pub fn traces(&self) -> u32 {
self.traces
}
/// Size of the state cache.
pub fn state(&self) -> u32 {
self.state * 3 / 4
}
/// Size of the jump-tables cache.
pub fn jump_tables(&self) -> u32 {
self.state / 4
}
}
#[cfg(test)]
mod tests {
use super::CacheConfig;
#[test]
fn test_cache_config_constructor() {
let config = CacheConfig::new_with_total_cache_size(200);
assert_eq!(config.db, 140);
assert_eq!(config.blockchain(), 20);
assert_eq!(config.queue(), 40);
assert_eq!(config.state(), 30);
assert_eq!(config.jump_tables(), 10);
}
#[test]
fn test_cache_config_db_cache_sizes() {
let config = CacheConfig::new_with_total_cache_size(400);
assert_eq!(config.db, 280);
assert_eq!(config.db_cache_size(), 280);
}
#[test]
fn test_cache_config_default() {
assert_eq!(
CacheConfig::default(),
CacheConfig::new(
super::DEFAULT_DB_CACHE_SIZE,
super::DEFAULT_BC_CACHE_SIZE,
super::DEFAULT_BLOCK_QUEUE_SIZE_LIMIT_MB,
super::DEFAULT_STATE_CACHE_SIZE
)
);
}
}

1655
bin/oe/cli/mod.rs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
[parity]
chain = "dev"
[mining]
reseal_min_period = 0
min_gas_price = 0
[rpc]
interface = "all"
apis = ["all"]
hosts = ["all"]

View File

@ -0,0 +1,6 @@
[parity]
chain = "dev"
[mining]
reseal_min_period = 0
min_gas_price = 0

View File

@ -0,0 +1,4 @@
[rpc]
interface = "all"
apis = ["all"]
hosts = ["all"]

View File

@ -0,0 +1,28 @@
[network]
# OpenEthereum will try to maintain connection to at least 50 peers.
min_peers = 50
# OpenEthereum will maintain at most 100 peers.
max_peers = 100
[ipc]
# You won't be able to use IPC to interact with OpenEthereum.
disable = true
[mining]
# Prepare a block to seal even when there are no miners connected.
force_sealing = true
# New pending block will be created for all transactions (both local and external).
reseal_on_txs = "all"
# New pending block will be created only once per 4000 milliseconds.
reseal_min_period = 4000
# OpenEthereum will keep/relay at most 8192 transactions in queue.
tx_queue_size = 8192
tx_queue_per_sender = 128
[footprint]
# If defined will never use more then 1024MB for all caches. (Overrides other cache settings).
cache_size = 1024
[misc]
# Logging pattern (`<module>=<level>`, e.g. `own_tx=trace`).
logging = "miner=trace,own_tx=trace"

View File

@ -0,0 +1,7 @@
[network]
# OpenEthereum will listen for connections on port 30305.
port = 30305
[rpc]
# JSON-RPC over HTTP will be accessible on port 8645.
port = 8645

28
bin/oe/cli/presets/mod.rs Normal file
View File

@ -0,0 +1,28 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::io::{Error, ErrorKind};
pub fn preset_config_string(arg: &str) -> Result<&'static str, Error> {
match arg.to_lowercase().as_ref() {
"dev" => Ok(include_str!("./config.dev.toml")),
"mining" => Ok(include_str!("./config.mining.toml")),
"non-standard-ports" => Ok(include_str!("./config.non-standard-ports.toml")),
"insecure" => Ok(include_str!("./config.insecure.toml")),
"dev-insecure" => Ok(include_str!("./config.dev-insecure.toml")),
_ => Err(Error::new(ErrorKind::InvalidInput, "Config doesn't match any presets [dev, mining, non-standard-ports, insecure, dev-insecure]"))
}
}

View File

@ -0,0 +1,126 @@
[parity]
mode = "last"
mode_timeout = 300
mode_alarm = 3600
no_persistent_txqueue = false
chain = "homestead"
base_path = "$HOME/.parity"
db_path = "$HOME/.parity/chains"
keys_path = "$HOME/.parity/keys"
identity = ""
[account]
unlock = ["0xdeadbeefcafe0000000000000000000000000000"]
password = ["~/.safe/password.file"]
keys_iterations = 10240
[ui]
path = "$HOME/.parity/signer"
[network]
port = 30303
min_peers = 25
max_peers = 50
nat = "any"
id = 1
bootnodes = []
discovery = true
warp = true
allow_ips = "all"
snapshot_peers = 0
max_pending_peers = 64
reserved_only = false
reserved_peers = "./path_to_file"
[rpc]
disable = false
port = 8545
interface = "local"
cors = ["null"]
apis = ["web3", "eth", "net", "parity", "traces", "rpc", "secretstore"]
hosts = ["none"]
allow_missing_blocks = false
[websockets]
disable = false
port = 8546
interface = "local"
origins = ["none"]
apis = ["web3", "eth", "net", "parity", "traces", "rpc", "secretstore"]
hosts = ["none"]
[ipc]
disable = false
path = "$HOME/.parity/jsonrpc.ipc"
apis = ["web3", "eth", "net", "parity", "parity_accounts", "personal", "traces", "rpc", "secretstore"]
[secretstore]
disable = false
disable_http = false
acl_contract = "registry"
service_contract = "none"
service_contract_srv_gen = "none"
service_contract_srv_retr = "none"
service_contract_doc_store = "none"
service_contract_doc_sretr = "none"
server_set_contract = "registry"
nodes = []
http_interface = "local"
http_port = 8082
interface = "local"
port = 8083
path = "$HOME/.parity/secretstore"
[mining]
author = "0xdeadbeefcafe0000000000000000000000000001"
engine_signer = "0xdeadbeefcafe0000000000000000000000000001"
force_sealing = true
reseal_on_txs = "all"
reseal_min_period = 4000
reseal_max_period = 60000
work_queue_size = 20
relay_set = "cheap"
min_gas_price = 0
usd_per_tx = "0.0001"
usd_per_eth = "auto"
price_update_period = "hourly"
gas_floor_target = "8000000"
gas_cap = "10000000"
tx_queue_size = 8192
tx_queue_locals = ["0xdeadbeefcafe0000000000000000000000000000"]
tx_queue_strategy = "gas_factor"
tx_queue_ban_count = 1
tx_queue_ban_time = 180 #s
tx_gas_limit = "10000000"
tx_time_limit = 100 #ms
tx_queue_no_unfamiliar_locals = false
tx_queue_no_early_reject = false
extra_data = "Parity"
remove_solved = false
notify_work = ["http://localhost:3001"]
refuse_service_transactions = false
[footprint]
tracing = "auto"
pruning = "auto"
pruning_history = 64
pruning_memory = 500
cache_size_db = 64
cache_size_blocks = 8
cache_size_queue = 50
cache_size_state = 25
cache_size = 128 # Overrides above caches with total size
db_compaction = "ssd"
fat_db = "auto"
scale_verifiers = true
num_verifiers = 6
[snapshots]
enable = false
[misc]
logging = "own_tx=trace"
log_file = "/var/log/openethereum.log"
color = true

View File

@ -0,0 +1,2 @@
[account]
invalid = 5

View File

@ -8,11 +8,7 @@ chain = "./chain.json"
unlock = ["0x1", "0x2", "0x3"]
password = ["passwdfile path"]
[ui]
disable = true
[network]
disable = false
warp = false
discovery = true
nat = "any"
@ -25,6 +21,9 @@ allow_ips = "public"
reserved_only = true
reserved_peers = "./path/to/reserved_peers"
[websockets]
disable = true
origins = ["none"]
[rpc]
disable = true
@ -33,10 +32,15 @@ port = 8180
[ipc]
apis = ["rpc", "eth"]
[dapps]
port = 8080
user = "username"
pass = "password"
[metrics]
enable = true
interface = "local"
port = 4000
prefix = "oe"
[secretstore]
http_port = 8082
port = 8083
[mining]
author = "0xdeadbeefcafe0000000000000000000000000001"
@ -44,15 +48,15 @@ engine_signer = "0xdeadbeefcafe0000000000000000000000000001"
force_sealing = true
reseal_on_txs = "all"
reseal_min_period = 4000
reseal_max_period = 60000
price_update_period = "hourly"
tx_queue_size = 1024
tx_queue_gas = "auto"
tx_queue_size = 8192
[footprint]
tracing = "on"
pruning = "fast"
pruning_history = 64
cache_size_db = 128
cache_size_db = 256
cache_size_blocks = 16
cache_size_queue = 100
cache_size_state = 25
@ -61,12 +65,11 @@ fat_db = "off"
scale_verifiers = false
[snapshots]
disable_periodic = true
[vm]
jit = false
enable = false
[misc]
logging = "own_tx=trace"
log_file = "/var/log/parity.log"
log_file = "/var/log/openethereum.log"
color = true
ports_shift = 0
unsafe_expose = false

781
bin/oe/cli/usage.rs Normal file
View File

@ -0,0 +1,781 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
macro_rules! return_if_parse_error {
($e:expr) => {
match $e {
Err(
clap_error
@
ClapError {
kind: ClapErrorKind::ValueValidation,
..
},
) => {
return Err(clap_error);
}
// Otherwise, if $e is ClapErrorKind::ArgumentNotFound or Ok(),
// then convert to Option
_ => $e.ok(),
}
};
}
macro_rules! if_option {
(Option<$type:ty>, THEN {$($then:tt)*} ELSE {$($otherwise:tt)*}) => (
$($then)*
);
($type:ty, THEN {$($then:tt)*} ELSE {$($otherwise:tt)*}) => (
$($otherwise)*
);
}
macro_rules! if_vec {
(Vec<$type:ty>, THEN {$($then:tt)*} ELSE {$($otherwise:tt)*}) => (
$($then)*
);
($type:ty, THEN {$($then:tt)*} ELSE {$($otherwise:tt)*}) => (
$($otherwise)*
);
}
macro_rules! if_option_vec {
(Option<Vec<String>>, THEN {$then:expr} ELSE {$otherwise:expr}) => {
$then
};
(Option<$type:ty>, THEN {$then:expr} ELSE {$otherwise:expr}) => {
$otherwise
};
}
macro_rules! inner_option_type {
(Option<$type:ty>) => {
$type
};
}
macro_rules! inner_vec_type {
(Vec<$type:ty>) => {
$type
};
}
macro_rules! inner_option_vec_type {
(Option<Vec<String>>) => {
String
};
}
macro_rules! usage_with_ident {
($name:expr, $usage:expr, $help:expr) => {
if $usage.contains("<") {
format!("<{}> {} '{}'", $name, $usage, $help)
} else {
format!("[{}] {} '{}'", $name, $usage, $help)
}
};
}
macro_rules! underscore_to_hyphen {
($e:expr) => {
str::replace($e, "_", "-")
};
}
macro_rules! usage {
(
{
$(
CMD $subc:ident
{
$subc_help:expr,
$(
CMD $subc_subc:ident
{
$subc_subc_help:expr,
$(
FLAG $subc_subc_flag:ident : (bool) = false, $subc_subc_flag_usage:expr, $subc_subc_flag_help:expr,
)*
$(
ARG $subc_subc_arg:ident : ($($subc_subc_arg_type_tt:tt)+) = $subc_subc_arg_default:expr, $subc_subc_arg_usage:expr, $subc_subc_arg_help:expr,
)*
}
)*
$(
FLAG $subc_flag:ident : (bool) = false, $subc_flag_usage:expr, $subc_flag_help:expr,
)*
$(
ARG $subc_arg:ident : ($($subc_arg_type_tt:tt)+) = $subc_arg_default:expr, $subc_arg_usage:expr, $subc_arg_help:expr,
)*
}
)*
}
{
$(
[$group_name:expr]
$(
FLAG $flag:ident : (bool) = false, or $flag_from_config:expr, $flag_usage:expr, $flag_help:expr,
)*
$(
ARG $arg:ident : ($($arg_type_tt:tt)+) = $arg_default:expr, or $arg_from_config:expr, $arg_usage:expr, $arg_help:expr,
)*
$(
CHECK $check:expr,
)*
)*
}
) => {
use toml;
use std::{fs, io, process, cmp};
use std::io::Read;
use parity_version::version;
use clap::{Arg, App, SubCommand, AppSettings, ArgSettings, Error as ClapError, ErrorKind as ClapErrorKind};
use dir::helpers::replace_home;
use std::ffi::OsStr;
use std::collections::HashMap;
extern crate textwrap;
extern crate term_size;
use self::textwrap::{Wrapper};
const MAX_TERM_WIDTH: usize = 120;
#[cfg(test)]
use regex::Regex;
#[derive(Debug)]
pub enum ArgsError {
Clap(ClapError),
Decode(toml::de::Error),
Config(String, io::Error),
PeerConfiguration,
}
impl ArgsError {
pub fn exit(self) -> ! {
match self {
ArgsError::Clap(e) => e.exit(),
ArgsError::Decode(e) => {
eprintln!("You might have supplied invalid parameters in config file.");
eprintln!("{}", e);
process::exit(2)
},
ArgsError::Config(path, e) => {
eprintln!("There was an error reading your config file at: {}", path);
eprintln!("{}", e);
process::exit(2)
},
ArgsError::PeerConfiguration => {
eprintln!("You have supplied `min_peers` > `max_peers`");
process::exit(2)
}
}
}
}
impl From<ClapError> for ArgsError {
fn from(e: ClapError) -> Self {
ArgsError::Clap(e)
}
}
impl From<toml::de::Error> for ArgsError {
fn from(e: toml::de::Error) -> Self {
ArgsError::Decode(e)
}
}
/// Parsed command line arguments.
#[derive(Debug, PartialEq)]
pub struct Args {
$(
pub $subc: bool,
$(
pub $subc_subc: bool,
$(
pub $subc_subc_flag: bool,
)*
$(
pub $subc_subc_arg: $($subc_subc_arg_type_tt)+,
)*
)*
$(
pub $subc_flag: bool,
)*
$(
pub $subc_arg: $($subc_arg_type_tt)+,
)*
)*
$(
$(
pub $flag: bool,
)*
$(
pub $arg: $($arg_type_tt)+,
)*
)*
}
impl Default for Args {
fn default() -> Self {
Args {
$(
$subc: Default::default(),
$(
$subc_subc: Default::default(),
$(
$subc_subc_flag: Default::default(),
)*
$(
$subc_subc_arg: Default::default(),
)*
)*
$(
$subc_flag: Default::default(),
)*
$(
$subc_arg: Default::default(),
)*
)*
$(
$(
$flag: Default::default(),
)*
$(
$arg: Default::default(),
)*
)*
}
}
}
#[derive(Default, Debug, PartialEq, Clone, Deserialize)]
struct RawArgs {
$(
$subc: bool,
$(
$subc_subc: bool,
$(
$subc_subc_flag: bool,
)*
$(
$subc_subc_arg: if_option!(
$($subc_subc_arg_type_tt)+,
THEN { $($subc_subc_arg_type_tt)+ }
ELSE { Option<$($subc_subc_arg_type_tt)+> }
),
)*
)*
$(
$subc_flag: bool,
)*
$(
$subc_arg: if_option!(
$($subc_arg_type_tt)+,
THEN { $($subc_arg_type_tt)+ }
ELSE { Option<$($subc_arg_type_tt)+> }
),
)*
)*
$(
$(
$flag: bool,
)*
$(
$arg: if_option!(
$($arg_type_tt)+,
THEN { $($arg_type_tt)+ }
ELSE { Option<$($arg_type_tt)+> }
),
)*
)*
}
impl Args {
pub fn parse<S: AsRef<str>>(command: &[S]) -> Result<Self, ArgsError> {
let raw_args = RawArgs::parse(command)?;
// Skip loading config file if no_config flag is specified
if raw_args.flag_no_config {
return Ok(raw_args.into_args(Config::default()));
}
let config_file = raw_args.arg_config.clone().unwrap_or_else(|| raw_args.clone().into_args(Config::default()).arg_config);
let config_file = replace_home(&::dir::default_data_path(), &config_file);
let args = match (fs::File::open(&config_file), raw_args.arg_config.clone()) {
// Load config file
(Ok(mut file), _) => {
eprintln!("Loading config file from {}", &config_file);
let mut config = String::new();
file.read_to_string(&mut config).map_err(|e| ArgsError::Config(config_file, e))?;
Ok(raw_args.into_args(Self::parse_config(&config)?))
},
// Don't display error in case default config cannot be loaded.
(Err(_), None) => Ok(raw_args.into_args(Config::default())),
// Config set from CLI (fail with error)
(Err(_), Some(ref config_arg)) => {
match presets::preset_config_string(config_arg) {
Ok(s) => Ok(raw_args.into_args(Self::parse_config(&s)?)),
Err(e) => Err(ArgsError::Config(config_file, e))
}
},
}?;
$(
$(
$check(&args)?;
)*
)*
Ok(args)
}
#[cfg(test)]
pub fn parse_without_config<S: AsRef<str>>(command: &[S]) -> Result<Self, ArgsError> {
Self::parse_with_config(command, Config::default())
}
#[cfg(test)]
fn parse_with_config<S: AsRef<str>>(command: &[S], config: Config) -> Result<Self, ArgsError> {
RawArgs::parse(command).map(|raw| raw.into_args(config)).map_err(ArgsError::Clap)
}
fn parse_config(config: &str) -> Result<Config, ArgsError> {
Ok(toml::from_str(config)?)
}
pub fn print_version() -> String {
format!(include_str!("./version.txt"), version())
}
#[allow(unused_mut)] // subc_subc_exist may be assigned true by the macro
#[allow(unused_assignments)] // Rust issue #22630
pub fn print_help() -> String {
const TAB: &str = " ";
const TAB_TAB: &str = " ";
let term_width = match term_size::dimensions() {
None => MAX_TERM_WIDTH,
Some((w, _)) => {
cmp::min(w, MAX_TERM_WIDTH)
}
};
let mut help : String = include_str!("./usage_header.txt").to_owned();
help.push_str("\n");
// Subcommands
let mut subcommands_wrapper = Wrapper::new(term_width).subsequent_indent(TAB);
help.push_str("openethereum [options]\n");
$(
{
let mut subc_subc_exist = false;
$(
subc_subc_exist = true;
let subc_subc_usages : Vec<&str> = vec![
$(
concat!("[",$subc_subc_flag_usage,"]"),
)*
$(
$subc_subc_arg_usage,
)*
];
help.push_str(&subcommands_wrapper.fill(
format!(
"openethereum [options] {} {} {}\n",
underscore_to_hyphen!(&stringify!($subc)[4..]),
underscore_to_hyphen!(&stringify!($subc_subc)[stringify!($subc).len()+1..]),
subc_subc_usages.join(" ")
).as_ref())
);
)*
// Print the subcommand on its own only if it has no subsubcommands
if !subc_subc_exist {
let subc_usages : Vec<&str> = vec![
$(
concat!("[",$subc_flag_usage,"]"),
)*
$(
$subc_arg_usage,
)*
];
help.push_str(&subcommands_wrapper.fill(
format!(
"openethereum [options] {} {}\n",
underscore_to_hyphen!(&stringify!($subc)[4..]),
subc_usages.join(" ")
).as_ref())
);
}
}
)*
help.push_str("\n");
// Arguments and flags
let args_wrapper = Wrapper::new(term_width).initial_indent(TAB_TAB).subsequent_indent(TAB_TAB);
$(
if $group_name != "Legacy Options" {
help.push_str($group_name); help.push_str(":\n");
$(
help.push_str(&format!("{}{}\n{}\n",
TAB, $flag_usage,
args_wrapper.fill($flag_help)
));
help.push_str("\n");
)*
$(
if_option!(
$($arg_type_tt)+,
THEN {
if_option_vec!(
$($arg_type_tt)+,
THEN {
help.push_str(&format!("{}{}\n{}\n",
TAB, $arg_usage,
args_wrapper.fill(format!(
"{} (default: {:?})",
$arg_help,
{let x : inner_option_type!($($arg_type_tt)+)> = $arg_default; x}
).as_ref())
))
}
ELSE {
help.push_str(&format!("{}{}\n{}\n",
TAB, $arg_usage,
args_wrapper.fill(format!(
"{}{}",
$arg_help,
$arg_default.map(|x: inner_option_type!($($arg_type_tt)+)| format!(" (default: {})",x)).unwrap_or("".to_owned())
).as_ref())
))
}
)
}
ELSE {
if_vec!(
$($arg_type_tt)+,
THEN {
help.push_str(&format!("{}{}\n{}\n", TAB, $arg_usage,
args_wrapper.fill(format!(
"{} (default: {:?})",
$arg_help,
{let x : $($arg_type_tt)+ = $arg_default; x}
).as_ref())
))
}
ELSE {
help.push_str(&format!("{}{}\n{}\n", TAB, $arg_usage,
args_wrapper.fill(format!(
"{} (default: {})",
$arg_help,
$arg_default
).as_ref())
))
}
)
}
);
help.push_str("\n");
)*
}
)*
help
}
}
impl RawArgs {
fn into_args(self, config: Config) -> Args {
let mut args = Args::default();
$(
args.$subc = self.$subc;
$(
args.$subc_subc = self.$subc_subc;
$(
args.$subc_subc_flag = self.$subc_subc_flag;
)*
$(
args.$subc_subc_arg = if_option!(
$($subc_subc_arg_type_tt)+,
THEN { self.$subc_subc_arg.or($subc_subc_arg_default) }
ELSE { self.$subc_subc_arg.unwrap_or($subc_subc_arg_default.into()) }
);
)*
)*
$(
args.$subc_flag = self.$subc_flag;
)*
$(
args.$subc_arg = if_option!(
$($subc_arg_type_tt)+,
THEN { self.$subc_arg.or($subc_arg_default) }
ELSE { self.$subc_arg.unwrap_or($subc_arg_default.into()) }
);
)*
)*
$(
$(
args.$flag = self.$flag || $flag_from_config(&config).unwrap_or(false);
)*
$(
args.$arg = if_option!(
$($arg_type_tt)+,
THEN { self.$arg.or_else(|| $arg_from_config(&config)).or_else(|| $arg_default.into()) }
ELSE { self.$arg.or_else(|| $arg_from_config(&config)).unwrap_or_else(|| $arg_default.into()) }
);
)*
)*
args
}
#[allow(unused_variables)] // the submatches of arg-less subcommands aren't used
pub fn parse<S: AsRef<str>>(command: &[S]) -> Result<Self, ClapError> {
let usages = vec![
$(
$(
usage_with_ident!(stringify!($arg), $arg_usage, $arg_help),
)*
$(
usage_with_ident!(stringify!($flag), $flag_usage, $flag_help),
)*
)*
];
// Hash of subc|subc_subc => Vec<String>
let mut subc_usages = HashMap::new();
$(
{
let this_subc_usages = vec![
$(
usage_with_ident!(stringify!($subc_flag), $subc_flag_usage, $subc_flag_help),
)*
$(
usage_with_ident!(stringify!($subc_arg), $subc_arg_usage, $subc_arg_help),
)*
];
subc_usages.insert(stringify!($subc),this_subc_usages);
$(
{
let this_subc_subc_usages = vec![
$(
usage_with_ident!(stringify!($subc_subc_flag), $subc_subc_flag_usage, $subc_subc_flag_help),
)*
$(
usage_with_ident!(stringify!($subc_subc_arg), $subc_subc_arg_usage, $subc_subc_arg_help),
)*
];
subc_usages.insert(stringify!($subc_subc), this_subc_subc_usages);
}
)*
}
)*
let matches = App::new("OpenEthereum")
.global_setting(AppSettings::VersionlessSubcommands)
.global_setting(AppSettings::DisableHelpSubcommand)
.max_term_width(MAX_TERM_WIDTH)
.help(Args::print_help().as_ref())
.args(&usages.iter().map(|u| {
let mut arg = Arg::from_usage(u)
.allow_hyphen_values(true) // Allow for example --allow-ips -10.0.0.0/8
.global(true) // Argument doesn't have to come before the first subcommand
.hidden(true); // Hide global arguments from the (subcommand) help messages generated by Clap
if arg.is_set(ArgSettings::Multiple) {
arg = arg.require_delimiter(true); // Multiple values can only be separated by commas, not spaces (#7428)
}
arg
}).collect::<Vec<Arg>>())
$(
.subcommand(
SubCommand::with_name(&underscore_to_hyphen!(&stringify!($subc)[4..]))
.about($subc_help)
.args(&subc_usages.get(stringify!($subc)).unwrap().iter().map(|u| Arg::from_usage(u).use_delimiter(false).allow_hyphen_values(true)).collect::<Vec<Arg>>())
$(
.setting(AppSettings::SubcommandRequired) // prevent from running `openethereum account`
.subcommand(
SubCommand::with_name(&underscore_to_hyphen!(&stringify!($subc_subc)[stringify!($subc).len()+1..]))
.about($subc_subc_help)
.args(&subc_usages.get(stringify!($subc_subc)).unwrap().iter().map(|u| Arg::from_usage(u).use_delimiter(false).allow_hyphen_values(true)).collect::<Vec<Arg>>())
)
)*
)
)*
.get_matches_from_safe(command.iter().map(|x| OsStr::new(x.as_ref())))?;
let mut raw_args : RawArgs = Default::default();
// Globals
$(
$(
raw_args.$flag = raw_args.$flag || matches.is_present(stringify!($flag));
)*
$(
if let some @ Some(_) = return_if_parse_error!(if_option!(
$($arg_type_tt)+,
THEN {
if_option_vec!(
$($arg_type_tt)+,
THEN { values_t!(matches, stringify!($arg), inner_option_vec_type!($($arg_type_tt)+)) }
ELSE { value_t!(matches, stringify!($arg), inner_option_type!($($arg_type_tt)+)) }
)
}
ELSE {
if_vec!(
$($arg_type_tt)+,
THEN { values_t!(matches, stringify!($arg), inner_vec_type!($($arg_type_tt)+)) }
ELSE { value_t!(matches, stringify!($arg), $($arg_type_tt)+) }
)
}
)) {
raw_args.$arg = some;
}
)*
)*
// Subcommands
$(
if let Some(submatches) = matches.subcommand_matches(&underscore_to_hyphen!(&stringify!($subc)[4..])) {
raw_args.$subc = true;
// Subcommand flags
$(
raw_args.$subc_flag = submatches.is_present(&stringify!($subc_flag));
)*
// Subcommand arguments
$(
raw_args.$subc_arg = return_if_parse_error!(if_option!(
$($subc_arg_type_tt)+,
THEN {
if_option_vec!(
$($subc_arg_type_tt)+,
THEN { values_t!(submatches, stringify!($subc_arg), inner_option_vec_type!($($subc_arg_type_tt)+)) }
ELSE { value_t!(submatches, stringify!($subc_arg), inner_option_type!($($subc_arg_type_tt)+)) }
)
}
ELSE {
if_vec!(
$($subc_arg_type_tt)+,
THEN { values_t!(submatches, stringify!($subc_arg), inner_vec_type!($($subc_arg_type_tt)+)) }
ELSE { value_t!(submatches, stringify!($subc_arg), $($subc_arg_type_tt)+) }
)
}
));
)*
// Sub-subcommands
$(
if let Some(subsubmatches) = submatches.subcommand_matches(&underscore_to_hyphen!(&stringify!($subc_subc)[stringify!($subc).len()+1..])) {
raw_args.$subc_subc = true;
// Sub-subcommand flags
$(
raw_args.$subc_subc_flag = subsubmatches.is_present(&stringify!($subc_subc_flag));
)*
// Sub-subcommand arguments
$(
raw_args.$subc_subc_arg = return_if_parse_error!(if_option!(
$($subc_subc_arg_type_tt)+,
THEN {
if_option_vec!(
$($subc_subc_arg_type_tt)+,
THEN { values_t!(subsubmatches, stringify!($subc_subc_arg), inner_option_vec_type!($($subc_subc_arg_type_tt)+)) }
ELSE { value_t!(subsubmatches, stringify!($subc_subc_arg), inner_option_type!($($subc_subc_arg_type_tt)+)) }
)
}
ELSE {
if_vec!(
$($subc_subc_arg_type_tt)+,
THEN { values_t!(subsubmatches, stringify!($subc_subc_arg), inner_vec_type!($($subc_subc_arg_type_tt)+)) }
ELSE { value_t!(subsubmatches, stringify!($subc_subc_arg), $($subc_subc_arg_type_tt)+) }
)
}
));
)*
}
else {
raw_args.$subc_subc = false;
}
)*
}
else {
raw_args.$subc = false;
}
)*
Ok(raw_args)
}
}
#[test]
fn usages_valid() {
let re = Regex::new(r"^(?:(-[a-zA-Z-]+, )?--[a-z-]+(=\[[a-zA-Z]+\](\.\.\.)?|=<[a-zA-Z]+>(\.\.\.)?)?)|(?:\[[a-zA-Z-]+\])(\.\.\.)?|(?:<[a-zA-Z-]+>)(\.\.\.)?$").unwrap();
let usages = vec![
$(
$(
$(
$subc_subc_arg_usage,
)*
)*
$(
$subc_arg_usage,
)*
)*
$(
$(
$flag_usage,
)*
$(
$arg_usage,
)*
)*
];
for usage in &usages {
assert!(re.is_match(usage));
}
}
}
}

View File

@ -0,0 +1,6 @@
OpenEthereum Client.
By Wood/Paronyan/Kotewicz/Drwięga/Volf/Greeff
Habermeier/Czaban/Gotchac/Redman/Nikolsky
Schoedon/Tang/Adolfsson/Silva/Palm/Hirsz et al.
Copyright 2015-2020 Parity Technologies (UK) Ltd.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

10
bin/oe/cli/version.txt Normal file
View File

@ -0,0 +1,10 @@
OpenEthereum Client.
version {}
Copyright 2015-2020 Parity Technologies (UK) Ltd.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
By Wood/Paronyan/Kotewicz/Drwięga/Volf/Greeff
Habermeier/Czaban/Gotchac/Redman/Nikolsky
Schoedon/Tang/Adolfsson/Silva/Palm/Hirsz et al.

2045
bin/oe/configuration.rs Normal file

File diff suppressed because it is too large Load Diff

25
bin/oe/db/mod.rs Normal file
View File

@ -0,0 +1,25 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Database-related operations.
#[path = "rocksdb/mod.rs"]
mod impls;
pub use self::impls::{migrate, restoration_db_handler};
#[cfg(feature = "secretstore")]
pub use self::impls::open_secretstore_db;

View File

@ -0,0 +1,83 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Blooms migration from rocksdb to blooms-db
use super::{kvdb_rocksdb::DatabaseConfig, open_database};
use ethcore::error::Error;
use ethereum_types::Bloom;
use rlp;
use std::path::Path;
const LOG_BLOOMS_ELEMENTS_PER_INDEX: u64 = 16;
pub fn migrate_blooms<P: AsRef<Path>>(path: P, config: &DatabaseConfig) -> Result<(), Error> {
// init
let db = open_database(&path.as_ref().to_string_lossy(), config)?;
// possible optimization:
// pre-allocate space on disk for faster migration
// iterate over header blooms and insert them in blooms-db
// Some(3) -> COL_EXTRA
// 3u8 -> ExtrasIndex::BlocksBlooms
// 0u8 -> level 0
let blooms_iterator = db
.key_value()
.iter_from_prefix(Some(3), &[3u8, 0u8])
.filter(|(key, _)| key.len() == 6)
.take_while(|(key, _)| key[0] == 3u8 && key[1] == 0u8)
.map(|(key, group)| {
let index = (key[2] as u64) << 24
| (key[3] as u64) << 16
| (key[4] as u64) << 8
| (key[5] as u64);
let number = index * LOG_BLOOMS_ELEMENTS_PER_INDEX;
let blooms = rlp::decode_list::<Bloom>(&group);
(number, blooms)
});
for (number, blooms) in blooms_iterator {
db.blooms().insert_blooms(number, blooms.iter())?;
}
// iterate over trace blooms and insert them in blooms-db
// Some(4) -> COL_TRACE
// 1u8 -> TraceDBIndex::BloomGroups
// 0u8 -> level 0
let trace_blooms_iterator = db
.key_value()
.iter_from_prefix(Some(4), &[1u8, 0u8])
.filter(|(key, _)| key.len() == 6)
.take_while(|(key, _)| key[0] == 1u8 && key[1] == 0u8)
.map(|(key, group)| {
let index = (key[2] as u64)
| (key[3] as u64) << 8
| (key[4] as u64) << 16
| (key[5] as u64) << 24;
let number = index * LOG_BLOOMS_ELEMENTS_PER_INDEX;
let blooms = rlp::decode_list::<Bloom>(&group);
(number, blooms)
});
for (number, blooms) in trace_blooms_iterator {
db.trace_blooms().insert_blooms(number, blooms.iter())?;
}
Ok(())
}

View File

@ -0,0 +1,40 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use super::kvdb_rocksdb::{CompactionProfile, DatabaseConfig};
use ethcore::client::{ClientConfig, DatabaseCompactionProfile};
use ethcore_db::NUM_COLUMNS;
use std::path::Path;
pub fn compaction_profile(
profile: &DatabaseCompactionProfile,
db_path: &Path,
) -> CompactionProfile {
match profile {
&DatabaseCompactionProfile::Auto => CompactionProfile::auto(db_path),
&DatabaseCompactionProfile::SSD => CompactionProfile::ssd(),
&DatabaseCompactionProfile::HDD => CompactionProfile::hdd(),
}
}
pub fn client_db_config(client_path: &Path, client_config: &ClientConfig) -> DatabaseConfig {
let mut client_db_config = DatabaseConfig::with_columns(NUM_COLUMNS);
client_db_config.memory_budget = client_config.db_cache_size;
client_db_config.compaction = compaction_profile(&client_config.db_compaction, &client_path);
client_db_config
}

View File

@ -0,0 +1,262 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use super::{
kvdb_rocksdb::{CompactionProfile, DatabaseConfig},
migration_rocksdb::{ChangeColumns, Config as MigrationConfig, Manager as MigrationManager},
};
use ethcore::{self, client::DatabaseCompactionProfile};
use std::{
fmt::{Display, Error as FmtError, Formatter},
fs,
io::{Error as IoError, ErrorKind, Read, Write},
path::{Path, PathBuf},
};
use super::{blooms::migrate_blooms, helpers};
/// The migration from v10 to v11.
/// Adds a column for node info.
pub const TO_V11: ChangeColumns = ChangeColumns {
pre_columns: Some(6),
post_columns: Some(7),
version: 11,
};
/// The migration from v11 to v12.
/// Adds a column for light chain storage.
pub const TO_V12: ChangeColumns = ChangeColumns {
pre_columns: Some(7),
post_columns: Some(8),
version: 12,
};
/// Database is assumed to be at default version, when no version file is found.
const DEFAULT_VERSION: u32 = 5;
/// Current version of database models.
const CURRENT_VERSION: u32 = 16;
/// Until this version please use upgrade tool.
const USE_MIGRATION_TOOL: u32 = 15;
/// A version of database at which blooms-db was introduced
const BLOOMS_DB_VERSION: u32 = 13;
/// Defines how many items are migrated to the new version of database at once.
const BATCH_SIZE: usize = 1024;
/// Version file name.
const VERSION_FILE_NAME: &'static str = "db_version";
/// Migration related erorrs.
#[derive(Debug)]
pub enum Error {
/// Returned when current version cannot be read or guessed.
UnknownDatabaseVersion,
/// Existing DB is newer than the known one.
FutureDBVersion,
/// Migration is not possible.
MigrationImpossible,
/// For old versions use external migration tool
UseMigrationTool,
/// Blooms-db migration error.
BloomsDB(ethcore::error::Error),
/// Migration was completed succesfully,
/// but there was a problem with io.
Io(IoError),
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> {
let out = match *self {
Error::UnknownDatabaseVersion => "Current database version cannot be read".into(),
Error::FutureDBVersion => "Database was created with newer client version. Upgrade your client or delete DB and resync.".into(),
Error::MigrationImpossible => format!("Database migration to version {} is not possible.", CURRENT_VERSION),
Error::BloomsDB(ref err) => format!("blooms-db migration error: {}", err),
Error::UseMigrationTool => "For db versions 15 and lower (v2.5.13=>13, 2.7.2=>14, v3.0.1=>15) please use upgrade db tool to manually upgrade db: https://github.com/openethereum/3.1-db-upgrade-tool".into(),
Error::Io(ref err) => format!("Unexpected io error on DB migration: {}.", err),
};
write!(f, "{}", out)
}
}
impl From<IoError> for Error {
fn from(err: IoError) -> Self {
Error::Io(err)
}
}
/// Returns the version file path.
fn version_file_path(path: &Path) -> PathBuf {
let mut file_path = path.to_owned();
file_path.push(VERSION_FILE_NAME);
file_path
}
/// Reads current database version from the file at given path.
/// If the file does not exist returns `DEFAULT_VERSION`.
fn current_version(path: &Path) -> Result<u32, Error> {
match fs::File::open(version_file_path(path)) {
Err(ref err) if err.kind() == ErrorKind::NotFound => Ok(DEFAULT_VERSION),
Err(_) => Err(Error::UnknownDatabaseVersion),
Ok(mut file) => {
let mut s = String::new();
file.read_to_string(&mut s)
.map_err(|_| Error::UnknownDatabaseVersion)?;
u32::from_str_radix(&s, 10).map_err(|_| Error::UnknownDatabaseVersion)
}
}
}
/// Writes current database version to the file.
/// Creates a new file if the version file does not exist yet.
fn update_version(path: &Path) -> Result<(), Error> {
fs::create_dir_all(path)?;
let mut file = fs::File::create(version_file_path(path))?;
file.write_all(format!("{}", CURRENT_VERSION).as_bytes())?;
Ok(())
}
/// Consolidated database path
fn consolidated_database_path(path: &Path) -> PathBuf {
let mut state_path = path.to_owned();
state_path.push("db");
state_path
}
/// Database backup
fn backup_database_path(path: &Path) -> PathBuf {
let mut backup_path = path.to_owned();
backup_path.pop();
backup_path.push("temp_backup");
backup_path
}
/// Default migration settings.
pub fn default_migration_settings(compaction_profile: &CompactionProfile) -> MigrationConfig {
MigrationConfig {
batch_size: BATCH_SIZE,
compaction_profile: *compaction_profile,
}
}
/// Migrations on the consolidated database.
fn consolidated_database_migrations(
compaction_profile: &CompactionProfile,
) -> Result<MigrationManager, Error> {
let mut manager = MigrationManager::new(default_migration_settings(compaction_profile));
manager
.add_migration(TO_V11)
.map_err(|_| Error::MigrationImpossible)?;
manager
.add_migration(TO_V12)
.map_err(|_| Error::MigrationImpossible)?;
Ok(manager)
}
/// Migrates database at given position with given migration rules.
fn migrate_database(
version: u32,
db_path: &Path,
mut migrations: MigrationManager,
) -> Result<(), Error> {
// check if migration is needed
if !migrations.is_needed(version) {
return Ok(());
}
let backup_path = backup_database_path(&db_path);
// remove the backup dir if it exists
let _ = fs::remove_dir_all(&backup_path);
// migrate old database to the new one
let temp_path = migrations.execute(&db_path, version)?;
// completely in-place migration leads to the paths being equal.
// in that case, no need to shuffle directories.
if temp_path == db_path {
return Ok(());
}
// create backup
fs::rename(&db_path, &backup_path)?;
// replace the old database with the new one
if let Err(err) = fs::rename(&temp_path, &db_path) {
// if something went wrong, bring back backup
fs::rename(&backup_path, &db_path)?;
return Err(err.into());
}
// remove backup
fs::remove_dir_all(&backup_path).map_err(Into::into)
}
fn exists(path: &Path) -> bool {
fs::metadata(path).is_ok()
}
/// Migrates the database.
pub fn migrate(path: &Path, compaction_profile: &DatabaseCompactionProfile) -> Result<(), Error> {
let compaction_profile = helpers::compaction_profile(&compaction_profile, path);
// read version file.
let version = current_version(path)?;
// migrate the databases.
// main db directory may already exists, so let's check if we have blocks dir
if version > CURRENT_VERSION {
return Err(Error::FutureDBVersion);
}
// We are in the latest version, yay!
if version == CURRENT_VERSION {
return Ok(());
}
if version != DEFAULT_VERSION && version <= USE_MIGRATION_TOOL {
return Err(Error::UseMigrationTool);
}
let db_path = consolidated_database_path(path);
// Further migrations
if version < CURRENT_VERSION && exists(&db_path) {
println!(
"Migrating database from version {} to {}",
version, CURRENT_VERSION
);
migrate_database(
version,
&db_path,
consolidated_database_migrations(&compaction_profile)?,
)?;
if version < BLOOMS_DB_VERSION {
println!("Migrating blooms to blooms-db...");
let db_config = DatabaseConfig {
max_open_files: 64,
memory_budget: None,
compaction: compaction_profile,
columns: ethcore_db::NUM_COLUMNS,
};
migrate_blooms(&db_path, &db_config).map_err(Error::BloomsDB)?;
}
println!("Migration finished");
}
// update version file.
update_version(path)
}

119
bin/oe/db/rocksdb/mod.rs Normal file
View File

@ -0,0 +1,119 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
extern crate ethcore_blockchain;
extern crate kvdb_rocksdb;
extern crate migration_rocksdb;
use self::{
ethcore_blockchain::{BlockChainDB, BlockChainDBHandler},
kvdb_rocksdb::{Database, DatabaseConfig},
};
use blooms_db;
use ethcore::client::ClientConfig;
use ethcore_db::KeyValueDB;
use stats::PrometheusMetrics;
use std::{fs, io, path::Path, sync::Arc};
mod blooms;
mod helpers;
mod migration;
pub use self::migration::migrate;
struct AppDB {
key_value: Arc<dyn KeyValueDB>,
blooms: blooms_db::Database,
trace_blooms: blooms_db::Database,
}
impl BlockChainDB for AppDB {
fn key_value(&self) -> &Arc<dyn KeyValueDB> {
&self.key_value
}
fn blooms(&self) -> &blooms_db::Database {
&self.blooms
}
fn trace_blooms(&self) -> &blooms_db::Database {
&self.trace_blooms
}
}
impl PrometheusMetrics for AppDB {
fn prometheus_metrics(&self, _: &mut stats::PrometheusRegistry) {}
}
/// Open a secret store DB using the given secret store data path. The DB path is one level beneath the data path.
#[cfg(feature = "secretstore")]
pub fn open_secretstore_db(data_path: &str) -> Result<Arc<dyn KeyValueDB>, String> {
use std::path::PathBuf;
let mut db_path = PathBuf::from(data_path);
db_path.push("db");
let db_path = db_path
.to_str()
.ok_or_else(|| "Invalid secretstore path".to_string())?;
Ok(Arc::new(
Database::open_default(&db_path).map_err(|e| format!("Error opening database: {:?}", e))?,
))
}
/// Create a restoration db handler using the config generated by `client_path` and `client_config`.
pub fn restoration_db_handler(
client_path: &Path,
client_config: &ClientConfig,
) -> Box<dyn BlockChainDBHandler> {
let client_db_config = helpers::client_db_config(client_path, client_config);
struct RestorationDBHandler {
config: DatabaseConfig,
}
impl BlockChainDBHandler for RestorationDBHandler {
fn open(&self, db_path: &Path) -> io::Result<Arc<dyn BlockChainDB>> {
open_database(&db_path.to_string_lossy(), &self.config)
}
}
Box::new(RestorationDBHandler {
config: client_db_config,
})
}
pub fn open_database(
client_path: &str,
config: &DatabaseConfig,
) -> io::Result<Arc<dyn BlockChainDB>> {
let path = Path::new(client_path);
let blooms_path = path.join("blooms");
let trace_blooms_path = path.join("trace_blooms");
fs::create_dir_all(&blooms_path)?;
fs::create_dir_all(&trace_blooms_path)?;
let db = Database::open(&config, client_path)?;
let db_with_metrics = ethcore_db::DatabaseWithMetrics::new(db);
let db = AppDB {
key_value: Arc::new(db_with_metrics),
blooms: blooms_db::Database::open(blooms_path)?,
trace_blooms: blooms_db::Database::open(trace_blooms_path)?,
};
Ok(Arc::new(db))
}

600
bin/oe/helpers.rs Normal file
View File

@ -0,0 +1,600 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use crate::{
cache::CacheConfig,
db::migrate,
miner::pool::PrioritizationStrategy,
sync::{self, validate_node_url},
upgrade::{upgrade, upgrade_data_paths},
};
use dir::{helpers::replace_home, DatabaseDirectories};
use ethcore::{
client::{BlockId, ClientConfig, DatabaseCompactionProfile, Mode, VMType, VerifierType},
miner::{Penalization, PendingSet},
};
use ethereum_types::{Address, U256};
use ethkey::Password;
use journaldb::Algorithm;
use std::{
collections::HashSet,
fs::File,
io,
io::{BufRead, BufReader, Write},
time::Duration,
};
pub fn to_duration(s: &str) -> Result<Duration, String> {
to_seconds(s).map(Duration::from_secs)
}
fn clean_0x(s: &str) -> &str {
if s.starts_with("0x") {
&s[2..]
} else {
s
}
}
fn to_seconds(s: &str) -> Result<u64, String> {
let bad = |_| {
format!(
"{}: Invalid duration given. See openethereum --help for more information.",
s
)
};
match s {
"twice-daily" => Ok(12 * 60 * 60),
"half-hourly" => Ok(30 * 60),
"1second" | "1 second" | "second" => Ok(1),
"1minute" | "1 minute" | "minute" => Ok(60),
"hourly" | "1hour" | "1 hour" | "hour" => Ok(60 * 60),
"daily" | "1day" | "1 day" | "day" => Ok(24 * 60 * 60),
x if x.ends_with("seconds") => x[0..x.len() - 7].trim().parse().map_err(bad),
x if x.ends_with("minutes") => x[0..x.len() - 7]
.trim()
.parse::<u64>()
.map_err(bad)
.map(|x| x * 60),
x if x.ends_with("hours") => x[0..x.len() - 5]
.trim()
.parse::<u64>()
.map_err(bad)
.map(|x| x * 60 * 60),
x if x.ends_with("days") => x[0..x.len() - 4]
.trim()
.parse::<u64>()
.map_err(bad)
.map(|x| x * 24 * 60 * 60),
x => x.trim().parse().map_err(bad),
}
}
pub fn to_mode(s: &str, timeout: u64, alarm: u64) -> Result<Mode, String> {
match s {
"active" => Ok(Mode::Active),
"passive" => Ok(Mode::Passive(
Duration::from_secs(timeout),
Duration::from_secs(alarm),
)),
"dark" => Ok(Mode::Dark(Duration::from_secs(timeout))),
"offline" => Ok(Mode::Off),
_ => Err(format!(
"{}: Invalid value for --mode. Must be one of active, passive, dark or offline.",
s
)),
}
}
pub fn to_block_id(s: &str) -> Result<BlockId, String> {
if s == "latest" {
Ok(BlockId::Latest)
} else if let Ok(num) = s.parse() {
Ok(BlockId::Number(num))
} else if let Ok(hash) = s.parse() {
Ok(BlockId::Hash(hash))
} else {
Err("Invalid block.".into())
}
}
pub fn to_u256(s: &str) -> Result<U256, String> {
if let Ok(decimal) = U256::from_dec_str(s) {
Ok(decimal)
} else {
clean_0x(s)
.parse()
.map_err(|_| format!("Invalid numeric value: {}", s))
}
}
pub fn to_pending_set(s: &str) -> Result<PendingSet, String> {
match s {
"cheap" => Ok(PendingSet::AlwaysQueue),
"strict" => Ok(PendingSet::AlwaysSealing),
"lenient" => Ok(PendingSet::SealingOrElseQueue),
other => Err(format!("Invalid pending set value: {:?}", other)),
}
}
pub fn to_queue_strategy(s: &str) -> Result<PrioritizationStrategy, String> {
match s {
"gas_price" => Ok(PrioritizationStrategy::GasPriceOnly),
other => Err(format!("Invalid queue strategy: {}", other)),
}
}
pub fn to_queue_penalization(time: Option<u64>) -> Result<Penalization, String> {
Ok(match time {
Some(threshold_ms) => Penalization::Enabled {
offend_threshold: Duration::from_millis(threshold_ms),
},
None => Penalization::Disabled,
})
}
pub fn to_address(s: Option<String>) -> Result<Address, String> {
match s {
Some(ref a) => clean_0x(a)
.parse()
.map_err(|_| format!("Invalid address: {:?}", a)),
None => Ok(Address::default()),
}
}
pub fn to_addresses(s: &Option<String>) -> Result<Vec<Address>, String> {
match *s {
Some(ref adds) if !adds.is_empty() => adds
.split(',')
.map(|a| {
clean_0x(a)
.parse()
.map_err(|_| format!("Invalid address: {:?}", a))
})
.collect(),
_ => Ok(Vec::new()),
}
}
/// Tries to parse string as a price.
pub fn to_price(s: &str) -> Result<f32, String> {
s.parse::<f32>().map_err(|_| {
format!(
"Invalid transaction price {:?} given. Must be a decimal number.",
s
)
})
}
pub fn join_set(set: Option<&HashSet<String>>) -> Option<String> {
set.map(|s| {
s.iter()
.map(|s| s.as_str())
.collect::<Vec<&str>>()
.join(",")
})
}
/// Flush output buffer.
pub fn flush_stdout() {
io::stdout().flush().expect("stdout is flushable; qed");
}
/// Formats and returns parity ipc path.
pub fn parity_ipc_path(base: &str, path: &str, shift: u16) -> String {
let mut path = path.to_owned();
if shift != 0 {
path = path.replace("jsonrpc.ipc", &format!("jsonrpc-{}.ipc", shift));
}
replace_home(base, &path)
}
/// Validates and formats bootnodes option.
pub fn to_bootnodes(bootnodes: &Option<String>) -> Result<Vec<String>, String> {
match *bootnodes {
Some(ref x) if !x.is_empty() => x
.split(',')
.map(|s| match validate_node_url(s).map(Into::into) {
None => Ok(s.to_owned()),
Some(sync::ErrorKind::AddressResolve(_)) => {
Err(format!("Failed to resolve hostname of a boot node: {}", s))
}
Some(_) => Err(format!(
"Invalid node address format given for a boot node: {}",
s
)),
})
.collect(),
Some(_) => Ok(vec![]),
None => Ok(vec![]),
}
}
#[cfg(test)]
pub fn default_network_config() -> crate::sync::NetworkConfiguration {
use super::network::IpFilter;
use crate::sync::NetworkConfiguration;
NetworkConfiguration {
config_path: Some(replace_home(&::dir::default_data_path(), "$BASE/network")),
net_config_path: None,
listen_address: Some("0.0.0.0:30303".into()),
public_address: None,
udp_port: None,
nat_enabled: true,
discovery_enabled: true,
boot_nodes: Vec::new(),
use_secret: None,
max_peers: 50,
min_peers: 25,
snapshot_peers: 0,
max_pending_peers: 64,
ip_filter: IpFilter::default(),
reserved_nodes: Vec::new(),
allow_non_reserved: true,
client_version: ::parity_version::version(),
}
}
pub fn to_client_config(
cache_config: &CacheConfig,
spec_name: String,
mode: Mode,
tracing: bool,
fat_db: bool,
compaction: DatabaseCompactionProfile,
vm_type: VMType,
name: String,
pruning: Algorithm,
pruning_history: u64,
pruning_memory: usize,
check_seal: bool,
max_round_blocks_to_import: usize,
) -> ClientConfig {
let mut client_config = ClientConfig::default();
let mb = 1024 * 1024;
// in bytes
client_config.blockchain.max_cache_size = cache_config.blockchain() as usize * mb;
// in bytes
client_config.blockchain.pref_cache_size = cache_config.blockchain() as usize * 3 / 4 * mb;
// db cache size, in megabytes
client_config.db_cache_size = Some(cache_config.db_cache_size() as usize);
// db queue cache size, in bytes
client_config.queue.max_mem_use = cache_config.queue() as usize * mb;
// in bytes
client_config.tracing.max_cache_size = cache_config.traces() as usize * mb;
// in bytes
client_config.tracing.pref_cache_size = cache_config.traces() as usize * 3 / 4 * mb;
// in bytes
client_config.state_cache_size = cache_config.state() as usize * mb;
// in bytes
client_config.jump_table_size = cache_config.jump_tables() as usize * mb;
// in bytes
client_config.history_mem = pruning_memory * mb;
client_config.mode = mode;
client_config.tracing.enabled = tracing;
client_config.fat_db = fat_db;
client_config.pruning = pruning;
client_config.history = pruning_history;
client_config.db_compaction = compaction;
client_config.vm_type = vm_type;
client_config.name = name;
client_config.verifier_type = if check_seal {
VerifierType::Canon
} else {
VerifierType::CanonNoSeal
};
client_config.spec_name = spec_name;
client_config.max_round_blocks_to_import = max_round_blocks_to_import;
client_config
}
pub fn execute_upgrades(
base_path: &str,
dirs: &DatabaseDirectories,
pruning: Algorithm,
compaction_profile: &DatabaseCompactionProfile,
) -> Result<(), String> {
upgrade_data_paths(base_path, dirs, pruning);
match upgrade(&dirs.path) {
Ok(upgrades_applied) if upgrades_applied > 0 => {
debug!("Executed {} upgrade scripts - ok", upgrades_applied);
}
Err(e) => {
return Err(format!("Error upgrading OpenEthereum data: {:?}", e));
}
_ => {}
}
let client_path = dirs.db_path(pruning);
migrate(&client_path, compaction_profile).map_err(|e| format!("{}", e))
}
/// Prompts user asking for password.
pub fn password_prompt() -> Result<Password, String> {
use rpassword::read_password;
const STDIN_ERROR: &'static str = "Unable to ask for password on non-interactive terminal.";
println!("Please note that password is NOT RECOVERABLE.");
print!("Type password: ");
flush_stdout();
let password = read_password().map_err(|_| STDIN_ERROR.to_owned())?.into();
print!("Repeat password: ");
flush_stdout();
let password_repeat = read_password().map_err(|_| STDIN_ERROR.to_owned())?.into();
if password != password_repeat {
return Err("Passwords do not match!".into());
}
Ok(password)
}
/// Read a password from password file.
pub fn password_from_file(path: String) -> Result<Password, String> {
let passwords = passwords_from_files(&[path])?;
// use only first password from the file
passwords
.get(0)
.map(Password::clone)
.ok_or_else(|| "Password file seems to be empty.".to_owned())
}
/// Reads passwords from files. Treats each line as a separate password.
pub fn passwords_from_files(files: &[String]) -> Result<Vec<Password>, String> {
let passwords = files.iter().map(|filename| {
let file = File::open(filename).map_err(|_| format!("{} Unable to read password file. Ensure it exists and permissions are correct.", filename))?;
let reader = BufReader::new(&file);
let lines = reader.lines()
.filter_map(|l| l.ok())
.map(|pwd| pwd.trim().to_owned().into())
.collect::<Vec<Password>>();
Ok(lines)
}).collect::<Result<Vec<Vec<Password>>, String>>();
Ok(passwords?.into_iter().flat_map(|x| x).collect())
}
#[cfg(test)]
mod tests {
use super::{
join_set, password_from_file, to_address, to_addresses, to_block_id, to_bootnodes,
to_duration, to_mode, to_pending_set, to_price, to_u256,
};
use ethcore::{
client::{BlockId, Mode},
miner::PendingSet,
};
use ethereum_types::U256;
use ethkey::Password;
use std::{collections::HashSet, fs::File, io::Write, time::Duration};
use tempdir::TempDir;
#[test]
fn test_to_duration() {
assert_eq!(
to_duration("twice-daily").unwrap(),
Duration::from_secs(12 * 60 * 60)
);
assert_eq!(
to_duration("half-hourly").unwrap(),
Duration::from_secs(30 * 60)
);
assert_eq!(to_duration("1second").unwrap(), Duration::from_secs(1));
assert_eq!(to_duration("2seconds").unwrap(), Duration::from_secs(2));
assert_eq!(to_duration("15seconds").unwrap(), Duration::from_secs(15));
assert_eq!(to_duration("1minute").unwrap(), Duration::from_secs(1 * 60));
assert_eq!(
to_duration("2minutes").unwrap(),
Duration::from_secs(2 * 60)
);
assert_eq!(
to_duration("15minutes").unwrap(),
Duration::from_secs(15 * 60)
);
assert_eq!(to_duration("hourly").unwrap(), Duration::from_secs(60 * 60));
assert_eq!(
to_duration("daily").unwrap(),
Duration::from_secs(24 * 60 * 60)
);
assert_eq!(
to_duration("1hour").unwrap(),
Duration::from_secs(1 * 60 * 60)
);
assert_eq!(
to_duration("2hours").unwrap(),
Duration::from_secs(2 * 60 * 60)
);
assert_eq!(
to_duration("15hours").unwrap(),
Duration::from_secs(15 * 60 * 60)
);
assert_eq!(
to_duration("1day").unwrap(),
Duration::from_secs(1 * 24 * 60 * 60)
);
assert_eq!(
to_duration("2days").unwrap(),
Duration::from_secs(2 * 24 * 60 * 60)
);
assert_eq!(
to_duration("15days").unwrap(),
Duration::from_secs(15 * 24 * 60 * 60)
);
assert_eq!(
to_duration("15 days").unwrap(),
Duration::from_secs(15 * 24 * 60 * 60)
);
assert_eq!(to_duration("2 seconds").unwrap(), Duration::from_secs(2));
}
#[test]
fn test_to_mode() {
assert_eq!(to_mode("active", 0, 0).unwrap(), Mode::Active);
assert_eq!(
to_mode("passive", 10, 20).unwrap(),
Mode::Passive(Duration::from_secs(10), Duration::from_secs(20))
);
assert_eq!(
to_mode("dark", 20, 30).unwrap(),
Mode::Dark(Duration::from_secs(20))
);
assert!(to_mode("other", 20, 30).is_err());
}
#[test]
fn test_to_block_id() {
assert_eq!(to_block_id("latest").unwrap(), BlockId::Latest);
assert_eq!(to_block_id("0").unwrap(), BlockId::Number(0));
assert_eq!(to_block_id("2").unwrap(), BlockId::Number(2));
assert_eq!(to_block_id("15").unwrap(), BlockId::Number(15));
assert_eq!(
to_block_id("9fc84d84f6a785dc1bd5abacfcf9cbdd3b6afb80c0f799bfb2fd42c44a0c224e")
.unwrap(),
BlockId::Hash(
"9fc84d84f6a785dc1bd5abacfcf9cbdd3b6afb80c0f799bfb2fd42c44a0c224e"
.parse()
.unwrap()
)
);
}
#[test]
fn test_to_u256() {
assert_eq!(to_u256("0").unwrap(), U256::from(0));
assert_eq!(to_u256("11").unwrap(), U256::from(11));
assert_eq!(to_u256("0x11").unwrap(), U256::from(17));
assert!(to_u256("u").is_err())
}
#[test]
fn test_pending_set() {
assert_eq!(to_pending_set("cheap").unwrap(), PendingSet::AlwaysQueue);
assert_eq!(to_pending_set("strict").unwrap(), PendingSet::AlwaysSealing);
assert_eq!(
to_pending_set("lenient").unwrap(),
PendingSet::SealingOrElseQueue
);
assert!(to_pending_set("othe").is_err());
}
#[test]
fn test_to_address() {
assert_eq!(
to_address(Some("0xD9A111feda3f362f55Ef1744347CDC8Dd9964a41".into())).unwrap(),
"D9A111feda3f362f55Ef1744347CDC8Dd9964a41".parse().unwrap()
);
assert_eq!(
to_address(Some("D9A111feda3f362f55Ef1744347CDC8Dd9964a41".into())).unwrap(),
"D9A111feda3f362f55Ef1744347CDC8Dd9964a41".parse().unwrap()
);
assert_eq!(to_address(None).unwrap(), Default::default());
}
#[test]
fn test_to_addresses() {
let addresses = to_addresses(&Some(
"0xD9A111feda3f362f55Ef1744347CDC8Dd9964a41,D9A111feda3f362f55Ef1744347CDC8Dd9964a42"
.into(),
))
.unwrap();
assert_eq!(
addresses,
vec![
"D9A111feda3f362f55Ef1744347CDC8Dd9964a41".parse().unwrap(),
"D9A111feda3f362f55Ef1744347CDC8Dd9964a42".parse().unwrap(),
]
);
}
#[test]
fn test_password() {
let tempdir = TempDir::new("").unwrap();
let path = tempdir.path().join("file");
let mut file = File::create(&path).unwrap();
file.write_all(b"a bc ").unwrap();
assert_eq!(
password_from_file(path.to_str().unwrap().into())
.unwrap()
.as_bytes(),
b"a bc"
);
}
#[test]
fn test_password_multiline() {
let tempdir = TempDir::new("").unwrap();
let path = tempdir.path().join("file");
let mut file = File::create(path.as_path()).unwrap();
file.write_all(
br#" password with trailing whitespace
those passwords should be
ignored
but the first password is trimmed
"#,
)
.unwrap();
assert_eq!(
password_from_file(path.to_str().unwrap().into()).unwrap(),
Password::from("password with trailing whitespace")
);
}
#[test]
fn test_to_price() {
assert_eq!(to_price("1").unwrap(), 1.0);
assert_eq!(to_price("2.3").unwrap(), 2.3);
assert_eq!(to_price("2.33").unwrap(), 2.33);
}
#[test]
fn test_to_bootnodes() {
let one_bootnode = "enode://e731347db0521f3476e6bbbb83375dcd7133a1601425ebd15fd10f3835fd4c304fba6282087ca5a0deeafadf0aa0d4fd56c3323331901c1f38bd181c283e3e35@128.199.55.137:30303";
let two_bootnodes = "enode://e731347db0521f3476e6bbbb83375dcd7133a1601425ebd15fd10f3835fd4c304fba6282087ca5a0deeafadf0aa0d4fd56c3323331901c1f38bd181c283e3e35@128.199.55.137:30303,enode://e731347db0521f3476e6bbbb83375dcd7133a1601425ebd15fd10f3835fd4c304fba6282087ca5a0deeafadf0aa0d4fd56c3323331901c1f38bd181c283e3e35@128.199.55.137:30303";
assert_eq!(to_bootnodes(&Some("".into())), Ok(vec![]));
assert_eq!(to_bootnodes(&None), Ok(vec![]));
assert_eq!(
to_bootnodes(&Some(one_bootnode.into())),
Ok(vec![one_bootnode.into()])
);
assert_eq!(
to_bootnodes(&Some(two_bootnodes.into())),
Ok(vec![one_bootnode.into(), one_bootnode.into()])
);
}
#[test]
fn test_join_set() {
let mut test_set = HashSet::new();
test_set.insert("0x1111111111111111111111111111111111111111".to_string());
test_set.insert("0x0000000000000000000000000000000000000000".to_string());
let res = join_set(Some(&test_set)).unwrap();
assert!(
res == "0x1111111111111111111111111111111111111111,0x0000000000000000000000000000000000000000"
||
res == "0x0000000000000000000000000000000000000000,0x1111111111111111111111111111111111111111"
);
}
}

429
bin/oe/informant.rs Normal file
View File

@ -0,0 +1,429 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
extern crate ansi_term;
use self::ansi_term::{
Colour,
Colour::{Blue, Cyan, Green, White, Yellow},
Style,
};
use std::{
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering as AtomicOrdering},
Arc,
},
time::{Duration, Instant},
};
use crate::{
io::{IoContext, IoHandler, TimerToken},
sync::{ManageNetwork, SyncProvider},
types::BlockNumber,
};
use atty;
use ethcore::{
client::{
BlockChainClient, BlockChainInfo, BlockId, BlockInfo, BlockQueueInfo, ChainInfo,
ChainNotify, Client, ClientIoMessage, ClientReport, NewBlocks,
},
snapshot::{service::Service as SnapshotService, RestorationStatus, SnapshotService as SS},
};
use number_prefix::{binary_prefix, Prefixed, Standalone};
use parity_rpc::{informant::RpcStats, is_major_importing_or_waiting};
use parking_lot::{Mutex, RwLock};
/// Format byte counts to standard denominations.
pub fn format_bytes(b: usize) -> String {
match binary_prefix(b as f64) {
Standalone(bytes) => format!("{} bytes", bytes),
Prefixed(prefix, n) => format!("{:.0} {}B", n, prefix),
}
}
/// Something that can be converted to milliseconds.
pub trait MillisecondDuration {
/// Get the value in milliseconds.
fn as_milliseconds(&self) -> u64;
}
impl MillisecondDuration for Duration {
fn as_milliseconds(&self) -> u64 {
self.as_secs() * 1000 + self.subsec_nanos() as u64 / 1_000_000
}
}
#[derive(Default)]
struct CacheSizes {
sizes: ::std::collections::BTreeMap<&'static str, usize>,
}
impl CacheSizes {
fn insert(&mut self, key: &'static str, bytes: usize) {
self.sizes.insert(key, bytes);
}
fn display<F>(&self, style: Style, paint: F) -> String
where
F: Fn(Style, String) -> String,
{
use std::fmt::Write;
let mut buf = String::new();
for (name, &size) in &self.sizes {
write!(buf, " {:>8} {}", paint(style, format_bytes(size)), name)
.expect("writing to string won't fail unless OOM; qed")
}
buf
}
}
pub struct SyncInfo {
last_imported_block_number: BlockNumber,
last_imported_ancient_number: Option<BlockNumber>,
num_peers: usize,
max_peers: u32,
snapshot_sync: bool,
}
pub struct Report {
importing: bool,
chain_info: BlockChainInfo,
client_report: ClientReport,
queue_info: BlockQueueInfo,
cache_sizes: CacheSizes,
sync_info: Option<SyncInfo>,
}
/// Something which can provide data to the informant.
pub trait InformantData: Send + Sync {
/// Whether it executes transactions
fn executes_transactions(&self) -> bool;
/// Whether it is currently importing (also included in `Report`)
fn is_major_importing(&self) -> bool;
/// Generate a report of blockchain status, memory usage, and sync info.
fn report(&self) -> Report;
}
/// Informant data for a full node.
pub struct FullNodeInformantData {
pub client: Arc<Client>,
pub sync: Option<Arc<dyn SyncProvider>>,
pub net: Option<Arc<dyn ManageNetwork>>,
}
impl InformantData for FullNodeInformantData {
fn executes_transactions(&self) -> bool {
true
}
fn is_major_importing(&self) -> bool {
let state = self.sync.as_ref().map(|sync| sync.status().state);
is_major_importing_or_waiting(state, self.client.queue_info(), false)
}
fn report(&self) -> Report {
let (client_report, queue_info, blockchain_cache_info) = (
self.client.report(),
self.client.queue_info(),
self.client.blockchain_cache_info(),
);
let chain_info = self.client.chain_info();
let mut cache_sizes = CacheSizes::default();
cache_sizes.insert("queue", queue_info.mem_used);
cache_sizes.insert("chain", blockchain_cache_info.total());
let importing = self.is_major_importing();
let sync_info = match (self.sync.as_ref(), self.net.as_ref()) {
(Some(sync), Some(net)) => {
let status = sync.status();
let num_peers_range = net.num_peers_range();
debug_assert!(num_peers_range.end() >= num_peers_range.start());
Some(SyncInfo {
last_imported_block_number: status
.last_imported_block_number
.unwrap_or(chain_info.best_block_number),
last_imported_ancient_number: status.last_imported_old_block_number,
num_peers: status.num_peers,
max_peers: status
.current_max_peers(*num_peers_range.start(), *num_peers_range.end()),
snapshot_sync: status.is_snapshot_syncing(),
})
}
_ => None,
};
Report {
importing,
chain_info,
client_report,
queue_info,
cache_sizes,
sync_info,
}
}
}
pub struct Informant<T> {
last_tick: RwLock<Instant>,
with_color: bool,
target: T,
snapshot: Option<Arc<SnapshotService>>,
rpc_stats: Option<Arc<RpcStats>>,
last_import: Mutex<Instant>,
skipped: AtomicUsize,
skipped_txs: AtomicUsize,
in_shutdown: AtomicBool,
last_report: Mutex<ClientReport>,
}
impl<T: InformantData> Informant<T> {
/// Make a new instance potentially `with_color` output.
pub fn new(
target: T,
snapshot: Option<Arc<SnapshotService>>,
rpc_stats: Option<Arc<RpcStats>>,
with_color: bool,
) -> Self {
Informant {
last_tick: RwLock::new(Instant::now()),
with_color: with_color,
target: target,
snapshot: snapshot,
rpc_stats: rpc_stats,
last_import: Mutex::new(Instant::now()),
skipped: AtomicUsize::new(0),
skipped_txs: AtomicUsize::new(0),
in_shutdown: AtomicBool::new(false),
last_report: Mutex::new(Default::default()),
}
}
/// Signal that we're shutting down; no more output necessary.
pub fn shutdown(&self) {
self.in_shutdown
.store(true, ::std::sync::atomic::Ordering::SeqCst);
}
pub fn tick(&self) {
let now = Instant::now();
let elapsed;
{
let last_tick = self.last_tick.read();
if now < *last_tick + Duration::from_millis(1500) {
return;
}
elapsed = now - *last_tick;
}
let (client_report, full_report) = {
let last_report = self.last_report.lock();
let full_report = self.target.report();
let diffed = full_report.client_report.clone() - &*last_report;
(diffed, full_report)
};
let Report {
importing,
chain_info,
queue_info,
cache_sizes,
sync_info,
..
} = full_report;
let rpc_stats = self.rpc_stats.as_ref();
let snapshot_sync = sync_info.as_ref().map_or(false, |s| s.snapshot_sync)
&& self
.snapshot
.as_ref()
.map_or(false, |s| match s.restoration_status() {
RestorationStatus::Ongoing { .. } | RestorationStatus::Initializing { .. } => {
true
}
_ => false,
});
if !importing && !snapshot_sync && elapsed < Duration::from_secs(30) {
return;
}
*self.last_tick.write() = now;
*self.last_report.lock() = full_report.client_report.clone();
let paint = |c: Style, t: String| match self.with_color && atty::is(atty::Stream::Stdout) {
true => format!("{}", c.paint(t)),
false => t,
};
info!(target: "import", "{}{} {} {} {}",
match importing {
true => match snapshot_sync {
false => format!("Syncing {} {} {} {}+{} Qed",
paint(White.bold(), format!("{:>8}", format!("#{}", chain_info.best_block_number))),
paint(White.bold(), format!("{}", chain_info.best_block_hash)),
if self.target.executes_transactions() {
format!("{} blk/s {} tx/s {} Mgas/s",
paint(Yellow.bold(), format!("{:7.2}", (client_report.blocks_imported * 1000) as f64 / elapsed.as_milliseconds() as f64)),
paint(Yellow.bold(), format!("{:6.1}", (client_report.transactions_applied * 1000) as f64 / elapsed.as_milliseconds() as f64)),
paint(Yellow.bold(), format!("{:6.1}", (client_report.gas_processed / 1000).low_u64() as f64 / elapsed.as_milliseconds() as f64))
)
} else {
format!("{} hdr/s",
paint(Yellow.bold(), format!("{:6.1}", (client_report.blocks_imported * 1000) as f64 / elapsed.as_milliseconds() as f64))
)
},
paint(Green.bold(), format!("{:5}", queue_info.unverified_queue_size)),
paint(Green.bold(), format!("{:5}", queue_info.verified_queue_size))
),
true => {
self.snapshot.as_ref().map_or(String::new(), |s|
match s.restoration_status() {
RestorationStatus::Ongoing { state_chunks, block_chunks, state_chunks_done, block_chunks_done, .. } => {
format!("Syncing snapshot {}/{}", state_chunks_done + block_chunks_done, state_chunks + block_chunks)
},
RestorationStatus::Initializing { chunks_done } => {
format!("Snapshot initializing ({} chunks restored)", chunks_done)
},
_ => String::new(),
}
)
},
},
false => String::new(),
},
match chain_info.ancient_block_number {
Some(ancient_number) => format!(" Ancient:#{}", ancient_number),
None => String::new(),
},
match sync_info.as_ref() {
Some(ref sync_info) => format!("{}{}/{} peers",
match importing {
true => format!("{}",
if self.target.executes_transactions() {
paint(Green.bold(), format!("{:>8} ", format!("LI:#{}", sync_info.last_imported_block_number)))
} else {
String::new()
}
),
false => match sync_info.last_imported_ancient_number {
Some(number) => format!("{} ", paint(Yellow.bold(), format!("{:>8}", format!("AB:#{}", number)))),
None => String::new(),
}
},
paint(Cyan.bold(), format!("{:2}", sync_info.num_peers)),
paint(Cyan.bold(), format!("{:2}", sync_info.max_peers)),
),
_ => String::new(),
},
cache_sizes.display(Blue.bold(), &paint),
match rpc_stats {
Some(ref rpc_stats) => format!(
"RPC: {} conn, {} req/s, {} µs",
paint(Blue.bold(), format!("{:2}", rpc_stats.sessions())),
paint(Blue.bold(), format!("{:4}", rpc_stats.requests_rate())),
paint(Blue.bold(), format!("{:4}", rpc_stats.approximated_roundtrip())),
),
_ => String::new(),
},
);
}
}
impl ChainNotify for Informant<FullNodeInformantData> {
// t_nb 11.2 Informant. Prints new block inclusiong to console/log.
fn new_blocks(&self, new_blocks: NewBlocks) {
if new_blocks.has_more_blocks_to_import {
return;
}
let mut last_import = self.last_import.lock();
let client = &self.target.client;
let importing = self.target.is_major_importing();
let ripe = Instant::now() > *last_import + Duration::from_secs(1) && !importing;
let txs_imported = new_blocks
.imported
.iter()
.take(
new_blocks
.imported
.len()
.saturating_sub(if ripe { 1 } else { 0 }),
)
.filter_map(|h| client.block(BlockId::Hash(*h)))
.map(|b| b.transactions_count())
.sum();
if ripe {
if let Some(block) = new_blocks
.imported
.last()
.and_then(|h| client.block(BlockId::Hash(*h)))
{
let header_view = block.header_view();
let size = block.rlp().as_raw().len();
let (skipped, skipped_txs) = (
self.skipped.load(AtomicOrdering::Relaxed) + new_blocks.imported.len() - 1,
self.skipped_txs.load(AtomicOrdering::Relaxed) + txs_imported,
);
info!(target: "import", "Imported {} {} ({} txs, {} Mgas, {} ms, {} KiB){}",
Colour::White.bold().paint(format!("#{}", header_view.number())),
Colour::White.bold().paint(format!("{}", header_view.hash())),
Colour::Yellow.bold().paint(format!("{}", block.transactions_count())),
Colour::Yellow.bold().paint(format!("{:.2}", header_view.gas_used().low_u64() as f32 / 1000000f32)),
Colour::Purple.bold().paint(format!("{}", new_blocks.duration.as_milliseconds())),
Colour::Blue.bold().paint(format!("{:.2}", size as f32 / 1024f32)),
if skipped > 0 {
format!(" + another {} block(s) containing {} tx(s)",
Colour::Red.bold().paint(format!("{}", skipped)),
Colour::Red.bold().paint(format!("{}", skipped_txs))
)
} else {
String::new()
}
);
self.skipped.store(0, AtomicOrdering::Relaxed);
self.skipped_txs.store(0, AtomicOrdering::Relaxed);
*last_import = Instant::now();
}
} else {
self.skipped
.fetch_add(new_blocks.imported.len(), AtomicOrdering::Relaxed);
self.skipped_txs
.fetch_add(txs_imported, AtomicOrdering::Relaxed);
}
}
}
const INFO_TIMER: TimerToken = 0;
impl<T: InformantData> IoHandler<ClientIoMessage> for Informant<T> {
fn initialize(&self, io: &IoContext<ClientIoMessage>) {
io.register_timer(INFO_TIMER, Duration::from_secs(5))
.expect("Error registering timer");
}
fn timeout(&self, _io: &IoContext<ClientIoMessage>, timer: TimerToken) {
if timer == INFO_TIMER && !self.in_shutdown.load(AtomicOrdering::SeqCst) {
self.tick();
}
}
}

240
bin/oe/lib.rs Normal file
View File

@ -0,0 +1,240 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Ethcore client application.
#![warn(missing_docs)]
extern crate ansi_term;
extern crate docopt;
#[macro_use]
extern crate clap;
extern crate atty;
extern crate dir;
extern crate futures;
extern crate jsonrpc_core;
extern crate num_cpus;
extern crate number_prefix;
extern crate parking_lot;
extern crate regex;
extern crate rlp;
extern crate rpassword;
extern crate rustc_hex;
extern crate semver;
extern crate serde;
extern crate serde_json;
#[macro_use]
extern crate serde_derive;
extern crate toml;
extern crate blooms_db;
extern crate cli_signer;
extern crate common_types as types;
extern crate ethcore;
extern crate ethcore_call_contract as call_contract;
extern crate ethcore_db;
extern crate ethcore_io as io;
extern crate ethcore_logger;
extern crate ethcore_miner as miner;
extern crate ethcore_network as network;
extern crate ethcore_service;
extern crate ethcore_sync as sync;
extern crate ethereum_types;
extern crate ethkey;
extern crate ethstore;
extern crate fetch;
extern crate hyper;
extern crate journaldb;
extern crate keccak_hash as hash;
extern crate kvdb;
extern crate node_filter;
extern crate parity_bytes as bytes;
extern crate parity_crypto as crypto;
extern crate parity_local_store as local_store;
extern crate parity_path as path;
extern crate parity_rpc;
extern crate parity_runtime;
extern crate parity_version;
extern crate prometheus;
extern crate stats;
#[macro_use]
extern crate log as rlog;
#[cfg(feature = "ethcore-accounts")]
extern crate ethcore_accounts as accounts;
#[cfg(feature = "secretstore")]
extern crate ethcore_secretstore;
#[cfg(test)]
#[macro_use]
extern crate pretty_assertions;
#[cfg(test)]
extern crate tempdir;
#[cfg(test)]
#[macro_use]
extern crate lazy_static;
mod account;
mod account_utils;
mod blockchain;
mod cache;
mod cli;
mod configuration;
mod db;
mod helpers;
mod informant;
mod metrics;
mod modules;
mod params;
mod presale;
mod rpc;
mod rpc_apis;
mod run;
mod secretstore;
mod signer;
mod snapshot;
mod upgrade;
mod user_defaults;
use std::{fs::File, io::BufReader, sync::Arc};
use crate::{
cli::Args,
configuration::{Cmd, Execute},
hash::keccak_buffer,
};
#[cfg(feature = "memory_profiling")]
use std::alloc::System;
pub use self::{configuration::Configuration, run::RunningClient};
pub use ethcore_logger::{setup_log, Config as LoggerConfig, RotatingLogger};
pub use parity_rpc::PubSubSession;
#[cfg(feature = "memory_profiling")]
#[global_allocator]
static A: System = System;
fn print_hash_of(maybe_file: Option<String>) -> Result<String, String> {
if let Some(file) = maybe_file {
let mut f =
BufReader::new(File::open(&file).map_err(|_| "Unable to open file".to_owned())?);
let hash = keccak_buffer(&mut f).map_err(|_| "Unable to read from file".to_owned())?;
Ok(format!("{:x}", hash))
} else {
Err("Streaming from standard input not yet supported. Specify a file.".to_owned())
}
}
#[cfg(feature = "deadlock_detection")]
fn run_deadlock_detection_thread() {
use ansi_term::Style;
use parking_lot::deadlock;
use std::{thread, time::Duration};
info!("Starting deadlock detection thread.");
// Create a background thread which checks for deadlocks every 10s
thread::spawn(move || loop {
thread::sleep(Duration::from_secs(10));
let deadlocks = deadlock::check_deadlock();
if deadlocks.is_empty() {
continue;
}
warn!(
"{} {} detected",
deadlocks.len(),
Style::new().bold().paint("deadlock(s)")
);
for (i, threads) in deadlocks.iter().enumerate() {
warn!("{} #{}", Style::new().bold().paint("Deadlock"), i);
for t in threads {
warn!("Thread Id {:#?}", t.thread_id());
warn!("{:#?}", t.backtrace());
}
}
});
}
/// Action that OpenEthereum performed when running `start`.
pub enum ExecutionAction {
/// The execution didn't require starting a node, and thus has finished.
/// Contains the string to print on stdout, if any.
Instant(Option<String>),
/// The client has started running and must be shut down manually by calling `shutdown`.
///
/// If you don't call `shutdown()`, execution will continue in the background.
Running(RunningClient),
}
fn execute(command: Execute, logger: Arc<RotatingLogger>) -> Result<ExecutionAction, String> {
#[cfg(feature = "deadlock_detection")]
run_deadlock_detection_thread();
match command.cmd {
Cmd::Run(run_cmd) => {
let outcome = run::execute(run_cmd, logger)?;
Ok(ExecutionAction::Running(outcome))
}
Cmd::Version => Ok(ExecutionAction::Instant(Some(Args::print_version()))),
Cmd::Hash(maybe_file) => {
print_hash_of(maybe_file).map(|s| ExecutionAction::Instant(Some(s)))
}
Cmd::Account(account_cmd) => {
account::execute(account_cmd).map(|s| ExecutionAction::Instant(Some(s)))
}
Cmd::ImportPresaleWallet(presale_cmd) => {
presale::execute(presale_cmd).map(|s| ExecutionAction::Instant(Some(s)))
}
Cmd::Blockchain(blockchain_cmd) => {
blockchain::execute(blockchain_cmd).map(|_| ExecutionAction::Instant(None))
}
Cmd::SignerToken(ws_conf, logger_config) => {
signer::execute(ws_conf, logger_config).map(|s| ExecutionAction::Instant(Some(s)))
}
Cmd::SignerSign {
id,
pwfile,
port,
authfile,
} => cli_signer::signer_sign(id, pwfile, port, authfile)
.map(|s| ExecutionAction::Instant(Some(s))),
Cmd::SignerList { port, authfile } => {
cli_signer::signer_list(port, authfile).map(|s| ExecutionAction::Instant(Some(s)))
}
Cmd::SignerReject { id, port, authfile } => {
cli_signer::signer_reject(id, port, authfile).map(|s| ExecutionAction::Instant(Some(s)))
}
Cmd::Snapshot(snapshot_cmd) => {
snapshot::execute(snapshot_cmd).map(|s| ExecutionAction::Instant(Some(s)))
}
}
}
/// Starts the OpenEthereum client.
///
/// The first parameter is the command line arguments that you would pass when running the openethereum
/// binary.
///
/// On error, returns what to print on stderr.
// FIXME: totally independent logging capability, see https://github.com/openethereum/openethereum/issues/10252
pub fn start(conf: Configuration, logger: Arc<RotatingLogger>) -> Result<ExecutionAction, String> {
execute(conf.into_command()?, logger)
}

17
bin/oe/logger/Cargo.toml Normal file
View File

@ -0,0 +1,17 @@
[package]
description = "Parity Ethereum Logger Implementation"
name = "ethcore-logger"
version = "1.12.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
log = "0.4"
env_logger = "0.5"
atty = "0.2"
lazy_static = "1.0"
regex = "1.0"
time = "0.1"
parking_lot = "0.11.1"
arrayvec = "0.4"
ansi_term = "0.10"

191
bin/oe/logger/src/lib.rs Normal file
View File

@ -0,0 +1,191 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Logger for OpenEthereum executables
extern crate ansi_term;
extern crate arrayvec;
extern crate atty;
extern crate env_logger;
extern crate log as rlog;
extern crate parking_lot;
extern crate regex;
extern crate time;
#[macro_use]
extern crate lazy_static;
mod rotating;
use ansi_term::Colour;
use env_logger::{Builder as LogBuilder, Formatter};
use parking_lot::Mutex;
use regex::Regex;
use std::{
env, fs,
io::Write,
sync::{Arc, Weak},
thread,
};
pub use rotating::{init_log, RotatingLogger};
#[derive(Debug, PartialEq, Clone)]
pub struct Config {
pub mode: Option<String>,
pub color: bool,
pub file: Option<String>,
}
impl Default for Config {
fn default() -> Self {
Config {
mode: None,
color: !cfg!(windows),
file: None,
}
}
}
lazy_static! {
static ref ROTATING_LOGGER: Mutex<Weak<RotatingLogger>> = Mutex::new(Default::default());
}
/// Sets up the logger
pub fn setup_log(config: &Config) -> Result<Arc<RotatingLogger>, String> {
use rlog::*;
let mut levels = String::new();
let mut builder = LogBuilder::new();
// Disable info logging by default for some modules:
builder.filter(Some("ws"), LevelFilter::Warn);
builder.filter(Some("hyper"), LevelFilter::Warn);
builder.filter(Some("rustls"), LevelFilter::Error);
// Enable info for others.
builder.filter(None, LevelFilter::Info);
if let Ok(lvl) = env::var("RUST_LOG") {
levels.push_str(&lvl);
levels.push_str(",");
builder.parse(&lvl);
}
if let Some(ref s) = config.mode {
levels.push_str(s);
builder.parse(s);
}
let isatty = atty::is(atty::Stream::Stderr);
let enable_color = config.color && isatty;
let logs = Arc::new(RotatingLogger::new(levels));
let logger = logs.clone();
let mut open_options = fs::OpenOptions::new();
let maybe_file = match config.file.as_ref() {
Some(f) => Some(
open_options
.append(true)
.create(true)
.open(f)
.map_err(|e| format!("Cannot write to log file given: {}, {}", f, e))?,
),
None => None,
};
let format = move |buf: &mut Formatter, record: &Record| {
let timestamp = time::strftime("%Y-%m-%d %H:%M:%S %Z", &time::now()).unwrap();
let with_color = if max_level() <= LevelFilter::Info {
format!(
"{} {}",
Colour::Black.bold().paint(timestamp),
record.args()
)
} else {
let name = thread::current().name().map_or_else(Default::default, |x| {
format!("{}", Colour::Blue.bold().paint(x))
});
format!(
"{} {} {} {} {}",
Colour::Black.bold().paint(timestamp),
name,
record.level(),
record.target(),
record.args()
)
};
let removed_color = kill_color(with_color.as_ref());
let ret = match enable_color {
true => with_color,
false => removed_color.clone(),
};
if let Some(mut file) = maybe_file.as_ref() {
// ignore errors - there's nothing we can do
let _ = file.write_all(removed_color.as_bytes());
let _ = file.write_all(b"\n");
}
logger.append(removed_color);
if !isatty && record.level() <= Level::Info && atty::is(atty::Stream::Stdout) {
// duplicate INFO/WARN output to console
println!("{}", ret);
}
writeln!(buf, "{}", ret)
};
builder.format(format);
builder
.try_init()
.and_then(|_| {
*ROTATING_LOGGER.lock() = Arc::downgrade(&logs);
Ok(logs)
})
// couldn't create new logger - try to fall back on previous logger.
.or_else(|err| {
ROTATING_LOGGER
.lock()
.upgrade()
.ok_or_else(|| format!("{:?}", err))
})
}
fn kill_color(s: &str) -> String {
lazy_static! {
static ref RE: Regex = Regex::new("\x1b\\[[^m]+m").unwrap();
}
RE.replace_all(s, "").to_string()
}
#[test]
fn should_remove_colour() {
let before = "test";
let after = kill_color(&Colour::Red.bold().paint(before));
assert_eq!(after, "test");
}
#[test]
fn should_remove_multiple_colour() {
let t = format!(
"{} {}",
Colour::Red.bold().paint("test"),
Colour::White.normal().paint("again")
);
let after = kill_color(&t);
assert_eq!(after, "test again");
}

View File

@ -0,0 +1,121 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Common log helper functions
use arrayvec::ArrayVec;
use env_logger::Builder as LogBuilder;
use rlog::LevelFilter;
use std::env;
use parking_lot::{RwLock, RwLockReadGuard};
lazy_static! {
static ref LOG_DUMMY: () = {
let mut builder = LogBuilder::new();
builder.filter(None, LevelFilter::Info);
if let Ok(log) = env::var("RUST_LOG") {
builder.parse(&log);
}
if !builder.try_init().is_ok() {
println!("logger initialization failed!");
}
};
}
/// Intialize log with default settings
pub fn init_log() {
*LOG_DUMMY
}
const LOG_SIZE: usize = 128;
/// Logger implementation that keeps up to `LOG_SIZE` log elements.
pub struct RotatingLogger {
/// Defined logger levels
levels: String,
/// Logs array. Latest log is always at index 0
logs: RwLock<ArrayVec<[String; LOG_SIZE]>>,
}
impl RotatingLogger {
/// Creates new `RotatingLogger` with given levels.
/// It does not enforce levels - it's just read only.
pub fn new(levels: String) -> Self {
RotatingLogger {
levels: levels,
logs: RwLock::new(ArrayVec::<[_; LOG_SIZE]>::new()),
}
}
/// Append new log entry
pub fn append(&self, log: String) {
let mut logs = self.logs.write();
if logs.is_full() {
logs.pop();
}
logs.insert(0, log);
}
/// Return levels
pub fn levels(&self) -> &str {
&self.levels
}
/// Return logs
pub fn logs(&self) -> RwLockReadGuard<ArrayVec<[String; LOG_SIZE]>> {
self.logs.read()
}
}
#[cfg(test)]
mod test {
use super::RotatingLogger;
fn logger() -> RotatingLogger {
RotatingLogger::new("test".to_owned())
}
#[test]
fn should_return_log_levels() {
// given
let logger = logger();
// when
let levels = logger.levels();
// then
assert_eq!(levels, "test");
}
#[test]
fn should_return_latest_logs() {
// given
let logger = logger();
// when
logger.append("a".to_owned());
logger.append("b".to_owned());
// then
let logs = logger.logs();
assert_eq!(logs[0], "b".to_owned());
assert_eq!(logs[1], "a".to_owned());
assert_eq!(logs.len(), 2);
}
}

180
bin/oe/main.rs Normal file
View File

@ -0,0 +1,180 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Ethcore client application.
#![warn(missing_docs)]
extern crate ctrlc;
extern crate dir;
extern crate fdlimit;
#[macro_use]
extern crate log;
extern crate ansi_term;
extern crate openethereum;
extern crate panic_hook;
extern crate parity_daemonize;
extern crate parking_lot;
extern crate ethcore_logger;
#[cfg(windows)]
extern crate winapi;
use std::{
io::Write,
process,
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
};
use ansi_term::Colour;
use ctrlc::CtrlC;
use ethcore_logger::setup_log;
use fdlimit::raise_fd_limit;
use openethereum::{start, ExecutionAction};
use parity_daemonize::AsHandle;
use parking_lot::{Condvar, Mutex};
#[derive(Debug)]
/// Status used to exit or restart the program.
struct ExitStatus {
/// Whether the program panicked.
panicking: bool,
/// Whether the program should exit.
should_exit: bool,
}
fn main() -> Result<(), i32> {
let conf = {
let args = std::env::args().collect::<Vec<_>>();
openethereum::Configuration::parse_cli(&args).unwrap_or_else(|e| e.exit())
};
let logger = setup_log(&conf.logger_config()).unwrap_or_else(|e| {
eprintln!("{}", e);
process::exit(2)
});
// FIXME: `pid_file` shouldn't need to cloned here
// see: `https://github.com/paritytech/parity-daemonize/pull/13` for more info
let handle = if let Some(pid) = conf.args.arg_daemon_pid_file.clone() {
info!(
"{}",
Colour::Blue.paint("starting in daemon mode").to_string()
);
let _ = std::io::stdout().flush();
match parity_daemonize::daemonize(pid) {
Ok(h) => Some(h),
Err(e) => {
error!("{}", Colour::Red.paint(format!("{}", e)));
return Err(1);
}
}
} else {
None
};
// increase max number of open files
raise_fd_limit();
let exit = Arc::new((
Mutex::new(ExitStatus {
panicking: false,
should_exit: false,
}),
Condvar::new(),
));
// Double panic can happen. So when we lock `ExitStatus` after the main thread is notified, it cannot be locked
// again.
let exiting = Arc::new(AtomicBool::new(false));
trace!(target: "mode", "Not hypervised: not setting exit handlers.");
let exec = start(conf, logger);
match exec {
Ok(result) => match result {
ExecutionAction::Instant(output) => {
if let Some(s) = output {
println!("{}", s);
}
}
ExecutionAction::Running(client) => {
panic_hook::set_with({
let e = exit.clone();
let exiting = exiting.clone();
move |panic_msg| {
warn!("Panic occured, see stderr for details");
eprintln!("{}", panic_msg);
if !exiting.swap(true, Ordering::SeqCst) {
*e.0.lock() = ExitStatus {
panicking: true,
should_exit: true,
};
e.1.notify_all();
}
}
});
CtrlC::set_handler({
let e = exit.clone();
let exiting = exiting.clone();
move || {
if !exiting.swap(true, Ordering::SeqCst) {
*e.0.lock() = ExitStatus {
panicking: false,
should_exit: true,
};
e.1.notify_all();
}
}
});
// so the client has started successfully
// if this is a daemon, detach from the parent process
if let Some(mut handle) = handle {
handle.detach()
}
// Wait for signal
let mut lock = exit.0.lock();
if !lock.should_exit {
let _ = exit.1.wait(&mut lock);
}
client.shutdown();
if lock.panicking {
return Err(1);
}
}
},
Err(err) => {
// error occured during start up
// if this is a daemon, detach from the parent process
if let Some(mut handle) = handle {
handle.detach_with_msg(format!("{}", Colour::Red.paint(&err)))
}
eprintln!("{}", err);
return Err(1);
}
};
Ok(())
}

117
bin/oe/metrics.rs Normal file
View File

@ -0,0 +1,117 @@
use std::{sync::Arc, time::Instant};
use crate::{futures::Future, rpc, rpc_apis};
use parking_lot::Mutex;
use hyper::{service::service_fn_ok, Body, Method, Request, Response, Server, StatusCode};
use stats::{
prometheus::{self, Encoder},
PrometheusMetrics, PrometheusRegistry,
};
#[derive(Debug, Clone, PartialEq)]
pub struct MetricsConfiguration {
/// Are metrics enabled (default is false)?
pub enabled: bool,
/// Prefix
pub prefix: String,
/// The IP of the network interface used (default is 127.0.0.1).
pub interface: String,
/// The network port (default is 3000).
pub port: u16,
}
impl Default for MetricsConfiguration {
fn default() -> Self {
MetricsConfiguration {
enabled: false,
prefix: "".into(),
interface: "127.0.0.1".into(),
port: 3000,
}
}
}
struct State {
rpc_apis: Arc<rpc_apis::FullDependencies>,
}
fn handle_request(
req: Request<Body>,
conf: Arc<MetricsConfiguration>,
state: Arc<Mutex<State>>,
) -> Response<Body> {
let (parts, _body) = req.into_parts();
match (parts.method, parts.uri.path()) {
(Method::GET, "/metrics") => {
let start = Instant::now();
let mut reg = PrometheusRegistry::new(conf.prefix.clone());
let state = state.lock();
state.rpc_apis.client.prometheus_metrics(&mut reg);
state.rpc_apis.sync.prometheus_metrics(&mut reg);
let elapsed = start.elapsed();
reg.register_gauge(
"metrics_time",
"Time to perform rpc metrics",
elapsed.as_millis() as i64,
);
let mut buffer = vec![];
let encoder = prometheus::TextEncoder::new();
let metric_families = reg.registry().gather();
encoder
.encode(&metric_families, &mut buffer)
.expect("all source of metrics are static; qed");
let text = String::from_utf8(buffer).expect("metrics encoding is ASCII; qed");
Response::new(Body::from(text))
}
(_, _) => {
let mut res = Response::new(Body::from("not found"));
*res.status_mut() = StatusCode::NOT_FOUND;
res
}
}
}
/// Start the prometheus metrics server accessible via GET <host>:<port>/metrics
pub fn start_prometheus_metrics(
conf: &MetricsConfiguration,
deps: &rpc::Dependencies<rpc_apis::FullDependencies>,
) -> Result<(), String> {
if !conf.enabled {
return Ok(());
}
let addr = format!("{}:{}", conf.interface, conf.port);
let addr = addr
.parse()
.map_err(|err| format!("Failed to parse address '{}': {}", addr, err))?;
let state = State {
rpc_apis: deps.apis.clone(),
};
let state = Arc::new(Mutex::new(state));
let conf = Arc::new(conf.to_owned());
let server = Server::bind(&addr)
.serve(move || {
// This is the `Service` that will handle the connection.
// `service_fn_ok` is a helper to convert a function that
// returns a Response into a `Service`.
let state = state.clone();
let conf = conf.clone();
service_fn_ok(move |req: Request<Body>| {
handle_request(req, conf.clone(), state.clone())
})
})
.map_err(|e| eprintln!("server error: {}", e));
info!("Started prometeus metrics at http://{}/metrics", addr);
deps.executor.spawn(server);
Ok(())
}

63
bin/oe/modules.rs Normal file
View File

@ -0,0 +1,63 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::sync::{mpsc, Arc};
use crate::{
sync::{self, ConnectionFilter, NetworkConfiguration, Params, SyncConfig},
types::BlockNumber,
};
use ethcore::{client::BlockChainClient, snapshot::SnapshotService};
use std::collections::BTreeSet;
pub use crate::sync::{EthSync, ManageNetwork, SyncProvider};
pub use ethcore::client::ChainNotify;
use ethcore_logger::Config as LogConfig;
pub type SyncModules = (
Arc<dyn SyncProvider>,
Arc<dyn ManageNetwork>,
Arc<dyn ChainNotify>,
mpsc::Sender<sync::PriorityTask>,
);
pub fn sync(
config: SyncConfig,
network_config: NetworkConfiguration,
chain: Arc<dyn BlockChainClient>,
forks: BTreeSet<BlockNumber>,
snapshot_service: Arc<dyn SnapshotService>,
_log_settings: &LogConfig,
connection_filter: Option<Arc<dyn ConnectionFilter>>,
) -> Result<SyncModules, sync::Error> {
let eth_sync = EthSync::new(
Params {
config,
chain,
forks,
snapshot_service,
network_config,
},
connection_filter,
)?;
Ok((
eth_sync.clone() as Arc<dyn SyncProvider>,
eth_sync.clone() as Arc<dyn ManageNetwork>,
eth_sync.clone() as Arc<dyn ChainNotify>,
eth_sync.priority_tasks(),
))
}

542
bin/oe/params.rs Normal file
View File

@ -0,0 +1,542 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::{collections::HashSet, fmt, fs, num::NonZeroU32, str, time::Duration};
use crate::{
miner::{
gas_price_calibrator::{GasPriceCalibrator, GasPriceCalibratorOptions},
gas_pricer::GasPricer,
},
user_defaults::UserDefaults,
};
use ethcore::{
client::Mode,
ethereum,
spec::{Spec, SpecParams},
};
use ethereum_types::{Address, U256};
use fetch::Client as FetchClient;
use journaldb::Algorithm;
use parity_runtime::Executor;
use parity_version::version_data;
use crate::configuration;
#[derive(Debug, PartialEq)]
pub enum SpecType {
Foundation,
Poanet,
Xdai,
Volta,
Ewc,
Musicoin,
Ellaism,
Mix,
Callisto,
Morden,
Ropsten,
Kovan,
Rinkeby,
Goerli,
Sokol,
Yolo3,
Dev,
Custom(String),
}
impl Default for SpecType {
fn default() -> Self {
SpecType::Foundation
}
}
impl str::FromStr for SpecType {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let spec = match s {
"eth" | "ethereum" | "foundation" | "mainnet" => SpecType::Foundation,
"poanet" | "poacore" => SpecType::Poanet,
"xdai" => SpecType::Xdai,
"volta" => SpecType::Volta,
"ewc" | "energyweb" => SpecType::Ewc,
"musicoin" => SpecType::Musicoin,
"ellaism" => SpecType::Ellaism,
"mix" => SpecType::Mix,
"callisto" => SpecType::Callisto,
"morden" => SpecType::Morden,
"ropsten" => SpecType::Ropsten,
"kovan" => SpecType::Kovan,
"rinkeby" => SpecType::Rinkeby,
"goerli" | "görli" | "testnet" => SpecType::Goerli,
"sokol" | "poasokol" => SpecType::Sokol,
"yolo3" => SpecType::Yolo3,
"dev" => SpecType::Dev,
other => SpecType::Custom(other.into()),
};
Ok(spec)
}
}
impl fmt::Display for SpecType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(match *self {
SpecType::Foundation => "foundation",
SpecType::Poanet => "poanet",
SpecType::Xdai => "xdai",
SpecType::Volta => "volta",
SpecType::Ewc => "energyweb",
SpecType::Musicoin => "musicoin",
SpecType::Ellaism => "ellaism",
SpecType::Mix => "mix",
SpecType::Callisto => "callisto",
SpecType::Morden => "morden",
SpecType::Ropsten => "ropsten",
SpecType::Kovan => "kovan",
SpecType::Rinkeby => "rinkeby",
SpecType::Goerli => "goerli",
SpecType::Sokol => "sokol",
SpecType::Yolo3 => "yolo3",
SpecType::Dev => "dev",
SpecType::Custom(ref custom) => custom,
})
}
}
impl SpecType {
pub fn spec<'a, T: Into<SpecParams<'a>>>(&self, params: T) -> Result<Spec, String> {
let params = params.into();
match *self {
SpecType::Foundation => Ok(ethereum::new_foundation(params)),
SpecType::Poanet => Ok(ethereum::new_poanet(params)),
SpecType::Xdai => Ok(ethereum::new_xdai(params)),
SpecType::Volta => Ok(ethereum::new_volta(params)),
SpecType::Ewc => Ok(ethereum::new_ewc(params)),
SpecType::Musicoin => Ok(ethereum::new_musicoin(params)),
SpecType::Ellaism => Ok(ethereum::new_ellaism(params)),
SpecType::Mix => Ok(ethereum::new_mix(params)),
SpecType::Callisto => Ok(ethereum::new_callisto(params)),
SpecType::Morden => Ok(ethereum::new_morden(params)),
SpecType::Ropsten => Ok(ethereum::new_ropsten(params)),
SpecType::Kovan => Ok(ethereum::new_kovan(params)),
SpecType::Rinkeby => Ok(ethereum::new_rinkeby(params)),
SpecType::Goerli => Ok(ethereum::new_goerli(params)),
SpecType::Sokol => Ok(ethereum::new_sokol(params)),
SpecType::Yolo3 => Ok(ethereum::new_yolo3(params)),
SpecType::Dev => Ok(Spec::new_instant()),
SpecType::Custom(ref filename) => {
let file = fs::File::open(filename).map_err(|e| {
format!("Could not load specification file at {}: {}", filename, e)
})?;
Spec::load(params, file)
}
}
}
pub fn legacy_fork_name(&self) -> Option<String> {
match *self {
SpecType::Musicoin => Some("musicoin".to_owned()),
_ => None,
}
}
}
#[derive(Debug, PartialEq)]
pub enum Pruning {
Specific(Algorithm),
Auto,
}
impl Default for Pruning {
fn default() -> Self {
Pruning::Auto
}
}
impl str::FromStr for Pruning {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"auto" => Ok(Pruning::Auto),
other => other.parse().map(Pruning::Specific),
}
}
}
impl Pruning {
pub fn to_algorithm(&self, user_defaults: &UserDefaults) -> Algorithm {
match *self {
Pruning::Specific(algo) => algo,
Pruning::Auto => user_defaults.pruning,
}
}
}
#[derive(Debug, PartialEq)]
pub struct ResealPolicy {
pub own: bool,
pub external: bool,
}
impl Default for ResealPolicy {
fn default() -> Self {
ResealPolicy {
own: true,
external: true,
}
}
}
impl str::FromStr for ResealPolicy {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let (own, external) = match s {
"none" => (false, false),
"own" => (true, false),
"ext" => (false, true),
"all" => (true, true),
x => return Err(format!("Invalid reseal value: {}", x)),
};
let reseal = ResealPolicy {
own: own,
external: external,
};
Ok(reseal)
}
}
#[derive(Debug, PartialEq)]
pub struct AccountsConfig {
pub iterations: NonZeroU32,
pub refresh_time: u64,
pub testnet: bool,
pub password_files: Vec<String>,
pub unlocked_accounts: Vec<Address>,
pub enable_fast_unlock: bool,
}
impl Default for AccountsConfig {
fn default() -> Self {
AccountsConfig {
iterations: NonZeroU32::new(10240).expect("10240 > 0; qed"),
refresh_time: 5,
testnet: false,
password_files: Vec::new(),
unlocked_accounts: Vec::new(),
enable_fast_unlock: false,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GasPricerConfig {
Fixed(U256),
Calibrated {
usd_per_tx: f32,
recalibration_period: Duration,
api_endpoint: String,
},
}
impl Default for GasPricerConfig {
fn default() -> Self {
GasPricerConfig::Calibrated {
usd_per_tx: 0.0001f32,
recalibration_period: Duration::from_secs(3600),
api_endpoint: configuration::ETHERSCAN_ETH_PRICE_ENDPOINT.to_string(),
}
}
}
impl GasPricerConfig {
pub fn to_gas_pricer(&self, fetch: FetchClient, p: Executor) -> GasPricer {
match *self {
GasPricerConfig::Fixed(u) => GasPricer::Fixed(u),
GasPricerConfig::Calibrated {
usd_per_tx,
recalibration_period,
ref api_endpoint,
} => GasPricer::new_calibrated(GasPriceCalibrator::new(
GasPriceCalibratorOptions {
usd_per_tx: usd_per_tx,
recalibration_period: recalibration_period,
},
fetch,
p,
api_endpoint.clone(),
)),
}
}
}
#[derive(Debug, PartialEq)]
pub struct MinerExtras {
pub author: Address,
pub engine_signer: Address,
pub extra_data: Vec<u8>,
pub gas_range_target: (U256, U256),
pub work_notify: Vec<String>,
pub local_accounts: HashSet<Address>,
}
impl Default for MinerExtras {
fn default() -> Self {
MinerExtras {
author: Default::default(),
engine_signer: Default::default(),
extra_data: version_data(),
gas_range_target: (8_000_000.into(), 10_000_000.into()),
work_notify: Default::default(),
local_accounts: Default::default(),
}
}
}
/// 3-value enum.
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Switch {
/// True.
On,
/// False.
Off,
/// Auto.
Auto,
}
impl Default for Switch {
fn default() -> Self {
Switch::Auto
}
}
impl str::FromStr for Switch {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"on" => Ok(Switch::On),
"off" => Ok(Switch::Off),
"auto" => Ok(Switch::Auto),
other => Err(format!("Invalid switch value: {}", other)),
}
}
}
pub fn tracing_switch_to_bool(
switch: Switch,
user_defaults: &UserDefaults,
) -> Result<bool, String> {
match (user_defaults.is_first_launch, switch, user_defaults.tracing) {
(false, Switch::On, false) => Err("TraceDB resync required".into()),
(_, Switch::On, _) => Ok(true),
(_, Switch::Off, _) => Ok(false),
(_, Switch::Auto, def) => Ok(def),
}
}
pub fn fatdb_switch_to_bool(
switch: Switch,
user_defaults: &UserDefaults,
_algorithm: Algorithm,
) -> Result<bool, String> {
let result = match (user_defaults.is_first_launch, switch, user_defaults.fat_db) {
(false, Switch::On, false) => Err("FatDB resync required".into()),
(_, Switch::On, _) => Ok(true),
(_, Switch::Off, _) => Ok(false),
(_, Switch::Auto, def) => Ok(def),
};
result
}
pub fn mode_switch_to_bool(
switch: Option<Mode>,
user_defaults: &UserDefaults,
) -> Result<Mode, String> {
Ok(switch.unwrap_or(user_defaults.mode().clone()))
}
#[cfg(test)]
mod tests {
use super::{tracing_switch_to_bool, Pruning, ResealPolicy, SpecType, Switch};
use crate::user_defaults::UserDefaults;
use journaldb::Algorithm;
#[test]
fn test_spec_type_parsing() {
assert_eq!(SpecType::Foundation, "eth".parse().unwrap());
assert_eq!(SpecType::Foundation, "ethereum".parse().unwrap());
assert_eq!(SpecType::Foundation, "foundation".parse().unwrap());
assert_eq!(SpecType::Foundation, "mainnet".parse().unwrap());
assert_eq!(SpecType::Poanet, "poanet".parse().unwrap());
assert_eq!(SpecType::Poanet, "poacore".parse().unwrap());
assert_eq!(SpecType::Xdai, "xdai".parse().unwrap());
assert_eq!(SpecType::Volta, "volta".parse().unwrap());
assert_eq!(SpecType::Ewc, "ewc".parse().unwrap());
assert_eq!(SpecType::Ewc, "energyweb".parse().unwrap());
assert_eq!(SpecType::Musicoin, "musicoin".parse().unwrap());
assert_eq!(SpecType::Ellaism, "ellaism".parse().unwrap());
assert_eq!(SpecType::Mix, "mix".parse().unwrap());
assert_eq!(SpecType::Callisto, "callisto".parse().unwrap());
assert_eq!(SpecType::Morden, "morden".parse().unwrap());
assert_eq!(SpecType::Ropsten, "ropsten".parse().unwrap());
assert_eq!(SpecType::Kovan, "kovan".parse().unwrap());
assert_eq!(SpecType::Rinkeby, "rinkeby".parse().unwrap());
assert_eq!(SpecType::Goerli, "goerli".parse().unwrap());
assert_eq!(SpecType::Goerli, "görli".parse().unwrap());
assert_eq!(SpecType::Goerli, "testnet".parse().unwrap());
assert_eq!(SpecType::Sokol, "sokol".parse().unwrap());
assert_eq!(SpecType::Sokol, "poasokol".parse().unwrap());
}
#[test]
fn test_spec_type_default() {
assert_eq!(SpecType::Foundation, SpecType::default());
}
#[test]
fn test_spec_type_display() {
assert_eq!(format!("{}", SpecType::Foundation), "foundation");
assert_eq!(format!("{}", SpecType::Poanet), "poanet");
assert_eq!(format!("{}", SpecType::Xdai), "xdai");
assert_eq!(format!("{}", SpecType::Volta), "volta");
assert_eq!(format!("{}", SpecType::Ewc), "energyweb");
assert_eq!(format!("{}", SpecType::Musicoin), "musicoin");
assert_eq!(format!("{}", SpecType::Ellaism), "ellaism");
assert_eq!(format!("{}", SpecType::Mix), "mix");
assert_eq!(format!("{}", SpecType::Callisto), "callisto");
assert_eq!(format!("{}", SpecType::Morden), "morden");
assert_eq!(format!("{}", SpecType::Ropsten), "ropsten");
assert_eq!(format!("{}", SpecType::Kovan), "kovan");
assert_eq!(format!("{}", SpecType::Rinkeby), "rinkeby");
assert_eq!(format!("{}", SpecType::Goerli), "goerli");
assert_eq!(format!("{}", SpecType::Sokol), "sokol");
assert_eq!(format!("{}", SpecType::Dev), "dev");
assert_eq!(format!("{}", SpecType::Custom("foo/bar".into())), "foo/bar");
}
#[test]
fn test_pruning_parsing() {
assert_eq!(Pruning::Auto, "auto".parse().unwrap());
assert_eq!(
Pruning::Specific(Algorithm::Archive),
"archive".parse().unwrap()
);
assert_eq!(
Pruning::Specific(Algorithm::EarlyMerge),
"light".parse().unwrap()
);
assert_eq!(
Pruning::Specific(Algorithm::OverlayRecent),
"fast".parse().unwrap()
);
assert_eq!(
Pruning::Specific(Algorithm::RefCounted),
"basic".parse().unwrap()
);
}
#[test]
fn test_pruning_default() {
assert_eq!(Pruning::Auto, Pruning::default());
}
#[test]
fn test_reseal_policy_parsing() {
let none = ResealPolicy {
own: false,
external: false,
};
let own = ResealPolicy {
own: true,
external: false,
};
let ext = ResealPolicy {
own: false,
external: true,
};
let all = ResealPolicy {
own: true,
external: true,
};
assert_eq!(none, "none".parse().unwrap());
assert_eq!(own, "own".parse().unwrap());
assert_eq!(ext, "ext".parse().unwrap());
assert_eq!(all, "all".parse().unwrap());
}
#[test]
fn test_reseal_policy_default() {
let all = ResealPolicy {
own: true,
external: true,
};
assert_eq!(all, ResealPolicy::default());
}
#[test]
fn test_switch_parsing() {
assert_eq!(Switch::On, "on".parse().unwrap());
assert_eq!(Switch::Off, "off".parse().unwrap());
assert_eq!(Switch::Auto, "auto".parse().unwrap());
}
#[test]
fn test_switch_default() {
assert_eq!(Switch::default(), Switch::Auto);
}
fn user_defaults_with_tracing(first_launch: bool, tracing: bool) -> UserDefaults {
let mut ud = UserDefaults::default();
ud.is_first_launch = first_launch;
ud.tracing = tracing;
ud
}
#[test]
fn test_switch_to_bool() {
assert!(
!tracing_switch_to_bool(Switch::Off, &user_defaults_with_tracing(true, true)).unwrap()
);
assert!(
!tracing_switch_to_bool(Switch::Off, &user_defaults_with_tracing(true, false)).unwrap()
);
assert!(
!tracing_switch_to_bool(Switch::Off, &user_defaults_with_tracing(false, true)).unwrap()
);
assert!(
!tracing_switch_to_bool(Switch::Off, &user_defaults_with_tracing(false, false))
.unwrap()
);
assert!(
tracing_switch_to_bool(Switch::On, &user_defaults_with_tracing(true, true)).unwrap()
);
assert!(
tracing_switch_to_bool(Switch::On, &user_defaults_with_tracing(true, false)).unwrap()
);
assert!(
tracing_switch_to_bool(Switch::On, &user_defaults_with_tracing(false, true)).unwrap()
);
assert!(
tracing_switch_to_bool(Switch::On, &user_defaults_with_tracing(false, false)).is_err()
);
}
}

65
bin/oe/presale.rs Normal file
View File

@ -0,0 +1,65 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use crate::{
helpers::{password_from_file, password_prompt},
params::SpecType,
};
use crypto::publickey;
use ethkey::Password;
use ethstore::PresaleWallet;
use std::num::NonZeroU32;
#[derive(Debug, PartialEq)]
pub struct ImportWallet {
pub iterations: NonZeroU32,
pub path: String,
pub spec: SpecType,
pub wallet_path: String,
pub password_file: Option<String>,
}
pub fn execute(cmd: ImportWallet) -> Result<String, String> {
let password = match cmd.password_file.clone() {
Some(file) => password_from_file(file)?,
None => password_prompt()?,
};
let wallet = PresaleWallet::open(cmd.wallet_path.clone())
.map_err(|_| "Unable to open presale wallet.")?;
let kp = wallet.decrypt(&password).map_err(|_| "Invalid password.")?;
let address = kp.address();
import_account(&cmd, kp, password);
Ok(format!("{:?}", address))
}
#[cfg(feature = "accounts")]
pub fn import_account(cmd: &ImportWallet, kp: publickey::KeyPair, password: Password) {
use accounts::{AccountProvider, AccountProviderSettings};
use ethstore::{accounts_dir::RootDiskDirectory, EthStore};
let dir = Box::new(RootDiskDirectory::create(cmd.path.clone()).unwrap());
let secret_store = Box::new(EthStore::open_with_iterations(dir, cmd.iterations).unwrap());
let acc_provider = AccountProvider::new(secret_store, AccountProviderSettings::default());
acc_provider
.insert_account(kp.secret().clone(), &password)
.unwrap();
}
#[cfg(not(feature = "accounts"))]
pub fn import_account(_cmd: &ImportWallet, _kp: publickey::KeyPair, _password: Password) {}

364
bin/oe/rpc.rs Normal file
View File

@ -0,0 +1,364 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::{collections::HashSet, io, path::PathBuf, sync::Arc};
use crate::{
helpers::parity_ipc_path,
rpc_apis::{self, ApiSet},
};
use dir::{default_data_path, helpers::replace_home};
use jsonrpc_core::MetaIoHandler;
use parity_rpc::{
self as rpc,
informant::{Middleware, RpcStats},
DomainsValidation, Metadata,
};
use parity_runtime::Executor;
pub use parity_rpc::{HttpServer, IpcServer, RequestMiddleware};
//pub use parity_rpc::ws::Server as WsServer;
pub use parity_rpc::ws::{ws, Server as WsServer};
pub const DAPPS_DOMAIN: &'static str = "web3.site";
#[derive(Debug, Clone, PartialEq)]
pub struct HttpConfiguration {
pub enabled: bool,
pub interface: String,
pub port: u16,
pub apis: ApiSet,
pub cors: Option<Vec<String>>,
pub hosts: Option<Vec<String>>,
pub server_threads: usize,
pub processing_threads: usize,
pub max_payload: usize,
pub keep_alive: bool,
}
impl Default for HttpConfiguration {
fn default() -> Self {
HttpConfiguration {
enabled: true,
interface: "127.0.0.1".into(),
port: 8545,
apis: ApiSet::UnsafeContext,
cors: Some(vec![]),
hosts: Some(vec![]),
server_threads: 1,
processing_threads: 4,
max_payload: 5,
keep_alive: true,
}
}
}
#[derive(Debug, PartialEq)]
pub struct IpcConfiguration {
pub enabled: bool,
pub socket_addr: String,
pub apis: ApiSet,
}
impl Default for IpcConfiguration {
fn default() -> Self {
IpcConfiguration {
enabled: true,
socket_addr: if cfg!(windows) {
r"\\.\pipe\jsonrpc.ipc".into()
} else {
let data_dir = ::dir::default_data_path();
parity_ipc_path(&data_dir, "$BASE/jsonrpc.ipc", 0)
},
apis: ApiSet::IpcContext,
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub struct WsConfiguration {
pub enabled: bool,
pub interface: String,
pub port: u16,
pub apis: ApiSet,
pub max_connections: usize,
pub origins: Option<Vec<String>>,
pub hosts: Option<Vec<String>>,
pub signer_path: PathBuf,
pub support_token_api: bool,
pub max_payload: usize,
}
impl Default for WsConfiguration {
fn default() -> Self {
let data_dir = default_data_path();
WsConfiguration {
enabled: true,
interface: "127.0.0.1".into(),
port: 8546,
apis: ApiSet::UnsafeContext,
max_connections: 100,
origins: Some(vec![
"parity://*".into(),
"chrome-extension://*".into(),
"moz-extension://*".into(),
]),
hosts: Some(Vec::new()),
signer_path: replace_home(&data_dir, "$BASE/signer").into(),
support_token_api: true,
max_payload: 5,
}
}
}
impl WsConfiguration {
pub fn address(&self) -> Option<rpc::Host> {
address(self.enabled, &self.interface, self.port, &self.hosts)
}
}
fn address(
enabled: bool,
bind_iface: &str,
bind_port: u16,
hosts: &Option<Vec<String>>,
) -> Option<rpc::Host> {
if !enabled {
return None;
}
match *hosts {
Some(ref hosts) if !hosts.is_empty() => Some(hosts[0].clone().into()),
_ => Some(format!("{}:{}", bind_iface, bind_port).into()),
}
}
pub struct Dependencies<D: rpc_apis::Dependencies> {
pub apis: Arc<D>,
pub executor: Executor,
pub stats: Arc<RpcStats>,
}
pub fn new_ws<D: rpc_apis::Dependencies>(
conf: WsConfiguration,
deps: &Dependencies<D>,
) -> Result<Option<WsServer>, String> {
if !conf.enabled {
return Ok(None);
}
let domain = DAPPS_DOMAIN;
let url = format!("{}:{}", conf.interface, conf.port);
let addr = url
.parse()
.map_err(|_| format!("Invalid WebSockets listen host/port given: {}", url))?;
let full_handler = setup_apis(rpc_apis::ApiSet::All, deps);
let handler = {
let mut handler = MetaIoHandler::with_middleware((
rpc::WsDispatcher::new(full_handler),
Middleware::new(deps.stats.clone(), deps.apis.activity_notifier()),
));
let apis = conf.apis.list_apis();
deps.apis.extend_with_set(&mut handler, &apis);
handler
};
let allowed_origins = into_domains(with_domain(conf.origins, domain, &None));
let allowed_hosts = into_domains(with_domain(conf.hosts, domain, &Some(url.clone().into())));
let signer_path;
let path = match conf.support_token_api {
true => {
signer_path = crate::signer::codes_path(&conf.signer_path);
Some(signer_path.as_path())
}
false => None,
};
let start_result = rpc::start_ws(
&addr,
handler,
allowed_origins,
allowed_hosts,
conf.max_connections,
rpc::WsExtractor::new(path.clone()),
rpc::WsExtractor::new(path.clone()),
rpc::WsStats::new(deps.stats.clone()),
conf.max_payload,
);
// match start_result {
// Ok(server) => Ok(Some(server)),
// Err(rpc::ws::Error::Io(rpc::ws::ErrorKind::Io(ref err), _)) if err.kind() == io::ErrorKind::AddrInUse => Err(
// format!("WebSockets address {} is already in use, make sure that another instance of an Ethereum client is not running or change the address using the --ws-port and --ws-interface options.", url)
// ),
// Err(e) => Err(format!("WebSockets error: {:?}", e)),
// }
match start_result {
Ok(server) => Ok(Some(server)),
Err(rpc::ws::Error::WsError(ws::Error {
kind: ws::ErrorKind::Io(ref err), ..
})) if err.kind() == io::ErrorKind::AddrInUse => Err(
format!("WebSockets address {} is already in use, make sure that another instance of an Ethereum client is not running or change the address using the --ws-port and --ws-interface options.", url)
),
Err(e) => Err(format!("WebSockets error: {:?}", e)),
}
}
pub fn new_http<D: rpc_apis::Dependencies>(
id: &str,
options: &str,
conf: HttpConfiguration,
deps: &Dependencies<D>,
) -> Result<Option<HttpServer>, String> {
if !conf.enabled {
return Ok(None);
}
let domain = DAPPS_DOMAIN;
let url = format!("{}:{}", conf.interface, conf.port);
let addr = url
.parse()
.map_err(|_| format!("Invalid {} listen host/port given: {}", id, url))?;
let handler = setup_apis(conf.apis, deps);
let cors_domains = into_domains(conf.cors);
let allowed_hosts = into_domains(with_domain(conf.hosts, domain, &Some(url.clone().into())));
let start_result = rpc::start_http(
&addr,
cors_domains,
allowed_hosts,
handler,
rpc::RpcExtractor,
conf.server_threads,
conf.max_payload,
conf.keep_alive,
);
match start_result {
Ok(server) => Ok(Some(server)),
Err(ref err) if err.kind() == io::ErrorKind::AddrInUse => Err(
format!("{} address {} is already in use, make sure that another instance of an Ethereum client is not running or change the address using the --{}-port and --{}-interface options.", id, url, options, options)
),
Err(e) => Err(format!("{} error: {:?}", id, e)),
}
}
pub fn new_ipc<D: rpc_apis::Dependencies>(
conf: IpcConfiguration,
dependencies: &Dependencies<D>,
) -> Result<Option<IpcServer>, String> {
if !conf.enabled {
return Ok(None);
}
let handler = setup_apis(conf.apis, dependencies);
let path = PathBuf::from(&conf.socket_addr);
// Make sure socket file can be created on unix-like OS.
// Windows pipe paths are not on the FS.
if !cfg!(windows) {
if let Some(dir) = path.parent() {
::std::fs::create_dir_all(&dir).map_err(|err| {
format!(
"Unable to create IPC directory at {}: {}",
dir.display(),
err
)
})?;
}
}
match rpc::start_ipc(&conf.socket_addr, handler, rpc::RpcExtractor) {
Ok(server) => Ok(Some(server)),
Err(io_error) => Err(format!("IPC error: {}", io_error)),
}
}
fn into_domains<T: From<String>>(items: Option<Vec<String>>) -> DomainsValidation<T> {
items
.map(|vals| vals.into_iter().map(T::from).collect())
.into()
}
fn with_domain(
items: Option<Vec<String>>,
domain: &str,
dapps_address: &Option<rpc::Host>,
) -> Option<Vec<String>> {
fn extract_port(s: &str) -> Option<u16> {
s.split(':').nth(1).and_then(|s| s.parse().ok())
}
items.map(move |items| {
let mut items = items.into_iter().collect::<HashSet<_>>();
{
let mut add_hosts = |address: &Option<rpc::Host>| {
if let Some(host) = address.clone() {
items.insert(host.to_string());
items.insert(host.replace("127.0.0.1", "localhost"));
items.insert(format!("http://*.{}", domain)); //proxypac
if let Some(port) = extract_port(&*host) {
items.insert(format!("http://*.{}:{}", domain, port));
}
}
};
add_hosts(dapps_address);
}
items.into_iter().collect()
})
}
pub fn setup_apis<D>(
apis: ApiSet,
deps: &Dependencies<D>,
) -> MetaIoHandler<Metadata, Middleware<D::Notifier>>
where
D: rpc_apis::Dependencies,
{
let mut handler = MetaIoHandler::with_middleware(Middleware::new(
deps.stats.clone(),
deps.apis.activity_notifier(),
));
let apis = apis.list_apis();
deps.apis.extend_with_set(&mut handler, &apis);
handler
}
#[cfg(test)]
mod tests {
use super::address;
#[test]
fn should_return_proper_address() {
assert_eq!(address(false, "localhost", 8180, &None), None);
assert_eq!(
address(true, "localhost", 8180, &None),
Some("localhost:8180".into())
);
assert_eq!(
address(true, "localhost", 8180, &Some(vec!["host:443".into()])),
Some("host:443".into())
);
assert_eq!(
address(true, "localhost", 8180, &Some(vec!["host".into()])),
Some("host".into())
);
}
}

646
bin/oe/rpc_apis.rs Normal file
View File

@ -0,0 +1,646 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::{
cmp::PartialEq,
collections::{BTreeMap, HashSet},
str::FromStr,
sync::Arc,
};
pub use parity_rpc::signer::SignerService;
use crate::{
account_utils::{self, AccountProvider},
miner::external::ExternalMiner,
sync::{ManageNetwork, SyncProvider},
};
use ethcore::{client::Client, miner::Miner, snapshot::SnapshotService};
use ethcore_logger::RotatingLogger;
use fetch::Client as FetchClient;
use jsonrpc_core::{self as core, MetaIoHandler};
use parity_rpc::{
dispatch::FullDispatcher,
informant::{ActivityNotifier, ClientNotifier},
Host, Metadata, NetworkSettings,
};
use parity_runtime::Executor;
use parking_lot::Mutex;
#[derive(Debug, PartialEq, Clone, Eq, Hash)]
pub enum Api {
/// Web3 (Safe)
Web3,
/// Net (Safe)
Net,
/// Eth (Safe)
Eth,
/// Eth Pub-Sub (Safe)
EthPubSub,
/// Geth-compatible "personal" API (DEPRECATED; only used in `--geth` mode.)
Personal,
/// Signer - Confirm transactions in Signer (UNSAFE: Passwords, List of transactions)
Signer,
/// Parity - Custom extensions (Safe)
Parity,
/// Traces (Safe)
Traces,
/// Rpc (Safe)
Rpc,
/// Parity PubSub - Generic Publish-Subscriber (Safety depends on other APIs exposed).
ParityPubSub,
/// Parity Accounts extensions (UNSAFE: Passwords, Side Effects (new account))
ParityAccounts,
/// Parity - Set methods (UNSAFE: Side Effects affecting node operation)
ParitySet,
/// SecretStore (UNSAFE: arbitrary hash signing)
SecretStore,
/// Geth-compatible (best-effort) debug API (Potentially UNSAFE)
/// NOTE We don't aim to support all methods, only the ones that are useful.
Debug,
}
impl FromStr for Api {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
use self::Api::*;
match s {
"debug" => Ok(Debug),
"eth" => Ok(Eth),
"net" => Ok(Net),
"parity" => Ok(Parity),
"parity_accounts" => Ok(ParityAccounts),
"parity_pubsub" => Ok(ParityPubSub),
"parity_set" => Ok(ParitySet),
"personal" => Ok(Personal),
"pubsub" => Ok(EthPubSub),
"rpc" => Ok(Rpc),
"secretstore" => Ok(SecretStore),
"signer" => Ok(Signer),
"traces" => Ok(Traces),
"web3" => Ok(Web3),
api => Err(format!("Unknown api: {}", api)),
}
}
}
#[derive(Debug, Clone)]
pub enum ApiSet {
// Unsafe context (like jsonrpc over http)
UnsafeContext,
// All possible APIs (safe context like token-protected WS interface)
All,
// Local "unsafe" context and accounts access
IpcContext,
// APIs for Parity Generic Pub-Sub
PubSub,
// Fixed list of APis
List(HashSet<Api>),
}
impl Default for ApiSet {
fn default() -> Self {
ApiSet::UnsafeContext
}
}
impl PartialEq for ApiSet {
fn eq(&self, other: &Self) -> bool {
self.list_apis() == other.list_apis()
}
}
impl FromStr for ApiSet {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let mut apis = HashSet::new();
for api in s.split(',') {
match api {
"all" => {
apis.extend(ApiSet::All.list_apis());
}
"safe" => {
// Safe APIs are those that are safe even in UnsafeContext.
apis.extend(ApiSet::UnsafeContext.list_apis());
}
// Remove the API
api if api.starts_with("-") => {
let api = api[1..].parse()?;
apis.remove(&api);
}
api => {
let api = api.parse()?;
apis.insert(api);
}
}
}
Ok(ApiSet::List(apis))
}
}
fn to_modules(apis: &HashSet<Api>) -> BTreeMap<String, String> {
let mut modules = BTreeMap::new();
for api in apis {
let (name, version) = match *api {
Api::Debug => ("debug", "1.0"),
Api::Eth => ("eth", "1.0"),
Api::EthPubSub => ("pubsub", "1.0"),
Api::Net => ("net", "1.0"),
Api::Parity => ("parity", "1.0"),
Api::ParityAccounts => ("parity_accounts", "1.0"),
Api::ParityPubSub => ("parity_pubsub", "1.0"),
Api::ParitySet => ("parity_set", "1.0"),
Api::Personal => ("personal", "1.0"),
Api::Rpc => ("rpc", "1.0"),
Api::SecretStore => ("secretstore", "1.0"),
Api::Signer => ("signer", "1.0"),
Api::Traces => ("traces", "1.0"),
Api::Web3 => ("web3", "1.0"),
};
modules.insert(name.into(), version.into());
}
modules
}
macro_rules! add_signing_methods {
($namespace:ident, $handler:expr, $deps:expr, $dispatch:expr) => {{
let deps = &$deps;
let (dispatcher, accounts) = $dispatch;
if deps.signer_service.is_enabled() {
$handler.extend_with($namespace::to_delegate(SigningQueueClient::new(
&deps.signer_service,
dispatcher.clone(),
deps.executor.clone(),
accounts,
)))
} else {
$handler.extend_with($namespace::to_delegate(SigningUnsafeClient::new(
accounts,
dispatcher.clone(),
)))
}
}};
}
/// RPC dependencies can be used to initialize RPC endpoints from APIs.
pub trait Dependencies {
type Notifier: ActivityNotifier;
/// Create the activity notifier.
fn activity_notifier(&self) -> Self::Notifier;
/// Extend the given I/O handler with endpoints for each API.
fn extend_with_set<S>(&self, handler: &mut MetaIoHandler<Metadata, S>, apis: &HashSet<Api>)
where
S: core::Middleware<Metadata>;
}
/// RPC dependencies for a full node.
pub struct FullDependencies {
pub signer_service: Arc<SignerService>,
pub client: Arc<Client>,
pub snapshot: Arc<dyn SnapshotService>,
pub sync: Arc<dyn SyncProvider>,
pub net: Arc<dyn ManageNetwork>,
pub accounts: Arc<AccountProvider>,
pub miner: Arc<Miner>,
pub external_miner: Arc<ExternalMiner>,
pub logger: Arc<RotatingLogger>,
pub settings: Arc<NetworkSettings>,
pub net_service: Arc<dyn ManageNetwork>,
pub experimental_rpcs: bool,
pub ws_address: Option<Host>,
pub fetch: FetchClient,
pub executor: Executor,
pub gas_price_percentile: usize,
pub poll_lifetime: u32,
pub allow_missing_blocks: bool,
pub no_ancient_blocks: bool,
}
impl FullDependencies {
fn extend_api<S>(
&self,
handler: &mut MetaIoHandler<Metadata, S>,
apis: &HashSet<Api>,
for_generic_pubsub: bool,
) where
S: core::Middleware<Metadata>,
{
use parity_rpc::v1::*;
let nonces = Arc::new(Mutex::new(dispatch::Reservations::new(
self.executor.clone(),
)));
let dispatcher = FullDispatcher::new(
self.client.clone(),
self.miner.clone(),
nonces.clone(),
self.gas_price_percentile,
);
let account_signer = Arc::new(dispatch::Signer::new(self.accounts.clone())) as _;
let accounts = account_utils::accounts_list(self.accounts.clone());
for api in apis {
match *api {
Api::Debug => {
handler.extend_with(DebugClient::new(self.client.clone()).to_delegate());
}
Api::Web3 => {
handler.extend_with(Web3Client::default().to_delegate());
}
Api::Net => {
handler.extend_with(NetClient::new(&self.sync).to_delegate());
}
Api::Eth => {
let client = EthClient::new(
&self.client,
&self.snapshot,
&self.sync,
&accounts,
&self.miner,
&self.external_miner,
EthClientOptions {
gas_price_percentile: self.gas_price_percentile,
allow_missing_blocks: self.allow_missing_blocks,
allow_experimental_rpcs: self.experimental_rpcs,
no_ancient_blocks: self.no_ancient_blocks,
},
);
handler.extend_with(client.to_delegate());
if !for_generic_pubsub {
let filter_client = EthFilterClient::new(
self.client.clone(),
self.miner.clone(),
self.poll_lifetime,
);
handler.extend_with(filter_client.to_delegate());
add_signing_methods!(
EthSigning,
handler,
self,
(&dispatcher, &account_signer)
);
}
}
Api::EthPubSub => {
if !for_generic_pubsub {
let client =
EthPubSubClient::new(self.client.clone(), self.executor.clone());
let h = client.handler();
self.miner
.add_transactions_listener(Box::new(move |hashes| {
if let Some(h) = h.upgrade() {
h.notify_new_transactions(hashes);
}
}));
if let Some(h) = client.handler().upgrade() {
self.client.add_notify(h);
}
handler.extend_with(client.to_delegate());
}
}
Api::Personal => {
#[cfg(feature = "accounts")]
handler.extend_with(
PersonalClient::new(
&self.accounts,
dispatcher.clone(),
self.experimental_rpcs,
)
.to_delegate(),
);
}
Api::Signer => {
handler.extend_with(
SignerClient::new(
account_signer.clone(),
dispatcher.clone(),
&self.signer_service,
self.executor.clone(),
)
.to_delegate(),
);
}
Api::Parity => {
let signer = match self.signer_service.is_enabled() {
true => Some(self.signer_service.clone()),
false => None,
};
handler.extend_with(
ParityClient::new(
self.client.clone(),
self.miner.clone(),
self.sync.clone(),
self.net_service.clone(),
self.logger.clone(),
self.settings.clone(),
signer,
self.ws_address.clone(),
self.snapshot.clone().into(),
)
.to_delegate(),
);
#[cfg(feature = "accounts")]
handler.extend_with(ParityAccountsInfo::to_delegate(
ParityAccountsClient::new(&self.accounts),
));
if !for_generic_pubsub {
add_signing_methods!(
ParitySigning,
handler,
self,
(&dispatcher, &account_signer)
);
}
}
Api::ParityPubSub => {
if !for_generic_pubsub {
let mut rpc = MetaIoHandler::default();
let apis = ApiSet::List(apis.clone())
.retain(ApiSet::PubSub)
.list_apis();
self.extend_api(&mut rpc, &apis, true);
handler.extend_with(
PubSubClient::new(rpc, self.executor.clone()).to_delegate(),
);
}
}
Api::ParityAccounts => {
#[cfg(feature = "accounts")]
handler.extend_with(ParityAccounts::to_delegate(ParityAccountsClient::new(
&self.accounts,
)));
}
Api::ParitySet => {
handler.extend_with(
ParitySetClient::new(
&self.client,
&self.miner,
&self.net_service,
self.fetch.clone(),
)
.to_delegate(),
);
#[cfg(feature = "accounts")]
handler.extend_with(
ParitySetAccountsClient::new(&self.accounts, &self.miner).to_delegate(),
);
}
Api::Traces => handler.extend_with(TracesClient::new(&self.client).to_delegate()),
Api::Rpc => {
let modules = to_modules(&apis);
handler.extend_with(RpcClient::new(modules).to_delegate());
}
Api::SecretStore => {
#[cfg(feature = "accounts")]
handler.extend_with(SecretStoreClient::new(&self.accounts).to_delegate());
}
}
}
}
}
impl Dependencies for FullDependencies {
type Notifier = ClientNotifier;
fn activity_notifier(&self) -> ClientNotifier {
ClientNotifier {
client: self.client.clone(),
}
}
fn extend_with_set<S>(&self, handler: &mut MetaIoHandler<Metadata, S>, apis: &HashSet<Api>)
where
S: core::Middleware<Metadata>,
{
self.extend_api(handler, apis, false)
}
}
impl ApiSet {
/// Retains only APIs in given set.
pub fn retain(self, set: Self) -> Self {
ApiSet::List(&self.list_apis() & &set.list_apis())
}
pub fn list_apis(&self) -> HashSet<Api> {
let mut public_list: HashSet<Api> = [
Api::Web3,
Api::Net,
Api::Eth,
Api::EthPubSub,
Api::Parity,
Api::Rpc,
]
.iter()
.cloned()
.collect();
match *self {
ApiSet::List(ref apis) => apis.clone(),
ApiSet::UnsafeContext => {
public_list.insert(Api::Traces);
public_list.insert(Api::ParityPubSub);
public_list
}
ApiSet::IpcContext => {
public_list.insert(Api::Traces);
public_list.insert(Api::ParityPubSub);
public_list.insert(Api::ParityAccounts);
public_list
}
ApiSet::All => {
public_list.insert(Api::Debug);
public_list.insert(Api::Traces);
public_list.insert(Api::ParityPubSub);
public_list.insert(Api::ParityAccounts);
public_list.insert(Api::ParitySet);
public_list.insert(Api::Signer);
public_list.insert(Api::Personal);
public_list.insert(Api::SecretStore);
public_list
}
ApiSet::PubSub => [
Api::Eth,
Api::Parity,
Api::ParityAccounts,
Api::ParitySet,
Api::Traces,
]
.iter()
.cloned()
.collect(),
}
}
}
#[cfg(test)]
mod test {
use super::{Api, ApiSet};
#[test]
fn test_api_parsing() {
assert_eq!(Api::Debug, "debug".parse().unwrap());
assert_eq!(Api::Web3, "web3".parse().unwrap());
assert_eq!(Api::Net, "net".parse().unwrap());
assert_eq!(Api::Eth, "eth".parse().unwrap());
assert_eq!(Api::EthPubSub, "pubsub".parse().unwrap());
assert_eq!(Api::Personal, "personal".parse().unwrap());
assert_eq!(Api::Signer, "signer".parse().unwrap());
assert_eq!(Api::Parity, "parity".parse().unwrap());
assert_eq!(Api::ParityAccounts, "parity_accounts".parse().unwrap());
assert_eq!(Api::ParitySet, "parity_set".parse().unwrap());
assert_eq!(Api::Traces, "traces".parse().unwrap());
assert_eq!(Api::Rpc, "rpc".parse().unwrap());
assert_eq!(Api::SecretStore, "secretstore".parse().unwrap());
assert!("rp".parse::<Api>().is_err());
}
#[test]
fn test_api_set_default() {
assert_eq!(ApiSet::UnsafeContext, ApiSet::default());
}
#[test]
fn test_api_set_parsing() {
assert_eq!(
ApiSet::List(vec![Api::Web3, Api::Eth].into_iter().collect()),
"web3,eth".parse().unwrap()
);
}
#[test]
fn test_api_set_unsafe_context() {
let expected = vec![
// make sure this list contains only SAFE methods
Api::Web3,
Api::Net,
Api::Eth,
Api::EthPubSub,
Api::Parity,
Api::ParityPubSub,
Api::Traces,
Api::Rpc,
]
.into_iter()
.collect();
assert_eq!(ApiSet::UnsafeContext.list_apis(), expected);
}
#[test]
fn test_api_set_ipc_context() {
let expected = vec![
// safe
Api::Web3,
Api::Net,
Api::Eth,
Api::EthPubSub,
Api::Parity,
Api::ParityPubSub,
Api::Traces,
Api::Rpc,
// semi-safe
Api::ParityAccounts,
]
.into_iter()
.collect();
assert_eq!(ApiSet::IpcContext.list_apis(), expected);
}
#[test]
fn test_all_apis() {
assert_eq!(
"all".parse::<ApiSet>().unwrap(),
ApiSet::List(
vec![
Api::Web3,
Api::Net,
Api::Eth,
Api::EthPubSub,
Api::Parity,
Api::ParityPubSub,
Api::Traces,
Api::Rpc,
Api::SecretStore,
Api::ParityAccounts,
Api::ParitySet,
Api::Signer,
Api::Personal,
Api::Debug,
]
.into_iter()
.collect()
)
);
}
#[test]
fn test_all_without_personal_apis() {
assert_eq!(
"personal,all,-personal".parse::<ApiSet>().unwrap(),
ApiSet::List(
vec![
Api::Web3,
Api::Net,
Api::Eth,
Api::EthPubSub,
Api::Parity,
Api::ParityPubSub,
Api::Traces,
Api::Rpc,
Api::SecretStore,
Api::ParityAccounts,
Api::ParitySet,
Api::Signer,
Api::Debug,
]
.into_iter()
.collect()
)
);
}
#[test]
fn test_safe_parsing() {
assert_eq!(
"safe".parse::<ApiSet>().unwrap(),
ApiSet::List(
vec![
Api::Web3,
Api::Net,
Api::Eth,
Api::EthPubSub,
Api::Parity,
Api::ParityPubSub,
Api::Traces,
Api::Rpc,
]
.into_iter()
.collect()
)
);
}
}

751
bin/oe/run.rs Normal file
View File

@ -0,0 +1,751 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::{
any::Any,
str::FromStr,
sync::{atomic, Arc, Weak},
thread,
time::{Duration, Instant},
};
use crate::{
account_utils,
cache::CacheConfig,
db,
helpers::{execute_upgrades, passwords_from_files, to_client_config},
informant::{FullNodeInformantData, Informant},
metrics::{start_prometheus_metrics, MetricsConfiguration},
miner::{external::ExternalMiner, work_notify::WorkPoster},
modules,
params::{
fatdb_switch_to_bool, mode_switch_to_bool, tracing_switch_to_bool, AccountsConfig,
GasPricerConfig, MinerExtras, Pruning, SpecType, Switch,
},
rpc, rpc_apis, secretstore, signer,
sync::{self, SyncConfig},
user_defaults::UserDefaults,
};
use ansi_term::Colour;
use dir::{DatabaseDirectories, Directories};
use ethcore::{
client::{BlockChainClient, BlockInfo, Client, DatabaseCompactionProfile, Mode, VMType},
miner::{self, stratum, Miner, MinerOptions, MinerService},
snapshot::{self, SnapshotConfiguration},
verification::queue::VerifierSettings,
};
use ethcore_logger::{Config as LogConfig, RotatingLogger};
use ethcore_service::ClientService;
use ethereum_types::{H256, U64};
use journaldb::Algorithm;
use jsonrpc_core;
use node_filter::NodeFilter;
use parity_rpc::{
informant, is_major_importing, FutureOutput, FutureResponse, FutureResult, Metadata,
NetworkSettings, Origin, PubSubSession,
};
use parity_runtime::Runtime;
use parity_version::version;
// How often we attempt to take a snapshot: only snapshot on blocknumbers that are multiples of this.
const SNAPSHOT_PERIOD: u64 = 20000;
// Start snapshoting from `tip`-`history, with this we want to bypass reorgs. Should be smaller than prunning history.
const SNAPSHOT_HISTORY: u64 = 50;
// Full client number of DNS threads
const FETCH_FULL_NUM_DNS_THREADS: usize = 4;
#[derive(Debug, PartialEq)]
pub struct RunCmd {
pub cache_config: CacheConfig,
pub dirs: Directories,
pub spec: SpecType,
pub pruning: Pruning,
pub pruning_history: u64,
pub pruning_memory: usize,
/// Some if execution should be daemonized. Contains pid_file path.
pub daemon: Option<String>,
pub logger_config: LogConfig,
pub miner_options: MinerOptions,
pub gas_price_percentile: usize,
pub poll_lifetime: u32,
pub ws_conf: rpc::WsConfiguration,
pub http_conf: rpc::HttpConfiguration,
pub ipc_conf: rpc::IpcConfiguration,
pub net_conf: sync::NetworkConfiguration,
pub network_id: Option<u64>,
pub warp_sync: bool,
pub warp_barrier: Option<u64>,
pub acc_conf: AccountsConfig,
pub gas_pricer_conf: GasPricerConfig,
pub miner_extras: MinerExtras,
pub mode: Option<Mode>,
pub tracing: Switch,
pub fat_db: Switch,
pub compaction: DatabaseCompactionProfile,
pub vm_type: VMType,
pub experimental_rpcs: bool,
pub net_settings: NetworkSettings,
pub secretstore_conf: secretstore::Configuration,
pub name: String,
pub custom_bootnodes: bool,
pub stratum: Option<stratum::Options>,
pub snapshot_conf: SnapshotConfiguration,
pub check_seal: bool,
pub allow_missing_blocks: bool,
pub download_old_blocks: bool,
pub verifier_settings: VerifierSettings,
pub no_persistent_txqueue: bool,
pub max_round_blocks_to_import: usize,
pub metrics_conf: MetricsConfiguration,
}
// node info fetcher for the local store.
struct FullNodeInfo {
miner: Option<Arc<Miner>>, // TODO: only TXQ needed, just use that after decoupling.
}
impl crate::local_store::NodeInfo for FullNodeInfo {
fn pending_transactions(&self) -> Vec<crate::types::transaction::PendingTransaction> {
let miner = match self.miner.as_ref() {
Some(m) => m,
None => return Vec::new(),
};
miner
.local_transactions()
.values()
.filter_map(|status| match *status {
crate::miner::pool::local_transactions::Status::Pending(ref tx) => {
Some(tx.pending().clone())
}
_ => None,
})
.collect()
}
}
/// Executes the given run command.
///
/// On error, returns what to print on stderr.
pub fn execute(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<RunningClient, String> {
// load spec
let spec = cmd.spec.spec(&cmd.dirs.cache)?;
// load genesis hash
let genesis_hash = spec.genesis_header().hash();
// database paths
let db_dirs = cmd.dirs.database(
genesis_hash,
cmd.spec.legacy_fork_name(),
spec.data_dir.clone(),
);
// user defaults path
let user_defaults_path = db_dirs.user_defaults_path();
// load user defaults
let mut user_defaults = UserDefaults::load(&user_defaults_path)?;
// select pruning algorithm
let algorithm = cmd.pruning.to_algorithm(&user_defaults);
// check if tracing is on
let tracing = tracing_switch_to_bool(cmd.tracing, &user_defaults)?;
// check if fatdb is on
let fat_db = fatdb_switch_to_bool(cmd.fat_db, &user_defaults, algorithm)?;
// get the mode
let mode = mode_switch_to_bool(cmd.mode, &user_defaults)?;
trace!(target: "mode", "mode is {:?}", mode);
let network_enabled = match mode {
Mode::Dark(_) | Mode::Off => false,
_ => true,
};
// prepare client and snapshot paths.
let client_path = db_dirs.client_path(algorithm);
let snapshot_path = db_dirs.snapshot_path();
// execute upgrades
execute_upgrades(&cmd.dirs.base, &db_dirs, algorithm, &cmd.compaction)?;
// create dirs used by parity
cmd.dirs.create_dirs(
cmd.acc_conf.unlocked_accounts.len() == 0,
cmd.secretstore_conf.enabled,
)?;
//print out running parity environment
print_running_environment(&spec.data_dir, &cmd.dirs, &db_dirs);
// display info about used pruning algorithm
info!(
"State DB configuration: {}{}{}",
Colour::White.bold().paint(algorithm.as_str()),
match fat_db {
true => Colour::White.bold().paint(" +Fat").to_string(),
false => "".to_owned(),
},
match tracing {
true => Colour::White.bold().paint(" +Trace").to_string(),
false => "".to_owned(),
}
);
info!(
"Operating mode: {}",
Colour::White.bold().paint(format!("{}", mode))
);
// display warning about using experimental journaldb algorithm
if !algorithm.is_stable() {
warn!(
"Your chosen strategy is {}! You can re-run with --pruning to change.",
Colour::Red.bold().paint("unstable")
);
}
// create sync config
let mut sync_config = SyncConfig::default();
sync_config.network_id = match cmd.network_id {
Some(id) => id,
None => spec.network_id(),
};
if spec.subprotocol_name().len() > 8 {
warn!("Your chain specification's subprotocol length is more then 8. Ignoring.");
} else {
sync_config.subprotocol_name = U64::from(spec.subprotocol_name().as_bytes())
}
sync_config.fork_block = spec.fork_block();
let mut warp_sync = spec.engine.supports_warp() && cmd.warp_sync;
if warp_sync {
// Logging is not initialized yet, so we print directly to stderr
if fat_db {
warn!("Warning: Warp Sync is disabled because Fat DB is turned on.");
warp_sync = false;
} else if tracing {
warn!("Warning: Warp Sync is disabled because tracing is turned on.");
warp_sync = false;
} else if algorithm != Algorithm::OverlayRecent {
warn!("Warning: Warp Sync is disabled because of non-default pruning mode.");
warp_sync = false;
}
}
sync_config.warp_sync = match (warp_sync, cmd.warp_barrier) {
(true, Some(block)) => sync::WarpSync::OnlyAndAfter(block),
(true, _) => sync::WarpSync::Enabled,
_ => sync::WarpSync::Disabled,
};
sync_config.download_old_blocks = cmd.download_old_blocks;
sync_config.eip1559_transition = spec.params().eip1559_transition;
let passwords = passwords_from_files(&cmd.acc_conf.password_files)?;
// prepare account provider
let account_provider = Arc::new(account_utils::prepare_account_provider(
&cmd.spec,
&cmd.dirs,
&spec.data_dir,
cmd.acc_conf,
&passwords,
)?);
// spin up event loop
let runtime = Runtime::with_default_thread_count();
// fetch service
let fetch = fetch::Client::new(FETCH_FULL_NUM_DNS_THREADS)
.map_err(|e| format!("Error starting fetch client: {:?}", e))?;
let txpool_size = cmd.miner_options.pool_limits.max_count;
// create miner
let miner = Arc::new(Miner::new(
cmd.miner_options,
cmd.gas_pricer_conf
.to_gas_pricer(fetch.clone(), runtime.executor()),
&spec,
(
cmd.miner_extras.local_accounts,
account_utils::miner_local_accounts(account_provider.clone()),
),
));
miner.set_author(miner::Author::External(cmd.miner_extras.author));
miner.set_gas_range_target(cmd.miner_extras.gas_range_target);
miner.set_extra_data(cmd.miner_extras.extra_data);
if !cmd.miner_extras.work_notify.is_empty() {
miner.add_work_listener(Box::new(WorkPoster::new(
&cmd.miner_extras.work_notify,
fetch.clone(),
runtime.executor(),
)));
}
let engine_signer = cmd.miner_extras.engine_signer;
if engine_signer != Default::default() {
if let Some(author) = account_utils::miner_author(
&cmd.spec,
&cmd.dirs,
&account_provider,
engine_signer,
&passwords,
)? {
miner.set_author(author);
}
}
// create client config
let mut client_config = to_client_config(
&cmd.cache_config,
spec.name.to_lowercase(),
mode.clone(),
tracing,
fat_db,
cmd.compaction,
cmd.vm_type,
cmd.name,
algorithm,
cmd.pruning_history,
cmd.pruning_memory,
cmd.check_seal,
cmd.max_round_blocks_to_import,
);
client_config.queue.verifier_settings = cmd.verifier_settings;
client_config.queue.verifier_settings.bad_hashes = verification_bad_blocks(&cmd.spec);
client_config.transaction_verification_queue_size = ::std::cmp::max(2048, txpool_size / 4);
client_config.snapshot = cmd.snapshot_conf.clone();
// set up bootnodes
let mut net_conf = cmd.net_conf;
if !cmd.custom_bootnodes {
net_conf.boot_nodes = spec.nodes.clone();
}
// set network path.
net_conf.net_config_path = Some(db_dirs.network_path().to_string_lossy().into_owned());
let restoration_db_handler = db::restoration_db_handler(&client_path, &client_config);
let client_db = restoration_db_handler
.open(&client_path)
.map_err(|e| format!("Failed to open database {:?}", e))?;
// create client service.
let service = ClientService::start(
client_config,
&spec,
client_db,
&snapshot_path,
restoration_db_handler,
&cmd.dirs.ipc_path(),
miner.clone(),
)
.map_err(|e| format!("Client service error: {:?}", e))?;
let connection_filter_address = spec.params().node_permission_contract;
// drop the spec to free up genesis state.
let forks = spec.hard_forks.clone();
drop(spec);
// take handle to client
let client = service.client();
// Update miners block gas limit and base_fee
let base_fee = client
.engine()
.calculate_base_fee(&client.best_block_header());
let allow_non_eoa_sender = client
.engine()
.allow_non_eoa_sender(client.best_block_header().number() + 1);
miner.update_transaction_queue_limits(
*client.best_block_header().gas_limit(),
base_fee,
allow_non_eoa_sender,
);
let connection_filter = connection_filter_address.map(|a| {
Arc::new(NodeFilter::new(
Arc::downgrade(&client) as Weak<dyn BlockChainClient>,
a,
))
});
let snapshot_service = service.snapshot_service();
// initialize the local node information store.
let store = {
let db = service.db();
let node_info = FullNodeInfo {
miner: match cmd.no_persistent_txqueue {
true => None,
false => Some(miner.clone()),
},
};
let store = crate::local_store::create(
db.key_value().clone(),
::ethcore_db::COL_NODE_INFO,
node_info,
);
if cmd.no_persistent_txqueue {
info!("Running without a persistent transaction queue.");
if let Err(e) = store.clear() {
warn!("Error clearing persistent transaction queue: {}", e);
}
}
// re-queue pending transactions.
match store.pending_transactions() {
Ok(pending) => {
for pending_tx in pending {
if let Err(e) = miner.import_own_transaction(&*client, pending_tx) {
warn!("Error importing saved transaction: {}", e)
}
}
}
Err(e) => warn!("Error loading cached pending transactions from disk: {}", e),
}
Arc::new(store)
};
// register it as an IO service to update periodically.
service
.register_io_handler(store)
.map_err(|_| "Unable to register local store handler".to_owned())?;
// create external miner
let external_miner = Arc::new(ExternalMiner::default());
// start stratum
if let Some(ref stratum_config) = cmd.stratum {
stratum::Stratum::register(stratum_config, miner.clone(), Arc::downgrade(&client))
.map_err(|e| format!("Stratum start error: {:?}", e))?;
}
// create sync object
let (sync_provider, manage_network, chain_notify, priority_tasks) = modules::sync(
sync_config,
net_conf.clone().into(),
client.clone(),
forks,
snapshot_service.clone(),
&cmd.logger_config,
connection_filter
.clone()
.map(|f| f as Arc<dyn crate::sync::ConnectionFilter + 'static>),
)
.map_err(|e| format!("Sync error: {}", e))?;
service.add_notify(chain_notify.clone());
// Propagate transactions as soon as they are imported.
let tx = ::parking_lot::Mutex::new(priority_tasks);
let is_ready = Arc::new(atomic::AtomicBool::new(true));
miner.add_transactions_listener(Box::new(move |_hashes| {
// we want to have only one PendingTransactions task in the queue.
if is_ready
.compare_exchange(
true,
false,
atomic::Ordering::SeqCst,
atomic::Ordering::SeqCst,
)
.is_ok()
{
let task =
crate::sync::PriorityTask::PropagateTransactions(Instant::now(), is_ready.clone());
// we ignore error cause it means that we are closing
let _ = tx.lock().send(task);
}
}));
// start network
if network_enabled {
chain_notify.start();
}
// set up dependencies for rpc servers
let rpc_stats = Arc::new(informant::RpcStats::default());
let secret_store = account_provider.clone();
let signer_service = Arc::new(signer::new_service(&cmd.ws_conf, &cmd.logger_config));
let deps_for_rpc_apis = Arc::new(rpc_apis::FullDependencies {
signer_service: signer_service,
snapshot: snapshot_service.clone(),
client: client.clone(),
sync: sync_provider.clone(),
net: manage_network.clone(),
accounts: secret_store,
miner: miner.clone(),
external_miner: external_miner.clone(),
logger: logger.clone(),
settings: Arc::new(cmd.net_settings.clone()),
net_service: manage_network.clone(),
experimental_rpcs: cmd.experimental_rpcs,
ws_address: cmd.ws_conf.address(),
fetch: fetch.clone(),
executor: runtime.executor(),
gas_price_percentile: cmd.gas_price_percentile,
poll_lifetime: cmd.poll_lifetime,
allow_missing_blocks: cmd.allow_missing_blocks,
no_ancient_blocks: !cmd.download_old_blocks,
});
let dependencies = rpc::Dependencies {
apis: deps_for_rpc_apis.clone(),
executor: runtime.executor(),
stats: rpc_stats.clone(),
};
// start rpc servers
let rpc_direct = rpc::setup_apis(rpc_apis::ApiSet::All, &dependencies);
let ws_server = rpc::new_ws(cmd.ws_conf.clone(), &dependencies)?;
let ipc_server = rpc::new_ipc(cmd.ipc_conf, &dependencies)?;
// start the prometheus metrics server
start_prometheus_metrics(&cmd.metrics_conf, &dependencies)?;
let http_server = rpc::new_http(
"HTTP JSON-RPC",
"jsonrpc",
cmd.http_conf.clone(),
&dependencies,
)?;
// secret store key server
let secretstore_deps = secretstore::Dependencies {
client: client.clone(),
sync: sync_provider.clone(),
miner: miner.clone(),
account_provider,
accounts_passwords: &passwords,
};
let secretstore_key_server = secretstore::start(
cmd.secretstore_conf.clone(),
secretstore_deps,
runtime.executor(),
)?;
// the informant
let informant = Arc::new(Informant::new(
FullNodeInformantData {
client: service.client(),
sync: Some(sync_provider.clone()),
net: Some(manage_network.clone()),
},
Some(snapshot_service.clone()),
Some(rpc_stats.clone()),
cmd.logger_config.color,
));
service.add_notify(informant.clone());
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;
user_defaults.set_mode(mode);
user_defaults.save(&user_defaults_path)?;
// tell client how to save the default mode if it gets changed.
client.on_user_defaults_change(move |mode: Option<Mode>| {
if let Some(mode) = mode {
user_defaults.set_mode(mode);
}
let _ = user_defaults.save(&user_defaults_path); // discard failures - there's nothing we can do
});
// the watcher must be kept alive.
let watcher = match cmd.snapshot_conf.enable {
false => None,
true => {
let sync = sync_provider.clone();
let client = client.clone();
let watcher = Arc::new(snapshot::Watcher::new(
service.client(),
move || is_major_importing(Some(sync.status().state), client.queue_info()),
service.io().channel(),
SNAPSHOT_PERIOD,
SNAPSHOT_HISTORY,
));
service.add_notify(watcher.clone());
Some(watcher)
}
};
Ok(RunningClient {
inner: RunningClientInner::Full {
rpc: rpc_direct,
informant,
client,
client_service: Arc::new(service),
keep_alive: Box::new((
watcher,
ws_server,
http_server,
ipc_server,
secretstore_key_server,
runtime,
)),
},
})
}
/// Set bad blocks in VerificationQeueu. By omiting header we can omit particular fork of chain.
fn verification_bad_blocks(spec: &SpecType) -> Vec<H256> {
match *spec {
SpecType::Ropsten => {
vec![
H256::from_str("1eac3d16c642411f13c287e29144c6f58fda859407c8f24c38deb168e1040714")
.expect("Valid hex string"),
]
}
_ => vec![],
}
}
/// Parity client currently executing in background threads.
///
/// Should be destroyed by calling `shutdown()`, otherwise execution will continue in the
/// background.
pub struct RunningClient {
inner: RunningClientInner,
}
enum RunningClientInner {
Full {
rpc:
jsonrpc_core::MetaIoHandler<Metadata, informant::Middleware<informant::ClientNotifier>>,
informant: Arc<Informant<FullNodeInformantData>>,
client: Arc<Client>,
client_service: Arc<ClientService>,
keep_alive: Box<dyn Any>,
},
}
impl RunningClient {
/// Performs an asynchronous RPC query.
// FIXME: [tomaka] This API should be better, with for example a Future
pub fn rpc_query(
&self,
request: &str,
session: Option<Arc<PubSubSession>>,
) -> FutureResult<FutureResponse, FutureOutput> {
let metadata = Metadata {
origin: Origin::CApi,
session,
};
match self.inner {
RunningClientInner::Full { ref rpc, .. } => rpc.handle_request(request, metadata),
}
}
/// Shuts down the client.
pub fn shutdown(self) {
match self.inner {
RunningClientInner::Full {
rpc,
informant,
client,
client_service,
keep_alive,
} => {
info!("Finishing work, please wait...");
// Create a weak reference to the client so that we can wait on shutdown
// until it is dropped
let weak_client = Arc::downgrade(&client);
// Shutdown and drop the ClientService
client_service.shutdown();
trace!(target: "shutdown", "ClientService shut down");
drop(client_service);
trace!(target: "shutdown", "ClientService dropped");
// drop this stuff as soon as exit detected.
drop(rpc);
trace!(target: "shutdown", "RPC dropped");
drop(keep_alive);
trace!(target: "shutdown", "KeepAlive dropped");
// to make sure timer does not spawn requests while shutdown is in progress
informant.shutdown();
trace!(target: "shutdown", "Informant shut down");
// just Arc is dropping here, to allow other reference release in its default time
drop(informant);
trace!(target: "shutdown", "Informant dropped");
drop(client);
trace!(target: "shutdown", "Client dropped");
// This may help when debugging ref cycles. Requires nightly-only `#![feature(weak_counts)]`
// trace!(target: "shutdown", "Waiting for refs to Client to shutdown, strong_count={:?}, weak_count={:?}", weak_client.strong_count(), weak_client.weak_count());
trace!(target: "shutdown", "Waiting for refs to Client to shutdown");
wait_for_drop(weak_client);
}
}
}
}
fn print_running_environment(data_dir: &str, dirs: &Directories, db_dirs: &DatabaseDirectories) {
info!("Starting {}", Colour::White.bold().paint(version()));
info!(
"Keys path {}",
Colour::White
.bold()
.paint(dirs.keys_path(data_dir).to_string_lossy().into_owned())
);
info!(
"DB path {}",
Colour::White
.bold()
.paint(db_dirs.db_root_path().to_string_lossy().into_owned())
);
}
fn wait_for_drop<T>(w: Weak<T>) {
const SLEEP_DURATION: Duration = Duration::from_secs(1);
const WARN_TIMEOUT: Duration = Duration::from_secs(60);
const MAX_TIMEOUT: Duration = Duration::from_secs(300);
let instant = Instant::now();
let mut warned = false;
while instant.elapsed() < MAX_TIMEOUT {
if w.upgrade().is_none() {
return;
}
if !warned && instant.elapsed() > WARN_TIMEOUT {
warned = true;
warn!("Shutdown is taking longer than expected.");
}
thread::sleep(SLEEP_DURATION);
// When debugging shutdown issues on a nightly build it can help to enable this with the
// `#![feature(weak_counts)]` added to lib.rs (TODO: enable when
// https://github.com/rust-lang/rust/issues/57977 is stable)
// trace!(target: "shutdown", "Waiting for client to drop, strong_count={:?}, weak_count={:?}", w.strong_count(), w.weak_count());
trace!(target: "shutdown", "Waiting for client to drop");
}
warn!("Shutdown timeout reached, exiting uncleanly.");
}

333
bin/oe/secretstore.rs Normal file
View File

@ -0,0 +1,333 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use crate::{account_utils::AccountProvider, sync::SyncProvider};
use crypto::publickey::{Public, Secret};
use dir::{default_data_path, helpers::replace_home};
use ethcore::{client::Client, miner::Miner};
use ethereum_types::Address;
use ethkey::Password;
use parity_runtime::Executor;
use std::{collections::BTreeMap, sync::Arc};
/// This node secret key.
#[derive(Debug, PartialEq, Clone)]
pub enum NodeSecretKey {
/// Stored as plain text in configuration file.
Plain(Secret),
/// Stored as account in key store.
#[cfg(feature = "accounts")]
KeyStore(Address),
}
/// Secret store service contract address.
#[derive(Debug, PartialEq, Clone)]
pub enum ContractAddress {
/// Contract address is read from registry.
Registry,
/// Contract address is specified.
Address(Address),
}
#[derive(Debug, PartialEq, Clone)]
/// Secret store configuration
pub struct Configuration {
/// Is secret store functionality enabled?
pub enabled: bool,
/// Is HTTP API enabled?
pub http_enabled: bool,
/// Is auto migrate enabled.
pub auto_migrate_enabled: bool,
/// ACL check contract address.
pub acl_check_contract_address: Option<ContractAddress>,
/// Service contract address.
pub service_contract_address: Option<ContractAddress>,
/// Server key generation service contract address.
pub service_contract_srv_gen_address: Option<ContractAddress>,
/// Server key retrieval service contract address.
pub service_contract_srv_retr_address: Option<ContractAddress>,
/// Document key store service contract address.
pub service_contract_doc_store_address: Option<ContractAddress>,
/// Document key shadow retrieval service contract address.
pub service_contract_doc_sretr_address: Option<ContractAddress>,
/// This node secret.
pub self_secret: Option<NodeSecretKey>,
/// Other nodes IDs + addresses.
pub nodes: BTreeMap<Public, (String, u16)>,
/// Key Server Set contract address. If None, 'nodes' map is used.
pub key_server_set_contract_address: Option<ContractAddress>,
/// Interface to listen to
pub interface: String,
/// Port to listen to
pub port: u16,
/// Interface to listen to
pub http_interface: String,
/// Port to listen to
pub http_port: u16,
/// Data directory path for secret store
pub data_path: String,
/// Administrator public key.
pub admin_public: Option<Public>,
}
/// Secret store dependencies
pub struct Dependencies<'a> {
/// Blockchain client.
pub client: Arc<Client>,
/// Sync provider.
pub sync: Arc<dyn SyncProvider>,
/// Miner service.
pub miner: Arc<Miner>,
/// Account provider.
pub account_provider: Arc<AccountProvider>,
/// Passed accounts passwords.
pub accounts_passwords: &'a [Password],
}
#[cfg(not(feature = "secretstore"))]
mod server {
use super::{Configuration, Dependencies, Executor};
/// Noop key server implementation
pub struct KeyServer;
impl KeyServer {
/// Create new noop key server
pub fn new(
_conf: Configuration,
_deps: Dependencies,
_executor: Executor,
) -> Result<Self, String> {
Ok(KeyServer)
}
}
}
#[cfg(feature = "secretstore")]
mod server {
use super::{Configuration, ContractAddress, Dependencies, Executor, NodeSecretKey};
use ansi_term::Colour::{Red, White};
use db;
use ethcore_secretstore;
use ethkey::KeyPair;
use std::sync::Arc;
fn into_service_contract_address(
address: ContractAddress,
) -> ethcore_secretstore::ContractAddress {
match address {
ContractAddress::Registry => ethcore_secretstore::ContractAddress::Registry,
ContractAddress::Address(address) => {
ethcore_secretstore::ContractAddress::Address(address)
}
}
}
/// Key server
pub struct KeyServer {
_key_server: Box<dyn ethcore_secretstore::KeyServer>,
}
impl KeyServer {
/// Create new key server
pub fn new(
mut conf: Configuration,
deps: Dependencies,
executor: Executor,
) -> Result<Self, String> {
let self_secret: Arc<dyn ethcore_secretstore::NodeKeyPair> =
match conf.self_secret.take() {
Some(NodeSecretKey::Plain(secret)) => {
Arc::new(ethcore_secretstore::PlainNodeKeyPair::new(
KeyPair::from_secret(secret)
.map_err(|e| format!("invalid secret: {}", e))?,
))
}
#[cfg(feature = "accounts")]
Some(NodeSecretKey::KeyStore(account)) => {
// Check if account exists
if !deps.account_provider.has_account(account.clone()) {
return Err(format!(
"Account {} passed as secret store node key is not found",
account
));
}
// Check if any passwords have been read from the password file(s)
if deps.accounts_passwords.is_empty() {
return Err(format!(
"No password found for the secret store node account {}",
account
));
}
// Attempt to sign in the engine signer.
let password = deps
.accounts_passwords
.iter()
.find(|p| {
deps.account_provider
.sign(account.clone(), Some((*p).clone()), Default::default())
.is_ok()
})
.ok_or_else(|| {
format!(
"No valid password for the secret store node account {}",
account
)
})?;
Arc::new(
ethcore_secretstore::KeyStoreNodeKeyPair::new(
deps.account_provider,
account,
password.clone(),
)
.map_err(|e| format!("{}", e))?,
)
}
None => return Err("self secret is required when using secretstore".into()),
};
info!(
"Starting SecretStore node: {}",
White.bold().paint(format!("{:?}", self_secret.public()))
);
if conf.acl_check_contract_address.is_none() {
warn!(
"Running SecretStore with disabled ACL check: {}",
Red.bold().paint("everyone has access to stored keys")
);
}
let key_server_name = format!("{}:{}", conf.interface, conf.port);
let mut cconf = ethcore_secretstore::ServiceConfiguration {
listener_address: if conf.http_enabled {
Some(ethcore_secretstore::NodeAddress {
address: conf.http_interface.clone(),
port: conf.http_port,
})
} else {
None
},
service_contract_address: conf
.service_contract_address
.map(into_service_contract_address),
service_contract_srv_gen_address: conf
.service_contract_srv_gen_address
.map(into_service_contract_address),
service_contract_srv_retr_address: conf
.service_contract_srv_retr_address
.map(into_service_contract_address),
service_contract_doc_store_address: conf
.service_contract_doc_store_address
.map(into_service_contract_address),
service_contract_doc_sretr_address: conf
.service_contract_doc_sretr_address
.map(into_service_contract_address),
acl_check_contract_address: conf
.acl_check_contract_address
.map(into_service_contract_address),
cluster_config: ethcore_secretstore::ClusterConfiguration {
listener_address: ethcore_secretstore::NodeAddress {
address: conf.interface.clone(),
port: conf.port,
},
nodes: conf
.nodes
.into_iter()
.map(|(p, (ip, port))| {
(
p,
ethcore_secretstore::NodeAddress {
address: ip,
port: port,
},
)
})
.collect(),
key_server_set_contract_address: conf
.key_server_set_contract_address
.map(into_service_contract_address),
allow_connecting_to_higher_nodes: true,
admin_public: conf.admin_public,
auto_migrate_enabled: conf.auto_migrate_enabled,
},
};
cconf.cluster_config.nodes.insert(
self_secret.public().clone(),
cconf.cluster_config.listener_address.clone(),
);
let db = db::open_secretstore_db(&conf.data_path)?;
let key_server = ethcore_secretstore::start(
deps.client,
deps.sync,
deps.miner,
self_secret,
cconf,
db,
executor,
)
.map_err(|e| format!("Error starting KeyServer {}: {}", key_server_name, e))?;
Ok(KeyServer {
_key_server: key_server,
})
}
}
}
pub use self::server::KeyServer;
impl Default for Configuration {
fn default() -> Self {
let data_dir = default_data_path();
Configuration {
enabled: true,
http_enabled: true,
auto_migrate_enabled: true,
acl_check_contract_address: Some(ContractAddress::Registry),
service_contract_address: None,
service_contract_srv_gen_address: None,
service_contract_srv_retr_address: None,
service_contract_doc_store_address: None,
service_contract_doc_sretr_address: None,
self_secret: None,
admin_public: None,
nodes: BTreeMap::new(),
key_server_set_contract_address: Some(ContractAddress::Registry),
interface: "127.0.0.1".to_owned(),
port: 8083,
http_interface: "127.0.0.1".to_owned(),
http_port: 8082,
data_path: replace_home(&data_dir, "$BASE/secretstore"),
}
}
}
/// Start secret store-related functionality
pub fn start(
conf: Configuration,
deps: Dependencies,
executor: Executor,
) -> Result<Option<KeyServer>, String> {
if !conf.enabled {
return Ok(None);
}
KeyServer::new(conf, deps, executor).map(|s| Some(s))
}

98
bin/oe/signer.rs Normal file
View File

@ -0,0 +1,98 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::{
io,
path::{Path, PathBuf},
};
use crate::{path::restrict_permissions_owner, rpc, rpc_apis};
use ansi_term::Colour::White;
use ethcore_logger::Config as LogConfig;
use parity_rpc;
pub const CODES_FILENAME: &'static str = "authcodes";
pub struct NewToken {
pub token: String,
pub message: String,
}
pub fn new_service(
ws_conf: &rpc::WsConfiguration,
logger_config: &LogConfig,
) -> rpc_apis::SignerService {
let logger_config_color = logger_config.color;
let signer_path = ws_conf.signer_path.clone();
let signer_enabled = ws_conf.support_token_api;
rpc_apis::SignerService::new(
move || {
generate_new_token(&signer_path, logger_config_color).map_err(|e| format!("{:?}", e))
},
signer_enabled,
)
}
pub fn codes_path(path: &Path) -> PathBuf {
let mut p = path.to_owned();
p.push(CODES_FILENAME);
let _ = restrict_permissions_owner(&p, true, false);
p
}
pub fn execute(ws_conf: rpc::WsConfiguration, logger_config: LogConfig) -> Result<String, String> {
Ok(generate_token_and_url(&ws_conf, &logger_config)?.message)
}
pub fn generate_token_and_url(
ws_conf: &rpc::WsConfiguration,
logger_config: &LogConfig,
) -> Result<NewToken, String> {
let code = generate_new_token(&ws_conf.signer_path, logger_config.color)
.map_err(|err| format!("Error generating token: {:?}", err))?;
let colored = |s: String| match logger_config.color {
true => format!("{}", White.bold().paint(s)),
false => s,
};
Ok(NewToken {
token: code.clone(),
message: format!(
r#"
Generated token:
{}
"#,
colored(code)
),
})
}
fn generate_new_token(path: &Path, logger_config_color: bool) -> io::Result<String> {
let path = codes_path(path);
let mut codes = parity_rpc::AuthCodes::from_file(&path)?;
codes.clear_garbage();
let code = codes.generate_new()?;
codes.to_file(&path)?;
trace!(
"New key code created: {}",
match logger_config_color {
true => format!("{}", White.bold().paint(&code[..])),
false => format!("{}", &code[..]),
}
);
Ok(code)
}

347
bin/oe/snapshot.rs Normal file
View File

@ -0,0 +1,347 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Snapshot and restoration commands.
use std::{
path::{Path, PathBuf},
sync::Arc,
time::Duration,
};
use crate::{hash::keccak, types::ids::BlockId};
use ethcore::{
client::{DatabaseCompactionProfile, Mode, VMType},
miner::Miner,
snapshot::{
io::{PackedReader, PackedWriter, SnapshotReader},
service::Service as SnapshotService,
Progress, RestorationStatus, SnapshotConfiguration, SnapshotService as SS,
},
};
use ethcore_service::ClientService;
use crate::{
cache::CacheConfig,
db,
helpers::{execute_upgrades, to_client_config},
params::{fatdb_switch_to_bool, tracing_switch_to_bool, Pruning, SpecType, Switch},
user_defaults::UserDefaults,
};
use dir::Directories;
/// Kinds of snapshot commands.
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum Kind {
/// Take a snapshot.
Take,
/// Restore a snapshot.
Restore,
}
/// Command for snapshot creation or restoration.
#[derive(Debug, PartialEq)]
pub struct SnapshotCommand {
pub cache_config: CacheConfig,
pub dirs: Directories,
pub spec: SpecType,
pub pruning: Pruning,
pub pruning_history: u64,
pub pruning_memory: usize,
pub tracing: Switch,
pub fat_db: Switch,
pub compaction: DatabaseCompactionProfile,
pub file_path: Option<String>,
pub kind: Kind,
pub block_at: BlockId,
pub max_round_blocks_to_import: usize,
pub snapshot_conf: SnapshotConfiguration,
}
// helper for reading chunks from arbitrary reader and feeding them into the
// service.
fn restore_using<R: SnapshotReader>(
snapshot: Arc<SnapshotService>,
reader: &R,
recover: bool,
) -> Result<(), String> {
let manifest = reader.manifest();
info!(
"Restoring to block #{} (0x{:?})",
manifest.block_number, manifest.block_hash
);
snapshot
.init_restore(manifest.clone(), recover)
.map_err(|e| format!("Failed to begin restoration: {}", e))?;
let (num_state, num_blocks) = (manifest.state_hashes.len(), manifest.block_hashes.len());
let informant_handle = snapshot.clone();
::std::thread::spawn(move || {
while let RestorationStatus::Ongoing {
state_chunks_done,
block_chunks_done,
..
} = informant_handle.restoration_status()
{
info!(
"Processed {}/{} state chunks and {}/{} block chunks.",
state_chunks_done, num_state, block_chunks_done, num_blocks
);
::std::thread::sleep(Duration::from_secs(5));
}
});
info!("Restoring state");
for &state_hash in &manifest.state_hashes {
if snapshot.restoration_status() == RestorationStatus::Failed {
return Err("Restoration failed".into());
}
let chunk = reader.chunk(state_hash).map_err(|e| {
format!(
"Encountered error while reading chunk {:?}: {}",
state_hash, e
)
})?;
let hash = keccak(&chunk);
if hash != state_hash {
return Err(format!(
"Mismatched chunk hash. Expected {:?}, got {:?}",
state_hash, hash
));
}
snapshot.feed_state_chunk(state_hash, &chunk);
}
info!("Restoring blocks");
for &block_hash in &manifest.block_hashes {
if snapshot.restoration_status() == RestorationStatus::Failed {
return Err("Restoration failed".into());
}
let chunk = reader.chunk(block_hash).map_err(|e| {
format!(
"Encountered error while reading chunk {:?}: {}",
block_hash, e
)
})?;
let hash = keccak(&chunk);
if hash != block_hash {
return Err(format!(
"Mismatched chunk hash. Expected {:?}, got {:?}",
block_hash, hash
));
}
snapshot.feed_block_chunk(block_hash, &chunk);
}
match snapshot.restoration_status() {
RestorationStatus::Ongoing { .. } => {
Err("Snapshot file is incomplete and missing chunks.".into())
}
RestorationStatus::Initializing { .. } => {
Err("Snapshot restoration is still initializing.".into())
}
RestorationStatus::Failed => Err("Snapshot restoration failed.".into()),
RestorationStatus::Inactive => {
info!("Restoration complete.");
Ok(())
}
}
}
impl SnapshotCommand {
// shared portion of snapshot commands: start the client service
fn start_service(self) -> Result<ClientService, String> {
// load spec file
let spec = self.spec.spec(&self.dirs.cache)?;
// load genesis hash
let genesis_hash = spec.genesis_header().hash();
// database paths
let db_dirs = self
.dirs
.database(genesis_hash, None, spec.data_dir.clone());
// user defaults path
let user_defaults_path = db_dirs.user_defaults_path();
// load user defaults
let user_defaults = UserDefaults::load(&user_defaults_path)?;
// select pruning algorithm
let algorithm = self.pruning.to_algorithm(&user_defaults);
// check if tracing is on
let tracing = tracing_switch_to_bool(self.tracing, &user_defaults)?;
// check if fatdb is on
let fat_db = fatdb_switch_to_bool(self.fat_db, &user_defaults, algorithm)?;
// prepare client and snapshot paths.
let client_path = db_dirs.client_path(algorithm);
let snapshot_path = db_dirs.snapshot_path();
// execute upgrades
execute_upgrades(&self.dirs.base, &db_dirs, algorithm, &self.compaction)?;
// prepare client config
let mut client_config = to_client_config(
&self.cache_config,
spec.name.to_lowercase(),
Mode::Active,
tracing,
fat_db,
self.compaction,
VMType::default(),
"".into(),
algorithm,
self.pruning_history,
self.pruning_memory,
true,
self.max_round_blocks_to_import,
);
client_config.snapshot = self.snapshot_conf;
let restoration_db_handler = db::restoration_db_handler(&client_path, &client_config);
let client_db = restoration_db_handler
.open(&client_path)
.map_err(|e| format!("Failed to open database {:?}", e))?;
let service = ClientService::start(
client_config,
&spec,
client_db,
&snapshot_path,
restoration_db_handler,
&self.dirs.ipc_path(),
// TODO [ToDr] don't use test miner here
// (actually don't require miner at all)
Arc::new(Miner::new_for_tests(&spec, None)),
)
.map_err(|e| format!("Client service error: {:?}", e))?;
Ok(service)
}
/// restore from a snapshot
pub fn restore(self) -> Result<(), String> {
let file = self.file_path.clone();
let service = self.start_service()?;
warn!("Snapshot restoration is experimental and the format may be subject to change.");
warn!(
"On encountering an unexpected error, please ensure that you have a recent snapshot."
);
let snapshot = service.snapshot_service();
if let Some(file) = file {
info!("Attempting to restore from snapshot at '{}'", file);
let reader = PackedReader::new(Path::new(&file))
.map_err(|e| format!("Couldn't open snapshot file: {}", e))
.and_then(|x| x.ok_or("Snapshot file has invalid format.".into()));
let reader = reader?;
restore_using(snapshot, &reader, true)?;
} else {
info!("Attempting to restore from local snapshot.");
// attempting restoration with recovery will lead to deadlock
// as we currently hold a read lock on the service's reader.
match *snapshot.reader() {
Some(ref reader) => restore_using(snapshot.clone(), reader, false)?,
None => return Err("No local snapshot found.".into()),
}
}
Ok(())
}
/// Take a snapshot from the head of the chain.
pub fn take_snapshot(self) -> Result<(), String> {
let file_path = self
.file_path
.clone()
.ok_or("No file path provided.".to_owned())?;
let file_path: PathBuf = file_path.into();
let block_at = self.block_at;
let service = self.start_service()?;
warn!("Snapshots are currently experimental. File formats may be subject to change.");
let writer = PackedWriter::new(&file_path)
.map_err(|e| format!("Failed to open snapshot writer: {}", e))?;
let progress = Arc::new(Progress::default());
let p = progress.clone();
let informant_handle = ::std::thread::spawn(move || {
::std::thread::sleep(Duration::from_secs(5));
let mut last_size = 0;
while !p.done() {
let cur_size = p.size();
if cur_size != last_size {
last_size = cur_size;
let bytes = crate::informant::format_bytes(cur_size as usize);
info!(
"Snapshot: {} accounts {} blocks {}",
p.accounts(),
p.blocks(),
bytes
);
}
::std::thread::sleep(Duration::from_secs(5));
}
});
if let Err(e) = service.client().take_snapshot(writer, block_at, &*progress) {
let _ = ::std::fs::remove_file(&file_path);
return Err(format!(
"Encountered fatal error while creating snapshot: {}",
e
));
}
info!("snapshot creation complete");
assert!(progress.done());
informant_handle
.join()
.map_err(|_| "failed to join logger thread")?;
Ok(())
}
}
/// Execute this snapshot command.
pub fn execute(cmd: SnapshotCommand) -> Result<String, String> {
match cmd.kind {
Kind::Take => cmd.take_snapshot()?,
Kind::Restore => cmd.restore()?,
}
Ok(String::new())
}

119
bin/oe/stratum.rs Normal file
View File

@ -0,0 +1,119 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! OpenEthereum sync service
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use ethcore_stratum::{Stratum as StratumServer, PushWorkHandler, RemoteJobDispatcher, ServiceConfiguration};
use modules::service_urls;
use boot;
use hypervisor::service::IpcModuleId;
use hypervisor::{HYPERVISOR_IPC_URL, ControlService};
use std::net::{SocketAddr, IpAddr};
use std::str::FromStr;
use nanoipc;
use std::thread;
use ethcore::miner::stratum::{STRATUM_SOCKET_NAME, JOB_DISPATCHER_SOCKET_NAME};
pub const MODULE_ID: IpcModuleId = 8000;
#[derive(Default)]
struct StratumControlService {
pub stop: Arc<AtomicBool>,
}
impl ControlService for StratumControlService {
fn shutdown(&self) -> bool {
trace!(target: "hypervisor", "Received shutdown from control service");
self.stop.store(true, ::std::sync::atomic::Ordering::SeqCst);
true
}
}
pub fn main() {
boot::setup_cli_logger("stratum");
let service_config: ServiceConfiguration = boot::payload()
.unwrap_or_else(|e| {
println!("Fatal: error reading boot arguments ({:?})", e);
std::process::exit(1)
});
let job_dispatcher = dependency!(
RemoteJobDispatcher,
&service_urls::with_base(&service_config.io_path, JOB_DISPATCHER_SOCKET_NAME)
);
let _ = boot::main_thread();
let service_stop = Arc::new(AtomicBool::new(false));
let server =
StratumServer::start(
&SocketAddr::new(
IpAddr::from_str(&service_config.listen_addr)
.unwrap_or_else(|e| {
println!("Fatal: invalid listen address: '{}' ({:?})", &service_config.listen_addr, e);
std::process::exit(1)
}),
service_config.port,
),
job_dispatcher.service().clone(),
service_config.secret
).unwrap_or_else(
|e| {
println!("Fatal: cannot start stratum server({:?})", e);
std::process::exit(1)
}
);
boot::host_service(
&service_urls::with_base(&service_config.io_path, STRATUM_SOCKET_NAME),
service_stop.clone(),
server.clone() as Arc<PushWorkHandler>
);
let hypervisor = boot::register(
&service_urls::with_base(&service_config.io_path, HYPERVISOR_IPC_URL),
&service_urls::with_base(&service_config.io_path, service_urls::STRATUM_CONTROL),
MODULE_ID
);
let timer_svc = server.clone();
let timer_stop = service_stop.clone();
thread::spawn(move || {
while !timer_stop.load(Ordering::SeqCst) {
thread::park_timeout(::std::time::Duration::from_millis(2000));
// It almost always not doing anything, only greets new peers with a job
timer_svc.maintain();
}
});
let control_service = Arc::new(StratumControlService::default());
let as_control = control_service.clone() as Arc<ControlService>;
let mut worker = nanoipc::Worker::<ControlService>::new(&as_control);
worker.add_reqrep(
&service_urls::with_base(&service_config.io_path, service_urls::STRATUM_CONTROL)
).unwrap();
while !control_service.stop.load(Ordering::SeqCst) {
worker.poll();
}
service_stop.store(true, Ordering::SeqCst);
hypervisor.module_shutdown(MODULE_ID);
trace!(target: "hypervisor", "Stratum process terminated gracefully");
}

246
bin/oe/upgrade.rs Normal file
View File

@ -0,0 +1,246 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
//! Parity upgrade logic
use dir::{default_data_path, helpers::replace_home, home_dir, DatabaseDirectories};
use journaldb::Algorithm;
use semver::{SemVerError, Version};
use std::{
collections::*,
fs::{self, create_dir_all, File},
io,
io::{Read, Write},
path::{Path, PathBuf},
};
#[derive(Debug)]
pub enum Error {
CannotCreateConfigPath(io::Error),
CannotWriteVersionFile(io::Error),
CannotUpdateVersionFile(io::Error),
SemVer(SemVerError),
}
impl From<SemVerError> for Error {
fn from(err: SemVerError) -> Self {
Error::SemVer(err)
}
}
const CURRENT_VERSION: &'static str = env!("CARGO_PKG_VERSION");
#[derive(Hash, PartialEq, Eq)]
struct UpgradeKey {
pub old_version: Version,
pub new_version: Version,
}
type UpgradeList = HashMap<UpgradeKey, fn() -> Result<(), Error>>;
impl UpgradeKey {
// given the following config exist
// ver.lock 1.1 (`previous_version`)
//
// current_version 1.4 (`current_version`)
//
//
//upgrades (set of `UpgradeKey`)
// 1.0 -> 1.1 (u1)
// 1.1 -> 1.2 (u2)
// 1.2 -> 1.3 (u3)
// 1.3 -> 1.4 (u4)
// 1.4 -> 1.5 (u5)
//
// then the following upgrades should be applied:
// u2, u3, u4
fn is_applicable(&self, previous_version: &Version, current_version: &Version) -> bool {
self.old_version >= *previous_version && self.new_version <= *current_version
}
}
// dummy upgrade (remove when the first one is in)
fn dummy_upgrade() -> Result<(), Error> {
Ok(())
}
fn push_upgrades(upgrades: &mut UpgradeList) {
// dummy upgrade (remove when the first one is in)
upgrades.insert(
UpgradeKey {
old_version: Version::new(0, 9, 0),
new_version: Version::new(1, 0, 0),
},
dummy_upgrade,
);
}
fn upgrade_from_version(previous_version: &Version) -> Result<usize, Error> {
let mut upgrades = HashMap::new();
push_upgrades(&mut upgrades);
let current_version = Version::parse(CURRENT_VERSION)?;
let mut count = 0;
for upgrade_key in upgrades.keys() {
if upgrade_key.is_applicable(previous_version, &current_version) {
let upgrade_script = upgrades[upgrade_key];
upgrade_script()?;
count += 1;
}
}
Ok(count)
}
fn with_locked_version<F>(db_path: &str, script: F) -> Result<usize, Error>
where
F: Fn(&Version) -> Result<usize, Error>,
{
let mut path = PathBuf::from(db_path);
create_dir_all(&path).map_err(Error::CannotCreateConfigPath)?;
path.push("ver.lock");
let version = File::open(&path)
.ok()
.and_then(|ref mut file| {
let mut version_string = String::new();
file.read_to_string(&mut version_string)
.ok()
.and_then(|_| Version::parse(&version_string).ok())
})
.unwrap_or(Version::new(0, 9, 0));
let mut lock = File::create(&path).map_err(Error::CannotWriteVersionFile)?;
let result = script(&version);
let written_version = Version::parse(CURRENT_VERSION)?;
lock.write_all(written_version.to_string().as_bytes())
.map_err(Error::CannotUpdateVersionFile)?;
result
}
pub fn upgrade(db_path: &str) -> Result<usize, Error> {
with_locked_version(db_path, |ver| upgrade_from_version(ver))
}
fn file_exists(path: &Path) -> bool {
match fs::metadata(&path) {
Err(ref e) if e.kind() == io::ErrorKind::NotFound => false,
_ => true,
}
}
#[cfg(any(test, feature = "accounts"))]
pub fn upgrade_key_location(from: &PathBuf, to: &PathBuf) {
match fs::create_dir_all(&to).and_then(|()| fs::read_dir(from)) {
Ok(entries) => {
let files: Vec<_> = entries
.filter_map(|f| {
f.ok().and_then(|f| {
if f.file_type().ok().map_or(false, |f| f.is_file()) {
f.file_name().to_str().map(|s| s.to_owned())
} else {
None
}
})
})
.collect();
let mut num: usize = 0;
for name in files {
let mut from = from.clone();
from.push(&name);
let mut to = to.clone();
to.push(&name);
if !file_exists(&to) {
if let Err(e) = fs::rename(&from, &to) {
debug!("Error upgrading key {:?}: {:?}", from, e);
} else {
num += 1;
}
} else {
debug!("Skipped upgrading key {:?}", from);
}
}
if num > 0 {
info!(
"Moved {} keys from {} to {}",
num,
from.to_string_lossy(),
to.to_string_lossy()
);
}
}
Err(e) => {
debug!("Error moving keys from {:?} to {:?}: {:?}", from, to, e);
}
}
}
fn upgrade_dir_location(source: &PathBuf, dest: &PathBuf) {
if file_exists(&source) {
if !file_exists(&dest) {
let mut parent = dest.clone();
parent.pop();
if let Err(e) = fs::create_dir_all(&parent).and_then(|()| fs::rename(&source, &dest)) {
debug!("Skipped path {:?} -> {:?} :{:?}", source, dest, e);
} else {
info!(
"Moved {} to {}",
source.to_string_lossy(),
dest.to_string_lossy()
);
}
} else {
debug!(
"Skipped upgrading directory {:?}, Destination already exists at {:?}",
source, dest
);
}
}
}
fn upgrade_user_defaults(dirs: &DatabaseDirectories) {
let source = dirs.legacy_user_defaults_path();
let dest = dirs.user_defaults_path();
if file_exists(&source) {
if !file_exists(&dest) {
if let Err(e) = fs::rename(&source, &dest) {
debug!("Skipped upgrading user defaults {:?}:{:?}", dest, e);
}
} else {
debug!(
"Skipped upgrading user defaults {:?}, File exists at {:?}",
source, dest
);
}
}
}
pub fn upgrade_data_paths(base_path: &str, dirs: &DatabaseDirectories, pruning: Algorithm) {
if home_dir().is_none() {
return;
}
let legacy_root_path = replace_home("", "$HOME/.parity");
let default_path = default_data_path();
if legacy_root_path != base_path && base_path == default_path {
upgrade_dir_location(&PathBuf::from(legacy_root_path), &PathBuf::from(&base_path));
}
upgrade_dir_location(&dirs.legacy_version_path(pruning), &dirs.db_path(pruning));
upgrade_dir_location(&dirs.legacy_snapshot_path(), &dirs.snapshot_path());
upgrade_dir_location(&dirs.legacy_network_path(), &dirs.network_path());
upgrade_user_defaults(&dirs);
}

188
bin/oe/user_defaults.rs Normal file
View File

@ -0,0 +1,188 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use ethcore::client::Mode as ClientMode;
use journaldb::Algorithm;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_json::{de::from_reader, ser::to_string};
use std::{fs::File, io::Write, path::Path, time::Duration};
#[derive(Clone)]
pub struct Seconds(Duration);
impl Seconds {
pub fn value(&self) -> u64 {
self.0.as_secs()
}
}
impl From<u64> for Seconds {
fn from(s: u64) -> Seconds {
Seconds(Duration::from_secs(s))
}
}
impl From<Duration> for Seconds {
fn from(d: Duration) -> Seconds {
Seconds(d)
}
}
impl Into<Duration> for Seconds {
fn into(self) -> Duration {
self.0
}
}
impl Serialize for Seconds {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
serializer.serialize_u64(self.value())
}
}
impl<'de> Deserialize<'de> for Seconds {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
let secs = u64::deserialize(deserializer)?;
Ok(Seconds::from(secs))
}
}
#[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "lowercase", tag = "mode")]
pub enum Mode {
Active,
Passive {
#[serde(rename = "mode.timeout")]
timeout: Seconds,
#[serde(rename = "mode.alarm")]
alarm: Seconds,
},
Dark {
#[serde(rename = "mode.timeout")]
timeout: Seconds,
},
Offline,
}
impl Into<ClientMode> for Mode {
fn into(self) -> ClientMode {
match self {
Mode::Active => ClientMode::Active,
Mode::Passive { timeout, alarm } => ClientMode::Passive(timeout.into(), alarm.into()),
Mode::Dark { timeout } => ClientMode::Dark(timeout.into()),
Mode::Offline => ClientMode::Off,
}
}
}
impl From<ClientMode> for Mode {
fn from(mode: ClientMode) -> Mode {
match mode {
ClientMode::Active => Mode::Active,
ClientMode::Passive(timeout, alarm) => Mode::Passive {
timeout: timeout.into(),
alarm: alarm.into(),
},
ClientMode::Dark(timeout) => Mode::Dark {
timeout: timeout.into(),
},
ClientMode::Off => Mode::Offline,
}
}
}
#[derive(Serialize, Deserialize)]
pub struct UserDefaults {
pub is_first_launch: bool,
#[serde(with = "algorithm_serde")]
pub pruning: Algorithm,
pub tracing: bool,
pub fat_db: bool,
#[serde(flatten)]
mode: Mode,
}
impl UserDefaults {
pub fn mode(&self) -> ClientMode {
self.mode.clone().into()
}
pub fn set_mode(&mut self, mode: ClientMode) {
self.mode = mode.into();
}
}
mod algorithm_serde {
use journaldb::Algorithm;
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
pub fn serialize<S>(algorithm: &Algorithm, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
algorithm.as_str().serialize(serializer)
}
pub fn deserialize<'de, D>(deserializer: D) -> Result<Algorithm, D::Error>
where
D: Deserializer<'de>,
{
let pruning = String::deserialize(deserializer)?;
pruning
.parse()
.map_err(|_| Error::custom("invalid pruning method"))
}
}
impl Default for UserDefaults {
fn default() -> Self {
UserDefaults {
is_first_launch: true,
pruning: Algorithm::OverlayRecent,
tracing: false,
fat_db: false,
mode: Mode::Active,
}
}
}
impl UserDefaults {
pub fn load<P>(path: P) -> Result<Self, String>
where
P: AsRef<Path>,
{
match File::open(path) {
Ok(file) => match from_reader(file) {
Ok(defaults) => Ok(defaults),
Err(e) => {
warn!("Error loading user defaults file: {:?}", e);
Ok(UserDefaults::default())
}
},
_ => Ok(UserDefaults::default()),
}
}
pub fn save<P>(&self, path: P) -> Result<(), String>
where
P: AsRef<Path>,
{
let mut file: File =
File::create(path).map_err(|_| "Cannot create user defaults file".to_owned())?;
file.write_all(to_string(&self).unwrap().as_bytes())
.map_err(|_| "Failed to save user defaults".to_owned())
}
}

View File

@ -1,25 +0,0 @@
// Copyright 2015, 2016 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/>.
extern crate rustc_version;
use rustc_version::{version_meta, Channel};
fn main() {
if let Channel::Nightly = version_meta().channel {
println!("cargo:rustc-cfg=nightly");
}
}

View File

@ -0,0 +1,23 @@
[package]
description = "OpenEthereum Account Management"
homepage = "https://github.com/openethereum/openethereum"
license = "GPL-3.0"
name = "ethcore-accounts"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
common-types = { path = "../ethcore/types" }
ethkey = { path = "ethkey" }
ethstore = { path = "ethstore" }
log = "0.4"
parity-crypto = { version = "0.6.2", features = [ "publickey" ] }
parking_lot = "0.11.1"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
[dev-dependencies]
ethereum-types = "0.9.2"
tempdir = "0.3"

View File

@ -0,0 +1,21 @@
[package]
description = "Parity Ethereum Keys Generator"
name = "ethkey"
version = "0.3.0"
authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
edit-distance = "2.0"
parity-crypto = { version = "0.6.2", features = ["publickey"] }
eth-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1", rev = "9791e79f21a5309dcb6e0bd254b1ef88fca2f1f4" }
ethereum-types = "0.9.2"
lazy_static = "1.0"
log = "0.4"
memzero = { path = "../../../crates/util/memzero" }
parity-wordlist = "1.3"
quick-error = "1.2.2"
rand = "0.7.3"
rustc-hex = "1.0"
serde = "1.0"
serde_derive = "1.0"
tiny-keccak = "1.4"

View File

@ -0,0 +1,220 @@
## ethkey-cli
Parity Ethereum keys generator.
### Usage
```
Parity Ethereum Keys Generator.
Copyright 2015-2019 Parity Technologies (UK) Ltd.
Usage:
ethkey info <secret-or-phrase> [options]
ethkey generate random [options]
ethkey generate prefix <prefix> [options]
ethkey sign <secret> <message>
ethkey verify public <public> <signature> <message>
ethkey verify address <address> <signature> <message>
ethkey recover <address> <known-phrase>
ethkey [-h | --help]
Options:
-h, --help Display this message and exit.
-s, --secret Display only the secret key.
-p, --public Display only the public key.
-a, --address Display only the address.
-b, --brain Use parity brain wallet algorithm. Not recommended.
Commands:
info Display public key and address of the secret.
generate random Generates new random Ethereum key.
generate prefix Random generation, but address must start with a prefix ("vanity address").
sign Sign message using a secret key.
verify Verify signer of the signature by public key or address.
recover Try to find brain phrase matching given address from partial phrase.
```
### Examples
#### `info <secret>`
*Display info about private key.*
- `<secret>` - ethereum secret, 32 bytes long
```
ethkey info 17d08f5fe8c77af811caa0c9a187e668ce3b74a99acc3f6d976f075fa8e0be55
```
```
secret: 17d08f5fe8c77af811caa0c9a187e668ce3b74a99acc3f6d976f075fa8e0be55
public: 689268c0ff57a20cd299fa60d3fb374862aff565b20b5f1767906a99e6e09f3ff04ca2b2a5cd22f62941db103c0356df1a8ed20ce322cab2483db67685afd124
address: 26d1ec50b4e62c1d1a40d16e7cacc6a6580757d5
```
--
#### `info --brain <phrase>`
*Display info about private key generate from brain wallet recovery phrase.*
- `<phrase>` - Parity recovery phrase, 12 words
```
ethkey info --brain "this is sparta"
```
```
The recover phrase was not generated by Parity: The word 'this' does not come from the dictionary.
secret: aa22b54c0cb43ee30a014afe5ef3664b1cde299feabca46cd3167a85a57c39f2
public: c4c5398da6843632c123f543d714d2d2277716c11ff612b2a2f23c6bda4d6f0327c31cd58c55a9572c3cc141dade0c32747a13b7ef34c241b26c84adbb28fcf4
address: 006e27b6a72e1f34c626762f3c4761547aff1421
```
--
#### `generate random`
*Generate new keypair randomly.*
```
ethkey generate random
```
```
secret: 7d29fab185a33e2cd955812397354c472d2b84615b645aa135ff539f6b0d70d5
public: 35f222d88b80151857a2877826d940104887376a94c1cbd2c8c7c192eb701df88a18a4ecb8b05b1466c5b3706042027b5e079fe3a3683e66d822b0e047aa3418
address: a8fa5dd30a87bb9e3288d604eb74949c515ab66e
```
--
#### `generate random --brain`
*Generate new keypair with recovery phrase randomly.*
```
ethkey generate random --brain
```
```
recovery phrase: thwarting scandal creamer nuzzle asparagus blast crouch trusting anytime elixir frenzied octagon
secret: 001ce488d50d2f7579dc190c4655f32918d505cee3de63bddc7101bc91c0c2f0
public: 4e19a5fdae82596e1485c69b687c9cc52b5078e5b0668ef3ce8543cd90e712cb00df822489bc1f1dcb3623538a54476c7b3def44e1a51dc174e86448b63f42d0
address: 00cf3711cbd3a1512570639280758118ba0b2bcb
```
--
#### `generate prefix <prefix>`
*Generate new keypair randomly with address starting with prefix.*
- `<prefix>` - desired address prefix, 0 - 32 bytes long.
```
ethkey generate prefix ff
```
```
secret: 2075b1d9c124ea673de7273758ed6de14802a9da8a73ceb74533d7c312ff6acd
public: 48dbce4508566a05509980a5dd1335599fcdac6f9858ba67018cecb9f09b8c4066dc4c18ae2722112fd4d9ac36d626793fffffb26071dfeb0c2300df994bd173
address: fff7e25dff2aa60f61f9d98130c8646a01f31649
```
--
#### `generate prefix --brain <prefix>`
*Generate new keypair with recovery phrase randomly with address starting with prefix.*
- `<prefix>` - desired address prefix, 0 - 32 bytes long.
```
ethkey generate prefix --brain 00cf
```
```
recovery phrase: thwarting scandal creamer nuzzle asparagus blast crouch trusting anytime elixir frenzied octagon
secret: 001ce488d50d2f7579dc190c4655f32918d505cee3de63bddc7101bc91c0c2f0
public: 4e19a5fdae82596e1485c69b687c9cc52b5078e5b0668ef3ce8543cd90e712cb00df822489bc1f1dcb3623538a54476c7b3def44e1a51dc174e86448b63f42d0
address: 00cf3711cbd3a1512570639280758118ba0b2bcb
```
--
#### `sign <secret> <message>`
*Sign a message with a secret.*
- `<secret>` - ethereum secret, 32 bytes long
- `<message>` - message to sign, 32 bytes long
```
ethkey sign 17d08f5fe8c77af811caa0c9a187e668ce3b74a99acc3f6d976f075fa8e0be55 bd50b7370c3f96733b31744c6c45079e7ae6c8d299613246d28ebcef507ec987
```
```
c1878cf60417151c766a712653d26ef350c8c75393458b7a9be715f053215af63dfd3b02c2ae65a8677917a8efa3172acb71cb90196e42106953ea0363c5aaf200
```
--
#### `verify public <public> <signature> <message>`
*Verify the signature.*
- `<public>` - ethereum public, 64 bytes long
- `<signature>` - message signature, 65 bytes long
- `<message>` - message, 32 bytes long
```
ethkey verify public 689268c0ff57a20cd299fa60d3fb374862aff565b20b5f1767906a99e6e09f3ff04ca2b2a5cd22f62941db103c0356df1a8ed20ce322cab2483db67685afd124 c1878cf60417151c766a712653d26ef350c8c75393458b7a9be715f053215af63dfd3b02c2ae65a8677917a8efa3172acb71cb90196e42106953ea0363c5aaf200 bd50b7370c3f96733b31744c6c45079e7ae6c8d299613246d28ebcef507ec987
```
```
true
```
--
#### `verify address <address> <signature> <message>`
*Verify the signature.*
- `<address>` - ethereum address, 20 bytes long
- `<signature>` - message signature, 65 bytes long
- `<message>` - message, 32 bytes long
```
ethkey verify address 689268c0ff57a20cd299fa60d3fb374862aff565b20b5f1767906a99e6e09f3ff04ca2b2a5cd22f62941db103c0356df1a8ed20ce322cab2483db67685afd124 c1878cf60417151c766a712653d26ef350c8c75393458b7a9be715f053215af63dfd3b02c2ae65a8677917a8efa3172acb71cb90196e42106953ea0363c5aaf200 bd50b7370c3f96733b31744c6c45079e7ae6c8d299613246d28ebcef507ec987
```
```
true
```
--
#### `recover <address> <known-phrase>`
*Try to recover an account given expected address and partial (too short or with invalid words) recovery phrase.*
- `<address>` - ethereum address, 20 bytes long
- `<known-phrase>` - known phrase, can be in a form of `thwarting * creamer`
```
RUST_LOG="info" ethkey recover "00cf3711cbd3a1512570639280758118ba0b2bcb" "thwarting scandal creamer nuzzle asparagus blast crouch trusting anytime elixir frenzied octag"
```
```
INFO:ethkey::brain_recover: Invalid word 'octag', looking for potential substitutions.
INFO:ethkey::brain_recover: Closest words: ["ocean", "octagon", "octane", "outage", "tag", "acting", "acts", "aorta", "cage", "chug"]
INFO:ethkey::brain_recover: Starting to test 7776 possible combinations.
thwarting scandal creamer nuzzle asparagus blast crouch trusting anytime elixir frenzied octagon
secret: 001ce488d50d2f7579dc190c4655f32918d505cee3de63bddc7101bc91c0c2f0
public: 4e19a5fdae82596e1485c69b687c9cc52b5078e5b0668ef3ce8543cd90e712cb00df822489bc1f1dcb3623538a54476c7b3def44e1a51dc174e86448b63f42d0
address: 00cf3711cbd3a1512570639280758118ba0b2bcb
```
## Parity Ethereum toolchain
_This project is a part of the Parity Ethereum toolchain._
- [evmbin](https://github.com/paritytech/parity-ethereum/blob/master/evmbin/) - EVM implementation for Parity Ethereum.
- [ethabi](https://github.com/paritytech/ethabi) - Parity Ethereum function calls encoding.
- [ethstore](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethstore) - Parity Ethereum key management.
- [ethkey](https://github.com/paritytech/parity-ethereum/blob/master/accounts/ethkey) - Parity Ethereum keys generator.

View File

@ -0,0 +1,69 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use parity_crypto::{
publickey::{KeyPair, Secret},
Keccak256,
};
use parity_wordlist;
/// Simple brainwallet.
pub struct Brain(String);
impl Brain {
pub fn new(s: String) -> Self {
Brain(s)
}
pub fn validate_phrase(phrase: &str, expected_words: usize) -> Result<(), ::WordlistError> {
parity_wordlist::validate_phrase(phrase, expected_words)
}
pub fn generate(&mut self) -> KeyPair {
let seed = self.0.clone();
let mut secret = seed.into_bytes().keccak256();
let mut i = 0;
loop {
secret = secret.keccak256();
match i > 16384 {
false => i += 1,
true => {
if let Ok(pair) = Secret::import_key(&secret).and_then(KeyPair::from_secret) {
if pair.address()[0] == 0 {
trace!("Testing: {}, got: {:?}", self.0, pair.address());
return pair;
}
}
}
}
}
}
}
#[cfg(test)]
mod tests {
use Brain;
#[test]
fn test_brain() {
let words = "this is sparta!".to_owned();
let first_keypair = Brain::new(words.clone()).generate();
let second_keypair = Brain::new(words.clone()).generate();
assert_eq!(first_keypair.secret(), second_keypair.secret());
}
}

View File

@ -0,0 +1,69 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use super::Brain;
use parity_crypto::publickey::{Error, KeyPair};
use parity_wordlist as wordlist;
/// Tries to find brain-seed keypair with address starting with given prefix.
pub struct BrainPrefix {
prefix: Vec<u8>,
iterations: usize,
no_of_words: usize,
last_phrase: String,
}
impl BrainPrefix {
pub fn new(prefix: Vec<u8>, iterations: usize, no_of_words: usize) -> Self {
BrainPrefix {
prefix,
iterations,
no_of_words,
last_phrase: String::new(),
}
}
pub fn phrase(&self) -> &str {
&self.last_phrase
}
pub fn generate(&mut self) -> Result<KeyPair, Error> {
for _ in 0..self.iterations {
let phrase = wordlist::random_phrase(self.no_of_words);
let keypair = Brain::new(phrase.clone()).generate();
if keypair.address().as_ref().starts_with(&self.prefix) {
self.last_phrase = phrase;
return Ok(keypair);
}
}
Err(Error::Custom("Could not find keypair".into()))
}
}
#[cfg(test)]
mod tests {
use BrainPrefix;
#[test]
fn prefix_generator() {
let prefix = vec![0x00u8];
let keypair = BrainPrefix::new(prefix.clone(), usize::max_value(), 12)
.generate()
.unwrap();
assert!(keypair.address().as_bytes().starts_with(&prefix));
}
}

View File

@ -0,0 +1,177 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::collections::HashSet;
use edit_distance::edit_distance;
use parity_crypto::publickey::Address;
use parity_wordlist;
use super::Brain;
/// Tries to find a phrase for address, given the number
/// of expected words and a partial phrase.
///
/// Returns `None` if phrase couldn't be found.
pub fn brain_recover(
address: &Address,
known_phrase: &str,
expected_words: usize,
) -> Option<String> {
let it = PhrasesIterator::from_known_phrase(known_phrase, expected_words);
for phrase in it {
let keypair = Brain::new(phrase.clone()).generate();
trace!("Testing: {}, got: {:?}", phrase, keypair.address());
if &keypair.address() == address {
return Some(phrase);
}
}
None
}
fn generate_substitutions(word: &str) -> Vec<&'static str> {
let mut words = parity_wordlist::WORDS
.iter()
.cloned()
.map(|w| (edit_distance(w, word), w))
.collect::<Vec<_>>();
words.sort_by(|a, b| a.0.cmp(&b.0));
words.into_iter().map(|pair| pair.1).collect()
}
/// Iterator over possible
pub struct PhrasesIterator {
words: Vec<Vec<&'static str>>,
combinations: u64,
indexes: Vec<usize>,
has_next: bool,
}
impl PhrasesIterator {
pub fn from_known_phrase(known_phrase: &str, expected_words: usize) -> Self {
let known_words = parity_wordlist::WORDS
.iter()
.cloned()
.collect::<HashSet<_>>();
let mut words = known_phrase
.split(' ')
.map(|word| match known_words.get(word) {
None => {
info!(
"Invalid word '{}', looking for potential substitutions.",
word
);
let substitutions = generate_substitutions(word);
info!("Closest words: {:?}", &substitutions[..10]);
substitutions
}
Some(word) => vec![*word],
})
.collect::<Vec<_>>();
// add missing words
if words.len() < expected_words {
let to_add = expected_words - words.len();
info!("Number of words is insuficcient adding {} more.", to_add);
for _ in 0..to_add {
words.push(parity_wordlist::WORDS.iter().cloned().collect());
}
}
// start searching
PhrasesIterator::new(words)
}
pub fn new(words: Vec<Vec<&'static str>>) -> Self {
let combinations = words.iter().fold(1u64, |acc, x| acc * x.len() as u64);
let indexes = words.iter().map(|_| 0).collect();
info!("Starting to test {} possible combinations.", combinations);
PhrasesIterator {
words,
combinations,
indexes,
has_next: combinations > 0,
}
}
pub fn combinations(&self) -> u64 {
self.combinations
}
fn current(&self) -> String {
let mut s = self.words[0][self.indexes[0]].to_owned();
for i in 1..self.indexes.len() {
s.push(' ');
s.push_str(self.words[i][self.indexes[i]]);
}
s
}
fn next_index(&mut self) -> bool {
let mut pos = self.indexes.len();
while pos > 0 {
pos -= 1;
self.indexes[pos] += 1;
if self.indexes[pos] >= self.words[pos].len() {
self.indexes[pos] = 0;
} else {
return true;
}
}
false
}
}
impl Iterator for PhrasesIterator {
type Item = String;
fn next(&mut self) -> Option<String> {
if !self.has_next {
return None;
}
let phrase = self.current();
self.has_next = self.next_index();
Some(phrase)
}
}
#[cfg(test)]
mod tests {
use super::PhrasesIterator;
#[test]
fn should_generate_possible_combinations() {
let mut it =
PhrasesIterator::new(vec![vec!["1", "2", "3"], vec!["test"], vec!["a", "b", "c"]]);
assert_eq!(it.combinations(), 9);
assert_eq!(it.next(), Some("1 test a".to_owned()));
assert_eq!(it.next(), Some("1 test b".to_owned()));
assert_eq!(it.next(), Some("1 test c".to_owned()));
assert_eq!(it.next(), Some("2 test a".to_owned()));
assert_eq!(it.next(), Some("2 test b".to_owned()));
assert_eq!(it.next(), Some("2 test c".to_owned()));
assert_eq!(it.next(), Some("3 test a".to_owned()));
assert_eq!(it.next(), Some("3 test b".to_owned()));
assert_eq!(it.next(), Some("3 test c".to_owned()));
assert_eq!(it.next(), None);
}
}

View File

@ -0,0 +1,88 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use crypto::Error as CryptoError;
use std::{error, fmt};
#[derive(Debug)]
/// Crypto error
pub enum Error {
/// Invalid secret key
InvalidSecret,
/// Invalid public key
InvalidPublic,
/// Invalid address
InvalidAddress,
/// Invalid EC signature
InvalidSignature,
/// Invalid AES message
InvalidMessage,
/// IO Error
Io(::std::io::Error),
/// Custom
Custom(String),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let msg = match *self {
Error::InvalidSecret => "Invalid secret".into(),
Error::InvalidPublic => "Invalid public".into(),
Error::InvalidAddress => "Invalid address".into(),
Error::InvalidSignature => "Invalid EC signature".into(),
Error::InvalidMessage => "Invalid AES message".into(),
Error::Io(ref err) => format!("I/O error: {}", err),
Error::Custom(ref s) => s.clone(),
};
f.write_fmt(format_args!("Crypto error ({})", msg))
}
}
impl error::Error for Error {
fn description(&self) -> &str {
format!("{:?}", &self)
}
}
impl Into<String> for Error {
fn into(self) -> String {
format!("{}", self)
}
}
impl From<CryptoError> for Error {
fn from(e: CryptoError) -> Error {
Error::Custom(e.to_string())
}
}
impl From<::secp256k1::Error> for Error {
fn from(e: ::secp256k1::Error) -> Error {
match e {
::secp256k1::Error::InvalidMessage => Error::InvalidMessage,
::secp256k1::Error::InvalidPublicKey => Error::InvalidPublic,
::secp256k1::Error::InvalidSecretKey => Error::InvalidSecret,
_ => Error::InvalidSignature,
}
}
}
impl From<::std::io::Error> for Error {
fn from(err: ::std::io::Error) -> Error {
Error::Io(err)
}
}

View File

@ -0,0 +1,39 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
// #![warn(missing_docs)]
extern crate edit_distance;
extern crate parity_crypto;
extern crate parity_wordlist;
extern crate serde;
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde_derive;
mod brain;
mod brain_prefix;
mod password;
mod prefix;
pub mod brain_recover;
pub use self::{
brain::Brain, brain_prefix::BrainPrefix, parity_wordlist::Error as WordlistError,
password::Password, prefix::Prefix,
};

View File

@ -0,0 +1,59 @@
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
// OpenEthereum 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.
// OpenEthereum 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 OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
use std::{fmt, ptr};
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Password(String);
impl fmt::Debug for Password {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Password(******)")
}
}
impl Password {
pub fn as_bytes(&self) -> &[u8] {
self.0.as_bytes()
}
pub fn as_str(&self) -> &str {
self.0.as_str()
}
}
// Custom drop impl to zero out memory.
impl Drop for Password {
fn drop(&mut self) {
unsafe {
for byte_ref in self.0.as_mut_vec() {
ptr::write_volatile(byte_ref, 0)
}
}
}
}
impl From<String> for Password {
fn from(s: String) -> Password {
Password(s)
}
}
impl<'a> From<&'a str> for Password {
fn from(s: &'a str) -> Password {
Password::from(String::from(s))
}
}

Some files were not shown because too many files have changed in this diff Show More