Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
5338f0f0
Commit
5338f0f0
authored
4 years ago
by
asynchronous rob
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tweaks to relevant_authority_ids (#2796)
parent
0794f693
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
polkadot/runtime/parachains/src/runtime_api_impl/v1.rs
+9
-2
9 additions, 2 deletions
polkadot/runtime/parachains/src/runtime_api_impl/v1.rs
with
9 additions
and
2 deletions
polkadot/runtime/parachains/src/runtime_api_impl/v1.rs
+
9
−
2
View file @
5338f0f0
...
...
@@ -240,9 +240,16 @@ pub fn session_index_for_child<T: initializer::Config>() -> SessionIndex {
pub
fn
relevant_authority_ids
<
T
:
initializer
::
Config
+
pallet_authority_discovery
::
Config
>
()
->
Vec
<
AuthorityDiscoveryId
>
{
let
current_session_index
=
session_index_for_child
::
<
T
>
();
let
earliest_stored_session
=
<
session_info
::
Module
<
T
>>
::
earliest_stored_session
();
let
mut
authority_ids
=
<
pallet_authority_discovery
::
Module
<
T
>>
::
next_authorities
();
for
session_index
in
earliest_stored_session
..=
current_session_index
{
// Due to `max_validators`, the `SessionInfo` stores only the validators who are actively
// selected to participate in parachain consensus. We'd like all authorities for the current
// and next sessions to be used in authority-discovery. The two sets likely have large overlap.
let
mut
authority_ids
=
<
pallet_authority_discovery
::
Module
<
T
>>
::
current_authorities
();
authority_ids
.extend
(
<
pallet_authority_discovery
::
Module
<
T
>>
::
next_authorities
());
// Due to disputes, we'd like to remain connected to authorities of the previous few sessions.
// For this, we don't need anyone other than the validators actively participating in consensus.
for
session_index
in
earliest_stored_session
..
current_session_index
{
let
info
=
<
session_info
::
Module
<
T
>>
::
session_info
(
session_index
);
if
let
Some
(
mut
info
)
=
info
{
authority_ids
.append
(
&
mut
info
.discovery_keys
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment