paritytech / substrate-api-sidecar

REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.
https://paritytech.github.io/substrate-api-sidecar/dist/
GNU General Public License v3.0
245 stars 151 forks source link

/blocks/3899549 returns 500 #440

Closed alecalve closed 3 years ago

alecalve commented 3 years ago

Description

Querying /blocks/3899549 for Polkadot's mainnet returns a 500 error.

The fullnode is running 0.8.28 and the substrate-api-sidecar is running v3.0.2

{
    "code": 500,
    "message": "createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec<Extrinsic>\"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(ExtrinsicSignatureV4):: Unable to create Enum via index 8, in Ed25519, Sr25519, Ecdsa",
    "stack": "Error: createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec<Extrinsic>\"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(ExtrinsicSignatureV4):: Unable to create Enum via index 8, in Ed25519, Sr25519, Ecdsa\n    at createTypeUnsafe (/home/runner/substrate-api-sidecar/node_modules/@polkadot/types/create/createType.js:72:11)\n    at RpcCore._formatOutput (/home/runner/substrate-api-sidecar/node_modules/@polkadot/rpc-core/index.js:394:41)\n    at callWithRegistry (/home/runner/substrate-api-sidecar/node_modules/@polkadot/rpc-core/index.js:262:42)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (node:internal/process/task_queues:94:5)",
    "level": "error"
}

Steps to Reproduce

curl http://localhost:9934/blocks/3899549

TarikGul commented 3 years ago

Hey @alecalve,

So currently trying to reproduce your issue and I am getting a successful query. I am running on sidecar v3.0.3 and when I query that block I get the following response:

I am also calling: curl http://localhost:8080/blocks/3899549 Port 8080 is where my sidecar instance runs.

{"number":"3899549","hash":"0x70260a28fbe7764cd3023169c415a923a80196ee9a841150b8e7e5eee769095d","parentHash":"0xb5f2894a2f5f309e2436d208186841cfbdb7fd7876c4a8c42c118cb753323e7c","stateRoot":"0x9ca66caaebba3b727a04ae91de135fd5b05c1e91355e4849bbe6a577158078e2","extrinsicsRoot":"0x31bbf8cb173e1894d1d0f3a5c01590cf5ac1592223fe7755e28fc5bd2dd99ac2","authorId":"13arSPsihdfLnYzKhwXTJQAjejxTdbXwpMKUeTUq45mvR5K9","logs":[{"type":"PreRuntime","index":"6","value":["BABE","0x0358000000f99c081000000000226a7a79e132184f69500cb68a13bf67514e6b3bb3e7570112adcc6996ccce756376bfcbf604e9953fc22645d1874cc1cbb333550b7e091e7c453be06e5b0301f5609d8ad068dca9c7fee3b7ee54fb77e0bf29e2e2c99725957248657fd57a07"]},{"type":"Seal","index":"5","value":["BABE","0x648f8f99d9d457c41bb47441d41fcf3e32d058597983e5d78539abb708d08450563c3bfc12f41144409c0baaaed95c4c4f27f32b99e8c26e7d785f88c7ac0f87"]}],"onInitialize":{"events":[]},"extrinsics":[{"method":{"pallet":"timestamp","method":"set"},"signature":null,"nonce":null,"args":{"now":"1613999574000"},"tip":null,"hash":"0x3290014e35f1ad9b82f0fc3be69b49a53513e600554f0ba0d2aab287cc0d2cea","info":{},"events":[{"method":{"pallet":"system","method":"ExtrinsicSuccess"},"data":[{"weight":"161397000","class":"Mandatory","paysFee":"Yes"}]}],"success":true,"paysFee":false},{"method":{"pallet":"balances","method":"transfer"},"signature":{"signature":"0x0275bb898cec222f3b359fac259887ae48c06924639f92d031c4d9d7cf1f2172d9c61692416ba5ce4f7ebc54a422f2a568afd5ca657b092a227becb8be0ec98c","signer":{"Id":"12T8nC5QnkkUXLyqhrhi15ji7da62aqP4w3Ze6ALmb6jZpnw"}},"nonce":"1","args":{"dest":{"Id":"15pAUxuEMZKS8KXVKSAgfSMXCpVQEL3tJ3yUUNFSCFgnwgSr"},"value":"46578920314120000001"},"tip":"0","hash":"0xc360e69541c14cce0e922190d305e0eb1fe1124c4e36ca1d47735ee4db502c85","info":{"weight":"218434000","class":"Normal","partialFee":"160000000"},"events":[{"method":{"pallet":"balances","method":"Deposit"},"data":["13arSPsihdfLnYzKhwXTJQAjejxTdbXwpMKUeTUq45mvR5K9","160000000"]},{"method":{"pallet":"system","method":"ExtrinsicFailed"},"data":[{"Module":{"index":"5","error":"3"}},{"weight":"218434000","class":"Normal","paysFee":"Yes"}]}],"success":false,"paysFee":true},{"method":{"pallet":"balances","method":"transfer"},"signature":{"signature":"0xb2b03e94a2e129cf0967cfdc367da3f4d37252e19fba809a0a824c8afb27701ffa6f7aa4d9000d7f0c4248aa3e0fbd010707aa25baf30f261099bb112bf5e18b","signer":{"Id":"133r1NQ9bv4p4u3kzDzE2LJ3cECRjUhCtVPm2dg6HcYNw4UZ"}},"nonce":"1","args":{"dest":{"Id":"15pAUxuEMZKS8KXVKSAgfSMXCpVQEL3tJ3yUUNFSCFgnwgSr"},"value":"46583215281416000001"},"tip":"0","hash":"0x258ab708d48800421a160a9df19961d93b996f61af7f688395054c4960b25d3f","info":{"weight":"218434000","class":"Normal","partialFee":"160000000"},"events":[{"method":{"pallet":"balances","method":"Deposit"},"data":["13arSPsihdfLnYzKhwXTJQAjejxTdbXwpMKUeTUq45mvR5K9","160000000"]},{"method":{"pallet":"system","method":"ExtrinsicFailed"},"data":[{"Module":{"index":"5","error":"3"}},{"weight":"218434000","class":"Normal","paysFee":"Yes"}]}],"success":false,"paysFee":true}
....

Try upgrading to the latest v3.0.3.

emostov commented 3 years ago

I cannot reproduce on either v3.0.2 or v3.0.3.

emostov commented 3 years ago

Closing due to inactivity.