14
votes
Accepted
How can the Substrate staking pallet be used in a parachain?
Finally, the first draft of my write up about this complicated topic is done. This document would likely change, find the latest version here.
The following is the version as of June 2022.
In depth ...
9
votes
Pallets needed for staking
If you want nominated proof of stake (NPoS) for validator staking of a standalone chain then you may extend the substrate-node-template by adding these further pallets from the Substrate repository:
...
7
votes
Accepted
Staking locking vs reserving
Locks can overlap, while reserved values cannot. This means that if a value is reserved, it cannot be used in other operations that would also reserve.
Consider somebody who both stakes and ...
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 ...
3
votes
Help for Staking Pallet! Preventing oversubscription on validator nodes
maxNominatorsCount is the maximum number of nomination intentions that can be set. In other words, it is limit on the maximum number of nominators. If set to None, no limit will exist.
...
2
votes
Accepted
Local network does not change validator set
This issue have been solved in this PR- https://github.com/ChainSafe/substrate-node-template/pull/4
2
votes
Local network does not change validator set
You should rise the validatorCount, that sets a target for the ideal number of validators.
You can do that in different ways:
set_validator_count
increase_validator_count
scale_validator_count
After ...
2
votes
Accepted
Benchmarking in a cusom pallet requires a storage put operation in Staking pallet
You can do it the same way as in tests, by inserting storage items like @Purple_Turtle posted in the comment;
pallet_staking::ActiveEra::<T>::put(…)
One example would be from the nomination-...
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
Allow specific accounts to make extrinsic calls
In short, use a SignedExtension if there is no configurable origin for a pallet. See How does one block specific accounts from calling extrinsics for a substrate pallet?
2
votes
Pallet Call Indicies are Conflicting Error
A macro was introduced to pallets to explicitly define an index for each runtime call.
If the pallet you are working on uses this macro, ensure that newly added calls also have a call index. E.g.:
#[...
2
votes
Accepted
How to test a pallet that depends on the staking pallet?
You will need to add the Staking Pallet into your mock construct_runtime!:
From frame/session/benchmarking/src/mock.rs:
frame_support::construct_runtime!(
pub enum Test where
Block = Block,...
1
vote
How to make POS consensus using Frontier?
Frontier does not do anything with the process of block authoring. It creates a EVM-compatibility layer on top of Substrate. To convert the PoA to PoS consensus, you need to reconfigure the validator ...
1
vote
Sudo account reward remainder
RewardRemainder need an object that implement OnUnbalanced.
https://github.com/paritytech/polkadot-sdk/blob/96ab6869bafb06352b282576a6395aec8e9f2705/substrate/frame/staking/src/pallet/mod.rs#L164
We ...
1
vote
How to stake asset instead of currency?
In pallet-staking you can see that type Currency has to implement the LockableCurrency trait which is implemented for pallet-balances.
Unfortunately this isn't implemented for pallet-assets. You could ...
1
vote
Accepted
How to burn the tokens treasury gets from staking inefficiency?
Yes you are correct (ref):
The remaining reward is send to the configurable end-point T::RewardRemainder.
You can set it to () (implementation) which will result in its
"default" ...
1
vote
Node template with POS Babe consensus: Removal of Unnecessary Extra Pallets
This is the kitchensink runtime and is configured with many pallets on purpose (to mimic a chain that is closer to how a real chain would be configured). If you want to use a chain with PoS (babe) ...
1
vote
How to fix the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `parity_scale_codec::Compact<sp_runtime::Perbill>`?
Workaround: Patching the dependency in the root Cargo.toml should solve the issue for now:
[patch.crates-io]
parity-scale-codec = { git = "https://github.com/paritytech/parity-scale-codec.git&...
1
vote
How to fix the trait `parity_scale_codec::MaxEncodedLen` is not implemented for `parity_scale_codec::Compact<sp_runtime::Perbill>`?
There has be a bug in the recently released SCALE version 3.6.6 and it has been yanked since.
Please fix the version to one earlier like this: =3.6.5. Just using 3.0.0 could have pulled in the faulty ...
1
vote
Accepted
Why my node doesn't create any block?
Because there isn't any genesis stakers.
No validators means no one to produce the block.
https://github.com/XcavateBlockchain/MarketplaceMVP_Substrate/blob/fd6743b04455fbf1f2d0aaccf4885970d951076b/...
1
vote
Accepted
Unable to unbond all the funds present in the locks
If you are running your own private network, check if your existential deposit is set to zero, it will fail the conditionledger.active < T::Currency::minimum_balance(), here minimum_balance is ...
1
vote
Accepted
the trait `std::clone::Clone` is not implemented for `Nominations<T>`
You need to change Clone in derive above Nominations to CloneNoBound. The difference between Clone and CloneNoBound is the handling of T. In case of Clone it adds the bound Clone to T. CloneNoBound ...
1
vote
Accepted
How to regenerate the voterlist
A proper way to call this method is writing a storage migration similar to this one.
Keep in mind, that using enum for storage versioning is not the best approach, so I would instead use integers, ...
1
vote
How could I get that reward amount of the nominator
Probably what you are looking for is to inspect the Rewarded event and find the one that corresponds to your nominator of choice. Some useful links to docs/tools:
https://paritytech.github.io/...
1
vote
Staking Election Failed (staking.StakingElectionFailed The election failed. No new era is planned. ) after adding EVM with NPOS(i.e BABE)
chilling the validators is not good practise as it is a 1 validator on network and if you do this your blockchain will stop you can do some other changes in you program you can add fallback in lib.rs ...
1
vote
Staking rewards for collator services
Review the code of how existing parachains have already added that feature or are in the process of doing so and then abide by their licensing requirements if you make use of their code or the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pallet-staking × 34staking × 13
pallet × 6
substrate-node-template × 6
validator × 5
assets × 3
session × 3
polkadot-js × 2
substrate-node × 2
substrateinterface × 2
grandpa × 2
migration × 2
benchmark × 2
pos × 2
pallet-treasury × 2
rewards × 2
polkadot × 1
extrinsic × 1
balances × 1
reserved-balance × 1
rust × 1
try-runtime × 1
babe × 1
parachain × 1
collator × 1