Module fragment_gossip

Module fragment_gossip 

Source
Expand description

Fragment-index gossip — distributed discovery of which Pouch holds which fragment.

§Purpose

When a Bill node runs PutFile and distributes RLNC fragments to remote Pouch peers, it publishes a FragmentIndexAnnouncement on a dedicated gossipsub topic. All nodes that receive the announcement update their local RemoteFragmentIndex, so they know exactly which Pouch holds each fragment of a chunk.

This enables targeted FetchChunk requests: instead of broadcasting a crate::network::NetworkCommand::FetchChunkFragments to every Pouch in the network, GetFile can send a crate::network::NetworkCommand::FetchChunkFragments only to the peers listed in RemoteFragmentIndex::pointers_for.

§Topic

billpouch/v1/{network_id}/index

Separate from the NodeInfo topic (billpouch/v1/{network_id}/nodes) so that consumers can subscribe selectively.

Structs§

FragmentIndexAnnouncement
Gossip announcement published after a PutFile distributes fragments.
FragmentPointer
A gossipped pointer: which peer_id (Pouch) holds fragment_id.
RemoteFragmentIndex
In-memory index accumulated from received FragmentIndexAnnouncements.