-
Notifications
You must be signed in to change notification settings - Fork 277
Closed
Labels
Bob 👨💼Effects the "Bob" development areaEffects the "Bob" development areaEnhancementNew or improved featuresNew or improved featuresP2PNode discovery and P2PNode discovery and P2P
Description
@cygnusv says:
As a follow-up of my comment here (#1741 (comment)), I have this idea for an alternative method for Bob.matching_nodes:
def matching_nodes(self, nodes: FleetSensor):
bob_bytes = bytes(self.public_keys(DecryptingPower))
def node_index(canonical_address: bytes) -> int:
digest = SHA256(bob_bytes + canonical_address) # potentially some metadata too (e.g. label?)
index = int.from_bytes(digest, 'big')
return index
indexed_nodes = sorted([(node_index(node.canonical_public_address), node) for node in nodes])
target_nodes = list(zip(*indexed_nodes))[1]
return target_nodesInstead of giving you a selection of nodes, this would give you a deterministic ordering of nodes, where you're guaranteed that the TMap is in some of the first nodes of that list (assuming there's still one of these original Ursulas online, obviously). This would work even as the network grows, at the expense of decreasing the success probability for Bob per Ursula (i.e, if the network is 10 times bigger, then Bob will get a 10x longer list, with ~9 false positives in that list per correct Ursula).
If this is something that you like, I'd be happy to contribute with this in a follow-up PR.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bob 👨💼Effects the "Bob" development areaEffects the "Bob" development areaEnhancementNew or improved featuresNew or improved featuresP2PNode discovery and P2PNode discovery and P2P