feat: index DIPs agreement and offer lifecycle for dipper#12
Open
MoonBoi9001 wants to merge 3 commits into
Open
feat: index DIPs agreement and offer lifecycle for dipper#12MoonBoi9001 wants to merge 3 commits into
MoonBoi9001 wants to merge 3 commits into
Conversation
Add an Offer entity keyed by agreementId, populated from RecurringCollector.OfferStored. Dipper queries this entity to avoid re-submitting an offer after a crashed-mid-flight restart where the on-chain tx landed but dipper lost track of it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add `lastStateChangeBlock` so consumers can poll for agreements that moved since a given block, and `canceledBy` (taken from the SubgraphService event's canceledOnBehalfOf) so operator-initiated cancels capture the real signer, not just the enum. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The audit dropped redundant timestamps and added OfferCancelled; the subgraph still used pre-audit signatures so every handler stayed silent. Catch up the ABI/yaml/mappings, subscribe to OfferCancelled, and refresh the Offer on every OfferStored. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7eae459 to
df0b0c1
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
Add the entities and handlers dipper's chain_listener needs to reconcile DIPs agreement state and offer existence from a single GraphQL endpoint, against the audited contract surface.
Motivation
Dipper currently has no way to learn whether an RCA offer it submitted is still live on-chain, or whether an agreement has been accepted, cancelled, or updated since it was last seen — that information lives across several RecurringCollector and SubgraphService events with no aggregated view. Without it, dipper has to call the contracts directly on every reconciliation pass and cannot backfill state on restart, which doesn't scale and may miss transitions during downtime. This PR adds an Offer entity for the idempotency gate and extends the IndexingAgreement entity with state-change tracking and the real canceler address.
Summary
Offerentity keyed by agreementId, populated fromOfferStoredandOfferCancelledevents.lastStateChangeBlockandcanceledByfields toIndexingAgreementfor state polling.Offeron everyOfferStored.🤖 Generated with Claude Code