-
Notifications
You must be signed in to change notification settings - Fork 10
feat: wallet-service nano contract update #96
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
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| We could make it work with sparse keys with a common prefix but a better alternative is to use a JSON key, where each key will be the address and the value will be the seqnum. | ||
|
|
||
| - Clearing the cache can be done with [JSON.CLEAR](https://redis.io/docs/latest/commands/json.clear/) |
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.
I like the idea of using redis since we already have it in the stack
But can you describe better how this is going to work?
I mean, when are we going to clear cache? Or is the number only going up for all addresses?
| 5. Forward any contract-specific API calls to the fullnode | ||
|
|
||
| This means that if address is the caller in a contract call that moves tokens from X to Y (e.g. a deposit action), all three addresses will see this transaction in their history: | ||
| This means that if address Z is the caller in a contract call that moves tokens from X to Y (e.g. a deposit action), all three addresses will see this transaction in their history: |
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.
This is not a problem bug "contract call that moves tokens from X to Y (e.g. a deposit action)" a deposit action moves tokens from X to the contract, not to an address Y. Maybe this address Y could be the change address.
|
|
||
| ### Seqnum tracking | ||
|
|
||
| The `seqnum` should be easily searched by address and listed (for clearing when a block arrives). |
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.
I was thinking about this tracking. We will set the current seqnum every time a new nano transaction arrives from the reliable integrations event. When building a new nano tx in the wallet lib, we need to know the next seqnum to use, so (i) we must have a way to fetch this seqnum from the wallet service, and (ii) how long does it take for the new event to be processed and the seqnum updated? Should we have a way to update this seqnum as soon as the transaction is pushed to the network (if done using the wallet service APIs)?
rendered