Commit Graph

1239 Commits

Author SHA1 Message Date
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
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
Pierre Krieger dab967ace8 Remove NetworkService::config() (#8653) 2018-06-01 09:49: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
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
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 80528c5344 parity: trim whitespace when parsing duration strings (#8692) 2018-05-24 19:43:18 +02: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 bd1e3fc606 Allow making direct RPC queries from the C API (#8588) 2018-05-22 19:07:27 +02: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
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
Niklas Adolfsson f9e64e0965 typo (#8640) 2018-05-16 20:09:59 +02:00
Niklas Adolfsson 8f56606cac ´main.rs´ typo (#8629)
* Typo

* Update main.rs
2018-05-15 07:46:37 +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
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
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
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
Wei Tang 2a829b1f1a Show imported messages for light client (#8517) 2018-05-01 14:16:03 +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
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 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
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
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
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
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
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
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
Marek Kotewicz dd2c27958c use atty instead of isatty (#8365) 2018-04-11 11:56:37 +01: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
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
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
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
Pierre Krieger 652f5032a2 Fix the JSONRPC API not running with the light client (#8326) 2018-04-08 18:29:25 +02:00
Pierre Krieger 27c32d3629
Tweaks and add a Dockerfile for Android (#8036) 2018-04-05 14:38:50 +02:00
East Coin d57944ffb9 Implement Easthub chain spec (#8295) 2018-04-04 23:00: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
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
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
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
Ryan Leung 9c9ddaccec use constant durations (#8278)
* use constant durations

* fix CI

* address comments
2018-04-02 10:47:56 +02:00