Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug on reshare process #898

Merged
merged 7 commits into from
Jan 11, 2022
Merged

Conversation

emmanuelm41
Copy link
Contributor

@emmanuelm41 emmanuelm41 commented Jan 11, 2022

Context
This bug allows a user to init a reshape process with a difference between the beacon id he sets on CLI command and the ones present inside config file.

Explanation
Two networks are working inside the nodes: the default and a second one. We start a reshare on the second one to add a new node to this network. This new node uses the flag --from on CLI reshare cmd, but the user forgets to set the --id flag. The new node which is being added to the network uses the default one as the "resharing beacon process" instead of the second one. When it tries to send its share to the leader node, it uses the beacon id present on the old config file (it is the correct one). For that reason the leader is able to start the dkg process... as a result, the new node is not on the new group file. In some cases, this scenario triggered an existing kyber bug.

@yiannisbot
Copy link
Member

Great catch! Do you have a solution to the bug? I guess a straightforward one is to avoid triggering the DKG if either of the 'beacon id' or the '--id' flag do not match what has been expected - in this case the '--id' flag of the right network is missing.

@emmanuelm41
Copy link
Contributor Author

Great catch! Do you have a solution to the bug? I guess a straightforward one is to avoid triggering the DKG if either of the 'beacon id' or the '--id' flag do not match what has been expected - in this case the '--id' flag of the right network is missing.

The fix is in the PR. Server will compare beacon id on InitReshare request and on old group file. They should be the same in order to continue. If they are different, we won't accept the request.

@emmanuelm41 emmanuelm41 merged commit 437aa1f into drand:master Jan 11, 2022
@emmanuelm41 emmanuelm41 deleted the fix-reshare-bug branch January 11, 2022 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants