Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into action
Browse files Browse the repository at this point in the history
* upstream/develop:
  fix(build): `uint` is not defined on Windows platform (4731)
  Eliminate the built-in SNTP support (fixes 4207): (4628)
  Set version to 2.0.0-b2
  fix: accept all valid currency codes in API (4566)
  chore: add .build to .gitignore (4722)
  Add ProtocolStart and GracefulClose P2P protocol messages (3839)
  Fix typo in BUILD.md (4718)
  APIv2(gateway_balances, channel_authorize): update errors (4618)
  build: use Boost 1.82 and link Boost.Json (4632)
  docs(overlay): add URL of blog post and clarify wording (4635)
  docs(API-CHANGELOG): api_version 2 is expected with 2.0 (4633)
  docs(RELEASENOTES): update 1.12.0 notes to match dev blog (4691)
  • Loading branch information
ximinez committed Sep 28, 2023
2 parents 43690b3 + b92d511 commit 2f3ddde
Show file tree
Hide file tree
Showing 47 changed files with 1,025 additions and 1,241 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,6 @@ pkg
CMakeUserPresets.json
bld.rippled/
.vscode

# Suggested in-tree build directory
/.build/
74 changes: 59 additions & 15 deletions API-CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
# API Changelog

This changelog is intended to list all updates to the API.
This changelog is intended to list all updates to the [public API methods](https://xrpl.org/public-api-methods.html).

For info about how API versioning works, view the [XLS-22d spec](https:/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https:/XRPLF/rippled/pull/3155).
For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https:/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https:/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior.

The API version controls the API behavior you see. This includes what properties you see in responses, what parameters you're permitted to send in requests, and so on. You specify the API version in each of your requests. When a breaking change is introduced to the `rippled` API, a new version is released. To avoid breaking your code, you should set (or increase) your version when you're ready to upgrade.

For a log of breaking changes, see the **API Version [number]** headings. Breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`rippled`) release.

## API Version 2
This version will be supported by `rippled` version 1.12.

#### V2 account_info response

`signer_lists` is returned in the root of the response, instead of being nested under `account_data` (as it was in API version 1). ([#3770](https:/XRPLF/rippled/pull/3770))
For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`rippled`) release.

## API Version 1
This version is supported by `rippled` version 1.11.

This version is supported by all `rippled` versions. At time of writing, it is the default API version, used when no `api_version` is specified. When a new API version is introduced, the command line interface will default to the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code.

### Idiosyncrasies

Expand All @@ -30,7 +24,7 @@ The `network_id` field was added in the `server_info` response in version 1.5.0

## XRP Ledger version 1.12.0

Version 1.12.0 is in development.
[Version 1.12.0](https:/XRPLF/rippled/releases/tag/1.12.0) was released on Sep 6, 2023.

### Additions in 1.12

Expand Down Expand Up @@ -76,9 +70,11 @@ Additions are intended to be non-breaking (because they are purely additive).

### Breaking changes in 1.11

- Added the ability to mark amendments as obsolete. For the `feature` admin API, there is a new possible value for the `vetoed` field. ([#4291](https:/XRPLF/rippled/pull/4291))
- The API now won't accept seeds or public keys in place of account addresses. ([#4404](https:/XRPLF/rippled/pull/4404))
- For the `ledger_data` method, when all entries are filtered out, the API now returns an empty list (an empty array, `[]`). (Previously, it would return `null`.) While this is technically a breaking change, the new behavior is consistent with the documentation, so this is considered only a bug fix. ([#4398](https:/XRPLF/rippled/pull/4398))
- Added the ability to mark amendments as obsolete. For the `feature` admin API, there is a new possible value for the `vetoed` field. (https:/XRPLF/rippled/pull/4291)
- The value of `vetoed` can now be `true`, `false`, or `"Obsolete"`.
- Removed the acceptance of seeds or public keys in place of account addresses. (https:/XRPLF/rippled/pull/4404)
- This simplifies the API and encourages better security practices (i.e. seeds should never be sent over the network).
- For the `ledger_data` method, when all entries are filtered out, the `state` field of the response is now an empty list (in other words, an empty array, `[]`). (Previously, it would return `null`.) While this is technically a breaking change, the new behavior is consistent with the documentation, so this is considered only a bug fix. (https:/XRPLF/rippled/pull/4398)
- If and when the `fixNFTokenRemint` amendment activates, there will be a new AccountRoot field, `FirstNFTSequence`. This field is set to the current account sequence when the account issues their first NFT. If an account has not issued any NFTs, then the field is not set. ([#4406](https:/XRPLF/rippled/pull/4406))
- There is a new account deletion restriction: an account can only be deleted if `FirstNFTSequence` + `MintedNFTokens` + `256` is less than the current ledger sequence.
- This is potentially a breaking change if clients have logic for determining whether an account can be deleted.
Expand All @@ -97,3 +93,51 @@ Additions are intended to be non-breaking (because they are purely additive).
- Added an `account_flags` object to the `account_info` method response. (https:/XRPLF/rippled/pull/4459)
- Added `NFTokenPages` to the `account_objects` RPC. (https:/XRPLF/rippled/pull/4352)
- Fixed: `marker` returned from the `account_lines` command would not work on subsequent commands. (https:/XRPLF/rippled/pull/4361)

# In development

Changes below this point are in development.

## API Version 2

At the time of writing, this version is expected to be introduced in `rippled` version 2.0.

Currently (prior to the release of 2.0), it is available as a "beta" version, meaning it can be enabled with a config setting in `rippled.cfg`:
```
[beta_rpc_api]
1
```

Since `api_version` 2 is in "beta", breaking changes can be made at any time.

#### Modifications to account_info response in V2

- `signer_lists` is returned in the root of the response. Previously, in API version 1, it was nested under `account_data`. (https:/XRPLF/rippled/pull/3770)
- When using an invalid `signer_lists` value, the API now returns an "invalidParams" error. (https:/XRPLF/rippled/pull/4585)
- (`signer_lists` must be a boolean. In API version 1, strings are accepted and may return a normal response - as if `signer_lists` were `true`.)

#### Modifications to [account_tx](https://xrpl.org/account_tx.html#account_tx) response in V2

- Using `ledger_index_min`, `ledger_index_max`, and `ledger_index` returns `invalidParams` because if you use `ledger_index_min` or `ledger_index_max`, then it does not make sense to also specify `ledger_index`. Previously, in API version 1, no error was returned. (https:/XRPLF/rippled/pull/4571)
- The same applies for `ledger_index_min`, `ledger_index_max`, and `ledger_hash`. (https:/XRPLF/rippled/issues/4545#issuecomment-1565065579)
- Using a `ledger_index_min` or `ledger_index_max` beyond the range of ledgers that the server has:
- returns `lgrIdxMalformed` in API version 2. (https:/XRPLF/rippled/issues/4288)
- Previously, in API version 1, no error was returned.

##### In progress

- Attempting to use a non-boolean value (such as a string) for the `binary` or `forward` parameters returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https:/XRPLF/rippled/pull/4620)

#### Modifications to [noripple_check](https://xrpl.org/noripple_check.html#noripple_check) response in V2

##### In progress

- Attempting to use a non-boolean value (such as a string) for the `transactions` parameter returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https:/XRPLF/rippled/pull/4620)

# Unit tests for API changes

The following information is useful to developers contributing to this project:

The purpose of unit tests is to catch bugs and prevent regressions. In general, it often makes sense to create a test function when there is a breaking change to the API. For APIs that have changed in a new API version, the tests should be modified so that both the prior version and the new version are properly tested.

To take one example: for `account_info` version 1, WebSocket and JSON-RPC behavior should be tested. The latest API version, i.e. API version 2, should be tested over WebSocket, JSON-RPC, and command line.
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ It patches their CMake to correctly import its dependencies.
and make sure it matches the `build_type` setting you chose in the previous
step.

Multi-config gnerators:
Multi-config generators:

```
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake ..
Expand Down
4 changes: 1 addition & 3 deletions Builds/CMake/RippledCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,7 @@ target_sources (rippled PRIVATE
src/ripple/core/impl/JobQueue.cpp
src/ripple/core/impl/LoadEvent.cpp
src/ripple/core/impl/LoadMonitor.cpp
src/ripple/core/impl/SNTPClock.cpp
src/ripple/core/impl/SociDB.cpp
src/ripple/core/impl/TimeKeeper.cpp
src/ripple/core/impl/Workers.cpp
src/ripple/core/Pg.cpp
#[===============================[
Expand Down Expand Up @@ -636,6 +634,7 @@ target_sources (rippled PRIVATE
src/ripple/overlay/impl/Cluster.cpp
src/ripple/overlay/impl/ConnectAttempt.cpp
src/ripple/overlay/impl/Handshake.cpp
src/ripple/overlay/impl/InboundHandoff.cpp
src/ripple/overlay/impl/Message.cpp
src/ripple/overlay/impl/OverlayImpl.cpp
src/ripple/overlay/impl/PeerImp.cpp
Expand Down Expand Up @@ -928,7 +927,6 @@ if (tests)
src/test/jtx/impl/AMMTest.cpp
src/test/jtx/impl/Env.cpp
src/test/jtx/impl/JSONRPCClient.cpp
src/test/jtx/impl/ManualTimeKeeper.cpp
src/test/jtx/impl/TestHelpers.cpp
src/test/jtx/impl/WSClient.cpp
src/test/jtx/impl/acctdelete.cpp
Expand Down
4 changes: 3 additions & 1 deletion Builds/CMake/deps/Boost.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
find_package(Boost 1.70 REQUIRED
find_package(Boost 1.82 REQUIRED
COMPONENTS
chrono
container
context
coroutine
date_time
filesystem
json
program_options
regex
system
Expand All @@ -29,6 +30,7 @@ target_link_libraries(ripple_boost
Boost::coroutine
Boost::date_time
Boost::filesystem
Boost::json
Boost::program_options
Boost::regex
Boost::system
Expand Down
1 change: 0 additions & 1 deletion Builds/levelization/results/ordering.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ test.nodestore > test.unit_test
test.overlay > ripple.app
test.overlay > ripple.basics
test.overlay > ripple.beast
test.overlay > ripple.core
test.overlay > ripple.overlay
test.overlay > ripple.peerfinder
test.overlay > ripple.protocol
Expand Down
58 changes: 26 additions & 32 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,69 +30,63 @@ If you operate an XRP Ledger server, upgrade to version 1.12.0 by September 20,

On supported platforms, see the [instructions on installing or updating `rippled`](https://xrpl.org/install-rippled.html).

The XRPL Foundation publishes portable binaries, which are drop-in replacements for the `rippled` daemon. [See information and downloads for the portable binaries](https:/XRPLF/rippled-portable-builds#portable-builds-of-the-rippled-server). This will work on most distributions, including Ubuntu 16.04, 18.04, 20.04, and 22.04; CentOS; and others. Please test and open issues on GitHub if there are problems.


## Changelog

### New Features and Amendments
### Amendments, New Features, and Changes
(These are changes which may impact or be useful to end users. For example, you may be able to update your code/workflow to take advantage of these changes.)

- **`AMM`**: Introduces an automated market maker (AMM) protocol to the XRP Ledger's decentralized exchange, enabling you to trade assets without a counterparty. For more information about AMMs, see: [Automated Market Maker](https://opensource.ripple.com/docs/xls-30d-amm/amm-uc/). [#4294](https:/XRPLF/rippled/pull/4294)

- **`Clawback`**: Allows issuers to add the `lsfAllowTrustLineClawback` flag to an issuing account. This enables the account to recover, or _claw back_, issued tokens after they're distributed to accounts. For additional documentation on this feature, see: [#4553](https:/XRPLF/rippled/pull/4553).
- **`Clawback`**: Adds a setting, *Allow Clawback*, which lets an issuer recover, or _claw back_, tokens that they previously issued. Issuers cannot enable this setting if they have issued tokens already. For additional documentation on this feature, see: [#4553](https:/XRPLF/rippled/pull/4553).

- **`fixReducedOffersV1`**: Reduces the occurrence of order books that are blocked by reduced offers. [#4512](https:/XRPLF/rippled/pull/4512)

- Added binary hardening and linker flags to enhance security during the build process. [#4603](https:/XRPLF/rippled/pull/4603)

- Updated build dependencies to the most recent versions in Conan Center. [#4595](https:/XRPLF/rippled/pull/4595)

- Updated Conan recipe for NuDB. [#4615](https:/XRPLF/rippled/pull/4615)

- Added a pre-commit hook that runs the clang-format linter locally before committing changes. To install this feature, see: [CONTRIBUTING](https:/XRPLF/xrpl-dev-portal/blob/master/CONTRIBUTING.md). [#4599](https:/XRPLF/rippled/pull/4599)

- Added quality-of-life improvements to workflows, using new [concurrency control](https://docs.github.com/en/actions/using-jobs/using-concurrency) features. [#4597](https:/XRPLF/rippled/pull/4597)

- Added an Artifactory to the `nix` workflow to improve build times. [#4556](https:/XRPLF/rippled/pull/4556)

- Added WebSocket and RPC port info to `server_info` responses. [#4427](https:/XRPLF/rippled/pull/4427)

- Removed the deprecated `accepted`, `seqNum`, `hash`, and `totalCoins` fields from the `ledger` method. [#4244](https:/XRPLF/rippled/pull/4244)


### Bug Fixes and Performance Improvements
(These are behind-the-scenes improvements, such as internal changes to the code, which are not expected to impact end users.)

- Fixed an incorrect error response when there are missing fields in the API v2 `ledger_entry` method. [#4552](https:/XRPLF/rippled/pull/4552)

- Updated checkout versions to resolve warnings during Github jobs. [#4598](https:/XRPLF/rippled/pull/4598)
- Added a pre-commit hook that runs the clang-format linter locally before committing changes. To install this feature, see: [CONTRIBUTING](https:/XRPLF/xrpl-dev-portal/blob/master/CONTRIBUTING.md). [#4599](https:/XRPLF/rippled/pull/4599)

- Added an error response to the API v2 `account_info` method when you include an invalid `signer_lists` value. [#4585](https:/XRPLF/rippled/pull/4585)
- In order to make it more straightforward to catch and handle overflows: changed the output type of the `mulDiv()` function from `std::pair<bool, uint64_t>` to `std::optional`. [#4243](https:/XRPLF/rippled/pull/4243)

- Fixed an issue with the debug package build. [#4591](https:/XRPLF/rippled/pull/4591)
- Updated `Handler::Condition` enum values to make the code less brittle. [#4239](https:/XRPLF/rippled/pull/4239)

- Added additional error responses to the API v2 `AccountTx` method. [#4571](https:/XRPLF/rippled/pull/4571)
- Renamed `ServerHandlerImp` to `ServerHandler`. [#4516](https:/XRPLF/rippled/pull/4516), [#4592](https:/XRPLF/rippled/pull/4592)

- Fixed build references to deleted `ServerHandlerImp`. [#4592](https:/XRPLF/rippled/pull/4592)
- Replaced hand-rolled code with `std::from_chars` for better maintainability. [#4473](https:/XRPLF/rippled/pull/4473)

- Fixed package definitions for Conan. [#4485](https:/XRPLF/rippled/pull/4485)
- Removed an unused `TypedField` move constructor. [#4567](https:/XRPLF/rippled/pull/4567)

- Changed the output type of the `mulDiv()` function from `std::pair<bool, uint64_t>` to `std::optional`. [#4243](https:/XRPLF/rippled/pull/4243)

- Updated `Handler::Condition` enum values to make the code less brittle. [#4239](https:/XRPLF/rippled/pull/4239)
### Docs and Build System

- Renamed `ServerHandlerImp` to `ServerHandler`. [#4516](https:/XRPLF/rippled/pull/4516)
- Updated checkout versions to resolve warnings during GitHub jobs. [#4598](https:/XRPLF/rippled/pull/4598)

- Removed the deprecated `accepted`, `seq`, `hash`, and `totalCoins` fields from the `ledger` method. [#4244](https:/XRPLF/rippled/pull/4244)
- Fixed an issue with the Debian package build. [#4591](https:/XRPLF/rippled/pull/4591)

- Replaced hand-rolled code with `std::from_chars` for better maintainability. [#4473](https:/XRPLF/rippled/pull/4473)
- Updated build instructions with additional steps to take after updating dependencies. [#4623](https:/XRPLF/rippled/pull/4623)

- Removed an unused `TypedField` move constructor. [#4567](https:/XRPLF/rippled/pull/4567)
- Updated contributing doc to clarify that beta releases should also be pushed to the `release` branch. [#4589](https:/XRPLF/rippled/pull/4589)

- Enabled the `BETA_RPC_API` flag in the default unit tests config, making the API v2 available to all unit tests. [#4573](https:/XRPLF/rippled/pull/4573)
- Enabled the `BETA_RPC_API` flag in the default unit tests config, making the API v2 (beta) available to unit tests. [#4573](https:/XRPLF/rippled/pull/4573)

- Conan dependency management.
- Fixed package definitions for Conan. [#4485](https:/XRPLF/rippled/pull/4485)
- Updated build dependencies to the most recent versions in Conan Center. [#4595](https:/XRPLF/rippled/pull/4595)
- Updated Conan recipe for NuDB. [#4615](https:/XRPLF/rippled/pull/4615)

### Docs
- Added binary hardening and linker flags to enhance security during the build process. [#4603](https:/XRPLF/rippled/pull/4603)

- Updated build instructions with additional steps to take after updating dependencies. [#4623](https:/XRPLF/rippled/pull/4623)
- Added an Artifactory to the `nix` workflow to improve build times. [#4556](https:/XRPLF/rippled/pull/4556)

- Updated contributing doc to clarify that beta releases should also be pushed to the `release` branch. [#4589](https:/XRPLF/rippled/pull/4589)
- Added quality-of-life improvements to workflows, using new [concurrency control](https://docs.github.com/en/actions/using-jobs/using-concurrency) features. [#4597](https:/XRPLF/rippled/pull/4597)


[Full Commit Log](https:/XRPLF/rippled/compare/1.11.0...1.12.0)
Expand Down
19 changes: 0 additions & 19 deletions cfg/rippled-example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -463,19 +463,6 @@
#
#
#
# [sntp_servers]
#
# IP address or domain of NTP servers to use for time synchronization.
#
# These NTP servers are suitable for rippled servers located in the United
# States:
# time.windows.com
# time.apple.com
# time.nist.gov
# pool.ntp.org
#
#
#
# [max_transactions]
#
# Configure the maximum number of transactions to have in the job queue
Expand Down Expand Up @@ -1704,12 +1691,6 @@ advisory_delete=0
[debug_logfile]
/var/log/rippled/debug.log

[sntp_servers]
time.windows.com
time.apple.com
time.nist.gov
pool.ntp.org

# To use the XRP test network
# (see https://xrpl.org/connect-your-rippled-to-the-xrp-test-net.html),
# use the following [ips] section:
Expand Down
Loading

0 comments on commit 2f3ddde

Please sign in to comment.