-
Notifications
You must be signed in to change notification settings - Fork 4
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
chore: distributed session keys #114
Conversation
size-limit report 📦
|
58f0598
to
2ec5a92
Compare
fc13ada
to
1555e0b
Compare
@@ -123,14 +123,14 @@ export const toSmartSessionsValidator = ( | |||
getStubSignature: async () => | |||
encodeSmartSessionSignature({ | |||
mode, | |||
permissionId, | |||
permissionId: permissionIds[permissionIdIndex], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when getting a sig we only need one permissionId at a time. which represents a session
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to check if there is case where it's making use of multiple already-enabled sessions in a single userop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we can confirm it then only make an array? in this PR can you revert it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this pr the functionality hasn't changed. I've only paved the way for accommodating multiple permissionIds later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you'd prefer I can revert, but I don't see any harm in doing this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm the module keeps active permission id single because for signature only one can be used at a time.
reverting is better only because we first check feasibility, ask @Fil then make changes.
@@ -123,14 +123,14 @@ export const toSmartSessionsValidator = ( | |||
getStubSignature: async () => | |||
encodeSmartSessionSignature({ | |||
mode, | |||
permissionId, | |||
permissionId: permissionIds[permissionIdIndex], | |||
enableSessionData, | |||
signature: DUMMY_ECDSA_SIG | |||
}), | |||
signUserOpHash: async (userOpHash: Hex) => | |||
encodeSmartSessionSignature({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add on to above comments, in module-sdk also encodeSmartSessionSignature uses single permissionId
@@ -102,7 +102,7 @@ export const parseModule = < | |||
chain extends Chain | undefined | |||
>( | |||
client: Client<Transport, chain, TModularSmartAccount> | |||
) => { | |||
): AnyData => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does parseModule do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a helper meant only for internal use. Not to be used externally really. It's a helper that pulls out the active module instance from the nexusClient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review i
Good points re permissionIds. I've created a ticket for your suggestion: #116 |
1555e0b
to
19baeaa
Compare
PR-Codex overview
This PR focuses on updating the
@biconomy/sdk
package to version0.0.10
, introducing distributed session keys and enhancing smart session functionalities. It includes various improvements in error handling, session management, and code structure.Detailed summary
package.json
to0.0.10
.KEY_GEN_DATA_NOT_FOUND
andSIGNATURE_NOT_FOUND
error messages inConstants.ts
.permissionId
topermissionIds
in several files to support multiple permissions.createNexusSessionClient
to directly returncreateNexusClient
.usePermission
to usecalls
instead ofactions
.useDistributedPermission
for executing multiple actions in a session.toSmartSessionsValidator.dan.dx.test.ts
.