Skip to content

fix: /pdp/accept task link mismatch by invoking with no nonce - #54

Open
alanshaw wants to merge 1 commit into
mainfrom
ash/fix/pdp-nonce
Open

fix: /pdp/accept task link mismatch by invoking with no nonce#54
alanshaw wants to merge 1 commit into
mainfrom
ash/fix/pdp-nonce

Conversation

@alanshaw

Copy link
Copy Markdown
Member

The /pdp/accept invocation is constructed independently in three places: the blob accept handler (for the AcceptOK.pdp promise), the aggregation pipeline (to issue the receipt), and the /pdp/info handler (to look the receipt up). Each call used the default random nonce, so the three task links never matched — receipts were stored under a link nobody else could derive, the pdp promise never resolved, and /pdp/info never found the receipt.

Invoke with invocation.WithNoNonce() at all three sites so the task is idempotent and its link is deterministically derivable from the blob multihash, matching the PDP protocol spec (and the existing /blob/accept pattern).

…aces: the blob accept handler (for the `AcceptOK.pdp` promise), the aggregation pipeline (to issue the receipt), and the `/pdp/info` handler (to look the receipt up). Each call used the default random nonce, so the three task links never matched — receipts were stored under a link nobody else could derive, the pdp promise never resolved, and `/pdp/info` never found the receipt.

Invoke with `invocation.WithNoNonce()` at all three sites so the task is idempotent and its link is deterministically derivable from the blob multihash, matching the PDP protocol spec (and the existing `/blob/accept` pattern).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make /pdp/accept task links deterministic (and therefore consistent across the blob accept handler, aggregation receipt issuance, and /pdp/info receipt lookup) by constructing the invocation with invocation.WithNoNonce(), aligning with the PDP protocol requirement that the task be idempotent and derivable from the blob multihash.

Changes:

  • Add invocation.WithNoNonce() when building /pdp/accept invocations in the blob accept handler, aggregation receipt generator, and /pdp/info handler.
  • Add an explanatory comment in the blob accept handler documenting why the nonce must be omitted for deterministic task links.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pkg/ucanhandlers/pdp/info.go Rebuilds /pdp/accept invocation for deterministic receipt lookup.
pkg/ucanhandlers/blob/accept.go Builds the AcceptOK.pdp promise task link deterministically by omitting nonce.
pkg/pdp/aggregation/manager/accepter.go Issues receipts against a deterministically rebuilt /pdp/accept invocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 80 to 84
pdpAcceptInv, err := pdp.Accept.Invoke(
deps.ID, deps.ID.DID(),
&pdp.AcceptArguments{Blob: args.Blob},
invocation.WithNoNonce(),
)
Comment on lines 79 to +83
// receipt store indexed under.
pdpAcceptInv, err := pdp.Accept.Invoke(
deps.ID, deps.ID.DID(),
&pdp.AcceptArguments{Blob: args.Blob},
invocation.WithNoNonce(),
@bajtos

bajtos commented Jul 31, 2026

Copy link
Copy Markdown
Member

What are the risks of not using any nonce? What is the worst-case outcome of a replay attack?

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.

4 participants