Skip to content

refactor PDP to use SP-side pull#678

Open
parkan wants to merge 6 commits intomainfrom
feat/fwss-pdp-pull
Open

refactor PDP to use SP-side pull#678
parkan wants to merge 6 commits intomainfrom
feat/fwss-pdp-pull

Conversation

@parkan
Copy link
Copy Markdown
Collaborator

@parkan parkan commented May 3, 2026

No description provided.

parkan and others added 6 commits April 29, 2026 15:31
Drops the broken create-with-self-as-SP flow in favor of the
FWSS-mediated SP-submits model. Singularity now never touches PDPVerifier
directly. For each batch it: looks up the SP's PDP service URL via
ServiceProviderRegistry, signs the EIP-712 extraData, POSTs
/pdp/piece/pull to have the SP fetch pieces from singularity's content
provider, waits for SP-side completion, then POSTs
/pdp/data-sets/create-and-add (new sets, atomic with first batch) or
/pdp/data-sets/{id}/pieces (existing assembling sets) to trigger the
on-chain commit which the SP submits from its own wallet.

- pdp_pull.go (new): OnChainPDP adapter. SP service-URL discovery with
  caching, EIP-712 signing via go-synapse SignDigest, atomic
  create-and-add for new sets, add-pieces for existing. ClientDataSetID
  persisted on PDPProofSet.
- pdp_api.go: PDPProofSetManager collapses to one method,
  PullPiecesToFWSS. PDPSchedulingConfig drops ConfirmationDepth +
  PollingInterval, gains PullTimeout. PDPTransactionConfirmer,
  PDPQueuedTx, PDPTransactionReceipt deleted (Curio handles confirmation).
- pdp_schedule.go: drops the currentProofSetID transfer-handoff state
  machine and resolveProviderEVMAddress; calls PullPiecesToFWSS per batch.
- pdp_onchain.go + pdp_onchain_test.go deleted.
- model.PDPProofSet: adds ClientDataSetID + ServiceURL. ProposedProviderEVM
  field dropped from struct (column lingers harmlessly on existing DBs).
- cmd/run/dealpusher.go: replaces --pdp-confirmation-depth /
  --pdp-poll-interval with --pdp-pull-timeout. Adds required
  --pdp-source-url-base and optional --pdp-record-keeper.
- send-manual-pdp.go: rewritten for the new flow.
- pdp_wiring_test.go, pdp_api_test.go: updated mocks + assertions.

NOTE: requires go-synapse feat/signdigest-authhelper. Branch carries a
local replace directive; drop it and bump go-synapse once the PR lands.
Drops the local replace directive that was pointing at the in-flight
go-synapse branch. The dealpusher pull flow now resolves cleanly via
the upstream EVMSigner.SignDigest + pdp.NewAuthHelper(SignDigestFunc, ...)
APIs.
The rest of service/dealpusher/ imports github.com/cockroachdb/errors
under its natural name 'errors' (120 errors.Wrap* call sites). The
FWSS-pull rewrite was an outlier with 21 cockroach.Wrap* call sites and
a separate stdlib errors import.

Drop the alias and the stdlib errors import; cockroachdb/errors covers
errors.New/Is/Wrap/Wrapf for everything we use here.
Picks up:
- d91ba0c, 2406bd9: spregistry getProvider* abi unpack fixes (was blocking
  Service.GetProviderByAddress on calibnet)
- 35c6f36: abix.UnpackSingleTuple extracted from spregistry, contracts/payments.go
  callers migrated
- 3273a9a: txutil retry/nonce helper cleanup
- 40ae25e: gosimple S1016 cleanup in payments.go
go generate output for the new send-manual-pdp --payload-size flag
and the deal-pusher --pdp-source-url-base / --pdp-pull-timeout /
--pdp-record-keeper flag set.
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.

1 participant