Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

make the thresholds between unsorted bags adjustable #9230

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 57 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"bin/node/rpc",
"bin/node/rpc-client",
"bin/node/runtime",
"bin/node/runtime/voter-bags",
"bin/node/testing",
"bin/utils/chain-spec-builder",
"bin/utils/subkey",
Expand Down
5 changes: 5 additions & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ pub mod constants;
use constants::{time::*, currency::*};
use sp_runtime::generic::Era;

/// Generated voter bag information.
mod voter_bags;

// Make the WASM binary available.
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
Expand Down Expand Up @@ -481,6 +484,7 @@ parameter_types! {
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
pub const MaxNominatorRewardedPerValidator: u32 = 256;
pub OffchainRepeat: BlockNumber = 5;
pub const VoterBagThresholds: &'static [u64] = &voter_bags::THRESHOLDS;
}

use frame_election_provider_support::onchain;
Expand Down Expand Up @@ -510,6 +514,7 @@ impl pallet_staking::Config for Runtime {
type GenesisElectionProvider =
onchain::OnChainSequentialPhragmen<pallet_election_provider_multi_phase::OnChainConfig<Self>>;
type WeightInfo = pallet_staking::weights::SubstrateWeight<Runtime>;
type VoterBagThresholds = VoterBagThresholds;
}

parameter_types! {
Expand Down
Loading