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

feegrant UX: remove the headache for pre-funds #3221

Open
4 tasks
Bidon15 opened this issue Mar 28, 2024 · 6 comments
Open
4 tasks

feegrant UX: remove the headache for pre-funds #3221

Bidon15 opened this issue Mar 28, 2024 · 6 comments
Labels
enhancement New feature or request ice-box this label is automatically applied to all issues. it is removed after starting work needs:investigation more knowledge is required before item can be groomed nice to have item is not blocking or required. WS: Maintenance 🔧 includes bugs, refactors, flakes, and tech debt etc x/feegrant item is directly relevant to the blob module

Comments

@Bidon15
Copy link
Member

Bidon15 commented Mar 28, 2024

Summary

You need the account to be pre-funded in order to use fee grant module

Problem Definition

celestia-appd tx feegrant grant celestia1sung806mz9r4lwdpaw6usk7hcw42ku7kyun44w celestia1rgj3z5rfydj3xulhm6glqr0zs7j8rr9rfh6ekw --home ~/.celestia-app-devops/ --node [https://rpc.celestia-mocha.com:443](https://rpc.celestia-mocha.com/) --spend-limit 1000000utia --allowed-messages "/cosmos.bank.v1beta1.MsgSend,/celestia.blob.v1.MsgPayForBlobs" --chain-id mocha-4 --keyring-backend test --fees 20000utia --broadcast-mode block --yes

This is a successful tx - https://mocha.celenium.io/tx/802a17777fbeab416f6fa2c25f0c56dd9cc8a92afc2a96293d114ac7c22efb5c

From a user pov - why do you need to prefund this account after the fee that has been granted for blob msgs?
celestia1rgj3z5rfydj3xulhm6glqr0zs7j8rr9rfh6ekw

Should the state be updated already if the grant tx is successful? I've tried this hypothesis without prefunding step and failed
with insufficient balance error

Proposal

Ideally have the following UX:

  1. user creates a new account -> has 0 tia
  2. 3rd party grants blob submissions to this account
  3. blob submission is working as expected with no prefunding required

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@evan-forbes
Copy link
Member

we do have to have a mechanism to pay for the state created in the new account, so we can't create accounts with zero funds, however there likely is a way to automate the creation of an account. One simple way would be add a 1utia bank.MsgSend as the first sdk.Msg of this tx, which would create the account.

@evan-forbes evan-forbes added x/feegrant item is directly relevant to the blob module ice-box this label is automatically applied to all issues. it is removed after starting work needs:discussion item needs to be discussed as a group in the next sync. if marking an item, pls be prepped to talk and removed external labels Mar 28, 2024
@Bidon15
Copy link
Member Author

Bidon15 commented Apr 2, 2024

we do have to have a mechanism to pay for the state created in the new account, so we can't create accounts with zero funds, however there likely is a way to automate the creation of an account. One simple way would be add a 1utia bank.MsgSend as the first sdk.Msg of this tx, which would create the account.

Ngl, any interim solution is fine as we need this UX feature to be done. Otherwise feegrant is not going to be adopted by RaaS teams due to itching nerves experience

@cmwaters
Copy link
Contributor

cmwaters commented Apr 2, 2024

What I thought happened was if you grant something to an account that doesn't exist you would create that account such that the account could sign a transaction and part of the fee would go towards setting the pubkey (and executing the rest of the transaction)

@cmwaters
Copy link
Contributor

cmwaters commented Apr 2, 2024

@Bidon15
Copy link
Member Author

Bidon15 commented Apr 3, 2024

If you look here we should be creating the account: https://github.com/cosmos/cosmos-sdk/blob/7799bba7bc889288607576aa11655b5fc31a2da9/x/feegrant/keeper/keeper.go#L43-L48

you mean by creating the account - it should be created by default once we have the feegrant tx included?
bc in Rootul's gist, we are creating the account and funding it before doing the granting tx

https://gist.github.com/rootulp/c47606e177aad1f8959ea31fa077ca5e

@evan-forbes evan-forbes added needs:investigation more knowledge is required before item can be groomed WS: V3 3️⃣ item is directly relevant to the v3 hardfork and removed needs:discussion item needs to be discussed as a group in the next sync. if marking an item, pls be prepped to talk labels May 13, 2024
@evan-forbes
Copy link
Member

To complete this, I think we should write a quick script to sanity test that this is does occur after creating a grant for an account. If it doesn't, then that appears to be a bug in the x/feegrant module. At that point, we can write a simple function that generates a bank.MsgSend of 1utia to the account and appends it to the sdk.Msgs in the feegrant tx, or fix the bug in v3 in a state breaking way.

@evan-forbes evan-forbes added WS: Maintenance 🔧 includes bugs, refactors, flakes, and tech debt etc priority:high optional label to track the relative priority of planned items labels Jul 15, 2024
@rootulp rootulp modified the milestone: v3 Sep 12, 2024
@evan-forbes evan-forbes added nice to have item is not blocking or required. and removed priority:high optional label to track the relative priority of planned items WS: V3 3️⃣ item is directly relevant to the v3 hardfork labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ice-box this label is automatically applied to all issues. it is removed after starting work needs:investigation more knowledge is required before item can be groomed nice to have item is not blocking or required. WS: Maintenance 🔧 includes bugs, refactors, flakes, and tech debt etc x/feegrant item is directly relevant to the blob module
Projects
None yet
Development

No branches or pull requests

4 participants