feat(dips): dedicated fast loop with offer-existence gate#1200
Open
MoonBoi9001 wants to merge 5 commits into
Open
feat(dips): dedicated fast loop with offer-existence gate#1200MoonBoi9001 wants to merge 5 commits into
MoonBoi9001 wants to merge 5 commits into
Conversation
c4d0d52 to
861cddf
Compare
MoonBoi9001
added a commit
to edgeandnode/local-network
that referenced
this pull request
Apr 25, 2026
The indexer-agent's DIPs accept gate (graphprotocol/indexer#1200) queries the indexing-payments-subgraph for OfferStored entities before calling acceptIndexingAgreement. Without a configured endpoint the gate is a no-op and a dropped offer() tx loses the agreement to a permanent deterministic rejection. Set INDEXER_AGENT_INDEXING_PAYMENTS_SUBGRAPH_ENDPOINT alongside the existing INDEXER_AGENT_OFFCHAIN_SUBGRAPHS so the agent picks up the gate as soon as the subgraph deployment is detected. Also add inline shellcheck directives to silence pre-existing SC1091 / SC2153 notes the post-edit-lint hook surfaced.
78f4c6c to
790355a
Compare
33c5e22 to
76346c1
Compare
Base automatically changed from
feat/dips-new-subgraph
to
feat/dips-on-chain-cancel
April 28, 2026 19:37
Base automatically changed from
feat/dips-on-chain-cancel
to
feat/dips-on-chain-collect
April 28, 2026 20:09
f792bc2 to
078630f
Compare
c6fbe02 to
2f6c404
Compare
DIPs acceptance rode the 120s reconcile cycle with no slack for the 300s RCA deadline. A 5s loop now polls and accepts, gated on the offer existing on-chain (missing offer waits, doesn't fail). Bundles the signedRca unpack and pre-accept rule creation the loop needs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A single slow submit stalled the serial accept loop. pMap with concurrency 4 parallelises, while the wallet's nonce queue keeps submits ordered. graphNode.ensure hoisted to rule creation, phase timers added, and ABI-fragment errors marked deterministic. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
If dipper expires an agreement or the agent restarts mid-flow, the local dips rule survives but no agreement backs it, so the indexer keeps indexing without payment. A 60s sweep removes dips rules with no matching Accepted agreement; reconcile then closes the allocation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The reconcile-cycle callback iterated networks via mapNetworkMapped with activeAllocations as input, but the body only calls dipsManager.collectAgreementPayments which doesn't read it. Switch to the simpler map() that doesn't require a per-network value. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2f6c404 to
4e965d5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Some DIPs proposals were expiring before the agent got around to accepting them, and a separate failure mode was leaving allocations indexed without payment when their agreement disappeared. A dedicated 5-second acceptance loop replaces the 120-second reconcile path, an offer-existence gate prevents accepting before dipper's offer reaches the chain, and a 60-second sweep removes orphan rules so the agent stops indexing for free. No migration; the offer gate is bypassed when the indexing-payments-subgraph isn't configured.
Motivation
The indexer-agent confirms acceptance of DIPs offers on-chain via the SubgraphService contract. Today that confirmation rides the agent's 120-second reconcile cycle, so on a fresh deploy with any backlog the agent needs two cycles or more — over the 300-second deadline that recurring collection agreements give. A second failure mode shows up under load: when dipper's offer transaction is evicted from the mempool by a higher-fee neighbour, the agent walks up to a contract that has no record of the offer, the call reverts, the agent treats the revert as permanent, and the slot is lost to reassessment.
Underneath both problems sits a quieter one: when an agreement is ended out from under the agent — dipper expires it, the agent restarts mid-flow, or in-flight context is lost — the local indexing rule survives, the allocation stays open, and the indexer keeps indexing a subgraph that no longer pays. Operators see opaque revert errors and silently-running unpaid work, with no signal distinguishing "broken" from "unlucky".
Summary