Skip to content

Commit dc2671a

Browse files
committed
Merge branch 'develop' into account_permissions
2 parents b41a4cb + 6d58065 commit dc2671a

File tree

282 files changed

+5531
-2045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+5531
-2045
lines changed

API-CHANGELOG.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conve
8383

8484
The `network_id` field was added in the `server_info` response in version 1.5.0 (2019), but it is not returned in [reporting mode](https://xrpl.org/rippled-server-modes.html#reporting-mode). However, use of reporting mode is now discouraged, in favor of using [Clio](https://github.com/XRPLF/clio) instead.
8585

86-
## XRP Ledger server version 2.2.0
86+
## XRP Ledger server version 2.4.0
8787

88-
The following is a non-breaking addition to the API.
88+
### Addition in 2.4
8989

90-
- The `feature` method now has a non-admin mode for users. (It was previously only available to admin connections.) The method returns an updated list of amendments, including their names and other information. ([#4781](https://github.com/XRPLF/rippled/pull/4781))
90+
- `ledger_entry`: `state` is added an alias for `ripple_state`.
91+
92+
## XRP Ledger server version 2.3.0
9193

9294
### Breaking change in 2.3
9395

@@ -105,6 +107,12 @@ The following additions are non-breaking (because they are purely additive).
105107
- In `Payment` transactions, `DeliverMax` has been added. This is a replacement for the `Amount` field, which should not be used. Typically, the `delivered_amount` (in transaction metadata) should be used. To ease the transition, `DeliverMax` is present regardless of API version, since adding a field is non-breaking.
106108
- API version 2 has been moved from beta to supported, meaning that it is generally available (regardless of the `beta_rpc_api` setting).
107109

110+
## XRP Ledger server version 2.2.0
111+
112+
The following is a non-breaking addition to the API.
113+
114+
- The `feature` method now has a non-admin mode for users. (It was previously only available to admin connections.) The method returns an updated list of amendments, including their names and other information. ([#4781](https://github.com/XRPLF/rippled/pull/4781))
115+
108116
## XRP Ledger server version 1.12.0
109117

110118
[Version 1.12.0](https://github.com/XRPLF/rippled/releases/tag/1.12.0) was released on Sep 6, 2023. The following additions are non-breaking (because they are purely additive).

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ set(SECP256K1_INSTALL TRUE)
7373
add_subdirectory(external/secp256k1)
7474
add_library(secp256k1::secp256k1 ALIAS secp256k1)
7575
add_subdirectory(external/ed25519-donna)
76+
add_subdirectory(external/antithesis-sdk)
7677
find_package(gRPC REQUIRED)
7778
find_package(lz4 REQUIRED)
7879
# Target names with :: are not allowed in a generator expression.

CONTRIBUTING.md

+62
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,68 @@ pip3 install pre-commit
343343
pre-commit install
344344
```
345345

346+
## Contracts and instrumentation
347+
348+
We are using [Antithesis](https://antithesis.com/) for continuous fuzzing,
349+
and keep a copy of [Antithesis C++ SDK](https://github.com/antithesishq/antithesis-sdk-cpp/)
350+
in `external/antithesis-sdk`. One of the aims of fuzzing is to identify bugs
351+
by finding external conditions which cause contracts violations inside `rippled`.
352+
The contracts are expressed as `ASSERT` or `UNREACHABLE` (defined in
353+
`include/xrpl/beast/utility/instrumentation.h`), which are effectively (outside
354+
of Antithesis) wrappers for `assert(...)` with added name. The purpose of name
355+
is to provide contracts with stable identity which does not rely on line numbers.
356+
357+
When `rippled` is built with the Antithesis instrumentation enabled
358+
(using `voidstar` CMake option) and ran on the Antithesis platform, the
359+
contracts become
360+
[test properties](https://antithesis.com/docs/using_antithesis/properties.html);
361+
otherwise they are just like a regular `assert`.
362+
To learn more about Antithesis, see
363+
[How Antithesis Works](https://antithesis.com/docs/introduction/how_antithesis_works.html)
364+
and [C++ SDK](https://antithesis.com/docs/using_antithesis/sdk/cpp/overview.html#)
365+
366+
We continue to use the old style `assert` or `assert(false)` in certain
367+
locations, where the reporting of contract violations on the Antithesis
368+
platform is either not possible or not useful.
369+
370+
For this reason:
371+
* The locations where `assert` or `assert(false)` contracts should continue to be used:
372+
* `constexpr` functions
373+
* unit tests i.e. files under `src/test`
374+
* unit tests-related modules (files under `beast/test` and `beast/unit_test`)
375+
* Outside of the listed locations, do not use `assert`; use `ASSERT` instead,
376+
giving it unique name, with the short description of the contract.
377+
* Outside of the listed locations, do not use `assert(false)`; use
378+
`UNREACHABLE` instead, giving it unique name, with the description of the
379+
condition being violated
380+
* The contract name should start with a full name (including scope) of the
381+
function, optionally a named lambda, followed by a colon ` : ` and a brief
382+
(typically at most five words) description. `UNREACHABLE` contracts
383+
can use slightly longer descriptions. If there are multiple overloads of the
384+
function, use common sense to balance both brevity and unambiguity of the
385+
function name. NOTE: the purpose of name is to provide stable means of
386+
unique identification of every contract; for this reason try to avoid elements
387+
which can change in some obvious refactors or when reinforcing the condition.
388+
* Contract description typically (except for `UNREACHABLE`) should describe the
389+
_expected_ condition, as in "I assert that _expected_ is true".
390+
* Contract description for `UNREACHABLE` should describe the _unexpected_
391+
situation which caused the line to have been reached.
392+
* Example good name for an
393+
`UNREACHABLE` macro `"Json::operator==(Value, Value) : invalid type"`; example
394+
good name for an `ASSERT` macro `"Json::Value::asCString : valid type"`.
395+
* Example **bad** name
396+
`"RFC1751::insert(char* s, int x, int start, int length) : length is greater than or equal zero"`
397+
(missing namespace, unnecessary full function signature, description too verbose).
398+
Good name: `"ripple::RFC1751::insert : minimum length"`.
399+
* In **few** well-justified cases a non-standard name can be used, in which case a
400+
comment should be placed to explain the rationale (example in `contract.cpp`)
401+
* Do **not** rename a contract without a good reason (e.g. the name no longer
402+
reflects the location or the condition being checked)
403+
* Do not use `std::unreachable`
404+
* Do not put contracts where they can be violated by an external condition
405+
(e.g. timing, data payload before mandatory validation etc.) as this creates
406+
bogus bug reports (and causes crashes of Debug builds)
407+
346408
## Unit Tests
347409
To execute all unit tests:
348410

RELEASENOTES.md

+73
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,79 @@ This document contains the release notes for `rippled`, the reference server imp
66

77
Have new ideas? Need help with setting up your node? [Please open an issue here](https://github.com/xrplf/rippled/issues/new/choose).
88

9+
# Version 2.3.0
10+
11+
Version 2.3.0 of `rippled`, the reference server implementation of the XRP Ledger protocol, is now available. This release includes 8 new amendments, including Multi-Purpose Tokens, Credentials, Clawback support for AMMs, and the ability to make offers as part of minting NFTs. Additionally, this release includes important fixes for stability, so server operators are encouraged to upgrade as soon as possible.
12+
13+
14+
## Action Required
15+
16+
If you run an XRP Ledger server, upgrade to version 2.3.0 as soon as possible to ensure service continuity.
17+
18+
Additionally, new amendments are now open for voting according to the XRP Ledger's [amendment process](https://xrpl.org/amendments.html), which enables protocol changes following two weeks of >80% support from trusted validators. The exact time that protocol changes take effect depends on the voting decisions of the decentralized network.
19+
20+
## Full Changelog
21+
22+
### Amendments
23+
24+
The following amendments are open for voting with this release:
25+
26+
- **XLS-70 Credentials** - Users can issue Credentials on the ledger and use Credentials to pre-approve incoming payments when using Deposit Authorization instead of individually approving payers. ([#5103](https://github.com/XRPLF/rippled/pull/5103))
27+
- related fix: #5189 (https://github.com/XRPLF/rippled/pull/5189)
28+
- **XLS-33 Multi-Purpose Tokens** - A new type of fungible token optimized for institutional DeFi including stablecoins. ([#5143](https://github.com/XRPLF/rippled/pull/5143))
29+
- **XLS-37 AMM Clawback** - Allows clawback-enabled tokens to be used in AMMs, with appropriate guardrails. ([#5142](https://github.com/XRPLF/rippled/pull/5142))
30+
- **XLS-52 NFTokenMintOffer** - Allows creating an NFT sell offer as part of minting a new NFT. ([#4845](https://github.com/XRPLF/rippled/pull/4845))
31+
- **fixAMMv1_2** - Fixes two bugs in Automated Market Maker (AMM) transaction processing. ([#5176](https://github.com/XRPLF/rippled/pull/5176))
32+
- **fixNFTokenPageLinks** - Fixes a bug that can cause NFT directories to have missing links, and introduces a transaction to repair corrupted ledger state. ([#4945](https://github.com/XRPLF/rippled/pull/4945))
33+
- **fixEnforceNFTokenTrustline** - Fixes two bugs in the interaction between NFT offers and trust lines. ([#4946](https://github.com/XRPLF/rippled/pull/4946))
34+
- **fixInnerObjTemplate2** - Standardizes the way inner objects are enforced across all transaction and ledger data. ([#5047](https://github.com/XRPLF/rippled/pull/5047))
35+
36+
The following amendment is partially implemented but not open for voting:
37+
38+
- **InvariantsV1_1** - Adds new invariants to ensure transactions process as intended, starting with an invariant to ensure that ledger entries owned by an account are deleted when the account is deleted. ([#4663](https://github.com/XRPLF/rippled/pull/4663))
39+
40+
### New Features
41+
42+
- Allow configuration of SQLite database page size. ([#5135](https://github.com/XRPLF/rippled/pull/5135), [#5140](https://github.com/XRPLF/rippled/pull/5140))
43+
- In the `libxrpl` C++ library, provide a list of known amendments. ([#5026](https://github.com/XRPLF/rippled/pull/5026))
44+
45+
### Deprecations
46+
47+
- History Shards are removed. ([#5066](https://github.com/XRPLF/rippled/pull/5066))
48+
- Reporting mode is removed. ([#5092](https://github.com/XRPLF/rippled/pull/5092))
49+
50+
For users wanting to store more ledger history, it is recommended to run a Clio server instead.
51+
52+
### Bug fixes
53+
54+
- Fix a crash in debug builds when amm_info request contains an invalid AMM account ID. ([#5188](https://github.com/XRPLF/rippled/pull/5188))
55+
- Fix a crash caused by a race condition in peer-to-peer code. ([#5071](https://github.com/XRPLF/rippled/pull/5071))
56+
- Fix a crash in certain situations
57+
- Fix several bugs in the book_changes API method. ([#5096](https://github.com/XRPLF/rippled/pull/5096))
58+
- Fix bug triggered by providing an invalid marker to the account_nfts API method. ([#5045](https://github.com/XRPLF/rippled/pull/5045))
59+
- Accept lower-case hexadecimal in compact transaction identifier (CTID) parameters in API methods. ([#5049](https://github.com/XRPLF/rippled/pull/5049))
60+
- Disallow filtering by types that an account can't own in the account_objects API method. ([#5056](https://github.com/XRPLF/rippled/pull/5056))
61+
- Fix error code returned by the feature API method when providing an invalid parameter. ([#5063](https://github.com/XRPLF/rippled/pull/5063))
62+
- (API v3) Fix error code returned by amm_info when providing invalid parameters. ([#4924](https://github.com/XRPLF/rippled/pull/4924))
63+
64+
### Other Improvements
65+
66+
- Adds a new default hub, hubs.xrpkuwait.com, to the config file and bootstrapping code. ([#5169](https://github.com/XRPLF/rippled/pull/5169))
67+
- Improve error message when commandline interface fails with `rpcInternal` because there was no response from the server. ([#4959](https://github.com/XRPLF/rippled/pull/4959))
68+
- Add tools for debugging specific transactions via replay. ([#5027](https://github.com/XRPLF/rippled/pull/5027), [#5087](https://github.com/XRPLF/rippled/pull/5087))
69+
- Major reorganization of source code files. ([#4997](https://github.com/XRPLF/rippled/pull/4997))
70+
- Add new unit tests. ([#4886](https://github.com/XRPLF/rippled/pull/4886))
71+
- Various improvements to build tools and contributor documentation. ([#5001](https://github.com/XRPLF/rippled/pull/5001), [#5028](https://github.com/XRPLF/rippled/pull/5028), [#5052](https://github.com/XRPLF/rippled/pull/5052), [#5091](https://github.com/XRPLF/rippled/pull/5091), [#5084](https://github.com/XRPLF/rippled/pull/5084), [#5120](https://github.com/XRPLF/rippled/pull/5120), [#5010](https://github.com/XRPLF/rippled/pull/5010). [#5055](https://github.com/XRPLF/rippled/pull/5055), [#5067](https://github.com/XRPLF/rippled/pull/5067), [#5061](https://github.com/XRPLF/rippled/pull/5061), [#5072](https://github.com/XRPLF/rippled/pull/5072), [#5044](https://github.com/XRPLF/rippled/pull/5044) )
72+
- Various code cleanup and refactoring. ([#4509](https://github.com/XRPLF/rippled/pull/4509), [#4521](https://github.com/XRPLF/rippled/pull/4521), [#4856](https://github.com/XRPLF/rippled/pull/4856), [#5190](https://github.com/XRPLF/rippled/pull/5190), [#5081](https://github.com/XRPLF/rippled/pull/5081), [#5053](https://github.com/XRPLF/rippled/pull/5053), [#5058](https://github.com/XRPLF/rippled/pull/5058), [#5122](https://github.com/XRPLF/rippled/pull/5122), [#5059](https://github.com/XRPLF/rippled/pull/5059), [#5041](https://github.com/XRPLF/rippled/pull/5041))
73+
74+
75+
Bug Bounties and Responsible Disclosures:
76+
77+
We welcome reviews of the `rippled` code and urge researchers to responsibly disclose any issues they may find.
78+
79+
To report a bug, please send a detailed report to: <[email protected]>
80+
81+
982
# Version 2.2.3
1083

1184
Version 2.2.3 of `rippled`, the reference server implementation of the XRP Ledger protocol, is now available. This release fixes a problem that can cause full-history servers to run out of space in their SQLite databases, depending on configuration. There are no new amendments in this release.

cmake/RippledCompiler.cmake

+12-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ else ()
120120
target_link_libraries (common
121121
INTERFACE
122122
-rdynamic
123-
$<$<BOOL:${is_linux}>:-Wl,-z,relro,-z,now>
123+
$<$<BOOL:${is_linux}>:-Wl,-z,relro,-z,now,--build-id>
124124
# link to static libc/c++ iff:
125125
# * static option set and
126126
# * NOT APPLE (AppleClang does not support static libc/c++) and
@@ -131,6 +131,17 @@ else ()
131131
>)
132132
endif ()
133133

134+
# Antithesis instrumentation will only be built and deployed using machines running Linux.
135+
if (voidstar)
136+
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
137+
message(FATAL_ERROR "Antithesis instrumentation requires Debug build type, aborting...")
138+
elseif (NOT is_linux)
139+
message(FATAL_ERROR "Antithesis instrumentation requires Linux, aborting...")
140+
elseif (NOT (is_clang AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0))
141+
message(FATAL_ERROR "Antithesis instrumentation requires Clang version 16 or later, aborting...")
142+
endif ()
143+
endif ()
144+
134145
if (use_mold)
135146
# use mold linker if available
136147
execute_process (

cmake/RippledCore.cmake

+15
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ target_compile_definitions(xrpl.libxrpl
7474
target_compile_options(xrpl.libxrpl
7575
PUBLIC
7676
$<$<BOOL:${is_gcc}>:-Wno-maybe-uninitialized>
77+
$<$<BOOL:${voidstar}>:-DENABLE_VOIDSTAR>
7778
)
7879

7980
target_link_libraries(xrpl.libxrpl
@@ -89,6 +90,7 @@ target_link_libraries(xrpl.libxrpl
8990
secp256k1::secp256k1
9091
xrpl.libpb
9192
xxHash::xxhash
93+
$<$<BOOL:${voidstar}>:antithesis-sdk-cpp>
9294
)
9395

9496
if(xrpld)
@@ -129,6 +131,19 @@ if(xrpld)
129131
target_compile_definitions(rippled PRIVATE RIPPLED_RUNNING_IN_CI)
130132
endif ()
131133

134+
if(voidstar)
135+
target_compile_options(rippled
136+
PRIVATE
137+
-fsanitize-coverage=trace-pc-guard
138+
)
139+
# rippled requires access to antithesis-sdk-cpp implementation file
140+
# antithesis_instrumentation.h, which is not exported as INTERFACE
141+
target_include_directories(rippled
142+
PRIVATE
143+
${CMAKE_SOURCE_DIR}/external/antithesis-sdk
144+
)
145+
endif()
146+
132147
# any files that don't play well with unity should be added here
133148
if(tests)
134149
set_source_files_properties(

cmake/RippledInstall.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ install (
1010
ripple_boost
1111
xrpl.libpb
1212
xrpl.libxrpl
13+
antithesis-sdk-cpp
1314
EXPORT RippleExports
1415
LIBRARY DESTINATION lib
1516
ARCHIVE DESTINATION lib

cmake/RippledSettings.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ if(unity)
1818
set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
1919
endif()
2020
endif()
21+
if(is_clang AND is_linux)
22+
option(voidstar "Enable Antithesis instrumentation." OFF)
23+
endif()
2124
if(is_gcc OR is_clang)
2225
option(coverage "Generates coverage info." OFF)
2326
option(profile "Add profiling flags" OFF)

external/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The Conan recipes include patches we have not yet pushed upstream.
66

77
| Folder | Upstream | Description |
88
|:----------------|:---------------------------------------------|:------------|
9+
| `antithesis-sdk`| [Project](https://github.com/antithesishq/antithesis-sdk-cpp/) | [Antithesis](https://antithesis.com/docs/using_antithesis/sdk/cpp/overview.html) SDK for C++ |
910
| `ed25519-donna` | [Project](https://github.com/floodyberry/ed25519-donna) | [Ed25519](http://ed25519.cr.yp.to/) digital signatures |
1011
| `rocksdb` | [Recipe](https://github.com/conan-io/conan-center-index/tree/master/recipes/rocksdb) | Fast key/value database. (Supports rotational disks better than NuDB.) |
1112
| `secp256k1` | [Project](https://github.com/bitcoin-core/secp256k1) | ECDSA digital signatures using the **secp256k1** curve |

external/antithesis-sdk/.clang-format

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
DisableFormat: true
3+
SortIncludes: false
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
cmake_minimum_required(VERSION 3.25)
2+
3+
# Note, version set explicitly by rippled project
4+
project(antithesis-sdk-cpp VERSION 0.4.2 LANGUAGES CXX)
5+
6+
add_library(antithesis-sdk-cpp INTERFACE antithesis_sdk.h)
7+
8+
# Note, both sections below created by rippled project
9+
target_include_directories(antithesis-sdk-cpp INTERFACE
10+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
11+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
12+
)
13+
14+
install(
15+
FILES antithesis_sdk.h
16+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
17+
)

external/antithesis-sdk/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Antithesis
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

external/antithesis-sdk/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Antithesis C++ SDK
2+
3+
This library provides methods for C++ programs to configure the [Antithesis](https://antithesis.com) platform. It contains three kinds of functionality:
4+
* Assertion macros that allow you to define test properties about your software or workload.
5+
* Randomness functions for requesting both structured and unstructured randomness from the Antithesis platform.
6+
* Lifecycle functions that inform the Antithesis environment that particular test phases or milestones have been reached.
7+
8+
For general usage guidance see the [Antithesis C++ SDK Documentation](https://antithesis.com/docs/using_antithesis/sdk/cpp/overview.html)

0 commit comments

Comments
 (0)