Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

client/authority-discovery: Allow two AuthorityIds to share one PeerId #7461

Closed
Tracked by #989
mxinden opened this issue Oct 29, 2020 · 1 comment · Fixed by #10259
Closed
Tracked by #989

client/authority-discovery: Allow two AuthorityIds to share one PeerId #7461

mxinden opened this issue Oct 29, 2020 · 1 comment · Fixed by #10259
Assignees
Labels
A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. I3-bug The node fails to follow expected behavior. I7-refactor Code needs refactoring. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Comments

@mxinden
Copy link
Contributor

mxinden commented Oct 29, 2020

Scenario

Say validator V1 is present in the authority set of session S1 with the authority id A1. V1 publishes its network addresses with peer id P1 under the key A1. For session S2 it changes its session keys and thus derives the authority id A1*. It then publishes its network addresses with peer id P1 under the key A1*.

Problem

Another validator V2 would lookup the authorities of both the current and the next session and thus the authority ids A1 and A1*. Today calling get_authority_id_by_peer_id will return either A1 or A1* whereas callers would be interested in both.

pub async fn get_authority_id_by_peer_id(&mut self, peer_id: PeerId) -> Option<AuthorityId> {

Solution

Treat the matching between AuthorityId and PeerId as a many to one relationship. One AuthorityId can have at most one PeerId (with deprecation of sentries in mind) at any given point in time. One PeerId can have many AuthorityIds.

@mxinden mxinden added I3-bug The node fails to follow expected behavior. I7-refactor Code needs refactoring. labels Oct 29, 2020
@mxinden mxinden self-assigned this Oct 29, 2020
@tomaka tomaka added the Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. label May 3, 2021
@stale
Copy link

stale bot commented Jul 7, 2021

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. I3-bug The node fails to follow expected behavior. I7-refactor Code needs refactoring. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants