Compare commits

..

118 Commits

Author SHA1 Message Date
Shawn Xie
9bfd78e2fc Add ZKP and ciphertext malleability tests (#6999) 2026-04-28 11:25:40 -04:00
Shawn Xie
5a643b1a7f fix: assorted safety checks (#7030) 2026-04-27 14:36:54 -04:00
yinyiqian1
8457b91b10 Test inconsistent C1 for ConfidentialMPTSend (#7017) 2026-04-24 15:03:26 -04:00
yinyiqian1
4520de22ef Merge pull request #7002 from yinyiqian1/merge-ct2
Merge develop into confidential-transfer
2026-04-23 12:24:22 -04:00
yinyiqian1
b0386622ca fix clang-tidy 2026-04-23 11:38:05 -04:00
yinyiqian1
c53d6aca08 resolve conflicts 2026-04-23 01:05:20 -04:00
yinyiqian1
be8de20a0b Merge branch 'develop' into merge-ct2 2026-04-23 00:41:44 -04:00
yinyiqian1
235547f460 Revert "Merge develop into ConfidentialTransfer (#6987)" (#7001) 2026-04-22 23:57:01 -04:00
yinyiqian1
1e73f3f3ff Merge develop into ConfidentialTransfer (#6987)
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: chuanshanjida <chuanshanjida@outlook.com>
Co-authored-by: Ed Hennis <ed@ripple.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
Co-authored-by: Zhiyuan Wang <96991820+Kassaking7@users.noreply.github.com>
Co-authored-by: Alex Kremer <akremer@ripple.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
Co-authored-by: Sergey Kuznetsov <skuznetsov@ripple.com>
Co-authored-by: JCW <a1q123456@users.noreply.github.com>
Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gregory Tsipenyuk <gregtatcam@users.noreply.github.com>
Co-authored-by: chuanshanjida <chuanshanjida@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
2026-04-22 23:34:03 -04:00
Shawn Xie
2b65b740d0 Add destination tag to ConfidentialMPTSend (#6988) 2026-04-22 17:07:31 -04:00
yinyiqian1
f08121de35 Address coding style comments (#6966) 2026-04-20 13:31:09 -04:00
yinyiqian1
09778f2fec Support compact AND-composed sigma proof (#6859) 2026-04-16 17:51:31 -04:00
Shawn Xie
5229ff5a45 fix: fix pipeline failures (#6850) 2026-04-10 13:42:59 -04:00
Shawn Xie
6a8016f288 Merge develop into confidential-transfer 2026-04-09 11:54:29 -04:00
Shawn Xie
5d38603f90 fix compile and test failure 2026-04-09 11:22:31 -04:00
Shawn Xie
6f4fddc1ae Merge remote-tracking branch 'upstream/develop' into ct-merge-mpt-dex 2026-04-09 11:05:31 -04:00
Peter Chen
4ae17f193f Add JS fields required for Clio mpt_holder_api (#6810) 2026-04-09 10:49:10 -04:00
Peter Chen
36c805692a add batch tests (#6598) 2026-04-08 14:45:11 -04:00
yinyiqian1
5bd7ce1dfd Add tests for confidential delegation with tickets (#6808) 2026-04-08 13:20:59 -04:00
yinyiqian1
0d7bf6948e Add delegation tests for Confidential Transfers (#6729) 2026-04-07 17:45:26 -04:00
Peter Chen
58e38e05f9 add non-curve point tests (#6695) 2026-04-07 13:50:08 -04:00
Shawn Xie
697786afab Merge develop into confidential-transfer
- Resolved conflicts from autogen files and modularization
2026-04-06 15:45:06 -04:00
Shawn Xie
834cb72515 Update autogen files and delegable count 2026-04-06 15:00:07 -04:00
Shawn Xie
261e7d7769 Resolve conflicts 2026-04-06 12:11:45 -04:00
Shawn Xie
042b09563b Merge remote-tracking branch 'upstream/develop' into ct-merge 2026-04-06 11:57:06 -04:00
yinyiqian1
cc2d6cbff6 Integrate mpt_utility SDK for tests (#6705) 2026-04-02 12:04:05 -04:00
yinyiqian1
6f1232140b remove dead functions due to integration (#6683) 2026-03-30 16:37:55 -04:00
Peter Chen
13b3a243a3 add tests: encrypt under wrong public key (#6650) 2026-03-30 10:38:03 -04:00
yinyiqian1
2472ef7df7 Integrate mpt-crypto SDK lib for on-chain verification (#6679) 2026-03-27 16:26:37 -04:00
Shawn Xie
b34ecc476a Add ProofReader and auth/lock and overflow edge case checks (#6651) 2026-03-26 13:16:51 -04:00
Shawn Xie
4c0e6012e3 Handle edge cases checks in flag setting and token deletion (#6596) 2026-03-24 11:41:27 -04:00
Peter Chen
3f749ecf76 tests: add ticket tests (#6576) 2026-03-20 10:52:18 -04:00
Shawn Xie
a43cf94ff7 update sfBlindingFactor to type uint256 and refactor helper functions to return std::optional 2026-03-19 14:04:03 -04:00
Shawn Xie
9f4cf28aea Rename privacy flag and public key names (#6550)
Corresponding spec change:
https://github.com/XRPLF/XRPL-Standards/pull/501

### Field Renames (SFields)

| Before | After |
|--------|-------|
| `sfIssuerElGamalPublicKey` | `sfIssuerEncryptionKey` |
| `sfHolderElGamalPublicKey` | `sfHolderEncryptionKey` |
| `sfAuditorElGamalPublicKey` | `sfAuditorEncryptionKey` |

### Flag Renames

#### Transaction Flags (`tf`)

| Before | After |
|--------|-------|
| `tfMPTCanPrivacy` | `tfMPTCanConfidentialAmount` |

#### Ledger State Flags (`lsf`)

| Before | After |
|--------|-------|
| `lsfMPTCanPrivacy` | `lsfMPTCanConfidentialAmount` |

#### Ledger State Mutable Flags (`lsmf`)

| Before | After |
|--------|-------|
| `lsmfMPTCannotMutatePrivacy` |
`lsmfMPTCannotMutateCanConfidentialAmount` |

#### Transaction Mutable Flags (`tmf`)

| Before | After |
|--------|-------|
| `tmfMPTCannotMutatePrivacy` |
`tmfMPTCannotMutateCanConfidentialAmount` |
| `tmfMPTSetPrivacy` | `tmfMPTSetCanConfidentialAmount` |
| `tmfMPTClearPrivacy` | `tmfMPTClearCanConfidentialAmount` |
2026-03-17 10:53:17 -04:00
Peter Chen
c45177b69e add homomorphic tests (#6490) 2026-03-16 11:27:36 -04:00
Shawn Xie
d615098849 refactor: improve readability and clean up code from review comments (#6544) 2026-03-16 10:47:39 -04:00
Shawn Xie
eeb0d15ea9 refactor: return optional buffers for helper functions (#6520) 2026-03-11 12:02:27 -04:00
Shawn Xie
84cc8599af chore: Apply clang-format width 100 (#6516) 2026-03-10 11:24:01 -04:00
Shawn Xie
36c1c5f3cd Merge develop into confidential-transfer 2026-03-09 16:50:01 -04:00
Shawn Xie
2c94e213c2 Resolve conflicts 2026-03-09 15:32:42 -04:00
Shawn Xie
cbcc75ff2d Merge remote-tracking branch 'upstream/develop' into ct-merge-dev-100col 2026-03-09 15:25:10 -04:00
Shawn Xie
da7698974c Merge commit '2c1fad102353e11293e3edde1c043224e7d3e983' into ct-merge-dev-100col 2026-03-09 14:24:26 -04:00
Shawn Xie
a3a82faa3d fix conflicts and update modularization 2026-03-09 14:23:22 -04:00
Shawn Xie
fff83c1d4a Merge commit '25cca465538a56cce501477f9e5e2c1c7ea2d84c' into ct-merge-dev-100col 2026-03-09 14:02:31 -04:00
Shawn Xie
803ab67fc5 fix: address auditor feedbacks (#6511) 2026-03-09 13:59:32 -04:00
yinyiqian1
734b11c0e3 Support shared r for ConfidentialMPTSend equality proof (#6496)
* Support shared r for send equality proof
2026-03-06 18:28:35 -05:00
Peter Chen
fae34d0f36 tests: add replay tests to confidential MPT (#6451) 2026-03-04 13:43:43 -05:00
yinyiqian1
c52d317810 Update hashing and support ticket (#6444) 2026-02-27 11:50:22 -05:00
Peter Chen
c2f8b91397 Add invariants and tests (#6403) 2026-02-25 16:40:44 -05:00
Peter Chen
1ea9312946 update crypto-lib (#6418) 2026-02-25 12:18:31 -05:00
yinyiqian1
6ad60d7141 Support Range Proof for ConfidentialMPTSend (#6404)
- proving send amount m is in the range [0, 2^64)
- proving remaining balance b-m is in the range [0, 2^64)
2026-02-20 14:18:34 -05:00
Shawn Xie
94e911ed69 Add Range Proof Verification to ConvertBack (#6377) 2026-02-19 19:22:48 -05:00
Shawn Xie
b2c434dd73 Compress ElGamal Public Keys and Pedersen Commitments + Add Validation (#6385) 2026-02-19 08:41:15 -05:00
Peter Chen
b6d1a8d62b Test Auditor for Confidential Send and revealed R (#6320) 2026-02-17 14:27:33 -05:00
Shawn Xie
9d0c854139 Remove hardcoded library functions in ConfidentialTransfer (#6365) 2026-02-12 14:18:36 -05:00
Ayaz Salikhov
3a6ca681ff chore: Use mpt-crypto library (#6362) 2026-02-12 12:59:36 -05:00
Shawn Xie
a216824c15 Merge develop into confidential-transfer 2026-02-12 11:40:07 -05:00
Shawn Xie
90cf86a920 remove newline 2026-02-12 11:33:34 -05:00
Shawn Xie
e69d3c9bd7 Merge remote-tracking branch 'upstream/develop' into ct-merge-develop-lib 2026-02-12 11:14:40 -05:00
Shawn Xie
fd390a4f1c Add doxygen comments for new transactions and helper functions (#6332) 2026-02-10 10:51:50 -05:00
Shawn Xie
3941283438 Prefix confidential transfer transaction names with "MPT" (#6312) 2026-02-02 12:13:18 -05:00
Shawn Xie
86af28d91d Apply clang-format due to new column size (#6311) 2026-02-02 11:15:39 -05:00
Shawn Xie
41f7102fb8 Merge develop into ripple/confidential-transfer
Merge `develop` into `ripple/confidential-transfer`
2026-02-02 09:46:25 -05:00
Shawn Xie
66ed0fa452 namespace rename 2026-01-30 12:36:15 -05:00
Shawn Xie
cad8fb328a Merge branch 'develop' into ct-merge-develop-new 2026-01-30 12:25:55 -05:00
Shawn Xie
31346425f0 Merge commit '5f638f55536def0d88b970d1018a465a238e55f4' into ct-merge-develop-new 2026-01-30 12:25:36 -05:00
Shawn Xie
40bfaa25d2 Merge commit '92046785d1fea5f9efe5a770d636792ea6cab78b' into ct-merge-develop-new 2026-01-30 12:25:16 -05:00
Peter Chen
c4916f1251 Add more Auditor Tests for Convert and ConvertBack (#6255) 2026-01-29 12:17:19 -05:00
yinyiqian1
fc8b7898c5 Support Pedersen-ElGamal linkage for ConfidentialSend (#6289)
* support Pedersen Amount commitment for ConfidentialSend
* support Pedersen Balance commitment for ConfidentialSend
2026-01-29 11:18:46 -05:00
Shawn Xie
446f9fbe6d Reuse getConfidentialRecipientCount (#6281) 2026-01-26 13:04:02 -05:00
yinyiqian1
1297385b7e Support ConfidentialSend equality proof (#6274)
* Support ConfidentialSend equality proof

* resolve conflicts

* Add version check in send
2026-01-26 12:39:35 -05:00
Shawn Xie
114adc0c57 Pedersen commitment with ConvertBack and basic test (#6243) 2026-01-22 13:00:19 -05:00
yinyiqian1
1d349c32c5 fix encrypt zero balance and remove improper throw (#6242) 2026-01-20 12:27:44 -05:00
Shawn Xie
a5f20c129d Copying over pedersen commitment from crypto lib (#6238) 2026-01-19 13:56:10 -05:00
yinyiqian1
75d143a2a0 support new design to reveal blinding factor (#6237)
* reveal blinding factor and optimize
* schnorr proof is added for registering holder pub key
* clean env.close that already closed
* clean up the lib functions
2026-01-19 13:07:19 -05:00
Shawn Xie
e3da98e310 Update unit test framework to use shared random factor (#6233) 2026-01-16 16:36:49 -05:00
Shawn Xie
ec6d7cb91d Add equality proof to ConvertBack and refactor to reduce redundancy (#6220) 2026-01-16 10:28:55 -05:00
Shawn Xie
fa055c2bd5 Add auditing feature across confidential transfer transactions (#6200) 2026-01-14 11:18:06 -05:00
Shawn Xie
6c38086f17 ConfidentialConvert with Equality Proof (#6177) 2026-01-07 16:17:07 -05:00
Shawn Xie
3e9dc276ed add back clawback hash (#6175) 2026-01-06 12:21:00 -05:00
Shawn Xie
abf7a62b1f Refactor proof (#6168) 2026-01-05 12:00:41 -05:00
yinyiqian1
bd3a6e1631 Support equality proof for confidential clawback (#6149) 2026-01-02 11:48:06 -05:00
yinyiqian1
7c0bd419a4 support mutability for MPTPrivacy (#6137)
Update lsfMPTNoConfidentialTransfer to lsfMPTPrivacy
Add flag lsmfMPTPrivacy to control the mutability of lsfMPTPrivacy.
disallow mutating lsfMPTPrivacy when lsfMPTPrivacy is not set.
disallow mutating lsfMPTPrivacy when there's confidential outstanding amount.
2025-12-10 17:10:33 -05:00
yinyiqian1
d3126959e7 Merge pull request #6123 from yinyiqian1/merge
Merge remote-tracking branch 'origin/develop' into 'ripple/confidential-transfer'
2025-12-09 10:49:11 -05:00
yinyiqian1
67e8e89e0f copyright fix 2025-12-08 18:36:34 -05:00
yinyiqian1
4e4326a174 trigger ci 2025-12-08 18:25:47 -05:00
yinyiqian1
5397bd6d6e fix naming 2025-12-08 17:58:32 -05:00
yinyiqian1
6dece25cc3 fix test failure 2025-12-08 17:34:20 -05:00
yinyiqian1
d9da8733be resolve pre-commit clang-format 2025-12-08 16:45:41 -05:00
yinyiqian1
f6f51451e7 Merge remote-tracking branch 'origin/develop' into merge 2025-12-08 15:09:04 -05:00
Shawn Xie
b94c95b3e9 Change err code (#6050) 2025-11-18 14:19:41 -05:00
yinyiqian1
8365148b5c feat: support ConfidentialClawback and add tests (#6023) 2025-11-13 14:24:40 -05:00
Shawn Xie
c03866bf0f Variable rename (#6028) 2025-11-12 11:58:05 -05:00
Shawn Xie
389afc5f06 Add deposit preauth and other checks (#6011) 2025-11-10 10:52:23 -05:00
Shawn Xie
7b04eaae81 ConvertBack preclaim tests (#6006) 2025-11-05 13:58:52 -05:00
Shawn Xie
1343019509 ConvertBack tests (#6005) 2025-11-05 13:52:55 -05:00
Shawn Xie
cd75e630a2 Change ConfidentialSend preflight error code (#5994) 2025-11-03 18:46:27 -05:00
Shawn Xie
ec57fbdc5f Merge remote-tracking branch 'upstream/develop' into confidential-transfer 2025-11-03 18:42:41 -05:00
Shawn Xie
4fe67f5715 ConvertBack preflight tests (#5991) 2025-11-03 15:58:32 -05:00
Shawn Xie
44d885e39b Basic ConvertBack test (#5979) 2025-10-31 11:46:24 -04:00
yinyiqian1
3af758145c Check auth for ConfidentialSend (#5968) 2025-10-30 11:02:46 -04:00
yinyiqian1
f3d4d4341b add ciphertext check for ConfidentialSend (#5964) 2025-10-29 12:10:48 -04:00
Shawn Xie
ddb518ad09 MergeInbox tests (#5949) 2025-10-28 13:21:11 -04:00
Shawn Xie
3899e3f36c Add auth checks for convert (#5937) 2025-10-24 11:42:43 -04:00
yinyiqian1
e4a8ba51f9 check lock in ConfidentialSend (#5933) 2025-10-23 12:58:38 -04:00
Shawn Xie
35e4fad557 Add ciphertext check (#5930) 2025-10-23 11:57:18 -04:00
yinyiqian1
8e9cb3c1da support ConfidentialSend (#5921) 2025-10-22 12:02:00 -04:00
Shawn Xie
18d92058e3 MergeInbox (#5922) 2025-10-22 11:30:44 -04:00
Shawn Xie
f24d584f29 ConfidentialConvert tests (#5911) 2025-10-20 14:39:16 -04:00
Shawn Xie
da3fbcd25b Remove unused header file (#5908) 2025-10-17 16:42:08 -04:00
Shawn Xie
daa1303b5a Update decryption test helper function (#5907) 2025-10-17 14:19:19 -04:00
Shawn Xie
a636fe5871 Update test framework for encryption (#5906) 2025-10-17 14:04:54 -04:00
Shawn Xie
bbc3071fd1 Update mpt-crypto with zero encryption (#5905) 2025-10-17 11:41:39 -04:00
Shawn Xie
8fdc639206 ConfidentialConvert (#5901)
ConfidentialConvert and some test framework update
2025-10-16 14:31:14 -04:00
Shawn Xie
5a89641d98 remove duplicate code 2025-10-07 15:52:18 -04:00
Shawn Xie
beefa248a6 Merge remote-tracking branch 'upstream/develop' into confidential-transfer 2025-10-07 15:00:14 -04:00
Shawn Xie
e919a25ecb Merge develop into ripple/confidential-transfer (#5835)
* Fix: Don't flag consensus as stalled prematurely (#5658)

Fix stalled consensus detection to prevent false positives in situations where there are no disputed transactions.

Stalled consensus detection was added to 2.5.0 in response to a network consensus halt that caused a round to run for over an hour. However, it has a flaw that makes it very easy to have false positives. Those false positives are usually mitigated by other checks that prevent them from having an effect, but there have been several instances of validators "running ahead" because there are circumstances where the other checks are "successful", allowing the stall state to be checked.

* Set version to 2.5.1

* fix: Skip processing transaction batch if the batch is empty (#5670)

Avoids an assertion failure in NetworkOPsImp::apply in the unlikely event that all incoming transactions are invalid.

* Fix: EscrowTokenV1 (#5571)

* resolves an accounting inconsistency in MPT escrows where transfer fees were not properly handled when unlocking escrowed tokens.

* refactor: Wrap GitHub CI conditionals in curly braces (#5796)

This change wraps all GitHub conditionals in `${{ .. }}`, both for consistency and to reduce unexpected failures, because it was previously noticed that not all conditionals work without those curly braces.

* Only notify clio for PRs targeting the release and master branches (#5794)

Clio should only be notified when releases are about to be made, instead of for all PR, so this change only notifies Clio when a PR targets the release or master branch.

* Support DynamicMPT XLS-94d (#5705)

* extends the functionality of the MPTokenIssuanceSet transaction, allowing the issuer to update fields or flags that were explicitly marked as mutable during creation.

* Bugfix: Adds graceful peer disconnection (#5669)

The XRPL establishes connections in three stages: first a TCP connection, then a TLS/SSL handshake to secure the connection, and finally an upgrade to the bespoke XRP Ledger peer-to-peer protocol. During connection termination, xrpld directly closes the TCP connection, bypassing the TLS/SSL shutdown handshake. This makes peer disconnection diagnostics more difficult - abrupt TCP termination appears as if the peer crashed rather than disconnected gracefully.

This change refactors the connection lifecycle with the following changes:
- Enhanced outgoing connection logic with granular timeouts for each connection stage (TCP, TLS, XRPL handshake) to improve diagnostic capabilities
- Updated both PeerImp and ConnectAttempt to use proper asynchronous TLS shutdown procedures for graceful connection termination

* Downgrade to boost 1.83

* Set version to 2.6.1-rc1

* chore: Use self hosted windows runners (#5780)

This changes switches from the GitHub-managed Windows runners to self-hosted runners to significantly reduce build time.

* Rename mutable flags (#5797)

This is a minor change on top of #5705

* fix(amendment): Add missing fields for keylets to ledger objects (#5646)

This change adds a fix amendment (`fixIncludeKeyletFields`) that adds:
* `sfSequence` to `Escrow` and `PayChannel`
* `sfOwner` to `SignerList`
* `sfOracleDocumentID` to `Oracle`

This ensures that all ledger entries hold all the information needed to determine their keylet.

* chore: Limits CI build and test parallelism to reduce resource contention (#5799)

GitHub runners have a limit on how many concurrent jobs they can actually process (even though they will try to run them all at the same time), and similarly the Conan remote cannot handle hundreds of concurrent requests. Previously, the Conan dependency uploading was already limited to max 10 jobs running in parallel, and this change makes the same change to the build+test workflow.

* chore: Build and test all configs for daily scheduled run (#5801)

This change re-enables building and testing all configurations, but only for the daily scheduled run. Previously all configurations were run for each merge into the develop branch, but that overwhelmed both the GitHub runners and the Conan remote, and thus they were limited to just a subset of configurations. Now that the number of jobs is limited via `max-parallel: 10`, we should be able to safely enable building all configurations again. However, building them all once a day instead of for each PR merge should be sufficient.

* chore: Add unit tests dir to code coverage excludes (#5803)

This change excludes unit test code from code coverage reporting.

* refactor: Modularise ledger (#5493)

This change moves the ledger code to libxrpl.

* Mark PermissionDelegation as unsupported

* Set version to 2.6.1-rc2

* Miscellaneous refactors and updates (#5590)

- Added a new Invariant: `ValidPseudoAccounts` which checks that all pseudo-accounts behave consistently through creation and updates, and that no "real" accounts look like pseudo-accounts (which means they don't have a 0 sequence). 
- `to_short_string(base_uint)`. Like `to_string`, but only returns the first 8 characters. (Similar to how a git commit ID can be abbreviated.) Used as a wrapped sink to prefix most transaction-related messages. More can be added later.
- `XRPL_ASSERT_PARTS`. Convenience wrapper for `XRPL_ASSERT`, which takes the `function` and `description` as separate parameters.
- `SField::sMD_PseudoAccount`. Metadata option for `SField` definitions to indicate that the field, if set in an `AccountRoot` indicates that account is a pseudo-account. Removes the need for hard-coded field lists all over the place. Added the flag to `AMMID` and `VaultID`.
- Added functionality to `SField` ctor to detect both code and name collisions using asserts. And require all SFields to have a name
- Convenience type aliases `STLedgerEntry::const_pointer` and `STLedgerEntry::const_ref`. (`SLE` is an alias to `STLedgerEntry`.)
- Generalized `feeunit.h` (`TaggedFee`) into `unit.h` (`ValueUnit`) and added new "BIPS"-related tags for future use. Also refactored the type restrictions to use Concepts.
- Restructured `transactions.macro` to do two big things
	1. Include the `#include` directives for transactor header files directly in the macro file. Removes the need to update `applySteps.cpp` and the resulting conflicts.
	2. Added a `privileges` parameter to the `TRANSACTION` macro, which specifies some of the operations a transaction is allowed to do. These `privileges` are enforced by invariant checks. Again, removed the need to update scattered lists of transaction types in various checks.
- Unit tests:
	1.  Moved more helper functions into `TestHelpers.h` and `.cpp`. 
	2. Cleaned up the namespaces to prevent / mitigate random collisions and ambiguous symbols, particularly in unity builds.
	3. Generalized `Env::balance` to add support for `MPTIssue` and `Asset`.
	4. Added a set of helper classes to simplify `Env` transaction parameter classes: `JTxField`, `JTxFieldWrapper`, and a bunch of classes derived or aliased from it. For an example of how awesome it is, check the changes `src/test/jtx/escrow.h` for how much simpler the definitions are for `finish_time`, `cancel_time`, `condition`, and `fulfillment`. 
	5. Generalized several of the amount-related helper classes to understand `Asset`s.
     6. `env.balance` for an MPT issuer will return a negative number (or 0) for consistency with IOUs.

* refactor: Simplify STParsedJSON with some helper functions (#5591)

- Add code coverage for STParsedJSON edge cases

Co-authored-by: Denis Angell <dangell@transia.co>

* test: Add STInteger and STParsedJSON tests (#5726)

This change is to improve code coverage (and to simplify #5720 and #5725); there is otherwise no change in functionality. The change adds basic tests for `STInteger` and `STParsedJSON`, so it becomes easier to test smaller changes to the types, as well as removes `STParsedJSONArray`, since it is not used anywhere (including in Clio).

* Revert "Update Conan dependencies: OpenSSL" (#5807)

This change reverts #5617, because it will require extensive testing that will take up more time than we have before the next scheduled release.

Reverting this change does not mean we are abandoning it. We aim to pick it back up once there's a sufficient time window to allow for testing on multiple distros running a mixture of OpenSSL 1.x and 3.x.

* docs: Add warning about using std::counting_semaphore (#5595)

This adds a comment to avoid using `std::counting_semaphore` until the minimum compiler versions of GCC and Clang have been updated to no longer contain the bug that is present in older compilers.

* Improve ValidatorList invalid UNL manifest logging (#5804)

This change raises logging severity from `INFO` to `WARN` when handling UNL manifest signed with an unexpected / invalid key. It also changes the internal error code for an invalid format of UNL manifest to `invalid` (from `untrusted`).

This is a follow up to problems experienced by an UNL node due to old manifest key configured in `validators.txt`, which would be easier to diagnose with improved logging.

It also replaces a log line with `UNREACHABLE` for an impossible situation when we match UNL manifest key against a configured key which has an invalid type (we cannot configure such a key because of checks when loading configured keys).

* chore: Pin all CI Docker tags (#5813)

To avoid surprises and ensure reproducibility, this change pins all CI Docker image tags to the latest version in the XRPLF/CI repo.

* change `fixPriceOracleOrder` to `Supported::yes` (#5749)

* fix: Address http header case sensitivity (#5767)

This change makes the regex in `HttpClient.cpp` that matches the content-length http header case insensitive to improve compatibility, as http headers are case insensitive.

* test: add more comprehensive tests for `FeeVote` (#5746)

This change adds more comprehensive tests for the `FeeVote` module, which previously only checked the basics, and not the more comprehensive flows in that class.

* ci: Call all reusable workflows reusable (#5818)

* Add `STInt32` as a new `SType` (#5788)

This change adds `STInt32` as a new `SType` under the `STInteger` umbrella, with `SType` value `12`. This is the first and only `STInteger` type that supports negative values.

* switch `fixIncludeKeyletFields` to `Supported::yes` (#5819)

* refactor: Restructure Transactor::preflight to reduce boilerplate (#5592)

* Restructures `Transactor::preflight` to create several functions that will remove the need for error-prone boilerplate code in derived classes' implementations of `preflight`.

* refactor: Add support for extra transaction signatures (#5594)

* Restructures Transactor signature checking code to be able to handle a `sigObject`, which may be the full transaction, or may be an object field containing a separate signature. Either way, the `sigObject` can be a single- or multi-sign signature.

* ci: Upload artifacts during build and test in a separate job (#5817)

* chore: Set free-form CI inputs as env vars (#5822)

This change moves CI values that could be user-provided into environment variables.

* Rename flags for DynamicMPT (#5820)

* Set version to 2.6.1

* fix: FD/handle guarding + exponential backoff (#5823)

* fix: Transaction sig checking functions do not get a full context (#5829)

Fixes a (currently harmless) bug introduced by PR #5594

* Remove bogus coverage warning (#5838)

* fix return type

---------

Co-authored-by: Ed Hennis <ed@ripple.com>
Co-authored-by: Jingchen <a1q123456@users.noreply.github.com>
Co-authored-by: Denis Angell <dangell@transia.co>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
Co-authored-by: yinyiqian1 <yqian@ripple.com>
Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Bronek Kozicki <brok@incorrekt.com>
Co-authored-by: Mayukha Vadari <mvadari@ripple.com>
Co-authored-by: Valentin Balaschenko <13349202+vlntb@users.noreply.github.com>
Co-authored-by: tequ <git@tequ.dev>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2025-10-07 14:14:34 -04:00
Shawn Xie
c3fdbc0430 SFields and formats (#5795) 2025-10-01 17:02:11 +00:00
408 changed files with 21661 additions and 4624 deletions

View File

@@ -66,14 +66,14 @@ Checks: "-*,
bugprone-terminating-continue,
bugprone-throw-keyword-missing,
bugprone-too-small-loop-variable,
bugprone-unchecked-optional-access,
# bugprone-unchecked-optional-access, # see https://github.com/XRPLF/rippled/pull/6502
bugprone-undefined-memory-manipulation,
bugprone-undelegated-constructor,
bugprone-unhandled-exception-at-new,
bugprone-unhandled-self-assignment,
bugprone-unique-ptr-array-mismatch,
bugprone-unsafe-functions,
bugprone-use-after-move,
bugprone-use-after-move, # has issues
bugprone-unused-raii,
bugprone-unused-return-value,
bugprone-unused-local-non-trivial-variable,
@@ -106,7 +106,6 @@ Checks: "-*,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-nodiscard,
modernize-use-override,
modernize-use-ranges,
modernize-use-starts-ends-with,

View File

@@ -93,7 +93,6 @@ test.core > xrpl.basics
test.core > xrpl.core
test.core > xrpld.core
test.core > xrpl.json
test.core > xrpl.protocol
test.core > xrpl.rdb
test.core > xrpl.server
test.csf > xrpl.basics
@@ -188,16 +187,10 @@ test.toplevel > xrpl.json
test.unit_test > xrpl.basics
test.unit_test > xrpl.protocol
tests.libxrpl > xrpl.basics
tests.libxrpl > xrpl.core
tests.libxrpl > xrpl.json
tests.libxrpl > xrpl.ledger
tests.libxrpl > xrpl.net
tests.libxrpl > xrpl.nodestore
tests.libxrpl > xrpl.protocol
tests.libxrpl > xrpl.protocol_autogen
tests.libxrpl > xrpl.server
tests.libxrpl > xrpl.shamap
tests.libxrpl > xrpl.tx
xrpl.conditions > xrpl.basics
xrpl.conditions > xrpl.protocol
xrpl.core > xrpl.basics

View File

@@ -51,21 +51,20 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
# Only generate a subset of configurations in PRs.
if not all:
# Debian:
# - Bookworm using GCC 13: Debug on linux/amd64, set the reference
# fee to 500 and enable code coverage (which will be done below).
# - Bookworm using GCC 15: Debug on linux/amd64, enable Address and
# UB sanitizers (which will be done below).
# - Bookworm using GCC 13: Release on linux/amd64, set the reference
# fee to 500.
# - Bookworm using GCC 15: Debug on linux/amd64, enable code
# coverage (which will be done below).
# - Bookworm using Clang 16: Debug on linux/amd64, enable voidstar.
# - Bookworm using Clang 17: Release on linux/amd64, set the
# reference fee to 1000.
# - Bookworm using Clang 20: Debug on linux/amd64, enable Address
# and UB sanitizers (which will be done below).
# - Bookworm using Clang 20: Debug on linux/amd64.
if os["distro_name"] == "debian":
skip = True
if os["distro_version"] == "bookworm":
if (
f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-13"
and build_type == "Debug"
and build_type == "Release"
and architecture["platform"] == "linux/amd64"
):
cmake_args = f"-DUNIT_TEST_REFERENCE_FEE=500 {cmake_args}"
@@ -194,11 +193,11 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
):
continue
# Enable code coverage for Debian Bookworm using GCC 13 in Debug on
# linux/amd64.
# Enable code coverage for Debian Bookworm using GCC 15 in Debug on
# linux/amd64
if (
f"{os['distro_name']}-{os['distro_version']}" == "debian-bookworm"
and f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-13"
and f"{os['compiler_name']}-{os['compiler_version']}" == "gcc-15"
and build_type == "Debug"
and architecture["platform"] == "linux/amd64"
):
@@ -235,39 +234,23 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
# Add the configuration to the list, with the most unique fields first,
# so that they are easier to identify in the GitHub Actions UI, as long
# names get truncated.
# Add Address and UB sanitizers as separate configurations for specific
# bookworm distros. Thread sanitizer is currently disabled (see below).
# Add Address and Thread (both coupled with UB) sanitizers for specific bookworm distros.
# GCC-Asan xrpld-embedded tests are failing because of https://github.com/google/sanitizers/issues/856
if os[
"distro_version"
] == "bookworm" and f"{os['compiler_name']}-{os['compiler_version']}" in [
"gcc-15",
"clang-20",
]:
# Add ASAN configuration.
if (
os["distro_version"] == "bookworm"
and f"{os['compiler_name']}-{os['compiler_version']}" == "clang-20"
):
# Add ASAN + UBSAN configuration.
configurations.append(
{
"config_name": config_name + "-asan",
"config_name": config_name + "-asan-ubsan",
"cmake_args": cmake_args,
"cmake_target": cmake_target,
"build_only": build_only,
"build_type": build_type,
"os": os,
"architecture": architecture,
"sanitizers": "address",
}
)
# Add UBSAN configuration.
configurations.append(
{
"config_name": config_name + "-ubsan",
"cmake_args": cmake_args,
"cmake_target": cmake_target,
"build_only": build_only,
"build_type": build_type,
"os": os,
"architecture": architecture,
"sanitizers": "undefinedbehavior",
"sanitizers": "address,undefinedbehavior",
}
)
# TSAN is deactivated due to seg faults with latest compilers.

View File

@@ -88,6 +88,7 @@ find_package(ed25519 REQUIRED)
find_package(gRPC REQUIRED)
find_package(LibArchive REQUIRED)
find_package(lz4 REQUIRED)
find_package(mpt-crypto REQUIRED)
find_package(nudb REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(secp256k1 REQUIRED)
@@ -100,6 +101,7 @@ target_link_libraries(
INTERFACE
ed25519::ed25519
lz4::lz4
mpt-crypto::mpt-crypto
OpenSSL::Crypto
OpenSSL::SSL
secp256k1::secp256k1

View File

@@ -22,10 +22,117 @@ Responsible investigation includes, but isn't limited to, the following:
- Not targeting physical security measures, or attempting to use social engineering, spam, distributed denial of service (DDOS) attacks, etc.
- Investigating bugs in a way that makes a reasonable, good faith effort not to be disruptive or harmful to the XRP Ledger and the broader ecosystem.
### Responsible Disclosure
If you discover a vulnerability or potential threat, or if you _think_
you have, please reach out by dropping an email using the contact
information below.
Your report should include the following:
- Your contact information (typically, an email address);
- The description of the vulnerability;
- The attack scenario (if any);
- The steps to reproduce the vulnerability;
- Any other relevant details or artifacts, including code, scripts or patches.
In your email, please describe the issue or potential threat. If possible, include a "repro" (code that can reproduce the issue) or describe the best way to reproduce and replicate the issue. Please make your report as detailed and comprehensive as possible.
For more information on responsible disclosure, please read this [Wikipedia article](https://en.wikipedia.org/wiki/Responsible_disclosure).
## Report Handling Process
Please report the bug directly to us and limit further disclosure. If you want to prove that you knew the bug as of a given time, consider using a cryptographic pre-commitment: hash the content of your report and publish the hash on a medium of your choice (e.g. on Twitter or as a memo in a transaction) as "proof" that you had written the text at a given point in time.
Once we receive a report, we:
1. Assign two people to independently evaluate the report;
2. Consider their recommendations;
3. If action is necessary, formulate a plan to address the issue;
4. Communicate privately with the reporter to explain our plan.
5. Prepare, test and release a version which fixes the issue; and
6. Announce the vulnerability publicly.
We will triage and respond to your disclosure within 24 hours. Beyond that, we will work to analyze the issue in more detail, formulate, develop and test a fix.
While we commit to responding with 24 hours of your initial report with our triage assessment, we cannot guarantee a response time for the remaining steps. We will communicate with you throughout this process, letting you know where we are and keeping you updated on the timeframe.
## Bug Bounty Program
[Ripple](https://ripple.com) is generously sponsoring a bug bounty program for vulnerabilities in [`xrpld`](https://github.com/XRPLF/rippled) (and other related projects, like [`Clio`](https://github.com/XRPLF/clio), [`xrpl.js`](https://github.com/XRPLF/xrpl.js), [`xrpl-py`](https://github.com/XRPLF/xrpl-py), [`xrpl4j`](https://github.com/XRPLF/xrpl4j)).
[Ripple](https://ripple.com) is generously sponsoring a bug bounty program for vulnerabilities in [`xrpld`](https://github.com/XRPLF/rippled) (and other related projects, like [`xrpl.js`](https://github.com/XRPLF/xrpl.js), [`xrpl-py`](https://github.com/XRPLF/xrpl-py), [`xrpl4j`](https://github.com/XRPLF/xrpl4j)).
This program allows us to recognize and reward individuals or groups that identify and report bugs.
This program allows us to recognize and reward individuals or groups that identify and report bugs. In summary, in order to qualify for a bounty, the bug must be:
We have partnered with Bugcrowd to manage this program. It is a private program, and security researchers can participate based on invitation. If you need access to the program, please email bugs@ripple.com with your Bugcrowd handle or Bugcrowd registered email, and we will get you added to the program. Once you have been added, please submit vulnerability reports through Bugcrowd, not by email. The detailed bug bounty policy is available on the Bugcrowd website.
1. **In scope**. Only bugs in software under the scope of the program qualify. Currently, that means `xrpld`, `xrpl.js`, `xrpl-py`, `xrpl4j`.
2. **Relevant**. A security issue, posing a danger to user funds, privacy, or the operation of the XRP Ledger.
3. **Original and previously unknown**. Bugs that are already known and discussed in public do not qualify. Previously reported bugs, even if publicly unknown, are not eligible.
4. **Specific**. We welcome general security advice or recommendations, but we cannot pay bounties for that.
5. **Fixable**. There has to be something we can do to permanently fix the problem. Note that bugs in other peoples software may still qualify in some cases. For example, if you find a bug in a library that we use which can compromise the security of software that is in scope and we can get it fixed, you may qualify for a bounty.
6. **Unused**. If you use the exploit to attack the XRP Ledger, you do not qualify for a bounty. If you report a vulnerability used in an ongoing or past attack and there is specific, concrete evidence that suggests you are the attacker we reserve the right not to pay a bounty.
The amount paid varies dramatically. Vulnerabilities that are harmless on their own, but could form part of a critical exploit will usually receive a bounty. Full-blown exploits can receive much higher bounties. Please dont hold back partial vulnerabilities while trying to construct a full-blown exploit. We will pay a bounty to anyone who reports a complete chain of vulnerabilities even if they have reported each component of the exploit separately and those vulnerabilities have been fixed in the meantime. However, to qualify for a the full bounty, you must to have been the first to report each of the partial exploits.
### Contacting Us
To report a qualifying bug, please send a detailed report to:
| Email Address | bugs@ripple.com |
| :-----------: | :-------------------------------------------------- |
| Short Key ID | `0xA9F514E0` |
| Long Key ID | `0xD900855AA9F514E0` |
| Fingerprint | `B72C 0654 2F2A E250 2763 A268 D900 855A A9F5 14E0` |
The full PGP key for this address, which is also available on several key servers (e.g. on [keyserver.ubuntu.com](https://keyserver.ubuntu.com)), is:
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGkSZAQBEACprU199OhgdsOsygNjiQV4msuN3vDOUooehL+NwfsGfW79Tbqq
Q2u7uQ3NZjW+M2T4nsDwuhkr7pe7xSReR5W8ssaczvtUyxkvbMClilcgZ2OSCAuC
N9tzJsqOqkwBvXoNXkn//T2jnPz0ZU2wSF+NrEibq5FeuyGdoX3yXXBxq9pW9HzK
HkQll63QSl6BzVSGRQq+B6lGgaZGLwf3mzmIND9Z5VGLNK2jKynyz9z091whNG/M
kV+E7/r/bujHk7WIVId07G5/COTXmSr7kFnNEkd2Umw42dkgfiNKvlmJ9M7c1wLK
KbL9Eb4ADuW6rRc5k4s1e6GT8R4/VPliWbCl9SE32hXH8uTkqVIFZP2eyM5WRRHs
aKzitkQG9UK9gcb0kdgUkxOvvgPHAe5IuZlcHFzU4y0dBbU1VEFWVpiLU0q+IuNw
5BRemeHc59YNsngkmAZ+/9zouoShRusZmC8Wzotv75C2qVBcjijPvmjWAUz0Zunm
Lsr+O71vqHE73pERjD07wuD/ISjiYRYYE/bVrXtXLZijC7qAH4RE3nID+2ojcZyO
/2jMQvt7un56RsGH4UBHi3aBHi9bUoDGCXKiQY981cEuNaOxpou7Mh3x/ONzzSvk
sTV6nl1LOZHykN1JyKwaNbTSAiuyoN+7lOBqbV04DNYAHL88PrT21P83aQARAQAB
tB1SaXBwbGUgTGFicyA8YnVnc0ByaXBwbGUuY29tPokCTgQTAQgAOBYhBLcsBlQv
KuJQJ2OiaNkAhVqp9RTgBQJpEmQEAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA
AAoJENkAhVqp9RTgBzgP/i7y+aDWl1maig1XMdyb+o0UGusumFSW4Hmj278wlKVv
usgLPihYgHE0PKrv6WRyKOMC1tQEcYYN93M+OeQ1vFhS2YyURq6RCMmh4zq/awXG
uZbG36OURB5NH8lGBOHiN/7O+nY0CgenBT2JWm+GW3nEOAVOVm4+r5GlpPlv+Dp1
NPBThcKXFMnH73++NpSQoDzTfRYHPxhDAX3jkLi/moXfSanOLlR6l94XNNN0jBHW
Quao0rzf4WSXq9g6AS224xhAA5JyIcFl8TX7hzj5HaFn3VWo3COoDu4U7H+BM0fl
85yqiMQypp7EhN2gxpMMWaHY5TFM85U/bFXFYfEgihZ4/gt4uoIzsNI9jlX7mYvG
KFdDij+oTlRsuOxdIy60B3dKcwOH9nZZCz0SPsN/zlRWgKzK4gDKdGhFkU9OlvPu
94ZqscanoiWKDoZkF96+sjgfjkuHsDK7Lwc1Xi+T4drHG/3aVpkYabXox+lrKB/S
yxZjeqOIQzWPhnLgCaLyvsKo5hxKzL0w3eURu8F3IS7RgOOlljv4M+Me9sEVcdNV
aN3/tQwbaomSX1X5D5YXqhBwC3rU3wXwamsscRTGEpkV+JCX6KUqGP7nWmxCpAly
FL05XuOd5SVHJjXLeuje0JqLUpN514uL+bThWwDbDTdAdwW3oK/2WbXz7IfJRLBj
uQINBGkSZAQBEADdI3SL2F72qkrgFqXWE6HSRBu9bsAvTE5QrRPWk7ux6at537r4
S4sIw2dOwLvbyIrDgKNq3LQ5wCK88NO/NeCOFm4AiCJSl3pJHXYnTDoUxTrrxx+o
vSRI4I3fHEql/MqzgiAb0YUezjgFdh3vYheMPp/309PFbOLhiFqEcx80Mx5h06UH
gDzu1qNj3Ec+31NLic5zwkrAkvFvD54d6bqYR3SEgMau6aYEewpGHbWBi2pLqSi2
lQcAeOFixqGpTwDmAnYR8YtjBYepy0MojEAdTHcQQlOYSDk4q4elG+io2N8vECfU
rD6ORecN48GXdZINYWTAdslrUeanmBdgQrYkSpce8TSghgT9P01SNaXxmyaehVUO
lqI4pcg5G2oojAE8ncNS3TwDtt7daTaTC3bAdr4PXDVAzNAiewjMNZPB7xidkDGQ
Y4W1LxTMXyJVWxehYOH7tsbBRKninlfRnLgYzmtIbNRAAvNcsxU6ihv3AV0WFknN
YbSzotEv1Xq/5wk309x8zCDe+sP0cQicvbXafXmUzPAZzeqFg+VLFn7F9MP1WGlW
B1u7VIvBF1Mp9Nd3EAGBAoLRdRu+0dVWIjPTQuPIuD9cCatJA0wVaKUrjYbBMl88
a12LixNVGeSFS9N7ADHx0/o7GNT6l88YbaLP6zggUHpUD/bR+cDN7vllIQARAQAB
iQI2BBgBCAAgFiEEtywGVC8q4lAnY6Jo2QCFWqn1FOAFAmkSZAQCGwwACgkQ2QCF
Wqn1FOAfAA/8CYq4p0p4bobY20CKEMsZrkBTFJyPDqzFwMeTjgpzqbD7Y3Qq5QCK
OBbvY02GWdiIsNOzKdBxiuam2xYP9WHZj4y7/uWEvT0qlPVmDFu+HXjoJ43oxwFd
CUp2gMuQ4cSL3X94VRJ3BkVL+tgBm8CNY0vnTLLOO3kum/R69VsGJS1JSGUWjNM+
4qwS3mz+73xJu1HmERyN2RZF/DGIZI2PyONQQ6aH85G1Dd2ohu2/DBAkQAMBrPbj
FrbDaBLyFhODxU3kTWqnfLlaElSm2EGdIU2yx7n4BggEa//NZRMm5kyeo4vzhtlQ
YIVUMLAOLZvnEqDnsLKp+22FzNR/O+htBQC4lPywl53oYSALdhz1IQlcAC1ru5KR
XPzhIXV6IIzkcx9xNkEclZxmsuy5ERXyKEmLbIHAlzFmnrldlt2ZgXDtzaorLmxj
klKibxd5tF50qOpOivz+oPtFo7n+HmFa1nlVAMxlDCUdM0pEVeYDKI5zfVwalyhZ
NnjpakdZSXMwgc7NP/hH9buF35hKDp7EckT2y3JNYwHsDdy1icXN2q40XZw5tSIn
zkPWdu3OUY8PISohN6Pw4h0RH4ZmoX97E8sEfmdKaT58U4Hf2aAv5r9IWCSrAVqY
u5jvac29CzQR9Kal0A+8phHAXHNFD83SwzIC0syaT9ficAguwGH8X6Q=
=nGuD
-----END PGP PUBLIC KEY BLOCK-----
```

View File

@@ -118,7 +118,7 @@ if(MSVC)
NOMINMAX
# TODO: Resolve these warnings, don't just silence them
_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:Debug>>:_CRTDBG_MAP_ALLOC>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:Debug>,$<NOT:$<BOOL:${is_ci}>>>:_CRTDBG_MAP_ALLOC>
)
target_link_libraries(common INTERFACE -errorreport:none -machine:X64)
else()

View File

@@ -12,6 +12,7 @@
"protobuf/6.33.5#d96d52ba5baaaa532f47bda866ad87a5%1774467363.12",
"openssl/3.6.1#e6399de266349245a4542fc5f6c71552%1774458290.139",
"nudb/2.0.9#11149c73f8f2baff9a0198fe25971fc7%1774883011.384",
"mpt-crypto/0.3.0-rc1#468344c6855d4aeaa8bd31fb2c403f89%1776358155.918",
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1765850143.914",
"libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1765842973.492",
"libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1%1765842973.03",
@@ -34,6 +35,7 @@
"msys2/cci.latest#d22fe7b2808f5fd34d0a7923ace9c54f%1770657326.649",
"m4/1.4.19#5d7a4994e5875d76faf7acf3ed056036%1774365463.87",
"cmake/4.3.0#b939a42e98f593fb34d3a8c5cc860359%1774439249.183",
"cmake/3.31.10#313d16a1aa16bbdb2ca0792467214b76%1765850153.479",
"b2/5.4.2#ffd6084a119587e70f11cd45d1a386e2%1774439233.447",
"automake/1.16.5#b91b7c384c3deaa9d535be02da14d04f%1755524470.56",
"autoconf/2.71#51077f068e61700d65bb05541ea1e4b0%1731054366.86",
@@ -58,6 +60,12 @@
],
"lz4/[>=1.9.4 <2]": [
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504"
],
"openssl/3.5.5": [
"openssl/3.6.1"
],
"openssl/[>=3 <4]": [
"openssl/3.6.1"
]
},
"config_requires": []

View File

@@ -31,6 +31,7 @@ class Xrpl(ConanFile):
"ed25519/2015.03",
"grpc/1.78.1",
"libarchive/3.8.1",
"mpt-crypto/0.3.0-rc1",
"nudb/2.0.9",
"openssl/3.6.1",
"secp256k1/0.7.1",
@@ -214,6 +215,7 @@ class Xrpl(ConanFile):
"grpc::grpc++",
"libarchive::libarchive",
"lz4::lz4",
"mpt-crypto::mpt-crypto",
"nudb::nudb",
"openssl::crypto",
"protobuf::libprotobuf",

View File

@@ -59,6 +59,7 @@ words:
- autobridging
- bimap
- bindir
- blindings
- bookdir
- Bougalis
- Britto
@@ -91,6 +92,7 @@ words:
- daria
- dcmake
- dearmor
- decryptor
- deleteme
- demultiplexer
- deserializaton
@@ -100,6 +102,7 @@ words:
- distro
- doxyfile
- dxrpl
- elgamal
- enabled
- endmacro
- exceptioned
@@ -110,6 +113,7 @@ words:
- fmtdur
- fsanitize
- funclets
- Gamal
- gcov
- gcovr
- ghead
@@ -199,6 +203,7 @@ words:
- partitioner
- paychan
- paychans
- Pedersen
- permdex
- perminute
- permissioned
@@ -219,6 +224,8 @@ words:
- queuable
- Raphson
- replayer
- rerandomization
- rerandomized
- rerere
- retriable
- RIPD
@@ -235,6 +242,7 @@ words:
- sahyadri
- Satoshi
- scons
- Schnorr
- secp
- sendq
- seqit
@@ -262,6 +270,7 @@ words:
- stvar
- stvector
- stxchainattestations
- summands
- superpeer
- superpeers
- takergets

View File

@@ -36,7 +36,7 @@ public:
explicit Section(std::string name = "");
/** Returns the name of this section. */
[[nodiscard]] std::string const&
std::string const&
name() const
{
return name_;
@@ -45,7 +45,7 @@ public:
/** Returns all the lines in the section.
This includes everything.
*/
[[nodiscard]] std::vector<std::string> const&
std::vector<std::string> const&
lines() const
{
return lines_;
@@ -54,7 +54,7 @@ public:
/** Returns all the values in the section.
Values are non-empty lines which are not key/value pairs.
*/
[[nodiscard]] std::vector<std::string> const&
std::vector<std::string> const&
values() const
{
return values_;
@@ -82,7 +82,7 @@ public:
* @return The retrieved value. A section with an empty legacy value returns
an empty string.
*/
[[nodiscard]] std::string
std::string
legacy() const
{
if (lines_.empty())
@@ -117,11 +117,11 @@ public:
}
/** Returns `true` if a key with the given name exists. */
[[nodiscard]] bool
bool
exists(std::string const& name) const;
template <class T = std::string>
[[nodiscard]] std::optional<T>
std::optional<T>
get(std::string const& name) const
{
auto const iter = lookup_.find(name);
@@ -132,7 +132,7 @@ public:
/// Returns a value if present, else another value.
template <class T>
[[nodiscard]] T
T
value_or(std::string const& name, T const& other) const
{
auto const v = get<T>(name);
@@ -141,7 +141,7 @@ public:
// indicates if trailing comments were seen
// during the appending of any lines/values
[[nodiscard]] bool
bool
had_trailing_comments() const
{
return had_trailing_comments_;
@@ -151,42 +151,42 @@ public:
operator<<(std::ostream&, Section const& section);
// Returns `true` if there are no key/value pairs.
[[nodiscard]] bool
bool
empty() const
{
return lookup_.empty();
}
// Returns the number of key/value pairs.
[[nodiscard]] std::size_t
std::size_t
size() const
{
return lookup_.size();
}
// For iteration of key/value pairs.
[[nodiscard]] const_iterator
const_iterator
begin() const
{
return lookup_.cbegin();
}
// For iteration of key/value pairs.
[[nodiscard]] const_iterator
const_iterator
cbegin() const
{
return lookup_.cbegin();
}
// For iteration of key/value pairs.
[[nodiscard]] const_iterator
const_iterator
end() const
{
return lookup_.cend();
}
// For iteration of key/value pairs.
[[nodiscard]] const_iterator
const_iterator
cend() const
{
return lookup_.cend();
@@ -206,7 +206,7 @@ private:
public:
/** Returns `true` if a section with the given name exists. */
[[nodiscard]] bool
bool
exists(std::string const& name) const;
/** Returns the section with the given name.
@@ -216,7 +216,7 @@ public:
Section&
section(std::string const& name);
[[nodiscard]] Section const&
Section const&
section(std::string const& name) const;
Section const&
@@ -264,7 +264,7 @@ public:
* legacy value.
* @return Contents of the legacy value.
*/
[[nodiscard]] std::string
std::string
legacy(std::string const& sectionName) const;
friend std::ostream&
@@ -272,7 +272,7 @@ public:
// indicates if trailing comments were seen
// in any loaded Sections
[[nodiscard]] bool
bool
had_trailing_comments() const
{
return std::ranges::any_of(map_, [](auto s) { return s.second.had_trailing_comments(); });

View File

@@ -101,13 +101,13 @@ public:
}
/** Returns the number of bytes in the buffer. */
[[nodiscard]] std::size_t
std::size_t
size() const noexcept
{
return size_;
}
[[nodiscard]] bool
bool
empty() const noexcept
{
return 0 == size_;
@@ -125,7 +125,7 @@ public:
to a single byte, to facilitate pointer arithmetic.
*/
/** @{ */
[[nodiscard]] std::uint8_t const*
std::uint8_t const*
data() const noexcept
{
return p_.get();
@@ -169,25 +169,25 @@ public:
return alloc(n);
}
[[nodiscard]] const_iterator
const_iterator
begin() const noexcept
{
return p_.get();
}
[[nodiscard]] const_iterator
const_iterator
cbegin() const noexcept
{
return p_.get();
}
[[nodiscard]] const_iterator
const_iterator
end() const noexcept
{
return p_.get() + size_;
}
[[nodiscard]] const_iterator
const_iterator
cend() const noexcept
{
return p_.get() + size_;

View File

@@ -19,7 +19,7 @@ public:
using Entry = std::pair<std::string, int>;
using List = std::vector<Entry>;
[[nodiscard]] List
List
getCounts(int minimumThreshold) const;
public:
@@ -59,19 +59,19 @@ public:
return --count_;
}
[[nodiscard]] int
int
getCount() const noexcept
{
return count_.load();
}
[[nodiscard]] Counter*
Counter*
getNext() const noexcept
{
return next_;
}
[[nodiscard]] std::string const&
std::string const&
getName() const noexcept
{
return name_;

View File

@@ -67,10 +67,8 @@ private:
}
else
{
for (; elapsed > 0; --elapsed)
{
while ((elapsed--) != 0u)
m_value -= (m_value + Window - 1) / Window;
}
}
}

View File

@@ -73,7 +73,7 @@ public:
{
}
[[nodiscard]] constexpr E const&
constexpr E const&
value() const&
{
return val_;
@@ -91,7 +91,7 @@ public:
return std::move(val_);
}
[[nodiscard]] constexpr E const&&
constexpr E const&&
value() const&&
{
return std::move(val_);
@@ -125,13 +125,13 @@ public:
{
}
[[nodiscard]] constexpr bool
constexpr bool
has_value() const
{
return Base::has_value();
}
[[nodiscard]] constexpr T const&
constexpr T const&
value() const
{
return Base::value();
@@ -143,7 +143,7 @@ public:
return Base::value();
}
[[nodiscard]] constexpr E const&
constexpr E const&
error() const
{
return Base::error();
@@ -210,7 +210,7 @@ public:
{
}
[[nodiscard]] constexpr E const&
constexpr E const&
error() const
{
return Base::error();

View File

@@ -159,11 +159,11 @@ public:
reset();
/** Get the raw pointer */
[[nodiscard]] T*
T*
get() const;
/** Return the strong count */
[[nodiscard]] std::size_t
std::size_t
use_count() const;
template <class TT, class... Args>
@@ -181,7 +181,7 @@ public:
private:
/** Return the raw pointer held by this object. */
[[nodiscard]] T*
T*
unsafeGetRawPtr() const;
/** Exchange the current raw pointer held by this object with the given
@@ -260,7 +260,7 @@ public:
lock() const;
/** Return true if the strong count is zero. */
[[nodiscard]] bool
bool
expired() const;
/** Set the pointer to null and decrement the weak count.
@@ -339,7 +339,7 @@ public:
don't lock the weak pointer. Use the `lock` method if that's what's
needed)
*/
[[nodiscard]] SharedIntrusive<T>
SharedIntrusive<T>
getStrong() const;
/** Return true if this is a strong pointer and the strong pointer is
@@ -357,31 +357,31 @@ public:
/** If this is a strong pointer, return the raw pointer. Otherwise
return null.
*/
[[nodiscard]] T*
T*
get() const;
/** If this is a strong pointer, return the strong count. Otherwise
* return 0
*/
[[nodiscard]] std::size_t
std::size_t
use_count() const;
/** Return true if there is a non-zero strong count. */
[[nodiscard]] bool
bool
expired() const;
/** If this is a strong pointer, return the strong pointer. Otherwise
attempt to lock the weak pointer.
*/
[[nodiscard]] SharedIntrusive<T>
SharedIntrusive<T>
lock() const;
/** Return true is this represents a strong pointer. */
[[nodiscard]] bool
bool
isStrong() const;
/** Return true is this represents a weak pointer. */
[[nodiscard]] bool
bool
isWeak() const;
/** If this is a weak pointer, attempt to convert it to a strong
@@ -412,7 +412,7 @@ private:
private:
/** Return the raw pointer held by this object.
*/
[[nodiscard]] T*
T*
unsafeGetRawPtr() const;
enum class RefStrength { strong, weak };

View File

@@ -207,7 +207,7 @@ private:
RefCountPair(CountType s, CountType w) noexcept;
/** Convert back to the packed integer form. */
[[nodiscard]] FieldType
FieldType
combinedValue() const noexcept;
static constexpr CountType maxStrongValue =

View File

@@ -76,7 +76,7 @@ private:
@return `true` if a system file is associated and opened for
writing.
*/
[[nodiscard]] bool
bool
isOpen() const noexcept;
/** Associate a system file with the log.

View File

@@ -44,7 +44,7 @@ public:
return data_;
}
[[nodiscard]] ProtectedDataType const&
ProtectedDataType const&
get() const
{
return data_;

View File

@@ -252,9 +252,9 @@ public:
// Assume unsigned values are... unsigned. i.e. positive
explicit Number(internalrep mantissa, int exponent, normalized);
[[nodiscard]] constexpr rep
constexpr rep
mantissa() const noexcept;
[[nodiscard]] constexpr int
constexpr int
exponent() const noexcept;
constexpr Number
@@ -339,7 +339,7 @@ public:
}
/** Return the sign of the amount */
[[nodiscard]] constexpr int
constexpr int
signum() const noexcept
{
if (negative_)
@@ -347,7 +347,7 @@ public:
return (mantissa_ != 0u) ? 1 : 0;
}
[[nodiscard]] Number
Number
truncate() const noexcept;
friend constexpr bool
@@ -490,13 +490,13 @@ private:
MantissaRange::rep const& minMantissa,
MantissaRange::rep const& maxMantissa);
[[nodiscard]] bool
bool
isnormal() const noexcept;
// Copy the number, but modify the exponent by "exponentDelta". Because the
// mantissa doesn't change, the result will be "mostly" normalized, but the
// exponent could go out of range, so it will be checked.
[[nodiscard]] Number
Number
shiftExponent(int exponentDelta) const;
// Safely convert rep (int64) mantissa to internalrep (uint64). If the rep

View File

@@ -20,7 +20,7 @@ public:
{
}
[[nodiscard]] uint256 const&
uint256 const&
as_uint256() const
{
return hash_;
@@ -30,17 +30,17 @@ public:
{
return hash_;
}
[[nodiscard]] bool
bool
isZero() const
{
return hash_.isZero();
}
[[nodiscard]] bool
bool
isNonZero() const
{
return hash_.isNonZero();
}
[[nodiscard]] int
int
signum() const
{
return hash_.signum();

View File

@@ -49,7 +49,7 @@ public:
/** Return a strong pointer if this is already a strong pointer (i.e. don't
lock the weak pointer. Use the `lock` method if that's what's needed)
*/
[[nodiscard]] std::shared_ptr<T> const&
std::shared_ptr<T> const&
getStrong() const;
/** Return true if this is a strong pointer and the strong pointer is
@@ -67,30 +67,30 @@ public:
/** If this is a strong pointer, return the raw pointer. Otherwise return
null.
*/
[[nodiscard]] T*
T*
get() const;
/** If this is a strong pointer, return the strong count. Otherwise return 0
*/
[[nodiscard]] std::size_t
std::size_t
use_count() const;
/** Return true if there is a non-zero strong count. */
[[nodiscard]] bool
bool
expired() const;
/** If this is a strong pointer, return the strong pointer. Otherwise
attempt to lock the weak pointer.
*/
[[nodiscard]] std::shared_ptr<T>
std::shared_ptr<T>
lock() const;
/** Return true is this represents a strong pointer. */
[[nodiscard]] bool
bool
isStrong() const;
/** Return true is this represents a weak pointer. */
[[nodiscard]] bool
bool
isWeak() const;
/** If this is a weak pointer, attempt to convert it to a strong pointer.

View File

@@ -180,7 +180,7 @@ public:
~SlabAllocator() = default;
/** Returns the size of the memory block this allocator returns. */
[[nodiscard]] constexpr std::size_t
constexpr std::size_t
size() const noexcept
{
return itemSize_;

View File

@@ -74,7 +74,7 @@ public:
@note The return type is guaranteed to be a pointer
to a single byte, to facilitate pointer arithmetic.
*/
[[nodiscard]] std::uint8_t const*
std::uint8_t const*
data() const noexcept
{
return data_;
@@ -123,25 +123,25 @@ public:
size_ -= n;
}
[[nodiscard]] const_iterator
const_iterator
begin() const noexcept
{
return data_;
}
[[nodiscard]] const_iterator
const_iterator
cbegin() const noexcept
{
return data_;
}
[[nodiscard]] const_iterator
const_iterator
end() const noexcept
{
return data_ + size_;
}
[[nodiscard]] const_iterator
const_iterator
cend() const noexcept
{
return data_ + size_;
@@ -158,7 +158,7 @@ public:
@returns The requested subslice, if the request is valid.
@throws std::out_of_range if pos > size()
*/
[[nodiscard]] Slice
Slice
substr(std::size_t pos, std::size_t count = std::numeric_limits<std::size_t>::max()) const
{
if (pos > size())

View File

@@ -222,19 +222,19 @@ private:
{
}
[[nodiscard]] bool
bool
isWeak() const
{
if (!ptr)
return true;
return ptr.isWeak();
}
[[nodiscard]] bool
bool
isCached() const
{
return ptr && ptr.isStrong();
}
[[nodiscard]] bool
bool
isExpired() const
{
return ptr.expired();

View File

@@ -102,7 +102,7 @@ public:
{
return reinterpret_cast<pointer>(data_.data());
}
[[nodiscard]] const_pointer
const_pointer
data() const
{
return reinterpret_cast<const_pointer>(data_.data());
@@ -118,22 +118,22 @@ public:
{
return data() + bytes;
}
[[nodiscard]] const_iterator
const_iterator
begin() const
{
return data();
}
[[nodiscard]] const_iterator
const_iterator
end() const
{
return data() + bytes;
}
[[nodiscard]] const_iterator
const_iterator
cbegin() const
{
return data();
}
[[nodiscard]] const_iterator
const_iterator
cend() const
{
return data() + bytes;
@@ -310,7 +310,7 @@ public:
return fromVoid(from.data());
}
[[nodiscard]] constexpr int
constexpr int
signum() const
{
for (int i = 0; i < WIDTH; i++)
@@ -433,14 +433,14 @@ public:
return ret;
}
[[nodiscard]] base_uint
base_uint
next() const
{
auto ret = *this;
return ++ret;
}
[[nodiscard]] base_uint
base_uint
prev() const
{
auto ret = *this;
@@ -517,12 +517,12 @@ public:
}
// Deprecated.
[[nodiscard]] bool
bool
isZero() const
{
return *this == beast::zero;
}
[[nodiscard]] bool
bool
isNonZero() const
{
return *this != beast::zero;

View File

@@ -49,7 +49,7 @@ public:
return m_ios;
}
[[nodiscard]] boost::asio::io_context const&
boost::asio::io_context const&
get_io_context() const
{
return m_ios;

View File

@@ -63,7 +63,7 @@ struct abstract_clock_wrapper : public abstract_clock<Facade>
using typename abstract_clock<Facade>::duration;
using typename abstract_clock<Facade>::time_point;
[[nodiscard]] time_point
time_point
now() const override
{
return Clock::now();

View File

@@ -32,7 +32,7 @@ public:
{
}
[[nodiscard]] time_point
time_point
now() const override
{
return now_;

View File

@@ -115,7 +115,7 @@ public:
return &m_iter->value;
}
[[nodiscard]] time_point const&
time_point const&
when() const
{
return m_iter->when;
@@ -136,7 +136,7 @@ private:
{
}
[[nodiscard]] Iterator const&
Iterator const&
iterator() const
{
return m_iter;

View File

@@ -186,7 +186,7 @@ private:
return *this;
}
[[nodiscard]] Compare const&
Compare const&
compare() const
{
return *this;
@@ -295,7 +295,7 @@ private:
return KeyValueCompare::compare();
}
[[nodiscard]] Compare const&
Compare const&
compare() const
{
return KeyValueCompare::compare();
@@ -307,7 +307,7 @@ private:
return *this;
}
[[nodiscard]] KeyValueCompare const&
KeyValueCompare const&
key_compare() const
{
return *this;
@@ -319,7 +319,7 @@ private:
return beast::detail::empty_base_optimization<ElementAllocator>::member();
}
[[nodiscard]] ElementAllocator const&
ElementAllocator const&
alloc() const
{
return beast::detail::empty_base_optimization<ElementAllocator>::member();

View File

@@ -149,7 +149,7 @@ private:
return *this;
}
[[nodiscard]] Hash const&
Hash const&
hash_function() const
{
return *this;
@@ -195,7 +195,7 @@ private:
return *this;
}
[[nodiscard]] KeyEqual const&
KeyEqual const&
key_eq() const
{
return *this;
@@ -348,7 +348,7 @@ private:
return *this;
}
[[nodiscard]] ValueHash const&
ValueHash const&
value_hash() const
{
return *this;
@@ -360,7 +360,7 @@ private:
return ValueHash::hash_function();
}
[[nodiscard]] Hash const&
Hash const&
hash_function() const
{
return ValueHash::hash_function();
@@ -372,7 +372,7 @@ private:
return *this;
}
[[nodiscard]] KeyValueEqual const&
KeyValueEqual const&
key_value_equal() const
{
return *this;
@@ -384,7 +384,7 @@ private:
return key_value_equal().key_eq();
}
[[nodiscard]] KeyEqual const&
KeyEqual const&
key_eq() const
{
return key_value_equal().key_eq();
@@ -396,7 +396,7 @@ private:
return beast::detail::empty_base_optimization<ElementAllocator>::member();
}
[[nodiscard]] ElementAllocator const&
ElementAllocator const&
alloc() const
{
return beast::detail::empty_base_optimization<ElementAllocator>::member();
@@ -433,7 +433,7 @@ private:
m_vec.clear();
}
[[nodiscard]] size_type
size_type
max_bucket_count() const
{
return m_vec.max_size();
@@ -445,7 +445,7 @@ private:
return m_max_load_factor;
}
[[nodiscard]] float const&
float const&
max_load_factor() const
{
return m_max_load_factor;

View File

@@ -43,7 +43,7 @@ public:
return *this;
}
[[nodiscard]] T const&
T const&
member() const noexcept
{
return *this;

View File

@@ -128,7 +128,7 @@ public:
}
private:
[[nodiscard]] reference
reference
dereference() const noexcept
{
return static_cast<reference>(*m_node);
@@ -287,14 +287,14 @@ public:
/** Determine if the list is empty.
@return `true` if the list is empty.
*/
[[nodiscard]] bool
bool
empty() const noexcept
{
return size() == 0;
}
/** Returns the number of elements in the list. */
[[nodiscard]] size_type
size_type
size() const noexcept
{
return m_size;
@@ -314,7 +314,7 @@ public:
@invariant The list may not be empty.
@return A const reference to the first element.
*/
[[nodiscard]] const_reference
const_reference
front() const noexcept
{
return element_from(m_head.m_next);
@@ -334,7 +334,7 @@ public:
@invariant The list may not be empty.
@return A const reference to the last element.
*/
[[nodiscard]] const_reference
const_reference
back() const noexcept
{
return element_from(m_tail.m_prev);
@@ -352,7 +352,7 @@ public:
/** Obtain a const iterator to the beginning of the list.
@return A const iterator pointing to the beginning of the list.
*/
[[nodiscard]] const_iterator
const_iterator
begin() const noexcept
{
return const_iterator(m_head.m_next);
@@ -361,7 +361,7 @@ public:
/** Obtain a const iterator to the beginning of the list.
@return A const iterator pointing to the beginning of the list.
*/
[[nodiscard]] const_iterator
const_iterator
cbegin() const noexcept
{
return const_iterator(m_head.m_next);
@@ -379,7 +379,7 @@ public:
/** Obtain a const iterator to the end of the list.
@return A constiterator pointing to the end of the list.
*/
[[nodiscard]] const_iterator
const_iterator
end() const noexcept
{
return const_iterator(&m_tail);
@@ -388,7 +388,7 @@ public:
/** Obtain a const iterator to the end of the list
@return A constiterator pointing to the end of the list.
*/
[[nodiscard]] const_iterator
const_iterator
cend() const noexcept
{
return const_iterator(&m_tail);
@@ -549,7 +549,7 @@ public:
@param element The element to obtain an iterator for.
@return A const iterator to the element.
*/
[[nodiscard]] const_iterator
const_iterator
const_iterator_to(T const& element) const noexcept
{
return const_iterator(static_cast<Node const*>(&element));

View File

@@ -162,7 +162,7 @@ public:
operator=(LockFreeStack const&) = delete;
/** Returns true if the stack is empty. */
[[nodiscard]] bool
bool
empty() const
{
return m_head.load() == &m_end;
@@ -237,25 +237,25 @@ public:
return iterator(&m_end);
}
[[nodiscard]] const_iterator
const_iterator
begin() const
{
return const_iterator(m_head.load());
}
[[nodiscard]] const_iterator
const_iterator
end() const
{
return const_iterator(&m_end);
}
[[nodiscard]] const_iterator
const_iterator
cbegin() const
{
return const_iterator(m_head.load());
}
[[nodiscard]] const_iterator
const_iterator
cend() const
{
return const_iterator(&m_end);

View File

@@ -37,15 +37,15 @@ public:
parse(std::string_view input);
/** Produce a string from semantic version components. */
[[nodiscard]] std::string
std::string
print() const;
[[nodiscard]] bool
bool
isRelease() const noexcept
{
return preReleaseIdentifiers.empty();
}
[[nodiscard]] bool
bool
isPreRelease() const noexcept
{
return !isRelease();

View File

@@ -45,7 +45,7 @@ public:
m_impl->notify(ceil<value_type>(value));
}
[[nodiscard]] std::shared_ptr<EventImpl> const&
std::shared_ptr<EventImpl> const&
impl() const
{
return m_impl;

View File

@@ -108,7 +108,7 @@ public:
}
/** @} */
[[nodiscard]] std::shared_ptr<GaugeImpl> const&
std::shared_ptr<GaugeImpl> const&
impl() const
{
return m_impl;

View File

@@ -14,7 +14,7 @@ public:
using ptr = std::shared_ptr<Group>;
/** Returns the name of this group, for diagnostics. */
[[nodiscard]] virtual std::string const&
virtual std::string const&
name() const = 0;
};

View File

@@ -24,7 +24,7 @@ public:
{
}
[[nodiscard]] std::shared_ptr<HookImpl> const&
std::shared_ptr<HookImpl> const&
impl() const
{
return m_impl;

View File

@@ -63,7 +63,7 @@ public:
}
/** @} */
[[nodiscard]] std::shared_ptr<MeterImpl> const&
std::shared_ptr<MeterImpl> const&
impl() const
{
return m_impl;

View File

@@ -32,25 +32,25 @@ public:
from_string(std::string const& s);
/** Returns a string representing the endpoint. */
[[nodiscard]] std::string
std::string
to_string() const;
/** Returns the port number on the endpoint. */
[[nodiscard]] Port
Port
port() const
{
return m_port;
}
/** Returns a new Endpoint with a different port. */
[[nodiscard]] Endpoint
Endpoint
at_port(Port port) const
{
return Endpoint(m_addr, port);
}
/** Returns the address portion of this endpoint. */
[[nodiscard]] Address const&
Address const&
address() const
{
return m_addr;
@@ -58,22 +58,22 @@ public:
/** Convenience accessors for the address part. */
/** @{ */
[[nodiscard]] bool
bool
is_v4() const
{
return m_addr.is_v4();
}
[[nodiscard]] bool
bool
is_v6() const
{
return m_addr.is_v6();
}
[[nodiscard]] AddressV4
AddressV4
to_v4() const
{
return m_addr.to_v4();
}
[[nodiscard]] AddressV6
AddressV6
to_v6() const
{
return m_addr.to_v6();

View File

@@ -43,10 +43,8 @@ public:
: work_(boost::asio::make_work_guard(ios_))
{
threads_.reserve(concurrency);
for (std::size_t i = 0; i < concurrency; ++i)
{
while ((concurrency--) != 0u)
threads_.emplace_back([&] { ios_.run(); });
}
}
~enable_yield_to()

View File

@@ -25,7 +25,7 @@ protected:
return m_cont;
}
[[nodiscard]] cont_type const&
cont_type const&
cont() const
{
return m_cont;
@@ -39,14 +39,14 @@ public:
using const_iterator = typename cont_type::const_iterator;
/** Returns `true` if the container is empty. */
[[nodiscard]] bool
bool
empty() const
{
return m_cont.empty();
}
/** Returns the number of items in the container. */
[[nodiscard]] size_type
size_type
size() const
{
return m_cont.size();
@@ -54,25 +54,25 @@ public:
/** Returns forward iterators for traversal. */
/** @{ */
[[nodiscard]] const_iterator
const_iterator
begin() const
{
return m_cont.cbegin();
}
[[nodiscard]] const_iterator
const_iterator
cbegin() const
{
return m_cont.cbegin();
}
[[nodiscard]] const_iterator
const_iterator
end() const
{
return m_cont.cend();
}
[[nodiscard]] const_iterator
const_iterator
cend() const
{
return m_cont.cend();

View File

@@ -21,7 +21,7 @@ public:
recorder() = default;
/** Returns a report with the results of all completed suites. */
[[nodiscard]] results const&
results const&
report() const
{
return m_results;

View File

@@ -41,14 +41,14 @@ private:
tests_t() = default;
/** Returns the total number of test conditions. */
[[nodiscard]] std::size_t
std::size_t
total() const
{
return cont().size();
}
/** Returns the number of failed test conditions. */
[[nodiscard]] std::size_t
std::size_t
failed() const
{
return failed_;
@@ -89,7 +89,7 @@ public:
}
/** Returns the name of this testcase. */
[[nodiscard]] std::string const&
std::string const&
name() const
{
return name_;
@@ -118,21 +118,21 @@ public:
}
/** Returns the name of this suite. */
[[nodiscard]] std::string const&
std::string const&
name() const
{
return name_;
}
/** Returns the total number of test conditions. */
[[nodiscard]] std::size_t
std::size_t
total() const
{
return total_;
}
/** Returns the number of failures. */
[[nodiscard]] std::size_t
std::size_t
failed() const
{
return failed_;
@@ -173,21 +173,21 @@ public:
results() = default;
/** Returns the total number of test cases. */
[[nodiscard]] std::size_t
std::size_t
cases() const
{
return m_cases;
}
/** Returns the total number of test conditions. */
[[nodiscard]] std::size_t
std::size_t
total() const
{
return total_;
}
/** Returns the number of failures. */
[[nodiscard]] std::size_t
std::size_t
failed() const
{
return failed_;

View File

@@ -47,7 +47,7 @@ public:
}
/** Returns the argument string. */
[[nodiscard]] std::string const&
std::string const&
arg() const
{
return arg_;

View File

@@ -57,7 +57,7 @@ private:
// in the event of a failure, if the option to stop is set.
struct abort_exception : public std::exception
{
[[nodiscard]] char const*
char const*
what() const noexcept override
{
return "test suite aborted";

View File

@@ -42,33 +42,33 @@ public:
{
}
[[nodiscard]] std::string const&
std::string const&
name() const
{
return name_;
}
[[nodiscard]] std::string const&
std::string const&
module() const
{
return module_;
}
[[nodiscard]] std::string const&
std::string const&
library() const
{
return library_;
}
/// Returns `true` if this suite only runs manually.
[[nodiscard]] bool
bool
manual() const
{
return manual_;
}
/// Return the canonical suite name as a string.
[[nodiscard]] std::string
std::string
full_name() const
{
return library_ + "." + module_ + "." + name_;

View File

@@ -47,13 +47,13 @@ public:
t_ = std::thread(&Thread::run, this, std::move(b));
}
[[nodiscard]] bool
bool
joinable() const
{
return t_.joinable();
}
[[nodiscard]] std::thread::id
std::thread::id
get_id() const
{
return t_.get_id();

View File

@@ -66,12 +66,12 @@ public:
operator=(Sink const& lhs) = delete;
/** Returns `true` if text at the passed severity produces output. */
[[nodiscard]] virtual bool
virtual bool
active(Severity level) const;
/** Returns `true` if a message is also written to the Output Window
* (MSVC). */
[[nodiscard]] virtual bool
virtual bool
console() const;
/** Set whether messages are also written to the Output Window (MSVC).
@@ -80,7 +80,7 @@ public:
console(bool output);
/** Returns the minimum severity level this sink will report. */
[[nodiscard]] virtual Severity
virtual Severity
threshold() const;
/** Set the minimum severity this sink will report. */
@@ -204,14 +204,14 @@ public:
operator=(Stream const& other) = delete;
/** Returns the Sink that this Stream writes to. */
[[nodiscard]] Sink&
Sink&
sink() const
{
return m_sink;
}
/** Returns the Severity level of messages this Stream reports. */
[[nodiscard]] Severity
Severity
level() const
{
return m_level;
@@ -219,7 +219,7 @@ public:
/** Returns `true` if sink logs anything at this stream's level. */
/** @{ */
[[nodiscard]] bool
bool
active() const
{
return m_sink.active(m_level);
@@ -267,14 +267,14 @@ public:
}
/** Returns the Sink associated with this Journal. */
[[nodiscard]] Sink&
Sink&
sink() const
{
return *m_sink;
}
/** Returns a stream for this sink, with the specified severity level. */
[[nodiscard]] Stream
Stream
stream(Severity level) const
{
return Stream(*m_sink, level);
@@ -284,7 +284,7 @@ public:
For a message to be logged, the severity must be at or above the
sink's severity threshold.
*/
[[nodiscard]] bool
bool
active(Severity level) const
{
return m_sink->active(level);
@@ -292,37 +292,37 @@ public:
/** Severity stream access functions. */
/** @{ */
[[nodiscard]] Stream
Stream
trace() const
{
return {*m_sink, severities::kTrace};
}
[[nodiscard]] Stream
Stream
debug() const
{
return {*m_sink, severities::kDebug};
}
[[nodiscard]] Stream
Stream
info() const
{
return {*m_sink, severities::kInfo};
}
[[nodiscard]] Stream
Stream
warn() const
{
return {*m_sink, severities::kWarning};
}
[[nodiscard]] Stream
Stream
error() const
{
return {*m_sink, severities::kError};
}
[[nodiscard]] Stream
Stream
fatal() const
{
return {*m_sink, severities::kFatal};

View File

@@ -149,7 +149,7 @@ class PropertyStream::Item : public List<Item>::Node
{
public:
explicit Item(Source* source);
[[nodiscard]] Source&
Source&
source() const;
Source*
operator->() const;
@@ -217,7 +217,7 @@ public:
PropertyStream&
stream();
[[nodiscard]] PropertyStream const&
PropertyStream const&
stream() const;
template <typename Value>
@@ -287,7 +287,7 @@ public:
PropertyStream&
stream();
[[nodiscard]] PropertyStream const&
PropertyStream const&
stream() const;
template <typename Value>
@@ -323,7 +323,7 @@ public:
operator=(Source const&) = delete;
/** Returns the name of this source. */
[[nodiscard]] std::string const&
std::string const&
name() const;
/** Add a child source. */

View File

@@ -35,13 +35,13 @@ public:
prefix_ = s;
}
[[nodiscard]] bool
bool
active(beast::severities::Severity level) const override
{
return sink_.active(level);
}
[[nodiscard]] bool
bool
console() const override
{
return sink_.console();
@@ -53,7 +53,7 @@ public:
sink_.console(output);
}
[[nodiscard]] beast::severities::Severity
beast::severities::Severity
threshold() const override
{
return sink_.threshold();

View File

@@ -43,7 +43,7 @@ public:
}
/// Get the native path for the temporary directory
[[nodiscard]] std::string
std::string
path() const
{
return path_.string();
@@ -53,7 +53,7 @@ public:
The file does not need to exist.
*/
[[nodiscard]] std::string
std::string
file(std::string const& name) const
{
return (path_ / name).string();

View File

@@ -41,15 +41,15 @@ public:
with respect to other conditions of the
same type.
*/
[[nodiscard]] virtual Buffer
virtual Buffer
fingerprint() const = 0;
/** Returns the type of this condition. */
[[nodiscard]] virtual Type
virtual Type
type() const = 0;
/** Validates a fulfillment. */
[[nodiscard]] virtual bool
virtual bool
validate(Slice data) const = 0;
/** Calculates the cost associated with this fulfillment. *
@@ -58,7 +58,7 @@ public:
type and properties of the condition and the fulfillment
that the condition is generated from.
*/
[[nodiscard]] virtual std::uint32_t
virtual std::uint32_t
cost() const = 0;
/** Returns the condition associated with the given fulfillment.
@@ -67,7 +67,7 @@ public:
will, if compliant, produce the identical condition for the
same fulfillment.
*/
[[nodiscard]] virtual Condition
virtual Condition
condition() const = 0;
};

View File

@@ -90,13 +90,13 @@ public:
{
}
[[nodiscard]] Type
Type
type() const override
{
return Type::preimageSha256;
}
[[nodiscard]] Buffer
Buffer
fingerprint() const override
{
sha256_hasher h;
@@ -105,19 +105,19 @@ public:
return {d.data(), d.size()};
}
[[nodiscard]] std::uint32_t
std::uint32_t
cost() const override
{
return static_cast<std::uint32_t>(payload_.size());
}
[[nodiscard]] Condition
Condition
condition() const override
{
return {type(), cost(), fingerprint()};
}
[[nodiscard]] bool
bool
validate(Slice) const override
{
// Perhaps counterintuitively, the message isn't

View File

@@ -118,7 +118,7 @@ private:
peers_.insert(peer);
}
[[nodiscard]] HashRouterFlags
HashRouterFlags
getFlags(void) const
{
return flags_;
@@ -138,7 +138,7 @@ private:
}
/** Return seated relay time point if the message has been relayed */
[[nodiscard]] std::optional<Stopwatch::time_point>
std::optional<Stopwatch::time_point>
relayed() const
{
return relayed_;

View File

@@ -98,11 +98,11 @@ public:
LoadMonitor& lm,
std::function<void()> const& job);
[[nodiscard]] JobType
JobType
getType() const;
/** Returns the time when the job was queued. */
[[nodiscard]] clock_type::time_point const&
clock_type::time_point const&
queue_time() const;
void

View File

@@ -7,13 +7,8 @@
#include <xrpl/core/detail/Workers.h>
#include <xrpl/json/json_value.h>
// Include only the specific Boost.Coroutine2 headers actually used here.
// Avoid `boost/coroutine2/all.hpp` because it transitively pulls in
// `boost/context/pooled_fixedsize_stack.hpp`, whose `.malloc()` / `.free()`
// member calls on `boost::pool` collide with MSVC's `_CRTDBG_MAP_ALLOC` macros
// in Debug builds (see cmake/XrplCompiler.cmake).
#include <boost/context/protected_fixedsize_stack.hpp>
#include <boost/coroutine2/coroutine.hpp>
#include <boost/coroutine2/all.hpp>
#include <set>

View File

@@ -54,13 +54,13 @@ public:
JobTypeData&
operator=(JobTypeData const& other) = delete;
[[nodiscard]] std::string
std::string
name() const
{
return info.name();
}
[[nodiscard]] JobType
JobType
type() const
{
return info.type();

View File

@@ -40,37 +40,37 @@ public:
{
}
[[nodiscard]] JobType
JobType
type() const
{
return m_type;
}
[[nodiscard]] std::string const&
std::string const&
name() const
{
return m_name;
}
[[nodiscard]] int
int
limit() const
{
return m_limit;
}
[[nodiscard]] bool
bool
special() const
{
return m_limit == 0;
}
[[nodiscard]] std::chrono::milliseconds
std::chrono::milliseconds
getAverageLatency() const
{
return m_avgLatency;
}
[[nodiscard]] std::chrono::milliseconds
std::chrono::milliseconds
getPeakLatency() const
{
return m_peakLatency;

View File

@@ -113,7 +113,7 @@ public:
return instance().get(jt).name();
}
[[nodiscard]] JobTypeInfo const&
JobTypeInfo const&
get(JobType jt) const
{
Map::const_iterator const iter(m_map.find(jt));
@@ -125,37 +125,37 @@ public:
return m_unknown;
}
[[nodiscard]] JobTypeInfo const&
JobTypeInfo const&
getInvalid() const
{
return m_unknown;
}
[[nodiscard]] Map::size_type
Map::size_type
size() const
{
return m_map.size();
}
[[nodiscard]] const_iterator
const_iterator
begin() const
{
return m_map.cbegin();
}
[[nodiscard]] const_iterator
const_iterator
cbegin() const
{
return m_map.cbegin();
}
[[nodiscard]] const_iterator
const_iterator
end() const
{
return m_map.cend();
}
[[nodiscard]] const_iterator
const_iterator
cend() const
{
return m_map.cend();

View File

@@ -21,15 +21,15 @@ public:
~LoadEvent();
[[nodiscard]] std::string const&
std::string const&
name() const;
// The time spent waiting.
[[nodiscard]] std::chrono::steady_clock::duration
std::chrono::steady_clock::duration
waitTime() const;
// The time spent running.
[[nodiscard]] std::chrono::steady_clock::duration
std::chrono::steady_clock::duration
runTime() const;
void

View File

@@ -26,7 +26,7 @@ public:
*
* @return The network ID this server is configured for
*/
[[nodiscard]] virtual std::uint32_t
virtual std::uint32_t
getNetworkID() const noexcept = 0;
};

View File

@@ -22,7 +22,7 @@ public:
PublicKey nodeId;
std::string description = {}; // NOLINT(readability-redundant-member-init)
[[nodiscard]] auto
auto
toJson() const -> Json::Value;
template <typename Hasher>

View File

@@ -121,7 +121,7 @@ public:
*
* @return Counters Json object
*/
[[nodiscard]] virtual Json::Value
virtual Json::Value
countersJson() const = 0;
/**
@@ -129,7 +129,7 @@ public:
*
* @return Current executing jobs and RPC calls and durations
*/
[[nodiscard]] virtual Json::Value
virtual Json::Value
currentJson() const = 0;
/**

View File

@@ -192,7 +192,7 @@ public:
virtual OpenLedger&
getOpenLedger() = 0;
[[nodiscard]] virtual OpenLedger const&
virtual OpenLedger const&
getOpenLedger() const = 0;
// Transaction and operation services
@@ -219,7 +219,7 @@ public:
getPerfLog() = 0;
// Configuration and state
[[nodiscard]] virtual bool
virtual bool
isStopping() const = 0;
virtual beast::Journal
@@ -231,7 +231,7 @@ public:
virtual Logs&
getLogs() = 0;
[[nodiscard]] virtual std::optional<uint256> const&
virtual std::optional<uint256> const&
getTrapTxID() const = 0;
/** Retrieve the "wallet database" */

View File

@@ -106,7 +106,7 @@ public:
@note This function is not thread-safe.
*/
[[nodiscard]] int
int
getNumberOfThreads() const noexcept;
/** Set the desired number of threads.
@@ -141,7 +141,7 @@ public:
While this function is thread-safe, the value may not stay
accurate for very long. It's mainly for diagnostic purposes.
*/
[[nodiscard]] int
int
numberOfCurrentlyRunningTasks() const noexcept;
//--------------------------------------------------------------------------

View File

@@ -14,7 +14,7 @@ public:
public:
JsonPropertyStream();
[[nodiscard]] Json::Value const&
Json::Value const&
top() const;
protected:

View File

@@ -64,7 +64,7 @@ public:
* their location in the parsed document. An empty string is returned if no
* error occurred during parsing.
*/
[[nodiscard]] std::string
std::string
getFormattedErrorMessages() const;
static constexpr unsigned nest_limit{25};

View File

@@ -53,7 +53,7 @@ public:
return str_;
}
[[nodiscard]] constexpr char const*
constexpr char const*
c_str() const
{
return str_;
@@ -158,11 +158,11 @@ private:
operator<(CZString const& other) const;
bool
operator==(CZString const& other) const;
[[nodiscard]] int
int
index() const;
[[nodiscard]] char const*
char const*
c_str() const;
[[nodiscard]] bool
bool
isStaticString() const;
private:
@@ -223,60 +223,60 @@ public:
void
swap(Value& other) noexcept;
[[nodiscard]] ValueType
ValueType
type() const;
[[nodiscard]] char const*
char const*
asCString() const;
/** Returns the unquoted string value. */
[[nodiscard]] std::string
std::string
asString() const;
[[nodiscard]] Int
Int
asInt() const;
[[nodiscard]] UInt
UInt
asUInt() const;
[[nodiscard]] double
double
asDouble() const;
[[nodiscard]] bool
bool
asBool() const;
/** Correct absolute value from int or unsigned int */
[[nodiscard]] UInt
UInt
asAbsUInt() const;
// TODO: What is the "empty()" method this docstring mentions?
/** isNull() tests to see if this field is null. Don't use this method to
test for emptiness: use empty(). */
[[nodiscard]] bool
bool
isNull() const;
[[nodiscard]] bool
bool
isBool() const;
[[nodiscard]] bool
bool
isInt() const;
[[nodiscard]] bool
bool
isUInt() const;
[[nodiscard]] bool
bool
isIntegral() const;
[[nodiscard]] bool
bool
isDouble() const;
[[nodiscard]] bool
bool
isNumeric() const;
[[nodiscard]] bool
bool
isString() const;
[[nodiscard]] bool
bool
isArray() const;
[[nodiscard]] bool
bool
isArrayOrNull() const;
[[nodiscard]] bool
bool
isObject() const;
[[nodiscard]] bool
bool
isObjectOrNull() const;
[[nodiscard]] bool
bool
isConvertibleTo(ValueType other) const;
/// Number of values in array or object
[[nodiscard]] UInt
UInt
size() const;
/** Returns false if this is an empty array, empty object, empty string,
@@ -304,10 +304,10 @@ public:
operator[](UInt index) const;
/// If the array contains at least index+1 elements, returns the element
/// value, otherwise returns defaultValue.
[[nodiscard]] Value
Value
get(UInt index, Value const& defaultValue) const;
/// Return true if index < size().
[[nodiscard]] bool
bool
isValidIndex(UInt index) const;
/// \brief Append value to array at the end.
///
@@ -355,7 +355,7 @@ public:
Value
get(char const* key, Value const& defaultValue) const;
/// Return the member named key if it exist, defaultValue otherwise.
[[nodiscard]] Value
Value
get(std::string const& key, Value const& defaultValue) const;
/// \brief Remove and return the named member.
@@ -374,10 +374,10 @@ public:
bool
isMember(char const* key) const;
/// Return true if the object has a member named key.
[[nodiscard]] bool
bool
isMember(std::string const& key) const;
/// Return true if the object has a member named key.
[[nodiscard]] bool
bool
isMember(StaticString const& key) const;
/// \brief Return a list of the member names.
@@ -385,15 +385,15 @@ public:
/// If null, return an empty list.
/// \pre type() is objectValue or nullValue
/// \post if type() was nullValue, it remains nullValue
[[nodiscard]] Members
Members
getMemberNames() const;
[[nodiscard]] std::string
std::string
toStyledString() const;
[[nodiscard]] const_iterator
const_iterator
begin() const;
[[nodiscard]] const_iterator
const_iterator
end() const;
iterator
@@ -513,20 +513,20 @@ public:
/// Return either the index or the member name of the referenced value as a
/// Value.
[[nodiscard]] Value
Value
key() const;
/// Return the index of the referenced Value. -1 if it is not an arrayValue.
[[nodiscard]] UInt
UInt
index() const;
/// Return the member name of the referenced Value. "" if it is not an
/// objectValue.
[[nodiscard]] char const*
char const*
memberName() const;
protected:
[[nodiscard]] Value&
Value&
deref() const;
void
@@ -535,10 +535,10 @@ protected:
void
decrement();
[[nodiscard]] difference_type
difference_type
computeDistance(SelfType const& other) const;
[[nodiscard]] bool
bool
isEqual(SelfType const& other) const;
void

View File

@@ -30,47 +30,47 @@ public:
std::shared_ptr<STTx const> const&,
std::shared_ptr<STObject const> const&);
[[nodiscard]] std::shared_ptr<STTx const> const&
std::shared_ptr<STTx const> const&
getTxn() const
{
return mTxn;
}
[[nodiscard]] TxMeta const&
TxMeta const&
getMeta() const
{
return mMeta;
}
[[nodiscard]] boost::container::flat_set<AccountID> const&
boost::container::flat_set<AccountID> const&
getAffected() const
{
return mAffected;
}
[[nodiscard]] TxID
TxID
getTransactionID() const
{
return mTxn->getTransactionID();
}
[[nodiscard]] TxType
TxType
getTxnType() const
{
return mTxn->getTxnType();
}
[[nodiscard]] TER
TER
getResult() const
{
return mMeta.getResultTER();
}
[[nodiscard]] std::uint32_t
std::uint32_t
getTxnSeq() const
{
return mMeta.getIndex();
}
[[nodiscard]] std::string
std::string
getEscMeta() const;
[[nodiscard]] Json::Value const&
Json::Value const&
getJson() const
{
return mJson;

View File

@@ -36,7 +36,7 @@ public:
virtual ~AmendmentTable() = default;
[[nodiscard]] virtual uint256
virtual uint256
find(std::string const& name) const = 0;
virtual bool
@@ -47,9 +47,9 @@ public:
virtual bool
enable(uint256 const& amendment) = 0;
[[nodiscard]] virtual bool
virtual bool
isEnabled(uint256 const& amendment) const = 0;
[[nodiscard]] virtual bool
virtual bool
isSupported(uint256 const& amendment) const = 0;
/**
@@ -58,17 +58,17 @@ public:
*
* @return true if an unsupported feature is enabled on the network
*/
[[nodiscard]] virtual bool
virtual bool
hasUnsupportedEnabled() const = 0;
[[nodiscard]] virtual std::optional<NetClock::time_point>
virtual std::optional<NetClock::time_point>
firstUnsupportedExpected() const = 0;
[[nodiscard]] virtual Json::Value
virtual Json::Value
getJson(bool isAdmin) const = 0;
/** Returns a Json::objectValue. */
[[nodiscard]] virtual Json::Value
virtual Json::Value
getJson(uint256 const& amendment, bool isAdmin) const = 0;
/** Called when a new fully-validated ledger is accepted. */
@@ -87,7 +87,7 @@ public:
/** Called to determine whether the amendment logic needs to process
a new validated ledger. (If it could have changed things.)
*/
[[nodiscard]] virtual bool
virtual bool
needValidatedLedger(LedgerIndex seq) const = 0;
virtual void
@@ -112,14 +112,14 @@ public:
// Called by the consensus code when we need to
// add feature entries to a validation
[[nodiscard]] virtual std::vector<uint256>
virtual std::vector<uint256>
doValidation(std::set<uint256> const& enabled) const = 0;
// The set of amendments to enable in the genesis ledger
// This will return all known, non-vetoed amendments.
// If we ever have two amendments that should not both be
// enabled at the same time, we should ensure one is vetoed.
[[nodiscard]] virtual std::vector<uint256>
virtual std::vector<uint256>
getDesired() const = 0;
// The function below adapts the API callers expect to the

View File

@@ -134,7 +134,7 @@ public:
while transactions applied to the consensus
ledger produce hard failures (and claim a fee).
*/
[[nodiscard]] virtual ApplyFlags
virtual ApplyFlags
flags() const = 0;
/** Prepare to modify the SLE associated with key.

View File

@@ -22,10 +22,10 @@ public:
BookDirs(ReadView const&, Book const&);
[[nodiscard]] const_iterator
const_iterator
begin() const;
[[nodiscard]] const_iterator
const_iterator
end() const;
};

View File

@@ -59,13 +59,13 @@ private:
return !(lhs == rhs);
}
[[nodiscard]] uint256 const&
uint256 const&
getAccount() const
{
return account_;
}
[[nodiscard]] uint256 const&
uint256 const&
getTXID() const
{
return txId_;
@@ -118,30 +118,30 @@ public:
return map_.erase(it);
}
[[nodiscard]] const_iterator
const_iterator
begin() const
{
return map_.begin();
}
[[nodiscard]] const_iterator
const_iterator
end() const
{
return map_.end();
}
[[nodiscard]] size_t
size_t
size() const
{
return map_.size();
}
[[nodiscard]] bool
bool
empty() const
{
return map_.empty();
}
[[nodiscard]] uint256 const&
uint256 const&
key() const
{
return salt_;

View File

@@ -31,10 +31,10 @@ public:
Dir(ReadView const&, Keylet const&);
[[nodiscard]] const_iterator
const_iterator
begin() const;
[[nodiscard]] const_iterator
const_iterator
end() const;
};

View File

@@ -21,8 +21,9 @@ private:
struct ValueIOU
{
explicit ValueIOU() = default;
STAmount lowAcctDebits;
STAmount highAcctDebits;
STAmount lowAcctCredits;
STAmount highAcctCredits;
STAmount lowAcctOrigBalance;
};
@@ -74,10 +75,10 @@ public:
// Get the adjustments for the balance between main and other.
// Returns the debits, credits and the original balance
[[nodiscard]] std::optional<AdjustmentIOU>
std::optional<AdjustmentIOU>
adjustmentsIOU(AccountID const& main, AccountID const& other, Currency const& currency) const;
[[nodiscard]] std::optional<AdjustmentMPT>
std::optional<AdjustmentMPT>
adjustmentsMPT(MPTID const& mptID) const;
void
@@ -104,7 +105,7 @@ public:
// Get the adjusted owner count. Since DeferredCredits is meant to be used
// in payments, and payments only decrease owner counts, return the max
// remembered owner count.
[[nodiscard]] std::optional<std::uint32_t>
std::optional<std::uint32_t>
ownerCount(AccountID const& id) const;
void
@@ -179,15 +180,15 @@ public:
}
/** @} */
[[nodiscard]] STAmount
STAmount
balanceHookIOU(AccountID const& account, AccountID const& issuer, STAmount const& amount)
const override;
[[nodiscard]] STAmount
STAmount
balanceHookMPT(AccountID const& account, MPTIssue const& issue, std::int64_t amount)
const override;
[[nodiscard]] STAmount
STAmount
balanceHookSelfIssueMPT(MPTIssue const& issue, std::int64_t amount) const override;
void
@@ -212,7 +213,7 @@ public:
void
adjustOwnerCountHook(AccountID const& account, std::uint32_t cur, std::uint32_t next) override;
[[nodiscard]] std::uint32_t
std::uint32_t
ownerCountHook(AccountID const& account, std::uint32_t count) const override;
/** Apply changes to base view.
@@ -229,7 +230,14 @@ public:
apply(PaymentSandbox& to);
/** @} */
[[nodiscard]] XRPAmount
// Return a map of balance changes on trust lines. The low account is the
// first account in the key. If the two accounts are equal, the map contains
// the total changes in currency regardless of issuer. This is useful to get
// the total change in XRP balances.
std::map<std::tuple<AccountID, AccountID, Currency>, STAmount>
balanceChanges(ReadView const& view) const;
XRPAmount
xrpDestroyed() const;
private:

View File

@@ -39,22 +39,22 @@ public:
struct sles_type : detail::ReadViewFwdRange<std::shared_ptr<SLE const>>
{
explicit sles_type(ReadView const& view);
[[nodiscard]] iterator
iterator
begin() const;
[[nodiscard]] iterator
iterator
end() const;
[[nodiscard]] iterator
iterator
upper_bound(key_type const& key) const;
};
struct txs_type : detail::ReadViewFwdRange<tx_type>
{
explicit txs_type(ReadView const& view);
[[nodiscard]] bool
bool
empty() const;
[[nodiscard]] iterator
iterator
begin() const;
[[nodiscard]] iterator
iterator
end() const;
};
@@ -78,33 +78,33 @@ public:
}
/** Returns information about the ledger. */
[[nodiscard]] virtual LedgerHeader const&
virtual LedgerHeader const&
header() const = 0;
/** Returns true if this reflects an open ledger. */
[[nodiscard]] virtual bool
virtual bool
open() const = 0;
/** Returns the close time of the previous ledger. */
[[nodiscard]] NetClock::time_point
NetClock::time_point
parentCloseTime() const
{
return header().parentCloseTime;
}
/** Returns the sequence number of the base ledger. */
[[nodiscard]] LedgerIndex
LedgerIndex
seq() const
{
return header().seq;
}
/** Returns the fees for the base ledger. */
[[nodiscard]] virtual Fees const&
virtual Fees const&
fees() const = 0;
/** Returns the tx processing rules. */
[[nodiscard]] virtual Rules const&
virtual Rules const&
rules() const = 0;
/** Determine if a state item exists.
@@ -114,7 +114,7 @@ public:
@return `true` if a SLE is associated with the
specified key.
*/
[[nodiscard]] virtual bool
virtual bool
exists(Keylet const& k) const = 0;
/** Return the key of the next state item.
@@ -127,7 +127,7 @@ public:
the key returned would be outside the open
interval (key, last).
*/
[[nodiscard]] virtual std::optional<key_type>
virtual std::optional<key_type>
succ(key_type const& key, std::optional<key_type> const& last = std::nullopt) const = 0;
/** Return the state item associated with a key.
@@ -143,7 +143,7 @@ public:
@return `nullptr` if the key is not present or
if the type does not match.
*/
[[nodiscard]] virtual std::shared_ptr<SLE const>
virtual std::shared_ptr<SLE const>
read(Keylet const& k) const = 0;
// Accounts in a payment are not allowed to use assets acquired during that
@@ -151,7 +151,7 @@ public:
// changes that accounts make during a payment. `balanceHookIOU` adjusts
// balances so newly acquired assets are not counted toward the balance.
// This is required to support PaymentSandbox.
[[nodiscard]] virtual STAmount
virtual STAmount
balanceHookIOU(AccountID const& account, AccountID const& issuer, STAmount const& amount) const
{
XRPL_ASSERT(amount.holds<Issue>(), "balanceHookIOU: amount is for Issue");
@@ -161,7 +161,7 @@ public:
// balanceHookMPT adjusts balances so newly acquired assets are not counted
// toward the balance.
[[nodiscard]] virtual STAmount
virtual STAmount
balanceHookMPT(AccountID const& account, MPTIssue const& issue, std::int64_t amount) const
{
return STAmount{issue, amount};
@@ -171,7 +171,7 @@ public:
// funds available to issue, which are originally available funds less
// already self sold MPT amounts (MPT sell offer). This hook is used
// by issuerFundsToSelfIssue() function.
[[nodiscard]] virtual STAmount
virtual STAmount
balanceHookSelfIssueMPT(MPTIssue const& issue, std::int64_t amount) const
{
return STAmount{issue, amount};
@@ -182,30 +182,30 @@ public:
// changes that accounts make during a payment. `ownerCountHook` adjusts the
// ownerCount so it returns the max value of the ownerCount so far.
// This is required to support PaymentSandbox.
[[nodiscard]] virtual std::uint32_t
virtual std::uint32_t
ownerCountHook(AccountID const& account, std::uint32_t count) const
{
return count;
}
// used by the implementation
[[nodiscard]] virtual std::unique_ptr<sles_type::iter_base>
virtual std::unique_ptr<sles_type::iter_base>
slesBegin() const = 0;
// used by the implementation
[[nodiscard]] virtual std::unique_ptr<sles_type::iter_base>
virtual std::unique_ptr<sles_type::iter_base>
slesEnd() const = 0;
// used by the implementation
[[nodiscard]] virtual std::unique_ptr<sles_type::iter_base>
virtual std::unique_ptr<sles_type::iter_base>
slesUpperBound(key_type const& key) const = 0;
// used by the implementation
[[nodiscard]] virtual std::unique_ptr<txs_type::iter_base>
virtual std::unique_ptr<txs_type::iter_base>
txsBegin() const = 0;
// used by the implementation
[[nodiscard]] virtual std::unique_ptr<txs_type::iter_base>
virtual std::unique_ptr<txs_type::iter_base>
txsEnd() const = 0;
/** Returns `true` if a tx exists in the tx map.
@@ -213,7 +213,7 @@ public:
A tx exists in the map if it is part of the
base ledger, or if it is a newly inserted tx.
*/
[[nodiscard]] virtual bool
virtual bool
txExists(key_type const& key) const = 0;
/** Read a transaction from the tx map.
@@ -224,7 +224,7 @@ public:
@return A pair of nullptr if the
key is not found in the tx map.
*/
[[nodiscard]] virtual tx_type
virtual tx_type
txRead(key_type const& key) const = 0;
//
@@ -257,7 +257,7 @@ public:
@return std::nullopt if the item does not exist.
*/
[[nodiscard]] virtual std::optional<digest_type>
virtual std::optional<digest_type>
digest(key_type const& key) const = 0;
};

View File

@@ -54,19 +54,19 @@ public:
bool isDryRun,
beast::Journal j);
[[nodiscard]] bool
bool
exists(ReadView const& base, Keylet const& k) const;
[[nodiscard]] std::optional<key_type>
std::optional<key_type>
succ(ReadView const& base, key_type const& key, std::optional<key_type> const& last) const;
[[nodiscard]] std::shared_ptr<SLE const>
std::shared_ptr<SLE const>
read(ReadView const& base, Keylet const& k) const;
std::shared_ptr<SLE>
peek(ReadView const& base, Keylet const& k);
[[nodiscard]] std::size_t
std::size_t
size() const;
void
@@ -97,7 +97,7 @@ public:
destroyXRP(XRPAmount const& fee);
// For debugging
[[nodiscard]] XRPAmount const&
XRPAmount const&
dropsDestroyed() const
{
return dropsDestroyed_;

View File

@@ -22,51 +22,51 @@ public:
ApplyViewBase(ReadView const* base, ApplyFlags flags);
// ReadView
[[nodiscard]] bool
bool
open() const override;
[[nodiscard]] LedgerHeader const&
LedgerHeader const&
header() const override;
[[nodiscard]] Fees const&
Fees const&
fees() const override;
[[nodiscard]] Rules const&
Rules const&
rules() const override;
[[nodiscard]] bool
bool
exists(Keylet const& k) const override;
[[nodiscard]] std::optional<key_type>
std::optional<key_type>
succ(key_type const& key, std::optional<key_type> const& last = std::nullopt) const override;
[[nodiscard]] std::shared_ptr<SLE const>
std::shared_ptr<SLE const>
read(Keylet const& k) const override;
[[nodiscard]] std::unique_ptr<sles_type::iter_base>
std::unique_ptr<sles_type::iter_base>
slesBegin() const override;
[[nodiscard]] std::unique_ptr<sles_type::iter_base>
std::unique_ptr<sles_type::iter_base>
slesEnd() const override;
[[nodiscard]] std::unique_ptr<sles_type::iter_base>
std::unique_ptr<sles_type::iter_base>
slesUpperBound(uint256 const& key) const override;
[[nodiscard]] std::unique_ptr<txs_type::iter_base>
std::unique_ptr<txs_type::iter_base>
txsBegin() const override;
[[nodiscard]] std::unique_ptr<txs_type::iter_base>
std::unique_ptr<txs_type::iter_base>
txsEnd() const override;
[[nodiscard]] bool
bool
txExists(key_type const& key) const override;
[[nodiscard]] tx_type
tx_type
txRead(key_type const& key) const override;
// ApplyView
[[nodiscard]] ApplyFlags
ApplyFlags
flags() const override;
std::shared_ptr<SLE>

View File

@@ -42,10 +42,10 @@ public:
void
apply(RawView& to) const;
[[nodiscard]] bool
bool
exists(ReadView const& base, Keylet const& k) const;
[[nodiscard]] std::optional<key_type>
std::optional<key_type>
succ(ReadView const& base, key_type const& key, std::optional<key_type> const& last) const;
void
@@ -57,19 +57,19 @@ public:
void
replace(std::shared_ptr<SLE> const& sle);
[[nodiscard]] std::shared_ptr<SLE const>
std::shared_ptr<SLE const>
read(ReadView const& base, Keylet const& k) const;
void
destroyXRP(XRPAmount const& fee);
[[nodiscard]] std::unique_ptr<ReadView::sles_type::iter_base>
std::unique_ptr<ReadView::sles_type::iter_base>
slesBegin(ReadView const& base) const;
[[nodiscard]] std::unique_ptr<ReadView::sles_type::iter_base>
std::unique_ptr<ReadView::sles_type::iter_base>
slesEnd(ReadView const& base) const;
[[nodiscard]] std::unique_ptr<ReadView::sles_type::iter_base>
std::unique_ptr<ReadView::sles_type::iter_base>
slesUpperBound(ReadView const& base, uint256 const& key) const;
private:

View File

@@ -27,16 +27,16 @@ public:
virtual ~ReadViewFwdIter() = default;
[[nodiscard]] virtual std::unique_ptr<ReadViewFwdIter>
virtual std::unique_ptr<ReadViewFwdIter>
copy() const = 0;
[[nodiscard]] virtual bool
virtual bool
equal(ReadViewFwdIter const& impl) const = 0;
virtual void
increment() = 0;
[[nodiscard]] virtual value_type
virtual value_type
dereference() const = 0;
};

View File

@@ -43,7 +43,7 @@ public:
{
}
[[nodiscard]] bool
bool
isSecure() const
{
return mSecure;

View File

@@ -58,7 +58,7 @@ public:
return ssl_context_;
}
[[nodiscard]] bool
bool
sslVerify() const
{
return verify_;

View File

@@ -34,7 +34,7 @@ public:
/** Get the block size for backends that support it
*/
[[nodiscard]] virtual std::optional<std::size_t>
virtual std::optional<std::size_t>
getBlockSize() const
{
return std::nullopt;
@@ -135,7 +135,7 @@ public:
}
/** Returns the number of file descriptors the backend expects to need. */
[[nodiscard]] virtual int
virtual int
fdRequired() const = 0;
};

View File

@@ -16,7 +16,7 @@ public:
virtual ~Factory() = default;
/** Retrieve the name of this factory. */
[[nodiscard]] virtual std::string
virtual std::string
getName() const = 0;
/** Create an instance of this factory's backend.

View File

@@ -59,15 +59,15 @@ public:
createObject(NodeObjectType type, Blob&& data, uint256 const& hash);
/** Returns the type of this object. */
[[nodiscard]] NodeObjectType
NodeObjectType
getType() const;
/** Returns the hash of the data. */
[[nodiscard]] uint256 const&
uint256 const&
getHash() const;
/** Returns the underlying data. */
[[nodiscard]] Blob const&
Blob const&
getData() const;
private:

View File

@@ -21,7 +21,7 @@ public:
DecodedBlob(void const* key, void const* value, int valueBytes);
/** Determine if the decoding was successful. */
[[nodiscard]] bool
bool
wasOk() const noexcept
{
return m_success;

View File

@@ -54,9 +54,8 @@ read_varint(void const* buf, std::size_t buflen, std::size_t& t)
return 1;
}
auto const used = n;
while (n > 0)
while (n--)
{
--n;
auto const d = p[n];
auto const t0 = t;
t *= 127;

View File

@@ -234,11 +234,9 @@ message TMGetObjectByHash {
otTRANSACTIONS = 7;
}
// Previously used - don't reuse.
reserved 3;
required ObjectType type = 1;
required bool query = 2; // is this a query or a reply?
optional uint32 seq = 3; // used to match replies to queries
optional bytes ledgerHash = 4; // the hash of the ledger these queries are for
optional bool fat = 5; // return related nodes
repeated TMIndexedObject objects = 6; // the specific objects requested

View File

@@ -68,7 +68,7 @@ public:
{
}
[[nodiscard]] AccountID const&
AccountID const&
getIssuer() const;
template <ValidIssueType TIss>
@@ -80,16 +80,16 @@ public:
get();
template <ValidIssueType TIss>
[[nodiscard]] constexpr bool
constexpr bool
holds() const;
[[nodiscard]] std::string
std::string
getText() const;
[[nodiscard]] constexpr value_type const&
constexpr value_type const&
value() const;
[[nodiscard]] constexpr token_type
constexpr token_type
token() const;
void
@@ -98,7 +98,7 @@ public:
STAmount
operator()(Number const&) const;
[[nodiscard]] constexpr AmtType
constexpr AmtType
getAmountType() const;
// Custom, generic visit implementation
@@ -111,7 +111,7 @@ public:
return detail::visit(issue_, std::forward<Visitors>(visitors)...);
}
[[nodiscard]] constexpr bool
constexpr bool
native() const
{
return visit(
@@ -119,7 +119,7 @@ public:
[&](MPTIssue const&) { return false; });
}
[[nodiscard]] bool
bool
integral() const
{
return visit(
@@ -169,7 +169,7 @@ Asset::holds() const
}
template <ValidIssueType TIss>
[[nodiscard]] constexpr TIss const&
constexpr TIss const&
Asset::get() const
{
if (!std::holds_alternative<TIss>(issue_))

View File

@@ -0,0 +1,391 @@
#pragma once
#include <xrpl/basics/Slice.h>
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/MPTIssue.h>
#include <xrpl/protocol/Protocol.h>
#include <xrpl/protocol/Rate.h>
#include <xrpl/protocol/STLedgerEntry.h>
#include <xrpl/protocol/STObject.h>
#include <xrpl/protocol/Serializer.h>
#include <xrpl/protocol/TER.h>
#include <xrpl/protocol/TxFormats.h>
#include <xrpl/protocol/detail/secp256k1.h>
#include <secp256k1_mpt.h>
namespace xrpl {
/**
* @brief Bundles an ElGamal public key with its associated encrypted amount.
*
* Used to represent a recipient in confidential transfers, containing both
* the recipient's ElGamal public key and the ciphertext encrypting the
* transfer amount under that key.
*/
struct ConfidentialRecipient
{
Slice publicKey; ///< The recipient's ElGamal public key (size=xrpl::ecPubKeyLength).
Slice encryptedAmount; ///< The encrypted amount ciphertext
///< (size=xrpl::ecGamalEncryptedTotalLength).
};
/// Holds two secp256k1 public key components representing an ElGamal ciphertext (C1, C2).
struct EcPair
{
secp256k1_pubkey c1;
secp256k1_pubkey c2;
};
/**
* @brief Increments the confidential balance version counter on an MPToken.
*
* The version counter is used to prevent replay attacks by binding proofs
* to a specific state of the account's confidential balance. Wraps to 0
* on overflow (defined behavior for unsigned integers).
*
* @param mptoken The MPToken ledger entry to update.
*/
inline void
incrementConfidentialVersion(STObject& mptoken)
{
// Retrieve current version and increment.
// Unsigned integer overflow is defined behavior in C++ (wraps to 0),
// which is acceptable here.
mptoken[sfConfidentialBalanceVersion] =
mptoken[~sfConfidentialBalanceVersion].value_or(0u) + 1u;
}
/**
* @brief Generates the context hash for ConfidentialMPTSend transactions.
*
* Creates a unique 256-bit hash that binds the zero-knowledge proofs to
* this specific send transaction, preventing proof reuse across transactions.
*
* @param account The sender's account ID.
* @param issuanceID The MPToken Issuance ID.
* @param sequence The transaction sequence number or ticket number.
* @param destination The destination account ID.
* @param version The sender's confidential balance version.
* @return A 256-bit context hash unique to this transaction.
*/
uint256
getSendContextHash(
AccountID const& account,
uint192 const& issuanceID,
std::uint32_t sequence,
AccountID const& destination,
std::uint32_t version);
/**
* @brief Generates the context hash for ConfidentialMPTClawback transactions.
*
* Creates a unique 256-bit hash that binds the equality proof to this
* specific clawback transaction.
*
* @param account The issuer's account ID.
* @param issuanceID The MPToken Issuance ID.
* @param sequence The transaction sequence number or ticket number.
* @param holder The holder's account ID being clawed back from.
* @return A 256-bit context hash unique to this transaction.
*/
uint256
getClawbackContextHash(
AccountID const& account,
uint192 const& issuanceID,
std::uint32_t sequence,
AccountID const& holder);
/**
* @brief Generates the context hash for ConfidentialMPTConvert transactions.
*
* Creates a unique 256-bit hash that binds the Schnorr proof (for key
* registration) to this specific convert transaction.
*
* @param account The holder's account ID.
* @param issuanceID The MPToken Issuance ID.
* @param sequence The transaction sequence number or a ticket number.
* @return A 256-bit context hash unique to this transaction.
*/
uint256
getConvertContextHash(AccountID const& account, uint192 const& issuanceID, std::uint32_t sequence);
/**
* @brief Generates the context hash for ConfidentialMPTConvertBack transactions.
*
* Creates a unique 256-bit hash that binds the zero-knowledge proofs to
* this specific convert-back transaction.
*
* @param account The holder's account ID.
* @param issuanceID The MPToken Issuance ID.
* @param sequence The transaction sequence number or a ticket number.
* @param version The holder's confidential balance version.
* @return A 256-bit context hash unique to this transaction.
*/
uint256
getConvertBackContextHash(
AccountID const& account,
uint192 const& issuanceID,
std::uint32_t sequence,
std::uint32_t version);
/**
* @brief Parses an ElGamal ciphertext into two secp256k1 public key components.
*
* Breaks a 66-byte encrypted amount (two 33-byte compressed EC points) into
* a pair containing (C1, C2) for use in cryptographic operations.
*
* @param buffer The 66-byte buffer containing the compressed ciphertext.
* @return The parsed pair (c1, c2) if successful, std::nullopt if the buffer is invalid.
*/
std::optional<EcPair>
makeEcPair(Slice const& buffer);
/**
* @brief Serializes an EcPair into compressed form.
*
* Converts an EcPair (C1, C2) back into a 66-byte buffer containing
* two 33-byte compressed EC points.
*
* @param pair The EcPair to serialize.
* @return The 66-byte buffer, or std::nullopt if serialization fails.
*/
std::optional<Buffer>
serializeEcPair(EcPair const& pair);
/**
* @brief Verifies that a buffer contains two valid, parsable EC public keys.
*
* @param buffer The input buffer containing two concatenated components.
* @return true if both components can be parsed successfully, false otherwise.
*/
bool
isValidCiphertext(Slice const& buffer);
/**
* @brief Verifies that a buffer contains a valid, parsable compressed EC point.
*
* Can be used to validate both compressed public keys and Pedersen commitments.
* Fails early if the prefix byte is not 0x02 or 0x03.
*
* @param buffer The input buffer containing a compressed EC point (33 bytes).
* @return true if the point can be parsed successfully, false otherwise.
*/
bool
isValidCompressedECPoint(Slice const& buffer);
/**
* @brief Homomorphically adds two ElGamal ciphertexts.
*
* Uses the additive homomorphic property of ElGamal encryption to compute
* Enc(a + b) from Enc(a) and Enc(b) without decryption.
*
* @param a The first ciphertext (66 bytes).
* @param b The second ciphertext (66 bytes).
* @return The resulting ciphertext Enc(a + b), or std::nullopt on failure.
*/
std::optional<Buffer>
homomorphicAdd(Slice const& a, Slice const& b);
/**
* @brief Homomorphically subtracts two ElGamal ciphertexts.
*
* Uses the additive homomorphic property of ElGamal encryption to compute
* Enc(a - b) from Enc(a) and Enc(b) without decryption.
*
* @param a The minuend ciphertext (66 bytes).
* @param b The subtrahend ciphertext (66 bytes).
* @return The resulting ciphertext Enc(a - b), or std::nullopt on failure.
*/
std::optional<Buffer>
homomorphicSubtract(Slice const& a, Slice const& b);
/**
* @brief Encrypts an amount using ElGamal encryption.
*
* Produces a ciphertext C = (C1, C2) where C1 = r*G and C2 = m*G + r*Pk,
* using the provided blinding factor r.
*
* @param amt The plaintext amount to encrypt.
* @param pubKeySlice The recipient's ElGamal public key (size=xrpl::ecPubKeyLength).
* @param blindingFactor The randomness used as blinding factor r
* (size=xrpl::ecBlindingFactorLength).
* @return The ciphertext (size=xrpl::ecGamalEncryptedTotalLength), or std::nullopt on failure.
*/
std::optional<Buffer>
encryptAmount(uint64_t const amt, Slice const& pubKeySlice, Slice const& blindingFactor);
/**
* @brief Generates the canonical zero encryption for a specific MPToken.
*
* Creates a deterministic encryption of zero that is unique to the account
* and MPT issuance. Used to initialize confidential balance fields.
*
* @param pubKeySlice The holder's ElGamal public key (size=xrpl::ecPubKeyLength).
* @param account The account ID of the token holder.
* @param mptId The MPToken Issuance ID.
* @return The canonical zero ciphertext (size=xrpl::ecGamalEncryptedTotalLength), or std::nullopt
* on failure.
*/
std::optional<Buffer>
encryptCanonicalZeroAmount(Slice const& pubKeySlice, AccountID const& account, MPTID const& mptId);
/**
* @brief Verifies a Schnorr proof of knowledge of an ElGamal private key.
*
* Proves that the submitter knows the secret key corresponding to the
* provided public key, without revealing the secret key itself.
*
* @param pubKeySlice The ElGamal public key (size=xrpl::ecPubKeyLength).
* @param proofSlice The Schnorr proof (size=xrpl::ecSchnorrProofLength).
* @param contextHash The 256-bit context hash binding the proof.
* @return tesSUCCESS if valid, or an error code otherwise.
*/
TER
verifySchnorrProof(Slice const& pubKeySlice, Slice const& proofSlice, uint256 const& contextHash);
/**
* @brief Validates the format of encrypted amount fields in a transaction.
*
* Checks that all ciphertext fields in the transaction object have the
* correct length and contain valid EC points. This function is only used
* by ConfidentialMPTConvert and ConfidentialMPTConvertBack transactions.
*
* @param object The transaction object containing encrypted amount fields.
* @return tesSUCCESS if all formats are valid, temMALFORMED if required fields
* are missing, or temBAD_CIPHERTEXT if format validation fails.
*/
NotTEC
checkEncryptedAmountFormat(STObject const& object);
/**
* @brief Verifies revealed amount encryptions for all recipients.
*
* Validates that the same amount was correctly encrypted for the holder,
* issuer, and optionally the auditor using their respective public keys.
*
* @param amount The revealed plaintext amount.
* @param blindingFactor The blinding factor used in all encryptions
* (size=xrpl::ecBlindingFactorLength).
* @param holder The holder's public key and encrypted amount.
* @param issuer The issuer's public key and encrypted amount.
* @param auditor Optional auditor's public key and encrypted amount.
* @return tesSUCCESS if all encryptions are valid, or an error code otherwise.
*/
TER
verifyRevealedAmount(
uint64_t const amount,
Slice const& blindingFactor,
ConfidentialRecipient const& holder,
ConfidentialRecipient const& issuer,
std::optional<ConfidentialRecipient> const& auditor);
/**
* @brief Returns the number of recipients in a confidential transfer.
*
* Returns 4 if an auditor is present (sender, destination, issuer, auditor),
* or 3 if no auditor (sender, destination, issuer).
*
* @param hasAuditor Whether the issuance has an auditor configured.
* @return The number of recipients (3 or 4).
*/
constexpr uint8_t
getConfidentialRecipientCount(bool hasAuditor)
{
return hasAuditor ? 4 : 3;
}
/**
* @brief Verifies a compact sigma clawback proof.
*
* Proves that the issuer knows the exact amount encrypted in the holder's
* balance ciphertext. Used in ConfidentialMPTClawback to verify the issuer
* can decrypt the balance using their private key.
*
* @param amount The revealed plaintext amount.
* @param proof The zero-knowledge proof bytes (ecClawbackProofLength).
* @param pubKeySlice The issuer's ElGamal public key (ecPubKeyLength bytes).
* @param ciphertext The issuer's encrypted balance on the holder's account
* (ecGamalEncryptedTotalLength bytes).
* @param contextHash The 256-bit context hash binding the proof.
* @return tesSUCCESS if the proof is valid, or an error code otherwise.
*/
TER
verifyClawbackProof(
uint64_t const amount,
Slice const& proof,
Slice const& pubKeySlice,
Slice const& ciphertext,
uint256 const& contextHash);
/**
* @brief Generates a cryptographically secure 32-byte blinding factor.
*
* Produces random bytes suitable for use as an ElGamal blinding factor
* or Pedersen commitment randomness.
*
* @return A 32-byte buffer containing the random blinding factor.
*/
Buffer
generateBlindingFactor();
/**
* @brief Verifies all zero-knowledge proofs for a ConfidentialMPTSend transaction.
*
* This function calls mpt_verify_send_proof API in the mpt-crypto utility lib, which verifies the
* equality proof, amount linkage, balance linkage, and range proof.
* Equality proof: Proves the same value is encrypted for the sender, receiver, issuer, and auditor.
* Amount linkage: Proves the send amount matches the amount Pedersen commitment.
* Balance linkage: Proves the sender's balance matches the balance Pedersen
* commitment.
* Range proof: Proves the amount and the remaining balance are within range [0, 2^64-1].
*
* @param proof The full proof blob.
* @param sender The sender's public key and encrypted amount.
* @param destination The destination's public key and encrypted amount.
* @param issuer The issuer's public key and encrypted amount.
* @param auditor The auditor's public key and encrypted amount if present.
* @param spendingBalance The sender's current spending balance ciphertext.
* @param amountCommitment The Pedersen commitment to the send amount.
* @param balanceCommitment The Pedersen commitment to the sender's balance.
* @param contextHash The context hash binding the proof.
* @return tesSUCCESS if all proofs are valid, or an error code otherwise.
*/
TER
verifySendProof(
Slice const& proof,
ConfidentialRecipient const& sender,
ConfidentialRecipient const& destination,
ConfidentialRecipient const& issuer,
std::optional<ConfidentialRecipient> const& auditor,
Slice const& spendingBalance,
Slice const& amountCommitment,
Slice const& balanceCommitment,
uint256 const& contextHash);
/**
* @brief Verifies all zero-knowledge proofs for a ConfidentialMPTConvertBack transaction.
*
* This function calls mpt_verify_convert_back_proof API in the mpt-crypto utility lib, which
* verifies the balance linkage proof and range proof. Balance linkage proof: proves the balance
* commitment matches the spending ciphertext. Range proof: proves the remaining balance after
* convert back is within range [0, 2^64-1].
*
* @param proof The full proof blob.
* @param pubKeySlice The holder's public key.
* @param spendingBalance The holder's spending balance ciphertext.
* @param balanceCommitment The Pedersen commitment to the balance.
* @param amount The amount being converted back to public.
* @param contextHash The context hash binding the proof.
* @return tesSUCCESS if all proofs are valid, or an error code otherwise.
*/
TER
verifyConvertBackProof(
Slice const& proof,
Slice const& pubKeySlice,
Slice const& spendingBalance,
Slice const& balanceCommitment,
uint64_t amount,
uint256 const& contextHash);
} // namespace xrpl

View File

@@ -39,7 +39,7 @@ struct Fees
The reserve is calculated as the reserve base plus
the reserve increment times the number of increments.
*/
[[nodiscard]] XRPAmount
XRPAmount
accountReserve(std::size_t ownerCount) const
{
return reserve + ownerCount * increment;

View File

@@ -71,13 +71,13 @@ public:
operator bool() const noexcept;
/** Return the sign of the amount */
[[nodiscard]] int
int
signum() const noexcept;
[[nodiscard]] exponent_type
exponent_type
exponent() const noexcept;
[[nodiscard]] mantissa_type
mantissa_type
mantissa() const noexcept;
static IOUAmount

View File

@@ -18,7 +18,7 @@ public:
static InnerObjectFormats const&
getInstance();
[[nodiscard]] SOTemplate const*
SOTemplate const*
findSOTemplateBySField(SField const& sField) const;
};

View File

@@ -21,22 +21,22 @@ public:
{
}
[[nodiscard]] AccountID const&
AccountID const&
getIssuer() const
{
return account;
}
[[nodiscard]] std::string
std::string
getText() const;
void
setJson(Json::Value& jv) const;
[[nodiscard]] bool
bool
native() const;
[[nodiscard]] bool
bool
integral() const;
friend constexpr std::weak_ordering

View File

@@ -25,7 +25,7 @@ struct Keylet
}
/** Returns true if the SLE matches the type */
[[nodiscard]] bool
bool
check(STLedgerEntry const&) const;
};

View File

@@ -44,7 +44,7 @@ public:
/** Retrieve the name of the format.
*/
[[nodiscard]] std::string const&
std::string const&
getName() const
{
return name_;
@@ -52,13 +52,13 @@ public:
/** Retrieve the transaction type this format represents.
*/
[[nodiscard]] KeyType
KeyType
getType() const
{
return type_;
}
[[nodiscard]] SOTemplate const&
SOTemplate const&
getSOTemplate() const
{
return soTemplate_;
@@ -96,7 +96,7 @@ public:
@param name The name of the type.
@return The type.
*/
[[nodiscard]] KeyType
KeyType
findTypeByName(std::string const& name) const
{
if (auto const result = findByName(name))
@@ -108,7 +108,7 @@ public:
/** Retrieve a format based on its type.
*/
[[nodiscard]] Item const*
Item const*
findByType(KeyType type) const
{
auto const itr = types_.find(type);
@@ -118,13 +118,13 @@ public:
}
// begin() and end() are provided for testing purposes.
[[nodiscard]] typename std::forward_list<Item>::const_iterator
typename std::forward_list<Item>::const_iterator
begin() const
{
return formats_.begin();
}
[[nodiscard]] typename std::forward_list<Item>::const_iterator
typename std::forward_list<Item>::const_iterator
end() const
{
return formats_.end();
@@ -133,7 +133,7 @@ public:
protected:
/** Retrieve a format based on its name.
*/
[[nodiscard]] Item const*
Item const*
findByName(std::string const& name) const
{
auto const itr = names_.find(name);

View File

@@ -173,7 +173,8 @@ enum LedgerEntryType : std::uint16_t {
LSF_FLAG(lsfMPTCanEscrow, 0x00000008) \
LSF_FLAG(lsfMPTCanTrade, 0x00000010) \
LSF_FLAG(lsfMPTCanTransfer, 0x00000020) \
LSF_FLAG(lsfMPTCanClawback, 0x00000040)) \
LSF_FLAG(lsfMPTCanClawback, 0x00000040) \
LSF_FLAG(lsfMPTCanConfidentialAmount, 0x00000080)) \
\
LEDGER_OBJECT(MPTokenIssuanceMutable, \
LSF_FLAG(lsmfMPTCanMutateCanLock, 0x00000002) \
@@ -183,7 +184,8 @@ enum LedgerEntryType : std::uint16_t {
LSF_FLAG(lsmfMPTCanMutateCanTransfer, 0x00000020) \
LSF_FLAG(lsmfMPTCanMutateCanClawback, 0x00000040) \
LSF_FLAG(lsmfMPTCanMutateMetadata, 0x00010000) \
LSF_FLAG(lsmfMPTCanMutateTransferFee, 0x00020000)) \
LSF_FLAG(lsmfMPTCanMutateTransferFee, 0x00020000) \
LSF_FLAG(lsmfMPTCannotMutateCanConfidentialAmount, 0x00040000)) \
\
LEDGER_OBJECT(MPToken, \
LSF_FLAG2(lsfMPTLocked, 0x00000001) \

View File

@@ -68,14 +68,14 @@ public:
}
/** Return the sign of the amount */
[[nodiscard]] constexpr int
constexpr int
signum() const noexcept;
/** Returns the underlying value. Code SHOULD NOT call this
function unless the type has been abstracted away,
e.g. in a templated function.
*/
[[nodiscard]] constexpr value_type
constexpr value_type
value() const;
static MPTAmount

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