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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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::...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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://...
1
vote
Accepted
chain stop producing block after adding pallet-session
Solved this issue by removing the author inherent functionality.
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. ...
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#...
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/
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 ...
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 ...
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.
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 = ...
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? ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
session × 36validator × 8
staking × 7
babe × 5
epoch × 4
pallet × 3
parachain × 3
polkadot-js × 3
aura × 3
grandpa × 3
pallet-staking × 3
evm × 2
blockchain × 2
extrinsic × 2
nodes × 2
substrate-node × 2
chainspec × 2
election × 2
parachain-collator × 2
polkadot × 1
kusama × 1
api × 1
storage × 1
moonbeam × 1
historical × 1