fix: protect freshly accepted DIPs rules with durable state#1227
Merged
MoonBoi9001 merged 4 commits intoJun 3, 2026
Conversation
Base automatically changed from
mb9/configurable-dips-acceptance-interval-and-cleanup
to
main-dips
June 1, 2026 19:20
The agent already stores a row per indexing-agreement proposal and flips it to 'accepted' once accepted on-chain, but nothing read those accepted rows back. Add a lookup for them and a way to retire them, and expose each row's last-updated time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A freshly accepted agreement's rule was shielded from cleanup by an in-memory, 300-second grace window that didn't survive a restart. Keep these rules alive from the durable 'accepted' proposal rows instead, retiring each row once the subgraph has indexed past its acceptance. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c4b35a3 to
05efa66
Compare
A freshly accepted agreement keeps its rule alive via a local row until the network data lists it. Retiring that row by comparing two separately-read timestamps could retire it too early and delete a live rule; retire once the data lists the agreement, and isolate a failed retire. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Accepting a proposal needs the indexing-payments subgraph, so the local accepted rows can only appear without one if it was unset after acceptance. The retirement path then can't run and the rules are kept silently; warn with the stuck deployments so the misconfiguration is visible. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
05efa66 to
ac722ca
Compare
Maikol
approved these changes
Jun 3, 2026
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
Replaces an in-memory, time-based workaround that protected freshly accepted DIPs indexing rules with durable local state, so the protection survives an agent restart and drops the fixed timer. No behaviour change in the normal case — it closes a gap where a freshly paid-for rule could be deleted.
Motivation
When the agent accepts a DIPs indexing agreement on-chain, it creates a local indexing rule for that deployment. A separate cleanup loop deletes DIPs rules that aren't backed by either a pending proposal or an agreement the indexing-payments subgraph reports as active. For a few blocks after acceptance the agreement is neither — it's been accepted, but the subgraph hasn't indexed it yet — so the freshly created rule looks unbacked.
Until now a 300-second in-memory grace window bridged that gap, but it didn't survive an agent restart: a restart during the window could let the cleanup delete a rule the indexer is actively being paid to serve, churning the deployment and its allocation until the subgraph caught up. The agent already records each acceptance durably, so the fix is to keep the rule alive from that record instead.
Summary