Issue Description
In AMMCreate::doApply (src/libxrpl/tx/transactors/dex/AMMCreate.cpp, lines ~280–287), order books are added to the in-memory OrderBookDB:
ctx_.registry.getOrderBookDB().addOrderBook(book);
However, AMMDelete never removes these entries from the OrderBookDB. The in-memory DB is rebuilt from the ledger on node restart, so the stale entries are transient and self-healing. However, between deletion and restart, the stale entries may trigger unnecessary subscription notifications for empty book sides.
Steps to Reproduce
- Create an AMM (which adds entries to
OrderBookDB).
- Delete the AMM via
AMMDelete.
- Observe that the
OrderBookDB still contains the AMM's order book entries until the next server restart.
Expected Result
AMMDelete should remove the corresponding order book entries from OrderBookDB when deleting an AMM, similar to how AMMCreate adds them.
Actual Result
Stale order book entries persist in OrderBookDB until the server restarts and rebuilds the DB from the ledger.
Environment
All versions with AMM support (XLS-30).
Supporting Files
N/A
Issue Description
In
AMMCreate::doApply(src/libxrpl/tx/transactors/dex/AMMCreate.cpp, lines ~280–287), order books are added to the in-memoryOrderBookDB:However,
AMMDeletenever removes these entries from theOrderBookDB. The in-memory DB is rebuilt from the ledger on node restart, so the stale entries are transient and self-healing. However, between deletion and restart, the stale entries may trigger unnecessary subscription notifications for empty book sides.Steps to Reproduce
OrderBookDB).AMMDelete.OrderBookDBstill contains the AMM's order book entries until the next server restart.Expected Result
AMMDeleteshould remove the corresponding order book entries fromOrderBookDBwhen deleting an AMM, similar to howAMMCreateadds them.Actual Result
Stale order book entries persist in
OrderBookDBuntil the server restarts and rebuilds the DB from the ledger.Environment
All versions with AMM support (XLS-30).
Supporting Files
N/A