Skip to content

feat: start indexing sooner after accepting a payment agreement#1234

Draft
MoonBoi9001 wants to merge 3 commits into
main-dipsfrom
mb9/start-dips-sync-on-offchain-accept
Draft

feat: start indexing sooner after accepting a payment agreement#1234
MoonBoi9001 wants to merge 3 commits into
main-dipsfrom
mb9/start-dips-sync-on-offchain-accept

Conversation

@MoonBoi9001

Copy link
Copy Markdown
Member

TL;DR

When an indexer accepts a payment agreement, the agent now starts indexing the subgraph straight away instead of waiting for the payer's on-chain offer to appear, and it holds the on-chain step for a few seconds so that offer has time to land. A new setting (default five seconds) controls that wait.

Motivation

Today, when an indexer accepts a payment agreement off-chain, the agent only writes a pending record, and the rule that tells the indexing engine to start work is tied to the payer's on-chain offer being visible. Because that offer transaction takes a moment to land and be indexed, the agent repeatedly tries the on-chain acceptance and finds the offer not yet there, and indexing doesn't begin until it clears. That wastes attempts against a tight agreement deadline and delays the indexer doing the work it is being paid for. This change starts the indexing as soon as the off-chain acceptance is seen and waits a short, bounded few seconds before the first on-chain attempt, so far fewer attempts are wasted while the subgraph is already syncing.

Summary

  • Create the indexing rule as soon as an accepted agreement is seen, so syncing starts immediately.
  • Wait a configurable few seconds before the first on-chain step, timed from the accept.
  • Cap that wait below the agreement deadline so it can never make the agent miss the deadline.
  • Add a setting for the wait (default five seconds) and thread it through the configuration.
  • Add tests for early sync start, the wait window, deadline ordering, and restart safety.

Create the dips indexing rule the moment the accept loop sees a pending proposal so
graph-node starts syncing right away, and hold the first on-chain acceptIndexingAgreement
by a short configurable delay so the payer's offer has time to land before the attempt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-project-automation github-project-automation Bot moved this to 🗃️ Inbox in Indexer Jun 10, 2026
MoonBoi9001 and others added 2 commits June 16, 2026 00:15
The accept-delay gate clamps its wait below the agreement deadline so a proposal close to
that deadline is never held past it. That path had no coverage; add a test asserting such a
proposal attempts the on-chain accept immediately despite a large configured delay.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The shared network mock set the accept-delay to 0 to skip the gate, but 0 is rejected at
config load, so the mock encoded a config production can't run. Use the real default and
default the proposal's created time to the past so the gate is already cleared.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MoonBoi9001 MoonBoi9001 marked this pull request as ready for review June 16, 2026 02:29
@MoonBoi9001 MoonBoi9001 requested a review from Maikol June 16, 2026 02:29
@MoonBoi9001 MoonBoi9001 marked this pull request as draft June 23, 2026 04:00
@MoonBoi9001

Copy link
Copy Markdown
Member Author

Turning this to draft for now, as not presently needed to move forward with DIPs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: 🗃️ Inbox

Development

Successfully merging this pull request may close these issues.

1 participant