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
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.
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.substrate/client/authority-discovery/src/service.rs
Line 68 in 179e02b
Solution
Treat the matching between
AuthorityId
andPeerId
as a many to one relationship. OneAuthorityId
can have at most onePeerId
(with deprecation of sentries in mind) at any given point in time. OnePeerId
can have manyAuthorityId
s.The text was updated successfully, but these errors were encountered: