refactor(retrieval-anon): filter expired PDP payments at the subgraph#12
Draft
dennis-tra wants to merge 1 commit into
Draft
refactor(retrieval-anon): filter expired PDP payments at the subgraph#12dennis-tra wants to merge 1 commit into
dennis-tra wants to merge 1 commit into
Conversation
`sampleAnonPiece` now adds `isPaymentActive: true` to the proofSet filter, so the subgraph excludes datasets whose PDP payment has terminated. With that guarantee, `AnonPieceSelectorService.drawPiece` collapses to a single deterministic draw per (bucket, pool): the up-to-two retry loop and the `pdpPaymentEndEpoch <= indexedAtBlock` client-side check both go away. The selector is now strictly cheaper — fewer subgraph round-trips, no client-side staleness window between `indexedAtBlock` and the chain head, and the fallback ladder (same-bucket opposite-pool → any-bucket indexed → any-bucket any) runs the same shape with half the calls. Requires the matching subgraph change (`feat/subgraph/payment-termination- tracking`) that maintains `DataSet.isPaymentActive`. Backwards compatible with the existing subgraph fields: `pdpPaymentEndEpoch` is still selected and returned in `AnonCandidatePiece` for callers that still want it, just no longer consulted by the selector itself. Closes FilOzone#579.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently targets the
anon-retrievalin ProbeLab's GH org but eventually should targetmainin https://github.com/FilOzone/dealbot after FilOzone#487 has landed.This is the second part of FilOzone#579. First part is FilOzone#582.
What
sampleAnonPiecenow addsisPaymentActive: trueto the proofSet filter,so the subgraph excludes datasets whose PDP payment has terminated. With
that guarantee,
AnonPieceSelectorService.drawPiececollapses to a singledeterministic draw per (bucket, pool): the up-to-two retry loop and the
pdpPaymentEndEpoch <= indexedAtBlockclient-side check both go away.The selector is now strictly cheaper — fewer subgraph round-trips, no
client-side staleness window between
indexedAtBlockand the chain head,and the fallback ladder (same-bucket opposite-pool → any-bucket indexed
→ any-bucket any) runs the same shape with half the calls.
Requires the matching subgraph change (
feat/subgraph/payment-termination- tracking) that maintainsDataSet.isPaymentActive. Backwards compatiblewith the existing subgraph fields:
pdpPaymentEndEpochis still selectedand returned in
AnonCandidatePiecefor callers that still want it,just no longer consulted by the selector itself.