Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is work-in-progress of a proof-of-concept (backwards incompatible) change to the routing scheme. The protocol version info has been set to a dummy value (0.0) to avoid peering with existing nodes.
Currently, we use greedy routing in all cases. This means we forward to the peer that minimizes the expected distance to the destination, where the expected distance is the distance on the spanning tree.
In this hybrid approach, we check if we're an ancestor of the destination (that is to say, if their coords in the tree are equal to our coords plus some additional hops). If we're their ancestor then we switch to source routing, using their coords (which are a source routed path from the root to the destination) as the source routed path.
In some cases where coord change, this may prevent packet loss as the cost of (possibly) routing along a suboptimal path. In particular, if the root stays the same and all of the old root->destination links are still active, then traffic should still be able to reach the destination after its coords are changed.
The source routing logic here can be reused (or slightly adapted) for more general source routing if/when we implement a full source routing pathfinder.