Skip to content

feat(blob): add optional affinity field to /blob/add arguments - #59

Draft
alanshaw with Copilot wants to merge 1 commit into
mainfrom
copilot/add-affinity-field-to-blob
Draft

feat(blob): add optional affinity field to /blob/add arguments#59
alanshaw with Copilot wants to merge 1 commit into
mainfrom
copilot/add-affinity-field-to-blob

Conversation

Copilot AI commented Aug 1, 2026

Copy link
Copy Markdown

Per fil-one/RFC#15, adds an optional affinity field to /blob/add so callers (e.g. Ingot) can constrain Sprue's storage-node selection to a specific set of Piri DIDs without imposing static space-level routing state.

Changes

  • commands/blob/types.go: AddArguments gains Affinity []did.DID (omitempty). nil → field absent, existing routing unchanged. Non-nil → encoded as a list of storage-node DIDs.
  • commands/blob/cbor_gen.go, json_gen.go: Regenerated via go generate.
// Pin a write to a specific Piri node
args := &blob.AddArguments{
    Blob:     myBlob,
    Affinity: []did.DID{localPiriDID},
}

// Omit affinity → Sprue's default routing applies (backward-compatible)
args := &blob.AddArguments{Blob: myBlob}

Per RFC fil-one/RFC#15 (dynamic affinity routing), adds an optional
`affinity` field to `AddArguments` that accepts a list of storage-node
DIDs. When present, it constrains routing to the specified nodes.
Regenerates cbor_gen.go and json_gen.go accordingly.
Copilot AI changed the title feat: add optional affinity field to /blob/add feat(blob): add optional affinity field to /blob/add arguments Aug 1, 2026
Copilot AI requested a review from alanshaw August 1, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants