Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kusama validators getting 0 backing rewards the first session they enter the active set #3722

Merged
merged 5 commits into from
Mar 18, 2024
Merged
Changes from 1 commit
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
23 changes: 13 additions & 10 deletions substrate/frame/authority-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,22 @@ impl<T: Config> OneSessionHandler<T::AccountId> for Pallet<T> {
);

Keys::<T>::put(bounded_keys);
}

let next_keys = queued_validators.map(|x| x.1).collect::<Vec<_>>();
// `changed` represents if queued_validators changed in the previous session not in the
// current one, so it does not make sense to guard updating of next_keys by it.
// see: https://github.com/paritytech/polkadot-sdk/blob/02e1a7f476d7d7c67153e975ab9a1bdc02ffea12/substrate/frame/session/src/lib.rs#L613
alexggh marked this conversation as resolved.
Show resolved Hide resolved
let next_keys = queued_validators.map(|x| x.1).collect::<Vec<_>>();

let next_bounded_keys = WeakBoundedVec::<_, T::MaxAuthorities>::force_from(
next_keys,
Some(
"Warning: The session has more queued validators than expected. \
A runtime configuration adjustment may be needed.",
),
);
let next_bounded_keys = WeakBoundedVec::<_, T::MaxAuthorities>::force_from(
next_keys,
Some(
"Warning: The session has more queued validators than expected. \
A runtime configuration adjustment may be needed.",
),
);

NextKeys::<T>::put(next_bounded_keys);
}
NextKeys::<T>::put(next_bounded_keys);
}

fn on_disabled(_i: u32) {
Expand Down
Loading