Skip to content

feat: index DIPs agreement and offer lifecycle for dipper#12

Open
MoonBoi9001 wants to merge 3 commits into
mainfrom
mb9/index-dips-agreement-and-offer-lifecycle
Open

feat: index DIPs agreement and offer lifecycle for dipper#12
MoonBoi9001 wants to merge 3 commits into
mainfrom
mb9/index-dips-agreement-and-offer-lifecycle

Conversation

@MoonBoi9001
Copy link
Copy Markdown
Member

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

  • Add Offer entity keyed by agreementId, populated from OfferStored and OfferCancelled events.
  • Add lastStateChangeBlock and canceledBy fields to IndexingAgreement for state polling.
  • Catch the subgraph up to audited contract events and refresh Offer on every OfferStored.

🤖 Generated with Claude Code

MoonBoi9001 and others added 3 commits May 11, 2026 16:31
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>
@MoonBoi9001 MoonBoi9001 force-pushed the mb9/index-dips-agreement-and-offer-lifecycle branch from 7eae459 to df0b0c1 Compare May 11, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant