Commit Graph

147 Commits

Author SHA1 Message Date
Toralf Wittner
fed4864939 secret_store: use ecies::encrypt/ecies::decrypt. (#8125) 2018-03-15 18:49:13 +03: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
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
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
Svyatoslav Nikolsky
ebb92947a3 SecretStore: fixed test (#7878) 2018-02-14 10:49:56 +01:00
Svyatoslav Nikolsky
8579a56f71 SecretStore: 'broadcast' decryption session (#7843) 2018-02-12 18:05:33 +01:00
Svyatoslav Nikolsky
1ca1fba8cf read registry_address from given block (#7866) 2018-02-12 18:02:48 +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
Svyatoslav Nikolsky
ebda6d3916 SecretStore: ignore removed authorities when running auto-migration (#7674) 2018-02-05 20:59:14 +01:00
Svyatoslav Nikolsky
10a95a5a22 remove obsolete file (#7788) 2018-02-02 08:55:44 +01:00
Svyatoslav Nikolsky
d4861f0a29 SecretStore: return HTTP 403 if consensus is unreachable (#7656) 2018-01-22 10:05:30 +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
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
Svyatoslav Nikolsky
04b571b742 SecretStore: threshold decrease PoC (#7562) 2018-01-16 12:58:41 +01: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
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
Svyatoslav Nikolsky
d360074323 SecretStore: do not send init if session has finished/failed instantly (#7397) 2018-01-10 11:35:23 +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
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
Svyatoslav Nikolsky
fc0eb600f3 checked_sub -> saturating_sub 2017-12-27 15:21:31 +03: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
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
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
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
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
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
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
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
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
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