Skip to content
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

Events for failed transactions #10618

Closed
4 tasks
Vritra4 opened this issue Nov 26, 2021 · 8 comments · Fixed by #11609
Closed
4 tasks

Events for failed transactions #10618

Vritra4 opened this issue Nov 26, 2021 · 8 comments · Fixed by #11609

Comments

@Vritra4
Copy link
Contributor

Vritra4 commented Nov 26, 2021

Summary of Bug

  • Events for failed transactions are empty although there's some fees paid.

Problem Definition

for failed transactions

Successful transactions have events about fee.
But failed transactions like below are have no events although there's some fees paid.
I think failed transactions also should have events about fee.

      {
        "code": 11,
        "data": null,
        "log": "out of gas in location: WritePerByte; gasWanted: 1069927, gasUsed: 1071169: out of gas",
        "info": "",
        "gas_wanted": "1069927",
        "gas_used": "1071169",
        "events": [],
        "codespace": "sdk"
      },

Version

v0.44.2

Steps to Reproduce

  1. invoke a Tx to be failed
  2. query Tx info

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@tac0turtle
Copy link
Member

DOnt see why a reason not to do this, would you be open to submitting a PR?

@alexanderbez
Copy link
Contributor

This is because we do not return an *sdk.Result if runMsgs fails. Returning events for a failed tx would break the non-nil semantics of *sdk.Result here. Not say this can't be done, but rather it wasn't done on purpose.

@yun-yeo
Copy link
Contributor

yun-yeo commented Nov 29, 2021

The purpose of this is for rosetta reconciliation test.

It requires to track whole tx balance changes including failed txs, which still spending fee but there is no tx events left. Due to absent of event logs, this reconciliation test continually failed when the account has failed tx.

@alexanderbez
Copy link
Contributor

Yes, I totally understand the motivation -- I'm just stating why it wasn't done. Returning events as a separate value works, albeit I don't think it's the cleanest solution, but it works.

@ghost
Copy link

ghost commented Nov 30, 2021

Doesnt this get addressed via #10630?

@alexanderbez
Copy link
Contributor

Doesnt this get addressed via #10630?

No, #10630 add Events to the response type -- this has the effect of including both message-related events and non-message related events (i.e. ante-handler).

This PR supports including events for failed txs.

@ghost
Copy link

ghost commented Nov 30, 2021

Ahh, that makes sense.

@jim423
Copy link

jim423 commented May 10, 2022

Hi, may I ask what the /txs API of querying for failed txs by ante events looks like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants