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

Remove old registration flow #1030

Merged
merged 23 commits into from
Aug 27, 2024
Merged

Remove old registration flow #1030

merged 23 commits into from
Aug 27, 2024

Conversation

HCastano
Copy link
Collaborator

@HCastano HCastano commented Aug 26, 2024

After having cleaned up a lot of code and tests in previous PRs it's finally time to get
rid of the old off-chain registration flow 🥳

Note that there are quite a few breaking changes in this PR since I've removed:
extrinsics, events, errors from the Registry pallet and a public HTTP API (/new/user)
from the TSS.

Hopefully I didn't miss anything, but there may be small clean up PRs that will be opened
over the next few weeks if I did.

@HCastano HCastano requested review from ameba23 and JesseAbram August 26, 2024 20:52
@HCastano HCastano added Breaks API Bump `spec_version` A change which affects the current runtime behaviour labels Aug 26, 2024
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 to see this all go.

Maybe once the signing stuff is also removed we need to have a check over documentation as i expect there's a lot that needs updating.

@@ -176,7 +176,6 @@ impl AppState {
pub fn app(app_state: AppState) -> Router {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you pls also remove the documentation for the /user/new endpoint from the top of this file. Line 75 or so.

@@ -303,22 +303,6 @@ pub fn development_genesis_config(
"imOnline": ImOnlineConfig { keys: vec![] },
"authorityDiscovery": AuthorityDiscoveryConfig { keys: vec![], ..Default::default() },
"grandpa": GrandpaConfig { authorities: vec![], ..Default::default() },
"registry": RegistryConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if your intention was to remove all traces of these pre-registered accounts in this PR. But if so we are still putting their keyshares in the kvdb here:

vec![("eve", hex::encode(EVE_VERIFYING_KEY)), ("dave", hex::encode(DAVE_VERIFYING_KEY))];

And there is quite possibly a bunch of other places where they pop up. Maybe something for another PR.

Copy link
Member

Choose a reason for hiding this comment

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

def at least an issue maybe should also tag js team here incase their tests rely on these

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, so there are some tests that still depend on this, e.g test_proactive_refresh.

So probably best done in a follow-up

let (validators_info, mut signature_request, validator_ips_and_keys) =
get_sign_tx_data(&entropy_api, &rpc, hex::encode(PREIMAGE_SHOULD_SUCCEED), with_parent_key)
.await;
get_sign_tx_data(&entropy_api, &rpc, hex::encode(PREIMAGE_SHOULD_SUCCEED)).await;

// This verifying key doesn't have a program registered with it
signature_request.block_number = rpc.chain_get_header(None).await.unwrap().unwrap().number;
Copy link
Contributor

Choose a reason for hiding this comment

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

Im kinda surprised the check below (line 227) still passes without dave being a pre-registered account anymore - i would expect the error to be something like "User not registered" and not "No program pointer defined for account". As i understand it, it should no longer be possible to get into a state where we have a registered account with no associated programs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Very nice, you were spot on 🔍

thread 'user::tests::test_signature_requests_fail_on_different_conditions' panicked at crates/threshold-signature-server/src/user/tests.rs:222:9:
assertion `left == right` failed
  left: "Substrate: User is not registered on-chain"
 right: "No program pointer defined for account"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test user::tests::test_signature_requests_fail_on_different_conditions ... FAILED

failures:

failures:
    user::tests::test_signature_requests_fail_on_different_conditions

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 30 filtered out; finished in 143.00s

Looks like the "build and step" test of the CI didn't run yesterday, which is why the pipeline is all green.

Agreed, we shouldn't be able to get into this state anymore so I'm gonna remove the test.

@HCastano
Copy link
Collaborator Author

Maybe once the signing stuff is also removed we need to have a check over documentation as i expect there's a lot that needs updating.

Yep, a lot of the docs will need updating

@HCastano HCastano merged commit d6f734d into master Aug 27, 2024
8 checks passed
@HCastano HCastano deleted the hc/remove-registration-flow branch August 27, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaks API Bump `spec_version` A change which affects the current runtime behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants