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

feat: readable linking challenge #483

Merged
merged 7 commits into from
Mar 6, 2023
Merged

Conversation

weichweich
Copy link
Contributor

fixes /~https://github.com/KILTprotocol/ticket/issues/2499

Replace the scale encoded challenge with a human readable challenge.

Checklist:

  • I have verified that the code works
    • No panics! (checked arithmetic ops, no indexing array[3] use get(3), ...)
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)

Copy link
Contributor

@trusch trusch left a comment

Choose a reason for hiding this comment

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

lgtm :) Will look nice in the display of metamask. The only thing even better would be probably something like giving MM a typed struct with the info so it could render it even nicer. https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4

@weichweich
Copy link
Contributor Author

lgtm :) Will look nice in the display of metamask. The only thing even better would be probably something like giving MM a typed struct with the info so it could render it even nicer. https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4

Yeah that would be nice, but it's only for ethereum. So we would have a special challenge for ethereum which is also possible. But i think this just makes it more complicated for little gain. It will also not get easier to process on chain.

Copy link
Member

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

So while before we were attempting to have a future-compatible SDK, now we will force all people to upgrade to the new version, otherwise stuff will break. Correct?

@@ -34,10 +34,10 @@ mod connection_record;
mod migration_state;
mod signature;

#[cfg(test)]
#[cfg(all(test, feature = "std"))]
Copy link
Member

Choose a reason for hiding this comment

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

I have never seen it used anywhere else. Are you sure there's no other way to do this? Perhaps feature-gating the specific tests or the mock itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We always run tests with at least the std feature. I also want to test get_challenge in a no_std environment since debug might be implemented differently there (e.g. for accounts it simply prints nothing).

To be able to test this without std I need to disable all tests that require std.

pallets/pallet-did-lookup/src/associate_account_request.rs Outdated Show resolved Hide resolved
@weichweich
Copy link
Contributor Author

So while before we were attempting to have a future-compatible SDK, now we will force all people to upgrade to the new version, otherwise stuff will break. Correct?

Things break because the SDK doesn't include these surprise changes yes.

@ntn-x2
Copy link
Member

ntn-x2 commented Mar 1, 2023

@weichweich do you think it would make sense to expose the new stuff as a new extrinsic? So the old SDK would still work without breaking, and the new SDK would use the new feature. I mean both extrinsics would support Ethereum accounts, but the type of signature would be different. We can then deprecate the old way later on.

I guess my main concern is that people can't just decide not to upgrade, since the old linking stuff would break as well.

@weichweich weichweich merged commit 4eb94ef into develop Mar 6, 2023
@weichweich weichweich deleted the aw-readable-challenge branch March 6, 2023 14:32
Ad96el pushed a commit that referenced this pull request Mar 20, 2023
Replace the scale encoded challenge with a human readable challenge.

Co-authored-by: Antonio <antonio@kilt.io>
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