From 571f096d4f4cfe4a47db3d24b80bba8387fa1a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Tue, 5 May 2026 12:45:59 -0300 Subject: [PATCH 1/3] chore: update aggregator to latest and rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- .env | 6 +++--- containers/indexer/indexer-service/run.sh | 2 +- .../Dockerfile | 4 ++-- .../query-payments/graph-tally-aggregator/run.sh | 14 ++++++++++++++ containers/query-payments/tap-agent/run.sh | 4 ++-- containers/query-payments/tap-aggregator/run.sh | 14 -------------- docker-compose.yaml | 14 ++++++-------- tests/tests/query_fees.rs | 2 +- 8 files changed, 29 insertions(+), 31 deletions(-) rename containers/query-payments/{tap-aggregator => graph-tally-aggregator}/Dockerfile (60%) create mode 100755 containers/query-payments/graph-tally-aggregator/run.sh delete mode 100755 containers/query-payments/tap-aggregator/run.sh diff --git a/.env b/.env index 73ac230..19ed6b0 100644 --- a/.env +++ b/.env @@ -43,7 +43,7 @@ IISA_VERSION= # gateway components versions GATEWAY_COMMIT=29fa2968439723548ff67926575a6cfb73876e7c -TAP_AGGREGATOR_VERSION=sha-08cb2ff +GRAPH_TALLY_AGGREGATOR_VERSION=v0.7.1 TAP_ESCROW_MANAGER_COMMIT=13c1f12a4c2ed96da4db6bba3052dbb2000bc136 # eligibility oracle (clone-and-build — requires published repo) @@ -69,7 +69,7 @@ REDPANDA_KAFKA_EXTERNAL_PORT=29092 REDPANDA_ADMIN_PORT=19644 REDPANDA_PANDAPROXY_PORT=18082 REDPANDA_SCHEMA_REGISTRY_PORT=18081 -TAP_AGGREGATOR_PORT=7610 +GRAPH_TALLY_AGGREGATOR_PORT=7610 BLOCK_EXPLORER_PORT=3000 # backward compat: old names without _PORT suffix (shell-only, uses ${} expansion) @@ -89,7 +89,7 @@ REDPANDA_KAFKA_EXTERNAL=${REDPANDA_KAFKA_EXTERNAL_PORT} REDPANDA_ADMIN=${REDPANDA_ADMIN_PORT} REDPANDA_PANDAPROXY=${REDPANDA_PANDAPROXY_PORT} REDPANDA_SCHEMA_REGISTRY=${REDPANDA_SCHEMA_REGISTRY_PORT} -TAP_AGGREGATOR=${TAP_AGGREGATOR_PORT} +GRAPH_TALLY_AGGREGATOR=${GRAPH_TALLY_AGGREGATOR_PORT} BLOCK_EXPLORER=${BLOCK_EXPLORER_PORT} # Indexing Payments (used with indexing-payments override) diff --git a/containers/indexer/indexer-service/run.sh b/containers/indexer/indexer-service/run.sh index 08ab7a9..4a937ae 100755 --- a/containers/indexer/indexer-service/run.sh +++ b/containers/indexer/indexer-service/run.sh @@ -43,7 +43,7 @@ max_amount_willing_to_lose_grt = 1 timestamp_buffer_secs = 15 [tap.sender_aggregator_endpoints] -${ACCOUNT0_ADDRESS} = "http://tap-aggregator:${TAP_AGGREGATOR_PORT}" +${ACCOUNT0_ADDRESS} = "http://graph-tally-aggregator:${GRAPH_TALLY_AGGREGATOR_PORT}" EOF cat config.toml diff --git a/containers/query-payments/tap-aggregator/Dockerfile b/containers/query-payments/graph-tally-aggregator/Dockerfile similarity index 60% rename from containers/query-payments/tap-aggregator/Dockerfile rename to containers/query-payments/graph-tally-aggregator/Dockerfile index 67aa47e..1d62cdf 100644 --- a/containers/query-payments/tap-aggregator/Dockerfile +++ b/containers/query-payments/graph-tally-aggregator/Dockerfile @@ -1,6 +1,6 @@ # check=skip=InvalidDefaultArgInFrom -ARG TAP_AGGREGATOR_VERSION -FROM ghcr.io/semiotic-ai/tap_aggregator:${TAP_AGGREGATOR_VERSION} +ARG GRAPH_TALLY_AGGREGATOR_VERSION +FROM ghcr.io/graphprotocol/graph_tally_aggregator:${GRAPH_TALLY_AGGREGATOR_VERSION} RUN apt-get update \ && apt-get install -y jq \ && rm -rf /var/lib/apt/lists/* diff --git a/containers/query-payments/graph-tally-aggregator/run.sh b/containers/query-payments/graph-tally-aggregator/run.sh new file mode 100755 index 0000000..263d443 --- /dev/null +++ b/containers/query-payments/graph-tally-aggregator/run.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -eu +. /opt/config/.env + +. /opt/shared/lib.sh + +graph_tally_verifier=$(contract_addr GraphTallyCollector.address horizon) + +export GRAPH_TALLY_PORT="${GRAPH_TALLY_AGGREGATOR_PORT}" +export GRAPH_TALLY_PRIVATE_KEY="${ACCOUNT1_SECRET}" +export GRAPH_TALLY_DOMAIN_CHAIN_ID=1337 +export GRAPH_TALLY_DOMAIN_VERIFYING_CONTRACT_V2="${graph_tally_verifier}" + +graph_tally_aggregator diff --git a/containers/query-payments/tap-agent/run.sh b/containers/query-payments/tap-agent/run.sh index 2dcd0f6..c68bc34 100755 --- a/containers/query-payments/tap-agent/run.sh +++ b/containers/query-payments/tap-agent/run.sh @@ -9,7 +9,7 @@ graph_tally_verifier=$(contract_addr GraphTallyCollector.address horizon) subgraph_service=$(contract_addr SubgraphService.address subgraph-service) cat >endpoints.yaml <<-EOF -${ACCOUNT0_ADDRESS}: "http://tap-aggregator:${TAP_AGGREGATOR_PORT}" +${ACCOUNT0_ADDRESS}: "http://graph-tally-aggregator:${GRAPH_TALLY_AGGREGATOR_PORT}" EOF cat >config.toml <<-EOF @@ -47,7 +47,7 @@ max_amount_willing_to_lose_grt = 1 timestamp_buffer_secs = 15 [tap.sender_aggregator_endpoints] -${ACCOUNT0_ADDRESS} = "http://tap-aggregator:${TAP_AGGREGATOR_PORT}" +${ACCOUNT0_ADDRESS} = "http://graph-tally-aggregator:${GRAPH_TALLY_AGGREGATOR_PORT}" EOF cat config.toml diff --git a/containers/query-payments/tap-aggregator/run.sh b/containers/query-payments/tap-aggregator/run.sh deleted file mode 100755 index 862e3ab..0000000 --- a/containers/query-payments/tap-aggregator/run.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -set -eu -. /opt/config/.env - -. /opt/shared/lib.sh - -graph_tally_verifier=$(contract_addr GraphTallyCollector.address horizon) - -export TAP_PORT="${TAP_AGGREGATOR_PORT}" -export TAP_PRIVATE_KEY="${ACCOUNT1_SECRET}" -export TAP_DOMAIN_CHAIN_ID=1337 -export TAP_DOMAIN_VERIFYING_CONTRACT_V2="${graph_tally_verifier}" - -tap_aggregator diff --git a/docker-compose.yaml b/docker-compose.yaml index 4882fa1..c412e47 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -93,7 +93,6 @@ services: context: containers/core/graph-contracts args: CONTRACTS_COMMIT: ${CONTRACTS_COMMIT} - TAP_CONTRACTS_COMMIT: ${TAP_CONTRACTS_COMMIT} depends_on: chain: { condition: service_healthy } volumes: @@ -152,7 +151,6 @@ services: context: containers/core/subgraph-deploy args: NETWORK_SUBGRAPH_COMMIT: ${NETWORK_SUBGRAPH_COMMIT} - TAP_SUBGRAPH_COMMIT: ${TAP_SUBGRAPH_COMMIT} BLOCK_ORACLE_COMMIT: ${BLOCK_ORACLE_COMMIT} depends_on: graph-contracts: { condition: service_completed_successfully } @@ -201,22 +199,22 @@ services: } restart: on-failure:3 - tap-aggregator: - container_name: tap-aggregator + graph-tally-aggregator: + container_name: graph-tally-aggregator build: - context: containers/query-payments/tap-aggregator + context: containers/query-payments/graph-tally-aggregator args: - TAP_AGGREGATOR_VERSION: ${TAP_AGGREGATOR_VERSION} + GRAPH_TALLY_AGGREGATOR_VERSION: ${GRAPH_TALLY_AGGREGATOR_VERSION} depends_on: graph-contracts: { condition: service_completed_successfully } - ports: ["${TAP_AGGREGATOR_PORT}:7610"] + ports: ["${GRAPH_TALLY_AGGREGATOR_PORT}:7610"] stop_signal: SIGKILL volumes: - ./shared:/opt/shared:ro - ./.env:/opt/config/.env:ro - config-local:/opt/config:ro environment: - RUST_LOG: info,tap_aggregator=trace + RUST_LOG: info,graph_tally_aggregator=trace RUST_BACKTRACE: 1 restart: on-failure:3 diff --git a/tests/tests/query_fees.rs b/tests/tests/query_fees.rs index 2624948..8078924 100644 --- a/tests/tests/query_fees.rs +++ b/tests/tests/query_fees.rs @@ -7,7 +7,7 @@ //! - `gateway_queries_generate_tap_receipts` → Cycle 5.1 (send test queries, verify receipts) //! - `tap_escrow_state_observable` → Cycle 5.3 (verify query fee collection state) //! -//! The local network runs the full TAP stack: gateway, tap-aggregator, +//! The local network runs the full TAP stack: gateway, graph-tally-aggregator, //! tap-escrow-manager, tap-agent, and redpanda (Kafka). Query fees are //! generated automatically when queries pass through the gateway with //! an API key. From 890c3701beea8ce9e2881a46a5d3b7e4896f87ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Tue, 5 May 2026 13:03:06 -0300 Subject: [PATCH 2/3] chore: update escrow manager to latest and rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- .env | 2 +- containers/core/graph-contracts/Dockerfile | 3 +- .../tap-escrow-manager/Dockerfile | 22 +++-------- .../query-payments/tap-escrow-manager/run.sh | 4 +- docker-compose.yaml | 10 ++--- .../archive/UserExperience.md | 10 ++--- .../safe-based/Architecture.md | 16 ++++---- .../safe-based/DipperServicePlan.md | 12 +++--- .../safe-based/IndexerAgentPlan.md | 24 ++++++------ .../safe-based/IndexerServicePlan.md | 12 +++--- docs/indexing-payments/safe-based/README.md | 4 +- docs/testing/reo/CurationSignal.md | 2 +- docs/testing/reo/Status.md | 14 +++---- tests/README.md | 8 ++-- tests/src/graphql.rs | 6 +-- tests/tests/query_fees.rs | 38 +++++++++---------- 16 files changed, 87 insertions(+), 100 deletions(-) diff --git a/.env b/.env index 19ed6b0..4c4add0 100644 --- a/.env +++ b/.env @@ -44,7 +44,7 @@ IISA_VERSION= # gateway components versions GATEWAY_COMMIT=29fa2968439723548ff67926575a6cfb73876e7c GRAPH_TALLY_AGGREGATOR_VERSION=v0.7.1 -TAP_ESCROW_MANAGER_COMMIT=13c1f12a4c2ed96da4db6bba3052dbb2000bc136 +GRAPH_TALLY_ESCROW_MANAGER_VERSION=13c1f12a4c2ed96da4db6bba3052dbb2000bc136 # eligibility oracle (clone-and-build — requires published repo) ELIGIBILITY_ORACLE_COMMIT=84710857394d3419f83dcbf6687a91f415cc1625 diff --git a/containers/core/graph-contracts/Dockerfile b/containers/core/graph-contracts/Dockerfile index ec5723c..e051901 100644 --- a/containers/core/graph-contracts/Dockerfile +++ b/containers/core/graph-contracts/Dockerfile @@ -12,8 +12,7 @@ RUN apt-get update \ # Corepack resolves pnpm per-directory from each project's `packageManager` # field (pnpm 10.x for the contracts repo — downloaded on demand). -# Strict mode off because TAP contracts (yarn-based) has no packageManager field. -ENV COREPACK_ENABLE_STRICT=0 +ENV COREPACK_ENABLE_STRICT=1 RUN corepack enable # Foundry diff --git a/containers/query-payments/tap-escrow-manager/Dockerfile b/containers/query-payments/tap-escrow-manager/Dockerfile index 5d41cd1..8a05b45 100644 --- a/containers/query-payments/tap-escrow-manager/Dockerfile +++ b/containers/query-payments/tap-escrow-manager/Dockerfile @@ -1,22 +1,10 @@ -FROM debian:bookworm-slim -ARG TAP_ESCROW_MANAGER_COMMIT - +# check=skip=InvalidDefaultArgInFrom +ARG GRAPH_TALLY_ESCROW_MANAGER_VERSION +FROM ghcr.io/graphprotocol/graph_tally_escrow_manager:${GRAPH_TALLY_ESCROW_MANAGER_VERSION} RUN apt-get update \ - && apt-get install -y clang cmake curl git jq libcurl4-openssl-dev libsasl2-dev libssl-dev pkg-config zip \ + && apt-get install -y jq \ && rm -rf /var/lib/apt/lists/* -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal - -# Install Foundry -COPY --from=ghcr.io/foundry-rs/foundry:v1.0.0 \ - /usr/local/bin/forge /usr/local/bin/cast /usr/local/bin/anvil /usr/local/bin/chisel /usr/local/bin/ - RUN curl -sLO https://github.com/redpanda-data/redpanda/releases/latest/download/rpk-linux-amd64.zip && unzip rpk-linux-amd64.zip -d /usr/local/bin/ -WORKDIR /opt -RUN git clone https://github.com/edgeandnode/tap-escrow-manager && \ - cd tap-escrow-manager && git checkout ${TAP_ESCROW_MANAGER_COMMIT} && \ - . /root/.cargo/env && cargo build -p tap-escrow-manager && \ - cp target/debug/tap-escrow-manager /usr/local/bin/tap-escrow-manager && cd .. && rm -rf tap-escrow-manager - COPY ./run.sh /opt/run.sh -ENTRYPOINT ["bash", "/opt/run.sh"] +ENTRYPOINT ["sh", "/opt/run.sh"] diff --git a/containers/query-payments/tap-escrow-manager/run.sh b/containers/query-payments/tap-escrow-manager/run.sh index 8b05e26..ff8dde2 100755 --- a/containers/query-payments/tap-escrow-manager/run.sh +++ b/containers/query-payments/tap-escrow-manager/run.sh @@ -36,5 +36,5 @@ cat >config.json <<-EOF EOF cat config.json -export RUST_LOG="info,tap_escrow_manager=debug" -tap-escrow-manager config.json +export RUST_LOG="info,graph_tally_escrow_manager=debug" +graph_tally_escrow_manager config.json diff --git a/docker-compose.yaml b/docker-compose.yaml index c412e47..218ffd8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -218,12 +218,12 @@ services: RUST_BACKTRACE: 1 restart: on-failure:3 - tap-escrow-manager: - container_name: tap-escrow-manager + graph-tally-escrow-manager: + container_name: graph-tally-escrow-manager build: - context: containers/query-payments/tap-escrow-manager + context: containers/query-payments/graph-tally-escrow-manager args: - TAP_ESCROW_MANAGER_COMMIT: ${TAP_ESCROW_MANAGER_COMMIT} + GRAPH_TALLY_ESCROW_MANAGER_VERSION: ${GRAPH_TALLY_ESCROW_MANAGER_VERSION} depends_on: subgraph-deploy: { condition: service_completed_successfully } redpanda: { condition: service_healthy } @@ -233,7 +233,7 @@ services: - ./.env:/opt/config/.env:ro - config-local:/opt/config:ro environment: - RUST_LOG: info,tap_escrow_manager=trace + RUST_LOG: info,graph_tally_escrow_manager=trace RUST_BACKTRACE: 1 restart: on-failure:3 diff --git a/docs/indexing-payments/archive/UserExperience.md b/docs/indexing-payments/archive/UserExperience.md index a6b9bba..a03c8f5 100644 --- a/docs/indexing-payments/archive/UserExperience.md +++ b/docs/indexing-payments/archive/UserExperience.md @@ -4,15 +4,15 @@ ## TL;DR -- **Default:** TAP for query fees (no change) -- **With Override:** TAP + Indexing Payments (dipper service added) +- **Default:** Graph Tally for query fees (no change) +- **With Override:** Graph Tally + Indexing Payments (dipper service added) - **Enable:** Set `COMPOSE_PROFILES=indexing-payments` in `.env`, then `docker compose up` ## Key Differences ### Payment Methods -| Aspect | TAP (Default) | Indexing Payments (Override) | +| Aspect | Graph Tally (Default) | Indexing Payments (Override) | | ------------ | ---------------------- | ----------------------------- | | **Use Case** | Query fees | Indexing fees | | **Method** | Allocations + receipts | GRT transfers | @@ -41,13 +41,13 @@ ### What Stays the Same - All default services run unchanged -- TAP query fees continue working +- Graph Tally query fees continue working - Graph node, gateway, indexer-agent unaffected - Can switch back to default by stopping override ## Usage Comparison -**Default (TAP Only):** +**Default (Graph Tally Only):** ```bash docker compose up diff --git a/docs/indexing-payments/safe-based/Architecture.md b/docs/indexing-payments/safe-based/Architecture.md index 07634ec..347fd81 100644 --- a/docs/indexing-payments/safe-based/Architecture.md +++ b/docs/indexing-payments/safe-based/Architecture.md @@ -2,16 +2,16 @@ ## Overview -This document describes the architecture for implementing Safe-based on-chain payments for Indexing Payments in The Graph Protocol. This implementation replaces TAP (Timeline Aggregation Protocol) for indexing fees due to impractical allocation requirements. +This document describes the architecture for implementing Safe-based on-chain payments for Indexing Payments in The Graph Protocol. This implementation replaces Graph Tally for indexing fees due to impractical allocation requirements. ## Background -TAP has the following critical issues for Indexing Payments: +Graph Tally has the following critical issues for Indexing Payments: - **High Capital Requirements**: $50-$1000 allocations needed for $5-$100 monthly payments - **Complex Allocation Management**: Variable allocation amounts create operational complexity - **Capital Inefficiency**: Large amounts of stake must be kept free for indexing payments -- **Missing Infrastructure**: TAP escrow management functionality not yet implemented +- **Missing Infrastructure**: Graph Tally escrow management functionality not yet implemented ## Architecture Overview @@ -21,7 +21,7 @@ TAP has the following critical issues for Indexing Payments: 2. **Safe Module Pattern**: Direct execution via `execTransactionFromModule` without multi-sig complexity 3. **State Machine**: Clear PENDING → SUBMITTED/FAILED status tracking 4. **Protocol Compliance**: 1% burn on all payments -5. **Clear Separation**: Indexing payments use Safe payments, query fees continue using TAP +5. **Clear Separation**: Indexing payments use Safe payments, query fees continue using Graph Tally ### System Components @@ -198,7 +198,7 @@ message CollectPaymentRequest { ```protobuf message CollectPaymentResponse { uint64 version = 1; - string receipt_id = 2; // Receipt ID for polling (replaces tap_receipt) + string receipt_id = 2; // Receipt ID for polling (replaces graph_tally_receipt) string amount = 3; // Total amount including burn string status = 4; // Initial status: "PENDING" } @@ -255,13 +255,13 @@ The dipper service requires the most significant changes as it manages the payme - **Receipt Registry**: Add payment status tracking (PENDING/SUBMITTED/FAILED) - **Worker System**: Add PayOnChain message handler for async payment processing - **Safe Module Client**: Implement GRT transfers with 1% burn via execTransactionFromModule -- **RPC Interface**: Return Receipt IDs instead of TAP receipts, add polling endpoint +- **RPC Interface**: Return Receipt IDs instead of Graph Tally receipts, add polling endpoint ### 2. Indexer Agent The indexer agent needs updates to handle the new async payment pattern: -- **Payment Collector**: Replace TAP receipt storage with Receipt ID tracking +- **Payment Collector**: Replace Graph Tally receipt storage with Receipt ID tracking - **Polling Mechanism**: Add background task to poll for payment status - **Database Models**: Update to store Receipt IDs and payment status - **RPC Client**: Update to handle new response format and polling endpoint @@ -283,4 +283,4 @@ The implementation succeeds when: - ✅ 1% protocol burn on all payments - ✅ Clear state machine transitions - ✅ Indexers can verify payments on-chain -- ✅ Complete separation from TAP for indexing fees +- ✅ Complete separation from Graph Tally for indexing fees diff --git a/docs/indexing-payments/safe-based/DipperServicePlan.md b/docs/indexing-payments/safe-based/DipperServicePlan.md index 2ba571f..bbb24cc 100644 --- a/docs/indexing-payments/safe-based/DipperServicePlan.md +++ b/docs/indexing-payments/safe-based/DipperServicePlan.md @@ -2,12 +2,12 @@ ## Overview -This plan details the changes required to the Dipper service to implement Safe-based GRT payments for Indexing Payments, replacing the current TAP receipt system. +This plan details the changes required to the Dipper service to implement Safe-based GRT payments for Indexing Payments, replacing the current Graph Tally receipt system. ## Current State The Dipper service currently: -- Generates TAP receipts for payment collection +- Generates Graph Tally receipts for payment collection - Returns receipts synchronously - Has worker infrastructure for async tasks - Stores receipts in PostgreSQL database @@ -105,7 +105,7 @@ Safe Module client needs: Changes: 1. Create receipt with PENDING status 2. Queue PayOnChain worker job -3. Return Receipt ID instead of TAP receipt in CollectPaymentResponse +3. Return Receipt ID instead of Graph Tally receipt in CollectPaymentResponse 4. Include initial status in response ``` @@ -164,7 +164,7 @@ Safe payment configuration: ### Phase 4: RPC Updates 1. Modify collect_payment flow 2. Add polling endpoint -3. Remove TAP generation +3. Remove Graph Tally generation 4. Update response types ### Phase 5: Testing @@ -256,7 +256,7 @@ Alert conditions: ## Rollback Plan -1. Keep TAP code available +1. Keep Graph Tally code available 2. Feature flag for payment method 3. Database backups before migration 4. Manual payment capability @@ -304,5 +304,5 @@ payment_retry_delay_seconds = 60 - Payments process within 60 seconds - State machine works correctly - 1% burn executed properly -- No TAP receipts for indexing payments +- No Graph Tally receipts for indexing payments - Transactions verifiable on chain \ No newline at end of file diff --git a/docs/indexing-payments/safe-based/IndexerAgentPlan.md b/docs/indexing-payments/safe-based/IndexerAgentPlan.md index 0f3c452..91ea554 100644 --- a/docs/indexing-payments/safe-based/IndexerAgentPlan.md +++ b/docs/indexing-payments/safe-based/IndexerAgentPlan.md @@ -2,7 +2,7 @@ ## Overview -This plan details the changes required to the Indexer Agent to support the new Safe-based Indexing Payments system. The implementation replaces TAP receipt collection with a Receipt ID polling mechanism. +This plan details the changes required to the Indexer Agent to support the new Safe-based Indexing Payments system. The implementation replaces Graph Tally receipt collection with a Receipt ID polling mechanism. ## Development Branch @@ -13,8 +13,8 @@ This work will continue on top of the existing `dips-horizon-rebase` branch, whi ## Current State The Indexer Agent currently: -- Uses payment collector class to collect TAP receipts from the gateway -- Stores TAP receipts locally for later redemption +- Uses payment collector class to collect Graph Tally receipts from the gateway +- Stores Graph Tally receipts locally for later redemption - Makes synchronous calls expecting immediate receipt data - Has existing database models for tracking receipts @@ -44,11 +44,11 @@ IndexingPaymentReceipt model: **Location**: `indexer-agent/source/packages/indexer-common/src/indexing-fees/indexing-payments.ts` -#### Remove TAP Dependencies +#### Remove Graph Tally Dependencies -- Remove all TAP receipt handling code +- Remove all Graph Tally receipt handling code - Remove receipt signature verification -- Remove TAP-specific imports and types +- Remove Graph Tally-specific imports and types #### Implement Receipt ID Collection @@ -161,13 +161,13 @@ Metrics to track: 1. Add GetReceiptById method to RPC client 2. Update CollectPayment response handling -3. Remove TAP-specific response parsing +3. Remove Graph Tally-specific response parsing 4. Add proper error handling ### Phase 3: Core Collection Logic 1. Refactor Payment Collector class -2. Remove all TAP receipt logic +2. Remove all Graph Tally receipt logic 3. Implement Receipt ID storage 4. Add polling mechanism 5. Handle all status transitions @@ -252,12 +252,12 @@ indexer-agent start \ ## Migration Considerations ### Backward Compatibility -- Keep TAP code for query fees +- Keep Graph Tally code for query fees - Add feature flag for new payment system - Support gradual rollout ### Data Migration -- No migration needed for existing TAP receipts +- No migration needed for existing Graph Tally receipts - New receipts use Receipt ID system - Clear separation in database @@ -267,7 +267,7 @@ indexer-agent start \ - All payments create Receipt IDs - Status polling works reliably - Transactions appear on chain -- No TAP receipts for indexing fees +- No Graph Tally receipts for indexing fees ### Performance Metrics - Receipt creation < 1 second @@ -279,7 +279,7 @@ indexer-agent start \ If issues arise: 1. Disable new payment flow via feature flag -2. Revert to TAP receipt collection +2. Revert to Graph Tally receipt collection 3. Investigate and fix issues 4. Re-deploy with fixes diff --git a/docs/indexing-payments/safe-based/IndexerServicePlan.md b/docs/indexing-payments/safe-based/IndexerServicePlan.md index ca2e540..ebfd55a 100644 --- a/docs/indexing-payments/safe-based/IndexerServicePlan.md +++ b/docs/indexing-payments/safe-based/IndexerServicePlan.md @@ -15,7 +15,7 @@ This work will continue on the existing `pcv/ipfs-dips-timeout` branch, which ha The Indexer Service currently: - Implements gRPC server for indexing payments using protocol buffers - Forwards collect payment requests to the gateway -- Returns TAP receipts in the response +- Returns Graph Tally receipts in the response - Has no business logic for payment processing (pass-through) ## Required Changes @@ -53,7 +53,7 @@ CREATE INDEX idx_indexing_receipts_receipt_id ON indexing_receipts(receipt_id); #### Update CollectPaymentResponse -The main change is to modify the response to return a Receipt ID instead of TAP receipt: +The main change is to modify the response to return a Receipt ID instead of Graph Tally receipt: ```protobuf // Current definition @@ -106,9 +106,9 @@ message GetReceiptByIdResponse { } ``` -#### Remove TAP-specific Status Codes +#### Remove Graph Tally-specific Status Codes -Review and potentially update the `CollectPaymentStatus` enum if any codes are TAP-specific: +Review and potentially update the `CollectPaymentStatus` enum if any codes are Graph Tally-specific: ```protobuf enum CollectPaymentStatus { @@ -199,7 +199,7 @@ Consider protocol version handling: 1. Deploy updated indexer-service 2. Trigger payment collection from indexer-agent 3. Verify Receipt ID is returned -4. Confirm no TAP receipts are generated +4. Confirm no Graph Tally receipts are generated ## Configuration @@ -238,7 +238,7 @@ This requires both schema and protocol changes: - Protocol definitions updated with new fields - Generated code compiles without errors -- No TAP receipt field in responses +- No Graph Tally receipt field in responses - Receipt ID returned successfully - Integration tests pass with indexer-agent diff --git a/docs/indexing-payments/safe-based/README.md b/docs/indexing-payments/safe-based/README.md index 76de402..ca6a1bd 100644 --- a/docs/indexing-payments/safe-based/README.md +++ b/docs/indexing-payments/safe-based/README.md @@ -6,7 +6,7 @@ This approach is obsolete. ## Overview -The Indexing Payments Safe payment system replaces TAP (Timeline Aggregation Protocol) for indexing fee payments, using on-chain GRT transfers via Safe Module pattern with asynchronous processing. +The Indexing Payments Safe payment system replaces Graph Tally for indexing fee payments, using on-chain GRT transfers via Safe Module pattern with asynchronous processing. ## Documentation Structure @@ -48,7 +48,7 @@ Read the [Architecture Document](./Architecture.md) to understand: ## Key Concepts -- **Receipt ID**: Replaces TAP receipts, enables async processing +- **Receipt ID**: Replaces Graph Tally receipts, enables async processing - **State Machine**: PENDING → SUBMITTED/FAILED - **Safe Module**: Direct execution pattern for GRT transfers - **1% Protocol Burn**: Automatic burn on all payments diff --git a/docs/testing/reo/CurationSignal.md b/docs/testing/reo/CurationSignal.md index 332dcbf..9b12d42 100644 --- a/docs/testing/reo/CurationSignal.md +++ b/docs/testing/reo/CurationSignal.md @@ -39,7 +39,7 @@ line 76-80: Set indexing rules ### Steps -For each deployed subgraph (network, tap, block_oracle): +For each deployed subgraph (network, block_oracle): 1. **Convert deployment IPFS hash to bytes32** (already done for GNS publishing — reuse `dep_hex`) diff --git a/docs/testing/reo/Status.md b/docs/testing/reo/Status.md index be7ab0e..b0550fe 100644 --- a/docs/testing/reo/Status.md +++ b/docs/testing/reo/Status.md @@ -48,7 +48,7 @@ Run with: `cd tests && cargo nextest run --no-capture` - [x] Allocation lifecycle tests (Layer 2) - [x] Deterministic eligibility lifecycle tests (Layer 3) - [x] Reward collection via `collect(IndexingRewards)` (Layer 3) -- [x] Query fee / TAP receipt generation tests (Layer 3) +- [x] Query fee / Graph Tally receipt generation tests (Layer 3) - [x] Enabled reward pipeline: curation signal + issuance config in deploy scripts - [x] EBO polling interval reduced from 20s to 1s for faster tests @@ -101,13 +101,13 @@ The `collect_indexing_rewards` test directly calls `SubgraphService.collect()` a Mining ~100 blocks for epoch advancement adds ~1200s of chain time (12s per block). With a 300s eligibility period, the indexer becomes ineligible mid-test. Tests must call `reo_renew_indexer()` before any reward-dependent operation. -### TAP Query Fee Pipeline +### Graph Tally Query Fee Pipeline -The TAP stack works end-to-end for receipt generation (20/20 gateway queries succeed). However: +The Graph Tally stack works end-to-end for receipt generation (20/20 gateway queries succeed). However: -- TAP escrow deposits are not observed (escrow balance = 0) -- TAP subgraph shows 0 escrow accounts -- This is expected — the TAP escrow manager processes asynchronously and may need longer running time +- Graph Tally escrow deposits are not observed (escrow balance = 0) +- Graph Tally subgraph shows 0 escrow accounts +- This is expected — the Graph Tally escrow manager processes asynchronously and may need longer running time ## Gaps @@ -176,7 +176,7 @@ Tests assume an already-running network. Full validation from `docker compose do - Set `issuancePerBlock = 100 GRT` in `graph-contracts/run.sh` (requires ACCOUNT1_SECRET as Governor) - Reduced EBO polling from 20s to 1s — tests 3x faster (allocation_lifecycle 105s→38s, eligibility 277s→91s) - Added `reward_collection.rs`: `collect(IndexingRewards)` increases stake by ~12,000 GRT -- Added `query_fees.rs`: gateway generates TAP receipts (20/20), escrow state observable +- Added `query_fees.rs`: gateway generates Graph Tally receipts (20/20), escrow state observable - Found and fixed eligibility expiry during mining (300s period, ~1200s chain time in 2 epoch advances) - Fixed `PaymentsEscrow.getBalance()` signature: 3 args (payer, collector, receiver) - All 12 tests passing diff --git a/tests/README.md b/tests/README.md index c3b4c78..410e5b0 100644 --- a/tests/README.md +++ b/tests/README.md @@ -39,9 +39,9 @@ All tests share a single blockchain and run serially (configured in | 4.3 | Create via actions queue | Indexer CLI workflow | — | | 4.4 | Create via deployment rules | Indexer CLI workflow | — | | 4.5 | Reallocate | Indexer CLI workflow | — | -| 5.1 | Gateway query serving | `gateway_serves_queries` + `gateway_query_serving` + `gateway_queries_generate_tap_receipts` | `network_state.rs`, `allocation_lifecycle.rs`, `query_fees.rs` | +| 5.1 | Gateway query serving | `gateway_serves_queries` + `gateway_query_serving` + `gateway_queries_generate_graph_tally_receipts` | `network_state.rs`, `allocation_lifecycle.rs`, `query_fees.rs` | | 5.2 | Close allocation + rewards | `close_and_recreate_allocation` + `close_allocation_collects_rewards` | `allocation_lifecycle.rs` | -| 5.3 | TAP escrow state | `tap_escrow_state_observable` (observational only, no assertions) | `query_fees.rs` | +| 5.3 | Graph Tally escrow state | `graph_tally_escrow_state_observable` (observational only, no assertions) | `query_fees.rs` | | 5.4 | Close with explicit POI | Indexer CLI workflow | — | | 6.1 | Indexer health metrics | `indexer_health_metrics` | `network_state.rs` | | 6.2 | Epoch progression | `epoch_progressing` | `network_state.rs` | @@ -161,7 +161,7 @@ All tests share a single blockchain and run serially (configured in | `stake_management.rs` | Stake add/remove (Cycle 2) | 2 | | `provision_management.rs` | Provision add/thaw/deprovision (Cycle 3) | 1 | | `allocation_lifecycle.rs` | Allocation create/close + gateway queries (Cycles 4-5, 7) | 3 | -| `query_fees.rs` | TAP receipt generation + escrow state (Cycle 5) | 2 | +| `query_fees.rs` | Graph Tally receipt generation + escrow state (Cycle 5) | 2 | | `reward_collection.rs` | Direct reward collection contract call | 1 | | `eligibility.rs` | REO eligibility lifecycle (IndexerTestGuide Sets 2-4, ReoTestPlan 6.1-6.4/6.6) | 1 | | `reo_governance.rs` | REO governance operations (ReoTestPlan Cycles 1, 3, 4, 5, 6.5, 7) | 15 | @@ -193,7 +193,7 @@ These items cannot be tested on the local network and must be verified on Arbitr - **ReoTestPlan Cycle 6 (multi-indexer)**: Multi-indexer reward cycling (requires 3+ indexers) - **BaselineTestPlan 4.3-4.5**: Actions queue, deployment rules, reallocate (indexer CLI workflows) - **BaselineTestPlan 5.4**: Close with explicit POI (indexer CLI workflow) -- **BaselineTestPlan 5.3**: TAP escrow state test is observational only (verifies services are reachable but makes no assertions on escrow balances or `queryFeesCollected`) +- **BaselineTestPlan 5.3**: Graph Tally escrow state test is observational only (verifies services are reachable but makes no assertions on escrow balances or `queryFeesCollected`) - **BaselineTestPlan 6.3**: Log review across indexer components - **RewardsConditionsTestPlan 4.2**: STALE_POI requires waiting beyond maxPOIStaleness - **RewardsConditionsTestPlan 4.3**: ZERO_POI requires explicit POI parameter not exposed by management API diff --git a/tests/src/graphql.rs b/tests/src/graphql.rs index 52becea..581b58b 100644 --- a/tests/src/graphql.rs +++ b/tests/src/graphql.rs @@ -137,14 +137,14 @@ impl TestNetwork { Ok(!resp["data"]["networkEpochBlockNumber"].is_null()) } - /// Query the TAP subgraph for escrow accounts. - pub async fn query_tap_escrow_accounts(&self) -> Result { + /// Query the network subgraph for escrow accounts. + pub async fn query_graph_tally_escrow_accounts(&self) -> Result { let query = r#"{ paymentsEscrowAccounts(first: 10) { balance payer { id } receiver { id } } }"#; - // TAP subgraph may be empty — treat GraphQL errors as empty result + // subgraph may be empty — treat GraphQL errors as empty result let resp = self.graphql_post(&self.subgraph_url, query, None).await; match resp { Ok(v) => Ok(v["data"]["paymentsEscrowAccounts"].clone()), diff --git a/tests/tests/query_fees.rs b/tests/tests/query_fees.rs index 8078924..798afc3 100644 --- a/tests/tests/query_fees.rs +++ b/tests/tests/query_fees.rs @@ -1,14 +1,14 @@ //! Query Fee Tests (BaselineTestPlan Cycle 5.1, 5.3) //! -//! Tests the TAP (Timeline Aggregation Protocol) query fee pipeline: -//! gateway query → TAP receipt → Kafka → aggregation → escrow +//! Tests the Graph Tally query fee pipeline: +//! gateway query → Graph Tally receipt → Kafka → aggregation → escrow //! //! Mapping to BaselineTestPlan: -//! - `gateway_queries_generate_tap_receipts` → Cycle 5.1 (send test queries, verify receipts) -//! - `tap_escrow_state_observable` → Cycle 5.3 (verify query fee collection state) +//! - `gateway_queries_generate_graph_tally_receipts` → Cycle 5.1 (send test queries, verify receipts) +//! - `graph_tally_escrow_state_observable` → Cycle 5.3 (verify query fee collection state) //! -//! The local network runs the full TAP stack: gateway, graph-tally-aggregator, -//! tap-escrow-manager, tap-agent, and redpanda (Kafka). Query fees are +//! The local network runs the full Graph Tally stack: gateway, graph_tally_aggregator, +//! graph_tally_escrow_manager, tap-agent, and redpanda (Kafka). Query fees are //! generated automatically when queries pass through the gateway with //! an API key. @@ -19,16 +19,16 @@ fn net() -> Result { TestNetwork::from_default_env() } -/// BaselineTestPlan 5.1: Verify gateway queries generate TAP receipts. +/// BaselineTestPlan 5.1: Verify gateway queries generate Graph Tally receipts. /// /// Emulates the `query_test.sh` script from the test plan. /// Sends queries through the gateway and checks that the indexer-service -/// receives and validates TAP V2 receipts. +/// receives and validates Graph Tally receipts. #[tokio::test] -async fn gateway_queries_generate_tap_receipts() -> Result<()> { +async fn gateway_queries_generate_graph_tally_receipts() -> Result<()> { let net = net()?; - eprintln!("=== TAP Receipt Generation Test ==="); + eprintln!("=== Graph Tally Receipt Generation Test ==="); // Send a batch of queries through the gateway let (ok, fail) = net.send_gateway_queries(20).await?; @@ -45,22 +45,22 @@ async fn gateway_queries_generate_tap_receipts() -> Result<()> { /// BaselineTestPlan 5.3: Check query fee collection state. /// -/// Verifies TAP escrow accounts in the TAP subgraph and on-chain via +/// Verifies Graph Tally escrow accounts in the subgraph and on-chain via /// `PaymentsEscrow.getBalance()`. In production, `queryFeesCollected` /// in the network subgraph would be non-zero after queries flow through. /// /// Note: This test observes current state rather than asserting a specific -/// value, since escrow deposits depend on background TAP processing timing. +/// value, since escrow deposits depend on background Graph Tally processing timing. #[tokio::test] -async fn tap_escrow_state_observable() -> Result<()> { +async fn graph_tally_escrow_state_observable() -> Result<()> { let net = net()?; - eprintln!("=== TAP Escrow State Test ==="); + eprintln!("=== Graph Tally Escrow State Test ==="); - // Check TAP subgraph for escrow accounts - let accounts = net.query_tap_escrow_accounts().await?; + // Check subgraph for escrow accounts + let accounts = net.query_graph_tally_escrow_accounts().await?; let count = accounts.as_array().map(|a| a.len()).unwrap_or(0); - eprintln!(" TAP escrow accounts: {count}"); + eprintln!(" Graph Tally escrow accounts: {count}"); if count > 0 { for acc in accounts.as_array().unwrap() { @@ -70,7 +70,7 @@ async fn tap_escrow_state_observable() -> Result<()> { eprintln!(" payer={payer} receiver={receiver} balance={balance}"); } } else { - eprintln!(" NOTE: No escrow accounts yet — TAP escrow manager may need time to process"); + eprintln!(" NOTE: No escrow accounts yet — Graph Tally escrow manager may need time to process"); } // Check on-chain escrow balance directly @@ -90,7 +90,7 @@ async fn tap_escrow_state_observable() -> Result<()> { } // This test is observational — it passes regardless of state to document - // the TAP system's current behavior. The key assertion is that querying + // the Graph Tally system's current behavior. The key assertion is that querying // doesn't error out (services are reachable). Ok(()) } From 1b292eb6fbcbc02f11a3171113b9c66cc4f993cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Tue, 5 May 2026 13:43:52 -0300 Subject: [PATCH 3/3] fix: rename fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- .env | 2 +- containers/query-payments/graph-tally-aggregator/run.sh | 2 +- .../Dockerfile | 2 +- .../{tap-escrow-manager => graph-tally-escrow-manager}/run.sh | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename containers/query-payments/{tap-escrow-manager => graph-tally-escrow-manager}/Dockerfile (91%) rename containers/query-payments/{tap-escrow-manager => graph-tally-escrow-manager}/run.sh (100%) diff --git a/.env b/.env index 4c4add0..f0413c4 100644 --- a/.env +++ b/.env @@ -44,7 +44,7 @@ IISA_VERSION= # gateway components versions GATEWAY_COMMIT=29fa2968439723548ff67926575a6cfb73876e7c GRAPH_TALLY_AGGREGATOR_VERSION=v0.7.1 -GRAPH_TALLY_ESCROW_MANAGER_VERSION=13c1f12a4c2ed96da4db6bba3052dbb2000bc136 +GRAPH_TALLY_ESCROW_MANAGER_VERSION=v2.0.0 # eligibility oracle (clone-and-build — requires published repo) ELIGIBILITY_ORACLE_COMMIT=84710857394d3419f83dcbf6687a91f415cc1625 diff --git a/containers/query-payments/graph-tally-aggregator/run.sh b/containers/query-payments/graph-tally-aggregator/run.sh index 263d443..a1e0032 100755 --- a/containers/query-payments/graph-tally-aggregator/run.sh +++ b/containers/query-payments/graph-tally-aggregator/run.sh @@ -9,6 +9,6 @@ graph_tally_verifier=$(contract_addr GraphTallyCollector.address horizon) export GRAPH_TALLY_PORT="${GRAPH_TALLY_AGGREGATOR_PORT}" export GRAPH_TALLY_PRIVATE_KEY="${ACCOUNT1_SECRET}" export GRAPH_TALLY_DOMAIN_CHAIN_ID=1337 -export GRAPH_TALLY_DOMAIN_VERIFYING_CONTRACT_V2="${graph_tally_verifier}" +export GRAPH_TALLY_DOMAIN_VERIFYING_CONTRACT="${graph_tally_verifier}" graph_tally_aggregator diff --git a/containers/query-payments/tap-escrow-manager/Dockerfile b/containers/query-payments/graph-tally-escrow-manager/Dockerfile similarity index 91% rename from containers/query-payments/tap-escrow-manager/Dockerfile rename to containers/query-payments/graph-tally-escrow-manager/Dockerfile index 8a05b45..ff156d3 100644 --- a/containers/query-payments/tap-escrow-manager/Dockerfile +++ b/containers/query-payments/graph-tally-escrow-manager/Dockerfile @@ -2,7 +2,7 @@ ARG GRAPH_TALLY_ESCROW_MANAGER_VERSION FROM ghcr.io/graphprotocol/graph_tally_escrow_manager:${GRAPH_TALLY_ESCROW_MANAGER_VERSION} RUN apt-get update \ - && apt-get install -y jq \ + && apt-get install -y jq curl unzip \ && rm -rf /var/lib/apt/lists/* RUN curl -sLO https://github.com/redpanda-data/redpanda/releases/latest/download/rpk-linux-amd64.zip && unzip rpk-linux-amd64.zip -d /usr/local/bin/ diff --git a/containers/query-payments/tap-escrow-manager/run.sh b/containers/query-payments/graph-tally-escrow-manager/run.sh similarity index 100% rename from containers/query-payments/tap-escrow-manager/run.sh rename to containers/query-payments/graph-tally-escrow-manager/run.sh