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.

api.derive.session.info() shows unused/non-applicable data

See original GitHub issue

Using api beta30 - getting derived session info returns wrong value on current kusama node. Chain height currently at BN:826889 while value for last session(epoch?) change is showing value of 262453039

It looks like other data is also wrong - if we look at polkascan and look into events on kusamacc2 - session and era starts do not correspond to data shown in session info.

According to session info, there should have been session starts at blocks 824870, 822470, 820070 which is calculated from await api.rpc.chain.getHeader()).number.toNumber() - sessionProgress which doesn’t look like it’s right because await api.query.system.events.at(await api.rpc.chain.getBlockHash(824870)) doesn’t return events that should be emitted on new nession start. Whereas await api.query.system.events.at(await api.rpc.chain.getBlockHash(824956)) does return these events

it looks like eraProgress returns same value as sessionProgress which is also wrong.

https://polkascan.io/pre/kusama-cc2/event Screen Shot 2019-11-26 at 01 57 40

https://github.com/polkadot-js/api/blob/4cea617b13efa9db9addb17f6c4e31e1df025246/packages/api-derive/src/session/info.ts#L63

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jak-pancommented, Nov 27, 2019

Yes, I know it worked on 1.x that’s why I was confused by this. Thanks for the explanation.

1reaction
jacogrcommented, Nov 27, 2019

100%. You will need to check block for session start events.

(We used to have that functionality in Substrate 1.x chains, e.g. Alexander, however it is not available on-chain anymore since Babe does not need it to operate - on-chain state is for operational requirements)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I close unused connections after read_html in R
According to ?read_html , it will use curl() if installed, else the url() connection. Both should work, really, but it's worth ...
Read more >
FAQ: What's a reproducible example (`reprex`) and how do I ...
The goal of a reprex is to package your code, and information about your problem ... Error: no applicable method for 'mutate_' applied...
Read more >
Package 'data.table' - R Project
i.e., it sees column names as if they are variables. This allows to not just select columns in j, but also compute on...
Read more >
bloomberg open api – core developer guide
Data for each subscription is tagged with a correlation ID (represented as a CorrelationID object) that must be unique to the Session. The...
Read more >
CryptGenKey function (wincrypt.h) - Win32 - Microsoft Learn
Generates a random cryptographic session key or a public/private key pair. A handle to the key or key pair is returned in phKey....
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