paritytech / substrate-api-sidecar

REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.

Home Page:https://paritytech.github.io/substrate-api-sidecar/dist/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]: Unable to decode `session.validators` (Tracking issue)

TarikGul opened this issue · comments

The following is a tracking issue for when this error shows up. It has been an error that has been reported for a long time that we have not been able to reproduce. A pattern we have noticed is this only comes up when there are instances that have been running for a long time, and the usual fix is to restart the instance and everything goes back to normal.

The Error

{"code":500,"message":"Unable to decode storage session.validators:: createType([u8;21]):: [u8;21]:: Decoded input doesn't match input, received 0xa5040000966d74f8027e07b43717b6876d97544fe0d71facef06acc8382749ae…feffabd8f3747b5ca19766866bd59856a2e65c537c6456c6f6863c026915f473 (9506 bytes), created 0xa5040000966d74f8027e07b43717b6876d97544fe0 (21 bytes)","stack":"Error: Unable to decode storage session.validators:: createType([u8;21]):: [u8;21]:: Decoded input doesn't match input, received 0xa5040000966d74f8027e07b43717b6876d97544fe0d71facef06acc8382749ae…feffabd8f3747b5ca19766866bd59856a2e65c537c6456c6f6863c026915f473 (9506 bytes), created 0xa5040000966d74f8027e07b43717b6876d97544fe0 (21 bytes)\n    at RpcCore._newType (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:385:19)\n    at RpcCore._formatStorageData (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:320:21)\n    at RpcCore._formatOutput (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:285:25)\n    at RpcCore._formatResult (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:147:20)\n    at callWithRegistry (/usr/src/app/node_modules/@polkadot/rpc-core/cjs/bundle.js:168:25)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)","level":"error"}

It would be good to get this investigated, and sorted. Step 1 would be to find a way to reproduce this issue, and then we can move forward from there.

Hi I got this error when I try to query meta data (/runtime/metadata).

{"code":500,"message":"createType(Vec<([u8;8],u32)>):: decodeU8aVec: failed at 0x000000… (index 2/16): ([u8;8],u32):: decodeU8a: failed at 0x000000… (index 1/2): [u8;8]:: Expected input with 8 bytes (64 bits), found 3 bytes","stack":"Error: createType(Vec<([u8;8],u32)>):: decodeU8aVec: failed at 0x000000… (index 2/16): ([u8;8],u32):: decodeU8a: failed at 0x000000… (index 1/2): [u8;8]:: Expected input with 8 bytes (64 bits), found 3 bytes\n    at createTypeUnsafe (/usr/src/app/node_modules/@polkadot/types-create/cjs/create/type.js:54:22)\n    at TypeRegistry.createType (/usr/src/app/node_modules/@polkadot/types/cjs/create/registry.js:270:52)\n    at sanitizeMetadataExceptionsV14 (/usr/src/app/build/src/sanitize/sanitizeNumbers.js:236:52)\n    at sanitizeMetadataExceptions (/usr/src/app/build/src/sanitize/sanitizeNumbers.js:192:13)\n    at /usr/src/app/build/src/sanitize/sanitizeNumbers.js:56:17\n    at Array.reduce (<anonymous>)\n    at sanitizeCodec (/usr/src/app/build/src/sanitize/sanitizeNumbers.js:45:30)\n    at sanitizeNumbers (/usr/src/app/build/src/sanitize/sanitizeNumbers.js:125:16)\n    at /usr/src/app/build/src/sanitize/sanitizeNumbers.js:96:35\n    at Type.map (<anonymous>)","level":"error"}

I wonder if this is similar to your case, I am using version v15.0.0.

Hello, we had the following error also (/blocks/18407461):

Version: 17.1.1

{"code":500,"message":"Unable to decode storage session.validators:: createType(PolkadotPrimitivesV5ValidatorAppPublic):: [u8;32]:: Decoded input doesn't match input, received 0xa5040000966d74f8027e07b43717b6876d97544fe0d71facef06acc8382749ae…feffabd8f3747b5ca19766866bd59856a2e65c537c6456c6f6863c026915f473 (9506 bytes), created 0xa5040000966d74f8027e07b43717b6876d97544fe0d71facef06acc8382749ae (32 bytes)","stack":"Error: Unable to decode storage session.validators:: createType(PolkadotPrimitivesV5ValidatorAppPublic):: [u8;32]:: Decoded input doesn't match input, received 0xa5040000966d74f8027e07b43717b6876d97544fe0d71facef06acc8382749ae…feffabd8f3747b5ca19766866bd59856a2e65c537c6456c6f6863c026915f473 (9506 bytes), created 0xa5040000966d74f8027e07b43717b6876d97544fe0d71facef06acc8382749ae (32 bytes)\n    at RpcCore._newType (/usr/local/share/.config/yarn/global/node_modules/@polkadot/rpc-core/cjs/bundle.js:385:19)\n    at RpcCore._formatStorageData (/usr/local/share/.config/yarn/global/node_modules/@polkadot/rpc-core/cjs/bundle.js:320:21)\n    at RpcCore._formatOutput (/usr/local/share/.config/yarn/global/node_modules/@polkadot/rpc-core/cjs/bundle.js:285:25)\n    at RpcCore._formatResult (/usr/local/share/.config/yarn/global/node_modules/@polkadot/rpc-core/cjs/bundle.js:147:20)\n    at callWithRegistry (/usr/local/share/.config/yarn/global/node_modules/@polkadot/rpc-core/cjs/bundle.js:168:25)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","level":"error"}