feat(tap-agent): use network subgraph for Horizon RAV redemption tracking#922
Merged
suchapalaver merged 14 commits intomainfrom Feb 3, 2026
Merged
feat(tap-agent): use network subgraph for Horizon RAV redemption tracking#922suchapalaver merged 14 commits intomainfrom
suchapalaver merged 14 commits intomainfrom
Conversation
Pull Request Test Coverage Report for Build 21645455959Details
💛 - Coveralls |
neithanmo
requested changes
Feb 3, 2026
Collaborator
neithanmo
left a comment
There was a problem hiding this comment.
Auditors pointed out some checks that were done in tap-agent and not in service, indicating that it could potentially cause database bloat. lets add that allocation-redeemed check in the service too
| .filter_map(|allocation_id| { | ||
| // Normalize to 20-byte allocation address for comparison. | ||
| if let Ok(collection_id) = | ||
| CollectionId::from_str(&allocation_id) |
Collaborator
There was a problem hiding this comment.
would this parses hex → CollectionId → AllocationIdCore → back to hex??
neithanmo
previously approved these changes
Feb 3, 2026
…king Query paymentsEscrowTransactions from the network subgraph to detect redeemed Horizon RAVs, replacing the LatestRavs query approach. This enables more reliable detection of allocation redemptions by checking for actual redeem transactions rather than comparing RAV values. Also adds allocation redemption checking for the AllocationId check to prevent accepting receipts for already-redeemed Horizon allocations.
The horizon branch has been merged, so use main instead.
…ubgraph The network subgraph stores allocationId as a 20-byte address, not as a 32-byte CollectionId. Use `as_address()` when encoding the allocation ID for the GraphQL query. Also remove redundant normalization logic in the response handling since the subgraph already returns 20-byte addresses.
Use the defined constant instead of Duration::default() for consistency with other test configuration values.
When the watcher source receiver is dropped, log a debug message and break out of the loop cleanly rather than panicking. This allows for graceful shutdown when the source watcher is dropped.
…20-byte address only The network subgraph consistently stores allocationId as the 20-byte address derived from the collection_id (rightmost 20 bytes), so remove the redundant 32-byte format from the query.
Log the allocation IDs being queried when checking for redeemed RAVs via the network subgraph. This aids debugging production issues with RAV finalization tracking.
530e2f3 to
c3bada7
Compare
Add AllocationRedeemedCheck to validate that allocations haven't already been redeemed before accepting receipts. For v1 receipts, queries the escrow subgraph for existing redemption transactions. For v2 receipts, queries the network subgraph for PaymentsEscrowTransactions. This prevents accepting receipts for allocations that have already been finalized, which would result in unrecoverable funds.
Add escrow and network subgraph configuration to the router integration test. This ensures the new allocation redeemed check introduced in the TAP receipt validation path is exercised during testing.
128ae16 to
2b881a2
Compare
Collaborator
Author
|
Thanks for all your feedback @neithanmo 🫡 |
neithanmo
approved these changes
Feb 3, 2026
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.
Summary
Signed off by Joseph Livesey joseph@semiotic.ai