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

Reshare confirmation #965

Merged
merged 31 commits into from
Jul 30, 2024
Merged

Reshare confirmation #965

merged 31 commits into from
Jul 30, 2024

Conversation

JesseAbram
Copy link
Member

@JesseAbram JesseAbram commented Jul 26, 2024

Related #941

  • Allow nodes to call in to confirm
  • On confirmation have chain update new signers

This PR also stores the new key and deletes the old one until the new flow is finished #968

@JesseAbram JesseAbram marked this pull request as ready for review July 29, 2024 16:59
@JesseAbram JesseAbram requested review from ameba23 and HCastano July 29, 2024 16:59
Copy link
Contributor

@ameba23 ameba23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 All looks good.

The thing i don't see, which i guess just isn't in the scope of this PR, is the bit where the one member of the old signing committee who isn't in the new signing committee deletes their keyshare.

Ok(StatusCode::OK)
}

/// Confirms that a address has finished registering on chain.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doccomment needs changing

signers_info.confirmations.push(validator_stash.clone());
NextSigners::<T>::put(signers_info);
Self::deposit_event(Event::SignerConfirmed(validator_stash));
Ok(Pays::No.into())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it a free transaction, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

free may not be the right term, refunded, as in they pay up front then if they don't hit any errors they get their fees back

@@ -276,6 +276,7 @@ pub fn development_genesis_config(
})
.collect::<Vec<_>>(),
proactive_refresh_data: (vec![], vec![]),
mock_signer_rotate: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im guessing this will be removed when this is all finished and we always rotate signers

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh no, this is for rotating on spin up, it is the only way I can get the tests in the TSS in the right state to actually test it (like the proactive refresh data above)


if self.mock_signer_rotate {
NextSigners::<T>::put(NextSignerInfo {
next_signers: self.inital_signers.clone(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is next_signers initially set to initial_signers just as a placeholder? Presumably it is going to get changed on the next new session.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty much if next signers do not exist then the chain isn't in a rotating state and when the nodes call confirm done they will get rejected

NextSigners::<T>::put(NextSignerInfo {
next_signers: current_signers,
confirmations: vec![],
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this PR, but is it possible to test this with our 3 node integration test / docker-compose setup? I guess we need 4 nodes before the check above which checks that the validator size is greater than the number of current signers will pass.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we would need an extra node added

@@ -77,6 +76,9 @@ async fn test_reshare() {
for response_result in response_results {
assert_eq!(response_result.unwrap().text().await.unwrap(), "");
}
let key_share_after = unsafe_get(&client, hex::encode(NETWORK_PARENT_KEY), 3001).await;
assert_ne!(key_share_before, key_share_after);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could also check that bob and charlie's keyshares got updated. Not sure if thats needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like overkill but happy to make an issue for it after....maybe a good first issue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm it was a good idea, I just did it

@JesseAbram
Copy link
Member Author

💯 All looks good.

The thing i don't see, which i guess just isn't in the scope of this PR, is the bit where the one member of the old signing committee who isn't in the new signing committee deletes their keyshare.

good point will add it to #941

@JesseAbram JesseAbram merged commit f996455 into master Jul 30, 2024
14 checks passed
@JesseAbram JesseAbram deleted the reshare-confirmation branch July 30, 2024 16:01
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants