-
Notifications
You must be signed in to change notification settings - Fork 22
Add Full Horizon (V2) TAP Receipt Verifier Support #825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
7a60956
to
4c6e510
Compare
0793bf6
to
f3b0f7d
Compare
3e2b57d
to
be4b685
Compare
e186490
to
3928a0b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow @neithanmo! Awesome work figuring all this out and capturing all your findings in so many useful additions! I'm going to keep digesting your findings and will try out running the tests locally 🫡
af574a0
to
8010e22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @neithanmo 🙌
0be8332
to
d065739
Compare
ecc19b7
to
63cfffe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has been tested locally using commit https://github.com/semiotic-ai/local-network/commit/b18f40147a01aa050c1172a7f524b8443a7a3d32
running just setup
then just test-local-v2
!
Amazing work @neithanmo 🫡
Adds indexer-cli Docker container built from graphprotocol/indexer horizon branch to enable allocation management via indexer-agent API for integration testing. - Builds from horizon branch with ESM compatibility fix - Auto-connects to indexer-agent on startup - Integrated into docker-compose and setup-test-network.sh - Enables allocation operations: list, close with POI, etc.
- Replace verbose debug logs with structured fields - Use consistent sender_type_str formatting (V1/V2) - Simplify error messages while preserving key information - Remove excessive escrow account mapping dumps - Consolidate allocation address handling logic***
- Replace hardcoded values with imports from constants module - Use SUBGRAPH_ID constant to match local-network/.env SUBGRAPH value - Consolidate import statements for better organization - Remove duplicate env var lookup in test_subgraph_deployment - Maintain env variable override functionality while standardizing defaults
Add minimal Docker-based wrapper around indexer-cli service to enable programmatic allocation operations in integration tests. Features: - List active allocations via graph indexer allocations get - Close allocations with zero POI for testing - Configurable container name via environment variables - Ethereum address parsing with deduplication Note: Integration with test suite pending further investigation.
- Replace MetricsChecker with DatabaseChecker for more reliable state verification - Add comprehensive V1 TAP test implementation with database validation - Enable early exit on successful RAV creation in V2 tests - Add detailed progress tracking with trigger threshold calculations - Implement delayed RAV creation detection with timeout handling - Remove commented-out legacy metrics code and unused imports - Disable invalid_chain_id test temporarily - Consolidate import statements across test modules The database checker provides direct access to TAP state rather than relying on metrics parsing, which are less reliable.
- Add V1 TAP escrow signer authorization with proof generation - Add V2 PaymentsEscrow signer authorization - Use separate gateway signer accounts (ACCOUNT1) for authorization - Add verification checks for both V1 and V2 signer authorization - Improve logging with clearer role descriptions and error handling
…renames • Replace string-interpolated logs with structured fields (tracing) for machine-parsable, consistent logs and lower formatting overhead. • main, metrics, routes, service: convert logs to structured fields (error, deployment, addr, config_path, etc.); fix typo “occoured” -> “occurred”. • tap-agent: • sender_account, sender_accounts_manager, sender_allocation, metrics, tracker/, tap/: widespread conversion to structured logs; clarify messages and add useful fields (allocation_id, sender, fees, counts, channel, code, etc.). • Derive Debug for DenyListVersion to improve log output. • No functional changes intended; only logging structure, readability, and typo fixes.
test: remove commented code; fix typos build: move deps to workspace
test: use our custom local-network to use subgraph-deploy patch which consist on simple loop to wait for TAP subgraph to be ready test: fix gateway path
…ith isLegacy + sender_type - Remove global allocation typing in Manager; keep a single raw watcher - Add per-sender normalization using Network Subgraph Allocation.isLegacy + escrow-derived sender_type - Pass typed Receiver<HashSet<AllocationId>> to SenderAccount; remove in-actor retyping
- Make DatabaseChecker hold TestConfig - improve receipts and rav checks using tap-agent config - V1 queries: fix table/column usage to scalar_tap_receipts/scalar_tap_ravs and signer_address - has_rav_for_identifier (V1) - get_pending_receipt_value (V1) - V2 pending value: compute receipts newer than last RAV and older than buffer cutoff (remove rav IS NULL join)
This script leverages local-network setup by adding some extra overrides to compile from source
2b0d167
to
02f3f60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's fix the formatting and get this merged!
Summary
This PR implements comprehensive support for Horizon (V2) TAP receipts by adding dual domain separator configuration and proper V2 verifier address handling across all services. This completes the foundation for full Horizon migration support in the indexer-rs ecosystem.
Changes Made
Configuration Updates
receipts_verifier_address_v2
field toBlockchainConfig
for separate V2 contract addressesService Updates
indexer-service
to use correct V2 verifier address for domain separator creationtap-agent
to use correct V2 verifier address for global domain separatorshorizon.enabled = true
,receipts_verifier_address_v2
must be explicitly configured (fails fast with clear error)horizon.enabled = false
, V2 operations fall back to V1 verifier address if V2 isn't specifiedInfrastructure Updates
Key Behavioral Changes
Horizon Configuration Invariants
When
horizon.enabled = true
: Both services require explicit V2 verifier configuration and will fail fast with:When
horizon.enabled = false
: Both services gracefully fall back to V1 addresses for V2 domainsDomain Separator Logic
receipts_verifier_address
receipts_verifier_address_v2
(required)receipts_verifier_address_v2
or fallback toreceipts_verifier_address
Configuration Example
Impact
This change resolves the "No sender found for signer" errors that occurred when V2 receipts were validated against incorrect verifier contracts. The dual domain approach ensures:
Testing