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

Problem: some balance tracking events are missing #706

Closed
mr-kenikh opened this issue Feb 19, 2022 · 2 comments
Closed

Problem: some balance tracking events are missing #706

mr-kenikh opened this issue Feb 19, 2022 · 2 comments

Comments

@mr-kenikh
Copy link

On v2.x.x (with Cosmos sdk <= 0.42.9) no events were emitted for failed transactions at txs_results in block_results.
For example, B50BDC617EBA33412B92AA11B58EE54EE055A8A3666846D735A9381813B06535 in block 3,526,796:

{
  "code": 13,
  "data": null,
  "log": "failed to execute message; message index: 1: receive packet verification failed: packet sequence (1917) already has been received: invalid packet",
  "info": "",
  "gas_wanted": "479656",
  "gas_used": "416404",
  "events": [],
  "codespace": "channel"
}

Since v3.x.x (with Cosmos sdk >= 0.43.0) events are emitted even for failed transactions (including balance tracking events).
For example, 4B0DD315C33C45571F730B506891A514D78BD23BF71A54DDCE202107DF769E90 in block 4,142,573:

{
  "code": 14,
  "data": null,
  "log": "failed to execute message; message index: 1: receive packet verification failed: block timestamp >= packet timeout timestamp (2022-01-19 07:17:47.384616821 +0000 UTC >= 2022-01-19 07:17:45.081402022 +0000 UTC): packet timeout",
  "info": "",
  "gas_wanted": "558831",
  "gas_used": "444972",
  "events": [
    {
      "type": "coin_spent",
      "attributes": [
        {
          "key": "spender",
          "value": "cro1gcpguzf4j4tn6yes764p0cm3c7umzssk3rsydl",
          "index": false
        },
        {
          "key": "amount",
          "value": "55884basecro",
          "index": false
        }
      ]
    },
    {
      "type": "coin_received",
      "attributes": [
        {
          "key": "receiver",
          "value": "cro17xpfvakm2amg962yls6f84z3kell8c5lgztehv",
          "index": false
        },
        {
          "key": "amount",
          "value": "55884basecro",
          "index": false
        }
      ]
    },
    {
      "type": "transfer",
      "attributes": [
        {
          "key": "recipient",
          "value": "cro17xpfvakm2amg962yls6f84z3kell8c5lgztehv",
          "index": false
        },
        {
          "key": "sender",
          "value": "cro1gcpguzf4j4tn6yes764p0cm3c7umzssk3rsydl",
          "index": false
        },
        {
          "key": "amount",
          "value": "55884basecro",
          "index": false
        }
      ]
    },
    {
      "type": "message",
      "attributes": [
        {
          "key": "sender",
          "value": "cro1gcpguzf4j4tn6yes764p0cm3c7umzssk3rsydl",
          "index": false
        }
      ]
    },
    {
      "type": "tx",
      "attributes": [
        {
          "key": "fee",
          "value": "55884basecro",
          "index": false
        }
      ]
    },
    {
      "type": "tx",
      "attributes": [
        {
          "key": "acc_seq",
          "value": "cro1gcpguzf4j4tn6yes764p0cm3c7umzssk3rsydl/6207",
          "index": false
        }
      ]
    },
    {
      "type": "tx",
      "attributes": [
        {
          "key": "signature",
          "value": "0se3sGU7JSry2lWDjTMKDi+rgmCEM5q6wnbT3qUwmC9tVQpm3r6w8t0MTubHGT4rrX2yUlC9snezvB2SnY2xMQ==",
          "index": false
        }
      ]
    }
  ],
  "codespace": "channel"
}

But there are still failed transactions for which no events are emitted.
For example, D75ADA55BF9BBFFE17BCEBA34CB69E659DE2B5DC9F7EA1E85634F424F1756199 in block 4,423,509:

{
  "code": 32,
  "data": null,
  "log": "account sequence mismatch, expected 896, got 899: incorrect account sequence",
  "info": "",
  "gas_wanted": "500000",
  "gas_used": "45695",
  "events": [],
  "codespace": "sdk"
}

All failed transactions due to account sequence mismatch do not have events.

Related to: (x/bank) #8656 balance and supply are now correctly tracked via coin_spent, coin_received, coinbase and burn events.

@devashishdxt
Copy link
Collaborator

Hi @mr-kenikh

Cosmos SDK does not generate any events when transaction fails in one of the auth middlewares (for example, signature verification, nonce matching, etc.). If you want more details on this, you can create an issue with Cosmos SDK.

@tomtau
Copy link
Contributor

tomtau commented Feb 21, 2022

a related issue: cosmos/cosmos-sdk#9375

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

No branches or pull requests

3 participants