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

Clean up registration related tests in pallet-registry #1021

Merged
merged 12 commits into from
Aug 22, 2024

Conversation

HCastano
Copy link
Collaborator

This cleans up some of the tests in the Registry pallet related to registration. The idea
was to make sure that any old tests were still valid for the new registration flow, or
where discarded.

@HCastano HCastano requested review from ameba23 and JesseAbram August 21, 2024 21:14
}

#[test]
fn it_fails_empty_program_list() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we not want to replace this with a similar test for register_on_chain? Did you do that somewhere and i missed it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

},
);

assert_ok!(Registry::register(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why still test the old flow here? Isn't it about to be removed?

Copy link
Collaborator Author

@HCastano HCastano Aug 22, 2024

Choose a reason for hiding this comment

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

I had initially removed it in this PR but reverted it since I figured it would be better to remove the whole confirmation flow in a different PR (which would include the removal on the TSS side as well).

I guess why the diff is a little confusing is that I moved it to be closer to the other registration tests, maybe I should move it back to keep the diff smaller

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.

⭐ Great that change program instance and change modification account now work with the new registration flow.

Approving pending getting the TSS tests to pass. It looks like the problem is that they use the pre-registered accounts which are currently only registered with the old flow. I guess we need to add them to the RegisteredOnChain map, giving them each a derivation path, and update their verifying keys in the entropy-shared constants.

I'm not sure if it is an issue that one of them is eve, and eve is also the pre-registered network parent key. So probably we shouldn't change eve's verification key. 😆

The other option would be to get rid of the pre-registered accounts and actually register in those tests. Since they are maybe not so helpful now that we don't need to do a per-user DKG anymore.

These tests are failing because we don't have the `RegisteredOnChain` struct pre-populated. Since
we're going to be updating everything to the new registration flow soon it doesn't make much sense
to fix this here.
@HCastano
Copy link
Collaborator Author

HCastano commented Aug 22, 2024

The other option would be to get rid of the pre-registered accounts and actually register in those tests. Since they are maybe not so helpful now that we don't need to do a per-user DKG anymore.

@ameba23 yeah this is probably what I'm going to end up doing, but in the PR where I actually remove the old registration flow. It's a bit annoying to populate them in genesis anyways.

I'm going to #[ignore] the failing tests for now since this is going to be addressed either today or tomorrow

@HCastano HCastano added the Bump `impl_version` A change which only affect the implementation details of the runtime label Aug 22, 2024
@HCastano HCastano merged commit 1202e02 into master Aug 22, 2024
8 checks passed
@HCastano HCastano deleted the hc/update-registration-pallet-test branch August 22, 2024 19:49
ameba23 added a commit that referenced this pull request Aug 23, 2024
* master:
  Clean up registration related tests in `pallet-registry` (#1021)
  Remove `prune_registration` extrinsic (#1022)
  Add benchmark for `new_session` hook (#1016)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bump `impl_version` A change which only affect the implementation details of the runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants