-
Notifications
You must be signed in to change notification settings - Fork 350
Drop peers with false ENR subnet advertising #9773
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
base: master
Are you sure you want to change the base?
Conversation
…ommittees, das subnets
} | ||
|
||
@Override | ||
public List<Peer> selectPeersToDisconnect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I have been looking at the code and this is called here:
peerSelectionStrategy
.selectPeersToDisconnect(network, peerPools)
.forEach(
peerToDrop ->
peerToDrop.disconnectCleanly(DisconnectReason.TOO_MANY_PEERS).finishTrace(LOG));
So it disconnects for the reason TOO_MANY_PEERS
. I wonder if it is better to have a different method which checks the false advertising peers and then fails with a new DisconnectReason. Probably something like FALSE_ADVERTISEMENT
or something like that. Otherwise TOO_MANY_PEERS
sounds wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can change this method to return an object with the list of peers to disconnect and the reason for that group. This way, we can always report on the exact reason for disconnecting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can change this method to return an object with the list of peers to disconnect and the reason for that group. This way, we can always report on the exact reason for disconnecting.
I like that actually, I guess more like a map DisconnectReason,List<Peer>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this? d92d991
I cannot introduce a reason, they are specced (actually goodbye messages are specced, not the reasons, but this doesn't change much, we could use existing I think)
final SszBitvector syncCommitteeSubnets = | ||
peerSubnetSubscriptions.getAttestationSubnetSubscriptions(peer.getId()); | ||
if (!syncCommitteeSubnets.isSuperSetOf(advertisedSyncCommitteeSubnets)) { | ||
reputationManager.adjustReputation(peer.getAddress(), ReputationAdjustment.LARGE_PENALTY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add a debug entry here saying we are downscoring peer X (not sure if we log this somewhere else). This will make it a bit easier to see this mechanism in action. The same applies to the other checks below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added daf1b10
subnetPeerCountGauge), | ||
reputationManager, | ||
new AtomicReference<>(), | ||
NodeIdToDataColumnSidecarSubnetsCalculator.NOOP, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this NOOP correct here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's test fixtures, don't need it at this point there, I think
Version before adding cache: 23160 calls for 3 hours (~128 calls/minute) 50th percentile: 9 ms Calls are made on different nio event threads |
Version with cache: 23408 calls during 3 hours (130 calls per minute) 50th percentile: 9 ms Cache is not helping at all, trying another approach |
This reverts commit 254571e.
…onStrategy, which sounds more correct
It's a final version. 50th percentile: 97 ms ~6000 calls during 10 hours |
if we decide no merge, don't forget to make a pr for renaming subnet to group where it's applicable, it should be merged anyway |
I tested this on fusaka-devnet-5 and seems like we consider peer lying on column subnets |
PR Description
Include attnets, sync committees, das subnets
Fixed Issue(s)
Documentation
doc-change-required
label to this PR if updates are required.Changelog