cosmos / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Apache License 2.0
6.24k stars 3.61k forks source link

Rosetta fails to retrieve some blocks #11402

Closed emmanuelm41 closed 1 year ago

emmanuelm41 commented 2 years ago

Summary of Bug

Rosetta is failing to retrieve some blocks with some nasty errors. On height 9773304 for example.

Version

Steps to Reproduce

Working request

{
    "network_identifier": 
        {
            "blockchain": "{{blockchain}}",
            "network": "{{network}}"
        },
    "block_identifier": {
        "index": 8000021
    }
}
{
    "block": {
        "block_identifier": {
            "index": 8000021,
            "hash": "D92CBFDD315BE2A2A7D24E5D1D1E8FF332BE10F00FF1206C589F6F468B19F972"
        },
        "parent_block_identifier": {
            "index": 8000020,
            "hash": "3575813AB4A5F45D21FE759AC4AF523C4A034F00822D795E5686776C6AFA577E"
        },
        "timestamp": 1634191683505,
        "transactions": [
            {
                "transaction_identifier": {
                    "hash": "01D92CBFDD315BE2A2A7D24E5D1D1E8FF332BE10F00FF1206C589F6F468B19F972"
                },
                "operations": []
            },
            {
                "transaction_identifier": {
                    "hash": "FCA128EC46CF97F43DE04869C442FF2BB9E2561F5109E8FBC68858565965FB46"
                },
                "operations": [
                    {
                        "operation_identifier": {
                            "index": 0
                        },
                        "type": "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
                        "status": "Success",
                        "account": {
                            "address": "cosmos1c9xj5vju9as5xygr2trma6e7dc7d0cye9ljuej"
                        },
                        "metadata": {
                            "delegator_address": "cosmos1c9xj5vju9as5xygr2trma6e7dc7d0cye9ljuej",
                            "validator_address": "cosmosvaloper1tflk30mq5vgqjdly92kkhhq3raev2hnz6eete3"
                        }
                    }
                ]
            },
            {
                "transaction_identifier": {
                    "hash": "00D92CBFDD315BE2A2A7D24E5D1D1E8FF332BE10F00FF1206C589F6F468B19F972"
                },
                "operations": []
            }
        ]
    }
}

Error 1

{
    "network_identifier": 
        {
            "blockchain": "{{blockchain}}",
            "network": "{{network}}"
        },
    "block_identifier": {
        "index": 9773304
    }
}

Error 2

{
    "network_identifier": 
        {
            "blockchain": "{{blockchain}}",
            "network": "{{network}}"
        },
    "block_identifier": {
        "index": 4000000
    }
}
____

For Admin Use

raynaudoe commented 2 years ago

I've found not the source of these errors but how rosetta is masking inner errors, thus getting something generic like this:

{
    "code": 0,
    "message": "unknown",
    "description": "unknown error",
    "retriable": false,
    "details": {
        "info": "rosetta: (0) unknown"
    }
}

The fix for getting the actual error message would be done in Zondax's fork .

As for the error while querying a block, I wasn't able to reproduce it with the actual codebase, most likely it was already fixed (fork). This kind of errors will be easily catched when rosetta-cli test can be run on CI