near / mpc

37 stars 11 forks source link

Decentralize node id distribution #330

Closed itegulov closed 8 months ago

itegulov commented 11 months ago

Description

Note: node id is equivalent to participant id and is represented as Participant model from cait-sith

Right 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.

itegulov commented 10 months ago

@volovyks are you still working on this or can I give this to @DavidM-D as his first ticket?

DavidM-D commented 10 months ago

How frequently is this changing? Should we encode the node ID on the smart contract or should we pull it out of consensus somehow?

itegulov commented 10 months ago

@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.

volovyks commented 10 months ago

I working on this.