Commit Graph

14004 Commits

Author SHA1 Message Date
Pretty Printer
f7f6e019bf Rename .hpp to .h 2025-06-15 21:07:42 +09:00
John Freeman
13ea38bcbb Simplify protobuf generation 2025-06-15 21:07:29 +09:00
Pretty Printer
3bf1229b42 Consolidate external libraries 2025-06-06 16:07:10 +09:00
John Freeman
4f476237c0 Remove unused files 2025-06-06 15:46:57 +09:00
Ed Hennis
0c34036549 fix: Remove redundant STAmount conversion in test (#4996) 2025-06-06 15:46:54 +09:00
Scott Determan
ef7ac442e6 fix: resolve database deadlock: (#4989)
The `rotateWithLock` function holds a lock while it calls a callback
function that's passed in by the caller. This is a problematic design
that needs to be used very carefully. In this case, at least one caller
passed in a callback that eventually relocks the mutex on the same
thread, causing UB (a deadlock was observed). The caller was from
SHAMapStoreImpl, and it called `clearCaches`. This `clearCaches` can
potentially call `fetchNodeObject`, which tried to relock the mutex.

This patch resolves the issue by changing the mutex type to a
`recursive_mutex`. Ideally, the code should be rewritten so it doesn't
hold the mutex during the callback and the mutex should be changed back
to a regular mutex.

Co-authored-by: Ed Hennis <ed@ripple.com>
2025-06-06 15:46:51 +09:00
Michael Legleux
0d6f8afeac fix Conan component reference typo 2025-06-06 15:46:47 +09:00
Bronek Kozicki
fe71d30665 Remove unused lambdas from MultiApiJson_test 2025-06-06 15:46:36 +09:00
Chenna Keshava B S
0f86e7ad54 test: verify the rounding behavior of equal-asset AMM deposits (#4982)
* Specifically, test using tfLPToken flag
2025-06-06 15:46:27 +09:00
John Freeman
4d03f30571 test: Add tests to raise coverage of AMM (#4971)
---------

Co-authored-by: Howard Hinnant <howard.hinnant@gmail.com>
Co-authored-by: Mark Travis <mtravis@ripple.com>
Co-authored-by: Bronek Kozicki <brok@incorrekt.com>
Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
Co-authored-by: Chenna Keshava <ckeshavabs@gmail.com>
2025-06-06 15:46:13 +09:00
John Freeman
415ef13480 test: Add tests to raise coverage of AMM (#4971)
---------

Co-authored-by: Howard Hinnant <howard.hinnant@gmail.com>
Co-authored-by: Mark Travis <mtravis@ripple.com>
Co-authored-by: Bronek Kozicki <brok@incorrekt.com>
Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
Co-authored-by: Chenna Keshava <ckeshavabs@gmail.com>
2025-06-06 15:44:24 +09:00
Bronek Kozicki
632c2982a4 test: Unit test for AMM offer overflow (#4986) 2025-06-06 14:48:00 +09:00
Mayukha Vadari
c97148218f fix amendment to add PreviousTxnID/PreviousTxnLgrSequence (#4751)
This amendment, `fixPreviousTxnID`, adds `PreviousTxnID` and
`PreviousTxnLgrSequence` as fields to all ledger objects that did
not already have them included (`DirectoryNode`, `Amendments`,
`FeeSettings`, `NegativeUNL`, and `AMM`). This makes it much easier
to go through the history of these ledger objects.
2025-06-06 14:47:47 +09:00
Ed Hennis
6bbd3cd9e0 chore: Default validator-keys-tool to master branch: (#4943)
* master is the default branch for that project. There's no point in
  using develop.
2025-06-06 13:09:45 +09:00
Scott Determan
df6da572d0 fixXChainRewardRounding: round reward shares down: (#4933)
When calculating reward shares, the amount should always be rounded
down. If the `fixUniversalNumber` amendment is not active, this works
correctly. If it is not active, then the amount is incorrectly rounded
up. This patch introduces an amendment so it will be rounded down.
2025-06-06 13:08:48 +09:00
Mark Travis
e2f562ae91 Don't reach consensus as quickly if no other proposals seen: (#4763)
This fixes a case where a peer can desync under a certain timing
circumstance--if it reaches a certain point in consensus before it receives
proposals. 

This was noticed under high transaction volumes. Namely, when we arrive at the
point of deciding whether consensus is reached after minimum establish phase
duration but before having received any proposals. This could be caused by
finishing the previous round slightly faster and/or having some delay in
receiving proposals. Existing behavior arrives at consensus immediately after
the minimum establish duration with no proposals. This causes us to desync
because we then close a non-validated ledger. The change in this PR causes us to
wait for a configured threshold before making the decision to arrive at
consensus with no proposals. This allows validators to catch up and for brief
delays in receiving proposals to be absorbed. There should be no drawback since,
with no proposals coming in, we needn't be in a huge rush to jump ahead.
2025-06-06 13:07:46 +09:00
Bronek Kozicki
97fb26f491 Write improved forAllApiVersions used in NetworkOPs (#4833) 2025-06-06 13:07:19 +09:00
Bronek Kozicki
7c89952537 Enforce no duplicate slots from incoming connections: (#4944)
We do not currently enforce that incoming peer connection does not have
remote_endpoint which is already used (either by incoming or outgoing
connection), hence already stored in slots_. If we happen to receive a
connection from such a duplicate remote_endpoint, it will eventually result in a
crash (when disconnecting) or weird behavior (when updating slot state), as a
result of an apparently matching remote_endpoint in slots_ being used by a
different connection.
2025-06-06 13:01:11 +09:00
Mayukha Vadari
d66b67fccb fixEmptyDID: fix amendment to handle empty DID edge case: (#4950)
This amendment fixes an edge case where an empty DID object can be
created. It adds an additional check to ensure that DIDs are
non-empty when created, and returns a `tecEMPTY_DID` error if the DID
would be empty.
2025-06-06 13:00:47 +09:00
Ed Hennis
12fb3abb13 test: Env unit test RPC errors return a unique result: (#4877)
* telENV_RPC_FAILED is a new code, reserved exclusively
  for unit tests when RPC fails. This will
  make those types of errors distinct and easier to test
  for when expected and/or diagnose when not.
* Output RPC command result when result is not expected.
2025-06-06 12:53:00 +09:00
Bronek Kozicki
2a509960c5 Upgrade to xxhash 0.8.2 as a Conan requirement, enable SIMD hashing (#4893)
We are currently using old version 0.6.2 of `xxhash`, as a verbatim copy and paste of its header file `xxhash.h`. Switch to the more recent version 0.8.2. Since this version is in Conan Center (and properly protects its ABI by keeping the state object incomplete), add it as a Conan requirement. Switch to the SIMD instructions (in the new `XXH3` family) supported by the new version.
2025-06-06 12:41:55 +09:00
Michael Legleux
dbeca5a2ee Install more public headers (#4940)
Fixes some mistakes in #4885
2025-06-06 12:30:28 +09:00
Scott Determan
646fb1a860 fix: order book update variable swap: (#4890)
This is likely the result of a typo when the code was simplified.
2025-06-06 12:21:02 +09:00
John Freeman
7f2ddf431b Embed patched recipe for RocksDB 6.29.5 (#4947) 2025-06-06 12:20:45 +09:00
Gregory Tsipenyuk
9d5b013b34 build: add STCurrency.h to xrpl_core to fix clio build (#4939) 2025-06-06 12:10:58 +09:00
Mayukha Vadari
266e2a26fc feat: add user version of feature RPC (#4781)
* uses same formatting as admin RPC
* hides potentially sensitive data
2025-06-06 12:10:42 +09:00
Scott Determan
c8373de952 Fast base58 codec: (#4327)
This algorithm is about an order of magnitude faster than the existing
algorithm (about 10x faster for encoding and about 15x faster for
decoding - including the double hash for the checksum). The algorithms
use gcc's int128 (fast MS version will have to wait, in the meantime MS
falls back to the slow code).
2025-06-06 12:01:35 +09:00
Chenna Keshava B S
fd36796bbd Remove default ctors from SecretKey and PublicKey: (#4607)
* It is now an invariant that all constructed Public Keys are valid,
  non-empty and contain 33 bytes of data.
* Additionally, the memory footprint of the PublicKey class is reduced.
  The size_ data member is declared as static.
* Distinguish and identify the PublisherList retrieved from the local
  config file, versus the ones obtained from other validators.
* Fixes #2942
2025-06-06 12:01:19 +09:00
Gregory Tsipenyuk
4ac704384e fix compile error on gcc 13: (#4932)
The compilation fails due to an issue in the initializer list
of an optional argument, which holds a vector of pairs.
The code compiles correctly on earlier gcc versions, but fails on gcc 13.
2025-06-04 20:51:42 +09:00
Gregory Tsipenyuk
6fbf018e33 Price Oracle (XLS-47d): (#4789) (#4789)
Implement native support for Price Oracles.

 A Price Oracle is used to bring real-world data, such as market prices,
 onto the blockchain, enabling dApps to access and utilize information
 that resides outside the blockchain.

 Add Price Oracle functionality:
 - OracleSet: create or update the Oracle object
 - OracleDelete: delete the Oracle object

 To support this functionality add:
 - New RPC method, `get_aggregate_price`, to calculate aggregate price for a token pair of the specified oracles
 - `ltOracle` object

 The `ltOracle` object maintains:
 - Oracle Owner's account
 - Oracle's metadata
 - Up to ten token pairs with the scaled price
 - The last update time the token pairs were updated

 Add Oracle unit-tests
2025-06-04 20:51:00 +09:00
tequ
89890e40d9 Merge branch 'sync-2.0.1-conan' into sync-2.1.1-conan 2025-06-04 20:10:10 +09:00
tequ
0a1a289bd4 Merge commit '827e6fe617808139556e4eb1513f468941f20912' into sync-2.0.1-conan 2025-06-04 20:10:00 +09:00
Mayukha Vadari
827e6fe617 feat(rpc): add server_definitions method (#4703)
Add a new RPC / WS call for `server_definitions`, which returns an
SDK-compatible `definitions.json` (binary enum definitions) generated by
the server. This enables clients/libraries to dynamically work with new
fields and features, such as ones that may become available on side
chains. Clients query `server_definitions` on a node from the network
they want to work with, and immediately know how to speak that node's
binary "language", even if new features are added to it in the future
(as long as there are no new serialized types that the software doesn't
know how to serialize/deserialize).

Example:

```js
> {"command": "server_definitions"}
< {
    "result": {
        "FIELDS": [
            [
                "Generic",
                {
                    "isSerialized": false,
                    "isSigningField": false,
                    "isVLEncoded": false,
                    "nth": 0,
                    "type": "Unknown"
                }
            ],
            [
                "Invalid",
                {
                    "isSerialized": false,
                    "isSigningField": false,
                    "isVLEncoded": false,
                    "nth": -1,
                    "type": "Unknown"
                }
            ],
            [
                "ObjectEndMarker",
                {
                    "isSerialized": false,
                    "isSigningField": true,
                    "isVLEncoded": false,
                    "nth": 1,
                    "type": "STObject"
                }
            ],
        ...
```

Close #3657

---------

Co-authored-by: Richard Holland <richard.holland@starstone.co.nz>
2025-06-04 20:07:53 +09:00
tequ
99ee7814e1 Merge branch 'sync-2.1.0-conan' into sync-2.1.1-conan 2025-06-04 18:45:47 +09:00
tequ
bdb5582818 Merge branch 'sync-2.0.1-conan' into sync-2.1.0-conan 2025-06-04 18:45:39 +09:00
tequ
5436d1fffd Merge branch 'sync-2.0.0-conan' into sync-2.0.1-conan 2025-06-04 18:45:29 +09:00
tequ
85e8ec2acf Merge branch 'sync-1.12.0-conan' into sync-2.0.0-conan 2025-06-04 18:45:17 +09:00
tequ
58fa7fda82 Merge branch 'dev' into sync-1.12.0-conan 2025-06-04 13:54:52 +09:00
Denis Angell
a5ea86fdfc Add Conan Building For Development (#432) 2025-05-14 14:00:20 +10:00
Gregory Tsipenyuk
60e80c0427 fix: improper handling of large synthetic AMM offers:
A large synthetic offer was not handled correctly in the payment engine.
This patch fixes that issue and introduces a new invariant check while
processing synthetic offers.
2025-05-06 15:14:35 +09:00
tequ
dc7b404538 Merge branch 'sync-2.0.1-conan' into sync-2.1.0-conan 2025-05-06 14:58:44 +09:00
tequ
e04d5911de Merge branch 'sync-2.0.0-conan' into sync-2.0.1-conan 2025-05-06 14:58:18 +09:00
tequ
8f4a9f44f6 Merge branch 'sync-1.12.0-conan' into sync-2.0.0-conan 2025-05-06 14:57:52 +09:00
tequ
a4bb9b9629 Merge branch 'tmp-conan' into sync-1.12.0-conan 2025-05-05 12:56:05 +09:00
RichardAH
9b47d06c64 Merge branch 'dev' into tmp-conan 2025-05-03 12:31:28 +10:00
RichardAH
615f56570a Sus pat (#507) 2025.5.1-release+1762 2025-05-01 17:23:56 +10:00
RichardAH
5e005cd6ee remove false positives from sus pat finder (#506) 2025-05-01 09:54:41 +10:00
Denis Angell
34b3442e00 Merge branch 'dev' into tmp-conan 2025-04-30 11:52:25 +02:00
Denis Angell
80a7197590 fix warnings (#505) 2025-04-30 11:51:58 +02:00
Denis Angell
dd5d580b97 [fold] bad merge 2025-04-30 10:39:12 +02:00