Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Implement cross-topic forwarding #823

Open
albrow opened this issue Jun 9, 2020 · 0 comments
Open

Implement cross-topic forwarding #823

albrow opened this issue Jun 9, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@albrow
Copy link
Contributor

albrow commented Jun 9, 2020

Cross-topic forwarding is a feature idea that I first proposed in #563, but as of now has not been implemented. Cross-topic forwarding allows peers with different (but overlapping) order filters to share orders with one another. So for example, a Mesh node that is subscribed on the default topic (all 0x orders) can receive orders on any topic and forward them to nodes that are only subscribed to that topic without subscribing to or even knowing about the custom topic ahead of time. #563 does not implement cross-topic forwarding but it does add everything we need to do so in the future without breaking backwards-compatibility (at least in theory).

Here's a rough overview of how it will work:

  1. Mesh nodes which are using custom filters will publish every order to two topics: (a) the topic corresponding to their custom filter and (b) the default topic. Because of how the JSON Schemas are implemented with allOf, we know that any order which is valid for a custom topic would also be considered valid on the default topic.
  2. Mesh nodes with cross-topic forwarding enabled will check every message that they receive to see which topics they were originally published to. They can then decode the custom schema from the topic string and validate that the order does match the custom schema. If it matches, they can forward the message to the custom topic. Hopefully we can do this while retaining the original pubsub signature, but it's possible we need to re-sign the message before forwarding.

A similar approach can be used to forward messages between topic versions. In other words a message that was originally sent on topic version 3 could be modified and forwarded to topic version 4. This means we could potentially break backwards compatibility at the pubsub layer without completely fragmenting liquidity (although this approach would add additional latency).

@albrow albrow added the enhancement New feature or request label Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant