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

passkey: reorder validation and some docs #2071

Merged
merged 6 commits into from
Jul 12, 2024
Merged

Conversation

aramikm
Copy link
Collaborator

@aramikm aramikm commented Jul 11, 2024

Goal

The goal of this PR is to re order the validations to be as close as possible to the signed extension order considering the customizations that we did such as not having post_dispatch implemented.

Related to #2032

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
pallets/passkey/src/lib.rs 96.13% <100.00%> (-0.19%) ⬇️
pallets/passkey/src/types.rs 68.75% <ø> (ø)

Copy link
Collaborator

@saraswatpuneet saraswatpuneet left a comment

Choose a reason for hiding this comment

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

nit and lgtm

Copy link
Collaborator

@shannonwells shannonwells left a comment

Choose a reason for hiding this comment

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

A few nits, nothing blocking.

pallets/passkey/README.md Outdated Show resolved Hide resolved
pallets/passkey/README.md Outdated Show resolved Hide resolved
pallets/passkey/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@enddynayn enddynayn left a comment

Choose a reason for hiding this comment

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

nice! 👍

Comment on lines +21 to +23
Because the Polkadot SDK currently lacks support for P256 signatures, we had to use an unsigned
extrinsic to allow this custom verification before dispatching transactions. To achieve this, we
added P256 signature verification within the `ValidateUnsigned` trait implementation for the pallet.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@shannonwells I'm still not happy with this. Any idea how we might make this better?

@aramikm aramikm merged commit d8faae7 into main Jul 12, 2024
27 checks passed
@aramikm aramikm deleted the passkey_reorder_docs branch July 12, 2024 18:33
This was referenced Jul 12, 2024
aramikm added a commit that referenced this pull request Jul 13, 2024
# Goal
There was a misunderstanding before that we thought if the fee was
deducted from account in pre_dispatch and after that any failure happens
inside pre_dispatch, only post_dispatch would be able to refund that
amount but that was not a correct assumption and the caller of
pre_dispatch is going to reverse all storage changes in it does not
return with Ok. based on
`/// Changes made to storage *WILL* be persisted if the call returns
`Ok`.`

Knowing this, we could put the signature check as the final validation
since it is the heaviest one.

Related to #2071
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.

4 participants