-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Allow 24 nominations per validator and publish count #7929
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would take such direction to prevent all runtimes being bound to this configuration:
Staking would accept type CompactSolution: sp_npos_elections::CompactSolution<T::AccountId>
as input in which the max-naminations is implicitly defined.
Later on, once #7909 is merged this configuration will be moved to the new election pallet and staking would only need a type MaxNominations: Get<_>
.
Actually, doing the above requires a bit of making things generic in staking, which is pretty much in vain if we also merge #7909. I'd say lets wait until we are almost at the next release: if 7909 is merged, there's no need for this. I'll get it in good shape anyhow though. |
Should build well now and the 24 is configurable from the runtime. Lots of boilerplate. as you see, so I'd consider not doing it this way as this will all be removed by the linked PR anyhow. |
}; | ||
pub use weights::WeightInfo; | ||
|
||
/// The default solution type used in substrate-node with 24 maximum winners. A runtime can customize this to their needs. | ||
pub mod default_solution { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I put this mostly here so that it can be blindly used in tests/benchmarks etc. Polkadot or any other chain should probably generate their own version.
/// The compact solution type used to accept offchain solution. | ||
/// | ||
/// This is implicitly encoding the maximum number of nominations as well. | ||
type CompactSolution: CompactSolution + frame_support::Parameter + Default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TLDR ^^^^^^^^^^^^^^^^^
@@ -208,7 +209,7 @@ benchmarks! { | |||
let r in 1 .. MAX_REPORTERS; | |||
// we skip 1 offender, because in such case there is no slashing | |||
let o in 2 .. MAX_OFFENDERS; | |||
let n in 0 .. MAX_NOMINATORS.min(MAX_NOMINATIONS as u32); | |||
let n in 0 .. MAX_NOMINATORS.min(<T as pallet_staking::Config>::CompactSolution::LIMIT as u32); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda blindly changed these and didn't check the full scope, they were 16 before, and now they are 24, just different syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can reexecute benchmarks to see
companion failing @kianenigma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the title of the PR should be "Allow 24 nominations per nominator and publish count", no ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
staking weight should be updated also I think,
otherwise looks good to me
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
…into gav-24-nominations
Has a companion now, locally my build was borked but had something to do with tracing in network crate, so def. not my issue. All runtimes build go well. Will wait to see the result here. Either way, it is ready for audit. |
anyone working on this? |
awaiting audit as it is no longer trivial. |
reintroduced in #8113 |
polkadot companion: paritytech/polkadot#2417