Skip to main content
10 votes
Accepted

Why do changes to the Validator set require a one Session delay?

This came out of necessity when implementing BABE. In BABE randomness from the VRFs is collected on-chain throughout a session (or epoch in BABE lingo), which is then used in future epochs. By ...
André's user avatar
  • 2,495
8 votes
Accepted

What is the KeyOwnerProofSystem in BABE config?

Let's say you have found an equivocation for Babe. Aka you are saying that Alice build two blocks on the same height in session 100. You will now need to prove to the runtime that there is an ...
bkchr's user avatar
  • 11.8k
7 votes

How get the starting Time of a an EraIndex?

The important point about the chain state is that it only contains information that is needed for future block execution. It is not a generalized database. Staking is a very good example - since we ...
Jaco's user avatar
  • 5,985
7 votes

Writing a test to call staking.chill() so as to remove Charlie as a Validator

No, the issue here is not related to invulnerables. Invulnerables are only immune to getting slashed when an offence occurs. Instead, the issue here is probably that you need to wait a full session ...
Shawn Tabrizi's user avatar
  • 16.3k
5 votes
Accepted

What does author_rotateKeys do?

I've seen in some guides suggesting to set Session Keys for validating. My concepts of session keys are that they are an amalgation of 4 keys, that will be used instead of the stash or controller keys ...
Luke Schoen's user avatar
  • 2,376
5 votes
Accepted

Benchmark session pallet fails without pallet_staking

You are correct that the benchmarking for the Session pallet depends on the Substrate Staking pallet also be used. If you do not use the Substrate staking pallet, you cannot (and should not) use the ...
Shawn Tabrizi's user avatar
  • 16.3k
4 votes
Accepted

Why the block author is always `Alice`?

The slot duration in your runtime is wrong: pub const MILLISECS_PER_BLOCK: u64 = 6_000; pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; You are running a parachain that can only produce a block ...
bkchr's user avatar
  • 11.8k
4 votes
Accepted

What event marks a Validator as selected for next session

There is an even in the Staking pallet: StakersElected, however this event does not itself contain all the new stakers that were selected since that list can be large, and just as easily queried if ...
Shawn Tabrizi's user avatar
  • 16.3k
3 votes
Accepted

Trying to get OneSessionHandler to trigger in custom pallet

You should use the SessionManager: struct SessionManager<I>(sp_std::marker::PhantomData<I>); impl<I: pallet_session::SessionManager<ValidatorId>, ValidatorId> pallet_session::...
bkchr's user avatar
  • 11.8k
3 votes
Accepted

how to verify that my validator has the right session keys

Replying to myself. It actually works the way I described it, not sure why I thought otherwise initially. let nextKeys = await api.query.session.nextKeys(stash_account); let nodeHasKeys = await ...
nicolasochem's user avatar
3 votes

How do you tell which block number the last runtime upgrade happened on a chain?

There is no simple way to tell you which block updated the runtime. To not require executing/looking into the state for each block, we introduced the CodeUpdated digest. This is part of the header and ...
bkchr's user avatar
  • 11.8k
3 votes

How do you tell which block number the last runtime upgrade happened on a chain?

Usually, I go to Subscan. At the event page, set the filter to System::CodeUpdated. Then you can easily find which block height this event happened. But it looks like it is hard to find it out ...
aurexav's user avatar
  • 11.2k
3 votes
Accepted

What happens in epoch of a blockchain?

An epoch is generally used with babe consensus algorithm, I suggest you learn more about how the algorithm works here BABE execution happens in sequential non-overlapping phases known as epochs. Each ...
dadzerlaze's user avatar
  • 1,093
3 votes
Accepted

Pallet session: QueuedKeys vs NextKeys

The main point that you are missing is that NextKeys can only be set via the set_keys transaction. Once a new session is being enacted, if the validator set has changed, QueuedKeys is formed from the ...
kianenigma's user avatar
  • 2,864
3 votes
Accepted

How to call session.set_keys from the CLI?

For cli, you can use the polkadot-js api-cli - $ polkadot-js-api --seed ... --tx tx.session.setKeys 0x.... There is also a docker image available with all the polkadot-js/tools tools.
RosaryBeads's user avatar
2 votes

SessionsPerEra doesn't seem to be affecting sessions per era

If you are updating your runtime, currently you compile it twice for native and for wasm. When both are exactly the same you should use the same spec_version. In your case here, you updated the native ...
bkchr's user avatar
  • 11.8k
2 votes

How to query the waiting validators in past eras?

Adding to @AurevoirXavier answer, API Sidecar exposes the endpoint pallets/staking/Validators which returns a list of all validators addresses and their corresponding status which can be either active ...
Iker's user avatar
  • 1,471
2 votes
Accepted

How to query the waiting validators in past eras?

There is no native API available for this purpose. The set of waiting validators can be obtained by subtracting the active validators from the Staking::Validators set. It's important to note that an ...
aurexav's user avatar
  • 11.2k
2 votes

Custom session keys in Chainspec for Mainnet config

Because AccountId was implemented From<[u8; 32]>. And the KeyId(aura, babe, grandpa...) was implemented UncheckedFrom<[u8; 32]> instead of From<[u8; 32]>. Read more: https://...
aurexav's user avatar
  • 11.2k
1 vote
Accepted

chain stop producing block after adding pallet-session

Solved this issue by removing the author inherent functionality.
Deepak Chaudhary's user avatar
1 vote
Accepted

Solochain mainnet experiencing problems finalizing blocks after a few months

I looked at your code and you have a 1s slot duration time and max 2 seconds of weight allocated for block production. 2 seconds for block production is default for solochains with 6s slot duration. ...
dastansam's user avatar
  • 619
1 vote
Accepted

setting up pallet_session genesis keys in running chain

You can follow this code to set up the session keys during a runtime upgrade. https://github.com/polkadot-fellows/runtimes/blob/6334588c9db0115f6b3445ce11d02a457275b34b/relay/polkadot/src/lib.rs#...
aurexav's user avatar
  • 11.2k
1 vote

subxt: How to submit pallet_session::set_keys() extrinsic?

Answered here https://github.com/paritytech/subxt/issues/1261#issuecomment-1809790645. We can see all the types here https://paritytech.github.io/subxt-explorer/
akhil nichenametla's user avatar
1 vote

Getting Error when i push session keys session.NoAssociatedValidatorId

From looking at your configuration; the ValidatorId is configured to an AccountId and ValidatorIdOf is configured to (). ValidatorIdOf makes the conversion from an AccountId to a ValidatorId (can be ...
Daan - R0GUE's user avatar
  • 2,884
1 vote

Failure of election for next session

Is then the current validation set re-used to solve the problem of missing validators? Correct. Is it possible also that such failure arise when the election_multi_phase pallet doesn’t complete an ...
kianenigma's user avatar
  • 2,864
1 vote
Accepted

How to implement a session progress bar for parachain?

This is a more generalized answer to this, specifically in Rust code and from within the Runtime.
kianenigma's user avatar
  • 2,864
1 vote

How to implement a session progress bar for parachain?

If what you want is the %, then you need to get the sessionProgress and the sessionLength: const progress = await api.derive.session.progress(); const total = progress.sessionLength; const value = ...
Alex Bean's user avatar
  • 5,767
1 vote

Is it possible to start a substrate BABE blockchain with no Grandpa authorities and BABE validators?

Is there a way to start the blockchain such that no session keys are set? No, then no one could produce blocks nor finalize blocks. Do all grandpa authorities need to be hardcoded in the chain spec? ...
bkchr's user avatar
  • 11.8k

Only top scored, non community-wiki answers of a minimum length are eligible