Compare commits

..

15 Commits

Author SHA1 Message Date
Bart
aac17f588a release: Bump version to 3.2.0-b2 2026-03-30 14:52:51 -04:00
Ayaz Salikhov
cbc09b2999 ci: Only publish docs in public repos (#6687) 2026-03-30 14:52:09 -04:00
Alex Kremer
453d94da17 chore: Enable remaining clang-tidy performance checks (#6648)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-30 14:52:09 -04:00
Jingchen
b36aedb4d5 refactor: Address PR comments after the modularisation PRs (#6389)
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
2026-03-30 14:52:09 -04:00
Alex Kremer
18540c97a5 chore: Fix clang-tidy header filter (#6686) 2026-03-30 14:52:08 -04:00
dependabot[bot]
8e3d87fce3 ci: [DEPENDABOT] bump actions/deploy-pages from 4.0.5 to 5.0.0 (#6684)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-30 14:52:08 -04:00
dependabot[bot]
b83dc9aa16 ci: [DEPENDABOT] bump codecov/codecov-action from 5.5.3 to 6.0.0 (#6685)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-30 14:52:08 -04:00
Pratik Mankawde
0c76bf991a fix: Guard Coro::resume() against completed coroutines (#6608)
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 14:52:08 -04:00
Vito Tumas
29aba28f5b refactor: Split LoanInvariant into LoanBrokerInvariant and LoanInvariant (#6674) 2026-03-30 14:52:08 -04:00
Ayaz Salikhov
b3f14c4052 ci: Don't publish docs on release branches (#6673) 2026-03-30 14:52:08 -04:00
Jingchen
e26624dcd1 refactor: Make function naming in ServiceRegistry consistent (#6390)
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Co-authored-by: Ed Hennis <ed@ripple.com>
2026-03-30 14:52:08 -04:00
Valentin Balaschenko
885f7b8c33 chore: Shorten job names to stay within Linux 15-char thread limit (#6669) 2026-03-30 14:52:07 -04:00
Vito Tumas
dcf973bc50 fix: Improve loan invariant message (#6668) 2026-03-30 14:52:07 -04:00
Ayaz Salikhov
68596f60d8 ci: Upload artifacts only in public repositories (#6670) 2026-03-30 14:52:07 -04:00
Bart
aac64d3b85 Update version (#6672) 2026-03-26 09:50:04 -04:00
654 changed files with 5811 additions and 7000 deletions

View File

@@ -78,28 +78,25 @@ Checks: "-*,
bugprone-unused-return-value, bugprone-unused-return-value,
bugprone-unused-local-non-trivial-variable, bugprone-unused-local-non-trivial-variable,
bugprone-virtual-near-miss, bugprone-virtual-near-miss,
cppcoreguidelines-init-variables, # cppcoreguidelines-init-variables, # has issues
cppcoreguidelines-misleading-capture-default-by-value, # cppcoreguidelines-misleading-capture-default-by-value, # has issues
cppcoreguidelines-no-suspend-with-lock, cppcoreguidelines-no-suspend-with-lock,
cppcoreguidelines-pro-type-member-init, # cppcoreguidelines-pro-type-member-init, # has issues
cppcoreguidelines-pro-type-static-cast-downcast, cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-rvalue-reference-param-not-moved, # cppcoreguidelines-rvalue-reference-param-not-moved, # has issues
cppcoreguidelines-use-default-member-init, # cppcoreguidelines-use-default-member-init, # has issues
cppcoreguidelines-virtual-class-destructor, # cppcoreguidelines-virtual-class-destructor, # has issues
hicpp-ignored-remove-result, hicpp-ignored-remove-result,
misc-const-correctness, # misc-definitions-in-headers, # has issues
misc-definitions-in-headers,
misc-header-include-cycle, misc-header-include-cycle,
misc-misplaced-const, misc-misplaced-const,
misc-redundant-expression,
misc-static-assert, misc-static-assert,
misc-throw-by-value-catch-by-reference, # misc-throw-by-value-catch-by-reference, # has issues
misc-unused-alias-decls, misc-unused-alias-decls,
misc-unused-using-decls, misc-unused-using-decls,
modernize-deprecated-headers, modernize-deprecated-headers,
modernize-make-shared, modernize-make-shared,
modernize-make-unique, modernize-make-unique,
llvm-namespace-comment,
performance-faster-string-find, performance-faster-string-find,
performance-for-range-copy, performance-for-range-copy,
performance-implicit-conversion-in-loop, performance-implicit-conversion-in-loop,
@@ -137,7 +134,10 @@ Checks: "-*,
# --- # ---
# other checks that have issues that need to be resolved: # other checks that have issues that need to be resolved:
# #
# llvm-namespace-comment,
# misc-const-correctness,
# misc-include-cleaner, # misc-include-cleaner,
# misc-redundant-expression,
# #
# readability-inconsistent-declaration-parameter-name, # in this codebase this check will break a lot of arg names # readability-inconsistent-declaration-parameter-name, # in this codebase this check will break a lot of arg names
# readability-static-accessed-through-instance, # this check is probably unnecessary. it makes the code less readable # readability-static-accessed-through-instance, # this check is probably unnecessary. it makes the code less readable

View File

@@ -76,11 +76,11 @@ fi
if ! grep -q 'Dev Null' src/test/rpc/ValidatorInfo_test.cpp; then if ! grep -q 'Dev Null' src/test/rpc/ValidatorInfo_test.cpp; then
echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/rpc/ValidatorInfo_test.cpp)" > src/test/rpc/ValidatorInfo_test.cpp echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/rpc/ValidatorInfo_test.cpp)" > src/test/rpc/ValidatorInfo_test.cpp
fi fi
if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/server_info/Manifest.cpp; then if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/DoManifest.cpp; then
echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/server_info/Manifest.cpp)" > src/xrpld/rpc/handlers/server_info/Manifest.cpp echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/DoManifest.cpp)" > src/xrpld/rpc/handlers/DoManifest.cpp
fi fi
if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp; then if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/ValidatorInfo.cpp; then
echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp)" > src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/ValidatorInfo.cpp)" > src/xrpld/rpc/handlers/ValidatorInfo.cpp
fi fi
if ! grep -q 'Bougalis' include/xrpl/basics/SlabAllocator.h; then if ! grep -q 'Bougalis' include/xrpl/basics/SlabAllocator.h; then
echo -e "// Copyright (c) 2022, Nikolaos D. Bougalis <nikb@bougalis.net>\n\n$(cat include/xrpl/basics/SlabAllocator.h)" > include/xrpl/basics/SlabAllocator.h # cspell: ignore Nikolaos Bougalis nikb echo -e "// Copyright (c) 2022, Nikolaos D. Bougalis <nikb@bougalis.net>\n\n$(cat include/xrpl/basics/SlabAllocator.h)" > include/xrpl/basics/SlabAllocator.h # cspell: ignore Nikolaos Bougalis nikb

View File

@@ -1,7 +1,7 @@
name: Check PR commits name: Check PR commits
on: on:
pull_request_target: pull_request:
# The action needs to have write permissions to post comments on the PR. # The action needs to have write permissions to post comments on the PR.
permissions: permissions:
@@ -10,4 +10,4 @@ permissions:
jobs: jobs:
check_commits: check_commits:
uses: XRPLF/actions/.github/workflows/check-pr-commits.yml@e2c7f400d1e85ae65dad552fd425169fbacca4a3 uses: XRPLF/actions/.github/workflows/check-pr-commits.yml@481048b78b94ac3343d1292b4ef125a813879f2b

View File

@@ -11,4 +11,4 @@ on:
jobs: jobs:
check_title: check_title:
if: ${{ github.event.pull_request.draft != true }} if: ${{ github.event.pull_request.draft != true }}
uses: XRPLF/actions/.github/workflows/check-pr-title.yml@a5d8dd35be543365e90a11358447130c8763871d uses: XRPLF/actions/.github/workflows/check-pr-title.yml@e2c7f400d1e85ae65dad552fd425169fbacca4a3

View File

@@ -14,7 +14,7 @@ on:
jobs: jobs:
# Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks. # Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks.
run-hooks: run-hooks:
uses: XRPLF/actions/.github/workflows/pre-commit.yml@9307df762265e15c745ddcdb38a581c989f7f349 uses: XRPLF/actions/.github/workflows/pre-commit.yml@e7896f15cc60d0da1a272c77ee5c4026b424f9c7
with: with:
runs_on: ubuntu-latest runs_on: ubuntu-latest
container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-41ec7c1" }' container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-41ec7c1" }'

View File

@@ -36,7 +36,7 @@ env:
BUILD_DIR: build BUILD_DIR: build
# ubuntu-latest has only 2 CPUs for private repositories # ubuntu-latest has only 2 CPUs for private repositories
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for--private-repositories # https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for--private-repositories
NPROC_SUBTRACT: ${{ github.event.repository.visibility == 'public' && '2' || '1' }} NPROC_SUBTRACT: ${{ github.event.repository.private && '1' || '2' }}
jobs: jobs:
build: build:
@@ -47,7 +47,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Prepare runner - name: Prepare runner
uses: XRPLF/actions/prepare-runner@90f11ee655d1687824fb8793db770477d52afbab uses: XRPLF/actions/prepare-runner@2bbc2dc1abeec7bfaa886804ab86871ac201764e
with: with:
enable_ccache: false enable_ccache: false
@@ -81,13 +81,13 @@ jobs:
cmake --build . --target docs --parallel ${BUILD_NPROC} cmake --build . --target docs --parallel ${BUILD_NPROC}
- name: Create documentation artifact - name: Create documentation artifact
if: ${{ (github.repository_owner == 'XRPLF' || github.event.repository.visibility == 'public') && github.event_name == 'push' }} if: ${{ github.event.repository.visibility == 'public' && github.event_name == 'push' }}
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with: with:
path: ${{ env.BUILD_DIR }}/docs/html path: ${{ env.BUILD_DIR }}/docs/html
deploy: deploy:
if: ${{ (github.repository_owner == 'XRPLF' || github.event.repository.visibility == 'public') && github.event_name == 'push' }} if: ${{ github.event.repository.visibility == 'public' && github.event_name == 'push' }}
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:

View File

@@ -107,7 +107,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Prepare runner - name: Prepare runner
uses: XRPLF/actions/prepare-runner@90f11ee655d1687824fb8793db770477d52afbab uses: XRPLF/actions/prepare-runner@2bbc2dc1abeec7bfaa886804ab86871ac201764e
with: with:
enable_ccache: ${{ inputs.ccache_enabled }} enable_ccache: ${{ inputs.ccache_enabled }}
@@ -199,7 +199,7 @@ jobs:
fi fi
- name: Upload the binary (Linux) - name: Upload the binary (Linux)
if: ${{ (github.repository_owner == 'XRPLF' || github.event.repository.visibility == 'public') && runner.os == 'Linux' }} if: ${{ github.event.repository.visibility == 'public' && runner.os == 'Linux' }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with: with:
name: xrpld-${{ inputs.config_name }} name: xrpld-${{ inputs.config_name }}

View File

@@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Prepare runner - name: Prepare runner
uses: XRPLF/actions/prepare-runner@90f11ee655d1687824fb8793db770477d52afbab uses: XRPLF/actions/prepare-runner@2bbc2dc1abeec7bfaa886804ab86871ac201764e
with: with:
enable_ccache: false enable_ccache: false
@@ -80,10 +80,10 @@ jobs:
env: env:
TARGETS: ${{ inputs.files != '' && inputs.files || 'src tests' }} TARGETS: ${{ inputs.files != '' && inputs.files || 'src tests' }}
run: | run: |
run-clang-tidy -j ${{ steps.nproc.outputs.nproc }} -p "${BUILD_DIR}" -quiet -allow-no-checks ${TARGETS} 2>&1 | tee clang-tidy-output.txt run-clang-tidy -j ${{ steps.nproc.outputs.nproc }} -p "${BUILD_DIR}" ${TARGETS} 2>&1 | tee clang-tidy-output.txt
- name: Upload clang-tidy output - name: Upload clang-tidy output
if: ${{ (github.repository_owner == 'XRPLF' || github.event.repository.visibility == 'public') && steps.run_clang_tidy.outcome != 'success' }} if: ${{ github.event.repository.visibility == 'public' && steps.run_clang_tidy.outcome != 'success' }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with: with:
name: clang-tidy-results name: clang-tidy-results

View File

@@ -70,7 +70,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Prepare runner - name: Prepare runner
uses: XRPLF/actions/prepare-runner@90f11ee655d1687824fb8793db770477d52afbab uses: XRPLF/actions/prepare-runner@2bbc2dc1abeec7bfaa886804ab86871ac201764e
with: with:
enable_ccache: false enable_ccache: false

View File

@@ -38,8 +38,6 @@ This section contains changes targeting a future version.
### Bugfixes ### Bugfixes
- Peer Crawler: The `port` field in `overlay.active[]` now consistently returns an integer instead of a string for outbound peers. [#6318](https://github.com/XRPLF/rippled/pull/6318) - Peer Crawler: The `port` field in `overlay.active[]` now consistently returns an integer instead of a string for outbound peers. [#6318](https://github.com/XRPLF/rippled/pull/6318)
- `ping`: The `ip` field is no longer returned as an empty string for proxied connections without a forwarded-for header. It is now omitted, consistent with the behavior for identified connections. [#6730](https://github.com/XRPLF/rippled/pull/6730)
- gRPC `GetLedgerDiff`: Fixed error message that incorrectly said "base ledger not validated" when the desired ledger was not validated. [#6730](https://github.com/XRPLF/rippled/pull/6730)
## XRP Ledger server version 3.1.0 ## XRP Ledger server version 3.1.0

View File

@@ -141,7 +141,7 @@ Alternatively, you can pull our recipes from the repository and export them loca
```bash ```bash
# Define which recipes to export. # Define which recipes to export.
recipes=('abseil' 'ed25519' 'grpc' 'm4' 'mpt-crypto' 'openssl' 'secp256k1' 'snappy' 'soci' 'wasm-xrplf' 'wasmi') recipes=('abseil' 'ed25519' 'grpc' 'm4' 'mpt-crypto' 'nudb' 'openssl' 'secp256k1' 'snappy' 'soci' 'wasm-xrplf' 'wasmi')
# Selectively check out the recipes from our CCI fork. # Selectively check out the recipes from our CCI fork.
cd external cd external

View File

@@ -270,14 +270,14 @@ Before running clang-tidy, you must build the project to generate required files
Then run clang-tidy on your local changes: Then run clang-tidy on your local changes:
``` ```
run-clang-tidy -p build -allow-no-checks src tests run-clang-tidy -p build src include tests
``` ```
This will check all source files in the `src`, `include` and `tests` directories using the compile commands from your `build` directory. This will check all source files in the `src`, `include` and `tests` directories using the compile commands from your `build` directory.
If you wish to automatically fix whatever clang-tidy finds _and_ is capable of fixing, add `-fix` to the above command: If you wish to automatically fix whatever clang-tidy finds _and_ is capable of fixing, add `-fix` to the above command:
``` ```
run-clang-tidy -p build -quiet -fix -allow-no-checks src tests run-clang-tidy -p build -fix src include tests
``` ```
## Contracts and instrumentation ## Contracts and instrumentation

View File

@@ -3,22 +3,22 @@
"requires": [ "requires": [
"zlib/1.3.1#cac0f6daea041b0ccf42934163defb20%1774439233.809", "zlib/1.3.1#cac0f6daea041b0ccf42934163defb20%1774439233.809",
"xxhash/0.8.3#681d36a0a6111fc56e5e45ea182c19cc%1765850149.987", "xxhash/0.8.3#681d36a0a6111fc56e5e45ea182c19cc%1765850149.987",
"sqlite3/3.51.0#66aa11eabd0e34954c5c1c061ad44abe%1774467355.988", "sqlite3/3.51.0#66aa11eabd0e34954c5c1c061ad44abe%1763899256.358",
"soci/4.0.3#fe32b9ad5eb47e79ab9e45a68f363945%1774450067.231", "soci/4.0.3#fe32b9ad5eb47e79ab9e45a68f363945%1774450067.231",
"snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1765850147.878", "snappy/1.1.10#968fef506ff261592ec30c574d4a7809%1765850147.878",
"secp256k1/0.7.1#481881709eb0bdd0185a12b912bbe8ad%1770910500.329", "secp256k1/0.7.1#481881709eb0bdd0185a12b912bbe8ad%1770910500.329",
"rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1765850186.86", "rocksdb/10.5.1#4a197eca381a3e5ae8adf8cffa5aacd0%1765850186.86",
"re2/20251105#8579cfd0bda4daf0683f9e3898f964b4%1774398111.888", "re2/20251105#8579cfd0bda4daf0683f9e3898f964b4%1774398111.888",
"protobuf/6.33.5#d96d52ba5baaaa532f47bda866ad87a5%1774467363.12", "protobuf/6.33.5#d96d52ba5baaaa532f47bda866ad87a5%1773224203.27",
"openssl/3.6.1#e6399de266349245a4542fc5f6c71552%1774458290.139", "openssl/3.6.1#e6399de266349245a4542fc5f6c71552%1774458290.139",
"nudb/2.0.9#11149c73f8f2baff9a0198fe25971fc7%1774883011.384", "nudb/2.0.9#0432758a24204da08fee953ec9ea03cb%1769436073.32",
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1765850143.914", "lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1765850143.914",
"libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1765842973.492", "libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1765842973.492",
"libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1%1765842973.03", "libbacktrace/cci.20210118#a7691bfccd8caaf66309df196790a5a1%1765842973.03",
"libarchive/3.8.1#ffee18995c706e02bf96e7a2f7042e0d%1765850144.736", "libarchive/3.8.1#ffee18995c706e02bf96e7a2f7042e0d%1765850144.736",
"jemalloc/5.3.0#e951da9cf599e956cebc117880d2d9f8%1729241615.244", "jemalloc/5.3.0#e951da9cf599e956cebc117880d2d9f8%1729241615.244",
"gtest/1.17.0#5224b3b3ff3b4ce1133cbdd27d53ee7d%1768312129.152", "gtest/1.17.0#5224b3b3ff3b4ce1133cbdd27d53ee7d%1768312129.152",
"grpc/1.78.1#b1a9e74b145cc471bed4dc64dc6eb2c1%1774467387.342", "grpc/1.78.1#b1a9e74b145cc471bed4dc64dc6eb2c1%1772623605.068",
"ed25519/2015.03#ae761bdc52730a843f0809bdf6c1b1f6%1765850143.772", "ed25519/2015.03#ae761bdc52730a843f0809bdf6c1b1f6%1765850143.772",
"date/3.0.4#862e11e80030356b53c2c38599ceb32b%1765850143.772", "date/3.0.4#862e11e80030356b53c2c38599ceb32b%1765850143.772",
"c-ares/1.34.6#545240bb1c40e2cacd4362d6b8967650%1774439234.681", "c-ares/1.34.6#545240bb1c40e2cacd4362d6b8967650%1774439234.681",
@@ -29,7 +29,7 @@
"build_requires": [ "build_requires": [
"zlib/1.3.1#cac0f6daea041b0ccf42934163defb20%1774439233.809", "zlib/1.3.1#cac0f6daea041b0ccf42934163defb20%1774439233.809",
"strawberryperl/5.32.1.1#8d114504d172cfea8ea1662d09b6333e%1774447376.964", "strawberryperl/5.32.1.1#8d114504d172cfea8ea1662d09b6333e%1774447376.964",
"protobuf/6.33.5#d96d52ba5baaaa532f47bda866ad87a5%1774467363.12", "protobuf/6.33.5#d96d52ba5baaaa532f47bda866ad87a5%1773224203.27",
"nasm/2.16.01#31e26f2ee3c4346ecd347911bd126904%1765850144.707", "nasm/2.16.01#31e26f2ee3c4346ecd347911bd126904%1765850144.707",
"msys2/cci.latest#d22fe7b2808f5fd34d0a7923ace9c54f%1770657326.649", "msys2/cci.latest#d22fe7b2808f5fd34d0a7923ace9c54f%1770657326.649",
"m4/1.4.19#5d7a4994e5875d76faf7acf3ed056036%1774365463.87", "m4/1.4.19#5d7a4994e5875d76faf7acf3ed056036%1774365463.87",
@@ -41,15 +41,16 @@
], ],
"python_requires": [], "python_requires": [],
"overrides": { "overrides": {
"boost/1.90.0#d5e8defe7355494953be18524a7f135b": [
null,
"boost/1.90.0"
],
"protobuf/[>=5.27.0 <7]": [ "protobuf/[>=5.27.0 <7]": [
"protobuf/6.33.5" "protobuf/6.33.5"
], ],
"lz4/1.9.4": [ "lz4/1.9.4": [
"lz4/1.10.0" "lz4/1.10.0"
], ],
"boost/[>=1.83.0 <1.91.0]": [
"boost/1.90.0"
],
"sqlite3/[>=3.44 <4]": [ "sqlite3/[>=3.44 <4]": [
"sqlite3/3.51.0" "sqlite3/3.51.0"
], ],

View File

@@ -311,7 +311,7 @@ template <class T>
bool bool
set(T& target, T const& defaultValue, std::string const& name, Section const& section) set(T& target, T const& defaultValue, std::string const& name, Section const& section)
{ {
bool const found_and_valid = set<T>(target, name, section); bool found_and_valid = set<T>(target, name, section);
if (!found_and_valid) if (!found_and_valid)
target = defaultValue; target = defaultValue;
return found_and_valid; return found_and_valid;

View File

@@ -34,7 +34,7 @@ public:
{ {
// Insert ourselves at the front of the lock-free linked list // Insert ourselves at the front of the lock-free linked list
CountedObjects& instance = CountedObjects::getInstance(); CountedObjects& instance = CountedObjects::getInstance();
Counter* head = nullptr; Counter* head;
do do
{ {

View File

@@ -93,7 +93,7 @@ class DecayWindow
public: public:
using time_point = typename Clock::time_point; using time_point = typename Clock::time_point;
explicit DecayWindow(time_point now) : when_(now) explicit DecayWindow(time_point now) : value_(0), when_(now)
{ {
} }
@@ -125,7 +125,7 @@ private:
when_ = now; when_ = now;
} }
double value_{0}; double value_;
time_point when_; time_point when_;
}; };

View File

@@ -84,8 +84,7 @@ public:
template <class TT> template <class TT>
requires std::convertible_to<TT*, T*> requires std::convertible_to<TT*, T*>
SharedIntrusive( SharedIntrusive(SharedIntrusive<TT>&& rhs);
SharedIntrusive<TT>&& rhs); // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
SharedIntrusive& SharedIntrusive&
operator=(SharedIntrusive const& rhs); operator=(SharedIntrusive const& rhs);
@@ -107,8 +106,7 @@ public:
template <class TT> template <class TT>
requires std::convertible_to<TT*, T*> requires std::convertible_to<TT*, T*>
SharedIntrusive& SharedIntrusive&
operator=( operator=(SharedIntrusive<TT>&& rhs);
SharedIntrusive<TT>&& rhs); // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
/** Adopt the raw pointer. The strong reference may or may not be /** Adopt the raw pointer. The strong reference may or may not be
incremented, depending on the TAdoptTag incremented, depending on the TAdoptTag
@@ -316,8 +314,7 @@ public:
template <class TT> template <class TT>
requires std::convertible_to<TT*, T*> requires std::convertible_to<TT*, T*>
SharedWeakUnion( SharedWeakUnion(SharedIntrusive<TT>&& rhs);
SharedIntrusive<TT>&& rhs); // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
SharedWeakUnion& SharedWeakUnion&
operator=(SharedWeakUnion const& rhs); operator=(SharedWeakUnion const& rhs);
@@ -330,8 +327,7 @@ public:
template <class TT> template <class TT>
requires std::convertible_to<TT*, T*> requires std::convertible_to<TT*, T*>
SharedWeakUnion& SharedWeakUnion&
operator=( operator=(SharedIntrusive<TT>&& rhs);
SharedIntrusive<TT>&& rhs); // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
~SharedWeakUnion(); ~SharedWeakUnion();

View File

@@ -68,7 +68,9 @@ SharedIntrusive<T>::operator=(SharedIntrusive const& rhs)
template <class T> template <class T>
template <class TT> template <class TT>
requires std::convertible_to<TT*, T*> // clang-format off
requires std::convertible_to<TT*, T*>
// clang-format on
SharedIntrusive<T>& SharedIntrusive<T>&
SharedIntrusive<T>::operator=(SharedIntrusive<TT> const& rhs) SharedIntrusive<T>::operator=(SharedIntrusive<TT> const& rhs)
{ {
@@ -99,7 +101,9 @@ SharedIntrusive<T>::operator=(SharedIntrusive&& rhs)
template <class T> template <class T>
template <class TT> template <class TT>
requires std::convertible_to<TT*, T*> // clang-format off
requires std::convertible_to<TT*, T*>
// clang-format on
SharedIntrusive<T>& SharedIntrusive<T>&
SharedIntrusive<T>::operator=(SharedIntrusive<TT>&& rhs) SharedIntrusive<T>::operator=(SharedIntrusive<TT>&& rhs)
{ {
@@ -303,7 +307,9 @@ WeakIntrusive<T>::WeakIntrusive(SharedIntrusive<T> const& rhs) : ptr_{rhs.unsafe
template <class T> template <class T>
template <class TT> template <class TT>
requires std::convertible_to<TT*, T*> // clang-format off
requires std::convertible_to<TT*, T*>
// clang-format on
WeakIntrusive<T>& WeakIntrusive<T>&
WeakIntrusive<T>::operator=(SharedIntrusive<TT> const& rhs) WeakIntrusive<T>::operator=(SharedIntrusive<TT> const& rhs)
{ {
@@ -448,7 +454,9 @@ SharedWeakUnion<T>::operator=(SharedWeakUnion const& rhs)
template <class T> template <class T>
template <class TT> template <class TT>
requires std::convertible_to<TT*, T*> // clang-format off
requires std::convertible_to<TT*, T*>
// clang-format on
SharedWeakUnion<T>& SharedWeakUnion<T>&
SharedWeakUnion<T>::operator=(SharedIntrusive<TT> const& rhs) SharedWeakUnion<T>::operator=(SharedIntrusive<TT> const& rhs)
{ {
@@ -462,7 +470,9 @@ SharedWeakUnion<T>::operator=(SharedIntrusive<TT> const& rhs)
template <class T> template <class T>
template <class TT> template <class TT>
requires std::convertible_to<TT*, T*> // clang-format off
requires std::convertible_to<TT*, T*>
// clang-format on
SharedWeakUnion<T>& SharedWeakUnion<T>&
SharedWeakUnion<T>::operator=(SharedIntrusive<TT>&& rhs) SharedWeakUnion<T>::operator=(SharedIntrusive<TT>&& rhs)
{ {

View File

@@ -448,7 +448,7 @@ inline void
partialDestructorFinished(T** o) partialDestructorFinished(T** o)
{ {
T& self = **o; T& self = **o;
IntrusiveRefCounts::RefCountPair const p = IntrusiveRefCounts::RefCountPair p =
self.refCounts.fetch_or(IntrusiveRefCounts::partialDestroyFinishedMask); self.refCounts.fetch_or(IntrusiveRefCounts::partialDestroyFinishedMask);
XRPL_ASSERT( XRPL_ASSERT(
(!p.partialDestroyFinishedBit && p.partialDestroyStartedBit && !p.strong), (!p.partialDestroyFinishedBit && p.partialDestroyStartedBit && !p.strong),

View File

@@ -73,12 +73,12 @@ struct MantissaRange
enum mantissa_scale { small, large }; enum mantissa_scale { small, large };
explicit constexpr MantissaRange(mantissa_scale scale_) explicit constexpr MantissaRange(mantissa_scale scale_)
: min(getMin(scale_)), log(logTen(min).value_or(-1)), scale(scale_) : min(getMin(scale_)), max(min * 10 - 1), log(logTen(min).value_or(-1)), scale(scale_)
{ {
} }
rep min; rep min;
rep max{min * 10 - 1}; rep max;
int log; int log;
mantissa_scale scale; mantissa_scale scale;

View File

@@ -91,10 +91,10 @@ class SlabAllocator
std::uint8_t* std::uint8_t*
allocate() noexcept allocate() noexcept
{ {
std::uint8_t* ret = nullptr; // NOLINT(misc-const-correctness) std::uint8_t* ret;
{ {
std::lock_guard const l(m_); std::lock_guard l(m_);
ret = l_; ret = l_;
@@ -123,7 +123,7 @@ class SlabAllocator
{ {
XRPL_ASSERT(own(ptr), "xrpl::SlabAllocator::SlabBlock::deallocate : own input"); XRPL_ASSERT(own(ptr), "xrpl::SlabAllocator::SlabBlock::deallocate : own input");
std::lock_guard const l(m_); std::lock_guard l(m_);
// Use memcpy to avoid unaligned UB // Use memcpy to avoid unaligned UB
// (will optimize to equivalent code) // (will optimize to equivalent code)
@@ -210,13 +210,16 @@ public:
// No slab can satisfy our request, so we attempt to allocate a new // No slab can satisfy our request, so we attempt to allocate a new
// one here: // one here:
std::size_t const size = slabSize_; std::size_t size = slabSize_;
// We want to allocate the memory at a 2 MiB boundary, to make it // We want to allocate the memory at a 2 MiB boundary, to make it
// possible to use hugepage mappings on Linux: // possible to use hugepage mappings on Linux:
auto buf = boost::alignment::aligned_alloc(megabytes(std::size_t(2)), size); auto buf = boost::alignment::aligned_alloc(megabytes(std::size_t(2)), size);
// clang-format off
if (!buf) [[unlikely]] if (!buf) [[unlikely]]
return nullptr; return nullptr;
// clang-format on
#if BOOST_OS_LINUX #if BOOST_OS_LINUX
// When allocating large blocks, attempt to leverage Linux's // When allocating large blocks, attempt to leverage Linux's

View File

@@ -66,12 +66,12 @@ strUnHex(std::size_t strSize, Iterator begin, Iterator end)
while (iter != end) while (iter != end)
{ {
int const cHigh = digitLookupTable[*iter++]; int cHigh = digitLookupTable[*iter++];
if (cHigh < 0) if (cHigh < 0)
return {}; return {};
int const cLow = digitLookupTable[*iter++]; int cLow = digitLookupTable[*iter++];
if (cLow < 0) if (cLow < 0)
return {}; return {};

View File

@@ -182,7 +182,8 @@ private:
: hook(collector->make_hook(handler)) : hook(collector->make_hook(handler))
, size(collector->make_gauge(prefix, "size")) , size(collector->make_gauge(prefix, "size"))
, hit_rate(collector->make_gauge(prefix, "hit_rate")) , hit_rate(collector->make_gauge(prefix, "hit_rate"))
, hits(0)
, misses(0)
{ {
} }
@@ -190,8 +191,8 @@ private:
beast::insight::Gauge size; beast::insight::Gauge size;
beast::insight::Gauge hit_rate; beast::insight::Gauge hit_rate;
std::size_t hits{0}; std::size_t hits;
std::size_t misses{0}; std::size_t misses;
}; };
class KeyOnlyEntry class KeyOnlyEntry
@@ -293,10 +294,10 @@ private:
clock_type::duration const m_target_age; clock_type::duration const m_target_age;
// Number of items cached // Number of items cached
int m_cache_count{0}; int m_cache_count;
cache_type m_cache; // Hold strong reference to recent objects cache_type m_cache; // Hold strong reference to recent objects
std::uint64_t m_hits{0}; std::uint64_t m_hits;
std::uint64_t m_misses{0}; std::uint64_t m_misses;
}; };
} // namespace xrpl } // namespace xrpl

View File

@@ -36,7 +36,9 @@ inline TaggedCache<
, m_name(name) , m_name(name)
, m_target_size(size) , m_target_size(size)
, m_target_age(expiration) , m_target_age(expiration)
, m_cache_count(0)
, m_hits(0)
, m_misses(0)
{ {
} }

View File

@@ -212,7 +212,7 @@ private:
while (in != sv.end()) while (in != sv.end())
{ {
std::uint32_t accum = {}; std::uint32_t accum = {};
for (std::uint32_t const shift : {4u, 0u, 12u, 8u, 20u, 16u, 28u, 24u}) for (std::uint32_t shift : {4u, 0u, 12u, 8u, 20u, 16u, 28u, 24u})
{ {
if (auto const result = hexCharToUInt(*in++, shift, accum); if (auto const result = hexCharToUInt(*in++, shift, accum);
result != ParseResult::okay) result != ParseResult::okay)
@@ -335,13 +335,11 @@ public:
operator=(std::uint64_t uHost) operator=(std::uint64_t uHost)
{ {
*this = beast::zero; *this = beast::zero;
// NOLINTBEGIN(cppcoreguidelines-pro-type-member-init)
union union
{ {
unsigned u[2]; unsigned u[2];
std::uint64_t ul; std::uint64_t ul;
}; };
// NOLINTEND(cppcoreguidelines-pro-type-member-init)
// Put in least significant bits. // Put in least significant bits.
ul = boost::endian::native_to_big(uHost); ul = boost::endian::native_to_big(uHost);
data_[WIDTH - 2] = u[0]; data_[WIDTH - 2] = u[0];
@@ -446,7 +444,7 @@ public:
for (int i = WIDTH; i--;) for (int i = WIDTH; i--;)
{ {
std::uint64_t const n = carry + boost::endian::big_to_native(data_[i]) + std::uint64_t n = carry + boost::endian::big_to_native(data_[i]) +
boost::endian::big_to_native(b.data_[i]); boost::endian::big_to_native(b.data_[i]);
data_[i] = boost::endian::native_to_big(static_cast<std::uint32_t>(n)); data_[i] = boost::endian::native_to_big(static_cast<std::uint32_t>(n));
@@ -623,7 +621,7 @@ template <>
inline std::size_t inline std::size_t
extract(uint256 const& key) extract(uint256 const& key)
{ {
std::size_t result = 0; std::size_t result;
// Use memcpy to avoid unaligned UB // Use memcpy to avoid unaligned UB
// (will optimize to equivalent code) // (will optimize to equivalent code)
std::memcpy(&result, key.data(), sizeof(std::size_t)); std::memcpy(&result, key.data(), sizeof(std::size_t));

View File

@@ -54,7 +54,7 @@ Throw(Args&&... args)
E e(std::forward<Args>(args)...); E e(std::forward<Args>(args)...);
LogThrow(std::string("Throwing exception of type " + beast::type_name<E>() + ": ") + e.what()); LogThrow(std::string("Throwing exception of type " + beast::type_name<E>() + ": ") + e.what());
throw std::move(e); throw e;
} }
/** Called when faulty logic causes a broken invariant. */ /** Called when faulty logic causes a broken invariant. */

View File

@@ -32,7 +32,7 @@ make_seed_pair() noexcept
// state_t& operator=(state_t const&) = delete; // state_t& operator=(state_t const&) = delete;
}; };
static state_t state; static state_t state;
std::lock_guard const lock(state.mutex); std::lock_guard lock(state.mutex);
return {state.dist(state.gen), state.dist(state.gen)}; return {state.dist(state.gen), state.dist(state.gen)};
} }

View File

@@ -14,13 +14,11 @@ namespace xrpl {
#ifndef __INTELLISENSE__ #ifndef __INTELLISENSE__
static_assert( static_assert(
// NOLINTNEXTLINE(misc-redundant-expression)
std::is_integral<beast::xor_shift_engine::result_type>::value && std::is_integral<beast::xor_shift_engine::result_type>::value &&
std::is_unsigned<beast::xor_shift_engine::result_type>::value, std::is_unsigned<beast::xor_shift_engine::result_type>::value,
"The Ripple default PRNG engine must return an unsigned integral type."); "The Ripple default PRNG engine must return an unsigned integral type.");
static_assert( static_assert(
// NOLINTNEXTLINE(misc-redundant-expression)
std::numeric_limits<beast::xor_shift_engine::result_type>::max() >= std::numeric_limits<beast::xor_shift_engine::result_type>::max() >=
std::numeric_limits<std::uint64_t>::max(), std::numeric_limits<std::uint64_t>::max(),
"The Ripple default PRNG engine return must be at least 64 bits wide."); "The Ripple default PRNG engine return must be at least 64 bits wide.");
@@ -58,9 +56,9 @@ default_prng()
// The thread-specific PRNGs: // The thread-specific PRNGs:
thread_local beast::xor_shift_engine engine = [] { thread_local beast::xor_shift_engine engine = [] {
std::uint64_t seed = 0; std::uint64_t seed;
{ {
std::lock_guard const lk(m); std::lock_guard lk(m);
std::uniform_int_distribution<std::uint64_t> distribution{1}; std::uniform_int_distribution<std::uint64_t> distribution{1};
seed = distribution(seeder); seed = distribution(seeder);
} }

View File

@@ -23,15 +23,15 @@ private:
std::recursive_mutex m_mutex; std::recursive_mutex m_mutex;
std::condition_variable_any m_cond; std::condition_variable_any m_cond;
std::size_t m_count{1}; std::size_t m_count;
duration const m_period; duration const m_period;
boost::asio::io_context& m_ios; boost::asio::io_context& m_ios;
boost::asio::basic_waitable_timer<std::chrono::steady_clock> m_timer; boost::asio::basic_waitable_timer<std::chrono::steady_clock> m_timer;
bool m_cancel{false}; bool m_cancel;
public: public:
io_latency_probe(duration const& period, boost::asio::io_context& ios) io_latency_probe(duration const& period, boost::asio::io_context& ios)
: m_period(period), m_ios(ios), m_timer(m_ios) : m_count(1), m_period(period), m_ios(ios), m_timer(m_ios), m_cancel(false)
{ {
} }
@@ -83,7 +83,7 @@ public:
void void
sample_one(Handler&& handler) sample_one(Handler&& handler)
{ {
std::lock_guard const lock(m_mutex); std::lock_guard lock(m_mutex);
if (m_cancel) if (m_cancel)
throw std::logic_error("io_latency_probe is canceled"); throw std::logic_error("io_latency_probe is canceled");
boost::asio::post( boost::asio::post(
@@ -98,7 +98,7 @@ public:
void void
sample(Handler&& handler) sample(Handler&& handler)
{ {
std::lock_guard const lock(m_mutex); std::lock_guard lock(m_mutex);
if (m_cancel) if (m_cancel)
throw std::logic_error("io_latency_probe is canceled"); throw std::logic_error("io_latency_probe is canceled");
boost::asio::post( boost::asio::post(
@@ -122,14 +122,14 @@ private:
void void
addref() addref()
{ {
std::lock_guard const lock(m_mutex); std::lock_guard lock(m_mutex);
++m_count; ++m_count;
} }
void void
release() release()
{ {
std::lock_guard const lock(m_mutex); std::lock_guard lock(m_mutex);
if (--m_count == 0) if (--m_count == 0)
m_cond.notify_all(); m_cond.notify_all();
} }
@@ -192,7 +192,7 @@ private:
m_handler(elapsed); m_handler(elapsed);
{ {
std::lock_guard const lock(m_probe->m_mutex); std::lock_guard lock(m_probe->m_mutex);
if (m_probe->m_cancel) if (m_probe->m_cancel)
return; return;
} }

View File

@@ -16,4 +16,4 @@ template <
class Allocator = std::allocator<std::pair<Key const, T>>> class Allocator = std::allocator<std::pair<Key const, T>>>
using aged_map = detail::aged_ordered_container<false, true, Key, T, Clock, Compare, Allocator>; using aged_map = detail::aged_ordered_container<false, true, Key, T, Clock, Compare, Allocator>;
} // namespace beast }

View File

@@ -16,4 +16,4 @@ template <
class Allocator = std::allocator<std::pair<Key const, T>>> class Allocator = std::allocator<std::pair<Key const, T>>>
using aged_multimap = detail::aged_ordered_container<true, true, Key, T, Clock, Compare, Allocator>; using aged_multimap = detail::aged_ordered_container<true, true, Key, T, Clock, Compare, Allocator>;
} // namespace beast }

View File

@@ -15,4 +15,4 @@ template <
class Allocator = std::allocator<Key>> class Allocator = std::allocator<Key>>
using aged_multiset = using aged_multiset =
detail::aged_ordered_container<true, false, Key, void, Clock, Compare, Allocator>; detail::aged_ordered_container<true, false, Key, void, Clock, Compare, Allocator>;
} // namespace beast }

View File

@@ -15,4 +15,4 @@ template <
class Allocator = std::allocator<Key>> class Allocator = std::allocator<Key>>
using aged_set = detail::aged_ordered_container<false, false, Key, void, Clock, Compare, Allocator>; using aged_set = detail::aged_ordered_container<false, false, Key, void, Clock, Compare, Allocator>;
} // namespace beast }

View File

@@ -17,4 +17,4 @@ template <
class Allocator = std::allocator<std::pair<Key const, T>>> class Allocator = std::allocator<std::pair<Key const, T>>>
using aged_unordered_map = using aged_unordered_map =
detail::aged_unordered_container<false, true, Key, T, Clock, Hash, KeyEqual, Allocator>; detail::aged_unordered_container<false, true, Key, T, Clock, Hash, KeyEqual, Allocator>;
} // namespace beast }

View File

@@ -17,4 +17,4 @@ template <
class Allocator = std::allocator<std::pair<Key const, T>>> class Allocator = std::allocator<std::pair<Key const, T>>>
using aged_unordered_multimap = using aged_unordered_multimap =
detail::aged_unordered_container<true, true, Key, T, Clock, Hash, KeyEqual, Allocator>; detail::aged_unordered_container<true, true, Key, T, Clock, Hash, KeyEqual, Allocator>;
} // namespace beast }

View File

@@ -17,4 +17,4 @@ template <
using aged_unordered_multiset = using aged_unordered_multiset =
detail::aged_unordered_container<true, false, Key, void, Clock, Hash, KeyEqual, Allocator>; detail::aged_unordered_container<true, false, Key, void, Clock, Hash, KeyEqual, Allocator>;
} // namespace beast }

View File

@@ -16,4 +16,4 @@ template <
class Allocator = std::allocator<Key>> class Allocator = std::allocator<Key>>
using aged_unordered_set = using aged_unordered_set =
detail::aged_unordered_container<false, false, Key, void, Clock, Hash, KeyEqual, Allocator>; detail::aged_unordered_container<false, false, Key, void, Clock, Hash, KeyEqual, Allocator>;
} // namespace beast }

View File

@@ -262,9 +262,7 @@ private:
{ {
} }
config_t( config_t(config_t&& other, Allocator const& alloc)
config_t&& other, // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
Allocator const& alloc)
: KeyValueCompare(std::move(other.key_compare())) : KeyValueCompare(std::move(other.key_compare()))
, beast::detail::empty_base_optimization<ElementAllocator>(alloc) , beast::detail::empty_base_optimization<ElementAllocator>(alloc)
, clock(other.clock) , clock(other.clock)
@@ -554,10 +552,7 @@ public:
aged_ordered_container(aged_ordered_container&& other); aged_ordered_container(aged_ordered_container&& other);
aged_ordered_container( aged_ordered_container(aged_ordered_container&& other, Allocator const& alloc);
// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
aged_ordered_container&& other,
Allocator const& alloc);
aged_ordered_container(std::initializer_list<value_type> init, clock_type& clock); aged_ordered_container(std::initializer_list<value_type> init, clock_type& clock);
@@ -1295,7 +1290,7 @@ aged_ordered_container<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>::aged_
template <bool IsMulti, bool IsMap, class Key, class T, class Clock, class Compare, class Allocator> template <bool IsMulti, bool IsMap, class Key, class T, class Clock, class Compare, class Allocator>
aged_ordered_container<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>::aged_ordered_container( aged_ordered_container<IsMulti, IsMap, Key, T, Clock, Compare, Allocator>::aged_ordered_container(
aged_ordered_container&& other, // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved) aged_ordered_container&& other,
Allocator const& alloc) Allocator const& alloc)
: m_config(std::move(other.m_config), alloc) : m_config(std::move(other.m_config), alloc)
#if BOOST_VERSION >= 108000 #if BOOST_VERSION >= 108000

View File

@@ -318,9 +318,7 @@ private:
{ {
} }
config_t( config_t(config_t&& other, Allocator const& alloc)
config_t&& other, // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
Allocator const& alloc)
: ValueHash(std::move(other.hash_function())) : ValueHash(std::move(other.hash_function()))
, KeyValueEqual(std::move(other.key_eq())) , KeyValueEqual(std::move(other.key_eq()))
, beast::detail::empty_base_optimization<ElementAllocator>(alloc) , beast::detail::empty_base_optimization<ElementAllocator>(alloc)
@@ -776,10 +774,7 @@ public:
aged_unordered_container(aged_unordered_container&& other); aged_unordered_container(aged_unordered_container&& other);
aged_unordered_container( aged_unordered_container(aged_unordered_container&& other, Allocator const& alloc);
// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
aged_unordered_container&& other,
Allocator const& alloc);
aged_unordered_container(std::initializer_list<value_type> init, clock_type& clock); aged_unordered_container(std::initializer_list<value_type> init, clock_type& clock);
@@ -1843,10 +1838,7 @@ template <
class KeyEqual, class KeyEqual,
class Allocator> class Allocator>
aged_unordered_container<IsMulti, IsMap, Key, T, Clock, Hash, KeyEqual, Allocator>:: aged_unordered_container<IsMulti, IsMap, Key, T, Clock, Hash, KeyEqual, Allocator>::
aged_unordered_container( aged_unordered_container(aged_unordered_container&& other, Allocator const& alloc)
// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
aged_unordered_container&& other,
Allocator const& alloc)
: m_config(std::move(other.m_config), alloc) : m_config(std::move(other.m_config), alloc)
, m_buck(alloc) , m_buck(alloc)
, m_cont(m_buck, std::cref(m_config.value_hash()), std::cref(m_config.key_value_equal())) , m_cont(m_buck, std::cref(m_config.value_hash()), std::cref(m_config.key_value_equal()))

View File

@@ -449,7 +449,7 @@ public:
iterator iterator
erase(iterator pos) noexcept erase(iterator pos) noexcept
{ {
Node const* node = &*pos; Node* node = &*pos;
++pos; ++pos;
node->m_next->m_prev = node->m_prev; node->m_next->m_prev = node->m_prev;
node->m_prev->m_next = node->m_next; node->m_prev->m_next = node->m_next;

View File

@@ -187,7 +187,7 @@ public:
bool bool
push_front(Node* node) push_front(Node* node)
{ {
bool first = false; bool first;
Node* old_head = m_head.load(std::memory_order_relaxed); Node* old_head = m_head.load(std::memory_order_relaxed);
do do
{ {
@@ -211,7 +211,7 @@ public:
pop_front() pop_front()
{ {
Node* node = m_head.load(); Node* node = m_head.load();
Node* new_head = nullptr; Node* new_head;
do do
{ {
if (node == &m_end) if (node == &m_end)

View File

@@ -23,7 +23,7 @@ private:
// A 64-byte buffer should to be big enough for us // A 64-byte buffer should to be big enough for us
static constexpr std::size_t INTERNAL_BUFFER_SIZE = 64; static constexpr std::size_t INTERNAL_BUFFER_SIZE = 64;
alignas(64) std::array<std::uint8_t, INTERNAL_BUFFER_SIZE> buffer_{}; alignas(64) std::array<std::uint8_t, INTERNAL_BUFFER_SIZE> buffer_;
std::span<std::uint8_t> readBuffer_; std::span<std::uint8_t> readBuffer_;
std::span<std::uint8_t> writeBuffer_; std::span<std::uint8_t> writeBuffer_;

View File

@@ -114,7 +114,7 @@ enable_yield_to::spawn(F0&& f, FN&&... fn)
boost::context::fixedsize_stack(2 * 1024 * 1024), boost::context::fixedsize_stack(2 * 1024 * 1024),
[&](yield_context yield) { [&](yield_context yield) {
f(yield); f(yield);
std::lock_guard const lock{m_}; std::lock_guard lock{m_};
if (--running_ == 0) if (--running_ == 0)
cv_.notify_all(); cv_.notify_all();
}, },

View File

@@ -35,10 +35,10 @@ private:
class tests_t : public detail::const_container<std::vector<test>> class tests_t : public detail::const_container<std::vector<test>>
{ {
private: private:
std::size_t failed_{0}; std::size_t failed_;
public: public:
tests_t() tests_t() : failed_(0)
{ {
} }
@@ -167,12 +167,12 @@ public:
class results : public detail::const_container<std::vector<suite_results>> class results : public detail::const_container<std::vector<suite_results>>
{ {
private: private:
std::size_t m_cases{0}; std::size_t m_cases;
std::size_t total_{0}; std::size_t total_;
std::size_t failed_{0}; std::size_t failed_;
public: public:
results() results() : m_cases(0), total_(0), failed_(0)
{ {
} }

View File

@@ -228,7 +228,7 @@ template <class>
void void
runner::testcase(std::string const& name) runner::testcase(std::string const& name)
{ {
std::lock_guard const lock(mutex_); std::lock_guard lock(mutex_);
// Name may not be empty // Name may not be empty
BOOST_ASSERT(default_ || !name.empty()); BOOST_ASSERT(default_ || !name.empty());
// Forgot to call pass or fail // Forgot to call pass or fail
@@ -244,7 +244,7 @@ template <class>
void void
runner::pass() runner::pass()
{ {
std::lock_guard const lock(mutex_); std::lock_guard lock(mutex_);
if (default_) if (default_)
testcase(""); testcase("");
on_pass(); on_pass();
@@ -255,7 +255,7 @@ template <class>
void void
runner::fail(std::string const& reason) runner::fail(std::string const& reason)
{ {
std::lock_guard const lock(mutex_); std::lock_guard lock(mutex_);
if (default_) if (default_)
testcase(""); testcase("");
on_fail(reason); on_fail(reason);
@@ -267,7 +267,7 @@ template <class>
void void
runner::log(std::string const& s) runner::log(std::string const& s)
{ {
std::lock_guard const lock(mutex_); std::lock_guard lock(mutex_);
if (default_) if (default_)
testcase(""); testcase("");
on_log(s); on_log(s);

View File

@@ -300,7 +300,7 @@ private:
static suite** static suite**
p_this_suite() p_this_suite()
{ {
static suite* pts = nullptr; // NOLINT(misc-const-correctness) static suite* pts = nullptr;
return &pts; return &pts;
} }

View File

@@ -311,7 +311,7 @@ private:
std::string const m_name; std::string const m_name;
std::recursive_mutex lock_; std::recursive_mutex lock_;
Item item_; Item item_;
Source* parent_{nullptr}; Source* parent_;
List<Item> children_; List<Item> children_;
public: public:

View File

@@ -28,7 +28,7 @@ struct Zero
namespace { namespace {
static constexpr Zero zero{}; static constexpr Zero zero{};
} // namespace }
/** Default implementation of signum calls the method on the class. */ /** Default implementation of signum calls the method on the class. */
template <typename T> template <typename T>

View File

@@ -37,7 +37,7 @@ public:
} }
private: private:
result_type s_[2]{}; result_type s_[2];
static result_type static result_type
murmurhash3(result_type x); murmurhash3(result_type x);

View File

@@ -56,7 +56,7 @@ private:
// a lock. This removes a small timing window that occurs if the // a lock. This removes a small timing window that occurs if the
// waiting thread is handling a spurious wakeup when closureCount_ // waiting thread is handling a spurious wakeup when closureCount_
// drops to zero. // drops to zero.
std::lock_guard const lock{mutex_}; std::lock_guard lock{mutex_};
// Update closureCount_. Notify if stopping and closureCount_ == 0. // Update closureCount_. Notify if stopping and closureCount_ == 0.
if ((--closureCount_ == 0) && waitForClosures_) if ((--closureCount_ == 0) && waitForClosures_)
@@ -92,9 +92,7 @@ private:
++counter_; ++counter_;
} }
Substitute( Substitute(ClosureCounter& counter, Closure&& closure)
ClosureCounter& counter,
Closure&& closure) // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
: counter_(counter), closure_(std::forward<Closure>(closure)) : counter_(counter), closure_(std::forward<Closure>(closure))
{ {
++counter_; ++counter_;
@@ -170,7 +168,7 @@ public:
{ {
std::optional<Substitute<Closure>> ret; std::optional<Substitute<Closure>> ret;
std::lock_guard const lock{mutex_}; std::lock_guard lock{mutex_};
if (!waitForClosures_) if (!waitForClosures_)
ret.emplace(*this, std::forward<Closure>(closure)); ret.emplace(*this, std::forward<Closure>(closure));
@@ -193,7 +191,7 @@ public:
bool bool
joined() const joined() const
{ {
std::lock_guard const lock{mutex_}; std::lock_guard lock{mutex_};
return waitForClosures_; return waitForClosures_;
} }
}; };

View File

@@ -7,6 +7,7 @@ JobQueue::Coro::Coro(Coro_create_t, JobQueue& jq, JobType type, std::string cons
: jq_(jq) : jq_(jq)
, type_(type) , type_(type)
, name_(name) , name_(name)
, running_(false)
, coro_( , coro_(
// Stack size of 1MB wasn't sufficient for deep calls. ASAN tests flagged the issue. Hence // Stack size of 1MB wasn't sufficient for deep calls. ASAN tests flagged the issue. Hence
// increasing the size to 1.5MB. // increasing the size to 1.5MB.

View File

@@ -16,7 +16,7 @@ namespace xrpl {
namespace perf { namespace perf {
class PerfLog; class PerfLog;
} // namespace perf }
class Logs; class Logs;
struct Coro_create_t struct Coro_create_t
@@ -45,7 +45,7 @@ public:
JobQueue& jq_; JobQueue& jq_;
JobType type_; JobType type_;
std::string name_; std::string name_;
bool running_{false}; bool running_;
std::mutex mutex_; std::mutex mutex_;
std::mutex mutex_run_; std::mutex mutex_run_;
std::condition_variable cv_; std::condition_variable cv_;
@@ -224,7 +224,7 @@ private:
beast::Journal m_journal; beast::Journal m_journal;
mutable std::mutex m_mutex; mutable std::mutex m_mutex;
std::uint64_t m_lastJob{0}; std::uint64_t m_lastJob;
std::set<Job> m_jobSet; std::set<Job> m_jobSet;
JobCounter jobCounter_; JobCounter jobCounter_;
std::atomic_bool stopping_{false}; std::atomic_bool stopping_{false};
@@ -233,7 +233,7 @@ private:
JobTypeData m_invalidJobData; JobTypeData m_invalidJobData;
// The number of jobs currently in processTask() // The number of jobs currently in processTask()
int m_processCount{0}; int m_processCount;
// The number of suspended coroutines // The number of suspended coroutines
int nSuspend_ = 0; int nSuspend_ = 0;

View File

@@ -19,13 +19,13 @@ public:
JobTypeInfo const& info; JobTypeInfo const& info;
/* The number of jobs waiting */ /* The number of jobs waiting */
int waiting{0}; int waiting;
/* The number presently running */ /* The number presently running */
int running{0}; int running;
/* And the number we deferred executing because of job limits */ /* And the number we deferred executing because of job limits */
int deferred{0}; int deferred;
/* Notification callbacks */ /* Notification callbacks */
beast::insight::Event dequeue; beast::insight::Event dequeue;
@@ -35,8 +35,12 @@ public:
JobTypeInfo const& info_, JobTypeInfo const& info_,
beast::insight::Collector::ptr const& collector, beast::insight::Collector::ptr const& collector,
Logs& logs) noexcept Logs& logs) noexcept
: m_load(logs.journal("LoadMonitor")), m_collector(collector), info(info_) : m_load(logs.journal("LoadMonitor"))
, m_collector(collector)
, info(info_)
, waiting(0)
, running(0)
, deferred(0)
{ {
m_load.setTargetLatency(info.getAverageLatency(), info.getPeakLatency()); m_load.setTargetLatency(info.getAverageLatency(), info.getPeakLatency());

View File

@@ -24,7 +24,7 @@ private:
std::chrono::milliseconds{0}) std::chrono::milliseconds{0})
{ {
using namespace std::chrono_literals; using namespace std::chrono_literals;
int const maxLimit = std::numeric_limits<int>::max(); int maxLimit = std::numeric_limits<int>::max();
auto add = [this]( auto add = [this](
JobType jt, JobType jt,

View File

@@ -36,10 +36,10 @@ public:
{ {
Stats(); Stats();
std::uint64_t count{0}; std::uint64_t count;
std::chrono::milliseconds latencyAvg; std::chrono::milliseconds latencyAvg;
std::chrono::milliseconds latencyPeak; std::chrono::milliseconds latencyPeak;
bool isOverloaded{false}; bool isOverloaded;
}; };
Stats Stats
@@ -54,8 +54,8 @@ private:
std::mutex mutex_; std::mutex mutex_;
std::uint64_t mCounts{0}; std::uint64_t mCounts;
int mLatencyEvents{0}; int mLatencyEvents;
std::chrono::milliseconds mLatencyMSAvg; std::chrono::milliseconds mLatencyMSAvg;
std::chrono::milliseconds mLatencyMSPeak; std::chrono::milliseconds mLatencyMSPeak;
std::chrono::milliseconds mTargetLatencyAvg; std::chrono::milliseconds mTargetLatencyAvg;

View File

@@ -67,7 +67,7 @@ public:
bool bool
contains(PublicKey const& nodeId) contains(PublicKey const& nodeId)
{ {
std::lock_guard const lock(this->mutex_); std::lock_guard lock(this->mutex_);
return table_.find({nodeId}) != table_.end(); return table_.find({nodeId}) != table_.end();
} }
@@ -92,7 +92,7 @@ public:
private: private:
beast::Journal mutable journal_; beast::Journal mutable journal_;
std::mutex mutable mutex_; std::mutex mutable mutex_;
DatabaseCon* connection_{}; DatabaseCon* connection_;
std::unordered_set<PeerReservation, beast::uhash<>, KeyEqual> table_; std::unordered_set<PeerReservation, beast::uhash<>, KeyEqual> table_;
}; };

View File

@@ -14,7 +14,7 @@
namespace beast { namespace beast {
class Journal; class Journal;
} // namespace beast }
namespace xrpl { namespace xrpl {
class Application; class Application;

View File

@@ -11,13 +11,13 @@ namespace xrpl {
// Forward declarations // Forward declarations
namespace NodeStore { namespace NodeStore {
class Database; class Database;
} // namespace NodeStore }
namespace Resource { namespace Resource {
class Manager; class Manager;
} // namespace Resource }
namespace perf { namespace perf {
class PerfLog; class PerfLog;
} // namespace perf }
// This is temporary until we migrate all code to use ServiceRegistry. // This is temporary until we migrate all code to use ServiceRegistry.
class Application; class Application;

View File

@@ -13,7 +13,7 @@ namespace xrpl {
namespace perf { namespace perf {
class PerfLog; class PerfLog;
} // namespace perf }
/** /**
* `Workers` is effectively a thread pool. The constructor takes a "callback" * `Workers` is effectively a thread pool. The constructor takes a "callback"
@@ -183,8 +183,8 @@ private:
std::thread thread_; std::thread thread_;
std::mutex mutex_; std::mutex mutex_;
std::condition_variable wakeup_; std::condition_variable wakeup_;
int wakeCount_{0}; // how many times to un-pause int wakeCount_; // how many times to un-pause
bool shouldExit_{false}; bool shouldExit_;
}; };
private: private:
@@ -197,9 +197,9 @@ private:
std::string m_threadNames; // The name to give each thread std::string m_threadNames; // The name to give each thread
std::condition_variable m_cv; // signaled when all threads paused std::condition_variable m_cv; // signaled when all threads paused
std::mutex m_mut; std::mutex m_mut;
bool m_allPaused{true}; bool m_allPaused;
semaphore m_semaphore; // each pending task is 1 resource semaphore m_semaphore; // each pending task is 1 resource
int m_numberOfThreads{0}; // how many we want active now int m_numberOfThreads; // how many we want active now
std::atomic<int> m_activeCount; // to know when all are paused std::atomic<int> m_activeCount; // to know when all are paused
std::atomic<int> m_pauseCount; // how many threads need to pause now std::atomic<int> m_pauseCount; // how many threads need to pause now
std::atomic<int> m_runningTaskCount; // how many calls to processTask() active std::atomic<int> m_runningTaskCount; // how many calls to processTask() active

View File

@@ -55,7 +55,7 @@ public:
void void
notify() notify()
{ {
std::lock_guard const lock{m_mutex}; std::lock_guard lock{m_mutex};
++m_count; ++m_count;
m_cond.notify_one(); m_cond.notify_one();
} }

View File

@@ -103,9 +103,9 @@ private:
public: public:
explicit ErrorInfo() = default; explicit ErrorInfo() = default;
Token token_{}; Token token_;
std::string message_; std::string message_;
Location extra_{}; Location extra_;
}; };
using Errors = std::deque<ErrorInfo>; using Errors = std::deque<ErrorInfo>;
@@ -173,11 +173,11 @@ private:
Nodes nodes_; Nodes nodes_;
Errors errors_; Errors errors_;
std::string document_; std::string document_;
Location begin_{}; Location begin_;
Location end_{}; Location end_;
Location current_{}; Location current_;
Location lastValueEnd_{}; Location lastValueEnd_;
Value* lastValue_{}; Value* lastValue_;
}; };
template <class BufferSequence> template <class BufferSequence>

View File

@@ -641,7 +641,7 @@ public:
SelfType SelfType
operator++(int) operator++(int)
{ {
SelfType const temp(*this); SelfType temp(*this);
++*this; ++*this;
return temp; return temp;
} }
@@ -649,7 +649,7 @@ public:
SelfType SelfType
operator--(int) operator--(int)
{ {
SelfType const temp(*this); SelfType temp(*this);
--*this; --*this;
return temp; return temp;
} }

View File

@@ -106,8 +106,8 @@ private:
ChildValues childValues_; ChildValues childValues_;
std::string document_; std::string document_;
std::string indentString_; std::string indentString_;
int rightMargin_{74}; int rightMargin_;
int indentSize_{3}; int indentSize_;
bool addChildValues_{}; bool addChildValues_{};
}; };
@@ -171,9 +171,9 @@ private:
using ChildValues = std::vector<std::string>; using ChildValues = std::vector<std::string>;
ChildValues childValues_; ChildValues childValues_;
std::ostream* document_{nullptr}; std::ostream* document_;
std::string indentString_; std::string indentString_;
int rightMargin_{74}; int rightMargin_;
std::string indentation_; std::string indentation_;
bool addChildValues_{}; bool addChildValues_{};
}; };

View File

@@ -143,7 +143,7 @@ public:
// Inject appropriate pseudo-transactions // Inject appropriate pseudo-transactions
for (auto const& it : actions) for (auto const& it : actions)
{ {
STTx const amendTx(ttAMENDMENT, [&it, seq = lastClosedLedger->seq() + 1](auto& obj) { STTx amendTx(ttAMENDMENT, [&it, seq = lastClosedLedger->seq() + 1](auto& obj) {
obj.setAccountID(sfAccount, AccountID()); obj.setAccountID(sfAccount, AccountID());
obj.setFieldH256(sfAmendment, it.first); obj.setFieldH256(sfAmendment, it.first);
obj.setFieldU32(sfLedgerSequence, seq); obj.setFieldU32(sfLedgerSequence, seq);

View File

@@ -6,4 +6,4 @@
namespace xrpl { namespace xrpl {
using CachedSLEs = TaggedCache<uint256, SLE const>; using CachedSLEs = TaggedCache<uint256, SLE const>;
} // namespace xrpl }

View File

@@ -31,7 +31,7 @@ public:
bool bool
startWork(LedgerIndex seq) startWork(LedgerIndex seq)
{ {
std::lock_guard const lock(mutex_); std::lock_guard lock(mutex_);
auto it = map_.find(seq); auto it = map_.find(seq);
@@ -54,7 +54,7 @@ public:
void void
finishWork(LedgerIndex seq) finishWork(LedgerIndex seq)
{ {
std::lock_guard const lock(mutex_); std::lock_guard lock(mutex_);
map_.erase(seq); map_.erase(seq);
await_.notify_all(); await_.notify_all();
@@ -64,7 +64,7 @@ public:
bool bool
pending(LedgerIndex seq) pending(LedgerIndex seq)
{ {
std::lock_guard const lock(mutex_); std::lock_guard lock(mutex_);
return map_.find(seq) != map_.end(); return map_.find(seq) != map_.end();
} }
@@ -117,7 +117,7 @@ public:
std::map<LedgerIndex, bool> std::map<LedgerIndex, bool>
getSnapshot() const getSnapshot() const
{ {
std::lock_guard const lock(mutex_); std::lock_guard lock(mutex_);
return map_; return map_;
} }

View File

@@ -157,11 +157,4 @@ rippleUnlockEscrowMPT(
STAmount const& grossAmount, STAmount const& grossAmount,
beast::Journal j); beast::Journal j);
TER
createMPToken(
ApplyView& view,
MPTID const& mptIssuanceID,
AccountID const& account,
std::uint32_t const flags);
} // namespace xrpl } // namespace xrpl

View File

@@ -16,7 +16,7 @@ struct FetchReport
{ {
} }
std::chrono::milliseconds elapsed{}; std::chrono::milliseconds elapsed;
FetchType const fetchType; FetchType const fetchType;
bool wasFound = false; bool wasFound = false;
}; };

View File

@@ -71,8 +71,8 @@ private:
Scheduler& m_scheduler; Scheduler& m_scheduler;
LockType mWriteMutex; LockType mWriteMutex;
CondvarType mWriteCondition; CondvarType mWriteCondition;
int mWriteLoad{0}; int mWriteLoad;
bool mWritePending{false}; bool mWritePending;
Batch mWriteSet; Batch mWriteSet;
}; };

View File

@@ -35,7 +35,7 @@ namespace NodeStore {
class EncodedBlob class EncodedBlob
{ {
/** The 32-byte key of the serialized object. */ /** The 32-byte key of the serialized object. */
std::array<std::uint8_t, 32> key_{}; std::array<std::uint8_t, 32> key_;
/** A pre-allocated buffer for the serialized object. /** A pre-allocated buffer for the serialized object.
@@ -43,8 +43,7 @@ class EncodedBlob
1024 more bytes. The precise size is calculated automatically 1024 more bytes. The precise size is calculated automatically
at compile time so as to avoid wasting space on padding bytes. at compile time so as to avoid wasting space on padding bytes.
*/ */
std::array<std::uint8_t, boost::alignment::align_up(9 + 1024, alignof(std::uint32_t))> std::array<std::uint8_t, boost::alignment::align_up(9 + 1024, alignof(std::uint32_t))> payload_;
payload_{};
/** The size of the serialized data. */ /** The size of the serialized data. */
std::uint32_t size_; std::uint32_t size_;

View File

@@ -56,7 +56,7 @@ lz4_compress(void const* in, std::size_t in_size, BufferFactory&& bf)
using std::runtime_error; using std::runtime_error;
using namespace nudb::detail; using namespace nudb::detail;
std::pair<void const*, std::size_t> result; std::pair<void const*, std::size_t> result;
std::array<std::uint8_t, varint_traits<std::size_t>::max> vi{}; std::array<std::uint8_t, varint_traits<std::size_t>::max> vi;
auto const n = write_varint(vi.data(), in_size); auto const n = write_varint(vi.data(), in_size);
auto const out_max = LZ4_compressBound(in_size); auto const out_max = LZ4_compressBound(in_size);
std::uint8_t* out = reinterpret_cast<std::uint8_t*>(bf(n + out_max)); std::uint8_t* out = reinterpret_cast<std::uint8_t*>(bf(n + out_max));
@@ -88,7 +88,7 @@ nodeobject_decompress(void const* in, std::size_t in_size, BufferFactory&& bf)
using namespace nudb::detail; using namespace nudb::detail;
std::uint8_t const* p = reinterpret_cast<std::uint8_t const*>(in); std::uint8_t const* p = reinterpret_cast<std::uint8_t const*>(in);
std::size_t type = 0; std::size_t type;
auto const vn = read_varint(p, in_size, type); auto const vn = read_varint(p, in_size, type);
if (vn == 0) if (vn == 0)
Throw<std::runtime_error>("nodeobject decompress"); Throw<std::runtime_error>("nodeobject decompress");
@@ -117,7 +117,7 @@ nodeobject_decompress(void const* in, std::size_t in_size, BufferFactory&& bf)
"nodeobject codec v1: short inner node size: " + std::string("in_size = ") + "nodeobject codec v1: short inner node size: " + std::string("in_size = ") +
std::to_string(in_size) + " hs = " + std::to_string(hs)); std::to_string(in_size) + " hs = " + std::to_string(hs));
istream is(p, in_size); istream is(p, in_size);
std::uint16_t mask = 0; std::uint16_t mask;
read<std::uint16_t>(is, mask); // Mask read<std::uint16_t>(is, mask); // Mask
in_size -= hs; in_size -= hs;
result.second = 525; result.second = 525;
@@ -196,10 +196,10 @@ nodeobject_compress(void const* in, std::size_t in_size, BufferFactory&& bf)
if (in_size == 525) if (in_size == 525)
{ {
istream is(in, in_size); istream is(in, in_size);
std::uint32_t index = 0; std::uint32_t index;
std::uint32_t unused = 0; std::uint32_t unused;
std::uint8_t kind = 0; std::uint8_t kind;
std::uint32_t prefix = 0; std::uint32_t prefix;
read<std::uint32_t>(is, index); read<std::uint32_t>(is, index);
read<std::uint32_t>(is, unused); read<std::uint32_t>(is, unused);
read<std::uint8_t>(is, kind); read<std::uint8_t>(is, kind);
@@ -208,7 +208,7 @@ nodeobject_compress(void const* in, std::size_t in_size, BufferFactory&& bf)
{ {
std::size_t n = 0; std::size_t n = 0;
std::uint16_t mask = 0; std::uint16_t mask = 0;
std::array<std::uint8_t, 512> vh{}; std::array<std::uint8_t, 512> vh;
for (unsigned bit = 0x8000; bit; bit >>= 1) for (unsigned bit = 0x8000; bit; bit >>= 1)
{ {
void const* const h = is(32); void const* const h = is(32);
@@ -247,7 +247,7 @@ nodeobject_compress(void const* in, std::size_t in_size, BufferFactory&& bf)
} }
} }
std::array<std::uint8_t, varint_traits<std::size_t>::max> vi{}; std::array<std::uint8_t, varint_traits<std::size_t>::max> vi;
constexpr std::size_t codecType = 1; constexpr std::size_t codecType = 1;
auto const vn = write_varint(vi.data(), codecType); auto const vn = write_varint(vi.data(), codecType);
@@ -257,7 +257,7 @@ nodeobject_compress(void const* in, std::size_t in_size, BufferFactory&& bf)
// case 0 was uncompressed data; we always compress now. // case 0 was uncompressed data; we always compress now.
case 1: // lz4 case 1: // lz4
{ {
std::uint8_t* p = nullptr; std::uint8_t* p;
auto const lzr = NodeStore::lz4_compress(in, in_size, [&p, &vn, &bf](std::size_t n) { auto const lzr = NodeStore::lz4_compress(in, in_size, [&p, &vn, &bf](std::size_t n) {
p = reinterpret_cast<std::uint8_t*>(bf(vn + n)); p = reinterpret_cast<std::uint8_t*>(bf(vn + n));
return p + vn; return p + vn;
@@ -287,10 +287,10 @@ filter_inner(void* in, std::size_t in_size)
if (in_size == 525) if (in_size == 525)
{ {
istream is(in, in_size); istream is(in, in_size);
std::uint32_t index = 0; std::uint32_t index;
std::uint32_t unused = 0; std::uint32_t unused;
std::uint8_t kind = 0; std::uint8_t kind;
std::uint32_t prefix = 0; std::uint32_t prefix;
read<std::uint32_t>(is, index); read<std::uint32_t>(is, index);
read<std::uint32_t>(is, unused); read<std::uint32_t>(is, unused);
read<std::uint8_t>(is, kind); read<std::uint8_t>(is, kind);

View File

@@ -82,7 +82,6 @@ template <class = void>
std::size_t std::size_t
write_varint(void* p0, std::size_t v) write_varint(void* p0, std::size_t v)
{ {
// NOLINTNEXTLINE(misc-const-correctness)
std::uint8_t* p = reinterpret_cast<std::uint8_t*>(p0); std::uint8_t* p = reinterpret_cast<std::uint8_t*>(p0);
do do
{ {

View File

@@ -102,7 +102,7 @@ template <typename T>
T T
toAmount(Issue const& issue, Number const& n, Number::rounding_mode mode = Number::getround()) toAmount(Issue const& issue, Number const& n, Number::rounding_mode mode = Number::getround())
{ {
saveNumberRoundMode const rm(Number::getround()); saveNumberRoundMode rm(Number::getround());
if (isXRP(issue)) if (isXRP(issue))
Number::setround(mode); Number::setround(mode);

View File

@@ -26,8 +26,8 @@ class IOUAmount : private boost::totally_ordered<IOUAmount>, private boost::addi
private: private:
using mantissa_type = std::int64_t; using mantissa_type = std::int64_t;
using exponent_type = int; using exponent_type = int;
mantissa_type mantissa_{}; mantissa_type mantissa_;
exponent_type exponent_{}; exponent_type exponent_;
/** Adjusts the mantissa and exponent to the proper range. /** Adjusts the mantissa and exponent to the proper range.

View File

@@ -363,12 +363,11 @@ uint256
getTicketIndex(AccountID const& account, SeqProxy ticketSeq); getTicketIndex(AccountID const& account, SeqProxy ticketSeq);
template <class... keyletParams> template <class... keyletParams>
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
struct keyletDesc struct keyletDesc
{ {
std::function<Keylet(keyletParams...)> function; std::function<Keylet(keyletParams...)> function;
Json::StaticString expectedLEName; Json::StaticString expectedLEName;
bool includeInTests{}; bool includeInTests;
}; };
// This list should include all of the keylet functions that take a single // This list should include all of the keylet functions that take a single

View File

@@ -96,7 +96,7 @@ operator<=>(Issue const& lhs, Issue const& rhs)
inline Issue const& inline Issue const&
xrpIssue() xrpIssue()
{ {
static Issue const issue{xrpCurrency(), xrpAccount()}; static Issue issue{xrpCurrency(), xrpAccount()};
return issue; return issue;
} }
@@ -104,7 +104,7 @@ xrpIssue()
inline Issue const& inline Issue const&
noIssue() noIssue()
{ {
static Issue const issue{noCurrency(), noAccount()}; static Issue issue{noCurrency(), noAccount()};
return issue; return issue;
} }

View File

@@ -56,8 +56,8 @@ struct TAmounts
return *this; return *this;
} }
In in{}; In in;
Out out{}; Out out;
}; };
using Amounts = TAmounts<STAmount, STAmount>; using Amounts = TAmounts<STAmount, STAmount>;
@@ -304,8 +304,8 @@ Quality::ceil_TAmounts_helper(
// Use the existing STAmount implementation for now, but consider // Use the existing STAmount implementation for now, but consider
// replacing with code specific to IOUAMount and XRPAmount // replacing with code specific to IOUAMount and XRPAmount
Amounts const stAmt(toSTAmount(amount.in), toSTAmount(amount.out)); Amounts stAmt(toSTAmount(amount.in), toSTAmount(amount.out));
STAmount const stLim(toSTAmount(limit)); STAmount stLim(toSTAmount(limit));
Amounts const stRes = ((*this).*ceil_function)(stAmt, stLim, roundUp...); Amounts const stRes = ((*this).*ceil_function)(stAmt, stLim, roundUp...);
return TAmounts<In, Out>(toAmount<In>(stRes.in), toAmount<Out>(stRes.out)); return TAmounts<In, Out>(toAmount<In>(stRes.in), toAmount<Out>(stRes.out));
} }

View File

@@ -6,4 +6,4 @@ namespace xrpl {
using LedgerHash = uint256; using LedgerHash = uint256;
} // namespace xrpl }

View File

@@ -35,9 +35,9 @@ public:
private: private:
Asset mAsset; Asset mAsset;
mantissa_type mValue{}; mantissa_type mValue;
exponent_type mOffset; exponent_type mOffset;
bool mIsNegative{}; bool mIsNegative;
public: public:
using value_type = STAmount; using value_type = STAmount;
@@ -532,7 +532,7 @@ STAmount::fromNumber(A const& a, Number const& number)
{ {
bool const negative = number.mantissa() < 0; bool const negative = number.mantissa() < 0;
Number const working{negative ? -number : number}; Number const working{negative ? -number : number};
Asset const asset{a}; Asset asset{a};
if (asset.integral()) if (asset.integral())
{ {
std::uint64_t const intValue = static_cast<std::int64_t>(working); std::uint64_t const intValue = static_cast<std::int64_t>(working);
@@ -716,7 +716,7 @@ roundToAsset(
std::int32_t scale, std::int32_t scale,
Number::rounding_mode rounding = Number::getround()) Number::rounding_mode rounding = Number::getround())
{ {
NumberRoundModeGuard const mg(rounding); NumberRoundModeGuard mg(rounding);
STAmount const ret{asset, value}; STAmount const ret{asset, value};
if (ret.integral()) if (ret.integral())
return ret; return ret;

View File

@@ -83,7 +83,7 @@ to_json(T const& t)
namespace detail { namespace detail {
class STVar; class STVar;
} // namespace detail }
// VFALCO TODO fix this restriction on copy assignment. // VFALCO TODO fix this restriction on copy assignment.
// //

View File

@@ -8,7 +8,7 @@ namespace xrpl {
class Rules; class Rules;
namespace test { namespace test {
class Invariants_test; class Invariants_test;
} // namespace test }
class STLedgerEntry final : public STObject, public CountedObject<STLedgerEntry> class STLedgerEntry final : public STObject, public CountedObject<STLedgerEntry>
{ {
@@ -86,9 +86,7 @@ inline STLedgerEntry::STLedgerEntry(LedgerEntryType type, uint256 const& key)
{ {
} }
inline STLedgerEntry::STLedgerEntry( inline STLedgerEntry::STLedgerEntry(SerialIter&& sit, uint256 const& index)
SerialIter&& sit, // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
uint256 const& index)
: STLedgerEntry(sit, index) : STLedgerEntry(sit, index)
{ {
} }

View File

@@ -671,7 +671,7 @@ public:
OptionalProxy& OptionalProxy&
operator=(std::nullopt_t const&); operator=(std::nullopt_t const&);
OptionalProxy& OptionalProxy&
operator=(optional_type&& v); // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved) operator=(optional_type&& v);
OptionalProxy& OptionalProxy&
operator=(optional_type const& v); operator=(optional_type const& v);
@@ -766,7 +766,7 @@ STObject::Proxy<T>::assign(U&& u)
st_->makeFieldAbsent(*f_); st_->makeFieldAbsent(*f_);
return; return;
} }
T* t = nullptr; T* t;
if (style_ == soeINVALID) if (style_ == soeINVALID)
t = dynamic_cast<T*>(st_->getPField(*f_, true)); t = dynamic_cast<T*>(st_->getPField(*f_, true));
else else
@@ -851,9 +851,7 @@ STObject::OptionalProxy<T>::operator=(std::nullopt_t const&) -> OptionalProxy&
template <class T> template <class T>
auto auto
STObject::OptionalProxy<T>::operator=( STObject::OptionalProxy<T>::operator=(optional_type&& v) -> OptionalProxy&
optional_type&& v) // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
-> OptionalProxy&
{ {
if (v) if (v)
this->assign(std::move(*v)); this->assign(std::move(*v));
@@ -932,7 +930,6 @@ STObject::Transform::operator()(detail::STVar const& e) const
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
inline STObject::STObject(SerialIter&& sit, SField const& name) : STObject(sit, name) inline STObject::STObject(SerialIter&& sit, SField const& name) : STObject(sit, name)
{ {
} }
@@ -1156,7 +1153,7 @@ STObject::getFieldByValue(SField const& field) const
if (!rf) if (!rf)
throwFieldNotFound(field); throwFieldNotFound(field);
SerializedTypeID const id = rf->getSType(); SerializedTypeID id = rf->getSType();
if (id == STI_NOTPRESENT) if (id == STI_NOTPRESENT)
return V(); // optional field not present return V(); // optional field not present
@@ -1183,7 +1180,7 @@ STObject::getFieldByConstRef(SField const& field, V const& empty) const
if (!rf) if (!rf)
throwFieldNotFound(field); throwFieldNotFound(field);
SerializedTypeID const id = rf->getSType(); SerializedTypeID id = rf->getSType();
if (id == STI_NOTPRESENT) if (id == STI_NOTPRESENT)
return empty; // optional field not present return empty; // optional field not present

View File

@@ -179,8 +179,7 @@ sterilize(STTx const& stx);
bool bool
isPseudoTx(STObject const& tx); isPseudoTx(STObject const& tx);
inline STTx::STTx(SerialIter&& sit) // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved) inline STTx::STTx(SerialIter&& sit) : STTx(sit)
: STTx(sit)
{ {
} }

View File

@@ -69,7 +69,7 @@ public:
int int
add32(T i) add32(T i)
{ {
int const ret = mData.size(); int ret = mData.size();
mData.push_back(static_cast<unsigned char>((i >> 24) & 0xff)); mData.push_back(static_cast<unsigned char>((i >> 24) & 0xff));
mData.push_back(static_cast<unsigned char>((i >> 16) & 0xff)); mData.push_back(static_cast<unsigned char>((i >> 16) & 0xff));
mData.push_back(static_cast<unsigned char>((i >> 8) & 0xff)); mData.push_back(static_cast<unsigned char>((i >> 8) & 0xff));
@@ -85,7 +85,7 @@ public:
int int
add64(T i) add64(T i)
{ {
int const ret = mData.size(); int ret = mData.size();
mData.push_back(static_cast<unsigned char>((i >> 56) & 0xff)); mData.push_back(static_cast<unsigned char>((i >> 56) & 0xff));
mData.push_back(static_cast<unsigned char>((i >> 48) & 0xff)); mData.push_back(static_cast<unsigned char>((i >> 48) & 0xff));
mData.push_back(static_cast<unsigned char>((i >> 40) & 0xff)); mData.push_back(static_cast<unsigned char>((i >> 40) & 0xff));
@@ -299,7 +299,7 @@ template <class Iter>
int int
Serializer::addVL(Iter begin, Iter end, int len) Serializer::addVL(Iter begin, Iter end, int len)
{ {
int const ret = addEncoded(len); int ret = addEncoded(len);
for (; begin != end; ++begin) for (; begin != end; ++begin)
{ {
addRaw(begin->data(), begin->size()); addRaw(begin->data(), begin->size());

View File

@@ -4,4 +4,4 @@ namespace xrpl {
enum class TxSearched { All, Some, Unknown }; enum class TxSearched { All, Some, Unknown };
} // namespace xrpl }

View File

@@ -25,10 +25,16 @@ extern nonPresentObject_t nonPresentObject;
// Concept to constrain STVar constructors, which // Concept to constrain STVar constructors, which
// instantiate ST* types from SerializedTypeID // instantiate ST* types from SerializedTypeID
// clang-format off
template <typename... Args> template <typename... Args>
concept ValidConstructSTArgs = concept ValidConstructSTArgs =
(std::is_same_v<std::tuple<std::remove_cvref_t<Args>...>, std::tuple<SField>> || (std::is_same_v<
std::is_same_v<std::tuple<std::remove_cvref_t<Args>...>, std::tuple<SerialIter, SField>>); std::tuple<std::remove_cvref_t<Args>...>,
std::tuple<SField>> ||
std::is_same_v<
std::tuple<std::remove_cvref_t<Args>...>,
std::tuple<SerialIter, SField>>);
// clang-format on
// "variant" that can hold any type of serialized object // "variant" that can hold any type of serialized object
// and includes a small-object allocation optimization. // and includes a small-object allocation optimization.
@@ -50,7 +56,7 @@ public:
STVar& STVar&
operator=(STVar&& rhs); operator=(STVar&& rhs);
STVar(STBase&& t) // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved) STVar(STBase&& t)
{ {
p_ = t.move(max_size, &d_); p_ = t.move(max_size, &d_);
} }

View File

@@ -59,7 +59,7 @@ inplace_bigint_add(std::span<std::uint64_t> a, std::uint64_t b)
return TokenCodecErrc::inputTooSmall; return TokenCodecErrc::inputTooSmall;
} }
std::uint64_t carry = 0; std::uint64_t carry;
std::tie(a[0], carry) = carrying_add(a[0], b); std::tie(a[0], carry) = carrying_add(a[0], b);
for (auto& v : a.subspan(1)) for (auto& v : a.subspan(1))
@@ -162,7 +162,7 @@ b58_10_to_b58_be(std::uint64_t input)
int i = 0; int i = 0;
while (input > 0) while (input > 0)
{ {
std::uint64_t rem = 0; std::uint64_t rem;
std::tie(input, rem) = div_rem(input, 58); std::tie(input, rem) = div_rem(input, 58);
result[resultSize - 1 - i] = rem; result[resultSize - 1 - i] = rem;
i += 1; i += 1;

View File

@@ -11,65 +11,66 @@
#error "undefined macro: XRPL_RETIRE_FIX" #error "undefined macro: XRPL_RETIRE_FIX"
#endif #endif
// clang-format off
// Add new amendments to the top of this list. // Add new amendments to the top of this list.
// Keep it sorted in reverse chronological order. // Keep it sorted in reverse chronological order.
XRPL_FIX (Security3_1_3, Supported::no, VoteBehavior::DefaultNo) XRPL_FIX (Security3_1_3, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (PermissionedDomainInvariant, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (PermissionedDomainInvariant, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (ExpiredNFTokenOfferRemoval, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (ExpiredNFTokenOfferRemoval, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (BatchInnerSigs, Supported::no, VoteBehavior::DefaultNo) XRPL_FIX (BatchInnerSigs, Supported::no, VoteBehavior::DefaultNo)
XRPL_FEATURE(LendingProtocol, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(LendingProtocol, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(PermissionDelegationV1_1, Supported::no, VoteBehavior::DefaultNo) XRPL_FEATURE(PermissionDelegationV1_1, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (DirectoryLimit, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (DirectoryLimit, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (IncludeKeyletFields, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (IncludeKeyletFields, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(DynamicMPT, Supported::no, VoteBehavior::DefaultNo) XRPL_FEATURE(DynamicMPT, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (TokenEscrowV1, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (TokenEscrowV1, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (PriceOracleOrder, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (PriceOracleOrder, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (MPTDeliveredAmount, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (MPTDeliveredAmount, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (AMMClawbackRounding, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (AMMClawbackRounding, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(TokenEscrow, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(TokenEscrow, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (EnforceNFTokenTrustlineV2, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (EnforceNFTokenTrustlineV2, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (AMMv1_3, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (AMMv1_3, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(PermissionedDEX, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(PermissionedDEX, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(Batch, Supported::no, VoteBehavior::DefaultNo) XRPL_FEATURE(Batch, Supported::no, VoteBehavior::DefaultNo)
XRPL_FEATURE(SingleAssetVault, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(SingleAssetVault, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (PayChanCancelAfter, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (PayChanCancelAfter, Supported::yes, VoteBehavior::DefaultNo)
// Check flags in Credential transactions // Check flags in Credential transactions
XRPL_FIX (InvalidTxFlags, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (InvalidTxFlags, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (FrozenLPTokenTransfer, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (FrozenLPTokenTransfer, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(DeepFreeze, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(DeepFreeze, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(PermissionedDomains, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(PermissionedDomains, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(DynamicNFT, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(DynamicNFT, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(Credentials, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(Credentials, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(AMMClawback, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(AMMClawback, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (AMMv1_2, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (AMMv1_2, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(MPTokensV1, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(MPTokensV1, Supported::yes, VoteBehavior::DefaultNo)
// InvariantsV1_1 will be changed to Supported::yes when all the invariants expected to be included // InvariantsV1_1 will be changes to Supported::yes when all the
// under it are complete. // invariants expected to be included under it are complete.
XRPL_FEATURE(InvariantsV1_1, Supported::no, VoteBehavior::DefaultNo) XRPL_FEATURE(InvariantsV1_1, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (NFTokenPageLinks, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (NFTokenPageLinks, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (InnerObjTemplate2, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (InnerObjTemplate2, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (EnforceNFTokenTrustline, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (EnforceNFTokenTrustline, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (ReducedOffersV2, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (ReducedOffersV2, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(NFTokenMintOffer, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(NFTokenMintOffer, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (AMMv1_1, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (AMMv1_1, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (PreviousTxnID, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (PreviousTxnID, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (XChainRewardRounding, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (XChainRewardRounding, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (EmptyDID, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (EmptyDID, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(PriceOracle, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(PriceOracle, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (AMMOverflowOffer, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (AMMOverflowOffer, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (InnerObjTemplate, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (InnerObjTemplate, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (NFTokenReserve, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (NFTokenReserve, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (FillOrKill, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (FillOrKill, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(DID, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(DID, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (DisallowIncomingV1, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (DisallowIncomingV1, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(XChainBridge, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(XChainBridge, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(AMM, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(AMM, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(Clawback, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(Clawback, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (UniversalNumber, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(XRPFees, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (RemoveNFTokenAutoTrustLine, Supported::yes, VoteBehavior::DefaultYes)
// The following amendments are obsolete, but must remain supported // The following amendments are obsolete, but must remain supported
// because they could potentially get enabled. // because they could potentially get enabled.
@@ -143,3 +144,5 @@ XRPL_RETIRE_FEATURE(SortedDirectories)
XRPL_RETIRE_FEATURE(TicketBatch) XRPL_RETIRE_FEATURE(TicketBatch)
XRPL_RETIRE_FEATURE(TickSize) XRPL_RETIRE_FEATURE(TickSize)
XRPL_RETIRE_FEATURE(TrustSetAuth) XRPL_RETIRE_FEATURE(TrustSetAuth)
// clang-format on

View File

@@ -5,6 +5,7 @@
#error "undefined macro: TYPED_SFIELD" #error "undefined macro: TYPED_SFIELD"
#endif #endif
// clang-format off
// untyped // untyped
UNTYPED_SFIELD(sfLedgerEntry, LEDGERENTRY, 257) UNTYPED_SFIELD(sfLedgerEntry, LEDGERENTRY, 257)
@@ -420,3 +421,5 @@ UNTYPED_SFIELD(sfAcceptedCredentials, ARRAY, 28)
UNTYPED_SFIELD(sfPermissions, ARRAY, 29) UNTYPED_SFIELD(sfPermissions, ARRAY, 29)
UNTYPED_SFIELD(sfRawTransactions, ARRAY, 30) UNTYPED_SFIELD(sfRawTransactions, ARRAY, 30)
UNTYPED_SFIELD(sfBatchSigners, ARRAY, 31, SField::sMD_Default, SField::notSigning) UNTYPED_SFIELD(sfBatchSigners, ARRAY, 31, SField::sMD_Default, SField::notSigning)
// clang-format on

View File

@@ -15,7 +15,7 @@ enum class TokenCodecErrc {
overflowAdd, overflowAdd,
unknown, unknown,
}; };
} // namespace xrpl }
namespace std { namespace std {
template <> template <>
@@ -69,7 +69,7 @@ public:
inline xrpl::detail::TokenCodecErrcCategory const& inline xrpl::detail::TokenCodecErrcCategory const&
TokenCodecErrcCategory() TokenCodecErrcCategory()
{ {
static xrpl::detail::TokenCodecErrcCategory const c; static xrpl::detail::TokenCodecErrcCategory c;
return c; return c;
} }

View File

@@ -112,7 +112,7 @@ getOrThrow(Json::Value const& v, xrpl::SField const& field)
{ {
auto const s = inner.asString(); auto const s = inner.asString();
// parse as hex // parse as hex
std::uint64_t val = 0; std::uint64_t val;
auto [p, ec] = std::from_chars(s.data(), s.data() + s.size(), val, 16); auto [p, ec] = std::from_chars(s.data(), s.data() + s.size(), val, 16);

File diff suppressed because it is too large Load Diff

View File

@@ -39,7 +39,7 @@ constexpr std::uint16_t const flagMutable = 0x0010;
inline std::uint16_t inline std::uint16_t
getFlags(uint256 const& id) getFlags(uint256 const& id)
{ {
std::uint16_t flags = 0; std::uint16_t flags;
memcpy(&flags, id.begin(), 2); memcpy(&flags, id.begin(), 2);
return boost::endian::big_to_native(flags); return boost::endian::big_to_native(flags);
} }
@@ -47,7 +47,7 @@ getFlags(uint256 const& id)
inline std::uint16_t inline std::uint16_t
getTransferFee(uint256 const& id) getTransferFee(uint256 const& id)
{ {
std::uint16_t fee = 0; std::uint16_t fee;
memcpy(&fee, id.begin() + 2, 2); memcpy(&fee, id.begin() + 2, 2);
return boost::endian::big_to_native(fee); return boost::endian::big_to_native(fee);
} }
@@ -55,7 +55,7 @@ getTransferFee(uint256 const& id)
inline std::uint32_t inline std::uint32_t
getSerial(uint256 const& id) getSerial(uint256 const& id)
{ {
std::uint32_t seq = 0; std::uint32_t seq;
memcpy(&seq, id.begin() + 28, 4); memcpy(&seq, id.begin() + 28, 4);
return boost::endian::big_to_native(seq); return boost::endian::big_to_native(seq);
} }
@@ -87,7 +87,7 @@ cipheredTaxon(std::uint32_t tokenSeq, Taxon taxon)
inline Taxon inline Taxon
getTaxon(uint256 const& id) getTaxon(uint256 const& id)
{ {
std::uint32_t taxon = 0; std::uint32_t taxon;
memcpy(&taxon, id.begin() + 24, 4); memcpy(&taxon, id.begin() + 24, 4);
taxon = boost::endian::big_to_native(taxon); taxon = boost::endian::big_to_native(taxon);

View File

@@ -1,3 +0,0 @@
# This disables all checks for this directory and its subdirectories
Checks: "-*"
InheritParentConfig: false

View File

@@ -14,7 +14,7 @@
namespace soci { namespace soci {
class session; class session;
} // namespace soci }
namespace xrpl { namespace xrpl {

View File

@@ -51,19 +51,19 @@ public:
AccountID const& account; AccountID const& account;
/// Ledger sequence range to search. A value of 0 for min or max /// Ledger sequence range to search. A value of 0 for min or max
/// means unbounded in that direction (no constraint applied). /// means unbounded in that direction (no constraint applied).
LedgerRange ledgerRange{}; LedgerRange ledgerRange;
std::uint32_t offset = 0; std::uint32_t offset;
std::uint32_t limit = 0; std::uint32_t limit;
bool bUnlimited{}; bool bUnlimited;
}; };
struct AccountTxPageOptions struct AccountTxPageOptions
{ {
AccountID const& account; AccountID const& account;
LedgerRange ledgerRange{}; LedgerRange ledgerRange;
std::optional<AccountTxMarker> marker; std::optional<AccountTxMarker> marker;
std::uint32_t limit = 0; std::uint32_t limit;
bool bAdmin = false; bool bAdmin;
}; };
using AccountTx = std::pair<std::shared_ptr<Transaction>, std::shared_ptr<TxMeta>>; using AccountTx = std::pair<std::shared_ptr<Transaction>, std::shared_ptr<TxMeta>>;
@@ -88,8 +88,8 @@ public:
struct AccountTxResult struct AccountTxResult
{ {
std::variant<AccountTxs, MetaTxsList> transactions; std::variant<AccountTxs, MetaTxsList> transactions;
LedgerRange ledgerRange{}; LedgerRange ledgerRange;
uint32_t limit = 0; uint32_t limit;
std::optional<AccountTxMarker> marker; std::optional<AccountTxMarker> marker;
}; };

View File

@@ -25,7 +25,7 @@
namespace sqlite_api { namespace sqlite_api {
struct sqlite3; struct sqlite3;
} // namespace sqlite_api }
namespace xrpl { namespace xrpl {

View File

@@ -5,30 +5,38 @@
namespace xrpl { namespace xrpl {
namespace Resource { namespace Resource {
// clang-format off
/** Schedule of fees charged for imposing load on the server. */ /** Schedule of fees charged for imposing load on the server. */
/** @{ */ /** @{ */
extern Charge const feeMalformedRequest; // A request that we can immediately tell is invalid. extern Charge const feeMalformedRequest; // A request that we can immediately
extern Charge const feeRequestNoReply; // A request that we cannot satisfy. // tell is invalid
extern Charge const feeInvalidSignature; // An object whose signature we had to check that failed. extern Charge const feeRequestNoReply; // A request that we cannot satisfy
extern Charge const feeUselessData; // Data we have no use for. extern Charge const feeInvalidSignature; // An object whose signature we had
extern Charge const feeInvalidData; // Data we have to verify before rejecting. // to check and it failed
extern Charge const feeUselessData; // Data we have no use for
extern Charge const feeInvalidData; // Data we have to verify before
// rejecting
// RPC loads // RPC loads
extern Charge const feeMalformedRPC; // An RPC request that we can immediately tell is invalid. extern Charge const feeMalformedRPC; // An RPC request that we can
extern Charge const feeReferenceRPC; // A default "reference" unspecified load. // immediately tell is invalid.
extern Charge const feeExceptionRPC; // RPC load that causes an exception. extern Charge const feeReferenceRPC; // A default "reference" unspecified
extern Charge const feeMediumBurdenRPC; // A somewhat burdensome RPC load. // load
extern Charge const feeHeavyBurdenRPC; // A very burdensome RPC load. extern Charge const feeExceptionRPC; // RPC load that causes an exception
extern Charge const feeMediumBurdenRPC; // A somewhat burdensome RPC load
extern Charge const feeHeavyBurdenRPC; // A very burdensome RPC load
// Peer loads // Peer loads
extern Charge const feeTrivialPeer; // Requires no reply. extern Charge const feeTrivialPeer; // Requires no reply
extern Charge const feeModerateBurdenPeer; // Requires some work. extern Charge const feeModerateBurdenPeer; // Requires some work
extern Charge const feeHeavyBurdenPeer; // Extensive work. extern Charge const feeHeavyBurdenPeer; // Extensive work
// Administrative // Administrative
extern Charge const feeWarning; // The cost of receiving a warning. extern Charge const feeWarning; // The cost of receiving a warning
extern Charge const feeDrop; // The cost of being dropped for excess load. extern Charge const feeDrop; // The cost of being dropped for
// excess load
/** @} */ /** @} */
// clang-format on
} // namespace Resource } // namespace Resource
} // namespace xrpl } // namespace xrpl

View File

@@ -17,7 +17,7 @@ struct Gossip
{ {
explicit Item() = default; explicit Item() = default;
int balance{}; int balance;
beast::IP::Endpoint address; beast::IP::Endpoint address;
}; };

View File

@@ -62,7 +62,7 @@ struct Entry : public beast::List<Entry>::Node
std::optional<PublicKey> publicKey; std::optional<PublicKey> publicKey;
// Back pointer to the map key (bit of a hack here) // Back pointer to the map key (bit of a hack here)
Key const* key{}; Key const* key;
// Number of Consumer references // Number of Consumer references
int refcount; int refcount;

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