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

Adding Session Storage Interface #256

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

tomarsachin2271
Copy link
Collaborator

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@linear
Copy link

linear bot commented Aug 19, 2023

SMA-60 Add session storage feature in the sdk

Add classes related to session storage with support for local storage initially and then later remote storage at some persistent storage as well.

Copy link
Contributor

@AmanRaj1608 AmanRaj1608 left a comment

Choose a reason for hiding this comment

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

I was thinking maybe we should another method as resetState which sets the data to null so if there is a mismatch in dapp the dapp wil reset the data and agar merkle with just one root value will be set?

@tomarsachin2271
Copy link
Collaborator Author

A method to reset the state can be added, but when will the client call this method? I hope this will be checked by the implementation of session storage interface which will check this matching of merkle root in storage with on-chain data

Copy link
Contributor

@livingrockrises livingrockrises left a comment

Choose a reason for hiding this comment

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

reviewed

sessionValidationModule: string
sessionKeyData: string
signerPublicKey: string
sessionID: string
Copy link
Contributor

Choose a reason for hiding this comment

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

would this not be optional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

validAfter: number
sessionValidationModule: string
sessionKeyData: string
signerPublicKey: string
Copy link
Contributor

Choose a reason for hiding this comment

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

can we rename to sessionPublicKey

status: SessionStatus
}

export type SessionSearchParam = {
Copy link
Contributor

Choose a reason for hiding this comment

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

from where we will get scw address information?
yesterday we discussed scw address, session validation module address and session pubkey will give a unique leaf.
but not just scw address and validation module address - as there may be two different session pub keys active in different browser for the same user for same session.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When user will create an instance of SessionLocalStorage then in that constructor user will pass SCW address and the json data that'll be stored in the storage will be against that scw address.

So if user uses a different SCW address tomorrow, then a new key and data will be created in local storage for that user. You'll see once you see the implementation of this interface.

Copy link
Contributor

@livingrockrises livingrockrises left a comment

Choose a reason for hiding this comment

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

LGTM

@livingrockrises livingrockrises merged commit 23fae58 into feat/modular-SA-V2-integration Aug 21, 2023
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