-
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
R4R: JSON-stringify ABCI Log w/ Msg Indexes #3606
Conversation
cc @cosmos/cosmos-ui |
Codecov Report
@@ Coverage Diff @@
## develop #3606 +/- ##
===========================================
+ Coverage 60.97% 61.01% +0.03%
===========================================
Files 187 187
Lines 14065 14069 +4
===========================================
+ Hits 8576 8584 +8
+ Misses 4945 4941 -4
Partials 544 544 |
imo |
@faboweb @alessio @jackzampolin I updated the |
I still propose Expected result:
|
Also why is log an Array? The result only displays one |
Ping for this. |
If the Tx carries multiple messages, there would be a log entry for each message - @alexanderbez correct me if I am mistaken please |
ah ok, but there would still just be one hash for the whole multi message tx? |
Correct one tx hash for one tx @faboweb. If you would like to change the actual type of |
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.
I think this is a good change that makes life better for clients of the SDK. Obviously we can't fix the root cause which requires ABCI changes. LGTM.
I disagree. We can post process the ABCI message in the REST server and deserialize the string to JSON (object). This is probably one line of code. |
I don't follow @faboweb, you're ultimately returning the following: return abci.ResponseCheckTx{ // Or ResponseDeliverTx
Code: uint32(result.Code),
Data: result.Data,
Log: result.Log, // this is a string and must be per ABCI (which is already JSON encoded!!!)
GasWanted: int64(result.GasWanted),
GasUsed: int64(result.GasUsed),
Tags: result.Tags,
} What are you proposing to change? Can you point to some code or suggested code? |
In your version:
log is a stringified JSON. I expect:
here log is an array which a client can directly go through without deserializing it. |
So you want it to be a @faboweb if you disapprove of this PR, which I personally think is a huge step forward and should be merged, then please decline and open a separate issue in Tendermint where further discussion can take place. |
@faboweb Happy to discuss this in more detail, but as @alexanderbez mentions, there is no consistency with the return in the log field from tendermint. Everything from custom error messages to full stack traces get dumped in there and we don't have a good way to parse that out. This PR represents a step forward in providing at least marginally useful error messages to clients. Let's not let perfect be the enemy of good here. |
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.
ACK (pending conflicts are resolved)
JSON-stringify the ABCI log in
BaseApp
to include the message index, log, and success value.Log
now contains a JSON encoded array parsable by clients.e.g. REST response
e.g. CLI response
closes: #3601
closes: #2953
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: