agora
agora copied to clipboard
Divide peers into three categories and apply proper limitation to them
Currently, our only check for our peers is as follow: https://github.com/bosagora/agora/blob/14459dd88a04797457a51f6e793d8b827b8d2d91/source/agora/network/Manager.d#L84-L88
However, this check is incorrect: First, any node configured as a validator
will have a public key, regardless of its enrollment status:
https://github.com/bosagora/agora/blob/14459dd88a04797457a51f6e793d8b827b8d2d91/source/agora/node/Validator.d#L337-L341
What we should do is check for the utxo
not being Hash.init
, and compare this against the Ledger
.
However, that would only leave us with two kinds of peers: full nodes and validators. The list of validators is not very stable by definition, and we've been moving towards using the presence of a stake as a criteria, rather than the enrollment itself, e.g. https://github.com/bosagora/agora/pull/2859
The same should probably be done for the network manager, so that it can differentiate nodes with identities and nodes without.