cosmos / gaia

Cosmos Hub
https://hub.cosmos.network
Apache License 2.0
470 stars 692 forks source link

`/cosmos/tx/v1beta1/txs/` counldn't show the transaction is failed with relevant raw log. #1618

Closed yj0x0x closed 2 years ago

yj0x0x commented 2 years ago

Summary of Bug

Transaction 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5 was failed one.

But when I send query like below;

curl -v https://api.cosmos.network/cosmos/tx/v1beta1/txs/4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5 

I couldn't find that this transaction is failed with account sequence mismatch raw log.

But when I have seen this transaction through explorer, it said account sequence mismatch. https://www.mintscan.io/cosmos/txs/4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5

How can I get the raw message?

Please anyone guide would be appreciated.

Version

Steps to Reproduce


For Admin Use

yaruwangway commented 2 years ago

hi @yj0x0x , you are querying a different tx hash in mint scan and https://api.cosmos.network/cosmos

yj0x0x commented 2 years ago

Hello @yaruwangway I have updated my ticket.

Can I ask you please take a look?

yaruwangway commented 2 years ago

hi, when i try a different node. it is ok https://lcd-cosmoshub.whispernode.com/cosmos/tx/v1beta1/txs/4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5

yj0x0x commented 2 years ago

I mean I couldn't see the raw_log which shows account sequence mismatch.

Explorer shows that this tx is failed one.

How can I distinguish this tx is failed or success?

And https://lcd-cosmoshub.whispernode.com/cosmos/tx/v1beta1/txs/4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5

return is

{
    "code": 5,
    "message": "rpc error: code = NotFound desc = tx not found: 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5: key not found",
    "details": []
}
yaruwangway commented 2 years ago

you can distinguish if a tx sucess/fail by query the txHash

yaruwangway commented 2 years ago

so the above shows 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5 failed.

yj0x0x commented 2 years ago

You mean that

return like below shows that tx is failed one?

{
    "code": 5,
    "message": "rpc error: code = NotFound desc = tx not found: 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5: key not found",
    "details": []
}
yj0x0x commented 2 years ago

My node is archive one. It shows same result when I queried to https://api.cosmos.network/.

But I couldn't find account sequence mismatch.

How can I see that the failed tx data??

yaruwangway commented 2 years ago

I mean I couldn't see the raw_log which shows account sequence mismatch.

Explorer shows that this tx is failed one.

How can I distinguish this tx is failed or success?

And https://lcd-cosmoshub.whispernode.com/cosmos/tx/v1beta1/txs/4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5

return is

{
    "code": 5,
    "message": "rpc error: code = NotFound desc = tx not found: 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5: key not found",
    "details": []
}

Hi, sry, I mistake this err of not found as the tx failed. This is prob due to this node does not provide that height data but height more near recent.

yj0x0x commented 2 years ago

@yaruwangway OK. I understand.

Again , How can I get the account sequence mismatch raw_log like as explorer show to me?

okwme commented 2 years ago

I believe mintscan has an error.

I see successful transaction on bigdipper: https://cosmos.bigdipper.live/transactions/4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5 and on raw query here: https://api.cosmos.network/cosmos/tx/v1beta1/txs/4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5

I'll send them this issue and ask if they know what's going on.

okwme commented 2 years ago

closing for now as this doesn't seem to be a gaia issue

yj0x0x commented 2 years ago

Hello @okwme Please Reopen it. I don't think mintscan was an error. Because below query show that tx 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5 was account sequence mismatc.

curl -X GET http://127.0.0.1:26667/block_results?height=8721037

result below.

{
    "jsonrpc": "2.0",
    "id": -1,
    "result": {
        "height": "8721037",
        "txs_results": [
            {
                "code": 32,
                "data": null,
                "log": "account sequence mismatch, expected 171521, got 171522: incorrect account sequence",
                "info": "",
                "gas_wanted": "354905",
                "gas_used": "263617",
                "events": [],
                "codespace": "sdk"
            },
            .........

Rosetta API return said, tx 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5 was reverted type.

okwme commented 2 years ago

mintscan has updated the TX: https://www.mintscan.io/cosmos/txs/4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5

the tx has 2 different responses at different heights. The later height (12123084) is what shows now.

yj0x0x commented 2 years ago

Then block height 8721037 's contents will be changed too?

Rosetta API said that 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5 was reverted type of transaction.

And I don't get the what is the meaning of tx has 2 different responses??

okwme commented 2 years ago

your account sequence was originally 171522 when it should have been 171521. However the TX hash was the same for both of these transactions. Is it possible you signed the original transaction using the correct sequence but then the incorrect sequence was used in the json of the transaction? I'm having trouble understanding how you got the same Tx hash for two different transactions.

yj0x0x commented 2 years ago

Still I don't get it.

Here is the relevant Rosetta API return of block height 8721037.

            {
                "transaction_identifier": {
                    "hash": "4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5"
                },
                "operations": [
                    {
                        "operation_identifier": {
                            "index": 0
                        },
                        "type": "/ibc.core.client.v1.MsgUpdateClient",
                        "status": "Reverted",
                        "account": {
                            "address": "cosmos1zz22dfpvw3zqpeyhvhmx944a588fgcalw744ts"
                        },
                        "metadata": {
                            "client_id": "07-tendermint-259",
                            "header": {
                                "@type": "/ibc.lightclients.tendermint.v1.Header",
                                "signed_header": {
                                    "commit": {
                                        "block_id": {
                                            "hash": "3geWnsieZ3fcQsDQ1Nj213ePS89U2zHbShFpcyN5mPM=",
                                            "part_set_header": {
                                                "hash": "8H1BwEyhJm9ZtRk5HOGxRfB73LMHYwsAcUB6L12O0Pw=",
                                                "total": 1
                                            }
                                        },
                                        "height": "2414101",
                                        "round": 0,
                                        "signatures": [
yj0x0x commented 2 years ago

Yes and As you said , Tx 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5 also in the block height 8721038 with same hash.

            {
                "transaction_identifier": {
                    "hash": "4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5"
                },
                "operations": [
                    {
                        "operation_identifier": {
                            "index": 0
                        },
                        "type": "/ibc.core.client.v1.MsgUpdateClient",
                        "status": "Success",
                        "account": {
                            "address": "cosmos1zz22dfpvw3zqpeyhvhmx944a588fgcalw744ts"
                        },
                        "metadata": {
                            "client_id": "07-tendermint-259",
                            "header": {
                                "@type": "/ibc.lightclients.tendermint.v1.Header",
                                "signed_header": {
                                    "commit": {
                                        "block_id": {
                                            "hash": "3geWnsieZ3fc
yj0x0x commented 2 years ago

How could it be possible??

okwme commented 2 years ago

There were some issues about Tendermint overwriting TX hashes when they were redundant. The issue was merged in this release: https://github.com/tendermint/tendermint/pull/8945 and included in cosmos sdk v0.46.0 which will come in Rho.

okwme commented 2 years ago

Trying to track down who's maintaining rosetta to see if the impact needs to be addressed there as well

yaruwangway commented 2 years ago

no one is tracking rosetta now, but this is in the check list of rho , rosseta need to be tested in the testnet this time. cc @uditvira

carameleon commented 2 years ago

But when I have seen this transaction through explorer, it said account sequence mismatch.

hello. there are 2 transactions in this hash. one is failure, another is success. height code hash
8721037 32 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5
8721038 0 4C3B62DB263EE842C6E2A97D6B6383CA487C8D86B7B5CA6C7DAC25F371A636A5

one of problems that tendermint had is tendermint always overwrote the tx index. so we can't retrieve old transaction had same hash.

on the other hand, we fixed to display it on mintscan. (casued by height ordering)

sorry for confusion and inconvenient.

** at the moment, you have to store all transaction in realtime for solving it. it is only solution that I know.

puneet2019 commented 2 years ago

I have had this error in persistence chain as well. (way back in cosmos-sdk v0.42.0)

https://rpc.core.persistence.one/tx_search?query="tx.height=984979"

https://rpc.core.persistence.one/tx_search?query="tx.height=874236" -> this query shows height as 984979

puneet2019 commented 2 years ago

There were some issues about Tendermint overwriting TX hashes when they were redundant. The issue was merged in this release: tendermint/tendermint#8945 and included in cosmos sdk v0.46.0 which will come in Rho.

I see! solves the mystery of an year old bookmarked URL