0

On the mainnet, I can get the baking rights up to 5 cycles in advance.

For example, we are currently on cycle 146, and I observe the following:

# returns succesfully:
./tezos-client -A mainnet-node.tzscan.io  rpc get /chains/main/blocks/head/helpers/baking_rights?cycle=151

# returns an error:
/tezos-client -A mainnet-node.tzscan.io  rpc get /chains/main/blocks/head/helpers/baking_rights?cycle=152

The error is The seed for cycle 152 has not been computed yet (latest known seed is for cycle 151). That is, the seed is computed 5 cycles in advance.

On the alphanet (current cycle: 315), same experiment shows that the seed is only computed 3 cycles in advance:

# Works:
./tezos-client -A alphanet-node.tzscan.io  rpc get /chains/main/blocks/head/helpers/baking_rights?cycle=318

# returns an error:
./tezos-client -A alphanet-node.tzscan.io  rpc get /chains/main/blocks/head/helpers/baking_rights?cycle=319

Why is it different ?

2

We can see the constants set for the two chains via the following RPCs:

Mainnet Alphanet

Notice the constant for preserved_cycles, mainnet and alphanet is currently set with 5 and 3 cycles, respectively.

Baking in tezos.alpha is the action of signing and publishing a block. In Bitcoin, the right to publish a block is associated with solving a proof-of-work puzzle. In tezos.alpha, the right to publish a block in cycle n is assigned to a randomly selected roll in a randomly selected roll snapshot from cycle n-PRESERVED_CYCLES-2.

http://tezos.gitlab.io/mainnet/whitedoc/proof_of_stake.html#baking-rights

Keep in mind that the random seed used to determine which snapshot will be used for cycle n is revealed in cycle n-PRESERVED_CYCLES. This is why you aren't able to get baking rights more than PRESERVED_CYCLES ahead because rights requires the random seed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.