feat(events producer): implement subgraph indexing agreements events emitter in callsites#656
Conversation
…emitter in callsites
* fix(reassess): send shortfall event after the chain-time read The "not enough indexers" event was sent before the step that reads chain time to stamp deadlines. In local runs that read can fail and retry the whole job, resending the event each round; sending it after the read makes a retried round emit it once. * fix(expiration): report proposal time from the deadline clock The expiry event mixed clocks: "proposed at" came from wall time, "expired at" from chain time, so with local time controls on, expiry could look earlier than the proposal. Agreements now stamp proposal time in the deadline's clock; old rows fall back to created_at.
|
Two forward-looking notes from the offer-pacing work (#661), for whichever branch rebases second. First, the n_indexers_unavailable gate: this PR emits it when to_add is non-empty and IISA returned fewer candidates than requested, with the gate deliberately preventing a standing shortfall from re-firing forever. #661 adds a case that defeats that intent: a request capped by the in-flight window re-runs its reassessment every 12-18s, and if IISA is also returning a shortfall during that window, the event re-fires on every poll — a sustained stream into Kafka that reads as indexer scarcity when the cause is throttling. Suggested reconciliation (one line): suppress the emit on passes where pacing withheld additions (withheld > 0), so the event only ever means a genuine supply shortfall. Note #661 also short-circuits before IISA when the global window is full, so the saturated case never reaches this emit site at all — the suppress only matters for per-indexer-capped passes. Second, for the Studio topic listener you mentioned starting: #662 adds priority classes to the job queue (Interactive vs Background). The listener's handler should enqueue its reassessments at JobPriority::Interactive, same as the admin RPC path, so Studio-driven requests are served ahead of the background reassignment sweep. |
…d app shutdown handling
Description
This PR wires the
SubgraphIndexingAgreementsEventsEmitterinto thedipper-servicemessage queue and agreement state callsites to emit the correct event, exactly once, for the given event:subgraph.indexing.agreement.request.received-> when a subgraph indexing agreement request is receivedsubgraph.indexing.agreement.proposed-> when the dipper has received Indexer candidates from the IISA, but before accepted onchainsubgraph.indexing.agreement.accepted-> when an indexer accepts the indexing agreementsubgraph.indexing.agreement.request.expired-> when an indexer fails to accept in the given time limitsubgraph.indexing.agreement.n_indexers_unavailable-> when the selection returns fewer indexer candidates than the requested amountsubgraph.indexing.agreement.terminated-> when the subgraph dev, indexer, or dipper cancel the indexing agreement