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

Decode block failed for Clover mainnet #825

Closed Ljzn closed 2 years ago

Ljzn commented 2 years ago

Description

sidecar version: v11.3.6

run SAS_SUBSTRATE_WS_URL=wss://api-ivy-elastic.clover.finance yarn start

visit http://localhost:8080/blocks/4476456

got

{"code":500,"message":"createType(SignedBlock):: Struct: failed on block: {\"header\":\"Header\",\"extrinsics\":\"Vec<Extrinsic>\"}:: Struct: failed on extrinsics: Vec<Extrinsic>:: createType(ExtrinsicV4):: createType(Call):: Call: failed decoding cloverClaims.burnElastic:: Struct: failed on args: Struct:: decodeU8a: failed at 0x010d6fcffe9e88355bcf2360236b5dc2… on network:: DoNotConstruct: Cannot construct unknown type BridgeNetworks","stack":"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 cloverClaims.burnElastic:: Struct: failed on args: Struct:: decodeU8a: failed at 0x010d6fcffe9e88355bcf2360236b5dc2… on network:: DoNotConstruct: Cannot construct unknown type BridgeNetworks\n    at createTypeUnsafe (/Users/linjiezhang/Documents/substrate-api-sidecar/node_modules/@polkadot/types-create/create/type.cjs:73:18)\n    at TypeRegistry.createTypeUnsafe (/Users/linjiezhang/Documents/substrate-api-sidecar/node_modules/@polkadot/types/create/registry.cjs:419:46)\n    at RpcCore._formatOutput (/Users/linjiezhang/Documents/substrate-api-sidecar/node_modules/@polkadot/rpc-core/bundle.cjs:412:21)\n    at RpcCore._formatResult (/Users/linjiezhang/Documents/substrate-api-sidecar/node_modules/@polkadot/rpc-core/bundle.cjs:237:27)\n    at callWithRegistry (/Users/linjiezhang/Documents/substrate-api-sidecar/node_modules/@polkadot/rpc-core/bundle.cjs:261:19)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)","level":"error"}

Expected vs. Actual Behavior

no error

TarikGul commented 2 years ago

info: Do you know if Clover network has a types package in '@polkadot/apps-config'. The type is just missing, and can be injected into the typeRegistry. See https://github.com/paritytech/substrate-api-sidecar#custom-substrate-types

pangwa commented 2 years ago

Clover types should already in @polkadot/apps-config: https://github.com/polkadot-js/apps/blob/master/packages/apps-config/src/api/spec/clover.ts

TarikGul commented 2 years ago

Closing this issue, as it seems it is resolved. I am able to connect and and query clover mainnet successfully without any decoding errors.