-
Notifications
You must be signed in to change notification settings - Fork 22
feat: support horizon #752
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
feat: support horizon #752
Conversation
2268792
to
e837c9b
Compare
8161ba1
to
aa47f97
Compare
e9db5a8
to
cf76df4
Compare
81f6a2c
to
c5f3b67
Compare
524104d
to
f91539f
Compare
test: update insta snapshots for id update Signed-off-by: Joseph Livesey <[email protected]>
f91539f
to
12e4c16
Compare
test(integration-tests): add rav v2 test support test(integration-tests): add load-test v2 test support test(integration-tests): update local testing for v2 test(integration-tests): update test middleware for v2 fix(integration-tests): fund v1 and v2 escrow in test setup
12e4c16
to
e51b616
Compare
The documentation is great!! |
@@ -6,8 +6,8 @@ services: | |||
- ../target/release/indexer-service-rs:/usr/local/bin/indexer-service-rs | |||
- ./indexer-service/start.sh:/usr/local/bin/start.sh | |||
- ./indexer-service/config.toml:/opt/config/config.toml | |||
- ../local-network/contracts.json:/opt/contracts.json:ro | |||
- ../local-network/.env:/opt/.env:ro | |||
- ./local-network/tap-contracts.json:/opt/contracts.json:ro |
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.
nice!
# - If Horizon contracts detected: Hybrid migration mode (new V2 receipts only, process existing V1 receipts) | ||
# - If Horizon contracts not detected: Remain in legacy mode (V1 receipts only) | ||
# When disabled: Pure legacy mode, no Horizon detection performed | ||
enabled = true |
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.
We can remove this setting later, after the testing phase
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.
but it is already smart enough to fallback to V1, really good!
query_url = "http://example.com/network-subgraph" | ||
# Query URL for the Escrow subgraph (v1). This is the old escrow subgraph. | ||
# NOTE: This is not used in v2, as the escrow subgraph is now in the network subgraph. | ||
query_url = "http://example.com/escrow-subgraph" |
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.
Basically, what I want to be clear is that v1
uses a separate escrow subgraph. If we're already on v2/horizon
then we only have an escrow subgraph apart from the network subgraph to provide legacy support for already existing receipts.
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.
Incredible work, a lot of changes and little details!
All looks good to me!
V2 TAP Testing Guide
This guide covers running and debugging V2 (Horizon) TAP functionality in the
indexer-rs
test environment.The testing here uses the semiotic-ai/local-network fork based on the
horizon
branch ofedgeandnode/local-network
.Table of Contents
Prerequisites
Before running V2 tests, ensure you have:
just
command runner installedsqlx-cli
installed (cargo install sqlx-cli
)Initial Setup
0. Set Up Local Development Database (Required for Compilation)
The
indexer-rs
codebase uses SQLx with compile-time checked queries. You need a local PostgreSQL database for the code to compile (but also see the alternative below):Alternative: If you want to skip the database requirement, you can use SQLx's offline mode:
export SQLX_OFFLINE=true
This requires that the
.sqlx
directory with prepared queries is up to date, which if CI is passing they are.1. Start the Local Test Network
This command runs
setup-test-network.sh
which:graph-node
with test subgraphsindexer-agent
,indexer-service
, andtap-agent
Note: The setup script checks for existing services and skips those already running. If you encounter conflicts:
2. Critical Post-Setup Step: Restart Services
IMPORTANT: After
just setup
completes successfully, you MUST restart the indexer-service and tap-agent:This is necessary because:
Running V2 Tests
Basic V2 Test
This runs the V2 RAV (Receipt Aggregate Voucher) integration test which:
tap_horizon_receipts
tabletap_horizon_ravs
tableLoad Test
just load-test-v2 1000 # Send 1000 V2 receipts
Known Issues and Workarounds
1. Collection ID Parsing Error
Symptom:
Solution: Run
just reload
to use the updated tap-agent binary with collection_id parsing fixes.2. Missing Allocation Warnings
What you'll see:
Explanation: V2 allocations must be closed before receipts can be aggregated into RAVs. This is expected behavior in the test environment where allocations remain open.
3. Attestation Derivation Failures
What you'll see:
Explanation: Some allocations have deployment IDs that exceed BIP32 path length limits. The system falls back to V2 derivation but some allocations may still fail. This affects attestation signing but not TAP receipt processing.
Understanding the Logs
Successful V2 Processing
When V2 is working correctly, you should see:
Expected Warnings
Questions for Upstream Teams
For indexer-agent Team
Allocation Lifecycle: In the test environment, how should V2 allocations be properly closed to enable RAV generation? The current test setup creates allocations but doesn't close them.
Migration Period Handling: The tap-agent expects collection_ids in the database to be either:
Is this the correct approach for the migration period?
Mnemonic Configuration: Some allocations cannot be derived even after trying 200 combinations. Are test allocations being created with a different mnemonic than what indexer-service uses? When I look it seems like everything is correct but maybe I'm missing something.
For Smart Contracts Team
For Gateway Team
tap_aggregator.v1.*
vstap_aggregator.v2.*
) for version routing. See the fork we're using in testing - although I'm unsure whether I need or am using at all the gateway here apart from as a docker compose dependency.Troubleshooting
Check Service Health
View Logs
Database Queries
Force Service Rebuild
Clean Restart
just down docker volume prune -f # WARNING: Removes all data just setup just reload
Architecture Notes
V2 Receipt Flow
tap_horizon_receipts
tap_horizon_ravs
for redemptionKey Differences from V1
CollectionIds
scalar_tap_*
) and V2 (tap_horizon_*
)"horizon:"
prefixtap-aggregator
Current Status
As of the latest testing:
indexer-rs
?)The V2 TAP pipeline is operational but requires proper allocation lifecycle management and escrow configuration for full end-to-end functionality.
Signed off by Joseph Livesey [email protected]