Closed ankurdubey521 closed 7 months ago
resolve conflicts
PR is ready to be merged. I think we should merge this post the "all-encompassing audit"
Looks great 🚀 LGTM
Should we merge this or Not?
@Aboudjem please let us know when this can be safely merged.
@Aboudjem please let us know when this can be safely merged.
Sure ! let's discuss it next week
@Aboudjem Any update on this?
@Aboudjem Any update on this?
I thought we had agreed to proceed with the merging after completing the audits, if I'm not wrong
This PR has been inactive for 30 days. If it's waiting for a review, please reach out to the team. Otherwise, please update the PR or it will be closed due to inactivity.
@Aboudjem Any update on this?
I thought we had agreed to proceed with the merging after completing the audits, if I'm not wrong
We have completed 1 audit for the module, I believe it can be safely merged now.
Introduction
Introduces a new
SessionKeyManagerHybrid
Module to support Session Keys infrastructure with the following enhancements:SessionData(svm, validUntil, validAfter, data)
on-chain. This removes any dependency on any off-chain DA solution such as Merkle tree storage, removing the need for synchronization between DApps using Session Keys infrastructure.bytes32 sessionDigest
for subsequent session transactions, resulting in massive calldata savings for long-running sessions. This results in significantly cheaper transactions on L2s (amortized costs).execute
andexecuteBatch
flows, eliminating the need to separately integrate the Batched Session Router to support sessions while batching.Other notes:
execute
andexecuteBatch
modes.abi.encodePacked
to reduce calldata size to further the gas savings on L2s.Usage
Definitions
Enabling a Session Manually
Disabling a Session Manually
Normally a session will expire automatically based on
(validUntil, validAfter)
, however an option to disable the session manually is available.Single Execute
Enable And Use Session
Prepare a User Operation where
op.calldata[0:4]
isSmartAccount.execute.selector
orSmartAccount.execute_ncC.selector
.Prepare one or more
SessionData
as described above. CalculatePrepare
bytes sessionEnableData
asSign
sessionEnableData
usingEIP1271
to producesessionEnableSignature
Prepare
moduleSignature
asUse Pre-Enabled Session
Prepare a User Operation where
op.calldata[0:4]
isSmartAccount.execute.selector
orSmartAccount.execute_ncC.selector
.No
sessionEnableData
is needed in this case. Simply preparemoduleSignature
asBatch Execute
Prepare a User Operation where
op.calldata[0:4]
isSmartAccount.executeBatch.selector
orSmartAccount.executeBatch_y6U.selector
.Here, for each item of the batch independently follow either the enable-and-use or the pre-enabled flow. The global
moduleSignature
structure is as follows:First some invariants:
sessionInfo.length == executeBatch-operations.length
sessionEnableDataList.length == sessionEnableSignatureList.length >= 0
Each item in
sessionInfo
corresponds to an operation in the batch. If any session wants to leverage the enable-and-use flow, it can refer to one of the enableData-signature pair. If no sessions use these flows, the first two lists are empty.Session Enable and Signature List
Follows the same structure as described in the Single Execute Section. This is effectively a 2D array of
(sessionDataHash, chainID)
. Assuming that batch operations A, B and C reference sessions SA, SB and SC, assuming the following Session Enable Data:sessionInfo[0]
can refer to it's corresponding SED entry as[0, 0]
sessionInfo[1]
can refer to it's corresponding SED entry as[0, 1]
sessionInfo[2]
can refer to it's corresponding SED entry as[1, 0]
Session Info Structure - Enable And Use
Session Info Structure - Use Pre-Enabled Session
Change Type
Checklist