fix: only send necessary proofs in retrieval auth delegation#357
fix: only send necessary proofs in retrieval auth delegation#357
Conversation
|
|
||
| go 1.25.3 | ||
|
|
||
| replace github.com/storacha/go-ucanto => ../go-ucanto |
There was a problem hiding this comment.
will update this reference when the changes are merged and tagged in go-ucanto. CI builds will fail till then.
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
Line 178 in d1d1504
There was a problem hiding this comment.
Why do we not use SelectProofs instead? It's a waste of work to create and sign a delegation that is subsequently thrown away.
There was a problem hiding this comment.
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
SelectProofsinstead? It's a waste of work to create and sign a delegation that is subsequently thrown away.
Is this reply satisfactory?
e1fef39 to
e2cf948
Compare
Ref. #378
Uses the new
validator.PruneProofsfunction 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.