Ripple ships a major cryptographic library upgrade for its SDK and fixes two core ledger bugs to improve error handling for `CheckCash` transactions and expired credentials in permissioned DEXs.
> impact
This week's update includes a significant dependency change for the Ripple SDK and two important fixes for the core ledger. First, the SDK has upgraded its cryptographic library dependency, `@noble/curves`, from v1.8.1 to v2.0.1. This is a major version bump that modernizes the SDK's security components.
Two notable bugs in the core ledger have been addressed to improve transaction processing logic and accuracy. The first fix corrects an issue where a `CheckCash` transaction would return an incorrect `tecPATH_PARTIAL` error if an issuer froze a currency after a check was created; it now correctly returns `tecFROZEN`. The second fix refactors the `accountInDomain` function, which previously failed to signal expired credentials in a permissioned DEX, causing transactions to fail with the wrong error code (`tecNO_PERMISSION`) and leaving expired credential entries on the ledger.
For developers using the Ripple SDK, the upgrade to `@noble/curves` v2.0.1 is a potential breaking change that requires immediate attention to ensure compatibility and prevent unexpected behavior in applications that rely on cryptographic functions. For the broader ecosystem, the core ledger fixes enhance the reliability and predictability of the XRP Ledger. The `CheckCash` correction provides clearer feedback to client applications, while the `accountInDomain` update ensures correct error reporting (`tecEXPIRED`), enables automatic cleanup of stale data, and mitigates ledger bloat.
> Try this now
try this
# The `accountInDomain` function currently returns a `bool`, preventing specific error signaling and cleanup of expired credentials.
# Here's how to refactor it to return a `TER` code and enable ledger cleanup:
// 1. In `PermissionedDEXHelpers.h` and `.cpp`, modify the function signature.
// BEFORE: bool accountInDomain(...);
// AFTER: TER accountInDomain(...);
// 2. In the function's implementation, return a specific error for expired credentials.
// if (credential && credential->getFieldU32(sfExpiration) < view.parentCloseTime())
// {
// // INSTEAD OF: return false;
// return tecEXPIRED; // Return the specific error code
// }
// return tesSUCCESS; // On success
// 3. Update call sites, like in `OfferCreate::doApply`, to handle the TER.
// TER const ter = accountInDomain(view(), account_, domain);
// if (ter != tesSUCCESS)
// {
// // 4. If expired, add logic to delete the stale ledger entry before returning.
// if (ter == tecEXPIRED)
// {
// auto const sle = view().peek(keylet::credential(account_, domain));
// if (sle)
// ctx.view().erase(sle);
// }
// return ter;
// }