-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Intelligently format transaction responses & errors in CLI #2953
Comments
This might require changing the upstream library (some error type in |
Cosmos message failures return an inconsistent ABCI Log value. In some instances the Log message is prefixed with Without prefix:
With prefix:
The Line 630 in 2435761
|
Yeeeeeeeees 🚀 |
@cwgoes is this needed prelaunch? Can we come up with a standardized format in regards to the response (e.g. |
@alexanderbez It would be great to have prelaunch. This issue pretty significantly affects the user experience on the CLI. Ideally the errors can be formatted in a couple of different ways (string format[s] would be nice too), and we aren't displaying codespace info. |
What I'm asking for is essentially what is the actionable item here? Do we still want JSON? Do we want plaintext? If so, what format? etc... |
So the |
@alexanderbez What about removing the prefix all together to allow for parsing? |
But if we remove the prefix, you wont know what error is for what message when you have multi-msg txs. |
We could have a struct that is |
Can the log be an array with one entry for every message? It looks like currently its a long string with a |
Perhaps, but in either case, this is an ABCI change that must happen in Tendermint first. An issue should be opened to change the type of |
So I took a peek at this this morning. It seems like the stringification of the SDK errors happens in type Log struct {
MsgIdx int
MsgLog string
} This doesn't account for tendermint errors however. Those will be passed error back in the So it seems like we could improve the way the SDK reports errors, but there will still be an issue with the way tendermint returns errors tho. Its unclear to me why the change to TM would require ABCI changes. We could just switch to a format thats parsable by the SDK right? |
Yes, correct. It's because |
cc @alessio thoughts / want to work on this? |
This issue is related to the PR I'm working on #3276. Currently, that PR is effectively an "escape hatch" for the current way CLI tx responses are formatted so that I can do useful formatting when I know what type of response to expect. These things may have been discussed elsewhere, but as an SDK user I just want to share what I would like to see in terms of intelligent tx response formatting (in addition to what's already been discussed here):
Hope this is helpful. |
Not as default, please. JSON as an option is most definitely a must have, we also need human-readable version format. |
How about something like: Tags:
action: send
GasUsed: 2000
GasWanted: 2500
... Which is effectively yaml, but human readable |
Makes sense for transaction responses |
So I'd like to make a concrete proposal for the default, human readable transaction response printing in the case when there are no errors. Not quite yaml but close (Tags for one isn't actually a map):
If any of the fields By default type TxResponseFormatting struct {
// makes Data print as a string in the default transaction response formatting
// Data gets printed as base64 by default
StringData bool
// makes Tags print as binary in the default transaction response formatting
// Tags get printed as strings by default
BinaryTags bool
} Thoughts? |
Looks like #3451 will close this ultimately. |
I'm not sure we want to fully close this issue (perhaps we can track further progress via #3601), but afaik we have not fully tackled the issue of failed messages and the way they're rendered in the ABCI log (not proper JSON). |
cc @jackzampolin
The text was updated successfully, but these errors were encountered: