Commit Graph

46 Commits

Author SHA1 Message Date
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
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
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 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
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
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
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 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
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 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 ea9c8a174c SecretStore: started adding tests for ServiceContractListener 2017-11-22 17:31:34 +03:00
Svyatoslav Nikolsky 85e150dbb5 SecretStore: restore server key 2017-11-22 11:43:01 +03:00
Svyatoslav Nikolsky 5a7e065e41 SecretStore: Kovan flush3 2017-11-22 10:05:14 +03:00
Svyatoslav Nikolsky b5fad300ba Merge branch 'master' into secretstore_kovan 2017-11-20 19:58:01 +03:00
Svyatoslav Nikolsky 3945a29ee6 SecretStore: mapping requests to KeyServer + requests retry 2017-11-20 19:03:31 +03:00
Svyatoslav Nikolsky 56875a83b3 SecretStore: Kovan flush2 2017-11-20 19:03:06 +03:00
Robert Habermeier 81212c5031 Merge branch 'master' into upload-crates 2017-11-17 16:42:41 +01:00
debris a22c48b6b0 removed redundant imports 2017-11-14 17:47:41 +01:00
Svyatoslav Nikolsky abfb9fccd3 SecretStore: Kovan integration initial commit 2017-11-14 14:26:31 +03:00
Robert Habermeier ec5519ccd1 rename hash crate to keccak-hash 2017-11-10 20:08:28 +01:00
debris c83e9d0f1b remove ipc codegen from secretstore 2017-10-16 17:12:02 +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
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
debris eb526b7769 separated kvdb into 3 crates: kvdb, kvdb-memorydb && kvdb-rocksdb, #6693 2017-10-12 15:36:27 +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
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
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
Fredrik 308f36a532 Don't reexport bigint from util 2017-09-04 16:36:49 +02:00
debris 7849fff41e finished 2017-08-31 11:35:41 +02:00
Svyatoslav Nikolsky c345bc3d85 cli option to disable SS ACL check 2017-07-27 15:48:07 +03:00
Svyatoslav Nikolsky 7c05a906d0 cli option to disable SS HTTP API 2017-07-27 13:29:09 +03:00
Svyatoslav Nikolsky 45f2b82411 NodeKeyPAir trait 2017-07-25 09:24:54 +03:00
Svyatoslav Nikolsky b9ad093d06 moved parsing to KeyServerSet 2017-07-20 13:15:16 +03:00
Svyatoslav Nikolsky 81de7e1075 initial KeyServerSet commit 2017-07-19 11:35:17 +03: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
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
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
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
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
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
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
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