Skip to content

Remove provider-initiated checkpoints#311

Open
bkontur wants to merge 2 commits into
devfrom
bko-remove-provider-initiated-checkpoints
Open

Remove provider-initiated checkpoints#311
bkontur wants to merge 2 commits into
devfrom
bko-remove-provider-initiated-checkpoints

Conversation

@bkontur

@bkontur bkontur commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves #306 as Option B — remove entirely: provider-initiated checkpoints were designed (#7) and implemented (#92) without review, and the rationale does not hold up — the uploading client is the sole data holder and can submit the checkpoint on-chain in the same session, a client that retains the providers' signed commitments can already enforce/challenge that state, and the provider-to-provider coordination overlaps what replica nodes do. #305 already pulled the design out of the review-gated docs; this PR deletes the implementation.

What is removed

Layer Removed
pallet-storage-provider Extrinsics 32–36 (provider_checkpoint, configure_checkpoint_window, report_missed_checkpoint, claim_checkpoint_rewards, fund_checkpoint_pool), storage (CheckpointConfigs, LastCheckpointWindow, CheckpointRewards, CheckpointPool), their 5 events and 9 errors, the window/leader helpers, the complete_deregister reward drain, and the matching benchmarks, weights and ~20 unit tests
storage-primitives CheckpointProposal, CheckpointWindowConfig
Runtimes (local + paseo) DefaultCheckpointInterval, DefaultCheckpointGrace, CheckpointReward, CheckpointMissPenalty + Config wiring
Provider node checkpoint_coordinator.rs (whole module), /checkpoint/sign + /checkpoint/duty + /checkpoint/trigger endpoints, --enable-checkpoint-coordinator flag, CheckpointChainClient impl in subxt_client.rs, ProviderState::checkpoint_cmd_tx, and the coordinator/API/auth tests
JS/TS SDK configureCheckpointWindow, fundCheckpointPool, submitProviderCheckpoint, claimCheckpointRewards, reportMissedCheckpoint, fetchCheckpointDuty, signCheckpointProposal; layer-1 getCheckpointDuty / triggerCheckpoint + CheckpointDuty type
UIs Provider dashboard checkpoint config/pool/reward/overdue display; drive-ui + s3-ui checkpoint duty/trigger panels
Examples / tooling / CI examples/papi/checkpoint-missed.ts + just papi-checkpoint-missed, e2e tests 5.4/5.5/5.7, the coordinator flag in just start-provider and 4 CI workflow jobs
Docs The five extrinsic entries + workflow + error rows in EXTRINSICS_REFERENCE.md, the runtime params in CLAUDE.md, mentions in the smart-contracts draft

Not touched: the client-initiated checkpoint / extend_checkpoint / challenge_checkpoint extrinsics, the /checkpoint-signature endpoint, and everything reading bucket.snapshot (e.g. the UIs' checkpoint-info displays) — that mechanism is canonical and unrelated.

Archive

The design and the full removed implementation (verbatim) are archived in docs/drafts/provider-initiated-checkpoints.md: pallet code, primitives, coordinator, HTTP handlers, chain-client impl, SDK wrappers, UI surfaces, the deleted example, and a behavior table for every removed test — enough to re-implement without archaeology if a validated rationale ever emerges.

Regenerated artifacts

Both runtime wasms were rebuilt and the metadata re-dumped, so:

  • crates/storage-subxt: storage_paseo_runtime.scale + regenerated bindings (just subxt-codegen pipeline). The diff also picks up runtime-API drift the stale bindings were missing (current_anchor_block, anchor_block_time_millis).
  • packages/papi/.papi/metadata/parachain.scale: descriptors regenerate from it on pnpm install.

Follow-up

bkontur added 2 commits July 23, 2026 14:53
Implements Option B of #306: the provider-initiated checkpoint design
(#7, #92) was added without review and does not hold up — the uploading
client can submit the checkpoint in the same session, client-held
signed commitments already provide enforceable protection, and the
provider-to-provider coordination overlaps what replica nodes do.

Removed across all layers:
- pallet-storage-provider: extrinsics 32-36 (provider_checkpoint,
  configure_checkpoint_window, report_missed_checkpoint,
  claim_checkpoint_rewards, fund_checkpoint_pool), storage items
  (CheckpointConfigs, LastCheckpointWindow, CheckpointRewards,
  CheckpointPool), their events and errors, the window/leader helpers,
  the complete_deregister reward drain, and the matching benchmarks,
  weights and unit tests
- storage-primitives: CheckpointProposal, CheckpointWindowConfig
- both runtimes: DefaultCheckpointInterval, DefaultCheckpointGrace,
  CheckpointReward, CheckpointMissPenalty
- provider-node: the checkpoint_coordinator module, the
  /checkpoint/sign, /checkpoint/duty and /checkpoint/trigger endpoints,
  the --enable-checkpoint-coordinator flag, the CheckpointChainClient
  impl, and the coordinator/API/auth tests
- JS/TS: layer0/layer1 SDK wrappers, e2e tests 5.4/5.5/5.7, the
  checkpoint-missed example + just recipe, and the provider/drive/s3
  UI checkpoint-config/duty/trigger surfaces
- docs (EXTRINSICS_REFERENCE, CLAUDE.md, smart-contracts draft),
  justfile, CI workflows

Client-initiated checkpoint / extend_checkpoint / challenge_checkpoint
and the /checkpoint-signature endpoint are untouched.

The design and the full removed implementation are archived verbatim in
docs/drafts/provider-initiated-checkpoints.md for later re-evaluation.

Regenerated from the new runtimes: subxt bindings + metadata
(crates/storage-subxt) and PAPI metadata (packages/papi), which also
picks up runtime-API drift the stale bindings were missing.

Follow-up: re-benchmark pallet-storage-provider weights — the
complete_deregister weight still includes the removed drain cost
(a safe overestimate).
…kpoints

The original design in the draft drifted from what was actually built.
Add a normative specification of the shipped implementation (window/leader
math, exact extrinsic semantics and validation order, storage layouts,
coordinator behavior, HTTP contracts, client surface), a list of known
defects to fix on re-implementation (unsound pool funds handling via
reserve + deposit_creating, leader-only miss penalty, skeleton coordinator,
dead errors), and an ordered re-implementation plan against the current
crate layout with the artifact-regeneration steps.
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.

Triage: remove (or justify) provider-initiated checkpoints

1 participant