This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
SecretStore: administrative sessions prototypes #6605
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…n_math_session_with_adding_new_node
…ore_change_server_set
svyatonik
added
A3-inprogress ⏳
Pull request is in progress. No review needed at this stage.
M4-core ⛓
Core client code / Rust.
labels
Sep 28, 2017
bjornwgnr
requested review from
gavofyork
and removed request for
gavofyork
September 28, 2017 19:15
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
Sep 29, 2017
needs a rebase |
Of above TODOs, there's one which may need some external review/advice before fixing. It is TODO#3. Here's my thoughts on it:
So idea is not to overwrite share in ShareAdd, but append a new version instead. This will need special handling:
|
I'd propose share version negotiation to be performed on startup and not on ShareAdd. This way additional negotiations on signing and ShareAdd won't be required. |
arkpar
added
A8-looksgood 🦄
Pull request is reviewed well.
and removed
A0-pleasereview 🤓
Pull request needs code review.
labels
Oct 2, 2017
This was referenced Oct 3, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is first (and largest, I hope) part of #6480 implementation (and thus made on top of it).
PR outline:
polynom1
field to SS database + upgrade. It is impossible to add shares for keys, generated in previous SS versions--secretstore-admin-public=[PUBLIC]
cli option (I suppose this is a temporary soultion - see explanation below)ServersSetChangeAccess consensus description:
Every administrative session is about changing some set of nodes from
old_nodes_set
tonew_nodes_set
:ShareAdd:
old_nodes_set
= current owners of same-key shares,new_nodes_set
=old_nodes_set
+ additional nodesShareMove:
old_nodes_set
= current owners of same-key shares,new_nodes_set
=old_nodes_set
except nodes that lose their shares + additional nodesShareRemove:
old_nodes_set
= current owners of same-key shares,new_nodes_set
=old_nodes_set
except nodes that lose their sharesServesSetChange:
old_nodes_set
= current set of ALL SS nodes,new_nodes_set
=old_nodes_set
except nodes that we are going to remove from SSOnly owners of 'administrator' key are allowed to start administrative sessions.
To make sure it is actually started by administrators, there are 3 input parameters for session:
new_nodes_set
- described aboveold_set_signature
- signature of keccak(ordered set ofold_nodes_set
)new_set_signature
- signature of keccak(ordered set ofnew_nodes_set
)The purpose of ServersSetChangeAccess is to check if
old_nodes_set
&&new_nodes_set
are valid (in general) and that signatures are valid signatures of admin key owner.This could be changed later to check signatures using on-chain contract or some other way (I suppose we need to discuss it during next (integration) task).
For now, admin_public is added for simplicity.
ShareAdd session description:
participants of session = all owners of given key shares + all nodes that are being added
session result = every added node owns its new key share
session steps:
ShareMove session description:
participants of session = all owners of given key shares + all nodes that are being added
session result = share is removed from nodes selected for removal + share is moved (it isn't regenerated - just moved) to 'new' nodes
session steps:
ShareRemove session description:
participants of session = all owners of given key shares
session result = share is removed from nodes selected for removal
session steps:
ServersSetChange session description:
participants of session = all SS nodes
session result = clear db on nodes being removed + shares for ALL existing sessions on nodes being added
sesion steps:
4.1) share change plan is created = nodes to add shares for, nodes to move shares from/to, nodes to remove shares from
4.2) share change session is started. Share change session = sequential execution of ShareAdd, then ShareMove && then ShareRemove sessions (order matters here) for single key
5.1) sub_master is selected from sessions participants
5.2) share change session is delegated from master to this sub_master
5.3) share change session is executed by this sub_master
5.4) share change confirm is sent from sub_master to master
General administrative sessions behavior:
TODOs:
5.1) report unknown sessions by chunks to avoid large messages
5.2) inactive nodes can mark session as stalled (if haven't received session messages for too long) => this will lead to failure