-
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
Multiple events are merged into one in transactin result log #14015
Comments
we send events back per tx, we don't do any sort of grouping on our side. This is tender mints endpoint . I think we need to reopen there. |
The flattening is explicitely implemented here: // Flatten returns a flattened version of StringEvents by grouping all attributes
// per unique event type.
func (se StringEvents) Flatten() StringEvents { which is used in msgLogs = append(msgLogs, sdk.NewABCIMessageLog(uint32(i), msgResult.Log, msgEvents)) I am not at all familiar with this codebase but it seems like this was implemented here on purpose at some point. |
FWIW, the flattened logs are in submitted order, and those with multiple fields are in submitted order as well. Thus the idx on the unique fields remains consistent to allow for grouping. Though I agree its super annoying to have to do that anyways. |
Is there still an issue here @webmaster128? |
Yes, so the text document written to the |
IIRC, we flatten due to Tendermint constraints (a string). Do you have a concrete proposal? |
The problem is when you use custom events, they are pushed into a map and you don't know which one came first. So if your transaction emits the event in the following order.
They can come out with a totally different order |
Usually we use the log field which afaik comes from the sdk as pointed by @webmaster128 added through this #4648 |
Yes, so the [
{
"events": [
{ So nothing should stop us from filling this |
wow blast from the past on the linked pr. We will look into what we can do to assist you guys here. |
Thank you for fixing this! |
Summary of Bug
Hi there! I seems like the JSON string in the
tx_result.log
field is wrong. Multiple events get merged together.The issue leads to problems with the relayer (ts-relayer in my case). It reads the
log
but then only finds one packet to send, not all of them. In the meantime we changed to reading tx events directy, but thelog
should still be correct I guess.At tendermint/tendermint#9595 it was pointed out that this is likely a Cosmos SDK bug.
Version
Juno Testnet (SDK 0.45.x, Tendermint 0.34.x)
Steps to Reproduce
In the following you see 19 events
Output JSON with 19 events
However, when looking at the
log
field, the encoded JSON document only has 4 events:Output parsed log
As you can see for the
"type": "execute"
, multiple events get merged into one event:The full JSON outputs can be found at https://gist.github.com/webmaster128/14d273b3b462c1c653f51e3e1edb8cd5.
The text was updated successfully, but these errors were encountered: