Closed itegulov closed 8 months ago
@volovyks are you still working on this or can I give this to @DavidM-D as his first ticket?
How frequently is this changing? Should we encode the node ID on the smart contract or should we pull it out of consensus somehow?
@DavidM-D only when the set of participants changes (someone joins/leaves) so fairly infrequent.
Should we encode the node ID on the smart contract or should we pull it out of consensus somehow?
Essentially, they are already in the smart contract. All that needs to be done in this ticket is instead of nodes supplying it to the smart contract when they want to join, smart contract should generate it on its end and give it out once they made it to the participant set.
I working on this.
Description
Note: node id is equivalent to participant id and is represented as
Participant
model from cait-sithRight now all nodes need to know their ID (i.e. index $
i \in 0..N-1
$ in the set of participants) at the startup time. This is highly impractical as newly joining nodes need to deduce what they should start with before they sync with the consensus. It is even more awkward when a node in the middle of the set leaves and everyone else has to restart with a different ID.What should actually happen is that nodes get to know their ID based on their position in the current consensus state. That position can easily change over time depending on who joins/leaves.