Remove provider-initiated checkpoints#311
Conversation
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.
danielbui12
left a comment
There was a problem hiding this comment.
Before merging this, make sure you run benchmark to re-generate correct weights following new changes in pallet storage provider
|
/cmd bench --runtime web3-storage-paseo storage-parachain-runtime |
|
Command "bench --runtime web3-storage-paseo storage-parachain-runtime" has started 🚀 See logs here |
…-storage-paseo storage-parachain-runtime'
|
Command "bench --runtime web3-storage-paseo storage-parachain-runtime" has finished ✅ See logs here DetailsSubweight results:
Command output:args: Namespace(command='bench', continue_on_fail=False, quiet=False, clean=False, runtime=['web3-storage-paseo', 'storage-parachain-runtime'], pallet=[], steps=50, repeat=20, profile='production') |
@danielbui12 yes, good point, thank you :) |
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
pallet-storage-providerprovider_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, thecomplete_deregisterreward drain, and the matching benchmarks, weights and ~20 unit testsstorage-primitivesCheckpointProposal,CheckpointWindowConfigDefaultCheckpointInterval,DefaultCheckpointGrace,CheckpointReward,CheckpointMissPenalty+ Config wiringcheckpoint_coordinator.rs(whole module),/checkpoint/sign+/checkpoint/duty+/checkpoint/triggerendpoints,--enable-checkpoint-coordinatorflag,CheckpointChainClientimpl insubxt_client.rs,ProviderState::checkpoint_cmd_tx, and the coordinator/API/auth testsconfigureCheckpointWindow,fundCheckpointPool,submitProviderCheckpoint,claimCheckpointRewards,reportMissedCheckpoint,fetchCheckpointDuty,signCheckpointProposal; layer-1getCheckpointDuty/triggerCheckpoint+CheckpointDutytypeexamples/papi/checkpoint-missed.ts+just papi-checkpoint-missed, e2e tests 5.4/5.5/5.7, the coordinator flag injust start-providerand 4 CI workflow jobsEXTRINSICS_REFERENCE.md, the runtime params inCLAUDE.md, mentions in the smart-contracts draftNot touched: the client-initiated
checkpoint/extend_checkpoint/challenge_checkpointextrinsics, the/checkpoint-signatureendpoint, and everything readingbucket.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-codegenpipeline). 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 onpnpm install.Follow-up