-
Notifications
You must be signed in to change notification settings - Fork 112
kademlia: use IsSameAs instead of Match for capability index comparison #2073
Conversation
Should there be a test that catches the case? |
added. also, please note - the tests in |
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.
Test TestCapabilityNeighbourhoodDepth is failing.
@acud So I am wondering now whether this is actually correct. The "light" and "full" client presets really are just temporary presets until we have proper capabilities negotiations logic in place. Won't this change actually prohibit "light" nodes from connecting to full clients? In terms of capabilities "light" node preset is supposed to be a subset of "full" node preset. Instead of this, probably there should be some logic that prevents the full node from connecting to a light node, but not the other way around. Sorry for not commenting this earlier, but my head has been elsewhere the last couple of weeks. |
@nolash can you please refer me to the code sanctioning a light client from connecting to a full node? I'm not sure if I am aware of such. It might at some point prevent a full node from connecting to a light client (although I think that the kademlia Looking at: Lines 173 to 180 in 0bc6bef
|
…on (ethersphere#2073) * kademlia: use IsSameAs instead of Match for capability index comparison
Fixes a bug where full node gets added to the light node capability index because it satisfies the comparison in the capabilities
Match
function (because light nodes will always be fulfilling a subset of full node capabilities).Instead,
IsSameAs
should be used when doing the comparison