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

bug(evm): discrepancy of the txIndex in the ethereum_tx event #2046

Closed
onikonychev opened this issue Sep 22, 2024 · 1 comment
Closed

bug(evm): discrepancy of the txIndex in the ethereum_tx event #2046

onikonychev opened this issue Sep 22, 2024 · 1 comment
Assignees

Comments

@onikonychev
Copy link
Contributor

See the block results below and notice that the same transaction has 2 events ethereum_tx and two different txIndex values 0 and 1. The correct value is 0.

{
   "jsonrpc":"2.0",
   "id":-1,
   "result":{
      "height":"47",
      "txs_results":[
         {
            "code":0,
            "data":"ErcECiEvZXRoLmV2bS52MS5Nc2dFdGhlcmV1bVR4UmVzcG9uc2USkQQKQjB4YWFmMDBkYzA4MDQ0NmM5ZWRhYzBkYWJjODEzMGE2YWE1MTcyZmJmMzQ1ODViMmEyNzcyOTQ0NTk1NTY0ZDU3NRKkAwoqMHg0N0Y0MTJCYzYxZEZjQjJmOERGMzNDQTA1NjBEZjE2NTc4Njk1OTYxEkIweGRkZjI1MmFkMWJlMmM4OWI2OWMyYjA2OGZjMzc4ZGFhOTUyYmE3ZjE2M2M0YTExNjI4ZjU1YTRkZjUyM2IzZWYSQjB4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwYzBmNGI0NTcxMjY3MGNmNzg2NWExNDgxNmJlOWFmOTA5MWVkZGExZBJCMHgwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDBjM2M0MjFiNzlhZjVmY2RmODNkNzhlMjExNjkwMmZkMTYxNzAzNjg3GiAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI4byb8EAACAvKkIweGFhZjAwZGMwODA0NDZjOWVkYWMwZGFiYzgxMzBhNmFhNTE3MmZiZjM0NTg1YjJhMjc3Mjk0NDU5NTU2NGQ1NzU6QjB4MjdkMjFiYTUzZDg0ZTRlODk5ZGJlMTg4N2YxNTE0NzU2NWViYTUwMGM0YjdlOTVhNTgwMDg4NTQwODJiYzEzYRogAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEo5pcD",
            "log":"[{\"msg_index\":0,\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/eth.evm.v1.MsgEthereumTx\"},{\"key\":\"sender\",\"value\":\"nibi1cr6tg4cjvux00pj6zjqkh6d0jzg7mksaywxyl3\"}]},{\"type\":\"eth.evm.v1.EventContractExecuted\",\"attributes\":[{\"key\":\"contract_addr\",\"value\":\"\\\"0x47F412Bc61dFcB2f8DF33CA0560Df16578695961\\\"\"},{\"key\":\"sender\",\"value\":\"\\\"0xC0f4b45712670cf7865A14816bE9Af9091EDdA1d\\\"\"}]},{\"type\":\"ethereum_tx\",\"attributes\":[{\"key\":\"amount\",\"value\":\"0\"},{\"key\":\"ethereumTxHash\",\"value\":\"0xaaf00dc080446c9edac0dabc8130a6aa5172fbf34585b2a2772944595564d575\"},{\"key\":\"txIndex\",\"value\":\"1\"},{\"key\":\"txGasUsed\",\"value\":\"52198\"},{\"key\":\"txHash\",\"value\":\"6EF436BB4239E21703E8CF3B156E8348E05C609A4DD7FF7072F76165059D8AAA\"},{\"key\":\"recipient\",\"value\":\"0x47F412Bc61dFcB2f8DF33CA0560Df16578695961\"}]},{\"type\":\"tx_log\",\"attributes\":[{\"key\":\"txLog\",\"value\":\"{\\\"address\\\":\\\"0x47F412Bc61dFcB2f8DF33CA0560Df16578695961\\\",\\\"topics\\\":[\\\"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\\\",\\\"0x000000000000000000000000c0f4b45712670cf7865a14816be9af9091edda1d\\\",\\\"0x000000000000000000000000c3c421b79af5fcdf83d78e2116902fd161703687\\\"],\\\"data\\\":\\\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACOG8m/BAAA=\\\",\\\"blockNumber\\\":47,\\\"transactionHash\\\":\\\"0xaaf00dc080446c9edac0dabc8130a6aa5172fbf34585b2a2772944595564d575\\\",\\\"transactionIndex\\\":0,\\\"blockHash\\\":\\\"0x27d21ba53d84e4e899dbe1887f15147565eba500c4b7e95a58008854082bc13a\\\",\\\"logIndex\\\":0}\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"module\",\"value\":\"evm\"},{\"key\":\"sender\",\"value\":\"0xC0f4b45712670cf7865A14816bE9Af9091EDdA1d\"},{\"key\":\"txType\",\"value\":\"2\"}]}]}]",
            "info":"",
            "gas_wanted":"52198",
            "gas_used":"52198",
            "events":[
               {
                  "type":"coin_spent",
                  "attributes":[
                     {
                        "key":"spender",
                        "value":"nibi1cr6tg4cjvux00pj6zjqkh6d0jzg7mksaywxyl3",
                        "index":true
                     },
                     {
                        "key":"amount",
                        "value":"52198unibi",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"coin_received",
                  "attributes":[
                     {
                        "key":"receiver",
                        "value":"nibi17xpfvakm2amg962yls6f84z3kell8c5l8u8ezw",
                        "index":true
                     },
                     {
                        "key":"amount",
                        "value":"52198unibi",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"transfer",
                  "attributes":[
                     {
                        "key":"recipient",
                        "value":"nibi17xpfvakm2amg962yls6f84z3kell8c5l8u8ezw",
                        "index":true
                     },
                     {
                        "key":"sender",
                        "value":"nibi1cr6tg4cjvux00pj6zjqkh6d0jzg7mksaywxyl3",
                        "index":true
                     },
                     {
                        "key":"amount",
                        "value":"52198unibi",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"message",
                  "attributes":[
                     {
                        "key":"sender",
                        "value":"nibi1cr6tg4cjvux00pj6zjqkh6d0jzg7mksaywxyl3",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"tx",
                  "attributes":[
                     {
                        "key":"fee",
                        "value":"52198unibi",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"ethereum_tx",
                  "attributes":[
                     {
                        "key":"ethereumTxHash",
                        "value":"0xaaf00dc080446c9edac0dabc8130a6aa5172fbf34585b2a2772944595564d575",
                        "index":true
                     },
                     {
                        "key":"txIndex",
                        "value":"0",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"message",
                  "attributes":[
                     {
                        "key":"action",
                        "value":"/eth.evm.v1.MsgEthereumTx",
                        "index":true
                     },
                     {
                        "key":"sender",
                        "value":"nibi1cr6tg4cjvux00pj6zjqkh6d0jzg7mksaywxyl3",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"eth.evm.v1.EventContractExecuted",
                  "attributes":[
                     {
                        "key":"contract_addr",
                        "value":"\"0x47F412Bc61dFcB2f8DF33CA0560Df16578695961\"",
                        "index":true
                     },
                     {
                        "key":"sender",
                        "value":"\"0xC0f4b45712670cf7865A14816bE9Af9091EDdA1d\"",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"ethereum_tx",
                  "attributes":[
                     {
                        "key":"amount",
                        "value":"0",
                        "index":true
                     },
                     {
                        "key":"ethereumTxHash",
                        "value":"0xaaf00dc080446c9edac0dabc8130a6aa5172fbf34585b2a2772944595564d575",
                        "index":true
                     },
                     {
                        "key":"txIndex",
                        "value":"1",
                        "index":true
                     },
                     {
                        "key":"txGasUsed",
                        "value":"52198",
                        "index":true
                     },
                     {
                        "key":"txHash",
                        "value":"6EF436BB4239E21703E8CF3B156E8348E05C609A4DD7FF7072F76165059D8AAA",
                        "index":true
                     },
                     {
                        "key":"recipient",
                        "value":"0x47F412Bc61dFcB2f8DF33CA0560Df16578695961",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"tx_log",
                  "attributes":[
                     {
                        "key":"txLog",
                        "value":"{\"address\":\"0x47F412Bc61dFcB2f8DF33CA0560Df16578695961\",\"topics\":[\"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\"0x000000000000000000000000c0f4b45712670cf7865a14816be9af9091edda1d\",\"0x000000000000000000000000c3c421b79af5fcdf83d78e2116902fd161703687\"],\"data\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACOG8m/BAAA=\",\"blockNumber\":47,\"transactionHash\":\"0xaaf00dc080446c9edac0dabc8130a6aa5172fbf34585b2a2772944595564d575\",\"transactionIndex\":0,\"blockHash\":\"0x27d21ba53d84e4e899dbe1887f15147565eba500c4b7e95a58008854082bc13a\",\"logIndex\":0}",
                        "index":true
                     }
                  ]
               },
               {
                  "type":"message",
                  "attributes":[
                     {
                        "key":"module",
                        "value":"evm",
                        "index":true
                     },
                     {
                        "key":"sender",
                        "value":"0xC0f4b45712670cf7865A14816bE9Af9091EDdA1d",
                        "index":true
                     },
                     {
                        "key":"txType",
                        "value":"2",
                        "index":true
                     }
                  ]
               }
            ],
            "codespace":""
         }
      ],
      "begin_block_events":[
         {
            "type":"coin_spent",
            "attributes":[
               {
                  "key":"spender",
                  "value":"nibi17xpfvakm2amg962yls6f84z3kell8c5l8u8ezw",
                  "index":true
               },
               {
                  "key":"amount",
                  "value":"",
                  "index":true
               }
            ]
         },
         {
            "type":"coin_received",
            "attributes":[
               {
                  "key":"receiver",
                  "value":"nibi1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8s6q9qv",
                  "index":true
               },
               {
                  "key":"amount",
                  "value":"",
                  "index":true
               }
            ]
         },
         {
            "type":"transfer",
            "attributes":[
               {
                  "key":"recipient",
                  "value":"nibi1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8s6q9qv",
                  "index":true
               },
               {
                  "key":"sender",
                  "value":"nibi17xpfvakm2amg962yls6f84z3kell8c5l8u8ezw",
                  "index":true
               },
               {
                  "key":"amount",
                  "value":"",
                  "index":true
               }
            ]
         },
         {
            "type":"message",
            "attributes":[
               {
                  "key":"sender",
                  "value":"nibi17xpfvakm2amg962yls6f84z3kell8c5l8u8ezw",
                  "index":true
               }
            ]
         },
         {
            "type":"commission",
            "attributes":[
               {
                  "key":"amount",
                  "value":"",
                  "index":true
               },
               {
                  "key":"validator",
                  "value":"nibivaloper1zaavvzxez0elundtn32qnk9lkm8kmcszuwx9jz",
                  "index":true
               }
            ]
         },
         {
            "type":"rewards",
            "attributes":[
               {
                  "key":"amount",
                  "value":"",
                  "index":true
               },
               {
                  "key":"validator",
                  "value":"nibivaloper1zaavvzxez0elundtn32qnk9lkm8kmcszuwx9jz",
                  "index":true
               }
            ]
         }
      ],
      "end_block_events":[
         {
            "type":"eth.evm.v1.EventBlockBloom",
            "attributes":[
               {
                  "key":"bloom",
                  "value":"\"00000000200000040000000000400000000000000000010000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000010000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000002000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000\"",
                  "index":true
               }
            ]
         }
      ],
      "validator_updates":null,
      "consensus_param_updates":{
         "block":{
            "max_bytes":"22020096",
            "max_gas":"-1"
         },
         "evidence":{
            "max_age_num_blocks":"100000",
            "max_age_duration":"172800000000000",
            "max_bytes":"1048576"
         },
         "validator":{
            "pub_key_types":[
               "ed25519"
            ]
         },
         "version":{
            
         }
      }
   }
}
@github-project-automation github-project-automation bot moved this to ⚡ Building 🧱 in ⚛️ Nibiru (Hougyoku) Sep 22, 2024
@github-actions github-actions bot added the S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 label Sep 22, 2024
@onikonychev
Copy link
Contributor Author

Fixed in #2053

@github-project-automation github-project-automation bot moved this from ⚡ Building 🧱 to ✅ Completed in ⚛️ Nibiru (Hougyoku) Oct 8, 2024
@Unique-Divine Unique-Divine removed the S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants