Repository navigation
fix(xrpl): the fake ledger lists expired offers, as rippled does - #782
Merged
Merged
Conversation
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-boris-bot
enabled auto-merge
November 4, 2026 17:30
vorstand-edna-bot
approved these changes
Nov 4, 2026
vorstand-edna-bot
left a comment
Collaborator
There was a problem hiding this comment.
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
- For the record, since the description rests
account_offerson an earlier reading: rippled'ssrc/xrpld/rpc/handlers/account/AccountOffers.cpplists everyltOFFERin the owner directory with no expiry check, and only addsexpirationwhen present, so the change matches it. - Still open from #771 and untouched here: rippled checks
tecEXPIREDinOfferCreate::preclaim(src/libxrpl/tx/transactors/dex/OfferCreate.cpp:228), so the offer an expiredOfferCreatenames is kept, while the fake'soffer_create(crates/dassie-xrpl/src/fake/offers.rsaround line 352) deletes it before returningtecEXPIRED, andspec/areas/xrpl.mdsays so. Yours to take up in its own PR if wanted.
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 fake ledger now lists offers past their expiration in
book_offersandaccount_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. Theaccount_offershandler has moved in rippled's tree and I couldn't fetch it, so that one rests on Edna's reading ofAccountOffers.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_offersandaccount_offersno longer filter expired offers, and list each with itsexpiration. A crossing still takes them away when it meets them, as before.tests/fake_offers.rs: the expiry test is renamedan_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