Skip to content

fix(filler): set the update block and time of an offer that turns invalid - #243

Merged
robrigo merged 1 commit into
mainfrom
fix/eng-2440-offer-invalid-write-timestamps
Oct 13, 2026
Merged

robrigo merged 1 commit into
mainfrom
fix/eng-2440-offer-invalid-write-timestamps

Conversation

@robrigo

@robrigo robrigo commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

The filler turned an offer invalid with a write of the state column alone. Each other state write of the offer processor also sets updated_at_block and updated_at_time. So a reader of /v1/offers with a sort or a filter on the update time never saw an offer turn invalid, and a client had to read each offer again to learn of the change. Tracking: ENG-2440. Lane S.

The logtransfer and logburnasset trace handlers now record the newest block with a moved asset, because the commit listener gets no block. The write to INVALID takes its block and time from that record. When the filler commits several blocks in one transaction during catch-up, both values are those of the newest block of that transaction with a transfer or a burn, not of the exact block of each move. The write that turns an offer pending again stays a write of the state alone, so a restored offer keeps the block and time of its invalidation. A new update time on that write would make a restored offer look new to a reader that selects pending offers by update time.

The change is visible in the API: an offer that turns invalid now moves up in a /v1/offers read with sort=updated, and the two fields of its response change at that moment. The change has no migration. The CHANGELOG.md entry sits under ## [2.7.0] because the values of a public response change.

Validation. pnpm lint and pnpm check-types pass. pnpm test passes with 607 tests and 37 pending, the counts of the previous run. pnpm test:integration:ci against PostgreSQL 17 passes with 841 tests, against 837 before. Of the 4 new cases, the 3 that read the two fields after a transfer, after a burn, and after a restore failed against the old processor. The fourth proves that an accepted, declined, or cancelled offer stays unchanged when its asset moves, and it passes before and after.

…alid

The filler turned an offer invalid with a write of the state column
alone. Each other state write of the offer processor also sets
updated_at_block and updated_at_time, so a reader of /v1/offers with a
sort or a filter on the update time never saw an offer turn invalid.

The transfer and burn trace handlers record the newest block with a
moved asset, because the commit listener gets no block. The invalid
write takes its block and time from that record. A commit of several
blocks during catch-up uses the newest of them.

The write that turns an offer pending again stays a write of the state
alone. A new update time there makes a restored offer look like a new
one to a reader that selects pending offers by update time.
@robrigo
robrigo force-pushed the fix/eng-2440-offer-invalid-write-timestamps branch from 4526963 to 83fb862 Compare October 13, 2026 20:38
@robrigo
robrigo requested a balanced review from Copilot October 13, 2026 20:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation matches the documented batch semantics and is covered by focused integration tests.

0 open findings

What changed in this PR

Updates invalidated offers so API consumers can detect state changes through update-time sorting and filtering.

Changes:

  • Records the latest asset movement block per commit batch.
  • Updates invalidated offers’ block and timestamp.
  • Adds integration coverage and release notes.
File Description
src/​filler/​handlers/​atomicassets/​processors/​offers.ts Tracks movement metadata and applies it during invalidation.
src/​filler/​handlers/​atomicassets/​processors/​offers.integration.test.ts Tests transfer, burn, restoration, and closed-offer behavior.
CHANGELOG.md Documents the public response change.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@robrigo
robrigo merged commit 052d887 into main Oct 13, 2026
8 checks passed
@robrigo
robrigo deleted the fix/eng-2440-offer-invalid-write-timestamps branch October 13, 2026 20:48
@robrigo robrigo mentioned this pull request Oct 13, 2026
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