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

get block fail on v10.0.0 & node v0.9.11 (westend) #716

Closed BomaxChen closed 2 years ago

BomaxChen commented 3 years ago

hi, there is a problem occurs at westend, here is log below

0|api  | 2021-10-14 04:14:33 error: RPC-CORE: getStorage(key: StorageKey, at?: BlockHash): StorageData:: Unable to decode storage system.events:: createType(Vec<FrameSystemEventRecord>):: decodeU8a: failed at 0x0000000000000080… on :: DoNotConstruct: Cannot construct unknown type FrameSystemEventRecord
0|api  | 2021-10-14 04:14:37 error: VEC: Unable to decode on index 1 createType(ExtrinsicV4):: createType(Call):: Call: failed decoding paraInherent.enter:: Struct: failed on args: {"data":"{\"bitfields\":\"Vec<PolkadotPrimitivesV1SignedUncheckedSigned>\",\"backedCandidates\":\"Vec<PolkadotPrimitivesV1BackedCandidate>\",\"disputes\":\"Vec<PolkadotPrimitivesV1DisputeStatementSet>\",\"parentHeader\":\"{\\\"parentHash\\\":\\\"H256\\\",\\\"number\\\":\\\"Compact<u32>\\\",\\\"stateRoot\\\":\\\"H256\\\",\\\"extrinsicsRoot\\\":\\\"H256\\\",\\\"digest\\\":\\\"{\\\\\\\"logs\\\\\\\":\\\\\\\"Vec<SpRuntimeGenericDigestDigestItem>\\\\\\\"}\\\"}\"}"}:: decodeU8a: failed at 0x401401000000009a… on data: {"bitfields":"Vec<PolkadotPrimitivesV1SignedUncheckedSigned>","backedCandidates":"Vec<PolkadotPrimitivesV1BackedCandidate>","disputes":"Vec<PolkadotPrimitivesV1DisputeStatementSet>","parentHeader":"{\"parentHash\":\"H256\",\"number\":\"Compact<u32>\",\"stateRoot\":\"H256\",\"extrinsicsRoot\":\"H256\",\"digest\":\"{\\\"logs\\\":\\\"Vec<SpRuntimeGenericDigestDigestItem>\\\"}\"}"}:: decodeU8a: failed at 0x401401000000009a… on bitfields: Vec<PolkadotPrimitivesV1SignedUncheckedSigned>:: decodeU8a: failed at 0x1401000000009af5… on :: DoNotConstruct: Cannot construct unknown type PolkadotPrimitivesV1SignedUncheckedSigned
0|api  | 2021-10-14 04:14:37 error: RPC-CORE: getBlock(hash?: BlockHash): SignedBlock:: createType(SignedBlock):: Struct: failed on block: {"header":"Header","extrinsics":"Vec<Extrinsic>"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding paraInherent.enter:: Struct: failed on args: {"data":"{\"bitfields\":\"Vec<PolkadotPrimitivesV1SignedUncheckedSigned>\",\"backedCandidates\":\"Vec<PolkadotPrimitivesV1BackedCandidate>\",\"disputes\":\"Vec<PolkadotPrimitivesV1DisputeStatementSet>\",\"parentHeader\":\"{\\\"parentHash\\\":\\\"H256\\\",\\\"number\\\":\\\"Compact<u32>\\\",\\\"stateRoot\\\":\\\"H256\\\",\\\"extrinsicsRoot\\\":\\\"H256\\\",\\\"digest\\\":\\\"{\\\\\\\"logs\\\\\\\":\\\\\\\"Vec<SpRuntimeGenericDigestDigestItem>\\\\\\\"}\\\"}\"}"}:: decodeU8a: failed at 0x401401000000009a… on data: {"bitfields":"Vec<PolkadotPrimitivesV1SignedUncheckedSigned>","backedCandidates":"Vec<PolkadotPrimitivesV1BackedCandidate>","disputes":"Vec<PolkadotPrimitivesV1DisputeStatementSet>","parentHeader":"{\"parentHash\":\"H256\",\"number\":\"Compact<u32>\",\"stateRoot\":\"H256\",\"extrinsicsRoot\":\"H256\",\"digest\":\"{\\\"logs\\\":\\\"Vec<SpRuntimeGenericDigestDigestItem>\\\"}\"}"}:: decodeU8a: failed at 0x401401000000009a… on bitfields: Vec<PolkadotPrimitivesV1SignedUncheckedSigned>:: decodeU8a: failed at 0x1401000000009af5… on :: DoNotConstruct: Cannot construct unknown type PolkadotPrimitivesV1SignedUncheckedSigned
0|api  | 2021-10-14 04:14:37 error: createType(SignedBlock):: Struct: failed on block: {"header":"Header","extrinsics":"Vec<Extrinsic>"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding paraInherent.enter:: Struct: failed on args: {"data":"{\"bitfields\":\"Vec<PolkadotPrimitivesV1SignedUncheckedSigned>\",\"backedCandidates\":\"Vec<PolkadotPrimitivesV1BackedCandidate>\",\"disputes\":\"Vec<PolkadotPrimitivesV1DisputeStatementSet>\",\"parentHeader\":\"{\\\"parentHash\\\":\\\"H256\\\",\\\"number\\\":\\\"Compact<u32>\\\",\\\"stateRoot\\\":\\\"H256\\\",\\\"extrinsicsRoot\\\":\\\"H256\\\",\\\"digest\\\":\\\"{\\\\\\\"logs\\\\\\\":\\\\\\\"Vec<SpRuntimeGenericDigestDigestItem>\\\\\\\"}\\\"}\"}"}:: decodeU8a: failed at 0x401401000000009a… on data: {"bitfields":"Vec<PolkadotPrimitivesV1SignedUncheckedSigned>","backedCandidates":"Vec<PolkadotPrimitivesV1BackedCandidate>","disputes":"Vec<PolkadotPrimitivesV1DisputeStatementSet>","parentHeader":"{\"parentHash\":\"H256\",\"number\":\"Compact<u32>\",\"stateRoot\":\"H256\",\"extrinsicsRoot\":\"H256\",\"digest\":\"{\\\"logs\\\":\\\"Vec<SpRuntimeGenericDigestDigestItem>\\\"}\"}"}:: decodeU8a: failed at 0x401401000000009a… on bitfields: Vec<PolkadotPrimitivesV1SignedUncheckedSigned>:: decodeU8a: failed at 0x1401000000009af5… on :: DoNotConstruct: Cannot construct unknown type PolkadotPrimitivesV1SignedUncheckedSigned
0|api  |  Error: createType(SignedBlock):: Struct: failed on block: {"header":"Header","extrinsics":"Vec<Extrinsic>"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding paraInherent.enter:: Struct: failed on args: {"data":"{\"bitfields\":\"Vec<PolkadotPrimitivesV1SignedUncheckedSigned>\",\"backedCandidates\":\"Vec<PolkadotPrimitivesV1BackedCandidate>\",\"disputes\":\"Vec<PolkadotPrimitivesV1DisputeStatementSet>\",\"parentHeader\":\"{\\\"parentHash\\\":\\\"H256\\\",\\\"number\\\":\\\"Compact<u32>\\\",\\\"stateRoot\\\":\\\"H256\\\",\\\"extrinsicsRoot\\\":\\\"H256\\\",\\\"digest\\\":\\\"{\\\\\\\"logs\\\\\\\":\\\\\\\"Vec<SpRuntimeGenericDigestDigestItem>\\\\\\\"}\\\"}\"}"}:: decodeU8a: failed at 0x401401000000009a… on data: {"bitfields":"Vec<PolkadotPrimitivesV1SignedUncheckedSigned>","backedCandidates":"Vec<PolkadotPrimitivesV1BackedCandidate>","disputes":"Vec<PolkadotPrimitivesV1DisputeStatementSet>","parentHeader":"{\"parentHash\":\"H256\",\"number\":\"Compact<u32>\",\"stateRoot\":\"H256\",\"extrinsicsRoot\":\"H256\",\"digest\":\"{\\\"logs\\\":\\\"Vec<SpRuntimeGenericDigestDigestItem>\\\"}\"}"}:: decodeU8a: failed at 0x401401000000009a… on bitfields: Vec<PolkadotPrimitivesV1SignedUncheckedSigned>:: decodeU8a: failed at 0x1401000000009af5… on :: DoNotConstruct: Cannot construct unknown type PolkadotPrimitivesV1SignedUncheckedSigned
0|api  |     at createTypeUnsafe (/home/user01/substrate-api-sidecar/node_modules/@polkadot/types/create/createType.cjs:68:18)
0|api  |     at TypeRegistry.createTypeUnsafe (/home/user01/substrate-api-sidecar/node_modules/@polkadot/types/create/registry.cjs:364:45)
0|api  |     at RpcCore._formatOutput (/home/user01/substrate-api-sidecar/node_modules/@polkadot/rpc-core/bundle.cjs:389:21)
0|api  |     at callWithRegistry (/home/user01/substrate-api-sidecar/node_modules/@polkadot/rpc-core/bundle.cjs:255:42)
0|api  |     at runMicrotasks (<anonymous>)
0|api  |     at processTicksAndRejections (node:internal/process/task_queues:93:5)
0|api  | 2021-10-14 04:14:37 error: GET /blocks/head 500 69ms
0|api  | 2021-10-14 04:14:37 error: RPC-CORE: getStorage(key: StorageKey, at?: BlockHash): StorageData:: Unable to decode storage system.events:: createType(Vec<FrameSystemEventRecord>):: decodeU8a: failed at 0x0000000000000080… on :: DoNotConstruct: Cannot construct unknown type FrameSystemEventRecord
TarikGul commented 3 years ago

Hey @BomaxChen Thanks for reporting the issue.

Can you specify what version sidecar you are using. Is this a public node, or an archive node, and the runtime version for westend?

TarikGul commented 2 years ago

Closing due to being stale, and lack of information. Please reopen or file a new issue if this re-appears.

Current latest release is v11.1.0 and I am not able to reproduce the issue.

LXHLeaner commented 2 years ago

This problem has been solved?I am synchronizing Karura's Header 730946 with this error,and now i use version is V12.4.0;

2022-07-14 19:22:37 error: VEC: Unable to decode on index 2 createType(ExtrinsicV4):: createType(Call):: Call: failed decoding acalaOracle.feedValues:: Struct: failed on args: {"values":"Vec<(OracleKey,OracleValue)>"}:: decodeU8a: failed at 0x0400820000530a6f4995a21100000000… on values (index 0/1): Vec<(OracleKey,OracleValue)>:: decodeU8a: failed at 0x00820000530a6f4995a2110000000000… (index 0/1):: decodeU8a: failed at 0x00820000530a6f4995a2110000000000… (index 0/2):: DoNotConstruct: Cannot construct unknown type OracleKey

2022-07-14 19:22:37 error: RPC-CORE: getBlock(hash?: BlockHash): SignedBlock:: createType(SignedBlock):: Struct: failed on block: {"header":"Header","extrinsics":"Vec"}:: Struct: failed on extrinsics: Vec:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding acalaOracle.feedValues:: Struct: failed on args: {"values":"Vec<(OracleKey,OracleValue)>"}:: decodeU8a: failed at 0x0400820000530a6f4995a21100000000… on values (index 0/1): Vec<(OracleKey,OracleValue)>:: decodeU8a: failed at 0x00820000530a6f4995a2110000000000… (index 0/1):: decodeU8a: failed at 0x00820000530a6f4995a2110000000000… (index 0/2):: DoNotConstruct: Cannot construct unknown type OracleKey

TarikGul commented 2 years ago

The two decoding issues above are completely separate. One deals with westend system.events which was not reproducible, but also westend types are native to polkadot-js. Yours deals with Karura which the types are not native to polkadot-js which in turn means you needs to inject the necessary TypesBundle.