-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Put all authorities of a session into SessionInfo
.
#3813
Conversation
@@ -120,7 +123,7 @@ impl<T: Config> Pallet<T> { | |||
// create a new entry in `Sessions` with information about the current session | |||
let new_session_info = SessionInfo { | |||
validators, // these are from the notification and are thus already correct. | |||
discovery_keys: take_active_subset(&active_set, &discovery_keys), | |||
discovery_keys: take_active_subset_and_inactive(&active_set, &discovery_keys), |
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.
This only seems to alter the discovery keys
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.
Yes, that's on purpose. We do have more authorities than parachain validators, but only parachain validators will be approval checkers, thus limiting assignment keys seems to be desired.
Any implementer's guide changes needed? |
Haven't found any places that would need adaption. |
Yeah ok - the comments there can be updated as well. Will do! |
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.
LGTM.
We used to map AuthorityDiscoveryId
to ValidatorId
by index, but I can't find that code anymore. I think we only map the other way around now. But maybe there are some external tools (e.g. block explorers) that make some assumptions about their length. We should somehow communicate that.
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.
Few nits, LGTM
/// in parachain consensus. See | ||
/// [`max_validators`](https://github.com/paritytech/polkadot/blob/a52dca2be7840b23c19c153cf7e110b1e3e475f8/runtime/parachains/src/configuration.rs#L148). | ||
/// | ||
/// `SessionInfo::validators` will be limited to to `max_validators` when set. |
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.
/// `SessionInfo::validators` will be limited to to `max_validators` when set. | |
/// `SessionInfo::validators` will be limited to `max_validators` when set. |
let subset: Vec<_> = active_validators | ||
/// Take an active subset of a set containing all validators. | ||
/// | ||
/// First item in pair will be all items in set have indeces found in the `active` indices set (in |
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.
/// First item in pair will be all items in set have indeces found in the `active` indices set (in | |
/// First item in pair will be all items in set have indices found in the `active` indices set (in |
let (mut a, mut i) = split_active_subset(active, all); | ||
a.append(&mut i); | ||
a |
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.
nit: iiuc is only done, to assure that the acitve validators occupy the indices 0..n
, correct? Would be nice to state this in the comment and/or the fn
-name
* master: (21 commits) Add build with docker info to README (#3843) improve approval tracing (#3846) UMP: Support Overweight messages (#3575) Companion for substrate#9115 (#3265) Better error messages. (#3835) Put all authorities of a session into `SessionInfo`. (#3813) Bump tracing from 0.1.26 to 0.1.27 (#3841) Companion for substrate#9711 (#3801) fix complaints in CI (#3838) dockerfiles: upgrade to ubuntu:20.04; some chore (#3828) make polkadot-runtime optional feature (#3820) Companion for #9648 (#3757) Substrate Companion #9737 (#3830) Add logging for worker spawn failures (#3827) Add Canvas (#3823) Allow staking miner to use different election algorithms (#3752) Do not expire HRMP open channel requests (#3543) Bump tokio from 1.10.1 to 1.11.0 (#3821) Add words to the dictionnary (#3819) Add vault secrets to puplish-rustdoc job (#3816) ...
* master: Raised nits on #3813 (#3844) Don't try to connect to ourselves. (#3855) add dispute metrics, some chores (#3842) add type info derive to senderror (#3860) Companion for #8615: enrich metadata with type information (#3336) approval-voting: processed wakeups can also update approval state (#3848) Add build with docker info to README (#3843) improve approval tracing (#3846) UMP: Support Overweight messages (#3575) Companion for substrate#9115 (#3265) Better error messages. (#3835) Put all authorities of a session into `SessionInfo`. (#3813) Bump tracing from 0.1.26 to 0.1.27 (#3841) Companion for substrate#9711 (#3801) fix complaints in CI (#3838)
* master: Raised nits on #3813 (#3844) Don't try to connect to ourselves. (#3855) add dispute metrics, some chores (#3842) add type info derive to senderror (#3860) Companion for #8615: enrich metadata with type information (#3336) approval-voting: processed wakeups can also update approval state (#3848) Add build with docker info to README (#3843) improve approval tracing (#3846) UMP: Support Overweight messages (#3575) Companion for substrate#9115 (#3265) Better error messages. (#3835) Put all authorities of a session into `SessionInfo`. (#3813)
Authorities are not limited to parachain consensus, thus we should have access to all authorities for a given session, even with
max_validators
set.This change fixes dispute distribution, which needs to know the authorities of the current session, so it can make sure the block producer will see its votes.
I checked the code base, apart from dispute distribution no subsystems should be affected by this change.
Fixes: #3653