How is the 24 nodes picked for a session?

If my node is picked for a session 0040, (a) is it possible to get picked again (low chances) for the next session in a row(13:00-14:00 and 14:05-15:05) or (b) every unjailed Nodes has to get in a session before a Node get selected for a second time.

Also, is it possible for a Node to be selected in the same hour for 2 sessions of different chains?
Something like 13:00-14:00 session for 0040 and 13:03-14:03 session for 0021?

From my understanding - a session key (seed) is generated by hashing (sha256) a json object composed of an application public key, the block hash, and the chain id.

This “seed” is then used to generate nodes that would be part of a session, pseudorandomly every 4 blocks per app. So, your node can be part of multiple sessions of different or same chains. It is not mutually exclusive.

Correct me if I’m wrong :slight_smile: , anyone! Still learning the core code myself.

Here’s the code itself to figure this out:

Shame on me xD.
Didn’t thought to check the github repository.

Thanks poktBlade!

I mainly asked for the array of nodes from which the 24 are picked randomly

nodesAddrs, totalNodes := keeper.GetValidatorsByChain(sessionCtx, chain)


All nodes staked with at least 15,000 POKT are qualified as servicers and have equal chance of being selected for sessions.

Within sessions, the Portal does its own cherry picking based on node quality, to ensure quality service for apps.

Those nodes are filtered out based off if they’re jailed or not as well. As Jackal also mentioned, the service quality is then filtered out from these session nodes, so possible you are part of a session and still don’t service any rewards if you aren’t synced up. The cherry picker does do sync checks and some other shenanigans. Cherry picker is also open source if you’re up for learning how it actually works.

Ye I had read the cherry picker code (calculating median latency and sort the 24 nodes by latency

1 Like