nethermind
nethermind copied to clipboard
Better peer diversity distribution.
Is your feature request related to a problem? Please describe.
- There is a good chance that there are some kind of connection instability with nethermind or other client.
- Because of that, minor client will get poor connection allocation as it tend to get disconnected.
- eg: Erigon send bloom as zero bloom instead of null bloom which causes receipt root mismatch in nethermind which is why nethermind disconnect erigon during old receipts.
- The same can be said with home staker with poor or less stable internet connection.
- Need a way to make these unstable peer more of a priority.
Describe the solution you'd like
- Generate an internal random bytes, store it in metadata db, or some file.
- For each peer, we generate another random bytes with the peer's ENR. This random bytes is then interpreted as score and peer with higher score is prioritized over other.
- This involve disconnecting other peer when peer limit is reached to make room for this peer. Or some other strategy.
- This means unstable peer with higher score always have peer connection slots.
- Of course, accounting for invalid network or protocol violation, something like that.
- To prevent attack where an attacker create multiple fake peer with different enr saturating the node's priority connection slot, this only apply to half the pool.
Describe alternatives you've considered
- I don't know.
Additional context
- I don't trust the peer allocation.