Skip to content

chore: snapshot event emitter branch before rebase check#675

Open
MoonBoi9001 wants to merge 21 commits into
mainfrom
mb9/event-emitter-stack-before-rebase-check
Open

chore: snapshot event emitter branch before rebase check#675
MoonBoi9001 wants to merge 21 commits into
mainfrom
mb9/event-emitter-stack-before-rebase-check

Conversation

@MoonBoi9001

Copy link
Copy Markdown
Member

This PR pins the subgraph agreement event emitter work at commit 6bacf8d, the last state reviewed before the branch stack was merged down and rebased onto main. Opening it as a draft against main makes GitHub render the pre-rebase diff, so it can be compared side by side with the rebased PR (#648) to confirm the rebase carried the same changes. It exists only for that comparison and will be closed without merging.

MoonBoi9001 and others added 21 commits June 22, 2026 16:14
The switch to always-contract-funded agreements removed the SubgraphService
cancel and subgraph-based offer idempotency, but several comments still
described them. Align them and cite the verified collector state bits.
The estimate log printed buffer_multiplier=2.0 next to the result even when the max-addition
ceiling or the floor actually set the limit, so a reader debugging an out-of-gas transaction
assumed 2x headroom never applied. Now logs with_buffer, ceiling, and the bound that won.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When an indexer accepts the off-chain proposal the agreement stays CREATED until the chain
listener sees on-chain acceptance, but dipper logged this as a CREATED->CREATED transition,
putting a phantom step in anyone's grep of the agreement lifecycle. Log it as a plain event.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The nonce-error warning omitted the nonce that was attempted, so when the signer's cached
counter went stale the failed value was invisible and the gap from chain could not be measured.
The resynced value already appears on the following success line.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
)

Dipper re-checks which indexers should serve each subgraph and creates or cancels agreements to match. A sibling change (#645) will let the worker run these checks concurrently; once it does, two checks for the same request could overlap and each create agreements, over-allocating the request. This adds a short-lived per-request lock — landing first — so the checks can't overlap once concurrency is switched on.
* 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.
A recovery sweep running only every 60th poll was the sole emitter of the accepted,
terminated and expired announcements, delaying each by 30 minutes while polling fast and
up to 5 hours once the last live agreement was cancelled. Run those three every poll.
Now that the accepted, terminated and expired announcements sweep every poll, a hung Kafka
broker made each of the 3 sweeps block on its 30-second send, stalling chain polling every
poll. After a failed send the sweeps now back off from 30 seconds up to 300 before retrying.
# Conflicts:
#	.release-please-manifest.json
#	CHANGELOG.md
#	bin/dipper-service/src/cancel_dispatch.rs
#	bin/dipper-service/src/chain_client.rs
#	bin/dipper-service/src/chain_client/client.rs
#	bin/dipper-service/src/config.rs
#	bin/dipper-service/src/main.rs
#	bin/dipper-service/src/network/service/chain_listener.rs
#	bin/dipper-service/src/network/service/escrow_reconciler.rs
#	bin/dipper-service/src/network/service/expiration.rs
#	bin/dipper-service/src/network/service/liveness_checker.rs
#	bin/dipper-service/src/network/service/topology.rs
#	bin/dipper-service/src/registry.rs
#	bin/dipper-service/src/worker/context.rs
#	bin/dipper-service/src/worker/handlers/cancel_rejected_agreement_on_chain.rs
#	bin/dipper-service/src/worker/handlers/reassess_indexing_request.rs
#	bin/dipper-service/src/worker/service.rs
#	dipper-pgregistry/src/postgres.rs
#	dipper-pgregistry/tests/it_registry_postgres.rs
#	k8s/deployment.yaml
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.

2 participants