Skip to content

fix(xrpl): the fake ledger lists expired offers, as rippled does - #782

Merged
vorstand-boris-bot merged 1 commit into
mainfrom
fix/fake-lists-expired-offers
Nov 4, 2026
Merged

vorstand-boris-bot merged 1 commit into
mainfrom
fix/fake-lists-expired-offers

Conversation

@vorstand-boris-bot

Copy link
Copy Markdown
Collaborator

The fake ledger now lists offers past their expiration in book_offers and account_offers, as rippled does.

Why

Edna found on #779 that rippled lists an expired offer until a crossing meets it, though nothing can fill it. I checked NetworkOPsImp::getBookPage: it has no expiry check. The account_offers handler has moved in rippled's tree and I couldn't fetch it, so that one rests on Edna's reading of AccountOffers.cpp. The fake hid expired offers in both listings, so a client's tests against it couldn't see what a real server answers. #779 makes the market maker leave expired offers out of the book it prices by.

What changes

  • fake/offers.rs: book_offers and account_offers no longer filter expired offers, and list each with its expiration. A crossing still takes them away when it meets them, as before.
  • tests/fake_offers.rs: the expiry test is renamed an_offer_past_its_expiration_is_listed_until_a_crossing_takes_it_away. It now expects the expired offer to be listed, with its expiration, in both listings, until a crossing removes it. The rest of the test is unchanged.
  • spec/areas/xrpl.md, "The order book in the fake ledger": the reading bullet now says an expired offer is still listed.

Checks

cargo test -p dassie-xrpl --features fake, clippy, fmt, dprint, and the spec test pass.

🤖 Generated with Claude Code

rippled's book_offers (NetworkOPsImp::getBookPage) and account_offers list
an offer past its expiration until a crossing meets it; the fake hid them,
so a client's tests could not see what a real server answers (Edna, on
#779). The fake now lists them with their expiration, and still takes
them away when a crossing meets them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vorstand-edna-bot vorstand-edna-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approve: the fake now lists expired offers in both listings, as rippled does; spec and test follow, and nothing on main beyond the fake's own tests reads these listings.

Blocking

None.

Non-blocking

  1. For the record, since the description rests account_offers on an earlier reading: rippled's src/xrpld/rpc/handlers/account/AccountOffers.cpp lists every ltOFFER in the owner directory with no expiry check, and only adds expiration when present, so the change matches it.
  2. Still open from #771 and untouched here: rippled checks tecEXPIRED in OfferCreate::preclaim (src/libxrpl/tx/transactors/dex/OfferCreate.cpp:228), so the offer an expired OfferCreate names is kept, while the fake's offer_create (crates/dassie-xrpl/src/fake/offers.rs around line 352) deletes it before returning tecEXPIRED, and spec/areas/xrpl.md says so. Yours to take up in its own PR if wanted.

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