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

clear responsibilities #2125

Merged
merged 2 commits into from
Nov 5, 2024
Merged

clear responsibilities #2125

merged 2 commits into from
Nov 5, 2024

Conversation

tudor-malene
Copy link
Collaborator

Why this change is needed

in preparation for adding the Session keys functionality to the Ten gateway, we need to structure the business logic a bit better

What changes were made as part of this PR

  • move the rpc connection pool to a separate type
  • only use a single type of "User" object in the codebase.
  • create a separate cache for the users
  • use the StorageWithCache

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

Copy link
Contributor

@zkokelj zkokelj left a comment

Choose a reason for hiding this comment

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

Few minor things:

tools/walletextension/storage/storage_test.go is broken
(it should be a quick fix.. adding logger to new storage and renaming user.PrivateKey to user.UserKey)

I was thinking about caching users in the gateway.
If we want to run multiple gateway backends this might be a bit of a problem, since each has separate cache and for example adding a user won't invalidate cache on another gateway instance and that instance will continue to think that this new address was not authenticated by this user.
Just something to keep in mind.

Otherwise LGTM

@tudor-malene tudor-malene merged commit c6a05ca into main Nov 5, 2024
2 checks passed
@tudor-malene tudor-malene deleted the tudor/pre-sk-refactor-2 branch November 5, 2024 11:09
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.

2 participants