graphprotocol / graphprotocol/dipper
Remove dead indexer RPC endpoints: cancel_agreement and collect_payment
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 1
- Avg merge
- 37m
- Merged PRs (30d)
- 3
Description
Motivation
Dipper's indexer-facing gRPC server (indexer_rpc) exposes two endpoints that are no longer part of the active protocol flow:
collect_payment— already an explicitunimplementedstub since PR #574. Payment collection is handled entirely on-chain viaRecurringCollector.cancel_agreement— has working server-side handling (signature verification, operator lookup, enqueuesprocess_indexing_agreement_indexer_cancellation), but has no production callers. The only trigger is the agent-side blocklist path (DipsManager._tryCancelAgreement), and even that is marginal. The public methodtryCancelAgreement(allocationId)is exported but never called from agent reconciliation loops.
Both endpoints are artefacts of the pre-on-chain architecture. With the migration to on-chain agreements and the offer-based authorization path, cancellation is handled on-chain: the indexer (or dipper) calls the contract directly, the event is emitted, the subgraph indexes it, and dipper's chain_listener detects the state change. The off-chain gRPC cancellation is redundant — it introduces a second pathway that must stay consistent with the on-chain source of truth without adding meaningful capability.
The collect_payment endpoint was part of the off-chain voucher system that was abandoned before deployment. It has been a dead stub for months.
Scope
This spans three codebases. The dead code in each:
dipper (this repo)
Server-side handlers:
bin/dipper-service/src/indexer_rpc_server/handlers.rs— thecancel_agreementandcollect_paymentimplementations on theGatewayDipsServicetraitbin/dipper-service/src/indexer_rpc_server/service.rs— the tonic server setup that registers theGatewayDipsServiceServerbin/dipper-service/src/signing/eip712.rs—recover_dips_cancellation_msg_signer(used only by cancel_agreement handler). If this is the last consumer of the EIP-712 signer module, the entire module can go.bin/dipper-service/src/worker/handlers/— theprocess_indexing_agreement_indexer_cancellationworker handler enqueued by cancel_agreementbin/dipper-service/src/main.rs— the indexer RPC server spawn and context wiring
Proto definitions:
dipper-rpc/src/indexer/— theGatewayDipsServiceproto withCancelAgreementandCollectPaymentRPCs, plus the Solidity-sideSignedCancellationRequesttype
Config:
bin/dipper-service/src/config.rs—indexer_rpcconfig section (listen_addr,allowlist). If no other endpoint needs the indexer RPC server, remove the entire server and its config.
indexer-rs (graphprotocol/indexer-rs)
Stub handler:
crates/dips/src/server.rs—cancel_agreementis an unimplemented stub that returnsStatus::unimplemented. It only exists to satisfy the proto trait.
Proto definitions:
crates/dips/src/proto/— the generatedCancelAgreementRequest,CancelAgreementResponse, andCollectPaymentRequest/CollectPaymentResponsetypes. These come from the shared.protofile — if dipper drops them from the proto, indexer-rs codegen will stop producing them automatically.
indexer agent (graphprotocol/indexer)
gRPC client:
packages/indexer-common/src/indexing-fees/gateway-dips-service-client.ts—createGatewayDipsServiceClientwhich constructs the gRPC client, pluscancelAgreementDomainandcancelAgreementTypesEIP-712 constants used for signing cancellation requestspackages/indexer-common/src/indexing-fees/dips.ts—tryCancelAgreement(allocationId),_tryCancelAgreement(agreement), and thegatewayDipsServiceClientfield onDipsManager. TheCancelAgreementcall at line 116 is the only gRPC call the agent makes to dipper.
Blocklist path:
packages/indexer-common/src/indexing-fees/dips.ts:851—_tryCancelAgreementis called when the agent detects a NEVER indexing rule for a deployment with an active agreement. This needs to be replaced with an on-chain cancellation call (the agent already has contract interaction infrastructure foracceptIndexingAgreement).
Note: Maikol has been actively working on DIPs agent-side features. Confirm with him before removing cancel_agreement client code — he may have plans for it or may prefer to handle the agent-side cleanup himself.
What to check before removing
- Grep all three codebases for
CancelAgreement,cancel_agreement,CollectPayment,collect_payment,GatewayDipsServiceto find any references beyond what's listed above. - Verify that dipper's
chain_listenercorrectly handles indexer-initiated on-chain cancellations (theIndexingAgreementCanceledevent path). If it does, the off-chain notification path is fully redundant. - Check whether the
.protofile lives in dipper or in a shared proto repo. If shared, coordinate the proto change across all consumers. - The agent's blocklist cancellation path (line 851) needs a replacement — either call the contract directly or remove the auto-cancel-on-blocklist behaviour entirely.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by grepping the three codebases for CancelAgreement, cancel_agreement, CollectPayment, collect_payment, and GatewayDipsService, beginning with the listed Rust and TypeScript files. Verify the chain_listener IndexingAgreementCanceled path and coordinate any shared proto changes before removing the endpoints. Done means obsolete handlers, clients, types, configuration, and worker paths are removed, with the agent blocklist behavior resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, typescript
- Domain
- api, backend, blockchain
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100