Page MenuHomePhabricator

[avalanche] Limit the size of the valid proof pool
AbandonedPublic

Authored by sdulfari on Jun 7 2022, 22:05.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Summary

The peer manager will now only maintain up to 4000 valid proofs. Since it's
desirable to maintain connections with all Avalanche peers, and
DEFAULT_MAX_PEER_CONNECTIONS is 4096, a number a bit under this seems like a
good place to start.

This patch indirectly imposes a limit on the conflict pool as well, since only
one conflict may be maintained per valid proof.

Depends on D11562

Test Plan

ninja check-avalanche

Diff Detail

Event Timeline

sdulfari requested review of this revision.Jun 7 2022, 22:05

Maybe we should just evict proof for which we have no peer after some time instead. We kind of have to do it anyways, and this makes this patch moot as far as I can tell.

Maybe we should just evict proof for which we have no peer after some time instead. We kind of have to do it anyways, and this makes this patch moot as far as I can tell.

You might be right. But in order to remove this pool limit safely, we need to consider how this impacts peer selection (due to DEFAULT_MAX_PEER_CONNECTIONS) and potentially other parts of the net code that we have not yet touched. Having this limit may also impact how staking rewards is implemented but there are more open questions for that one.

Ultimately this patch will help us launch Avalanche on mainnet in the short term while we learn from real world data and continue to the next stage.


I planned changes for a different reason. I'm investigating an edge case.

Fix a bug where conflicts would unnecessarily trigger pool trimming.

deadalnix requested changes to this revision.Jun 8 2022, 13:23

No this does not help, because you'll have to get rid of proofs for which there is no node regardless. In fact, not only do you need to, but this becomes significantly more important to once you limit how many proofs you can accept.

This revision now requires changes to proceed.Jun 8 2022, 13:23