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

Add new registration flow test to TSS side #997

Merged
merged 6 commits into from
Aug 12, 2024

Conversation

HCastano
Copy link
Collaborator

@HCastano HCastano commented Aug 9, 2024

While working on the signing flow I realized that there wasn't a test checking the new
registration flow on the TSS side (which is a pre-requisite to doing signing).

I've added a mostly happy-path test for registration. I don't really want to get bogged
down in checking all the failure scenarios until after the signing flow is done.

I think this makes sense since we're going to have a few test flows in there that utilize it.
The verifying key that's being used in there is wrong (we need to derive it),
and it's easier to go through the registration flow ourselves due to the
prereq that the network has been jumpstarted.
@HCastano HCastano requested review from ameba23 and JesseAbram August 9, 2024 17:26
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.

💯 nice clear comments i gotta say

rpc: &LegacyRpcMethods<EntropyConfig>,
signature_request_account: &Sr25519Keyring,
program_modification_account: subxtAccountId32,
program_instance: BoundedVec<ProgramInstance>,
Copy link
Contributor

Choose a reason for hiding this comment

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

i know this is just copied from the fn above, but i feel like this should be called program_instances

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. I'm not running the CI again to fix it in this PR though lol. Will do in a different one

@@ -1471,3 +1599,25 @@ pub async fn get_sign_tx_data(

(validators_info, generic_msg, validator_ips_and_keys)
}

pub async fn jump_start_network(
Copy link
Contributor

Choose a reason for hiding this comment

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

i was gonna say 'don't we already have something like this?' but +1 for making it generic

@@ -143,15 +143,6 @@ pub mod pallet {
version_number: T::KeyVersionNumber::get(),
},
);

RegisteredOnChain::<T>::insert(
Copy link
Contributor

Choose a reason for hiding this comment

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

So no more pre-registered accounts

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For the moment no. I wrote a little thing out in the commit message removing this why it doesn't make sense to have them. tl;dr registration requires a jumpstarted network as a pre-req and that's a bit of a tricky setup using the Genesis config code.

It's something we might want to look at in the future if we find that manually setting everything up with extrinsics becomes cumbersome

submit_transaction(api, rpc, &signature_request_account, &registering_tx, None).await?;

// Since we're only submitting one request above, looking for the first event as opposed to
// say, all events, should be fine.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is nice. But in our actual production client code we will still need a loop to filter out the events of other users, right?

Copy link
Member

Choose a reason for hiding this comment

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

yes that is correct

@HCastano HCastano merged commit e7f5b6e into master Aug 12, 2024
14 checks passed
@HCastano HCastano deleted the hc/test-registration-on-tss-side branch August 12, 2024 16:08
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.

3 participants