Skip to content

fix: only send necessary proofs in retrieval auth delegation#357

Open
volmedo wants to merge 3 commits intomainfrom
vic/fix/retrieve-big-header
Open

fix: only send necessary proofs in retrieval auth delegation#357
volmedo wants to merge 3 commits intomainfrom
vic/fix/retrieve-big-header

Conversation

@volmedo
Copy link
Member

@volmedo volmedo commented Feb 25, 2026

Ref. #378

Uses the new validator.PruneProofs function to build retrieval auth delegations for the indexing-service that only contain the minimum amount of proofs to form a valid chain.

These delegations travel in HTTP headers and it's easy to go above the max if we just add every delegation in the agent's store.

@volmedo volmedo self-assigned this Feb 25, 2026

go 1.25.3

replace github.com/storacha/go-ucanto => ../go-ucanto
Copy link
Member Author

Choose a reason for hiding this comment

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

will update this reference when the changes are merged and tagged in go-ucanto. CI builds will fail till then.

Copy link
Member

Choose a reason for hiding this comment

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

You can refer to the commit by sha instead, and CI should work. (Waiting to merge until that's pointing to a real release is still a good idea, though, even if we haven't been consistent about that.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer the CI screaming at me so that I don't forget 😅

cmd/retrieve.go Outdated
return nil, fmt.Errorf("creating delegation to indexer: %w", err)
}

pfs, unauth := validator.PruneProofs(ctx, draftDlg, pruningCtx)
Copy link
Member

Choose a reason for hiding this comment

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

Should pruning be part of the client.Proofs(...) call? Perhaps as an option?

If no then please can we also add this to the gateway command?

return delegation.Delegate(c.Issuer(), indexerPrincipal, caps, opts...)

Copy link
Member

Choose a reason for hiding this comment

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

Why do we not use SelectProofs instead? It's a waste of work to create and sign a delegation that is subsequently thrown away.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should pruning be part of the client.Proofs(...) call? Perhaps as an option?

If no then please can we also add this to the gateway command?

I think leaving client.Proofs as just a "query and filter proofs from store" API is cleaner. I added pruning to the gateway serve command.

Why do we not use SelectProofs instead? It's a waste of work to create and sign a delegation that is subsequently thrown away.

Is this reply satisfactory?

@volmedo volmedo force-pushed the vic/fix/retrieve-big-header branch from e1fef39 to e2cf948 Compare March 6, 2026 13:00
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.

3 participants