Skip to main content

Module mesh_artifact

Module mesh_artifact 

Source
Expand description

Artifact exchange over the mesh (ADR-099 section 6, mesh-placement-11).

ArtifactExchange is the node-local side of the swarm-ready piece protocol defined in crate::mesh_artifact_wire. It keeps descriptors, derives each artifact’s have bitfield from the pieces held in ArtifactStore, and decides what may be served.

  • Identity. An artifact is its piece-list root (ArtifactDescriptor::id). Pieces are stored in ArtifactStore under their own BLAKE3, so a node that holds a verified artifact can serve it (origin or not), and a restart resumes from the pieces already on disk.
  • Trust. A descriptor received from a peer is only pending: its pieces are hash-checked against it, but its content_hash is the peer’s claim. It becomes verified only when the pieces assemble to that hash on this node ([Self::promote]); if they do not, the descriptor is discarded and the pieces that fetch wrote are rolled back. Blobs already in the store are never removed on a peer’s word. Content keys (ArtifactKey::Content) resolve to verified descriptors only.
  • Governance. Only verified artifacts whose content a signed manifest lists (and that manifest verified here) are served ([Self::is_servable]); see crate::mesh_artifact_pkg.
  • Audit. Outcomes are chained (artifact.fetch, artifact.piece_rejected, artifact.serve once per peer); individual pieces are not.

Transfer (serve / fetch) lives in crate::mesh_artifact_transfer. v1 fetches from one peer at a time; card 25 adds multi-source fetch, rarest-first, seeding policy, caching and bandwidth limits on top of the same types.

Re-exports§

pub use crate::mesh_artifact_types::ExchangeConfig;
pub use crate::mesh_artifact_types::ExchangeError;

Structs§

ArtifactExchange
Node-local state of the artifact piece protocol.

Constants§

MAX_PENDING
Most partially downloaded artifacts held at once.