Skip to content

add possibility to inject non-authorities session-keys in genesis#5078

Merged
bkchr merged 23 commits intoparitytech:masterfrom
girazoki:girazoki-genesis-non-validator-keys
Jul 29, 2024
Merged

add possibility to inject non-authorities session-keys in genesis#5078
bkchr merged 23 commits intoparitytech:masterfrom
girazoki:girazoki-genesis-non-validator-keys

Conversation

@girazoki
Copy link
Copy Markdown
Contributor

Add the possibility of injecting session-keys in genesis for non-validators. Currently all keys injected in genesis were considered as part of the initial validators set, this PR allows to inject a new vector with non-authority keys

@girazoki girazoki requested a review from a team as a code owner July 19, 2024 12:54
@bkchr bkchr added T1-FRAME This PR/Issue is related to core FRAME, the framework. T2-pallets This PR/Issue is related to a particular pallet. and removed T1-FRAME This PR/Issue is related to core FRAME, the framework. labels Jul 19, 2024
Copy link
Copy Markdown
Member

@davxy davxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically looks good

Comment on lines +428 to +429
/// List of (AccountId, ValidatorId, Keys) that will be registered at genesis, but not as active validators.
pub non_authority_keys: Vec<(T::AccountId, T::ValidatorId, T::Keys)>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO is worth being explicit that these keys (together with keys) will end up in the NextKeys set. I.e. keys that are registered as candidates for session after next session (session # 2).

And technically these are still authorities (well, authority candidates). So maybe a more appropriate name? Don't know registered_candidates? But naming is hard so I may be biased :-D

Copy link
Copy Markdown
Contributor Author

@girazoki girazoki Jul 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree, non_authority_keys are not necessarily authorities, whether they will be authorities it will be decided by SessionManager (even in the session # 2). Just for having keys registered they will not be authorities, unless they SessionManager decides to select them.

As for the naming, I am fine with anything as I am not too biased around it.

Copy link
Copy Markdown
Member

@davxy davxy Jul 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well.

  1. I agree that these are not necessarily actual authorities, indeed I put in bold that are candidates.
  2. This is not my opinion, if I've not overlooked something, this is just a fact. The inner_set_keys is called, which calls put_keys, which stores your non_authority_keys in NextKeys set, which are the candidates registered

So I still think is worth being explicit about what is the usage of this non_authority_keys list. Otherwise as a user the doc is not super clear.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah got it. Yeah I can add more clarity on that for sure!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright so I added a comment saying that these keys are valid at least until session 2 (maybe valid is not the best word here?), but basically my intention is to say that if there is a session-key change, the first session that would pick these new keys is session number 3

@bkchr bkchr enabled auto-merge July 22, 2024 19:53
@bkchr
Copy link
Copy Markdown
Member

bkchr commented Jul 22, 2024

@girazoki CI is not happy.

@girazoki
Copy link
Copy Markdown
Contributor Author

@girazoki CI is not happy.

will check

auto-merge was automatically disabled July 23, 2024 07:41

Head branch was pushed to by a user without write access

@bkchr
Copy link
Copy Markdown
Member

bkchr commented Jul 23, 2024

@bkchr
Copy link
Copy Markdown
Member

bkchr commented Jul 24, 2024

@girazoki CI is still not happy :D

@girazoki
Copy link
Copy Markdown
Contributor Author

@girazoki CI is still not happy :D

I am really trying xD. Let's see this time

@girazoki girazoki requested a review from acatangiu as a code owner July 26, 2024 07:21
auto-merge was automatically disabled July 29, 2024 08:46

Head branch was pushed to by a user without write access

@bkchr
Copy link
Copy Markdown
Member

bkchr commented Jul 29, 2024

Also check-semver is still failing 🙈

@girazoki
Copy link
Copy Markdown
Contributor Author

Also check-semver is still failing 🙈

That should be easy I think 😄

@girazoki
Copy link
Copy Markdown
Contributor Author

Also check-semver is still failing 🙈

Or maybe not 🙈, why is semver telling me the crates are not listed in the pr-doc when they are?

@bkchr
Copy link
Copy Markdown
Member

bkchr commented Jul 29, 2024

Also check-semver is still failing 🙈

Or maybe not 🙈, why is semver telling me the crates are not listed in the pr-doc when they are?

Ahh yeah there was a bug with none. It got fixed, not sure it is already in CI.

@bkchr bkchr added this pull request to the merge queue Jul 29, 2024
Merged via the queue into paritytech:master with commit d6f5987 Jul 29, 2024
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
…ritytech#5078)

Add the possibility of injecting session-keys in genesis for
non-validators. Currently all keys injected in genesis were considered
as part of the initial validators set, this PR allows to inject a new
vector with non-authority keys

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Aug 26, 2024
…ritytech#5078)

Add the possibility of injecting session-keys in genesis for
non-validators. Currently all keys injected in genesis were considered
as part of the initial validators set, this PR allows to inject a new
vector with non-authority keys

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
aurexav added a commit to darwinia-network/darwinia that referenced this pull request May 29, 2025
aurexav added a commit to darwinia-network/darwinia that referenced this pull request May 30, 2025
* Initialize

* Companion for paritytech/polkadot-sdk#4977

* Companion for paritytech/polkadot-sdk#5078

* Companion for paritytech/polkadot-sdk#5214

* Companion for paritytech/polkadot-sdk#5431

* Companion for paritytech/polkadot-sdk#4792

* Companion for paritytech/polkadot-sdk#5613

* Companion for paritytech/polkadot-sdk#7688

* Fixes

* Companion for paritytech/polkadot-sdk#5364

* Fixes

* Disable storage limit & fix format issue

* Benchmark only

* Patch evm

* Update patch info

* Fixes

---------

Co-authored-by: bear <boundless.forest@outlook.com>
Patrick8rz added a commit to Patrick8rz/darwinia that referenced this pull request Sep 6, 2025
* Initialize

* Companion for paritytech/polkadot-sdk#4977

* Companion for paritytech/polkadot-sdk#5078

* Companion for paritytech/polkadot-sdk#5214

* Companion for paritytech/polkadot-sdk#5431

* Companion for paritytech/polkadot-sdk#4792

* Companion for paritytech/polkadot-sdk#5613

* Companion for paritytech/polkadot-sdk#7688

* Fixes

* Companion for paritytech/polkadot-sdk#5364

* Fixes

* Disable storage limit & fix format issue

* Benchmark only

* Patch evm

* Update patch info

* Fixes

---------

Co-authored-by: bear <boundless.forest@outlook.com>
jacksonLewis88 added a commit to jacksonLewis88/darwinia that referenced this pull request Sep 25, 2025
* Initialize

* Companion for paritytech/polkadot-sdk#4977

* Companion for paritytech/polkadot-sdk#5078

* Companion for paritytech/polkadot-sdk#5214

* Companion for paritytech/polkadot-sdk#5431

* Companion for paritytech/polkadot-sdk#4792

* Companion for paritytech/polkadot-sdk#5613

* Companion for paritytech/polkadot-sdk#7688

* Fixes

* Companion for paritytech/polkadot-sdk#5364

* Fixes

* Disable storage limit & fix format issue

* Benchmark only

* Patch evm

* Update patch info

* Fixes

---------

Co-authored-by: bear <boundless.forest@outlook.com>
kinetic-smith803tr added a commit to kinetic-smith803tr/darwinia that referenced this pull request Sep 26, 2025
* Initialize

* Companion for paritytech/polkadot-sdk#4977

* Companion for paritytech/polkadot-sdk#5078

* Companion for paritytech/polkadot-sdk#5214

* Companion for paritytech/polkadot-sdk#5431

* Companion for paritytech/polkadot-sdk#4792

* Companion for paritytech/polkadot-sdk#5613

* Companion for paritytech/polkadot-sdk#7688

* Fixes

* Companion for paritytech/polkadot-sdk#5364

* Fixes

* Disable storage limit & fix format issue

* Benchmark only

* Patch evm

* Update patch info

* Fixes

---------

Co-authored-by: bear <boundless.forest@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T2-pallets This PR/Issue is related to a particular pallet.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants