Skip to content

Prune dontime store properly#1901

Closed
prashantkumar1982 wants to merge 2 commits intomainfrom
dontime_pruning
Closed

Prune dontime store properly#1901
prashantkumar1982 wants to merge 2 commits intomainfrom
dontime_pruning

Conversation

@prashantkumar1982
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Mar 16, 2026

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-common

View full report


currentDonTimes := make(map[string][]int64, len(outcome.ObservedDonTimes))
for id, observedDonTimes := range outcome.ObservedDonTimes {
t.store.setDonTimes(id, observedDonTimes.Timestamps)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same though, but Codex says this:

Not by itself.
The deletion in plugin.go only removes state during Outcome, from that node’s local store, at the moment that node computes the pruned outcome. The problem is that transmitter.go also writes to the same local store later, based on whatever is in the transmitted report, and before the fix it only did “upserts”:

for IDs still present: setDonTimes(...)

for IDs no longer present: do nothing
So if a store already had donTimes["workflow-123"], and a later report arrived where workflow-123 had been pruned from ObservedDonTimes, Transmit would leave that stale entry behind unless that exact process had already deleted it via Outcome.
Why that matters:

Outcome cleanup is not the right place to rely on for store reconciliation, because Transmit is another mutation path for the same state.

The store should reflect the latest transmitted outcome after Transmit finishes.

Without reconciliation in Transmit, stale donTimes can remain locally and RequestDonTime can incorrectly serve old cached timestamps for already-expired execution IDs.
So the deletion in plugin.go was correct, but it was not sufficient to keep the store consistent across all store write paths.

@DylanTinianov : Could you look?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this makes sense. Also I have another PR to clean ObservedDonTimes

@prashantkumar1982 prashantkumar1982 marked this pull request as ready for review March 17, 2026 16:29
@prashantkumar1982 prashantkumar1982 requested a review from a team as a code owner March 17, 2026 16:29
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.

3 participants