This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes consensus-shipyard/ipc#463
Changes in this PR:
Client::publish_preemptive(subnet_id, bytes)
to publish arbitrary data to an arbitrary subnetEvent::ReceivedPreemptive(subnet_id, bytes)
to the events emitted byService::subscribe()
pin_subnet
to subscribe to a topic based on the (child) subnet ID and the network name to receive pre-emptive dataThe idea is that agents on the parent network pin the ID of child subnets they know exist, because they are interested in resolving data from them, so it's a natural assumption that they would want to benefit from pre-emptively published data as well.
By contrast, we could have used a topic based on the parent subnet ID, which would allow anyone to publish any made-up subnet ID. I reckon this would be difficult to regulate, as the potential number of subnets is unknown, so coming up with stable Gossipsub topic parameters would be tricky; for example we can't predict the volume and frequency of data published to this topic up front, and therefore we can't easily filter out overproducing peers.
While anyone can publish data to the subnet specific topics as well, it is more likely that we have expectations about how much data we expect from subnets we know about.
Potential enhancements
It is possible that an agent would want to opt-out of this feature, in case it is abused. At least with the
resolve
method they already know that the CID has been signed and embedded, whereas here anyone can push whatever they want. Perhaps it would be a good idea to attach the peer ID to the event, so the agent can report bad behaviour.What exactly should the agents publish? At the moment it's raw bytes, expected to be inserted into an in-memory
Blockstore
temporarily after its CID is calculated by the agent, expecting that soon it would have to be resolved anyway. The message is intentionally identical from all agents, soGossipsub
can filter duplicates.Note that is unlikely that we could use group signatures here. At best a checkpoint is signed, but there are no Merkle proofs we can use to prove that a sequence of bytes is actually a message that's included in the checkpoint. Although, the voting mechanism in consensus-shipyard/ipc#447 could be used by the validators in the child-subnet to gather quorum over individual messages. However, every member could potentially publish the same message with slightly different quorum composition, defeating the duplicate filters.