Skip to content

feat: replace a registered Piri's delegation in sprue on onboarding - #287

Merged
alanshaw merged 3 commits into
mainfrom
ash/feat/onboard-sets-sprue-proofs
Oct 21, 2026
Merged

alanshaw merged 3 commits into
mainfrom
ash/feat/onboard-sets-sprue-proofs

Conversation

@alanshaw

Copy link
Copy Markdown
Member

Onboarding a Piri that sprue already holds now replaces sprue's copy of its delegation with the one in the request. This is how a delegation the node reissued reaches sprue. Before this, sprue kept the delegation it got at registration for good, and the only way to change it was to deregister the provider, which resets its weights.

fil-forge/infra-nodes#192 added /blob/release and /blob/reject to the delegation, and fil-forge/infra-nodes#194 makes keygen.sh reissue it when its commands change. With this change an existing node gets the new grants into sprue by running keygen.sh and onboarding-request.sh, then onboarding again with the new proof.

  • If sprue holds the provider at the requested endpoint and the request carries PIRI_PROOF, the plan includes "replace did:…'s delegation in sprue with the one in the request" and Apply calls the new SprueClient.SetProofs (/admin/provider/proofs/set). sprue has no read of the proofs it holds, so this happens on every run that carries one, the same way weights are written on every run.
  • A run without PIRI_PROOF leaves sprue's copy alone, so a second run still needs no proof.
  • A fresh provider is registered with the delegation as before. An endpoint mismatch is still a blocker.
  • docs/appliance-onboarding.md describes the replacement and how to deliver a reissued delegation.

Depends on fil-forge/sprue#149. go.mod pins sprue to that PR's commit (db351b7), the only place AdminProviderProofsSet exists yet. The pin also brings ucantone from 2026-08-27 to 2026-09-28 and libforge to 2026-10-01. Everything builds and the tests pass, including the hilt client. Before merging:

Tests: plan and apply for a registered provider with a proof (replaced, not re-registered), and a fresh provider (not replaced). Four existing tests that assert exact action lists for unrelated cases now leave the proof out of their request. go test ./... passes.

🤖 Generated with Claude Code

@alanshaw
alanshaw marked this pull request as ready for review October 20, 2026 15:00
@alanshaw
alanshaw requested a balanced review from Copilot October 20, 2026 15:48
alanshaw and others added 2 commits October 20, 2026 16:48
sprue kept the delegation it got at registration for good, so a
delegation the node reissued with new commands never reached it. When
sprue already holds the provider and the request carries the Piri proof,
onboarding now replaces sprue's copy through /admin/provider/proofs/set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alanshaw
alanshaw force-pushed the ash/feat/onboard-sets-sprue-proofs branch from 585aa75 to c4aa01e Compare October 20, 2026 15:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human confirmation is needed that every stage supports the new sprue API before the updated Lambda rolls out.

No open issues 🎉

What changed in this PR

Updates Piri onboarding to replace an existing provider’s delegation in sprue without deregistering it or resetting its weights.

Changes:

  • Adds proof replacement when a registered provider’s request includes PIRI_PROOF.
  • Adds regression tests and documents the delegation refresh workflow.
  • Updates sprue and related dependencies for the new API.
File Description
internal/​onboard/​sprue.go Adds the proof-replacement client method.
internal/​onboard/​onboard.go Plans and applies delegation replacement.
internal/​onboard/​onboard_test.go Tests replacement and fresh-registration behavior.
go.sum Updates dependency checksums.
go.mod Updates sprue and related dependency versions.
docs/​appliance-onboarding.md Documents delivering reissued delegations.

Review effort: Balanced

@alanshaw
alanshaw merged commit ed31b01 into main Oct 21, 2026
25 checks passed
@alanshaw
alanshaw deleted the ash/feat/onboard-sets-sprue-proofs branch October 21, 2026 10:50
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