-
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/core_access): add TxConfig #3349
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3349 +/- ##
==========================================
+ Coverage 44.83% 45.66% +0.82%
==========================================
Files 265 274 +9
Lines 14620 15453 +833
==========================================
+ Hits 6555 7056 +501
- Misses 7313 7590 +277
- Partials 752 807 +55 ☔ View full report in Codecov by Sentry. |
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 PR looks good to me.
Just re-iterating that the most important feature/user-request is that users can submit blobs from different accounts. No other options should be added before that particular one. Having an options struct part of the JSON-RPC further more manifests that this current API is basically driven by implementation details (this is very go idiomatic). No blocker to merge this but sth I wanted to raise.
cc @renaynay
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 - want to discuss the gasLim
option there
Should we also update ADR 9 (API ADR)?
d4115b9
to
ea485bb
Compare
7622f8f
to
4df5175
Compare
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.
Question for potential follow-up PR:
should we break SubmitPayForBlob
on the state level to not take gasLim or fee and just use defaults? And then we can make blob module use SubmitPayForBlobWithOptions
under the hood if opts are specified?
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.
Are we going to add the optional parameters to the struct in this PR as discussed above?
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
Yes, I also thought about it. |
cdc22aa
to
88875ff
Compare
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.
LFG
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.
utACK
// gasPrice represents the amount to be paid per gas unit. | ||
// Negative gasPrice means user want us to use the minGasPrice | ||
// defined in the node. |
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.
nit: minGasPrice is a bit ambiguous because in celestia-app version >= 2, consensus nodes have a local min gas price. There is also a global network min gas price which is a governance modifiable parameter so perhaps it is worth clarifying which gas price this defaults to: the local min gas price or the network min gas price.
Resolves #3346
What was done:
Implemented a new TxConfig struct
The keyName field allows the user to use a non-default account from the Keystore to pay fees.
The granter field is moved from the state config. The user will need to specify the granter address each time he wants to submit a tx with a granter. The reason for moving the granter to the options struct is that previously user had to restart the node each time when he wanted to start/stop using
grantee
mode.Tested on mocha with several accounts:
List of breaking changes:
KeyringAccName
toDefaultKeyName
andKeyringBackend
toDefaultBackendName
in the config;blob.GasPrice
sinceblob.Submit
requiresSubmitOptions
which are type alias ofTxConfig
;state.Blob
which is an alias forapp.Blob
(State Module now requires blob type from app)(Was added to avoid circular dependency between node's blob Module and node's state Module);