-
Notifications
You must be signed in to change notification settings - Fork 931
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
feat(state): enable fee granting #3304
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3304 +/- ##
==========================================
- Coverage 44.83% 44.81% -0.02%
==========================================
Files 265 272 +7
Lines 14620 15061 +441
==========================================
+ Hits 6555 6750 +195
- Misses 7313 7545 +232
- Partials 752 766 +14 ☔ View full report in Codecov by Sentry. |
Can you try this approach and see if this works? 🙏 |
Hey @Bidon15 Please find all info below:
https://mocha-4.celenium.io/tx/4a317410cf3a0ccc86169a1774d796fc3f37a47f109f7a00664ea155fcc86e9b https://mocha-4.celenium.io/tx/165865c66fa785bae7b9e73b21abe20b1c0cff97ad1a80dbde0b3a6ee29f4003
|
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.
Logically, these changes are sound and I only have a few adjacent comments.
While I was reviewing this, I was thinking about the broader picture. Will node API eventually support all transactions that can be submitted to the Celestia state machine or only a subset that is specifically relevant to rollup nodes? If we're taking a minimalist stance I don't see why the grant-fee
and revoke-grant-fee
cli needs to be supported. These already exist in the app cli so do we really need to duplicate it here.
My naive implementation of this would have been to add a field feeGranter in the coreAccessor struct that can be set in the constructor and then simply in every SubmitPayForBlob
, check if it is set and then set it in the transaction that goes to the Signer
- that way light nodes are now compliant with the fee granter protocol
I would say so, considering merge and API unification efforts. We can start piece by piece as use cases come. Thoughts or objections? |
I like the general principle of it doesn't matter which node you talk to, they all have the same API |
Co-authored-by: Callum Waters <cmwaters19@gmail.com>
Co-authored-by: rene <41963722+renaynay@users.noreply.github.com>
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.
LGTM.
Resolves #3256
Tested on mocha:
Run funded light node and grant unlimited fee to the newly created FN:
celestia state grant-fee celestia12psg90lwvxdktnqerr2p5mxuw2v3je497uv6tj 2000 1000000 --node.store ~/.celestia-light-mocha-4/
Run FN and submitted blob:
celestia blob submit 0x42690c204d39600fddd3 'gm' --node.store ~/.celestia-full-mocha-4/
Result: blob was successfully submitted:
Run revoke-fee cmd on the LN:
celestia state revoke-grant-fee celestia12psg90lwvxdktnqerr2p5mxuw2v3je497uv6tj 2000 1000000 --node.store ~/.celestia-light-mocha-4/
Submitted blob from the FN and got an error back:
Run grant fee with a very small limit:
celestia state grant-fee celestia12psg90lwvxdktnqerr2p5mxuw2v3je497uv6tj 2000 1000000 --amount 10 --node.store ~/.celestia-light-mocha-4/
Submitting blobs now returns an error: