fix: read agreement state from the chain correctly - #719
Merged
MoonBoi9001 merged 5 commits intoOct 2, 2026
Merged
MoonBoi9001 merged 5 commits into
MoonBoi9001 merged 5 commits into
Conversation
The contract keeps an offer stored after its deadline, flagging that nothing can be claimed from it, but dipper read any stored offer as live. It then paid to cancel offers nobody could accept any more, and lost their expired status. An offer with that flag now reads as not live.
When an offer is withdrawn before anyone accepts it, the subgraph reports it as cancelled with no accept time, and dipper still marked it accepted, so accepted and terminated events went out for an agreement that was never live. An offer cancelled with no accept time is no longer an accept.
The cancel retry decided whether an unaccepted offer's deadline had passed using the subgraph's latest block time, which stops moving while the subgraph is down, so those offers stayed cancelling until it recovered. It now reads the chain's own latest block time instead.
Dipper read an agreement's state from whichever RPC endpoint it was using, so a lagging fallback could report an agreement as not live after dipper had seen it go live. Each read now checks the endpoint has reached the newest block dipper has seen, and moves to the next endpoint if not.
A read refused because the endpoint was behind, or because its node lacked the block asked for, was treated as a hard failure, so dipper gave up on that endpoint at once. Hosted endpoints are often a block behind for a moment, so both are now retried on the same endpoint with backoff.
MoonBoi9001
added this pull request to stack #723
October 2, 2026 22:01
MoonBoi9001
removed this pull request from stack #723
October 2, 2026 22:01
MoonBoi9001
added this pull request to stack #724
October 2, 2026 22:04
MoonBoi9001
marked this pull request as ready for review
October 2, 2026 22:04
MoonBoi9001
removed this pull request from stack #724
October 2, 2026 22:10
MoonBoi9001
added this pull request to stack #725
October 2, 2026 22:10
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.
Dipper now reads an offer past its deadline as not live, no longer records an offer withdrawn before anyone accepted it as accepted, times cancel retries by the chain's own clock rather than the subgraph's, and refuses to read an agreement from an RPC endpoint that is behind a block it has already seen.