fix: correct expiry timestamps and a duplicated shortfall event#658
Merged
Conversation
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
approved these changes
Jul 6, 2026
cdc1b84
into
chris.whited/feat-producer/wire-into-dipper-svc
11 checks passed
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.
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.