Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divide peers into three categories and apply proper limitation to them #2867

Open
Geod24 opened this issue Jan 18, 2022 · 0 comments
Open

Divide peers into three categories and apply proper limitation to them #2867

Geod24 opened this issue Jan 18, 2022 · 0 comments
Labels
C. Network Communication An issue which is related to network communication

Comments

@Geod24
Copy link
Collaborator

Geod24 commented Jan 18, 2022

Currently, our only check for our peers is as follow:

///
public bool isValidator () const scope @safe pure nothrow @nogc
{
return this.key != PublicKey.init;
}

However, this check is incorrect: First, any node configured as a validator will have a public key, regardless of its enrollment status:

auto enroll_key = this.enroll_man.getEnrollmentKey();
Identity id = Identity(this.config.validator.key_pair.address,
enroll_key == Hash.init ? this.getFrozenUTXO() : enroll_key);
if (key == PublicKey.init)
return id;

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. #2859

The same should probably be done for the network manager, so that it can differentiate nodes with identities and nodes without.

@Geod24 Geod24 added the C. Network Communication An issue which is related to network communication label Jan 18, 2022
@Geod24 Geod24 added this to the 6. Stabilization milestone Jan 18, 2022
@Geod24 Geod24 self-assigned this Jan 18, 2022
@omerfirmak omerfirmak removed their assignment Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C. Network Communication An issue which is related to network communication
Projects
None yet
Development

No branches or pull requests

3 participants
@Geod24 @omerfirmak and others