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

[SPIKE] UX flow for extending TTL #1689

Closed
sdfcharles opened this issue Nov 19, 2024 · 4 comments
Closed

[SPIKE] UX flow for extending TTL #1689

sdfcharles opened this issue Nov 19, 2024 · 4 comments
Assignees

Comments

@sdfcharles
Copy link

No description provided.

@sdfcharles sdfcharles self-assigned this Nov 19, 2024
@sdfcharles sdfcharles changed the title [design] UX flow for extending TTL [DESIGN] UX flow for extending TTL Nov 21, 2024
@sdfcharles
Copy link
Author

Seems to be same as #1693

@JakeUrban JakeUrban changed the title [DESIGN] UX flow for extending TTL UX flow for extending TTL Dec 9, 2024
@piyalbasu piyalbasu reopened this Dec 10, 2024
@aristidesstaffieri aristidesstaffieri changed the title UX flow for extending TTL [SPIKE] UX flow for extending TTL Dec 13, 2024
@aristidesstaffieri
Copy link
Contributor

Eng Spike:

There are 2 scenarios where expired data or contracts can affect the UX in Freighter:

  • A data entry has expired, and that entry either represents data that Freighter uses in the UI or is an entry that is needed as part of an operation that Freighter supports.
  • A contract instance has expired and Freighter relies on that contract.

Right now, we don't have a way to track TTLs for specific entries in order to display the "archived entry" icon. There are a few things we can consider when finding a solution for this data:

  • Does this icon and the TTL flow from the asset dropdown encompass both expired data and the contract instances themselves? TTLs for SACs get bumped whenever they are used, inline with the operation. It might be unlikely that users need this flow for more commonly used assets.
  • Do we support this workflow for custom tokens? If so, how do we determine which entries to track? Custom tokens could have any storage layout supported by Soroban.

Other considerations:

Should we also prioritize a bump and/or restore workflow for our submit tx flows? It seems more likely that users will need this when they try to submit a transaction and it is rejected due to an entry being archived.

Should we prioritize improving our archived entry related error messages? Right now, users have a hard time understanding that they're transaction has failed due to an expired entry in Freighter. We could add more user friendly error messages for these cases.

Looking up entries using ledger keys on the rpc can be a slow process with several trips to the ledger. We will likely get much better performance from a proper index of this data, and if we decide to implement this check on the asset list, then the latency affects our home page loading time so we may want to be sensitive to this. We could also get similar UX by handling archived entry related errors during balance fetching in a way that informed the client that the entry or contract is archived.

@JakeUrban
Copy link
Contributor

JakeUrban commented Dec 17, 2024

Thanks @aristidesstaffieri, after reading this I'm not sure if we should support extending TTLs, at least right now.

I think we need to step back and ask ourselves why we want to provide users the ability to extend TTLs. I can think of two reasons:

  1. We read ledger state in order to display information to the user. If this state was archived, we wouldn't be able to read it and therefore provide it to the user.
    • For example, we currently fetch custom token balance entires using RPC to display the user's balance on the home page.
  2. We submit transactions on behalf of our users. If these transactions rely on entires that are archived, the won't be able to submit these transactions without restoring the entries first.
    • For example, we support sending to C... address, and the contract we're sending to or the token contract we need to call could be archived.

On the first point, we already have a solution: we need to index any state Freighter provides to the user off-chain, so we don't rely on the state being live. This is why the wallet backend needs to track account balances. I don't think we use any other ledger state in the UI.

On the second point, I think restoring entires on an as-needed basis might be better than trying to track all entries we may need when submitting transactions for users. Right now, the state we would need to track are custom token balance entires, and token contract entires (for stellar asset and custom token contracts). Tracking these entires is probably doable, however, I can see a future where we integrate with defi protocols, and therefore may need to extend TTLs for entires on that contract. I don't think its practical to track an ever-expanding set of entires that Freighter user's can use when executing transactions.

Given that, I recommend we mark this task as done and create new ones for the two solutions mentioned above: indexing any state needed for read-only purposes and supporting on-demand restoration of any state needed for write (i.e. transaction execution) purposes.

@aristidesstaffieri
Copy link
Contributor

@JakeUrban that sounds good, I def think this needs some more detail.

I made this one for indexing data and this one for the restore & retry action.

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

4 participants