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

Cleanup of Wallet Deposit Endpoints #59

Open
duizer opened this issue Aug 9, 2023 · 1 comment
Open

Cleanup of Wallet Deposit Endpoints #59

duizer opened this issue Aug 9, 2023 · 1 comment

Comments

@duizer
Copy link
Contributor

duizer commented Aug 9, 2023

Wallet Deposit Endpoints are easily created, which means that there is a case where they are never used. At the time of writing, there is no cleanup of unused Wallet Deposit Endpoint. This could lead to a potential performance issue.

Things to consider here is what is "unused" and do we need some lifetime period.

@MartinSchmidt
Copy link
Member

This is indeed a good question, but if you gave the WalletDepositEndpoint to someone, and deleted you own reference to it, then they would be able to transfer to it on the registry level, but the WalletSystem would reject it, this leaves the Slice in limbo where no one can regain control of it.

We could make transfers similar to how allocate/claim works, so that a receiver has to receive on the registries as well before the transfer is complete, if not done, then the sender can revoke the transfer, only if the receiver has not completet it ofcouse.

sequenceDiagram
    SenderWallet->>Registry: TransferSlice
    SenderWallet->>ReceiverWallet: Send receiverSlice

    alt receiveSlice Success
        ReceiverWallet->>Registry: CompleteTransfer
    else fails
        SenderWallet->>Registry: RevokeTransfer
    end
Loading

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

No branches or pull requests

2 participants