Commit Graph

1627 Commits

Author SHA1 Message Date
Marek Kotewicz e81069ab3d
fixed ipc leak, closes #8774 (#8876) 2018-06-13 13:02:16 +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
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
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
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
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
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
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 ee41fa6f30 Move connection_filter to the network crate (#8674) 2018-05-22 12:34:01 +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 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 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
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
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
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
Pierre Krieger 629da8f8bf More changes for Android (#8421) 2018-05-02 09:20:59 +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
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
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 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
Sergey Pepyakin 650948feed Update wasmi (#8452) 2018-04-21 11:27:39 +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
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 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
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
Svyatoslav Nikolsky db7a8c4ac7 tokio-core v0.1.16 -> v0.1.17 (#8408) 2018-04-16 12:02:23 +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
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
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
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
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
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
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 27c32d3629
Tweaks and add a Dockerfile for Android (#8036) 2018-04-05 14:38:50 +02:00
Marek Kotewicz 9d3771458d bump proc macro deps (#8310) 2018-04-05 10:31:06 +02: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