Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ IISA_VERSION=

# gateway components versions
GATEWAY_COMMIT=29fa2968439723548ff67926575a6cfb73876e7c
TAP_AGGREGATOR_VERSION=sha-08cb2ff
TAP_ESCROW_MANAGER_COMMIT=13c1f12a4c2ed96da4db6bba3052dbb2000bc136
GRAPH_TALLY_AGGREGATOR_VERSION=v0.7.1
GRAPH_TALLY_ESCROW_MANAGER_VERSION=v2.0.0

# eligibility oracle (clone-and-build — requires published repo)
ELIGIBILITY_ORACLE_COMMIT=84710857394d3419f83dcbf6687a91f415cc1625
Expand All @@ -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)
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions containers/core/graph-contracts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion containers/indexer/indexer-service/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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/*
Expand Down
14 changes: 14 additions & 0 deletions containers/query-payments/graph-tally-aggregator/run.sh
Original file line number Diff line number Diff line change
@@ -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="${graph_tally_verifier}"

graph_tally_aggregator
10 changes: 10 additions & 0 deletions containers/query-payments/graph-tally-escrow-manager/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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 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/

COPY ./run.sh /opt/run.sh
ENTRYPOINT ["sh", "/opt/run.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions containers/query-payments/tap-agent/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions containers/query-payments/tap-aggregator/run.sh

This file was deleted.

22 changes: 0 additions & 22 deletions containers/query-payments/tap-escrow-manager/Dockerfile

This file was deleted.

24 changes: 11 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -201,31 +199,31 @@ 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

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 }
Expand All @@ -235,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

Expand Down
10 changes: 5 additions & 5 deletions docs/indexing-payments/archive/UserExperience.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions docs/indexing-payments/safe-based/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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"
}
Expand Down Expand Up @@ -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
Expand All @@ -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
12 changes: 6 additions & 6 deletions docs/indexing-payments/safe-based/DipperServicePlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Loading