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

Refines keyless error handling, handles vkey rotations, updates serialization format of KeylessAccounts #564

Merged
merged 6 commits into from
Nov 5, 2024

Conversation

heliuchuan
Copy link
Contributor

@heliuchuan heliuchuan commented Nov 2, 2024

Description

This further improves handling of Keyless Errors.

  • KeylessAccount stores a hash of the verifying key used to check rotations.
  • Handles JWK checking for federated accounts
  • Updates the serialization format to include the address, and vkey hash. Including address in serialization prevents losing address information if the key has been rotated.

Test Plan

e2e test added. However it is TODO to add a case for vkey rotations, needs the localnet admin key.

Related Links

Checklist

  • Have you ran pnpm fmt?
  • Have you updated the CHANGELOG.md?

@heliuchuan heliuchuan requested a review from a team as a code owner November 2, 2024 00:11
Copy link
Contributor

@GhostWalker562 GhostWalker562 left a comment

Choose a reason for hiding this comment

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

I like the refactor! A couple of comments but should be good to go.

src/account/AbstractKeylessAccount.ts Show resolved Hide resolved
src/account/AbstractKeylessAccount.ts Show resolved Hide resolved
src/bcs/serializer.ts Show resolved Hide resolved
src/core/crypto/keyless.ts Show resolved Hide resolved
src/core/crypto/keyless.ts Show resolved Hide resolved
src/bcs/deserializer.ts Show resolved Hide resolved
@heliuchuan heliuchuan merged commit f644e61 into main Nov 5, 2024
8 checks passed
@heliuchuan heliuchuan deleted the add-vkey-on-account branch November 5, 2024 01:04
@@ -82,6 +82,7 @@ export class Deserializer {
}

/**
* @deprecated use `deserializeOption` instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this should be marked as deprecated,
deserializeOption returns string | undefined so it's not equivalent

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