Skip to content

fix: correct expiry timestamps and a duplicated shortfall event#658

Merged
cmwhited merged 2 commits into
chris.whited/feat-producer/wire-into-dipper-svcfrom
mb9/fix-expiry-timestamp-and-shortage-signal-repeats
Jul 6, 2026
Merged

fix: correct expiry timestamps and a duplicated shortfall event#658
cmwhited merged 2 commits into
chris.whited/feat-producer/wire-into-dipper-svcfrom
mb9/fix-expiry-timestamp-and-shortage-signal-repeats

Conversation

@MoonBoi9001

Copy link
Copy Markdown
Member

The service emits lifecycle events as indexing agreements change state, and two of those events go wrong in local and test runs where chain time runs independently of wall time. An expiry event could show an agreement expiring before it was ever proposed, and the "not enough indexers" event could fire twice for a single round when a job retried. This change corrects both so the events read consistently.

Both only surface under the local chain-time bypass; in production the two clocks track each other and neither case arises. The expiry fix stamps each agreement's proposal time in the same clock as its deadline and reports that, falling back to the wall-clock creation time for agreements written before this change. The shortfall fix moves the emit to after the chain-time read, the one step beneath it that can fail and retry the whole job, so a retried round emits the event once. New tests cover both paths alongside the existing ones.

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.
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.
@cmwhited cmwhited merged commit cdc1b84 into chris.whited/feat-producer/wire-into-dipper-svc Jul 6, 2026
11 checks passed
@cmwhited cmwhited deleted the mb9/fix-expiry-timestamp-and-shortage-signal-repeats branch July 6, 2026 18:43
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