question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to decode storage system.events for Kusama block 92874

See original GitHub issue

I get the following at block 92874 (polkascan)

Unable to decode storage system.events: createType(Vec<EventRecord>):: Struct: failed on 'data':: Unable to create Enum via index 15, in Normal, Operational
2020-01-21 18:13:29        RPC-CORE: getStorage(key: StorageKey, at?: BlockHash): StorageData:: createType(Vec<EventRecord>):: Struct: failed on 'data':: Unable to create Enum via index 15, in Normal, Operational
2020-01-21 18:13:29            MAIN: Error: getStorage(key: StorageKey, at?: BlockHash): StorageData:: createType(Vec<EventRecord>):: Struct: failed on 'data':: Unable to create Enum via index 15, in Normal, Operational
    at CatchSubscriber.pipe.error [as selector] (/home/thib/github/paritytech/Nomidot/node_modules/@polkadot/rpc-core/index.js:193:38)
    at CatchSubscriber.error (/home/thib/github/paritytech/Nomidot/node_modules/rxjs/src/internal/operators/catchError.ts:132:23)
    at MapSubscriber._next (/home/thib/github/paritytech/Nomidot/node_modules/rxjs/src/internal/operators/map.ts:86:24)
    at MapSubscriber.Subscriber.next (/home/thib/github/paritytech/Nomidot/node_modules/rxjs/src/internal/Subscriber.ts:99:12)92874
    at SwitchMapSubscriber.notifyNext (/home/thib/github/paritytech/Nomidot/node_modules/rxjs/src/internal/operators/switchMap.ts:172:24)
    at InnerSubscriber._next (/home/thib/github/paritytech/Nomidot/node_modules/rxjs/src/internal/InnerSubscriber.ts:17:17)
    at InnerSubscriber.Subscriber.next (/home/thib/github/paritytech/Nomidot/node_modules/rxjs/src/internal/Subscriber.ts:99:12)
    at CombineLatestSubscriber.notifyNext (/home/thib/github/paritytech/Nomidot/node_modules/rxjs/src/internal/observable/combineLatest.ts:313:26)
    at InnerSubscriber._next (/home/thib/github/paritytech/Nomidot/node_modules/rxjs/src/internal/InnerSubscriber.ts:17:17)
    at InnerSubscriber.Subscriber.next (/home/thib/github/paritytech/Nomidot/node_modules/rxjs/src/internal/Subscriber.ts:99:12)

Reproducible in the js console. With the block before all good, the 92874 fails:

async function logMethod(blockHash){
  const events = await api.query.system.events.at(blockHash);
  events.map(
        ({ event: { method } }) =>
          console.log('method',method)
      );
}

const blockHashFine = "0x88bfb8baf0e8e5e192b911b80aed45e49f27b50fa91d217a2ca71c6dd1e2c53d"; //92873 working fine
const blockHashFailing = "0xc67e368912d8b0a824f917fff7ef3885e4bf867f07df99441368eb234b05b4ab"; //92874 failing

logMethod(blockHashFine).catch(e => console.error(e));
logMethod(blockHashFailing).catch(e => console.error(e));

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jacogrcommented, Jan 22, 2020

It is the types, specifically DispatchError, as indicated above, see https://github.com/polkadot-js/api/blob/master/packages/api/src/base/typeInjector.ts#L33

(The above is NOT comprehensive, since types adjust to latest)

0reactions
polkadot-js-botcommented, Jun 4, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to decode events help on substrate using polkadot.js?
You want to decode the data from ContractEmitted. So you are half-way there in known that you can pass the Bytes to the...
Read more >
Errors and How to Resolve Them - Polkadot Wiki
In the explorer tab, find the block in which this failure occurred. Then, expand the system.ExtrinsicFailed frame: Error described.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found