Compare commits

...

405 Commits

Author SHA1 Message Date
JCW
a2de1d6e88 Merge remote-tracking branch 'origin/develop' into a1q123456/early-exit-fee 2026-10-16 10:49:05 +01:00
JCW
737b8646fe Merge commit 'd1ed3a0966cf98bef4e8f0ac596006c83055445f' into a1q123456/early-exit-fee 2026-10-16 10:44:41 +01:00
Bart
4087861411 fix: Refuse to walk an invalid SHAMap in getMissingNodes (#8086)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-10-16 05:47:08 +00:00
Bart
dc43faafed fix: Refuse to make an invalid SHAMap or Ledger immutable (#8085)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-10-16 05:47:07 +00:00
Bart
6af97c07d9 fix: Report a node the sync path refuses as invalid data (#8084)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16 05:47:06 +00:00
Bart
4c7d920e66 fix: Make the SHAMap sync-path state atomic (#8083)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-16 05:47:06 +00:00
yinyiqian1
8b59d9d307 docs: Add todo comment for key rotation zkproof (#8589) 2026-10-16 00:11:06 +00:00
Bart
b0fa295595 fix: Judge a header's account hash on both acquisition routes (#8476)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-15 21:00:21 +00:00
Bart
9af432cb0e fix: Signal every InboundLedger failure found in local data (#8082)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-10-15 21:00:20 +00:00
Bart
4435ca4cbf refactor: Add a reusable peer harness for acquisition tests (#8310)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-10-15 21:00:19 +00:00
Olek
cd72a11786 refactor: TxQ (#8064) 2026-10-15 18:11:46 +00:00
Peter Chen
b398b88385 fix: Reject a zero credential ID in deposit_authorized (#8533) 2026-10-15 18:11:18 +00:00
Olek
31f6f90206 feat: Add IssuerMirrorEncryptionKey and InitialIssuerEncryptionKey (#8325) 2026-10-15 18:04:29 +00:00
Olek
1d8c2f9172 test: Sponsor checkSign additional tests (#8331) 2026-10-15 18:03:48 +00:00
Vito Tumas
f105418bdb feat: Book FixedPrecision LoanPay and LoanManage (#8271)
Co-authored-by: Jingchen <a1q123456@users.noreply.github.com>
Co-authored-by: Alex Kremer <akremer@ripple.com>
2026-10-15 18:02:36 +00:00
Ayaz Salikhov
4a134eb883 docs: Clarify OS and toolchain requirements (#8588) 2026-10-15 17:58:11 +00:00
Ayaz Salikhov
ec3f251ad8 ci: Fix running pre-commit after clang-tidy (#8601) 2026-10-15 16:15:35 +00:00
Mayukha Vadari
5faa861226 feat: Add Smart Escrow fee voting (#8214) 2026-10-15 15:50:16 +00:00
Vito
d1ed3a0966 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-loanpay 2026-10-15 16:06:04 +02:00
Jingchen
88fd1222d6 build: Fix unity build by addressing name clashes (#8599) 2026-10-15 12:59:20 +00:00
Vito
163f326b65 fix: Leave a self-paid fee out of LoanPay's debit check
When the borrower is the broker owner, the fee is not transferred, but the
"account balance decreased" check still counted it in the amount paid. A
Vault credit that rounds away on a large owner-borrower balance then
aborted the check. Count only what leaves the borrower, and add a row with
a 2e7 owner-borrower, a 1e-9 Vault credit and a self-paid fee.
2026-10-15 14:48:56 +02:00
Vito
b00266cafb fix: Avoid an assert-only variable in LoanPay
Release builds compile XRPL_ASSERT out, so totalPaid was unused and -Werror failed. Compute it inside the assert.
2026-10-15 14:21:48 +02:00
Vito
1c6e1cf46b fix: Let LoanPay's checks allow each trust line's rounding
The borrower's and the payee's trust lines each round a payment to 16
digits, so the debit and the credit can differ by a unit, or one side can
round away. That is normal IOU behavior, but the debug conservation checks
assumed exact transfers and aborted, also on CashBasis Vaults.

Drop the terminal fee forgiveness that tried to avoid these cases: the fee
is now always sent, and each side rounds as it does. Put the cover credit
back before associateAsset. Allow up to one unit of each touched balance
in the conservation checks, and add rows where the debit and the credit
differ.
2026-10-15 14:12:32 +02:00
Vito
8c55746cca fix: Take the credit grid from the floored sum
creditToPosteriorScale floored reference + raw summed Downward, but its
caller picked the grid from the same sum rounded to nearest. A sum just
under a power of ten that rounds up to it picked the coarser grid, and the
Downward sum floored on it landed below reference, so the credit was
negative. A LoanManage default with a cover just under one unit on an
all-nines AssetsAvailable then failed with tecINTERNAL.

Compute the sum once in the credit's rounding mode, take its live scale,
and floor that sum, so a Downward credit is always between zero and raw.
2026-10-15 14:12:31 +02:00
Vito
590f6b9a89 fix: Round CoverAvailable after the moved LoanPay cover credit
d23112bee9 moved the redirected fee credit after associateAsset, which
rounds the broker's fields to the asset once. The new sum was stored with
more than 16 digits, so on Legacy and CashBasis a valid payment failed the
cover invariant. Round the broker's fields again after the credit, which
matches develop's result, and add Legacy and CashBasis rows.
2026-10-15 11:20:45 +02:00
Vito
af6dbb1225 fix: Allow a negative broker owner balance in the LoanPay checks
The conservation checks now read stored IOU balances, which are signed. A
broker owner that owes the issuer on a reciprocal trust line has a negative
balance and can still receive the fee, so the non-negative check aborted
a valid payment. Allow it for an IOU fee paid to the owner, keep the check
for the Vault and the broker pseudo-account, and add a negative owner row.
2026-10-15 10:23:59 +02:00
Vito
d23112bee9 fix: Decide LoanPay fee forgiveness from stored balances
The terminal fee forgiveness read the payee's spendable balance. That is a
placeholder maximum for an IOU issuer, so any fee to an issuer-owned broker
was forgiven, and it adds the opposite trust limit, so a collectible small
fee could look like it rounds away. It also ignored the borrower's side.

Decide from the stored trust line balance of each holder side, skip the
issuer side, and forgive the fee if either side would round away. Credit
the cover only after that decision. The conservation checks use stored
balances for holders too, and accept an issuer payee whose spendable
balance does not move.
2026-10-15 09:23:59 +02:00
Ayaz Salikhov
f1ce9449f2 fix: Skip bootstrap DNS lookups in standalone mode (#8583)
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-10-14 21:02:45 +00:00
Vito
3518a96aec test: Set the real VaultID in the FixedPrecision loan-vault invariant rows
The transaction was built before preclose created the Vault, so rows that
set sfVaultID used a zero placeholder. Create the Vault first, then build
the transaction.
2026-10-14 18:41:56 +02:00
Vito
4270ba99d4 fix: Forgive a LoanPay fee that rounds away on the owner's balance
On a terminal payment whose Vault credit rounds to zero, a fee sent to a
broker owner with a large IOU balance can round away on its trust line.
Neither the Vault nor the owner balance then grows, and the conservation
asserts after the transfer fail. Forgive the fee like the Vault's sub-unit
remainder and return before the transfer, and cover it with a large owner
balance row.
2026-10-14 18:41:54 +02:00
Timur Yalymov
7237b3321c fix: Charge transfer fee on third-party vault withdrawals (#8267) 2026-10-14 16:35:42 +00:00
Alex Kremer
b1addafd4d feat: Book FixedPrecision LoanManage default and impairment (#8461) 2026-10-14 17:16:26 +01:00
Vito
dc5cc55061 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-loanpay 2026-10-14 17:30:55 +02:00
Vito
0735fc8fd6 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-14 17:23:46 +02:00
Vito
5a5046d7b5 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-loanpay 2026-10-14 17:21:30 +02:00
Vito
858b2c68f4 fix: Floor the default cover credit from the exact raw cover
Keep the capped cover as a Number and let creditToPosteriorAvailableScale
do the only conversion. Truncating it to a 16-digit STAmount first could
drop digits that change floor16(AssetsAvailable + cover) and credit the
Vault one posterior unit less.
2026-10-14 17:12:13 +02:00
Vito
54ce42770c Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-14 17:08:15 +02:00
Vito
d0e92cf3dd Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-loanpay 2026-10-14 17:04:54 +02:00
Vito
b570bdfa4e Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-14 16:34:17 +02:00
Vito
c29a42b6c0 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-loanpay 2026-10-14 16:32:33 +02:00
Timur Yalymov
84d980d883 fix: Reject VaultClawback with a nonexistent holder (#8470) 2026-10-14 14:29:05 +00:00
Vito
f00ad8e091 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-14 16:25:40 +02:00
Vito
bec158b313 test: Remove the unreachable final-withdrawal rounding test
The shares-to-assets round trip for a final withdrawal cannot exceed
AssetsAvailable when AssetsDeployed is zero: that needs an AssetsTotal
near 1e19, beyond any asset's limit. The test never reached the case it
was named for.
2026-10-14 16:25:34 +02:00
Timur Yalymov
791c96faad fix: Enforce pseudo-account directory contents with an invariant (#8181)
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
2026-10-14 13:51:24 +00:00
Ayaz Salikhov
31473e7e6d build: Unify clang variables (#8581) 2026-10-14 13:51:05 +00:00
Timur Yalymov
aa70b368b5 fix: Enforce asset authorization on LoanBrokerDelete (#8204)
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
2026-10-14 13:51:05 +00:00
Vito Tumas
d3db569b34 feat: Book FixedPrecision LoanSet through AssetsDeployed (#8260)
Co-authored-by: Jingchen <a1q123456@users.noreply.github.com>
2026-10-14 13:20:58 +00:00
Vito Tumas
94d6b7daf8 feat: Round LoanBroker cover on the FixedPrecision grid (#8258)
Co-authored-by: Jingchen <a1q123456@users.noreply.github.com>
2026-10-14 12:59:39 +00:00
Vito Tumas
e089abe982 feat: Use FixedPrecision accounting in Vault transactors (#8460)
Co-authored-by: Jingchen <a1q123456@users.noreply.github.com>
2026-10-14 12:52:25 +00:00
Vito
914f8fceb6 chore: Apply clang-tidy fixes 2026-10-14 13:39:15 +02:00
Vito
455c7997cb Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-14 13:34:25 +02:00
Vito
eed8066cd5 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-14 13:31:43 +02:00
Vito
fed9b41b01 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-14 13:29:20 +02:00
Vito
f2295b7b8d Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-14 13:26:51 +02:00
Vito
423bb295f5 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-transactors 2026-10-14 13:13:03 +02:00
Vito
249d09c3a5 test: Include envconfig.h in VaultClawback test 2026-10-14 13:13:00 +02:00
Vito
c89209089a Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage
# Conflicts:
#	src/test/app/invariants/InvariantsVault_test.cpp
2026-10-14 12:32:23 +02:00
Vito
1588dea04f Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-14 12:31:28 +02:00
Vito
58b2f9f8c8 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-14 12:31:26 +02:00
Vito
37e61675d6 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-14 12:31:24 +02:00
Vito
7b36f88be5 test: Stop excluding LendingProtocolV1_2 from testableAmendments
V1_2 also enables develop features such as lending Batch inners and
Loan Broker domains, so excluding it from every default Env hid their
tests. Keep testableAmendments() as in develop and instead pin only the
test functions that create FixedPrecision Vaults and need lending this
stack enables later; the LoanManage PR removes those pins. Also gate
the VaultCreate AssetsMaximum base-grid check on the Vault version being
created, so Legacy and CashBasis creates keep their behavior.
2026-10-14 12:30:49 +02:00
Alex Kremer
33289e882b refactor: Migrate handlers to rpc-spec (C) (#8561) 2026-10-14 10:15:32 +00:00
Vito
7977fdfe7a Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-transactors 2026-10-14 11:58:09 +02:00
Vito
a53506785a Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-14 10:10:06 +02:00
Vito
202dd15ebc Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-14 10:10:03 +02:00
Vito
afb7e6cffc Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-14 10:10:00 +02:00
Vito
aaad117a83 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-14 10:09:56 +02:00
Vito
190320b01b Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-transactors
# Conflicts:
#	include/xrpl/ledger/helpers/VaultHelpers.h
#	include/xrpl/protocol/Protocol.h
#	src/libxrpl/ledger/helpers/VaultHelpers.cpp
#	src/tests/libxrpl/protocol/VaultGridTests.cpp
2026-10-14 09:56:35 +02:00
Gregory Tsipenyuk
1ed0bccb07 fix: Clamp invalid XRP amounts in Quality::ceilOut & getBookPage (#8480)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-10-14 07:49:27 +00:00
Gregory Tsipenyuk
1da55e3989 fix: Waive CanTransfer on loan default and broker delete (#8231)
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-10-14 07:49:12 +00:00
Valentin Balaschenko
166e97e12b refactor: Decouple LedgerHistory from TaggedCache internals (#5874)
Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com>
2026-10-13 23:33:32 +00:00
Chenna Keshava B S
33e5a6fa7c feat: Add TransactionProposalCancel & Cosign Ticket reservation (#8538)
Co-authored-by: Shawn Xie <35279399+shawnxie999@users.noreply.github.com>
Co-authored-by: Kassaking7 <96991820+Kassaking7@users.noreply.github.com>
Co-authored-by: Shawn Xie <shawnxie@live.ca>
Co-authored-by: Zhiyuan Wang <1830604455@qq.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-10-13 19:07:45 +00:00
Ayaz Salikhov
b1f9dc6919 ci: Fix rpm installation problems (#8575) 2026-10-13 18:46:41 +00:00
Ayaz Salikhov
38965af055 docs: Clarify freeze on large changes 2 weeks before first RC (#8574) 2026-10-13 18:43:24 +00:00
Gregory Tsipenyuk
b010d4a563 refactor: Retire fixAMMv1_1 amendment (#8226)
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-10-13 18:03:10 +00:00
dependabot[bot]
eedd6604d1 chore: [DEPENDABOT] bump pyparsing from 3.3.2 to 3.3.3 in /cmake/scripts/codegen in the codegen-dependencies group (#8572)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-13 17:48:57 +00:00
Mayukha Vadari
59ff04b648 fix: Allow WASM transactions in simulate only in admin mode (#8568) 2026-10-13 17:39:32 +00:00
Gregory Tsipenyuk
fcb3ee6425 fix: Detect int64 overflow in XRPAmount and MPTAmount (#8453)
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-10-13 17:35:35 +00:00
Gregory Tsipenyuk
77eacbb52c fix: Assorted MPT/DEX offer related fixes (#8211)
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-10-13 17:18:47 +00:00
Vito
7d15e02214 chore: Address LoanManage review comments
Mark defaultLoanFixedPrecision [[nodiscard]], drop a redundant lambda
return type, and exclude the adjustVaultBalances failure returns that
cannot be reached from coverage.
2026-10-13 18:23:43 +02:00
Vito Tumas
5ce85b2799 feat: Add FixedPrecision Vault grid and balance helpers (#8257)
Co-authored-by: Jingchen <a1q123456@users.noreply.github.com>
2026-10-13 16:19:08 +00:00
Jingchen
6a0aebb86b Apply batched suggestions from code review
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
2026-10-13 17:17:36 +01:00
JCW
e3dee6872c Fix clang-tidy errors 2026-10-13 15:49:37 +01:00
Ayaz Salikhov
4538d198e1 build: Update codegen requirements (#8570) 2026-10-13 14:29:59 +00:00
JCW
da6c067864 Merge remote-tracking branch 'origin/tapanito/sav-fixed-precision-loanmanage' into a1q123456/early-exit-fee 2026-10-13 15:26:30 +01:00
JCW
181c56f7ac Fix unit tests 2026-10-13 15:24:53 +01:00
JCW
0f72064245 Tighten invariant checks so that we don't get test failures 2026-10-13 15:08:58 +01:00
Vito
b549db8ca4 test: Expect tecPRECISION_LOSS for out-of-range AssetsMaximum on FixedPrecision
Before fixCleanup3_5_0, an out-of-range AssetsMaximum throws on Legacy and
CashBasis Vaults, but FixedPrecision Vaults reject it in preclaim through
the base-grid check.
2026-10-13 14:45:26 +02:00
Vito
16d44c5c9b Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-13 14:14:48 +02:00
Vito
683f9fb8cd Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-13 14:14:45 +02:00
Vito
0a81c64c5c Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-13 14:14:42 +02:00
Vito
0779f4a655 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-13 14:14:39 +02:00
Vito
de078770d5 Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-13 14:14:36 +02:00
Vito
77296557bc fix: Reject out-of-range values in isOnVaultBaseGrid
Check isRepresentable before building an STAmount, so an out-of-range
user-supplied value is rejected in preclaim instead of throwing.
2026-10-13 14:14:22 +02:00
Vito
90ecf34aea chore: Apply clang-tidy trailing-comma and const-correctness fixes 2026-10-13 13:20:15 +02:00
Vito
c159a87b90 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage
# Conflicts:
#	src/test/app/lending/LoanTestBase.h
2026-10-13 13:17:25 +02:00
Vito
2dc43acd0b chore: Apply clang-tidy trailing-comma and const-correctness fixes 2026-10-13 13:17:03 +02:00
Vito
c25ce4c20e Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-13 13:14:27 +02:00
Vito
d12903de88 chore: Apply clang-tidy trailing-comma and const-correctness fixes 2026-10-13 13:14:21 +02:00
Vito
4e3d41559c Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-13 13:12:20 +02:00
Vito
ad035568a3 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-13 12:57:39 +02:00
Vito
001e7a70b3 chore: Apply clang-tidy trailing-comma and const-correctness fixes 2026-10-13 12:57:34 +02:00
Vito
ea0e1eeb36 Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-13 12:53:27 +02:00
Vito
cd63845918 test: Use NOLINTNEXTLINE for the optional access in VaultHelpers test
The trailing NOLINT moved off the flagged line once the initializer was
split across lines.
2026-10-13 12:53:18 +02:00
Vito
2d0ee68946 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-13 12:49:01 +02:00
Vito
cf668a5016 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-13 12:27:41 +02:00
Vito
7cdefdffd5 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-13 12:27:17 +02:00
Vito
b531a5d643 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-13 12:26:05 +02:00
Vito
f2dd239808 Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-13 12:25:28 +02:00
Vito
ab97784fd4 chore: Regenerate protocol autogen tests 2026-10-13 12:25:04 +02:00
Vito
274148879b Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage
# Conflicts:
#	src/test/app/vault/VaultScale_test.cpp
2026-10-13 12:06:49 +02:00
Vito
ca0ed4eb55 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-13 12:06:34 +02:00
Vito
4196ff56af Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset
# Conflicts:
#	src/test/app/lending/LoanSet_test.cpp
2026-10-13 12:06:30 +02:00
Vito
32608826fb Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker
# Conflicts:
#	src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp
2026-10-13 12:05:59 +02:00
Vito
e1c05bf272 Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors
# Conflicts:
#	src/test/app/vault/VaultScale_test.cpp
2026-10-13 12:05:36 +02:00
Vito
d5d9160f67 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-13 12:05:17 +02:00
Vito
b4142832a0 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage
# Conflicts:
#	src/libxrpl/tx/transactors/lending/LoanManage.cpp
#	src/test/app/invariants/InvariantsVault_test.cpp
#	src/test/app/vault/VaultScale_test.cpp
2026-10-13 12:04:30 +02:00
Vito
d693c8232a Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-13 12:03:58 +02:00
Vito
397956a618 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-13 12:03:55 +02:00
Vito
c35d4d362e chore: Apply clang-tidy trailing-comma and const-correctness fixes 2026-10-13 11:55:19 +02:00
Vito
2e7f968230 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-13 11:49:47 +02:00
Vito
4604f437b5 chore: Apply clang-tidy trailing-comma and const-correctness fixes 2026-10-13 11:49:41 +02:00
Vito
080b7da6a7 Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors
# Conflicts:
#	src/tests/libxrpl/protocol/VaultGridTests.cpp
2026-10-13 11:43:24 +02:00
Vito
56ea39fbba chore: Apply clang-tidy trailing-comma and const-correctness fixes 2026-10-13 11:42:50 +02:00
Vito
0e14d9a164 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker
# Conflicts:
#	src/test/app/lending/LendingHelpers_test.cpp
2026-10-13 11:25:46 +02:00
Vito
59a80e0d42 fix: clang-tidy 2026-10-13 11:20:55 +02:00
Vito
2a56180959 Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors
# Conflicts:
#	src/test/app/vault/VaultScale_test.cpp
2026-10-13 11:06:54 +02:00
Gregory Tsipenyuk
4c39b05f94 fix: Reject vault and lending amounts out of range for the asset (#8527)
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-10-13 08:46:55 +00:00
Vito
42699efc40 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-13 10:37:45 +02:00
Vito
167dbd85dc fix: Skip LoanPay transfer when an owner-borrower pays itself the fee
On a terminal payment whose Vault credit rounds to zero, a fee that goes
to the broker owner who is also the borrower moves nothing, so the
conservation asserts after the transfer failed. Return early in that case
too, and cover it with an owner-as-borrower row.
2026-10-13 10:37:34 +02:00
Vito
281b08e876 chore: Exclude LoanSet adjustVaultBalances failure from coverage
LoanSet only moves cash already checked against AssetsAvailable and
changes no loss, so adjustVaultBalances cannot fail here.
2026-10-13 10:21:22 +02:00
Vito
205803bea5 chore: Exclude VaultClawback dust check return from coverage 2026-10-13 10:21:09 +02:00
Bart
c2478f509c refactor: Open the acquisition seams its tests need (#8081)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-10-13 03:51:12 +00:00
JCW
2f7c17caee Fix for clang-tidy and formatting 2026-10-13 01:05:23 +01:00
JCW
e861d09438 Merge remote-tracking branch 'origin/tapanito/sav-fixed-precision-loanmanage' into a1q123456/early-exit-fee 2026-10-13 01:00:33 +01:00
JCW
a15461d8c4 Fix PR comments 2026-10-13 00:59:25 +01:00
Mayukha Vadari
c908ed7839 fix: Reject malformed conditions in EscrowFinish preflight (#8523) 2026-10-12 20:48:55 +00:00
Bart
fc57311c81 refactor: Expose a SHAMapAddNode verdict as counts (#8080)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-10-12 20:02:36 +00:00
Mayukha Vadari
818de49264 refactor: Use DepositPreauthEntry everywhere (#8364) 2026-10-12 18:56:14 +00:00
dependabot[bot]
1318b1e58b chore: [DEPENDABOT] bump cxx from 1.0.202 to 1.0.203 in /crates in the rust-dependencies group (#8564)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-12 17:23:41 +00:00
Ayaz Salikhov
617c816ec8 chore: Fix readability-trailing-comma (#8545) 2026-10-12 13:57:24 +00:00
Vito
2e2846da4e Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-12 15:05:52 +02:00
Vito
9055a78591 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-12 15:05:49 +02:00
Vito
14e6c90737 test: Include Issue.h in LoanSetFixedPrecision test 2026-10-12 15:05:45 +02:00
dependabot[bot]
34fc86f585 ci: [DEPENDABOT] bump the github-actions group across 1 directory with 2 updates (#8562)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-12 12:59:39 +00:00
Vito
53f478eefc chore: Rename Vault maximum IOU scale constants 2026-10-12 14:12:39 +02:00
Vito
da52cd3281 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-12 14:04:40 +02:00
Vito
af6dc0900f Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-12 14:02:21 +02:00
Vito
a863d2edf1 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-12 14:00:16 +02:00
Vito
eb649826e6 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-12 13:57:54 +02:00
Vito
1f3808b5f7 chore: Address Vault review comments
Rename the Vault maximum IOU scale constants so the Vault, not the IOU,
carries the Legacy/FixedPrecision qualifier. Exclude the unreachable
adjustVaultCash failure returns from coverage, and compare the
AssetsAvailable round-trip in the test helper against the stored value.
2026-10-12 13:57:35 +02:00
Ayaz Salikhov
e071f0a28d chore: Fix misc-const-correctness (#8546) 2026-10-12 11:44:06 +00:00
Vito
364eeaaa7c Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-12 13:39:00 +02:00
Vito
4dc126ee0a Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-12 13:30:20 +02:00
Vito
1c62e703d2 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-12 13:22:48 +02:00
Vito
34be40fae1 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-12 13:16:56 +02:00
Vito
712eb2de0b Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-12 13:08:57 +02:00
Vito
425ccc6f49 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-12 12:59:38 +02:00
Vito
da5a9e77b6 test: Update default Vault version cases for LendingProtocolV1_1
FixedPrecision now requires featureLendingProtocolV1_1 and no longer
depends on fixCleanup3_2_0. Also rename the VaultCreate callers to
getVaultDefaultVersion.
2026-10-12 12:58:58 +02:00
Vito
77bf786c66 Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-12 12:55:25 +02:00
Vito
d32886a91a test: Cover Vault outflow clamp and default version selection
Rename vaultVersionFor to getVaultDefaultVersion. Add grid tests for
clampVaultOutflow on integral and IOU assets, and for the amendment
combinations that select each Vault version.
2026-10-12 12:55:15 +02:00
Ayaz Salikhov
8faa624ade chore: Update XRPLF/actions to use pip from python3.14 explicitly (#8560) 2026-10-12 10:06:06 +00:00
Vito
afa775bc05 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-12 11:18:32 +02:00
Vito
ae830be3f1 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-12 11:11:10 +02:00
Vito
a198934412 test: Cover YieldUnrealized net of management fee on LoanSet
Check YieldUnrealized against the loans' TotalValueOutstanding -
PrincipalOutstanding - ManagementFeeOutstanding in the shared
FixedPrecision Vault helper, and add LoanSet cases with a nonzero
management fee on IOU, XRP and MPT FixedPrecision Vaults.
2026-10-12 11:10:53 +02:00
Vito
b0dcfb765c Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-12 10:59:24 +02:00
Vito
f301f143dc docs: Clarify LoanBroker cover comments
Note that the scale-mismatch test input is also over the Open limit, and
move the comment on why FixedPrecision skips canApplyToBrokerCover into
the FixedPrecision branch.
2026-10-12 10:59:11 +02:00
Vito
17c4a41e7d chore: Drop redundant lambda parameter lists 2026-10-12 10:58:42 +02:00
Vito
2ab3d22f40 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-12 10:41:52 +02:00
Vito
030b48bfc2 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay
# Conflicts:
#	src/libxrpl/tx/transactors/lending/LoanPay.cpp
2026-10-12 10:35:01 +02:00
Vito
4229172066 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-12 10:29:07 +02:00
Vito
acdc5fa53c chore: Drop redundant lambda parameter lists 2026-10-12 10:29:02 +02:00
Vito
130dbb6981 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker
# Conflicts:
#	src/libxrpl/tx/transactors/lending/LoanBrokerCoverDeposit.cpp
2026-10-12 10:21:36 +02:00
Vito
583bfdfec7 chore: Drop redundant lambda parameter lists 2026-10-12 10:21:13 +02:00
Vito
a9800ad95d Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors
# Conflicts:
#	src/libxrpl/tx/transactors/vault/VaultDeposit.cpp
2026-10-12 09:59:14 +02:00
Vito
cb32fbb0a9 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-12 09:38:45 +02:00
Vito
0cf1f6a375 fix: ai comments 2026-10-12 09:33:20 +02:00
Ayaz Salikhov
6d6ab2d067 Merge remote-tracking branch 'upstream/release/3.4.x' into develop 2026-10-10 00:20:39 +01:00
Ayaz Salikhov
00e6407514 chore: Bump version to 3.4.1 and make pkg_release 2 2026-10-09 23:50:58 +01:00
Ayaz Salikhov
00c06edffb Merge remote-tracking branch 'upstream/release/3.4.x' into develop 2026-10-09 22:45:18 +01:00
Ayaz Salikhov
de5053ae0d build: Reduce number of conan logs (#8548) 2026-10-09 16:33:41 +00:00
Ayaz Salikhov
1940ec5c2a chore: Fix readability-redundant-lambda-parameter-list (#8544) 2026-10-09 16:20:45 +00:00
Vito
3999aff7a9 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-09 17:48:15 +02:00
Vito
353d21820b Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-09 17:48:12 +02:00
Vito
f42a5aa698 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-09 17:48:10 +02:00
Vito
bdf89b1b8e Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-09 17:48:07 +02:00
Vito
5a91f9b9ea test: Include Feature.h in LoanPermissionedDomain test 2026-10-09 17:48:02 +02:00
Vito
d58162b1ac Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-09 17:35:05 +02:00
Vito
3ab49f5f4f Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-09 17:29:32 +02:00
Vito
d61a683241 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-09 17:21:54 +02:00
Vito
72cfefc781 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-09 17:14:59 +02:00
Vito
3b6f78630c test: Enable LendingProtocolV1_2 for Loan Broker domain cases
DomainID and private Loan Brokers require featureLendingProtocolV1_2,
which this stack leaves out of the default test amendments until the
LoanManage PR. Enable it explicitly in the permissioned-domain cases of
LoanPermissionedDomain, LoanBroker, InvariantsPseudoAccount and
InvariantsMisc.
2026-10-09 17:12:36 +02:00
Denis Angell
19c94c73f4 fix: Reject Batch inner txs with the wrong wrapper (fixBatchV1_2) 2026-10-09 16:04:36 +01:00
Bart
cd005ff60d ci: Update Nexus packaging URL 2026-10-09 16:04:36 +01:00
Gregory Tsipenyuk
578224f2e6 fix: Assorted integer-arithmetic hardening in the payment engine and ledger helpers 2026-10-09 16:04:35 +01:00
Vito
9efae1b2e8 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-09 16:39:16 +02:00
Vito
e42887e697 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-09 16:39:16 +02:00
Vito
d1e597962f Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-09 16:39:15 +02:00
Vito
62da67d9fd Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-09 16:39:15 +02:00
Vito
e4b0c5406e Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-09 16:39:15 +02:00
Vito
64092e8b24 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-09 16:39:04 +02:00
Shawn Xie
3857ce21cd fix: Change mpt subscription msg type back to transaction (#8539) 2026-10-09 13:33:13 +00:00
Vito
a794a2aba1 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-09 13:38:17 +02:00
Vito
ae7b80c4cb Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-09 13:38:14 +02:00
Vito
62df379d07 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-09 13:38:11 +02:00
Vito
d92c817942 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-09 13:38:07 +02:00
Vito
4c0081a8ef Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-09 13:38:04 +02:00
Vito
c25312570d docs: Fix adjustVaultBalances contract for negative YieldUnrealized
A negative YieldUnrealized is rejected with tefBAD_LEDGER, not clamped.
2026-10-09 13:37:58 +02:00
Vito
c6351e31b1 test: Run Vault and Loan suites on FixedPrecision Vaults
Stop excluding featureLendingProtocolV1_2 from the shared VaultTestBase
and LoanTestBase feature sets, so suites that create new Vaults now get
FixedPrecision Vaults.

VaultBugs and VaultScale keep V1_2 disabled locally: they probe the
STAmount 16-digit cliff, which FixedPrecision's Open-zone cap makes
unreachable. The pre-fixCleanup3_1_3 unclamped clawback case in
VaultClawback also disables V1_2, as it needs a CashBasis Vault.
2026-10-09 13:36:15 +02:00
Vito
b246d37b33 test: Restore FixedPrecision lending cases in LendingBatch
LoanSet, LoanPay and LoanManage now handle FixedPrecision Vaults, so run
every case under featureLendingProtocolV1_1 again.
2026-10-09 12:57:47 +02:00
Vito
a8a65168c3 Merge remote-tracking branch 'origin/tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-09 12:56:09 +02:00
Vito
80b41425f9 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-09 12:53:29 +02:00
Vito
10fcaa9f87 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-09 12:51:00 +02:00
Vito
ef203f6010 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-09 12:47:51 +02:00
Vito
1c6f3a7eef test: Skip FixedPrecision lending cases in LendingBatch until LoanManage
With featureLendingProtocolV1_1 and featureLendingProtocolV1_2 enabled,
new Vaults are FixedPrecision, whose lending transactions are enabled
later in the stack. Run only the Vault-only cases under that feature
set; the LoanManage PR restores the rest.
2026-10-09 12:47:37 +02:00
Ayaz Salikhov
aa490df46b chore: Update clang-tidy image to v23 (#8536) 2026-10-09 10:19:07 +00:00
Jingchen
88c1f1e7ac feat: Integrate Permissioned Domain & Credential Checks for Lending Protocol (#6517)
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Co-authored-by: Vito <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-10-09 10:18:31 +00:00
JCW
a7bc9d890a Address PR comments 2026-10-09 10:18:58 +01:00
JCW
53c281d292 Address PR comments 2026-10-08 22:46:35 +01:00
JCW
291b9d3a28 Merge branch 'tapanito/sav-fixed-precision-loanmanage' into a1q123456/early-exit-fee 2026-10-08 16:33:25 +01:00
Vito
91836b41e8 Merge remote-tracking branch 'origin/tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage
# Conflicts:
#	src/test/app/invariants/InvariantsVault_test.cpp
2026-10-08 16:48:30 +02:00
Vito Tumas
189b9376ce Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-08 16:39:54 +02:00
Vito Tumas
919565be21 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-08 16:38:01 +02:00
Vito Tumas
d6de322a86 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-08 16:37:47 +02:00
Vito Tumas
313251bcb6 Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-08 16:35:49 +02:00
Vito
e7067d0cd6 fix: Restore NOLINT placement in VaultHelpers test
The previous clang-tidy pass split the initializer so the NOLINT no
longer covered the optional access, failing CI clang-tidy.
2026-10-08 15:25:20 +02:00
Vito Tumas
f9619235ec Merge branch 'develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-08 15:23:51 +02:00
Ayaz Salikhov
ede8af8191 refactor: Group binaries in subdirectories (#8535)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-10-08 12:34:06 +00:00
Vito
e56eedd808 chore: Apply clang-tidy fixes to Vault grid and balance tests 2026-10-08 14:10:28 +02:00
Vito
87e1568016 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-08 13:55:25 +02:00
Alex Kremer
3c24b605a1 chore: Split multiple-in-one into individual tests (#8025) 2026-10-08 09:57:38 +00:00
Alex Kremer
d343b542f1 refactor: Migrate handlers to rpc-spec (B) (#8484) 2026-10-07 13:46:37 +00:00
Ayaz Salikhov
7acd719bf7 build: Use images with Clang 23 except for clang-tidy (#8530) 2026-10-07 13:08:20 +00:00
Ayaz Salikhov
b4564d5301 chore: Update pre-commit hooks and image (#8528) 2026-10-07 10:59:37 +00:00
Vito
e624889f5d Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-07 11:02:28 +02:00
Vito
928ea60765 chore: Clarify LoanBroker cover deposit and clawback diagnostics
Fix the CoverDeposit comment on why the zero check covers
FixedPrecision, and log the error code when the cover clawback amount
cannot be determined, since it may now be tecPRECISION_LOSS.
2026-10-07 11:00:18 +02:00
Vito
00d154c62f test: Cover FixedPrecision Vault invariants without lending
Move the lending-free FixedPrecision rows of InvariantsVault into this
PR: the VaultCreate AssetsDeployed and YieldUnrealized rows, the XRP
AssetsDeployed rows, the YieldUnrealized rows and the AssetsAvailable
off-by-one row. They enable featureLendingProtocolV1_2 explicitly, since
testableAmendments() leaves it off until the LoanManage PR.
2026-10-07 11:00:16 +02:00
Vito
e1f18dea4a fix: Floor Vault credits in the requested rounding mode
Compute reference + raw under the caller's rounding mode in
creditToPosteriorScale, so the ambient mode cannot round the sum up
before the floor and credit more than raw.

Reject a negative YieldUnrealized with tefBAD_LEDGER like the other
Vault balances instead of clamping it to zero.

Add grid tests for the credit repro and isOnVaultBaseGrid, and fix the
amendment named for the 19-digit Number range.
2026-10-07 11:00:04 +02:00
Shawn Xie
60195e6d37 fix: Fix MPT partial payment overflow (#8302) 2026-10-06 23:16:13 +00:00
Ayaz Salikhov
3d526d456e build: Use LLVM 23 (#8522) 2026-10-06 21:19:57 +00:00
Denis Angell
f05c9f7913 refactor: Extract escrow lock helpers and paychan test helpers (#7882)
Co-authored-by: Mayukha Vadari <mvadari@ripple.com>
2026-10-06 19:58:52 +00:00
Harshit Gupta
c2a4bc3aa1 fix: Validate vetoed parameter type in feature RPC (#7583)
Co-authored-by: Mayukha Vadari <mvadari@ripple.com>
2026-10-06 19:44:56 +00:00
Mayukha Vadari
718185e3b2 refactor: Use CheckEntry everywhere (#8349) 2026-10-06 19:26:35 +00:00
Ayaz Salikhov
1d7783bb86 build: Make conan retry with Conan Center's source backups (#8524) 2026-10-06 19:23:38 +00:00
Mayukha Vadari
9fd2c552f5 refactor: Use AmendmentsEntry everywhere (#8368) 2026-10-06 17:59:44 +00:00
Ayaz Salikhov
70b8fd301b chore: Update docker images; link Conan-built tools with a static runtime (#8520) 2026-10-06 16:47:35 +00:00
Mayukha Vadari
e6564f553d refactor: Use NegativeUNLEntry everywhere (#8365) 2026-10-06 14:23:24 +00:00
Ayaz Salikhov
ed96e60ce3 build: Make clang-tools custom in Nix, to match what's being built (#8521) 2026-10-06 13:59:12 +00:00
Alex Kremer
2ebd745a1b refactor: Migrate handlers to rpc-spec (A) (#8345) 2026-10-06 13:19:20 +00:00
Mayukha Vadari
cfcbe45b60 test: Declare, not define, entry instantiations in SLEBase test (#8357) 2026-10-06 12:12:22 +00:00
yinyiqian1
9cbf78ba99 test: Add more tests for granular permissions (#8459)
Co-authored-by: Bart <bthomee@users.noreply.github.com>
2026-10-05 23:18:58 +00:00
Timur Yalymov
b8d8738f81 fix: Enforce that MPT issuance flags are never cleared (#8152) 2026-10-05 23:17:36 +00:00
Timur Yalymov
63c97e719f feat: Allow lending transactions in Batch (#8244)
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
2026-10-05 23:17:26 +00:00
Mayukha Vadari
3ac26f23c7 feat: Add full support for all objects in ledger_entry (#6319)
Co-authored-by: Timur Yalymov <36795566+tyalymov@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2026-10-05 23:17:14 +00:00
Bart
ff9410bc56 build: Define XRPL_ASAN, XRPL_TSAN, and XRPL_UBSAN compile definitions (#8483)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-10-05 23:15:08 +00:00
Vito
21d778849a Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-05 23:51:09 +02:00
Vito
e5e1fab26c refactor: Share Vault cash and dust-debit handling across transactors
Add adjustVaultCash, which applies a signed cash movement to a Vault of any version, and checkDebitNotDust, which rejects a dust outflow and maps Number overflow to tecPATH_DRY. VaultDeposit, VaultWithdraw and VaultClawback use them instead of repeating the version branch and the dust check. debitIsNonZeroDust now picks its reference balance from the Vault itself, replacing vaultDebitDustReference. No behavior change.
2026-10-05 23:50:52 +02:00
Mayukha Vadari
1798262d7a refactor: Use LedgerHashesEntry everywhere (#8369) 2026-10-05 18:15:02 +00:00
Mayukha Vadari
cd633b9ac9 refactor: Use EscrowEntry everywhere (#8354) 2026-10-05 17:51:18 +00:00
Ayaz Salikhov
5c5f7d315a chore: Update nix flake file (#8479) 2026-10-05 16:58:41 +00:00
Mayukha Vadari
0f7493ce50 refactor: Use FeeSettingsEntry everywhere (#8370) 2026-10-05 16:56:41 +00:00
Harshit Gupta
40f61f828a fix: Add string type validation for channel_id and signature (#7582) 2026-10-05 16:55:14 +00:00
Mayukha Vadari
108277f4b7 test: Migrate three beast suites from beast::unit_test to gtest (#7993) 2026-10-05 15:28:05 +00:00
Jingchen
b94b6cc605 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-05 09:58:53 +01:00
Jingchen
9fb3d78932 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-05 09:58:40 +01:00
Jingchen
4bff29e39b Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-05 09:58:31 +01:00
Jingchen
29ff8282ba Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-05 09:58:18 +01:00
Jingchen
af321df56e Merge branch 'tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-05 09:58:05 +01:00
Jingchen
d26e61b516 Merge branch 'develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-05 09:57:48 +01:00
Vito
1b864895f9 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-02 17:05:40 +02:00
Vito
f3ad8f8373 Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-02 17:05:34 +02:00
Vito
f75e317fe6 test: Reach the both-legs-zero close through the cover branch
CoverAvailable started at zero, so the dust fee was credited rather than floored and the test never took the path it names. Push CoverAvailable past 1e6 with a redirected service fee first, so its grid is 1e-9 and the dust fee floors to zero, then require CoverAvailable to stay unchanged. Also drop two comment paragraphs that described tests in another file.
2026-10-02 17:05:32 +02:00
Vito
0271003597 test: Drop the FixedPrecision LoanSet refusal test
LoanSet now supports FixedPrecision Vaults, so the temporary tecNO_PERMISSION gate and its test go away.
2026-10-02 17:05:22 +02:00
Vito
1dadfd7405 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-02 17:02:43 +02:00
Vito
5cd5241dee Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-02 17:02:36 +02:00
Vito
0b8336bde8 fix: Check a cover withdrawal's destination against the sent amount
On FixedPrecision Vaults LoanBrokerCoverWithdraw sends the amount rounded at the broker's posterior grid, but the third-party destination check used sfAmount. A request that rounds down could be refused even though the destination has room for the amount actually sent. Check roundedAmount, as VaultWithdraw does.
2026-10-02 17:02:29 +02:00
Vito
9f7993f7d0 Merge remote-tracking branch 'origin/tapanito/sav-fixed-precision-vault-rounding' into tapanito/sav-fixed-precision-vault-transactors 2026-10-02 17:01:48 +02:00
Vito
3a0b7b69da test: Cover the FixedPrecision LoanSet refusal
A valid LoanSet against a FixedPrecision Vault returns tecNO_PERMISSION until LoanSet supports these Vaults.
2026-10-02 17:01:46 +02:00
Vito
b712b95f2b fix: Keep the Vault side of default cover exact
Floor AssetsAvailable + cover at its posterior grid, so the Vault
gains exactly the cover. The LoanBroker absorbs the rounding:
CoverAvailable - cover rounds to nearest, as the broker
pseudo-account's trust line does, so CoverAvailable still equals the
pseudo-account balance.

When AssetsAvailable has digits finer than a 16-digit cover can carry,
no cover makes the sum exact, and the Vault rounds too, as VaultDeposit
and LoanPay credits do.

Add a test that coarsens CoverAvailable past 1e10 through the LoanPay
fee redirect and defaults a loan whose cover needs finer digits.
2026-10-02 16:44:19 +02:00
Vito
f93a25e0ff refactor: Round default cover once at the coarser posterior grid
Extract the FixedPrecision default cover into
LoanManage::calculateDefaultCover and round it once, toward zero, at
the coarser of the CoverAvailable and AssetsAvailable posterior grids.
CoverAvailable - cover stays exact; AssetsAvailable + cover may be
rounded by up to half a posterior ulp, since no single amount fits
both grids once they differ.

Drop the vaultAsset parameter from defaultLoan and the pre-write
guards that the capped cover and the LoanBroker invariant already
cover. Add gtests that sweep cover rounding across grids.
2026-10-02 15:11:44 +02:00
Vito
65c4bae372 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-02 13:36:51 +02:00
Vito
3127e2c9d3 test: Name magic values in the FixedPrecision LoanPay tests 2026-10-02 13:36:43 +02:00
Vito
afa0cc8c6c refactor: Drop redundant LoanPay asserts and field proxies
ValidVault already checks AssetsAvailable against AssetsTotal. Also drop the
payment-sum and rounding-mode asserts, the debug-only pseudo-account balance
checks, and a duplicate debug log, and read Vault and LoanBroker fields
directly instead of through proxies.
2026-10-02 13:36:43 +02:00
Vito
a680ec2581 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-02 12:25:14 +02:00
Vito
e5cc51096c Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-02 12:25:14 +02:00
Vito
052bfc7310 refactor: improve tests 2026-10-02 12:24:42 +02:00
Vito Tumas
565f3e2787 Merge branch 'develop' into tapanito/sav-fixed-precision-vault-rounding 2026-10-02 12:20:40 +02:00
Vito
5f964d74f9 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-02 12:02:00 +02:00
Vito
c905e3948f Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-02 12:02:00 +02:00
Vito
2930bab1c3 refactor: Reject origination on a coarsened Vault in LoanSet preclaim
Move the coarsened FixedPrecision Vault check from doApply to preclaim, read
the Vault version once, and move the DebtTotal rounding comment into
adjustBrokerDebtTotal.
2026-10-02 12:01:51 +02:00
Vito
244b132f8d Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-02 11:35:19 +02:00
Vito
e7b03d9b81 refactor: Pass the LoanBroker to adjustBrokerDebtTotal in LoanPay 2026-10-02 11:35:11 +02:00
Vito
06383eaeba Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-02 11:35:08 +02:00
Vito
21031eb05a refactor: Pass the LoanBroker to adjustBrokerDebtTotal in LoanSet 2026-10-02 11:34:58 +02:00
Vito
d8b3f54713 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-02 11:34:49 +02:00
Vito
69e5a8b92e refactor: Pass the LoanBroker to adjustBrokerDebtTotal
Take the LoanBroker SLE instead of a DebtTotal proxy, and pass the proxy only
to adjustImpreciseNumber. Move the definition out of the header.
2026-10-02 11:34:41 +02:00
Vito
4db0997329 test: Expect temDISABLED for closed-ended VaultCreate without V1_1
Closed-ended Vaults require LendingProtocolV1_1; V1_2 alone does not enable
them.
2026-10-02 11:05:32 +02:00
Vito
f2e5f58518 Merge branch 'tapanito/sav-fixed-precision-loanpay' into tapanito/sav-fixed-precision-loanmanage 2026-10-02 11:05:08 +02:00
Vito
c7fbe3aa9f Merge branch 'tapanito/sav-fixed-precision-loanset' into tapanito/sav-fixed-precision-loanpay 2026-10-02 11:05:07 +02:00
Vito
ef780fe257 Merge branch 'tapanito/sav-fixed-precision-loanbroker' into tapanito/sav-fixed-precision-loanset 2026-10-02 11:05:07 +02:00
Vito
bf906c52e8 Merge branch 'tapanito/sav-fixed-precision-vault-transactors' into tapanito/sav-fixed-precision-loanbroker 2026-10-02 11:05:07 +02:00
Vito
2fa2239cb2 fix: Check AssetsMaximum grid on every Vault under LendingProtocolV1_2
FixedPrecision now requires LendingProtocolV1_1, closed-ended creation stays
V1_1-only, and fixCleanup3_2_0 is no longer checked. VaultSet checks the cap
through the new checkAssetsMaximum helper, and VaultCreate checks it at the end
of preclaim. Add a test that an existing Vault with an off-grid cap can replace
it after V1_2.
2026-10-02 11:05:00 +02:00
Vito
a20b7d55f4 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage 2026-10-02 10:13:57 +02:00
Vito
c09725af11 Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay 2026-10-02 10:13:57 +02:00
Vito
5b273138f5 Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanset 2026-10-02 10:13:57 +02:00
Vito
f6290acf6d Merge tapanito/sav-fixed-precision-vault-transactors into tapanito/sav-fixed-precision-loanbroker 2026-10-02 10:13:56 +02:00
Vito
9b3512707b fix: Address review comments on the FixedPrecision Vault transactors
- Check for burning every share while AssetsDeployed is non-zero inside
  VaultClawback::assetsToClawback, after the clamp to AssetsAvailable.
- Gate VaultSet's AssetsMaximum representability check on
  featureLendingProtocolV1_2, so existing Vaults get the same check.
- Restore the LCOV exclusion on the VaultWithdraw clamp error return.
- Add a test for an unrepresentable AssetsMaximum on an existing Vault after
  V1_2 is enabled, and fix two comments.
2026-10-02 10:13:54 +02:00
Vito
8968c892bf test: Drop the fixCleanup3_1_3-disabled clawback run
fixCleanup3_1_3 is enabled on the network, so a FixedPrecision Vault never runs without it.
2026-10-02 10:10:01 +02:00
Vito
fd8af944f0 test: Address review comments on FixedPrecision LoanManage tests
- Default with two interest-bearing Loans removes only the defaulted Loan's
  scheduled interest from YieldUnrealized.
- Check the cover moved against the rate amount and the broker
  pseudo-account balance after a partial-cover default.
- ValidVault rejects a FixedPrecision Vault created with non-zero
  YieldUnrealized.
2026-10-02 09:49:54 +02:00
Vito
2517b5b983 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage 2026-10-02 09:49:52 +02:00
Vito
14039dce06 fix: Address review comments on FixedPrecision LoanPay
- Pass the exact principal + interest sum and the exact fee to the credit
  helpers, so nothing is rounded before the posterior sum is floored.
- Log the terminal zero-credit close at debug level.
- Move the vault-side coarsened-vault tests into their own
  VaultCoarsenedFixedPrecision suite.
2026-10-02 09:49:50 +02:00
Vito
b21b700951 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage 2026-10-02 09:30:01 +02:00
Vito
0d0260460b Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay 2026-10-02 09:28:44 +02:00
Vito
a335d6d9fc fix: Address review comments on FixedPrecision LoanSet
Reword the DebtTotal comment in LoanSet, and run the full-clawback test also without fixCleanup3_1_3.
2026-10-02 09:28:27 +02:00
Vito
2fbe48d2a6 Merge tapanito/sav-fixed-precision-vault-transactors into tapanito/sav-fixed-precision-loanbroker 2026-10-02 09:27:59 +02:00
Vito
49d3763295 Merge tapanito/sav-fixed-precision-vault-rounding into tapanito/sav-fixed-precision-vault-transactors 2026-10-02 09:27:59 +02:00
Vito
f307a9bccc Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanset 2026-10-02 09:27:59 +02:00
Vito
1f0915bd46 refactor: Assert the VaultVersion declaration order relied on by comparisons 2026-10-02 09:27:57 +02:00
Vito
e5fb5afa5e Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanset 2026-10-02 09:27:29 +02:00
Vito
af9a2efc18 fix: Address review comments on the FixedPrecision broker cover helpers
- Take the exact raw amount as a Number in creditToPosteriorBrokerCoverScale
  and getPosteriorBrokerCoverScale.
- checkOptionalBrokerCoverInflow checks the effective credit it is given
  instead of rounding it again as a standalone delta.
2026-10-02 09:27:27 +02:00
Vito
9fc908aa34 Merge tapanito/sav-fixed-precision-vault-transactors into tapanito/sav-fixed-precision-loanbroker 2026-10-02 09:26:34 +02:00
Vito
8098f6de1d fix: Require zero YieldUnrealized on FixedPrecision Vault creation
ValidVault now checks YieldUnrealized as well as AssetsDeployed when a
FixedPrecision Vault is created. Also correct the VaultClawback_test comment
about which Vault the pre-fixCleanup3_1_3 case needs.
2026-10-02 09:26:32 +02:00
Vito
1c8322853e Merge tapanito/sav-fixed-precision-vault-rounding into tapanito/sav-fixed-precision-vault-transactors 2026-10-02 09:25:47 +02:00
Vito
a5a112f646 fix: Address review comments on the FixedPrecision Vault helpers
- Keep the ToNearest guard through scale() in posteriorAssetScale, as the
  Legacy/CashBasis clamp did.
- Take the exact raw amount as a Number in the credit helpers, so the sum is
  floored before any 16-digit rounding of the raw amount.
- Reject a negative amount in checkOptionalVaultInflow at runtime too.
- Use one namespace detail block in VaultHelpers.h and VaultHelpers.cpp.
- Seed AssetsAvailable in the FixedPrecision VaultHelpers_test rows.
- Add gtests for creditToPosteriorAvailableScale.
2026-10-02 09:25:32 +02:00
Vito
624798f7b1 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage 2026-10-01 18:17:53 +02:00
Vito
e98f90d726 Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay 2026-10-01 18:17:53 +02:00
Vito
0a78cfb4d3 test: Drop the unused TxFlags.h include from LoanSetFixedPrecision_test 2026-10-01 18:17:51 +02:00
Vito
6ec28706f1 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage 2026-10-01 18:00:47 +02:00
Vito
1ed4c3855d test: Add the coarsened-vault origination test to the LoanPay suite 2026-10-01 18:00:45 +02:00
Vito
96c35383ac Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay 2026-10-01 18:00:23 +02:00
Vito
1b45e6bf76 test: Move the coarsened-vault origination test to the LoanPay suite
It coarsens the Vault with a late LoanPay, which needs FixedPrecision LoanPay.
2026-10-01 18:00:22 +02:00
Vito
84f5e205b1 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage (history only) 2026-10-01 17:47:41 +02:00
Vito
4e2dc7a63b Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay (history only) 2026-10-01 17:47:28 +02:00
Vito
7005ca4815 Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanset (history only) 2026-10-01 17:47:28 +02:00
Vito
734cd81190 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage 2026-10-01 17:47:28 +02:00
Vito
4fe4ac530a Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay 2026-10-01 17:47:09 +02:00
Vito
9083442c02 Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanset 2026-10-01 17:47:09 +02:00
Vito
425fec2f51 Merge tapanito/sav-fixed-precision-vault-transactors into tapanito/sav-fixed-precision-loanbroker 2026-10-01 17:47:08 +02:00
Vito
0ed495b92c Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanpay 2026-10-01 17:46:56 +02:00
Vito
c1ad8b5295 Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanset 2026-10-01 17:46:55 +02:00
Vito
cd396fce37 Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanbroker 2026-10-01 17:46:55 +02:00
Vito
6078cae6ad test: Build the Env features bitset from two features, not their bitwise OR
FeatureBitset{featureDynamicMPT | featureTokenEscrow} ORs the two IDs into an unregistered one. The test only reaches this line when testableAmendments() has an unsupported feature.
2026-10-01 17:46:53 +02:00
Vito
bf1f49940c Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage 2026-10-01 17:30:53 +02:00
Vito
2658200d13 test: Use CamelCase duration alias in LoanPay_test 2026-10-01 17:30:51 +02:00
Vito
086a0c1a35 fix: Mark assert-only locals maybe_unused in LoanManage 2026-10-01 17:11:27 +02:00
Vito
6fd5ece5c3 Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanset 2026-10-01 17:07:44 +02:00
Vito
69e45b901c Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay 2026-10-01 17:07:44 +02:00
Vito
69447e8519 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage 2026-10-01 17:07:44 +02:00
Vito
18e66bb98d test: Use snake_case gtest case names in LoanBrokerCoverTests 2026-10-01 17:07:42 +02:00
Vito
ed5ec1e554 Merge tapanito/sav-fixed-precision-vault-rounding into tapanito/sav-fixed-precision-vault-transactors 2026-10-01 17:07:42 +02:00
Vito
3728d76c68 Merge tapanito/sav-fixed-precision-vault-transactors into tapanito/sav-fixed-precision-loanbroker 2026-10-01 17:07:42 +02:00
Vito
301675ac13 test: Use snake_case gtest case names in VaultGridTests 2026-10-01 17:07:40 +02:00
Vito
0496a80094 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage 2026-10-01 17:01:45 +02:00
Vito
db8f6cf189 style: Fix clang-tidy findings in FixedPrecision headers 2026-10-01 17:01:44 +02:00
Vito
1b562f2c9f Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay 2026-10-01 17:01:42 +02:00
Vito
db79ce5d45 style: Fix clang-tidy findings in FixedPrecision headers 2026-10-01 17:01:40 +02:00
Vito
7a0229c9f5 Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanset 2026-10-01 17:01:38 +02:00
Vito
c29cbaec9d style: Fix clang-tidy findings in FixedPrecision headers 2026-10-01 17:01:37 +02:00
Vito
acdb754728 Merge tapanito/sav-fixed-precision-vault-transactors into tapanito/sav-fixed-precision-loanbroker 2026-10-01 17:01:35 +02:00
Vito
ade43a4b9e style: Fix clang-tidy findings in FixedPrecision headers 2026-10-01 17:01:33 +02:00
Vito
47294b5ae8 style: Fix clang-tidy findings in FixedPrecision headers 2026-10-01 17:01:30 +02:00
Vito
6775bacabe Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage
Brings in develop. Switch this PR's code to the SLE::ConstRef / SLE::Ref aliases and gtest naming introduced on develop.
2026-10-01 16:59:59 +02:00
Vito
9b79472c53 Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay
Brings in develop. Switch this PR's code to the SLE::ConstRef / SLE::Ref aliases and gtest naming introduced on develop.
2026-10-01 16:59:57 +02:00
Vito
1ebe5078fa Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanset
Brings in develop. Switch this PR's code to the SLE::ConstRef / SLE::Ref aliases and gtest naming introduced on develop.
2026-10-01 16:59:54 +02:00
Vito
f0eacbad31 Merge tapanito/sav-fixed-precision-vault-transactors into tapanito/sav-fixed-precision-loanbroker
Brings in develop. Switch this PR's code to the SLE::ConstRef / SLE::Ref aliases and gtest naming introduced on develop.
2026-10-01 16:59:52 +02:00
Vito
7450b3d299 Merge tapanito/sav-fixed-precision-vault-rounding into tapanito/sav-fixed-precision-vault-transactors
Brings in develop. Switch this PR's code to the SLE::ConstRef / SLE::Ref aliases and gtest naming introduced on develop.
2026-10-01 16:59:15 +02:00
Vito
4a5257443c Merge develop into tapanito/sav-fixed-precision-vault-rounding
Resolve the VaultHelpers.cpp conflict and switch the FixedPrecision code to the SLE::ConstRef / SLE::Ref aliases and gtest naming introduced on develop.
2026-10-01 16:58:37 +02:00
Vito
bba00533c9 Merge tapanito/sav-fixed-precision-loanpay into tapanito/sav-fixed-precision-loanmanage (stack history only, tree unchanged) 2026-10-01 16:56:11 +02:00
Vito
5416782cc9 Merge tapanito/sav-fixed-precision-loanset into tapanito/sav-fixed-precision-loanpay (stack history only, tree unchanged) 2026-10-01 16:56:11 +02:00
Vito
6d54abf904 Merge tapanito/sav-fixed-precision-loanbroker into tapanito/sav-fixed-precision-loanset (stack history only, tree unchanged) 2026-10-01 16:56:11 +02:00
Vito
c32202999a Merge tapanito/sav-fixed-precision-vault-transactors into tapanito/sav-fixed-precision-loanbroker (stack history only, tree unchanged) 2026-10-01 16:56:10 +02:00
Vito
7a38dd8869 Merge tapanito/sav-fixed-precision-vault-rounding into tapanito/sav-fixed-precision-vault-transactors (stack history only, tree unchanged) 2026-10-01 16:56:10 +02:00
Vito
9161ddbc6d refactor: Reuse fix340Enabled in VaultClawback::assetsToClawback 2026-10-01 16:50:52 +02:00
Vito
56d1d59586 refactor: Reuse fix340Enabled in VaultClawback::assetsToClawback 2026-10-01 16:50:52 +02:00
Vito
6a5b12bc2d refactor: Reuse fix340Enabled in VaultClawback::assetsToClawback 2026-10-01 16:50:52 +02:00
Vito
92726e1b10 refactor: Reuse fix340Enabled in VaultClawback::assetsToClawback 2026-10-01 16:50:52 +02:00
Vito
5ec8f37bb7 refactor: Reuse fix340Enabled in VaultClawback::assetsToClawback 2026-10-01 16:50:50 +02:00
Vito
1da9ca310a docs: Clarify the FixedPrecision live exponent in getVaultScale 2026-10-01 16:49:59 +02:00
Vito
3be766c2b6 docs: Clarify the FixedPrecision live exponent in getVaultScale 2026-10-01 16:49:59 +02:00
Vito
a60b5596fe docs: Clarify the FixedPrecision live exponent in getVaultScale 2026-10-01 16:49:58 +02:00
Vito
a58a692383 docs: Clarify the FixedPrecision live exponent in getVaultScale 2026-10-01 16:49:58 +02:00
Vito
533dfdddbd docs: Clarify the FixedPrecision live exponent in getVaultScale 2026-10-01 16:49:58 +02:00
Vito
a5bf7c08fd docs: Clarify the FixedPrecision live exponent in getVaultScale 2026-10-01 16:49:56 +02:00
Vito
57562b4768 feat: Book FixedPrecision LoanManage default and impairment
Default, impair and unimpair on a FixedPrecision Vault go through
adjustVaultBalances. Removes the temporary LoanManage guard and the
temporary featureLendingProtocolV1_2 exclusion from testableAmendments().
2026-10-01 16:43:32 +02:00
Vito
3d1d9d707a feat: Book FixedPrecision LoanPay through AssetsDeployed
LoanPay on a FixedPrecision Vault floors the Vault credit on the posterior
AssetsAvailable grid and reduces AssetsDeployed by the principal paid. A
terminal payment with no representable credit closes the Loan. Removes
the temporary LoanPay guard.
2026-10-01 16:43:22 +02:00
Vito
25cb86143a feat: Use FixedPrecision accounting in Vault transactors
VaultCreate creates FixedPrecision Vaults under featureLendingProtocolV1_2.
Vault deposit, withdraw, clawback, set and delete use adjustVaultBalances
and the AssetsAvailable grid, and ValidVault checks the FixedPrecision
balance identities.

Until the lending PRs land, LoanSet, LoanPay and LoanManage return
tecNO_PERMISSION for FixedPrecision Vaults, and jtx::testableAmendments()
excludes featureLendingProtocolV1_2.
2026-10-01 16:43:13 +02:00
Vito
b32aca2e59 feat: Book FixedPrecision LoanSet through AssetsDeployed
LoanSet on a FixedPrecision Vault moves principal from AssetsAvailable to
AssetsDeployed and books scheduled interest in YieldUnrealized. Origination
is refused on a coarsened Vault or outside the Open zone. Removes the
temporary LoanSet guard.
2026-10-01 16:41:54 +02:00
Vito
01ab57caee feat: Round LoanBroker cover on the FixedPrecision grid
LoanBroker cover deposit, withdraw and clawback round on the posterior
CoverAvailable grid for brokers on FixedPrecision Vaults, and LoanBrokerSet
rejects a DebtMaximum that is not on the Vault grid.
2026-10-01 16:41:48 +02:00
Vito
bd31dbcc48 feat: Add FixedPrecision Vault grid and balance helpers
Add VaultVersion::FixedPrecision, the YieldUnrealized and AssetsDeployed
Vault fields, and the VaultHelpers grid and balance helpers used by
FixedPrecision Vaults. VaultCreate does not create FixedPrecision Vaults
yet, so no transaction behaviour changes.
2026-10-01 16:41:23 +02:00
JCW
cf714bbe1f Add tests 2026-09-29 17:03:39 +01:00
JCW
d7e23b425d Fix clang-tidy errors 2026-09-28 15:32:29 +01:00
JCW
928c05e7e6 Codegen 2026-09-28 15:23:29 +01:00
JCW
5b5d4c2bdb Implemented the spec 2026-09-28 15:02:37 +01:00
Vito
294b127425 docs: Clarify LoanPay zero-credit precision-loss logging
Record principal, interest, and vault credit when AssetsAvailable does not move, and note the coarsened-AssetsAvailable path that can still reach that branch.
2026-09-24 10:36:01 +02:00
Vito
20f206e024 test: Share FixedPrecision LoanPay IOU fixture setup
Collapse the repeated issuer/lender/borrower Env construction in the FixedPrecision cases onto one local helper.
2026-09-24 10:26:43 +02:00
Vito
19519c6b19 refactor: Extract FixedPrecision LoanPay deltas and tighten coverage
Move interest-first AssetsTotal, DebtTotal, and vault-credit rounding into fixed_precision::loanPaymentDeltas, warn before clamping YieldUnrealized, and cover management fees plus early full payoff.
2026-09-23 18:04:05 +02:00
Vito
4e83215457 feat: Apply FixedPrecision interest-first accounting to LoanPay
Record paid interest in AssetsTotal under explicit downward rounding, then credit AssetsAvailable with principal plus recorded interest at its posterior scale. Keep FixedPrecision DebtTotal exact, update YieldUnrealized from scheduled interest, and round redirected broker fees at the posterior cover scale.
2026-09-23 17:00:22 +02:00
Vito
5157a2866b feat: Apply FixedPrecision Open-zone admission to LoanSet
Origination on LEVersion 2 vaults uses the vault base scale, rejects coarsened vaults and InterestDue that would leave the Open zone, and books accepted InterestDue into YieldUnrealized.
2026-09-22 16:37:54 +02:00
Vito
663229cfdf fix: Rename LendingHelpers' liveScale to avoid unity-build clash
VaultHelpers.cpp defines its own file-local liveScale with the same
signature. Under -Dunity=ON the ledger module batches sources in
groups of 15, so the two anonymous-namespace helpers can land in the
same translation unit and collide.
2026-09-22 16:30:59 +02:00
Vito
89028a2ec6 style: Fix clang-tidy include-cleaner, braces, and return-move warnings 2026-09-22 15:48:40 +02:00
Vito
bb820683cb feat: Apply FixedPrecision cover grid to LoanBroker first-loss capital
Cover deposit, withdraw, and clawback round at the posterior CoverAvailable exponent so optional inflows cannot coarsen past the Open zone, while outflows may re-fine. DebtMaximum and minimum cover use the vault base scale, and FixedPrecision withdraw/clawback skip the live-scale canApplyToBrokerCover guard that would reject a valid re-fine.
2026-09-22 15:48:40 +02:00
Vito
5e0e36f87d Apply FixedPrecision rounding clamp to Deposit/Withdraw/Clawback; fix vault gate/test gaps
VaultDeposit/VaultWithdraw/VaultClawback now apply the fixCleanup3_4_0
posterior-scale rounding clamp unconditionally for FixedPrecision vaults,
not only when fix340Enabled. VaultCreate's featureLendingProtocolV1_1 gate
check now also accepts V1_2, matching the "V1.2 implies V1.1" semantics
already encoded in doApply.

Test changes:
- VaultHelpers_test: add a FixedPrecision-tagged clamp table to
  clampToAssetsTotalScale coverage; previously only Legacy/CashBasis was
  exercised.
- VaultClosedEnded_test: fix the closed-ended gate test, which asserted
  temDISABLED after subtracting only V1_1 even though V1_2 alone already
  satisfies the gate; add a case proving V1_2-only still opens it.
- VaultFixedPrecision_test: dedupe repeated scaled-vault setup into a
  shared helper.
- VaultTestBase: keep V1_2 excluded from all_ with a comment explaining
  why VaultBugs_test's precision-boundary scenarios are structurally
  unreachable under FixedPrecision's Open-zone cap, not just deferred.
2026-09-22 15:39:12 +02:00
Vito
9ae863d89e docs: Clarify LEVersion and deprecate kVaultMaximumIouScale.
Split the pre-V1.2 Scale cap to kVaultMaximumLegacyIouScale so the old name can warn without breaking V1.2 call sites.
2026-09-22 13:41:10 +02:00
Vito
b17c737e74 Merge remote-tracking branch 'origin/develop' into tapanito/sav-fixed-precision-vault-rounding 2026-09-22 12:41:17 +02:00
Vito
71d271ebed feat: Add FixedPrecision vault scale helpers and Open-zone deposit checks
New vaults created under V1.2 stay on a lifetime base grid so optional inflows cannot coarsen AssetsTotal, while pre-V1.2 vaults keep the dynamic scale they were created with.
2026-09-22 11:58:18 +02:00
862 changed files with 61758 additions and 25478 deletions

View File

@@ -5,7 +5,10 @@ Checks: "-*,
-bugprone-exception-escape,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions,
-bugprone-signed-bitwise,
-bugprone-std-exception-baseclass,
-bugprone-throwing-static-initialization,
-bugprone-unhandled-code-paths,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
@@ -14,6 +17,7 @@ Checks: "-*,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-explicit-constructor,
-cppcoreguidelines-interfaces-global-init,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-missing-std-forward,
@@ -32,6 +36,7 @@ Checks: "-*,
llvm-namespace-comment,
misc-*,
-misc-explicit-constructor,
-misc-multiple-inheritance,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
@@ -45,6 +50,8 @@ Checks: "-*,
-modernize-avoid-c-style-cast,
-modernize-return-braced-init-list,
-modernize-use-integer-sign-comparison,
-modernize-use-string-view,
-modernize-use-structured-binding,
-modernize-use-trailing-return-type,
performance-*,
@@ -53,6 +60,7 @@ Checks: "-*,
-performance-noexcept-move-constructor,
-performance-unnecessary-copy-initialization,
-performance-unnecessary-value-param,
-performance-use-std-move,
readability-*,
-readability-avoid-const-params-in-decls,
@@ -65,7 +73,10 @@ Checks: "-*,
-readability-named-parameter,
-readability-qualified-auto,
-readability-redundant-access-specifiers,
-readability-redundant-nested-if,
-readability-redundant-qualified-alias,
-readability-static-accessed-through-instance,
-readability-trivial-switch,
-readability-uppercase-literal-suffix
"
# ---

View File

@@ -103,6 +103,7 @@ words:
- dearmor
- decryptor
- dedented
- dedup
- deleteme
- demultiplexer
- deserializaton
@@ -344,6 +345,7 @@ words:
- unambiguity
- unauthorizes
- unauthorizing
- undeserializable
- unergonomic
- unfetched
- unfindable

View File

@@ -108,3 +108,75 @@ endfunction()
function(patch_nix_binary target)
endfunction()
function(rpcspec_generate_instantiations)
set(options)
set(oneValueArgs OUT_VAR VALUE_TYPE VIEW_HEADER INCLUDE_DIR)
set(multiValueArgs HANDLERS)
cmake_parse_arguments(
THIS_FUNCTION_PREFIX
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN}
)
endfunction()
function(corrosion_import_crate)
set(options
ALL_FEATURES
NO_DEFAULT_FEATURES
NO_STD
NO_LINKER_OVERRIDE
NO_USES_TERMINAL
LOCKED
FROZEN
)
set(oneValueArgs MANIFEST_PATH PROFILE IMPORTED_CRATES)
set(multiValueArgs
CRATE_TYPES
CRATES
FEATURES
FLAGS
OVERRIDE_CRATE_TYPE
)
cmake_parse_arguments(
THIS_FUNCTION_PREFIX
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN}
)
endfunction()
function(corrosion_set_env_vars target_name env_var)
endfunction()
function(corrosion_add_cxxbridge cxx_target)
set(options)
set(oneValueArgs CRATE)
set(multiValueArgs FILES)
cmake_parse_arguments(
THIS_FUNCTION_PREFIX
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN}
)
endfunction()
function(_unlink_libgcc_s crate)
endfunction()
function(add_xrpl_crate name)
set(options)
set(oneValueArgs CRATE)
set(multiValueArgs FILES)
cmake_parse_arguments(
THIS_FUNCTION_PREFIX
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${ARGN}
)
endfunction()

View File

@@ -15,9 +15,9 @@ inputs:
required: false
default: "false"
log_verbosity:
description: "The logging verbosity."
description: 'The logging verbosity ("quiet", "verbose"), or empty to use the Conan defaults.'
required: false
default: "verbose"
default: ""
sanitizers:
description: "The sanitizers to enable."
required: false
@@ -35,6 +35,16 @@ runs:
LOG_VERBOSITY: ${{ inputs.log_verbosity }}
SANITIZERS: ${{ inputs.sanitizers }}
run: |
# By default, leave the verbosity unset, so CMake configure output is
# shown, but compile commands and Boost's b2 debug output (~85k lines
# when "verbose") are not.
VERBOSITY_ARGS=()
if [[ -n "${LOG_VERBOSITY}" ]]; then
VERBOSITY_ARGS=(
--conf:all tools.build:verbosity="${LOG_VERBOSITY}"
--conf:all tools.compilation:verbosity="${LOG_VERBOSITY}"
)
fi
conan install \
--profile:all ci \
--build="${BUILD_OPTION}" \
@@ -42,6 +52,13 @@ runs:
--options:host='&:xrpld=True' \
--settings:all build_type="${BUILD_TYPE}" \
--conf:all tools.build:jobs=${BUILD_NPROC} \
--conf:all tools.build:verbosity="${LOG_VERBOSITY}" \
--conf:all tools.compilation:verbosity="${LOG_VERBOSITY}" \
.
"${VERBOSITY_ARGS[@]}" \
--format=json \
. >"${RUNNER_TEMP}/conan-graph.json"
# Tools that run during the build may only load glibc from the Nix store,
# as their package ID survives a GCC runtime update.
- name: Check build-context packages for Nix store dependencies (Linux)
if: ${{ runner.os == 'Linux' }}
shell: bash
run: ./bin/nix/check-build-context-runtime.sh "${RUNNER_TEMP}/conan-graph.json"

View File

@@ -36,3 +36,18 @@ updates:
rust-dependencies:
patterns:
- "*"
- package-ecosystem: uv
directory: /cmake/scripts/codegen
schedule:
interval: weekly
day: monday
time: "04:00"
timezone: Etc/GMT
commit-message:
prefix: "chore: [DEPENDABOT] "
target-branch: develop
groups:
codegen-dependencies:
patterns:
- "*"

View File

@@ -62,6 +62,7 @@ libxrpl.tx > xrpl.protocol
libxrpl.tx > xrpl.server
libxrpl.tx > xrpl.tx
test.app > test.jtx
test.app > tests.libxrpl
test.app > test.unit_test
test.app > xrpl.basics
test.app > xrpl.config

View File

@@ -1,5 +1,5 @@
{
"image_tag": "sha-060957e",
"image_tag": "sha-3d526d4",
"configs": {
"ubuntu": [
{
@@ -74,7 +74,7 @@
"extra_cmake_args": "-Dvalidator_keys=ON",
"package": {
"type": "deb",
"image": "ghcr.io/xrplf/xrpld/packaging-debian:sha-3a2d19f"
"image": "ghcr.io/xrplf/xrpld/packaging-debian:sha-e6055dd"
}
},
{
@@ -86,7 +86,7 @@
"extra_cmake_args": "-Dvalidator_keys=ON -Dassert=ON",
"package": {
"type": "deb",
"image": "ghcr.io/xrplf/xrpld/packaging-debian:sha-3a2d19f",
"image": "ghcr.io/xrplf/xrpld/packaging-debian:sha-e6055dd",
"variant": "assert"
}
}
@@ -101,7 +101,7 @@
"extra_cmake_args": "-Dvalidator_keys=ON",
"package": {
"type": "rpm",
"image": "ghcr.io/xrplf/xrpld/packaging-rhel:sha-3a2d19f"
"image": "ghcr.io/xrplf/xrpld/packaging-rhel:sha-e6055dd"
}
}
]

View File

@@ -12,8 +12,7 @@ on:
- "!nix/docker/README.md"
- "!nix/devshell.nix"
- "!nix/check-tools/**"
- "bin/default-loader-path.sh"
- "bin/install-sanitizer-libs.sh"
- "bin/nix/default-loader-path.sh"
pull_request:
paths:
- ".github/workflows/build-nix-images.yml"
@@ -25,8 +24,8 @@ on:
- "!nix/devshell.nix"
- "!nix/check-tools/**"
- "bin/check-tools.sh"
- "bin/default-loader-path.sh"
- "bin/install-sanitizer-libs.sh"
- "bin/nix/default-loader-path.sh"
- "bin/install/sanitizer-libs.sh"
workflow_dispatch:
concurrency:

View File

@@ -5,13 +5,12 @@ on:
branches:
- develop
paths:
- ".github/workflows/build-packaging-images.yml"
- "bin/install-packaging-tools.sh"
- "bin/install/packaging-tools.sh"
- "package/images/packaging/**"
pull_request:
paths:
- ".github/workflows/build-packaging-images.yml"
- "bin/install-packaging-tools.sh"
- "bin/install/packaging-tools.sh"
- "package/images/packaging/**"
workflow_dispatch:

View File

@@ -5,7 +5,6 @@ on:
branches:
- develop
paths:
- ".github/workflows/build-pre-commit-image.yml"
- "bin/pre-commit/Dockerfile"
- "rust-toolchain.toml"
pull_request:

View File

@@ -34,7 +34,7 @@ permissions:
jobs:
audit:
runs-on: ubuntu-latest
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-060957e
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-3d526d4
permissions:
contents: read
# Needed to open an issue on scheduled failures.
@@ -66,7 +66,7 @@ jobs:
- name: Create issue
if: ${{ steps.audit.outcome != 'success' && github.event_name == 'schedule' }}
uses: XRPLF/actions/create-issue@2b8bc36af85b88bca0dd7bfac2e2dc05f94ad712
uses: XRPLF/actions/create-issue@b489c21d53928f7dab4874912fec40e4f6c9e85e
with:
title: "cargo audit found vulnerabilities"
body_file: /tmp/cargo-audit-issue.md

View File

@@ -53,7 +53,7 @@ jobs:
- name: Create issue
if: ${{ failure() && github.event_name == 'schedule' && github.repository == 'XRPLF/rippled' }}
uses: XRPLF/actions/create-issue@2b8bc36af85b88bca0dd7bfac2e2dc05f94ad712
uses: XRPLF/actions/create-issue@b489c21d53928f7dab4874912fec40e4f6c9e85e
with:
title: "Releases not merged back into develop"
body_file: ${{ env.ISSUE_FILE }}

View File

@@ -79,7 +79,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@b3e255d74d785d053e4903da8ac90983cd7d9e82
uses: XRPLF/actions/prepare-runner@8e98d61f011fd2a67f3fde5f0f075662c099a527
with:
enable_ccache: false
@@ -108,7 +108,7 @@ jobs:
- name: Upload regenerated snapshot
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: check-tools-${{ runner.os }}-${{ runner.arch }}
path: ${{ matrix.snapshot }}

View File

@@ -93,9 +93,8 @@ jobs:
.github/workflows/reusable-upload-recipe.yml
.clang-tidy
.codecov.yml
bin/check-nix-store-refs.sh
bin/check-tools.sh
bin/default-loader-path.sh
bin/nix/**
cfg/**
cmake/**
conan/**

View File

@@ -31,9 +31,8 @@ on:
- ".github/workflows/reusable-upload-recipe.yml"
- ".clang-tidy"
- ".codecov.yml"
- "bin/check-nix-store-refs.sh"
- "bin/check-tools.sh"
- "bin/default-loader-path.sh"
- "bin/nix/**"
- "cfg/**"
- "cmake/**"
- "conan/**"

View File

@@ -14,7 +14,7 @@ on:
jobs:
# Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks.
run-hooks:
uses: XRPLF/actions/.github/workflows/pre-commit.yml@279ec358f4a1be4088be3e024b07916fa97c75b6
uses: XRPLF/actions/.github/workflows/pre-commit.yml@d7f2acb47d9662e1e2f8b1f5feffa6d21cc3290a
with:
runs_on: ubuntu-latest
container: '{ "image": "ghcr.io/xrplf/xrpld/pre-commit:sha-473fe44" }'
container: '{ "image": "ghcr.io/xrplf/xrpld/pre-commit:sha-70b8fd3" }'

View File

@@ -41,13 +41,13 @@ env:
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-060957e
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-3d526d4
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@b3e255d74d785d053e4903da8ac90983cd7d9e82
uses: XRPLF/actions/prepare-runner@8e98d61f011fd2a67f3fde5f0f075662c099a527
with:
enable_ccache: false

View File

@@ -129,7 +129,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@b3e255d74d785d053e4903da8ac90983cd7d9e82
uses: XRPLF/actions/prepare-runner@8e98d61f011fd2a67f3fde5f0f075662c099a527
with:
enable_ccache: ${{ inputs.ccache_enabled }}
@@ -186,9 +186,6 @@ jobs:
with:
build_nproc: ${{ steps.nproc.outputs.nproc }}
build_type: ${{ inputs.build_type }}
# Set the verbosity to "quiet" for Windows to avoid an excessive
# amount of logs. For other OSes, the "verbose" logs are more useful.
log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
sanitizers: ${{ inputs.sanitizers }}
- name: Configure CMake
@@ -257,20 +254,20 @@ jobs:
# cache included, since what it holds is what gets uploaded and reused.
- name: Check the build output for Nix store references (Nix toolchain)
if: ${{ inputs.toolchain == 'nix' }}
run: ./bin/check-nix-store-refs.sh "${BUILD_DIR}"
run: ./bin/nix/check-nix-store-refs.sh "${BUILD_DIR}"
- name: Check the Conan cache for Nix store references (Nix toolchain)
if: ${{ inputs.toolchain == 'nix' }}
run: ./bin/check-nix-store-refs.sh "${CONAN_HOME}"
run: ./bin/nix/check-nix-store-refs.sh "${CONAN_HOME}"
# Only what PatchNixBinary.cmake retargets: the toolchain in the Linux
# images always references the store. Same condition it uses.
- name: Check for Nix store references (Linux)
if: ${{ runner.os == 'Linux' && env.SANITIZERS_ENABLED == 'false' }}
run: |
./bin/check-nix-store-refs.sh "${BUILD_DIR}/xrpld"
./bin/check-nix-store-refs.sh "${BUILD_DIR}/xrpl_tests"
./bin/check-nix-store-refs.sh "${BUILD_DIR}/xrpld_tests"
./bin/nix/check-nix-store-refs.sh "${BUILD_DIR}/xrpld"
./bin/nix/check-nix-store-refs.sh "${BUILD_DIR}/xrpl_tests"
./bin/nix/check-nix-store-refs.sh "${BUILD_DIR}/xrpld_tests"
- name: Show ccache statistics
if: ${{ inputs.ccache_enabled }}
@@ -283,7 +280,7 @@ jobs:
- name: Upload the binary (Linux)
if: ${{ env.PACKAGING_ARTIFACTS_ENABLED == 'true' && runner.os == 'Linux' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: xrpld-${{ inputs.config_name }}
path: ${{ env.BUILD_DIR }}/xrpld
@@ -297,7 +294,7 @@ jobs:
- name: Upload the validator-keys binary
if: ${{ env.PACKAGING_ARTIFACTS_ENABLED == 'true' && env.VALIDATOR_KEYS_ENABLED == 'true' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: validator-keys-${{ inputs.config_name }}
path: |
@@ -308,7 +305,7 @@ jobs:
- name: Upload the test binary (Linux)
if: ${{ github.event.repository.visibility == 'public' && runner.os == 'Linux' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: xrpl_tests-${{ inputs.config_name }}
path: ${{ env.BUILD_DIR }}/xrpl_tests
@@ -324,7 +321,7 @@ jobs:
- name: Upload server definitions
if: ${{ github.event.repository.visibility == 'public' && inputs.config_name == 'ubuntu-gcc-debug-amd64-coverage' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: server-definitions
path: ${{ env.BUILD_DIR }}/server_definitions.json

View File

@@ -34,7 +34,7 @@ jobs:
needs: [determine-files]
if: ${{ needs.determine-files.outputs.cpp_changed_files != '' || needs.determine-files.outputs.need_full_run == 'true' }}
runs-on: ["self-hosted", "Linux", "X64", "heavy"]
container: "ghcr.io/xrplf/xrpld/nix-debian:sha-060957e"
container: "ghcr.io/xrplf/xrpld/nix-debian:sha-3d526d4"
permissions:
contents: read
issues: write
@@ -43,7 +43,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@b3e255d74d785d053e4903da8ac90983cd7d9e82
uses: XRPLF/actions/prepare-runner@8e98d61f011fd2a67f3fde5f0f075662c099a527
with:
enable_ccache: false
@@ -73,7 +73,6 @@ jobs:
with:
build_nproc: ${{ steps.nproc.outputs.nproc }}
build_type: ${{ env.BUILD_TYPE }}
log_verbosity: verbose
- name: Configure CMake
working-directory: ${{ env.BUILD_DIR }}
@@ -110,7 +109,7 @@ jobs:
- name: Upload clang-tidy output
if: ${{ github.event.repository.visibility == 'public' && steps.run_clang_tidy.outcome != 'success' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
path: ${{ env.OUTPUT_FILE }}
archive: false
@@ -124,17 +123,23 @@ jobs:
- name: Fix style
if: ${{ steps.files_changed.outcome != 'success' }}
# pre-commit installs every hook's environment, even for hooks that match
# no files, and node-based hooks need libatomic, which this image lacks.
# Exit code 1 just means hooks modified files or found issues.
env:
SKIP: prettier,cspell
run: |
pre-commit run --all-files || true
git add --update
pre-commit run || [ $? -eq 1 ]
- name: Generate git diff
if: ${{ steps.files_changed.outcome != 'success' }}
run: |
git diff | tee "${DIFF_FILE}"
git diff HEAD | tee "${DIFF_FILE}"
- name: Upload clang-tidy diff output
if: ${{ github.event.repository.visibility == 'public' && steps.files_changed.outcome != 'success' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
path: ${{ env.DIFF_FILE }}
archive: false
@@ -186,7 +191,7 @@ jobs:
- name: Create issue
if: ${{ steps.run_clang_tidy.outcome != 'success' && inputs.create_issue_on_failure }}
uses: XRPLF/actions/create-issue@2b8bc36af85b88bca0dd7bfac2e2dc05f94ad712
uses: XRPLF/actions/create-issue@b489c21d53928f7dab4874912fec40e4f6c9e85e
with:
title: "Clang-tidy check failed"
body_file: ${{ env.ISSUE_FILE }}

View File

@@ -44,7 +44,7 @@ jobs:
# Every package lands in one directory; the step below picks its own,
# which keeps this independent of the artifact names.
- name: Download package artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: "*-pkg"
merge-multiple: true
@@ -95,11 +95,15 @@ jobs:
apt-get update -qq
apt-get install -y "./${PACKAGE}"
# Rocky Linux and AlmaLinux pick a mirror from a mirrorlist, and now and
# then get one that serves the repository metadata at a few hundred kB/s,
# which alone outlasts the job's timeout. dnf only abandons a mirror below
# 1000 B/s for 30 s, so raise that floor to fail over to the next one fast.
- name: Install the RPM
if: ${{ inputs.package_type == 'rpm' }}
env:
PACKAGE: ${{ steps.find.outputs.package }}
run: dnf install -y "./${PACKAGE}"
run: dnf install -y --setopt=minrate=1M --setopt=timeout=10 "./${PACKAGE}"
- name: Run xrpld
run: xrpld --version

View File

@@ -100,18 +100,18 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@b3e255d74d785d053e4903da8ac90983cd7d9e82
uses: XRPLF/actions/prepare-runner@8e98d61f011fd2a67f3fde5f0f075662c099a527
with:
enable_ccache: false
- name: Download pre-built xrpld binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ matrix.xrpld_artifact_name }}
path: ${{ env.BUILD_DIR }}
- name: Download pre-built validator-keys binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ matrix.validator_keys_artifact_name }}
path: ${{ env.BUILD_DIR }}
@@ -151,7 +151,7 @@ jobs:
# version starts with a digit and a longer name does not, so that one digit
# is what tells 'xrpld-3.4.1-...' from 'xrpld-assert-3.4.1-...'.
- name: Upload package artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ matrix.xrpld_artifact_name }}-pkg
path: |
@@ -160,7 +160,7 @@ jobs:
if-no-files-found: error
- name: Upload debug symbol artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ matrix.xrpld_artifact_name }}-pkg-debug
path: |
@@ -225,13 +225,13 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@b3e255d74d785d053e4903da8ac90983cd7d9e82
uses: XRPLF/actions/prepare-runner@8e98d61f011fd2a67f3fde5f0f075662c099a527
with:
enable_ccache: false
# Both artifacts, so the debug symbols are published alongside the package.
- name: Download package artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: ${{ matrix.xrpld_artifact_name }}-pkg*
merge-multiple: true
@@ -287,7 +287,7 @@ jobs:
run: echo "PUSH=${PUSH}" | tee -a "${GITHUB_ENV}"
- name: Download package artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: "*-pkg"
merge-multiple: true
@@ -295,7 +295,7 @@ jobs:
- name: Download voidstar binary
if: ${{ matrix.target == 'voidstar' }}
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: xrpld-ubuntu-clang-debug-amd64-voidstar
path: ${{ env.CONTEXT }}

View File

@@ -28,7 +28,7 @@ permissions:
jobs:
clippy:
runs-on: ubuntu-latest
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-060957e
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-3d526d4
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -41,7 +41,7 @@ jobs:
coverage:
runs-on: ubuntu-latest
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-060957e
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-3d526d4
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -70,7 +70,7 @@ jobs:
doc:
runs-on: ubuntu-latest
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-060957e
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-3d526d4
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

View File

@@ -40,7 +40,7 @@ defaults:
jobs:
upload:
runs-on: ubuntu-latest
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-060957e
container: ghcr.io/xrplf/xrpld/nix-ubuntu:sha-3d526d4
env:
REMOTE_NAME: ${{ inputs.remote_name }}
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.remote_username }}
@@ -50,7 +50,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@b3e255d74d785d053e4903da8ac90983cd7d9e82
uses: XRPLF/actions/prepare-runner@8e98d61f011fd2a67f3fde5f0f075662c099a527
with:
enable_ccache: false

View File

@@ -68,7 +68,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@b3e255d74d785d053e4903da8ac90983cd7d9e82
uses: XRPLF/actions/prepare-runner@8e98d61f011fd2a67f3fde5f0f075662c099a527
with:
enable_ccache: false
@@ -108,14 +108,11 @@ jobs:
build_nproc: ${{ steps.nproc.outputs.nproc }}
build_type: ${{ matrix.build_type }}
force_build: ${{ github.event_name == 'schedule' || github.event.inputs.force_source_build == 'true' }}
# Set the verbosity to "quiet" for Windows to avoid an excessive
# amount of logs. For other OSes, the "verbose" logs are more useful.
log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
sanitizers: ${{ matrix.sanitizers }}
- name: Check the Conan cache for Nix store references (Nix toolchain)
if: ${{ matrix.toolchain == 'nix' }}
run: ./bin/check-nix-store-refs.sh "${CONAN_HOME}"
run: ./bin/nix/check-nix-store-refs.sh "${CONAN_HOME}"
- name: Log into Conan remote
if: ${{ github.repository == 'XRPLF/rippled' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}

View File

@@ -60,7 +60,7 @@ repos:
types_or: [c++, c]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: e2b496dc2bd8340c2524cb9a2d2a943cde1bb6df # frozen: v23.1.1
rev: a9a8a861f30ed207ead7d5a3b7e8032283ba5da7 # frozen: v23.1.2
hooks:
- id: clang-format
args: [--style=file]
@@ -82,9 +82,10 @@ repos:
files: ^crates/.*\.rs$
- repo: https://github.com/BlankSpruce/gersemi-pre-commit
rev: f1c4833f8cf23c6d952673abc73525411a5719e8 # frozen: 0.29.1
rev: 28010ddd6016e1a0f7bd232acb6536ef996ae897 # frozen: 0.29.2
hooks:
- id: gersemi
args: [-i, --warnings-as-errors]
- repo: https://github.com/rbubley/mirrors-prettier
rev: ef4a397f916211b4a39ccf9d3d9cbb6562157251 # frozen: v3.9.9
@@ -95,19 +96,19 @@ repos:
# Scoped to package/: the rest of the repo's Python has pre-existing findings,
# so widening these is its own change.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: a56c0b927e6465d37cae3e97d35d4d18ab2b96cd # frozen: v0.16.9
rev: f12be1ebaa5351c1fc76472de98db2c3446c8253 # frozen: v0.16.10
hooks:
- id: ruff-check
args: [--fix]
files: ^package/.*\.py$
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 4160603246a6b365d4a2af661c6d71b0a0f50478 # frozen: 26.5.1
rev: 96ae3e5802f3fe2d551e703e18f0a367d1a81ac2 # frozen: 26.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 7ff8d35ae36a7d2b968f2f90b4c723e292e594ee # frozen: v2.3.1
rev: 2834ec6639549dd6796205c8f011dedcd587288b # frozen: v2.4.0
hooks:
- id: mypy
args: [--strict]

View File

@@ -28,7 +28,19 @@ Version 3.5.0 is not yet released.
### Additions in 3.5.0
- `subscribe`, `unsubscribe`: Added an optional `mpt_issuances` request field, an array of MPT issuance IDs (hex strings). Subscribers receive a message with `type` `mptTransaction` for each validated transaction whose metadata affects a subscribed issuance; the message has the same fields as the `transactions` stream. MPT issuance subscriptions count toward the per-connection subscription limit. An empty array, a non-array value, or an invalid ID returns `invalidParams`. ([#5671](https://github.com/XRPLF/rippled/pull/5671))
- `subscribe`, `unsubscribe`: Added an optional `mpt_issuances` request field, an array of MPT issuance IDs (hex strings). Subscribers receive the same `transaction` message as the `transactions` stream for each validated transaction whose metadata affects a subscribed issuance. MPT issuance subscriptions count toward the per-connection subscription limit. An empty array, a non-array value, or an invalid ID returns `invalidParams`. ([#5671](https://github.com/XRPLF/rippled/pull/5671))
- `ledger_entry`: Add full support for checks, NFT offers, payment channels, and signer lists. ([#6319](https://github.com/XRPLF/rippled/pull/6319))
### Bugfixes in 3.5.0
- `channel_authorize`: The `channel_id` field now returns an `invalidParams` error if the value is not a string. [#7582](https://github.com/XRPLF/rippled/pull/7582)
- `channel_verify`: The `channel_id` and `signature` fields now return an `invalidParams` error if the value is not a string. [#7582](https://github.com/XRPLF/rippled/pull/7582)
- `account_currencies`, `account_nfts`, `account_offers`: A request with more than one problem may now report a different one of them. An invalid `ledger_hash` or `ledger_index` is reported before an invalid or missing `account`. An invalid `limit` or `marker` is reported before `lgrNotFound` or `actNotFound`, and for `account_offers` also before `actMalformed`. A request with a single problem returns the same error as before. [#8561](https://github.com/XRPLF/rippled/pull/8561)
- `deposit_authorized`: A `credentials` entry that is all zeros (for example `"0"` or 64 `0` characters) now returns a `badCredentials` error instead of looking up a credential that can never exist.
### Bugfixes in 3.5.0
- `feature`: The admin-only `vetoed` field now returns `invalidParams` unless its value is a boolean. [#7583](https://github.com/XRPLF/rippled/pull/7583)
## XRP Ledger server version 3.4.0
@@ -50,6 +62,7 @@ Version 3.4.0 is not yet released. These changes are available in the 3.4.0 beta
- `account_lines`: The `peer` field now returns an error if the value is not a string. [#7728](https://github.com/XRPLF/rippled/pull/7728)
- `ledger`: `delivered_amount` is now included in the metadata of successful `AccountDelete` transactions when transactions are expanded (`expand`, or admin-only `full`). Previously it was only added for `Payment` and `CheckCash`, which made `ledger` inconsistent with `tx` and `account_tx`. [#5706](https://github.com/XRPLF/rippled/pull/5706)
- `noripple_check`: The `transactions` field is no longer included in error responses; it is still returned (possibly as an empty array) whenever `transactions` is `true` and the request succeeds. A malformed `account` is now rejected before the ledger is looked up, so that error response no longer carries the `ledger_hash`, `ledger_index`, and `validated` fields ([#6303](https://github.com/XRPLF/rippled/pull/6303)).
- `transaction_entry`: An object or an array in `tx_hash` now returns `malformedRequest`, like any other value that is not a hex hash, instead of an `internal` error.
## XRP Ledger server version 3.3.0

View File

@@ -2,33 +2,12 @@
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| These instructions assume you have a C++ development environment ready with Git, Python, Conan, CMake, and a C++ compiler. For help setting one up on Linux, macOS, or Windows, [see this guide](./docs/build/environment.md).<br><br>These instructions also assume a basic familiarity with Conan and CMake. If you are unfamiliar with Conan, you can read our [crash course](./docs/build/conan.md) or the official [Getting Started][conan-getting-started] walkthrough. |
## Minimum Requirements
## Supported platforms
For the hardware needed to run a node, see
[System Requirements](https://xrpl.org/system-requirements.html).
For the software needed to build xrpld, see the
[environment setup guide](./docs/build/environment.md).
## Operating Systems
### Linux
The Ubuntu Linux distribution has received the highest level of quality
assurance, testing, and support. We also support Red Hat and use Debian
internally.
Our Linux CI tooling is distro-independent and uses a Nix-based environment, so it should be possible to build on other Linux distributions as well, although we have not tested them.
### macOS
Many `xrpld` engineers use macOS for development.
The minimum supported version is macOS 15 (Sequoia).
CI testing is done in macOS 26 (Tahoe), but the build defaults `CMAKE_OSX_DEPLOYMENT_TARGET` to 15.
### Windows
Windows is used by some engineers for development only, and is not recommended
for production use.
Building and testing are supported on Linux, macOS, and (best effort) Windows;
see [Supported development platforms](./docs/build/environment.md#supported-development-platforms).
Running `xrpld` is officially supported on Linux only;
see [Requirements](./docs/install.md#requirements).
## Steps

View File

@@ -42,7 +42,7 @@ if(is_gcc)
# GCC-specific fixes
add_compile_options(-Wno-unknown-pragmas -Wno-subobject-linkage)
# -Wno-subobject-linkage can be removed when we upgrade GCC version to at least 13.3
elseif(is_clang)
elseif(is_any_clang)
# Clang-specific fixes
add_compile_options(-Wno-unknown-warning-option) # Ignore unknown warning options
elseif(is_msvc)

View File

@@ -332,7 +332,7 @@ This ensures that configuration changes don't introduce new warnings across the
### Installing clang-tidy
See the [environment setup guide](./docs/build/environment.md#clang-tidy) for how to get clang-tidy.
The [Nix development shell](./docs/build/nix.md) provides `clang-tidy` at the [tested version](./docs/build/environment.md#tested-compiler-versions).
### Running clang-tidy locally

View File

@@ -34,7 +34,7 @@ so tools can filter them and protection rules can target `release/*` and `stagin
- **Branches only move forward.**
`develop`, `staging/X.Y.x`, and `release/X.Y.x` are never rewritten.
- **Cherry-picking only goes from `develop` to a staging branch**,
for fixes that must get into a release after the code freeze
for fixes that must get into a release after the [code freeze](#release-candidates)
(see [Emergency Fixes From `develop`](#emergency-fixes-from-develop)).
- **Security fixes are prepared privately and published with the release that contains them**,
so vulnerabilities are not disclosed prematurely.
@@ -49,6 +49,7 @@ develop staging/X.Y.x & release/X.Y.x
│
├── Tag: X.Y.0-b1
├── Tag: X.Y.0-bN
│ (2 weeks before rc1: freeze on large changes starts)
├── Tag: X.Y.0-rc1 ───────────────┐ (branches created)
│ │
│ (development continues) ├── Fixes
@@ -75,16 +76,20 @@ develop staging/X.Y.x & release/X.Y.x
3. **Branches:** `staging/X.Y.x` and `release/X.Y.x` are created from `develop`
at the commit tagged `X.Y.0-rc1`.
The first RC also kicks off the QE process.
4. **Code freeze:** No new features or unrelated changes are pulled from `develop`
into `staging/X.Y.x` or `release/X.Y.x`.
Only critical stabilization fixes go into the line.
5. **No large changes on `develop`:** Until `X.Y.0` is [merged back](#merging-back-into-develop),
large changes (e.g., big refactors, moving or renaming many files, mass reformatting)
are not merged into `develop`,
so that fixes on the line and the merge back don't run into conflicts.
### Freeze on Large Changes
From two weeks before `X.Y.0-rc1` until `X.Y.0` is [merged back](#merging-back-into-develop),
large changes (e.g., big refactors, moving or renaming many files, mass reformatting)
are not merged into `develop`.
### Release Candidates
After branching, the line is in code freeze:
no new features or unrelated changes are pulled from `develop`
into `staging/X.Y.x` or `release/X.Y.x`.
Only critical stabilization fixes go into the line.
1. Fixes are developed against `staging/X.Y.x`.
2. When ready, a new RC is created on `staging/X.Y.x`,
and `release/X.Y.x` is fast-forwarded to it.
@@ -106,7 +111,8 @@ one right after the other.
2. `release/X.Y.x` is fast-forwarded to `staging/X.Y.x`,
and the release is tagged on it.
3. The release is immediately [merged back into `develop`](#merging-back-into-develop).
For a major-minor release, this lifts the freeze on large changes in `develop`.
For a major-minor release, this lifts the [freeze on large changes](#freeze-on-large-changes)
in `develop`.
### Merging Back Into `develop`
@@ -127,7 +133,7 @@ After the merge, `git log develop..<tag>` must be empty.
### Emergency Fixes From `develop`
If a commit was merged to `develop`
and needs to be included in a release after the code freeze:
and needs to be included in a release after the [code freeze](#release-candidates):
1. Create a PR that cherry-picks the commit onto `staging/X.Y.x`.
2. Leave `develop` as it is, with no reverts.

View File

@@ -20,9 +20,11 @@
# development setups, but not in the macOS CI environment. They are checked
# everywhere except when running in CI on macOS.
#
# Tools that Nix also exposes under a version-suffixed name (`clang-tidy-22`,
# `g++-15`, ...) are probed under both names: a suffixed name can break while
# the plain one still works (see mkVersionedToolLinks in nix/packages.nix).
# Tools that Nix also exposes under a version-suffixed name
# (`clang-tidy-<v>`, `g++-<v>`, ...) are probed under both names:
# a suffixed name can break while the plain one still works
# (see mkVersionedToolLinks in nix/packages.nix).
# The suffix is the major version of the plain `clang` / `gcc` on PATH.
#
# Tools scoped to a single dev shell rather than to commonPackages are checked
# only in that shell, keyed off XRPL_DEVSHELL.
@@ -34,9 +36,16 @@
set -uo pipefail
# Version suffixes of the Nix tool links, tracking nix/packages.nix.
gcc_version=15
llvm_version=22
# major_version <compiler>
# Major version of a compiler on PATH, or "unknown" when it isn't there.
major_version() {
local version
version="$("$1" -dumpversion 2>/dev/null)" || version=""
version="${version%%.*}"
printf '%s' "${version:-unknown}"
}
llvm_version="$(major_version clang)"
missing=()
checked=0
@@ -112,6 +121,7 @@ if [ "${os}" = "linux" ] || [ "${os}" = "macos" ]; then
check ClangBuildAnalyzer
check curl
check file
check jq
check less
check make
# net-tools netstat reports "net-tools X.Y"; macOS ships BSD netstat with no
@@ -180,6 +190,7 @@ fi
if [ "${os}" = "linux" ]; then
echo
echo "GCC toolchain:"
gcc_version="$(major_version gcc)"
check gcc
check "gcc-${gcc_version}"
check g++

View File

@@ -0,0 +1,65 @@
#!/usr/bin/env bash
# Fail if a binary of a build-context Conan package loads anything from the Nix
# store other than glibc, or cannot resolve a library at all.
#
# Only binaries linked by the Nix toolchain are checked, i.e. those recording a
# store path as their interpreter or RUNPATH. Prebuilt upstream binaries (such
# as the ones the cmake package ships) use the system loader instead.
#
# Build-context packages provide the tools that run during the build (protoc,
# grpc_cpp_plugin, ...). Their package ID does not change when a Nix toolchain
# update moves the GCC runtime to a new store path, so a cached binary has to
# get by with the pinned glibc alone. See docs/build/nix.md.
#
# Usage: bin/nix/check-build-context-runtime.sh <graph.json>
# <graph.json> is the output of `conan install --format=json`.
set -euo pipefail
if [ "$#" -ne 1 ]; then
echo "usage: $0 <graph.json>" >&2
exit 2
fi
if [ "$(uname -s)" != "Linux" ]; then
echo "$0: Linux only" >&2
exit 2
fi
folders="$(jq -r '.graph.nodes[] | select(.context == "build" and .package_folder) | .package_folder' "$1" | sort -u)"
checked=0
failed=0
while IFS= read -r file; do
case "$(file -b "${file}")" in
ELF*) ;;
*) continue ;;
esac
[[ "$(readelf -ldW "${file}")" == */nix/store/* ]] || continue
checked=$((checked + 1))
# `ldd` lists the interpreter and every library as the loader resolves them.
if deps="$(ldd "${file}" 2>&1)"; then
bad="$(printf '%s\n' "${deps}" |
grep -E 'not found|/nix/store/' |
grep -vE '/nix/store/[^/]+-glibc-[^/]+/' || true)"
else
case "${deps}" in
*"not a dynamic executable"*) continue ;;
esac
bad="${deps}"
fi
if [ -n "${bad}" ]; then
failed=$((failed + 1))
echo "::error file=${file}::loads a library from the Nix store other than glibc"
echo "${file}"
echo "${bad}" | sed 's/^/ /'
fi
done < <(
# shellcheck disable=SC2086 # one folder per line, no spaces in Conan paths
[ -z "${folders}" ] || find ${folders} -type f \( -perm -u+x -o -name '*.so*' \)
)
echo "Build-context packages: checked ${checked} binaries, ${failed} failed."
[ "${failed}" -eq 0 ]

View File

@@ -10,7 +10,7 @@
# alone; the scripts in a Conan cache are all git hook samples and autotools
# scratch, 36 false positives to 0 real.
#
# Usage: bin/check-nix-store-refs.sh <path>
# Usage: bin/nix/check-nix-store-refs.sh <path>
set -euo pipefail

View File

@@ -23,7 +23,7 @@ apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
ARG PRE_COMMIT_VERSION=4.6.0
ARG PRE_COMMIT_VERSION=4.6.2
RUN pip install --no-cache --break-system-packages \
pre-commit==${PRE_COMMIT_VERSION}

View File

@@ -26,8 +26,6 @@ import sys
import tempfile
from pathlib import Path
CLANG_TIDY_VERSION = 22
# Extensions run-clang-tidy can analyse: `.cpp` translation units and, thanks to
# the `verify_headers` build option, `.h`/`.hpp` headers (each has its own
# compile_commands.json entry). `.ipp` fragments have no entry and are skipped.
@@ -39,8 +37,21 @@ TIDY_EXTENSIONS = {".cpp", ".h", ".hpp"}
FILEPATH_RE = re.compile(r"^(\s*(?:-\s+)?FilePath:\s*)'((?:[^']|'')*)'\s*$")
def find_tool(name: str) -> str | None:
for candidate in (f"{name}-{CLANG_TIDY_VERSION}", name):
def clang_tidy_major() -> str | None:
"""Major version of the `clang-tidy` on PATH, which run-clang-tidy invokes."""
if not (clang_tidy := shutil.which("clang-tidy")):
return None
output = subprocess.run(
[clang_tidy, "--version"], capture_output=True, text=True
).stdout
m = re.search(r"LLVM version (\d+)", output)
return m.group(1) if m else None
def find_tool(name: str, version: str | None) -> str | None:
"""Prefer `<name>-<version>`, so a host tool of another version can't win."""
candidates = ([f"{name}-{version}"] if version else []) + [name]
for candidate in candidates:
if path := shutil.which(candidate):
return path
return None
@@ -103,8 +114,9 @@ def main():
if not files:
return 0
run_clang_tidy = find_tool("run-clang-tidy")
clang_apply_replacements = find_tool("clang-apply-replacements")
version = clang_tidy_major()
run_clang_tidy = find_tool("run-clang-tidy", version)
clang_apply_replacements = find_tool("clang-apply-replacements", version)
missing = [
name
for name, path in (
@@ -114,9 +126,10 @@ def main():
if not path
]
if missing:
tried = f" (tried the '-{version}' suffix too)" if version else ""
print(
f"clang-tidy check failed: TIDY is enabled but {' and '.join(missing)} "
f"was not found in PATH (tried the '-{CLANG_TIDY_VERSION}' suffix too).",
f"was not found in PATH{tried}.",
file=sys.stderr,
)
return 1

View File

@@ -1360,6 +1360,39 @@
# Example:
# owner_reserve = 200000 # 0.2 XRP
#
# gas_limit = <gas>
#
# The gas limit is the maximum amount of gas that can be
# consumed by a single transaction. The gas limit is used to prevent
# transactions from consuming too many resources.
#
# If this parameter is unspecified, xrpld will use an internal
# default. Don't change this without understanding the consequences.
#
# Example:
# gas_limit = 1000000 # 1 million gas
#
# bytecode_size_limit = <bytes>
#
# The bytecode size limit is the maximum size of a WASM extension in
# bytes. The size limit is used to prevent extensions from consuming
# too many resources.
#
# If this parameter is unspecified, xrpld will use an internal
# default. Don't change this without understanding the consequences.
#
# Example:
# bytecode_size_limit = 100000 # 100 kb
#
# gas_price = <micro-drops>
#
# The gas price is the conversion between WASM gas and its price in drops.
#
# If this parameter is unspecified, xrpld will use an internal
# default. Don't change this without understanding the consequences.
#
# Example:
# gas_price = 1000000 # 1 drop per gas
#-------------------------------------------------------------------------------
#
# 9. Misc Settings

View File

@@ -9,13 +9,21 @@ include_guard(GLOBAL)
# --------------------------------------------------------------------
# Compiler detection (C++)
# --------------------------------------------------------------------
set(is_clang FALSE)
# is_any_clang is true for both LLVM Clang and AppleClang. Their version numbers
# and feature sets differ, so use is_llvm_clang or is_apple_clang when it matters.
set(is_any_clang FALSE)
set(is_llvm_clang FALSE)
set(is_apple_clang FALSE)
set(is_gcc FALSE)
set(is_msvc FALSE)
set(is_xcode FALSE)
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") # Clang or AppleClang
set(is_clang TRUE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(is_any_clang TRUE)
set(is_llvm_clang TRUE)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(is_any_clang TRUE)
set(is_apple_clang TRUE)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(is_gcc TRUE)
elseif(MSVC)

View File

@@ -17,7 +17,7 @@
(runtime libraries resolved through the rpath) are skipped too.
Everywhere else `patch_nix_binary` is a no-op.
The default loader is resolved by bin/default-loader-path.sh.
The default loader is resolved by bin/nix/default-loader-path.sh.
#]===================================================================]
include_guard(GLOBAL)
@@ -25,7 +25,7 @@ include_guard(GLOBAL)
include(CompilationEnv)
# Resolves the system default ELF loader path for the current architecture.
set(_loader_path_script "${CMAKE_SOURCE_DIR}/bin/default-loader-path.sh")
set(_loader_path_script "${CMAKE_SOURCE_DIR}/bin/nix/default-loader-path.sh")
if(
is_linux

View File

@@ -130,7 +130,7 @@ else()
INTERFACE
-Wall
-Wdeprecated
$<$<BOOL:${is_clang}>:-Wno-deprecated-declarations>
$<$<BOOL:${is_any_clang}>:-Wno-deprecated-declarations>
$<$<BOOL:${wextra}>:-Wextra
-Wno-unused-parameter>
$<$<BOOL:${werr}>:-Werror>
@@ -177,7 +177,7 @@ else()
if(
is_nix_compiler
AND is_linux
AND is_clang
AND is_any_clang
AND CMAKE_CXX_FLAGS MATCHES "stdlib=libstdc"
)
string(
@@ -204,7 +204,10 @@ if(voidstar)
"Antithesis instrumentation requires Linux, aborting..."
)
elseif(
NOT (is_clang AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
NOT (
is_llvm_clang
AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0
)
)
message(
FATAL_ERROR

View File

@@ -292,6 +292,20 @@ if(xrpld)
)
target_sources(xrpld PRIVATE ${sources})
rpcspec_generate_instantiations(
OUT_VAR rpcspec_instantiations
VALUE_TYPE "::json::Value"
VIEW_HEADER "xrpld/rpc/detail/JsonObjectView.hpp"
HANDLERS
account_currencies
account_nfts
account_offers
book_changes
ledger
transaction_entry
)
target_sources(xrpld PRIVATE ${rpcspec_instantiations})
if(tests)
file(
GLOB_RECURSE sources
@@ -322,6 +336,7 @@ if(xrpld)
# antithesis_instrumentation.h, which is not exported as INTERFACE
target_include_directories(
xrpld
SYSTEM
PRIVATE ${CMAKE_SOURCE_DIR}/external/antithesis-sdk
)
endif()

View File

@@ -58,7 +58,7 @@ target_link_options(common INTERFACE ${sanitizers_linker_flags})
# This module appends -fsanitize-ignorelist=<path> for Clang builds.
# The ignorelist path contains CMAKE_SOURCE_DIR, so it must be set here, rather than in the Conan profile.
# GCC does not support -fsanitize-ignorelist.
if(is_clang)
if(is_any_clang)
set(ignorelist_path
"${CMAKE_SOURCE_DIR}/sanitizers/suppressions/sanitizer-ignorelist.txt"
)
@@ -77,19 +77,24 @@ if(is_clang)
message(STATUS " Ignorelist: ${ignorelist_path}")
endif()
# Define SANITIZERS macro for BuildInfo.cpp
# Define the SANITIZERS macro for BuildInfo.cpp, plus one of XRPL_ASAN,
# XRPL_TSAN and XRPL_UBSAN per active sanitizer, so that code can test for a
# specific one with #ifdef instead of parsing the dot-joined SANITIZERS string.
set(sanitizers_list)
if(SANITIZERS MATCHES "address")
set(enable_asan ON)
list(APPEND sanitizers_list "ASAN")
target_compile_definitions(common INTERFACE XRPL_ASAN)
endif()
if(SANITIZERS MATCHES "thread")
set(enable_tsan ON)
list(APPEND sanitizers_list "TSAN")
target_compile_definitions(common INTERFACE XRPL_TSAN)
endif()
if(SANITIZERS MATCHES "undefinedbehavior")
set(enable_ubsan ON)
list(APPEND sanitizers_list "UBSAN")
target_compile_definitions(common INTERFACE XRPL_UBSAN)
endif()
if(sanitizers_list)

View File

@@ -23,11 +23,8 @@ if(NOT is_multiconfig)
endif()
endif()
if(is_clang) # both Clang and AppleClang
if(
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0
)
if(is_llvm_clang)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
message(FATAL_ERROR "This project requires clang 16 or later")
endif()
elseif(is_gcc)

View File

@@ -62,11 +62,11 @@ if(unity)
set(CMAKE_UNITY_BUILD ON CACHE BOOL "Do a unity build")
endif()
if(is_clang AND is_linux)
if(is_llvm_clang AND is_linux)
option(voidstar "Enable Antithesis instrumentation." OFF)
endif()
if(is_gcc OR is_clang)
if(is_gcc OR is_any_clang)
include(ProcessorCount)
ProcessorCount(PROCESSOR_COUNT)
@@ -125,7 +125,7 @@ else()
set(use_mold OFF CACHE BOOL "mold linker, linux only" FORCE)
endif()
if(is_clang)
if(is_any_clang)
option(use_lld "enables detection of lld linker" ON)
else()
set(use_lld OFF CACHE BOOL "try lld linker, clang only" FORCE)

View File

@@ -7,7 +7,7 @@
pcpp>=1.30
# Parser combinator library - used to parse the macro DSL
pyparsing>=3.0.0
pyparsing>=3.3.3
# Template engine - used to generate C++ code from templates
Mako>=1.2.2
Mako>=1.4.2

View File

@@ -1,8 +1,8 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.in --generate-hashes --output-file requirements.txt
mako==1.3.12 \
--hash=sha256:8f61569480282dbf557145ce441e4ba888be453c30989f879f0d652e39f53ea9 \
--hash=sha256:9f778e93289bd410bb35daadeb4fc66d95a746f0b75777b942088b7fd7af550a
mako==1.4.3 \
--hash=sha256:723296007c870bfd6b3f0c3230dba7198096e5269297ebf5e4eff9e7ffa39d4f \
--hash=sha256:cd6537fe88d5fec315c55c2f8529bc4ce7a9a352ad7db3eeaa6a66e2dd4ec37a
# via -r requirements.in
markupsafe==3.0.3 \
--hash=sha256:0303439a41979d9e74d18ff5e2dd8c43ed6c6001fd40e5bf2e43f7bd9bbc523f \
@@ -99,7 +99,7 @@ pcpp==1.30 \
--hash=sha256:05fe08292b6da57f385001c891a87f40d6aa7f46787b03e8ba326d20a3297c6e \
--hash=sha256:5af9fbce55f136d7931ae915fae03c34030a3b36c496e72d9636cedc8e2543a1
# via -r requirements.in
pyparsing==3.3.2 \
--hash=sha256:850ba148bd908d7e2411587e247a1e4f0327839c40e2e5e6d05a007ecc69911d \
--hash=sha256:c777f4d763f140633dcb6d8a3eda953bf7a214dc4eff598413c070bcdc117cbc
pyparsing==3.3.3 \
--hash=sha256:928ae7e20211f3b6f3915a72f06a0cfd29ab9d24279dd6346b6b1a7146397d36 \
--hash=sha256:ece8c00a69cf01b45d0b1dedabb469c90d8caf996d4fda40f147627a122849a4
# via -r requirements.in

View File

@@ -3,7 +3,7 @@
"requires": [
"zlib/1.3.2#1cb806da49011867778ffb6ac7190fcb%1782392402.122708",
"xxhash/0.8.3#681d36a0a6111fc56e5e45ea182c19cc%1782392402.420688",
"xrpl-rpc-spec/0.1.19#870b2d3abcfbbf13b61c2d3c69495060%1790348286.187549",
"xrpl-rpc-spec/0.1.23#56e8946f5b3fb949a3732e1a51135ca2%1790977482.197086",
"sqlite3/3.53.0#324ada52333108388a9a6108bfa96734%1782392403.185447",
"soci/4.0.3#e726491a03468795453f7c83fc924a96%1782392402.679521",
"snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1782307151.633168",
@@ -20,7 +20,7 @@
"libarchive/3.8.7#c446109bd1f1d8ba7936c94189bc50e6%1782392403.066892",
"jemalloc/5.3.1#1fc58d55316041f10fbc1e8a2eae632a%1776700028.228",
"gtest/1.17.0#5224b3b3ff3b4ce1133cbdd27d53ee7d%1782392402.791979",
"grpc/1.81.1#b87796a4269034856cbc1a2522db16eb%1788275071.530512",
"grpc/1.81.1#aaa93ab6cda2f2baa6a84490582c8adf%1791284951.826256",
"fast_float/8.2.10#f6f28d6bb22112078e7dbda611caf681%1785888854.601666",
"ed25519/2015.03#ae761bdc52730a843f0809bdf6c1b1f6%1782307148.15562",
"date/3.0.4#862e11e80030356b53c2c38599ceb32b%1782392402.538492",
@@ -34,11 +34,15 @@
"build_requires": [
"zlib/1.3.2#1cb806da49011867778ffb6ac7190fcb%1782392402.122708",
"strawberryperl/5.32.1.1#8d114504d172cfea8ea1662d09b6333e%1782395692.540639",
"re2/20251105#8579cfd0bda4daf0683f9e3898f964b4%1782392402.431897",
"protobuf/6.33.5#ff253ead763bd8d9904a52979cd21e81%1782392410.233933",
"openssl/3.6.3#f806de8933e3bf6f01016c6a888cee2e%1783945160.863288",
"nasm/2.16.01#31e26f2ee3c4346ecd347911bd126904%1782395690.33162",
"msys2/cci.latest#d22fe7b2808f5fd34d0a7923ace9c54f%1770657326.649",
"m4/1.4.19#1727f439cf74e83826ec96d0b4904eee%1784541921.659",
"grpc/1.81.1#aaa93ab6cda2f2baa6a84490582c8adf%1791284951.826256",
"cmake/4.3.3#840cf00ea09777e05c2050a50a82c722%1782392418.696091",
"c-ares/1.34.6#545240bb1c40e2cacd4362d6b8967650%1782392402.681654",
"b2/5.4.2#ffd6084a119587e70f11cd45d1a386e2%1782392402.624226",
"automake/1.16.5#b91b7c384c3deaa9d535be02da14d04f%1755524470.56",
"autoconf/2.71#51077f068e61700d65bb05541ea1e4b0%1731054366.86",

View File

@@ -3,5 +3,13 @@
core:non_interactive=True
core.download:parallel={{ os.cpu_count() }}
core.upload:parallel={{ os.cpu_count() }}
tools.files.download:retry=5
# Fall back to Conan Center's source backups when a recipe's upstream URL is down
# (e.g. the GNU FTP mirrors), see
# https://github.com/conan-io/conan-center-index/issues/28147#issuecomment-3183544772
# The backups are only tried once every upstream URL has used up its retries,
# so keep the retries low.
core.sources:download_urls=["origin", "https://c3i.jfrog.io/artifactory/conan-center-backup-sources"]
tools.files.download:retry=1
tools.files.download:retry_wait=10
# Fail fast on unreachable hosts (default connect timeout is 30s), keep the 60s read timeout.
core.net.http:timeout=(5, 60)

View File

@@ -29,9 +29,9 @@ os.version={{ min_macos_version }}
[conf]
{# The Boost recipe builds with b2, which doesn't use Conan's toolchain files. #}
{# Instead it hand-rolls the compiler for user-config.jam, #}
{# and its fallback probes a version-suffixed binary (e.g. `g++-15`) before plain `g++`. #}
{# Inside the Nix shell the wrapper only provides `g++`/`gcc` (no `-15` suffix), #}
{# so on a host that also has a system `g++-15` the probe escapes Nix #}
{# and its fallback probes a version-suffixed binary (e.g. `g++-<major>`) before plain `g++`. #}
{# Inside the Nix shell the wrapper only provides `g++`/`gcc` (no `-<major>` suffix), #}
{# so on a host that also has a system `g++-<major>` the probe escapes Nix #}
{# and picks the system compiler, which is mismatched with the Nix libraries #}
{# and breaks the build (e.g. Boost.Stacktrace link checks fail). #}
{# Pinning the executables here short-circuits that probe so Boost (and the rest of the toolchain) #}
@@ -49,8 +49,31 @@ tools.build:compiler_executables={'c':'{{ cc_exe }}','cpp':'{{ cxx_exe }}'}
user.package:cppstd_version=23
tools.info.package_id:confs+=["user.package:cppstd_version"]
{% if os == "Macos" %}
{% if os == "Linux" and context == "build" %}
{# Build-context executables (protoc, grpc_cpp_plugin, build tools) run during the build #}
{# and would otherwise load libstdc++/libgcc from a Nix store path #}
{# that might change with a Nix toolchain update. #}
{# --as-needed drops the ones they link but don't use, #}
{# such as libatomic for grpc_cpp_plugin on arm64. #}
{% set static_runtime_flags = ["-static-libstdc++", "-static-libgcc", "-Wl,--as-needed"] %}
tools.build:exelinkflags+={{ static_runtime_flags }}
tools.info.package_id:confs+=["tools.build:exelinkflags"]
{% endif %}
{% if os == "Linux" and context == "build" %}
{# b2 links itself with its own script, which ignores exelinkflags #}
{# and only takes CXXFLAGS when use_cxx_env is set (see [buildenv] below). #}
[options]
b2/*:use_cxx_env=True
{% endif %}
[buildenv]
{# gRPC emits thousands of compiler warnings that we cannot act on. #}
{# CMake picks up CXXFLAGS, and unlike tools.build:cxxflags, #}
{# this is not part of the package ID, so binaries stay shareable. #}
grpc/*:CXXFLAGS=-w
{% if os == "Macos" %}
{# os.version adds -mmacosx-version-min to compiler command lines, #}
{# but Boost.Context's b2 assembly (.S) rule ignores it, #}
{# so those objects keep the host SDK version and still warn at link time. #}
@@ -58,3 +81,7 @@ tools.info.package_id:confs+=["user.package:cppstd_version"]
{# Scoped to boost/* since it is the only gap. #}
boost/*:MACOSX_DEPLOYMENT_TARGET={{ min_macos_version }}
{% endif %}
{% if os == "Linux" and context == "build" %}
b2/*:CXXFLAGS={{ static_runtime_flags | join(" ") }}
{% endif %}

View File

@@ -5,6 +5,9 @@ include(default)
{% if not sanitizers %}
{# Sanitizers not configured; no additional settings needed #}
{% elif context == "build" %}
{# Build-context packages are tools we run, not code we test, #}
{# so don't instrument them #}
{% else %}
{% if compiler == "msvc" %}

View File

@@ -40,7 +40,7 @@ class Xrpl(ConanFile):
"nudb/2.0.9",
"openssl/3.6.3",
"soci/4.0.3",
"xrpl-rpc-spec/0.1.19",
"xrpl-rpc-spec/0.1.23",
"zlib/1.3.2",
]
@@ -49,7 +49,8 @@ class Xrpl(ConanFile):
]
tool_requires = [
"protobuf/6.33.5",
"grpc/<host_version>",
"protobuf/<host_version>",
]
default_options = {
@@ -123,6 +124,10 @@ class Xrpl(ConanFile):
"xxhash/*:shared": False,
}
# default_options only reach the host context;
# give tool_requires (and their dependencies) the same dependency options.
default_build_options = {k: v for k, v in default_options.items() if "/" in k}
def set_version(self):
self.version = self.version or DEV_VERSION
@@ -149,7 +154,7 @@ class Xrpl(ConanFile):
self.requires("xxhash/0.8.3", transitive_headers=True)
exports_sources = (
"bin/default-loader-path.sh",
"bin/nix/default-loader-path.sh",
"CMakeLists.txt",
"cfg/*",
"cmake/*",

View File

@@ -80,13 +80,12 @@ function(add_xrpl_crate name)
# `cc` picks its runtime flag from `crt-static` alone, so it compiles a
# crate's C++ with `-MT`; Debug needs `-MTd` (to match cmake/XrplCompiler.cmake).
if(is_msvc)
corrosion_set_env_vars(
${ARG_CRATE}
"$<$<CONFIG:Debug>:CXXFLAGS=-MTd>"
)
corrosion_set_env_vars(${ARG_CRATE} "$<$<CONFIG:Debug>:CXXFLAGS=-MTd>")
endif()
corrosion_add_cxxbridge(${name}_cxxbridge CRATE ${ARG_CRATE} FILES
${ARG_FILES}
corrosion_add_cxxbridge(
${name}_cxxbridge
CRATE ${ARG_CRATE}
FILES ${ARG_FILES}
)
# Generated cxxbridge headers don't exist at configure time; CMake 3.28+
# validates INTERFACE_SOURCES on consuming targets. Clear it to skip the

20
crates/Cargo.lock generated
View File

@@ -57,9 +57,9 @@ dependencies = [
[[package]]
name = "cxx"
version = "1.0.202"
version = "1.0.205"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13f6de320895f42e6e081abb5c7983bedcf0b6d0ff9323de0d33f620c8ac1199"
checksum = "c8a02bfeba9074b2bbb39492c9b0908ec854f455a3cccdcde7a1de55e2315e40"
dependencies = [
"cc",
"cxx-build",
@@ -72,9 +72,9 @@ dependencies = [
[[package]]
name = "cxx-build"
version = "1.0.202"
version = "1.0.205"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fde53ca86b9704a943fef0f1e1d836239a6aedca5de3c65fa9f97ec0bd46d39"
checksum = "bbc2ac76997619d2d888b58ad79488f1c835de41ca4dd3dd7082acf4ecb0a50f"
dependencies = [
"cc",
"codespan-reporting",
@@ -87,9 +87,9 @@ dependencies = [
[[package]]
name = "cxxbridge-cmd"
version = "1.0.202"
version = "1.0.205"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bae89236c811fd4d08ed3441759ac4ac98d752cbfd3de341315ba16ad20ec3"
checksum = "54a486ed16a3f2a053fe7f5b98db4c1a59846a23e8cb9e49f9d1bd48830d51a2"
dependencies = [
"clap",
"codespan-reporting",
@@ -101,15 +101,15 @@ dependencies = [
[[package]]
name = "cxxbridge-flags"
version = "1.0.202"
version = "1.0.205"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49045042e5fced01b80742aba5508de82aa4f13677ed3fa2b4cda709c40c5918"
checksum = "c72569be94e2283764d334cd285980b747dbe221e27e315484eb6bcd93fa808a"
[[package]]
name = "cxxbridge-macro"
version = "1.0.202"
version = "1.0.205"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b181252e2e3d3b5d183afbdc033a3958b445eb3e1a0ae65fc3d4f5259f5da6fd"
checksum = "423e795284a7f7b3f843c956a5322c4bc497b60c2dd1a6339da10313cb18d575"
dependencies = [
"indexmap",
"proc-macro2",

View File

@@ -4,20 +4,33 @@ This document explains how to set one up.
[BUILD.md]: ../../BUILD.md
## Supported development platforms
- **Linux**: the [Nix development shell](./nix.md),
which provides the same toolchain CI uses on any distribution.
- **macOS** 15 (Sequoia) or newer: the [Nix development shell](./nix.md),
or the system [Apple Clang](#macos-apple-clang).
CI runs on macOS 26 (Tahoe), but the build defaults `CMAKE_OSX_DEPLOYMENT_TARGET` to 15.
- **Windows**: best effort, see [Windows](#windows).
For the platforms supported for running `xrpld`,
see [Requirements](../install.md#requirements).
## Tested compiler versions
`xrpld` is built in the **C++23** dialect by default, so your toolchain has to
support it — see [compiler support for C++23][cpp23-support].
The versions currently tested in CI are:
| Compiler | Version |
| ----------- | ------------------ |
| GCC | 15.2 |
| Clang | 22 |
| Apple Clang | 21 |
| MSVC | Visual Studio 2026 |
| Compiler | Version |
| ----------- | ------------------------------- |
| GCC | `gccVersion` in [packages.nix] |
| Clang | `llvmVersion` in [packages.nix] |
| Apple Clang | 21 |
| MSVC | Visual Studio 2026 |
LLVM tools (`clang-tidy` and `clang-format`) are also pinned to version 22.
LLVM tools (`clang-tidy` and `clang-format`)
come from the same LLVM release as Clang.
### Older compilers
@@ -34,20 +47,16 @@ compiler building. Treat support for anything outside the table as best-effort.
## Required tools
Besides a compiler, building `xrpld` requires:
| Tool | Minimum version |
| ------------------------------------------- | --------------- |
| [Git](https://git-scm.com/downloads) | any recent |
| [Python](https://www.python.org/downloads/) | 3.11 |
| [Conan](https://conan.io/downloads.html) | 2.17 |
| [CMake](https://cmake.org/download/) | 3.16 |
Besides a compiler, building `xrpld` requires
[Git](https://git-scm.com/downloads),
[Python](https://www.python.org/downloads/),
[Conan](https://conan.io/downloads.html),
and [CMake](https://cmake.org/download/).
Building with `-Drust=ON` additionally requires a Rust toolchain,
see [Rust](#rust).
On Linux and macOS, the [Nix development shell](./nix.md) provides all of them
(see below). On Windows they have to be installed manually.
Building with `-Drust=ON` additionally requires a Rust toolchain, see
[Rust](#rust). A default build does not, so it is not in the table above.
at the versions CI uses, recorded in [`nix/check-tools/`](../../nix/check-tools).
Once they are in place, verify that everything is installed and runnable with:
@@ -57,60 +66,19 @@ Once they are in place, verify that everything is installed and runnable with:
## Linux and macOS
The **recommended way** to get a development environment on Linux and macOS is
the Nix development shell. It provides the exact tooling used in CI — `git`,
`python`, `conan`, `cmake`, `clang-tidy`, `clang-format`, and everything else —
with a single command and without installing anything system-wide:
Use the [Nix development shell](./nix.md):
it provides the compiler and every tool CI uses,
without installing anything system-wide.
```bash
nix --experimental-features 'nix-command flakes' develop
```
### macOS: Apple Clang
On **Linux**, Nix also provides the compiler (GCC); on **macOS**, it provides
Clang. If you instead opt to use your system-wide Apple Clang (via
`nix develop .#apple-clang`), you need to manage its version yourself (see
below).
See [Using the Nix development shell](./nix.md) for installation and usage
details, including how to select a different compiler and why we recommend Nix
over a hand-maintained environment.
### macOS: managing the Apple Clang version
If you use your system-wide Apple Clang on macOS (via `nix develop .#apple-clang`),
the compiler version is whatever your installed Xcode (or Command Line Tools)
provides. The following command should return a version greater than or equal to
the [tested one](#tested-compiler-versions):
```bash
clang --version
```
If you develop other applications using Xcode, you might be consistently
updating to the newest version of Apple Clang, which will likely cause issues
building xrpld. You may want to install and pin a specific version of Xcode:
1. **Download Xcode**
- Visit [Apple Developer Downloads](https://developer.apple.com/download/more/)
- Sign in with your Apple Developer account
- Search for an Xcode version that includes the expected Apple Clang version
- Download the `.xip` file
2. **Install and configure Xcode**
```bash
# Extract the .xip file and rename for version management
# Example: Xcode_16.2.app
# Move to Applications directory
sudo mv Xcode_16.2.app /Applications/
# Set as default toolchain (persistent)
sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
# Set as environment variable (temporary)
export DEVELOPER_DIR=/Applications/Xcode_16.2.app/Contents/Developer
```
You can also build with the system Apple Clang,
installing the other [required tools](#required-tools) any way you like
(or getting them from `nix develop .#apple-clang`).
Its version is whatever your installed Xcode (or Command Line Tools) provides,
so check that `clang --version` is at least the [tested one](#tested-compiler-versions).
If several Xcode versions are installed,
select one with `sudo xcode-select -s <path>` or the `DEVELOPER_DIR` environment variable.
## Windows
@@ -122,8 +90,7 @@ manually:
"x64 Native Tools Command Prompt". CI configures CMake with the
`Visual Studio 18 2026` generator.
- [Git for Windows](https://git-scm.com/download/win)
- Python, Conan, and CMake, at the versions listed in
[Required tools](#required-tools).
- recent releases of Python, Conan, and CMake
- a [Rust toolchain](https://rustup.rs) — only needed to build with
`-Drust=ON`, see [Rust](#rust)
@@ -144,15 +111,5 @@ version.
Everything else the Rust build needs on the CMake side comes from Conan along
with the rest of the dependencies, so there is nothing further to install.
## Clang-tidy
`clang-tidy` is required to run static analysis checks locally (see
[CONTRIBUTING.md](../../CONTRIBUTING.md)). It is not required to build the
project. The version this project uses is listed in
[Tested compiler versions](#tested-compiler-versions).
On Linux and macOS, the [Nix development shell](./nix.md) provides that exact
version out of the box — run it via `run-clang-tidy`. No separate installation
is needed.
[cpp23-support]: https://en.cppreference.com/w/cpp/compiler_support/23
[packages.nix]: ../../nix/packages.nix

41
docs/build/nix.md vendored
View File

@@ -9,9 +9,7 @@ This guide explains how to use Nix to set up a reproducible development environm
- **Reproducible environment**: Everyone gets the same versions of tools and compilers
- **Matches CI**: The Linux CI runs in Docker images built from this exact Nix environment, and CI builds some macOS configurations in it as well
- **No system pollution**: Dependencies are isolated and don't affect your system packages
- **Consistent compilers**: The GCC and Clang shells use the same versions as CI
- **Quick setup**: Get started with a single command
- **Works on Linux and macOS**: Consistent experience across platforms
## Install Nix
@@ -27,13 +25,8 @@ From the root of the xrpld repository, enter the default development shell:
nix --experimental-features 'nix-command flakes' develop
```
This will:
- Download and set up all required development tools (CMake, Ninja, Conan, etc.)
- Configure the appropriate compiler for your platform:
- **Linux**: GCC (provided by Nix)
- **macOS**: Clang (provided by Nix)
This downloads and sets up all required development tools (CMake, Ninja, Conan, etc.)
and the compiler for your platform (see [Platform notes](#platform-notes)).
The first time you run this command, it will take a few minutes to download and build the environment. Subsequent runs will be much faster.
### Platform notes
@@ -183,24 +176,36 @@ at link or run time.
> configuration CI covers, and no dependency binaries are published for it.
This is checked rather than assumed.
[`bin/check-nix-store-refs.sh`](../../bin/check-nix-store-refs.sh) takes one file
or directory and fails if a binary under it resolves a store path at run time.
[`bin/nix/check-nix-store-refs.sh`](../../bin/nix/check-nix-store-refs.sh) takes one
file or directory and fails if a binary under it resolves a store path at run time.
CI runs it over the build output and the Conan cache, and again in the upload job
before anything is published. You can run it yourself:
```bash
bin/check-nix-store-refs.sh build
bin/check-nix-store-refs.sh ~/.conan2-nix
bin/nix/check-nix-store-refs.sh build
bin/nix/check-nix-store-refs.sh ~/.conan2-nix
```
It works on Linux too, but asserts something narrower there: the toolchain always
writes the store into `PT_INTERP` and `RUNPATH`, and CI builds inside an image
whose store is fixed for its lifetime, so that is fine. Only the binaries
[`PatchNixBinary.cmake`](../../cmake/PatchNixBinary.cmake) retargets to the
system loader have to be clean, and those are what CI checks:
writes the store into `PT_INTERP` and `RUNPATH`. That is fine for the pinned
glibc, whose path does not move, but not for the GCC runtime, which moves with
every GCC update. So [`conan/profiles/default`](../../conan/profiles/default)
links build-context packages, whose executables run during the build, with
`-static-libstdc++ -static-libgcc -Wl,--as-needed`, and
[`conan/profiles/sanitizers`](../../conan/profiles/sanitizers) does not
instrument them. CI checks that they load nothing from the store but glibc, from
the graph `conan install --format=json` writes:
```bash
bin/check-nix-store-refs.sh build/xrpld
bin/nix/check-build-context-runtime.sh graph.json
```
Only the binaries [`PatchNixBinary.cmake`](../../cmake/PatchNixBinary.cmake)
retargets to the system loader have to be fully clean, and those are what CI
checks:
```bash
bin/nix/check-nix-store-refs.sh build/xrpld
```
### The libresolv stub

View File

@@ -178,11 +178,11 @@ A binary stops starting after a `nix flake update`, or after
dyld[57271]: Library not loaded: /nix/store/…-libresolv-93/lib/libresolv.9.dylib
```
[`bin/check-nix-store-refs.sh`](../../bin/check-nix-store-refs.sh) finds the same
thing without having to run anything, and names the file:
[`bin/nix/check-nix-store-refs.sh`](../../bin/nix/check-nix-store-refs.sh) finds the
same thing without having to run anything, and names the file:
```
$ bin/check-nix-store-refs.sh ~/.conan2-nix
$ bin/nix/check-nix-store-refs.sh ~/.conan2-nix
::error file=/Users/you/.conan2-nix/p/b/c-area24ded30c388c/p/bin/adig::references the Nix store at run time
/Users/you/.conan2-nix/p/b/c-area24ded30c388c/p/bin/adig
/nix/store/p4lp3xq4imd1qzqh08x8vcq2zfhi7rca-libresolv-93/lib/libresolv.9.dylib

View File

@@ -10,6 +10,19 @@ and DNF on Red Hat-based distributions such as RHEL, AlmaLinux, and Rocky Linux,
where `yum` is a symlink to `dnf`.
To build from source instead, see [BUILD.md](../BUILD.md).
## Requirements
Linux is the only operating system officially supported for running `xrpld`;
macOS and Windows builds are for development only.
Any x86-64 Linux distribution with APT or DNF and glibc 2.31 or newer should work
(see [How libc is handled](../nix/docker/README.md#how-libc-is-handled)).
CI tests the packages on Debian 11–13, Ubuntu 20.04–26.04,
RHEL (UBI) 9–10, AlmaLinux 9–10, and Rocky Linux 9–10.
For the hardware needed to run a node,
see [System Requirements](https://xrpl.org/system-requirements.html).
## Release channels
Packages are published to four channels:

View File

@@ -6,7 +6,7 @@ project(antithesis-sdk-cpp VERSION 0.4.4 LANGUAGES CXX)
add_library(antithesis-sdk-cpp INTERFACE antithesis_sdk.h)
# Note, both sections below created by xrpld project
target_include_directories(antithesis-sdk-cpp INTERFACE
target_include_directories(antithesis-sdk-cpp SYSTEM INTERFACE
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

12
flake.lock generated
View File

@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1781173989,
"narHash": "sha256-fnzKKPvS+oieI/pTzotA5tkoM47EB1NpaBcgk4R97hE=",
"lastModified": 1791130267,
"narHash": "sha256-1sjwcQMcgAbmiip/VivBSiK8p2bTkQGOvCuO7vnwfx4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8c91a71d13451abc40eb9dae8910f972f979852f",
"rev": "9013764fcc0ea99fa16cf7aa7decf8a5c3889dd2",
"type": "github"
},
"original": {
@@ -47,11 +47,11 @@
]
},
"locked": {
"lastModified": 1784611586,
"narHash": "sha256-OfqgY+0hp/zseZB7uyH0U8kIDPS4scZZCyAurEplvG0=",
"lastModified": 1791189933,
"narHash": "sha256-Y8eN7ki0Urx4Ojf4w1xSpWg8uk/3lJqK+E0Oth77rH0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "14f58845249f3552a89b07772626b8d3c632fa86",
"rev": "e60029353d0c48d216bc4b065168ccd4079c166f",
"type": "github"
},
"original": {

View File

@@ -34,7 +34,7 @@ lz4Compress(void const* in, std::size_t inSize, BufferFactory&& bf)
// data
auto compressed = bf(outCapacity);
auto compressedSize = LZ4_compress_default(
auto const compressedSize = LZ4_compress_default(
reinterpret_cast<char const*>(in),
reinterpret_cast<char*>(compressed),
inSize,

View File

@@ -20,12 +20,14 @@ SharedIntrusive<T>::SharedIntrusive(T* p, TAdoptTag) noexcept : ptr_{p}
template <class T>
SharedIntrusive<T>::SharedIntrusive(SharedIntrusive const& rhs)
: ptr_{[&] {
auto p = rhs.unsafeGetRawPtr();
if (p)
p->addStrongRef();
return p;
}()}
: ptr_{
[&] {
auto p = rhs.unsafeGetRawPtr();
if (p)
p->addStrongRef();
return p;
}(),
}
{
}
@@ -33,12 +35,14 @@ template <class T>
template <class TT>
requires std::convertible_to<TT*, T*>
SharedIntrusive<T>::SharedIntrusive(SharedIntrusive<TT> const& rhs)
: ptr_{[&] {
auto p = rhs.unsafeGetRawPtr();
if (p)
p->addStrongRef();
return p;
}()}
: ptr_{
[&] {
auto p = rhs.unsafeGetRawPtr();
if (p)
p->addStrongRef();
return p;
}(),
}
{
}
@@ -140,12 +144,14 @@ SharedIntrusive<T>::~SharedIntrusive()
template <class T>
template <class TT>
SharedIntrusive<T>::SharedIntrusive(StaticCastTagSharedIntrusive, SharedIntrusive<TT> const& rhs)
: ptr_{[&] {
auto p = static_cast<T*>(rhs.unsafeGetRawPtr());
if (p)
p->addStrongRef();
return p;
}()}
: ptr_{
[&] {
auto p = static_cast<T*>(rhs.unsafeGetRawPtr());
if (p)
p->addStrongRef();
return p;
}(),
}
{
}
@@ -159,12 +165,14 @@ SharedIntrusive<T>::SharedIntrusive(StaticCastTagSharedIntrusive, SharedIntrusiv
template <class T>
template <class TT>
SharedIntrusive<T>::SharedIntrusive(DynamicCastTagSharedIntrusive, SharedIntrusive<TT> const& rhs)
: ptr_{[&] {
auto p = dynamic_cast<T*>(rhs.unsafeGetRawPtr());
if (p)
p->addStrongRef();
return p;
}()}
: ptr_{
[&] {
auto p = dynamic_cast<T*>(rhs.unsafeGetRawPtr());
if (p)
p->addStrongRef();
return p;
}(),
}
{
}
@@ -260,7 +268,7 @@ SharedIntrusive<T>::unsafeReleaseAndStore(T* next)
return;
using enum ReleaseStrongRefAction;
auto action = prev->releaseStrongRef();
auto const action = prev->releaseStrongRef();
switch (action)
{
case NoOp:
@@ -361,7 +369,7 @@ WeakIntrusive<T>::unsafeReleaseNoStore()
return;
using enum ReleaseWeakRefAction;
auto action = ptr_->releaseWeakRef();
auto const action = ptr_->releaseWeakRef();
switch (action)
{
case NoOp:
@@ -580,7 +588,7 @@ SharedWeakUnion<T>::convertToStrong()
auto p = unsafeGetRawPtr();
if (p && p->checkoutStrongRefFromWeak())
{
[[maybe_unused]] auto action = p->releaseWeakRef();
[[maybe_unused]] auto const action = p->releaseWeakRef();
XRPL_ASSERT(
(action == ReleaseWeakRefAction::NoOp),
"xrpl::SharedWeakUnion::convertToStrong : "
@@ -603,7 +611,7 @@ SharedWeakUnion<T>::convertToWeak()
return false;
using enum ReleaseStrongRefAction;
auto action = p->addWeakReleaseStrongRef();
auto const action = p->addWeakReleaseStrongRef();
switch (action)
{
case NoOp:
@@ -670,7 +678,7 @@ SharedWeakUnion<T>::unsafeReleaseNoStore()
if (isStrong())
{
using enum ReleaseStrongRefAction;
auto strongAction = p->releaseStrongRef();
auto const strongAction = p->releaseStrongRef();
switch (strongAction)
{
case NoOp:
@@ -688,7 +696,7 @@ SharedWeakUnion<T>::unsafeReleaseNoStore()
else
{
using enum ReleaseWeakRefAction;
auto weakAction = p->releaseWeakRef();
auto const weakAction = p->releaseWeakRef();
switch (weakAction)
{
case NoOp:

View File

@@ -406,10 +406,10 @@ IntrusiveRefCounts::useCount() const noexcept
inline IntrusiveRefCounts::~IntrusiveRefCounts() noexcept
{
#ifndef NDEBUG
auto v = refCounts_.load(std::memory_order_acquire);
auto const v = refCounts_.load(std::memory_order_acquire);
XRPL_ASSERT(
(!(v & kValueMask)), "xrpl::IntrusiveRefCounts::~IntrusiveRefCounts : count must be zero");
auto t = v & kTagMask;
auto const t = v & kTagMask;
XRPL_ASSERT((!t || t == kTagMask), "xrpl::IntrusiveRefCounts::~IntrusiveRefCounts : valid tag");
#endif
}

View File

@@ -3,9 +3,156 @@
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <optional>
namespace xrpl {
/**
* Add two signed 64-bit integers, returning std::nullopt when the exact
* mathematical sum is not representable in std::int64_t.
*/
[[nodiscard]] constexpr std::optional<std::int64_t>
checkedAdd(std::int64_t a, std::int64_t b) noexcept
{
using L = std::numeric_limits<std::int64_t>;
if ((b > 0 && a > L::max() - b) || (b < 0 && a < L::min() - b))
return std::nullopt;
return a + b;
}
/**
* Subtract two signed 64-bit integers, returning std::nullopt when the exact
* mathematical difference is not representable in std::int64_t.
*/
[[nodiscard]] constexpr std::optional<std::int64_t>
checkedSub(std::int64_t a, std::int64_t b) noexcept
{
using L = std::numeric_limits<std::int64_t>;
if ((b > 0 && a < L::min() + b) || (b < 0 && a > L::max() + b))
return std::nullopt;
return a - b;
}
/**
* Multiply two signed 64-bit integers, returning std::nullopt when the exact
* mathematical product is not representable in std::int64_t.
*/
[[nodiscard]] constexpr std::optional<std::int64_t>
checkedMul(std::int64_t a, std::int64_t b) noexcept
{
using L = std::numeric_limits<std::int64_t>;
if (a == 0 || b == 0)
return 0;
if (a > 0)
{
if (b > 0 ? a > L::max() / b : b < L::min() / a)
return std::nullopt;
}
else if (b > 0 ? a < L::min() / b : b < L::max() / a)
{
return std::nullopt;
}
return a * b;
}
static_assert(checkedAdd(0, 0) == 0);
static_assert(checkedAdd(1, -1) == 0);
static_assert(checkedAdd(-5, 2) == -3);
static_assert(!checkedAdd(std::numeric_limits<std::int64_t>::max(), 1).has_value());
static_assert(!checkedAdd(std::numeric_limits<std::int64_t>::min(), -1).has_value());
static_assert(
checkedAdd(std::numeric_limits<std::int64_t>::max() - 1, 1) ==
std::numeric_limits<std::int64_t>::max());
static_assert(
checkedAdd(
std::numeric_limits<std::int64_t>::min(),
std::numeric_limits<std::int64_t>::max()) == -1);
static_assert(
checkedAdd(
std::numeric_limits<std::int64_t>::max(),
std::numeric_limits<std::int64_t>::min()) == -1);
static_assert(
!checkedAdd(std::numeric_limits<std::int64_t>::max(), std::numeric_limits<std::int64_t>::max())
.has_value());
static_assert(
!checkedAdd(std::numeric_limits<std::int64_t>::min(), std::numeric_limits<std::int64_t>::min())
.has_value());
static_assert(checkedSub(0, 0) == 0);
static_assert(checkedSub(1, 1) == 0);
static_assert(checkedSub(-5, 2) == -7);
static_assert(checkedSub(-5, -2) == -3);
static_assert(!checkedSub(std::numeric_limits<std::int64_t>::min(), 1).has_value());
static_assert(!checkedSub(std::numeric_limits<std::int64_t>::max(), -1).has_value());
static_assert(
checkedSub(std::numeric_limits<std::int64_t>::min() + 1, 1) ==
std::numeric_limits<std::int64_t>::min());
static_assert(
checkedSub(-1, std::numeric_limits<std::int64_t>::max()) ==
std::numeric_limits<std::int64_t>::min());
static_assert(
!checkedSub(std::numeric_limits<std::int64_t>::max(), std::numeric_limits<std::int64_t>::min())
.has_value());
static_assert(
!checkedSub(std::numeric_limits<std::int64_t>::min(), std::numeric_limits<std::int64_t>::max())
.has_value());
static_assert(checkedMul(0, std::numeric_limits<std::int64_t>::min()) == 0);
static_assert(checkedMul(std::numeric_limits<std::int64_t>::min(), 0) == 0);
static_assert(checkedMul(-1, -1) == 1);
// a > 0, b > 0
static_assert(
checkedMul(std::numeric_limits<std::int64_t>::max(), 1) ==
std::numeric_limits<std::int64_t>::max());
static_assert(
checkedMul(std::numeric_limits<std::int64_t>::max() / 2, 2) ==
std::numeric_limits<std::int64_t>::max() - 1);
static_assert(!checkedMul((std::numeric_limits<std::int64_t>::max() / 2) + 1, 2).has_value());
static_assert(!checkedMul(2, (std::numeric_limits<std::int64_t>::max() / 2) + 1).has_value());
// a > 0, b < 0
static_assert(
checkedMul(std::numeric_limits<std::int64_t>::max(), -1) ==
-std::numeric_limits<std::int64_t>::max());
static_assert(
checkedMul((std::numeric_limits<std::int64_t>::max() / 2) + 1, -2) ==
std::numeric_limits<std::int64_t>::min());
static_assert(!checkedMul((std::numeric_limits<std::int64_t>::max() / 2) + 2, -2).has_value());
static_assert(
checkedMul(1, std::numeric_limits<std::int64_t>::min()) ==
std::numeric_limits<std::int64_t>::min());
static_assert(
checkedMul(2, std::numeric_limits<std::int64_t>::min() / 2) ==
std::numeric_limits<std::int64_t>::min());
static_assert(!checkedMul(2, (std::numeric_limits<std::int64_t>::min() / 2) - 1).has_value());
// a < 0, b > 0
static_assert(
checkedMul(std::numeric_limits<std::int64_t>::min(), 1) ==
std::numeric_limits<std::int64_t>::min());
static_assert(
checkedMul(std::numeric_limits<std::int64_t>::min() / 2, 2) ==
std::numeric_limits<std::int64_t>::min());
static_assert(!checkedMul((std::numeric_limits<std::int64_t>::min() / 2) - 1, 2).has_value());
static_assert(!checkedMul(std::numeric_limits<std::int64_t>::min(), 2).has_value());
// a < 0, b < 0
static_assert(
checkedMul(-(std::numeric_limits<std::int64_t>::max() / 2), -2) ==
std::numeric_limits<std::int64_t>::max() - 1);
static_assert(!checkedMul(std::numeric_limits<std::int64_t>::min() / 2, -2).has_value());
static_assert(
checkedMul(-1, -std::numeric_limits<std::int64_t>::max()) ==
std::numeric_limits<std::int64_t>::max());
static_assert(!checkedMul(std::numeric_limits<std::int64_t>::min(), -1).has_value());
static_assert(!checkedMul(-1, std::numeric_limits<std::int64_t>::min()).has_value());
/**
* Calculate one number divided by another number in percentage.
* The result is rounded up to the next integer, and capped in the range [0,100]

View File

@@ -340,7 +340,7 @@ public:
for (auto const& c : cfg)
{
auto& a = allocators_.emplace_back(c.extra_, c.alloc_, c.align_);
auto const& a = allocators_.emplace_back(c.extra_, c.alloc_, c.align_);
if (a.size() > maxSize_)
maxSize_ = a.size();

View File

@@ -36,7 +36,7 @@ template <typename T>
concept SomeChar = std::same_as<std::remove_cvref_t<T>, int8_t> ||
std::same_as<std::remove_cvref_t<T>, char> || std::same_as<std::remove_cvref_t<T>, uint8_t>;
inline constexpr std::array<std::optional<int>, 256> const kDigitLookupTable = []() {
inline constexpr std::array<std::optional<int>, 256> const kDigitLookupTable = [] {
std::array<std::optional<int>, 256> t{};
for (int i = 0; i < 10; ++i)

View File

@@ -153,6 +153,24 @@ private:
Policy policy,
Callback&& replaceCallback = nullptr);
/**
* canonicalizeImpl variant for callers that already hold `mutex_`.
*
* The unnamed `scoped_lock<MutexType> const&` parameter is proof of
* ownership; this overload does not acquire the lock. Use it from other
* methods (e.g. fetchAndModify) that need to compose canonicalize with
* additional work under a single critical section, without relying on
* recursive-mutex re-entry.
*/
template <class Policy, class Callback = std::nullptr_t>
bool
canonicalizeImpl(
std::scoped_lock<MutexType> const&,
key_type const& key,
CanonicalizeClientPointerType<Policy> data,
Policy policy,
Callback&& replaceCallback = nullptr);
public:
/**
* Replace aliased objects with originals.
@@ -239,9 +257,6 @@ public:
bool
retrieve(key_type const& key, T& data);
MutexType&
peekMutex();
std::vector<key_type>
getKeys() const;
@@ -263,6 +278,22 @@ public:
fetch(key_type const& digest, Handler const& h);
// End CachedSLEs functions.
/**
* Fetch or create an entry and execute a callback while holding the lock.
*
* The entry for the given key is fetched from the cache or created if it
* doesn't exist. The callback is then invoked with a reference to the
* entry while the cache mutex is still held, allowing safe modification
* of the cached object.
*
* @param key The key to fetch or create
* @param callback Function to call with the entry under lock.
* Signature: void(T&)
*/
template <class Callback>
void
fetchAndModify(key_type const& key, Callback&& callback);
private:
SharedPointerType
initialFetch(key_type const& key, std::scoped_lock<MutexType> const& l);

View File

@@ -4,6 +4,7 @@
#include <xrpl/basics/Log.h> // IWYU pragma: keep
#include <xrpl/basics/TaggedCache.h>
#include <xrpl/basics/scope.h>
#include <xrpl/beast/utility/instrumentation.h>
#include <algorithm>
@@ -300,7 +301,7 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
// Remove from cache, if !valid, remove from map too. Returns true if removed from cache
std::scoped_lock const lock(mutex_);
auto cit = cache_.find(key);
auto const cit = cache_.find(key);
if (cit == cache_.end())
return false;
@@ -335,6 +336,29 @@ template <class Policy, class Callback>
inline bool
TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash, KeyEqual, Mutex>::
canonicalizeImpl(
key_type const& key,
CanonicalizeClientPointerType<Policy> data,
Policy policy,
Callback&& replaceCallback)
{
std::scoped_lock<MutexType> const lock(mutex_);
return canonicalizeImpl(lock, key, data, policy, std::forward<Callback>(replaceCallback));
}
template <
class Key,
class T,
bool IsKeyCache,
class SharedWeakUnionPointer,
class SharedPointerType,
class Hash,
class KeyEqual,
class Mutex>
template <class Policy, class Callback>
inline bool
TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash, KeyEqual, Mutex>::
canonicalizeImpl(
std::scoped_lock<MutexType> const&,
key_type const& key,
CanonicalizeClientPointerType<Policy> data,
[[maybe_unused]] Policy policy,
@@ -354,9 +378,7 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
// passing a const argument is a compile error.
constexpr bool replaceCached = std::is_same_v<Policy, detail::ReplaceCached>;
std::scoped_lock const lock(mutex_);
auto cit = cache_.find(key);
auto const cit = cache_.find(key);
if (cit == cache_.end())
{
@@ -371,7 +393,7 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
Entry& entry = cit->second;
entry.touch(clock_.now());
auto shouldReplaceCached = [&] {
auto const shouldReplaceCached = [&] {
if constexpr (replaceCached)
{
return true;
@@ -400,7 +422,7 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
return true;
}
auto cachedData = entry.lock();
auto const cachedData = entry.lock();
if (cachedData)
{
@@ -563,7 +585,7 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
retrieve(key_type const& key, T& data)
{
// retrieve the value of the stored data
auto entry = fetch(key);
auto const entry = fetch(key);
if (!entry)
return false;
@@ -572,22 +594,6 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
return true;
}
template <
class Key,
class T,
bool IsKeyCache,
class SharedWeakUnionPointer,
class SharedPointerType,
class Hash,
class KeyEqual,
class Mutex>
inline auto
TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash, KeyEqual, Mutex>::
peekMutex() -> MutexType&
{
return mutex_;
}
template <
class Key,
class T,
@@ -687,7 +693,7 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
return ret;
}
auto sle = h();
auto const sle = h();
if (!sle)
return {};
@@ -700,6 +706,49 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
}
// End CachedSLEs functions.
template <
class Key,
class T,
bool IsKeyCache,
class SharedWeakUnionPointer,
class SharedPointerType,
class Hash,
class KeyEqual,
class Mutex>
template <class Callback>
inline void
TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash, KeyEqual, Mutex>::
fetchAndModify(key_type const& key, Callback&& callback)
{
static_assert(
!IsKeyCache, "fetchAndModify is only supported for value caches, not key-only caches");
static_assert(
std::is_same_v<std::shared_ptr<T>, SharedPointerType> ||
std::is_same_v<intr_ptr::SharedPtr<T>, SharedPointerType>,
"fetchAndModify requires std::shared_ptr<T> or intr_ptr::SharedPtr<T>");
std::scoped_lock<MutexType> const lock(mutex_);
// Same pointer-type dispatch as insert(): the placeholder must have exactly
// SharedPointerType so canonicalizeImpl can write the cached pointer back.
SharedPointerType entry = [] {
if constexpr (std::is_same_v<std::shared_ptr<T>, SharedPointerType>)
{
return std::make_shared<T>();
}
else
{
return intr_ptr::makeShared<T>();
}
}();
canonicalizeImpl(lock, key, entry, detail::ReplaceClient{});
ALWAYS(
entry != nullptr, "xrpl::TaggedCache::fetchAndModify : entry present after canonicalize");
callback(*entry);
}
template <
class Key,
class T,
@@ -713,7 +762,7 @@ inline SharedPointerType
TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash, KeyEqual, Mutex>::
initialFetch(key_type const& key, std::scoped_lock<MutexType> const& l)
{
auto cit = cache_.find(key);
auto const cit = cache_.find(key);
if (cit == cache_.end())
return {};
@@ -783,7 +832,7 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
std::atomic<int>& allRemovals,
std::scoped_lock<std::recursive_mutex> const&)
{
return std::thread([&, this]() {
return std::thread([&, this] {
int cacheRemovals = 0;
int mapRemovals = 0;
@@ -863,7 +912,7 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
std::atomic<int>& allRemovals,
std::scoped_lock<std::recursive_mutex> const&)
{
return std::thread([&, this]() {
return std::thread([&, this] {
// NOLINTBEGIN https://github.com/XRPLF/rippled/issues/7056
int cacheRemovals = 0;
int mapRemovals = 0;

View File

@@ -195,7 +195,8 @@ private:
{
// Local lambda that converts a single hex char to four bits and
// ORs those bits into a uint32_t.
auto hexCharToUInt = [](char c, std::uint32_t shift, std::uint32_t& accum) -> ParseResult {
auto const hexCharToUInt =
[](char c, std::uint32_t shift, std::uint32_t& accum) -> ParseResult {
std::uint32_t nibble = 0xFFu;
if (c < '0' || c > 'f')
return ParseResult::BadChar;
@@ -453,7 +454,7 @@ public:
{
for (int i = kWidth - 1; i >= 0; --i)
{
auto prev = data_[i];
auto const prev = data_[i];
data_[i] = boost::endian::native_to_big(boost::endian::big_to_native(data_[i]) - 1);
if (prev != 0)

View File

@@ -17,7 +17,7 @@
namespace xrpl {
template <typename Key>
static std::size_t
std::size_t
extract(Key const& key)
{
return key;
@@ -365,7 +365,7 @@ public:
size() const
{
std::size_t ret = 0;
for (auto& p : map_)
for (auto const& p : map_)
ret += p.size();
return ret;
}

View File

@@ -1604,7 +1604,7 @@ AgedOrderedContainer<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>::erase(
beast::detail::AgedContainerIterator<IsConst, Iterator> pos)
requires(!IsBoostReverseIterator<Iterator>::value)
{
unlinkAndDeleteElement(&*((pos++).iterator()));
unlinkAndDeleteElement(&*(pos++).iterator());
return beast::detail::AgedContainerIterator<false, Iterator>(pos.iterator());
}
@@ -1617,7 +1617,7 @@ AgedOrderedContainer<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>::erase(
requires(!IsBoostReverseIterator<Iterator>::value)
{
for (; first != last;)
unlinkAndDeleteElement(&*((first++).iterator()));
unlinkAndDeleteElement(&*(first++).iterator());
return beast::detail::AgedContainerIterator<false, Iterator>(first.iterator());
}

View File

@@ -2404,7 +2404,7 @@ beast::detail::AgedContainerIterator<false, Iterator>
AgedUnorderedContainer<IsMulti, IsMap, Key, T, Clock, Hash, KeyEqual, Allocator>::erase(
beast::detail::AgedContainerIterator<IsConst, Iterator> pos)
{
unlinkAndDeleteElement(&*((pos++).iterator()));
unlinkAndDeleteElement(&*(pos++).iterator());
return beast::detail::AgedContainerIterator<false, Iterator>(pos.iterator());
}
@@ -2424,7 +2424,7 @@ AgedUnorderedContainer<IsMulti, IsMap, Key, T, Clock, Hash, KeyEqual, Allocator>
beast::detail::AgedContainerIterator<IsConst, Iterator> last)
{
for (; first != last;)
unlinkAndDeleteElement(&*((first++).iterator()));
unlinkAndDeleteElement(&*(first++).iterator());
return beast::detail::AgedContainerIterator<false, Iterator>(first.iterator());
}
@@ -2536,7 +2536,7 @@ AgedUnorderedContainer<IsMulti, IsMap, Key, T, Clock, Hash, KeyEqual, Allocator>
return false;
for (auto iter(cbegin()), last(cend()), otherLast(other.cend()); iter != last; ++iter)
{
auto otherIter(other.find(extract(*iter)));
auto const otherIter(other.find(extract(*iter)));
if (otherIter == otherLast)
return false;
}

View File

@@ -68,7 +68,7 @@ struct LexicalCast<Out, std::string_view>
if (first != last && *first == '+')
++first;
auto ret = std::from_chars(first, last, out);
auto const ret = std::from_chars(first, last, out);
return ret.ec == std::errc() && ret.ptr == last;
}

View File

@@ -390,7 +390,7 @@ void
hash_append(Hasher& h, boost::container::flat_set<Key, Compare, Alloc> const& v) noexcept
requires(IsContiguouslyHashable<Key, Hasher>::value)
{
h(&(v.begin()), v.size() * sizeof(Key));
h(&v.begin(), v.size() * sizeof(Key));
}
// tuple

View File

@@ -8,7 +8,7 @@ namespace beast::insight {
class HookImpl : public std::enable_shared_from_this<HookImpl>
{
public:
using HandlerType = std::function<void(void)>;
using HandlerType = std::function<void()>;
virtual ~HookImpl() = 0;
};

View File

@@ -61,7 +61,7 @@ isMulticast(Address const& addr)
inline bool
isPrivate(Address const& addr)
{
return (addr.is_v4()) ? isPrivate(addr.to_v4()) : isPrivate(addr.to_v6());
return addr.is_v4() ? isPrivate(addr.to_v4()) : isPrivate(addr.to_v6());
}
/**
@@ -70,7 +70,7 @@ isPrivate(Address const& addr)
inline bool
isPublic(Address const& addr)
{
return (addr.is_v4()) ? isPublic(addr.to_v4()) : isPublic(addr.to_v6());
return addr.is_v4() ? isPublic(addr.to_v4()) : isPublic(addr.to_v6());
}
} // namespace ip

View File

@@ -83,7 +83,7 @@ trimRight(String const& s)
{
using std::begin;
using std::end;
auto first(begin(s));
auto const first(begin(s));
auto last(end(s));
last = trimRight(first, last);
return {first, last};

View File

@@ -34,7 +34,7 @@ typeName()
name += " volatile";
if (std::is_lvalue_reference_v<T>)
{
name += "&";
name += '&';
}
else if (std::is_rvalue_reference_v<T>)
{

View File

@@ -32,7 +32,7 @@ public:
Module,
// Match nothing (used internally)
None
None,
};
private:

View File

@@ -20,7 +20,7 @@ namespace beast::unit_test {
namespace detail {
template <class String>
static std::string
std::string
makeReason(String const& reason, char const* file, int line)
{
std::string s(reason);

View File

@@ -47,8 +47,8 @@ public:
template <class F, class... Args>
explicit Thread(Suite& s, F&& f, Args&&... args) : s_(&s)
{
std::function<void(void)> b = [f = std::forward<F>(f),
... args = std::forward<Args>(args)]() mutable {
std::function<void()> b = [f = std::forward<F>(f),
... args = std::forward<Args>(args)] mutable {
std::invoke(f, args...);
};
t_ = std::thread(&Thread::run, this, std::move(b));
@@ -94,7 +94,7 @@ public:
private:
void
run(std::function<void(void)> f)
run(std::function<void()> f)
{
try
{

View File

@@ -24,7 +24,7 @@ enum class Severity : std::uint8_t {
Fatal = 5,
Disabled = 6,
None = Disabled
None = Disabled,
};
/**

View File

@@ -18,7 +18,7 @@ enum class Type : std::uint8_t {
PrefixSha256 = 1,
ThresholdSha256 = 2,
RsaSha256 = 3,
Ed25519Sha256 = 4
Ed25519Sha256 = 4,
};
class Condition

View File

@@ -49,7 +49,7 @@ public:
using namespace der;
auto p = parsePreamble(s, ec);
auto const p = parsePreamble(s, ec);
if (ec)
return nullptr;

View File

@@ -21,7 +21,7 @@ enum class Error {
UnexpectedTag,
LongTag,
LargeSize,
PreimageTooLong
PreimageTooLong,
};
std::error_code

View File

@@ -396,7 +396,7 @@ inline bool
getIfExists<bool>(Section const& section, std::string const& name, bool& v)
{
int intVal = 0;
auto stat = getIfExists(section, name, intVal);
auto const stat = getIfExists(section, name, intVal);
if (stat)
v = bool(intVal);
return stat;

View File

@@ -94,6 +94,7 @@ struct Keys
static constexpr auto kBbtOptions = "bbt_options";
static constexpr auto kBgThreads = "bg_threads";
static constexpr auto kBlockSize = "block_size";
static constexpr auto kBytecodeSizeLimit = "bytecode_size_limit";
static constexpr auto kCacheAge = "cache_age";
static constexpr auto kCacheMb = "cache_mb";
static constexpr auto kCacheSize = "cache_size";
@@ -108,6 +109,8 @@ struct Keys
static constexpr auto kFileSizeMult = "file_size_mult";
static constexpr auto kFilterBits = "filter_bits";
static constexpr auto kFilterFull = "filter_full";
static constexpr auto kGasLimit = "gas_limit";
static constexpr auto kGasPrice = "gas_price";
static constexpr auto kHardSet = "hard_set";
static constexpr auto kHighThreads = "high_threads";
static constexpr auto kHoldTime = "hold_time";

View File

@@ -93,14 +93,14 @@ public:
void
check(std::vector<TxID> accepted, Predicate&& pred)
{
auto acceptTxid = accepted.begin();
auto const acceptTxid = accepted.begin();
auto const ae = accepted.end();
std::sort(acceptTxid, ae);
// We want to remove all tracking entries for transactions that were
// accepted as well as those which match the predicate.
auto i = removeIfIntersectOrMatch(
auto const i = removeIfIntersectOrMatch(
tracker_.begin(),
tracker_.end(),
accepted.begin(),

View File

@@ -779,7 +779,7 @@ Consensus<Adaptor>::peerProposalInternal(
{
// update current position
auto peerPosIt = currPeerPositions_.find(peerID);
auto const peerPosIt = currPeerPositions_.find(peerID);
if (peerPosIt != currPeerPositions_.end())
{
@@ -1110,7 +1110,7 @@ Consensus<Adaptor>::checkLedger(std::unique_ptr<std::stringstream> const& clog)
{
CLOG(clog) << "checkLedger. ";
auto netLgr = adaptor_.getPrevLedger(prevLedgerID_, previousLedger_, mode_.get());
auto const netLgr = adaptor_.getPrevLedger(prevLedgerID_, previousLedger_, mode_.get());
CLOG(clog) << "network ledgerid " << netLgr << ", "
<< "previous ledger " << prevLedgerID_ << ". ";
@@ -1159,8 +1159,8 @@ Consensus<Adaptor>::phaseOpen(std::unique_ptr<std::stringstream> const& clog)
// it is shortly before ledger close time
bool const anyTransactions = adaptor_.hasOpenTransactions();
auto proposersClosed = currPeerPositions_.size();
auto proposersValidated = adaptor_.proposersValidated(prevLedgerID_);
auto const proposersClosed = currPeerPositions_.size();
auto const proposersValidated = adaptor_.proposersValidated(prevLedgerID_);
openTime_.tick(clock_.now());
@@ -1669,7 +1669,7 @@ Consensus<Adaptor>::haveConsensus(std::unique_ptr<std::stringstream> const& clog
// CHECKME: should possibly count unacquired TX sets as disagreeing
int agree = 0, disagree = 0;
auto ourPosition = result_->position.position();
auto const ourPosition = result_->position.position();
// Count number of agreements/disagreements with our position
for (auto const& [nodeId, peerPos] : currPeerPositions_)
@@ -1686,7 +1686,7 @@ Consensus<Adaptor>::haveConsensus(std::unique_ptr<std::stringstream> const& clog
++disagree;
}
}
auto currentFinished = adaptor_.proposersFinished(previousLedger_, prevLedgerID_);
auto const currentFinished = adaptor_.proposersFinished(previousLedger_, prevLedgerID_);
JLOG(j_.debug()) << "Checking for TX consensus: agree=" << agree << ", disagree=" << disagree;
@@ -1812,7 +1812,7 @@ Consensus<Adaptor>::createDisputes(TxSetT const& o, std::unique_ptr<std::strings
<< ". ";
JLOG(j_.debug()) << "createDisputes " << result_->txns.id() << " to " << o.id();
auto differences = result_->txns.compare(o);
auto const differences = result_->txns.compare(o);
int dc = 0;
@@ -1826,7 +1826,7 @@ Consensus<Adaptor>::createDisputes(TxSetT const& o, std::unique_ptr<std::strings
"xrpl::Consensus::createDisputes : has disputed transactions");
TxT const tx = inThisSet ? result_->txns.find(txId) : o.find(txId);
auto txID = tx.id();
auto const txID = tx.id();
if (result_->disputes.find(txID) != result_->disputes.end())
continue;
@@ -1837,7 +1837,8 @@ Consensus<Adaptor>::createDisputes(TxSetT const& o, std::unique_ptr<std::strings
tx,
result_->txns.exists(txID),
std::max(prevProposers_, currPeerPositions_.size()),
j_};
j_,
};
// Update all of the available peer's votes on the disputed transaction
for (auto const& [nodeId, peerPos] : currPeerPositions_)

View File

@@ -145,18 +145,26 @@ struct ConsensusParms
std::map<AvalancheState, AvalancheCutoff> const avalancheCutoffs{
// {state, {time, percent, nextState}},
// Initial state: 50% of nodes must vote yes
{AvalancheState::Init,
{.consensusTime = 0, .consensusPct = 50, .next = AvalancheState::Mid}},
{
AvalancheState::Init,
{.consensusTime = 0, .consensusPct = 50, .next = AvalancheState::Mid},
},
// mid-consensus starts after 50% of the previous round time, and
// requires 65% yes
{AvalancheState::Mid,
{.consensusTime = 50, .consensusPct = 65, .next = AvalancheState::Late}},
{
AvalancheState::Mid,
{.consensusTime = 50, .consensusPct = 65, .next = AvalancheState::Late},
},
// late consensus starts after 85% time, and requires 70% yes
{AvalancheState::Late,
{.consensusTime = 85, .consensusPct = 70, .next = AvalancheState::Stuck}},
{
AvalancheState::Late,
{.consensusTime = 85, .consensusPct = 70, .next = AvalancheState::Stuck},
},
// we're stuck after 2x time, requires 95% yes votes
{AvalancheState::Stuck,
{.consensusTime = 200, .consensusPct = 95, .next = AvalancheState::Stuck}},
{
AvalancheState::Stuck,
{.consensusTime = 200, .consensusPct = 95, .next = AvalancheState::Stuck},
},
};
/**

View File

@@ -59,7 +59,7 @@ enum class ConsensusMode {
* if we entered the round observing, but is used to indicate we did
* have the wrongLedger at some point.
*/
SwitchedLedger
SwitchedLedger,
};
inline std::string
@@ -222,7 +222,7 @@ medianCloseOffset(ConsensusCloseTimes const& times)
// Accumulate weight in time order; the first bin to reach halfWeight is
// the (lower) weighted median. Returns true once that bin is found.
auto step = [&](time_point t, std::int64_t w) {
auto const step = [&](time_point t, std::int64_t w) {
XRPL_ASSERT(tally < halfWeight, "xrpl::medianCloseOffset::step : median not yet found");
tally += w;
if (tally >= halfWeight)
@@ -267,7 +267,7 @@ enum class ConsensusState {
No, ///< We do not have consensus
MovedOn, ///< The network has consensus without us
Expired, ///< Consensus time limit has hard-expired
Yes ///< We have consensus along with the network
Yes, ///< We have consensus along with the network
};
/**

View File

@@ -266,7 +266,7 @@ template <class Tx, class NodeId>
void
DisputedTx<Tx, NodeId>::unVote(NodeId const& peer)
{
auto it = votes_.find(peer);
auto const it = votes_.find(peer);
if (it != votes_.end())
{

View File

@@ -211,7 +211,7 @@ struct Node
void
erase(Node const* child)
{
auto it = std::ranges::find_if(
auto const it = std::ranges::find_if(
children, [child](std::unique_ptr<Node> const& curr) { return curr.get() == child; });
XRPL_ASSERT(it != children.end(), "xrpl::Node::erase : valid input");
std::swap(*it, children.back());

View File

@@ -184,7 +184,7 @@ enum class ValStatus {
/**
* Multiple validations by a validator for different ledgers
*/
Conflicting
Conflicting,
};
inline std::string
@@ -366,7 +366,7 @@ private:
removeTrie(std::scoped_lock<Mutex> const&, NodeID const& nodeID, Validation const& val)
{
{
auto it = acquiring_.find(std::make_pair(val.seq(), val.ledgerID()));
auto const it = acquiring_.find(std::make_pair(val.seq(), val.ledgerID()));
if (it != acquiring_.end())
{
it->second.erase(nodeID);
@@ -375,7 +375,7 @@ private:
}
}
{
auto it = lastLedger_.find(nodeID);
auto const it = lastLedger_.find(nodeID);
if (it != lastLedger_.end() && it->second.id() == val.ledgerID())
{
trie_.remove(it->second);
@@ -443,7 +443,7 @@ private:
// Clear any prior acquiring ledger for this node
if (prior)
{
auto it = acquiring_.find(*prior);
auto const it = acquiring_.find(*prior);
if (it != acquiring_.end())
{
it->second.erase(nodeID);
@@ -455,7 +455,7 @@ private:
checkAcquired(lock);
std::pair<Seq, ID> const valPair{val.seq(), val.ledgerID()};
auto it = acquiring_.find(valPair);
auto const it = acquiring_.find(valPair);
if (it != acquiring_.end())
{
it->second.insert(nodeID);
@@ -529,7 +529,7 @@ private:
}
else
{
auto cit = typename decltype(current_)::const_iterator{it};
auto const cit = typename decltype(current_)::const_iterator{it};
// contains a live record
f(cit->first, cit->second);
++it;
@@ -554,7 +554,7 @@ private:
void
byLedger(std::scoped_lock<Mutex> const&, ID const& ledgerID, Pre&& pre, F&& f)
{
auto it = byLedger_.find(ledgerID);
auto const it = byLedger_.find(ledgerID);
if (it != byLedger_.end())
{
// Update set time since it is being used
@@ -857,7 +857,7 @@ public:
if (!preferred)
{
// fall back to majority over acquiring ledgers
auto it = std::ranges::max_element(acquiring_, [](auto const& a, auto const& b) {
auto const it = std::ranges::max_element(acquiring_, [](auto const& a, auto const& b) {
std::pair<Seq, ID> const& aKey = a.first;
typename HashSet<NodeID>::size_type const& aSize = a.second.size();
std::pair<Seq, ID> const& bKey = b.first;
@@ -937,7 +937,7 @@ public:
return (preferred->first >= minSeq) ? preferred->second : lcl.id();
// Otherwise, rely on peer ledgers
auto it = std::ranges::max_element(peerCounts, [](auto const& a, auto const& b) {
auto const it = std::ranges::max_element(peerCounts, [](auto const& a, auto const& b) {
// Prefer larger counts, then larger ids on ties
// (max_element expects this to return true if a < b)
return std::tie(a.second, a.first) < std::tie(b.second, b.first);

View File

@@ -156,7 +156,7 @@ public:
{
if (!allClosuresDoneCond_.wait_for(lock, wait, [this] { return closureCount_ == 0; }))
{
if (auto stream = j.error())
if (auto const stream = j.error())
stream << name << " waiting for ClosureCounter::join().";
allClosuresDoneCond_.wait(lock, [this] { return closureCount_ == 0; });
}

View File

@@ -54,7 +54,7 @@ JobQueue::Coro::post()
}
// sp keeps 'this' alive
if (jq_.addJob(type_, name_, [this, sp = shared_from_this()]() { resume(); }))
if (jq_.addJob(type_, name_, [this, sp = shared_from_this()] { resume(); }))
{
return true;
}
@@ -130,7 +130,7 @@ inline void
JobQueue::Coro::join()
{
std::unique_lock<std::mutex> lk(mutexRun_);
cv_.wait(lk, [this]() { return !running_; });
cv_.wait(lk, [this] { return !running_; });
}
} // namespace xrpl

View File

@@ -37,7 +37,7 @@ enum class HashRouterFlags : std::uint16_t {
PRIVATE6 = 0x2000,
// Used in apply.cpp
PRIVATE7 = 0x4000,
PRIVATE8 = 0x8000
PRIVATE8 = 0x8000,
};
constexpr HashRouterFlags

View File

@@ -30,12 +30,12 @@ private:
using namespace std::chrono_literals;
int const maxLimit = std::numeric_limits<int>::max();
auto add = [this](
JobType jt,
std::string name,
int limit,
std::chrono::milliseconds avgLatency,
std::chrono::milliseconds peakLatency) {
auto const add = [this](
JobType jt,
std::string name,
int limit,
std::chrono::milliseconds avgLatency,
std::chrono::milliseconds peakLatency) {
XRPL_ASSERT(!map.contains(jt), "xrpl::JobTypes::JobTypes::add : unique job type input");
[[maybe_unused]] auto const inserted =

View File

@@ -177,12 +177,13 @@ measureDurationAndLog(
std::chrono::duration<Rep, Period> maxDelay,
beast::Journal const& journal)
{
auto startTime = std::chrono::high_resolution_clock::now();
auto const startTime = std::chrono::high_resolution_clock::now();
auto result = func();
auto endTime = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime);
auto const endTime = std::chrono::high_resolution_clock::now();
auto const duration =
std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime);
if (duration > maxDelay)
{
JLOG(journal.warn()) << actionDescription << " took " << duration.count() << " ms";

Some files were not shown because too many files have changed in this diff Show More