-
Notifications
You must be signed in to change notification settings - Fork 2
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
Reshare confirmation #965
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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![], | ||
}); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
good point will add it to #941 |
Related #941
This PR also stores the new key and deletes the old one until the new flow is finished #968