Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

SecretStore: servers set change session api #6925

Merged
merged 53 commits into from
Nov 16, 2017
Merged

Conversation

svyatonik
Copy link
Collaborator

@svyatonik svyatonik commented Oct 30, 2017

on top of #6910
InProgress: testing + adding tests + I'm going to add RPC for calculating servers set signature (it is keccak(ordered set of nodes-ids (ethkey::Public)))

@svyatonik svyatonik added A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. M4-core ⛓ Core client code / Rust. labels Oct 30, 2017
@svyatonik svyatonik added the M6-rpcapi 📣 RPC API. label Oct 30, 2017
@5chdn 5chdn added this to the 1.9 milestone Oct 30, 2017
@svyatonik
Copy link
Collaborator Author

Added new RPC: secretstore_signServersSet. Params are: account, password to unlock this account and array of nodes ids to sign. Usage example:

svyatonik@xwnotebook:~/dev/parity.testss/servers_set_change$ curl --data-binary '{"jsonrpc": "2.0", "method": "secretstore_signServersSet", "params": ["0xE3b68C48CE837236EDdF70dA0D817c3746732982", "AdminAccount2", ["0xa7cc7a8ef336189c2bfabfeab8eed55598fa2b480adf98eeb66e006f2811319550222122bd37fb25dbc35709ccd5d9793dc829d208b73ffbce893d63a393101b", "0x54319671ca191b9e08e2064d8b9eaa43cb246e698dc7d995d557ebef3428dc69b93ca3caa20c43552414132448425c9333aa33b2231caa082ddcec7e12a56963"]], "id":1 }' -H 'Content-type: application/json' http://127.0.0.1:8545/
{"jsonrpc":"2.0","result":"0xff5fbcfa6c05d6a1353023e5ade51c3ab53bead7466c1bacd510ee3ef93814ef2a3340cdd7991bea362aac9f111795a470b70d5f4e9ad9877338089c9aacbdb200","id":1}

Added HTTP API for starting ServersSetChange session. Caller must post to {base_url}/admin/servers_set_change/{old_servers_set_signature}/{new_servers_set_signature} with body = json array of nodes ids. Example:

curl --data-binary '["0xa7cc7a8ef336189c2bfabfeab8eed55598fa2b480adf98eeb66e006f2811319550222122bd37fb25dbc35709ccd5d9793dc829d208b73ffbce893d63a393101b", "0x54319671ca191b9e08e2064d8b9eaa43cb246e698dc7d995d557ebef3428dc69b93ca3caa20c43552414132448425c9333aa33b2231caa082ddcec7e12a56963"]' -v -X POST http://localhost:8084/admin/servers_set_change/17374292b9e1a026e1e87fe37ae4e987156d1979461b6daa8ec804ed667e8d100d8129295172a86db63c12b1aa6bb861e89b3ea4330e4b8ae27e0e1917485c1e01/ff5fbcfa6c05d6a1353023e5ade51c3ab53bead7466c1bacd510ee3ef93814ef2a3340cdd7991bea362aac9f111795a470b70d5f4e9ad9877338089c9aacbdb20

So to change SS nodes set from old_nodes_set to new_nodes_set:

  1. make sure that all nodes from old_nodes_set and new_nodes_set are online
  2. make sure that all nodes are connected either by registering nodes on KeyServerSet contract, or by adding nodes to configuration files
  3. prepare administrator' signature of all online nodes (i.e. old_nodes_set + new_nodes_set) by using secretstore_signServersSet RPC
  4. prepare administrator' signature of all nodes from new_nodes_set by using secretstore_signServersSet RPC
  5. start ServersSetChange session by POSTing new_nodes_set && passing signatures via URL to SS/admin/servers_set_change
  6. after ServersSetChange session is completed, disconnect all nodes that have to be disconnected (new_nodes_set.except(old_nodes_set)) either by registering nodes on KeyServerSet contract, or by adding nodes to configuration

@svyatonik svyatonik added A0-pleasereview 🤓 Pull request needs code review. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels Oct 31, 2017
@debris
Copy link
Collaborator

debris commented Nov 14, 2017

lgtm, but my knowledge of secret store is too shallow to properly review this code

@debris debris added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Nov 14, 2017
@5chdn 5chdn added A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. and removed A8-looksgood 🦄 Pull request is reviewed well. labels Nov 15, 2017
@debris
Copy link
Collaborator

debris commented Nov 16, 2017

@arkpar please review it and merge if it looks good

@arkpar arkpar merged commit e16f6fb into master Nov 16, 2017
@arkpar arkpar deleted the servers_set_change_api branch November 16, 2017 16:34
5chdn pushed a commit that referenced this pull request Jan 30, 2018
* 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 & -> &

* [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 2fa0af6.

* Update usd_per_tx test

* Fix tests

* Fix initial_minimum
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. M4-core ⛓ Core client code / Rust. M6-rpcapi 📣 RPC API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants