Skip to content

v11.10.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 21:54
42ccc6b
  • XrplAmount: an amount over the ledger's whole range (#150, Xrpl.Amounts). It holds XRP drops, MPT units or an issued currency as a 16-digit mantissa with an exponent from -96 to 80, as rippled's STAmount does. Parse, TryParse, FromNumber (STAmount::fromNumber), FromCurrency / ToCurrency, ToString (STAmount::getText), comparison and KindOf. AmountKind (Xrp, Iou, Mpt) moves from Xrpl.Sugar to Xrpl.Amounts and becomes public
    • Currency.ToXrplAmount() reads a wire amount exactly, beyond what ValueAsNumber holds
  • XrplAmountMath: STAmount arithmetic (#238): Add, Subtract, Multiply(amount, fraction, rounding) (multiply(amount, frac, rm)), Multiply(v1, v2, asset), Divide, and the directed rounding of offer crossing - MulRound, MulRoundStrict, DivRound, DivRoundStrict - with canonicalizeRound / canonicalizeRoundStrict, the MPTokensV2 Number path, and the fixed-width behaviour of STAmount's constructor (a mantissa above int64 wraps for an issued currency and loses its last digit for XRP and MPT)
  • XrplQuality: rippled's Quality (#238): the 64-bit encoding, FromAmounts (getRate), FromBookDirectory, Rate, rippled's ordering, CeilIn, CeilOut, CeilInStrict, CeilOutStrict and WithinRelativeDistance
    • Offer.BookQuality is the quality the node crosses an offer at, from its BookDirectory; Offer.RemainingQuality the exact ratio of what it has left
  • OfferCrossing: one offer sized as BookStep sizes it (#238): Fund (transfer fees and the owner's funds), LimitStepIn, LimitStepOut, ForwardPass (the forward pass settling on the reverse pass's output), Cross, LimitIn / LimitOut (TOffer::limitIn / limitOut), MulRatio for XRP, MPT and issued currencies, and PassesQualityLimit; the result is an OfferStep
    • LedgerRules.FixReducedOffersV2 selects ceilInStrict in LimitIn; FromNodeAsync reads it
  • OfferCreateCrossing: an OfferCreate crossed over whole order books and AMM pools (Xrpl.Amounts). Cross repeats rippled 3.4.0's flowCross against a DexSnapshot: the direct book and, for two issued currencies, the bridge through XRP; every offer of a quality level per pass, in book order, with expired, empty, deep-frozen, unfunded and too-small offers removed; the owner's funds after what the transaction already moved (PaymentSandbox's deferred credits); the AMM pool's synthetic offer - sized to the book's quality on a single strand (changeSpotPriceQuality, maxOffer) and in Fibonacci slices on two; the StrandFlow loop with limitOut; tfPassive, tfSell, tfImmediateOrCancel, tfFillOrKill; tick size; the remainder and the reserve for placing it
    • OfferCrossingResult: EngineResult, Paid, Received, PlacedTakerPays / PlacedTakerGets, Offers (OfferChange), Pools (AmmPoolChange) and BalanceChanges (BalanceChange), the fee included
    • DexSnapshot with DexAccount, DexTrustLine, DexOffer and DexAmmPool; DexSnapshot.FromNodeAsync reads the books, pools, accounts and trust lines a crossing reaches at one validated ledger
    • LedgerRules.FixAMMv1_2 and LedgerRules.FixFillOrKill; FromNodeAsync reads them
  • PaymentFlow: a Payment evaluated through the payment engine (#240, Xrpl.Amounts). Evaluate repeats rippled 3.4.0's Payment - the tem codes of preflight, the destination checks of preclaim, deposit authorization - and RippleCalc against a DexSnapshot: toStrands, with the implied source, SendMax issuer, book and destination issuer and its path and loop checks; direct steps with QualityIn / QualityOut, trust limits, NoRipple, freezes, authorization and the transfer fee of each issuer the payment ripples through; book steps that leave the output fee to the next step; SendMax, DeliverMin, tfPartialPayment, tfLimitQuality and tfNoDirectRipple; and a direct XRP payment against the reserve
    • PaymentFlowResult: EngineResult, Applied, DeliveredAmount, Paid, Offers, Pools and BalanceChanges
    • DexSnapshot.FromNodeAsync(client, payment) reads the trust lines along the payment's paths and default path, the books and pools on them, the accounts, and the destination's deposit preauthorizations
    • DexTrustLine describes both sides of a line: Limit / PeerLimit, QualityIn / QualityOut / PeerQualityIn / PeerQualityOut, NoRipple / PeerNoRipple, FrozenByAccount, Authorized / PeerAuthorized. DexAccount gains RequireAuth, RequireDestinationTag, DepositAuth and DepositPreauthorized
    • OfferCreateCrossing builds its strands through the same toStrands, and its BalanceChanges list both sides of every trust line, as the metadata does
  • The engine's checks around the flow (Xrpl.Amounts):
    • OfferCreateCrossing.Cross(snapshot, offer, rules) takes the SDK's OfferCreate and repeats its preflight (temINVALID_FLAG, temMALFORMED, temBAD_EXPIRATION, temBAD_SEQUENCE, temBAD_OFFER, temREDUNDANT, temBAD_CURRENCY) and preclaim (tecFROZEN, tecUNFUNDED_OFFER, temBAD_SEQUENCE, tecEXPIRED, checkAcceptAsset's tecNO_ISSUER / tecNO_LINE / tecNO_AUTH / tecFROZEN), cancels the offer OfferSequence names before crossing, and refuses an expired offer. A tec result other than tecKILLED keeps only the fee
    • OfferCrossingResult gains Applied, TrustLines and NeedsDeeperBooks; PaymentFlowResult gains TrustLines and NeedsDeeperBooks. TrustLineChange names a line created or deleted
    • Book steps remove the offer of an owner the issuer does not authorize to hold what the offer asks for (requireAuth), before its quality is checked
    • Trust lines follow trustCreate and directSendNoFeeIOU: a line created on the way in is owned by its receiver, with NoRipple on each side as the account's DefaultRipple implies; a sender whose positive balance is gone and whose side is at its defaults stops paying the line's reserve, and the line is deleted when the receiver does not pay it either. DexTrustLine gains Reserve and PeerReserve; DexAccount gains Sequence, DefaultRipple and DisallowIncomingTrustline
    • Permissioned DEX: an OfferCreate or a Payment with a DomainID walks the domain's books - its offers and the hybrid ones, no AMM pool - with members only, refusing outsiders with tecNO_PERMISSION and expired members with tecEXPIRED; a domain offer whose owner left the domain is removed. DexSnapshot gains Domains and Credentials (DexDomain, DexCredential, DexCredentialType); DexOffer gains DomainId and Hybrid
    • Credentials: a payment's CredentialIDs are checked (temMALFORMED, tecBAD_CREDENTIALS, tecEXPIRED) and meet deposit authorization by the credential sets DexAccount.DepositPreauthorizedCredentials lists
    • Books read in part: DexSnapshot.PartialBooks (DexBook) lists the books a snapshot holds only the top of, and a result that walked past what was read says so in NeedsDeeperBooks. DexSnapshotOptions.BookDepth reads a book by walking its directories - quality by quality, page by page, unfunded offers included - instead of one book_offers page, which a public node caps at 100 offers
    • DexSnapshot.FromNodeAsync takes a DexSnapshotOptions, and an OfferCreate in a new overload; it reads the domain, its books, the credentials the domain accepts for the accounts involved, those a payment presents, and the offer OfferSequence cancels
    • BookOffersRequest.Domain and the book offer's DomainID
  • DexQuoteSugar: quotes against a node's ledger (Xrpl.Sugar). QuotePaymentAsync and QuoteOfferCreateAsync read a snapshot and run the engine, reading deeper while the result NeedsDeeperBooks. QuoteDeliverAsync quotes the cost of delivering an exact amount and QuoteSpendAsync the delivery an exact spend buys, along the paths ripple_path_find returns; each returns a PaymentQuote with the Payment to sign
  • PathFinding: payment paths found locally, as ripple_path_find finds them (Xrpl.Amounts). FindAsync repeats rippled 3.4.0's PathRequest and Pathfinder: the source assets (source_currencies, SendMax, or every asset the source holds), the path-shape table of each payment type up to the search level, addLink over trust lines and order books with getPathsOut's candidate ranking and the ledger-sequence tie-break, every complete path ranked through the payment engine (getPathLiquidity, rankPaths), getBestPaths with the covering full-liquidity path, and the cost of the chosen paths; convert_all with a destination amount of -1
    • PathFindRequest, PathFindResult (Alternatives, DestinationCurrencies, DestinationTagRequired, the node's error codes) and PathFindAlternative (SourceAmount, PathsComputed, DestinationAmount)
    • PathfindingSource.FromSnapshot and PathfindingSource.FromNodeAsync: the ledger a search reads - accounts and trust lines as the search reaches them, in owner-directory order with AssetCache's incoming/outgoing sets, and the state for ranking read along the paths found, at one ledger
    • IBookIndex and BookIndex: the order books, which rippled's OrderBookDB holds and a client supplies - FromLedgerAsync (every book directory and AMM pool of a ledger), FromAssetsAsync (the books between given assets, at most MaxProbeAssets), FromAccountsAsync (between the assets the accounts' trust lines hold, owe or trust for), FromSnapshot, and Observe for the books later transactions create
    • DexQuoteSugar.FindPathsAsync, and a books argument on QuoteDeliverAsync and QuoteSpendAsync that takes the paths from the local search instead of ripple_path_find
    • RipplePathFindRequest.Domain
  • The engine outside a transaction: rippled reads some amendments from the current transaction's rules, which a node has none of outside a transaction - in ripple_path_find - and which a transaction sets only under SingleAssetVault, LendingProtocol, fixCleanup3_2_0 or fixCleanup3_3_0. swapAssetIn and swapAssetOut (fixAMMv1_1), an offer's checkInvariant (fixAMMv1_3) and limitIn (fixReducedOffersV2) now read them that way, while BookStep, AMMLiquidity and changeSpotPriceQuality keep reading the view's rules; outside a transaction Number keeps its large scale
  • The engine no longer moves XRP straight from one account to another along a strand of two XRP endpoints (isDirectXrpToXrp), as rippled's flow refuses
  • GetBalanceChanges computes issued-currency deltas as XrplAmount (#154): the difference is exact, then rounded once to 16 digits to nearest with ties to even, and written as rippled writes it. A balance beyond decimal is reported instead of throwing AmountOutOfRangeException
  • Breaking: Xrpl.Utils.Quality is removed. It was an empty class; the quality of an offer is XrplQuality
  • Amounts-Guide (both languages) covers XrplAmount, the arithmetic, XrplQuality, OfferCrossing, OfferCreateCrossing, PaymentFlow, permissioned domains and credentials, reading books from a node, quotes, and finding paths
  • protocol-watch.yml: engine-watch also follows the path finder's sources (Pathfinder, PathRequest, AssetCache, TrustLine, AccountAssets, OrderBookDBImpl, RipplePathFind, STPathSet) and Rules.cpp; a path added to its list starts from the baseline ref
  • The Blazor demo has a Paths & quotes page: quotes to deliver or spend exactly, and path searches compared with the node's
  • TestUAmountVectors replays 8,808 results computed by rippled 3.4.0's STAmount, Quality and mulRatio code over every Number scale and rounding mode; Tests/Xrpl.Tests/Fixtures/Amount holds the vectors and the generator. TestUXrplAmount pins the ceilIn / ceilOut cases of Quality_test.cpp, the getRate cases of STAmount_test.cpp and the text form. TestIOfferCrossing crosses offers on a node - partially, with a transfer fee, from an underfunded maker, between two issued currencies - and compares every amount with the metadata, and reads a 5e90 balance change
  • TestUOfferCreateCrossing rebuilds the offer crossings of rippled's AMM_test.cpp (testBasicPaymentEngine) as snapshots and requires the same pool balances, remaining offers and holdings under each amendment set, and replays testFixChangeSpotPriceQuality. TestIBookCrossing, TestIBookCrossingBridge and TestIBookCrossingAmm build books and pools on a node, cross them locally and on the node, and compare every offer, pool and balance the transaction changed
  • TestUPaymentFlow replays the payments of rippled's Flow_test.cpp (testDirectStep, testLineQuality) as snapshots, and TestUStrandBuilder the strands of PayStrand_test.cpp (testToStrand). TestIPaymentFlow sends payments on a node - rippling through intermediaries with qualities and transfer fees, through books and pools, on two strands, with DeliverMin and the limit quality, along paths from ripple_path_find, and the ones the node refuses - and compares each with the metadata
  • TestUDexGaps covers the offer's own checks, OfferSequence, Offer_test.cpp's testMissingAuth, trust lines created and deleted, domain and hybrid books, credentials and deposit authorization, partial books, and the book directory keys against mainnet's. TestIOfferCreateChecks, TestIPermissionedDex and TestIDexQuotes run the same on a node - an unauthorized owner's offer, frozen, unfunded, expired and malformed offers, OfferSequence, lines created and deleted, domain and hybrid offers, members and outsiders, expired credentials, credentials meeting deposit authorization, a 111-offer book read by walking its directories, and quotes submitted as quoted - and compare each with the metadata, trust lines created and deleted included
  • TestUPathFinding replays Path_test.cpp's searches as snapshots, with jtx's accounts - direct, through a gateway, rippling, consume-all, through an offer, the four best of many paths, the negative cases - and TestIPathFinding runs searches locally and through ripple_path_find at the same ledger - through gateways, intermediaries, books and pools, across currencies, consume-all, source-issuer selection, every source asset, a domain book - and requires the same alternatives, and pays one as found
  • .ci-config/rippled.cfg and rippled.batchv11.cfg store ledgers in NuDB instead of RocksDB: standalone xrpld with RocksDB never finishes closing a ledger of more than about 100 transactions, and building a deep book beside the other classes reaches that