mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-16 00:42:28 +00:00
Compare commits
34 Commits
a1q123456/
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d52d735543 | ||
|
|
6a0ce46755 | ||
|
|
2f029a2120 | ||
|
|
61fbde3a71 | ||
|
|
e2e537b3bb | ||
|
|
a873250019 | ||
|
|
56c9d1d497 | ||
|
|
d52dd29d20 | ||
|
|
7793b5f10b | ||
|
|
dfcad69155 | ||
|
|
6d1a5be8d2 | ||
|
|
b0fe2ec58a | ||
|
|
c00ed673a8 | ||
|
|
f239256d87 | ||
|
|
00761dbb67 | ||
|
|
077e03ff33 | ||
|
|
7d524a03b8 | ||
|
|
c0ee813666 | ||
|
|
8e05416211 | ||
|
|
81555d5456 | ||
|
|
6b55c4cdc8 | ||
|
|
3414a1776b | ||
|
|
6d9ed125f3 | ||
|
|
02fa55df8d | ||
|
|
6e2452207d | ||
|
|
29e49abd3c | ||
|
|
ae21f53e4d | ||
|
|
bee1056faa | ||
|
|
b6aa4a8fde | ||
|
|
a9afd2c116 | ||
|
|
2502befb42 | ||
|
|
c3fae847f3 | ||
|
|
7f53351920 | ||
|
|
bb95a7d6cd |
54
.clang-tidy
54
.clang-tidy
@@ -10,26 +10,26 @@ Checks: "-*,
|
|||||||
bugprone-chained-comparison,
|
bugprone-chained-comparison,
|
||||||
bugprone-compare-pointer-to-member-virtual-function,
|
bugprone-compare-pointer-to-member-virtual-function,
|
||||||
bugprone-copy-constructor-init,
|
bugprone-copy-constructor-init,
|
||||||
# bugprone-crtp-constructor-accessibility, # has issues
|
bugprone-crtp-constructor-accessibility,
|
||||||
bugprone-dangling-handle,
|
bugprone-dangling-handle,
|
||||||
bugprone-dynamic-static-initializers,
|
bugprone-dynamic-static-initializers,
|
||||||
# bugprone-empty-catch, # has issues
|
bugprone-empty-catch,
|
||||||
bugprone-fold-init-type,
|
bugprone-fold-init-type,
|
||||||
# bugprone-forward-declaration-namespace, # has issues
|
bugprone-forward-declaration-namespace,
|
||||||
# bugprone-inaccurate-erase,
|
bugprone-inaccurate-erase,
|
||||||
# bugprone-inc-dec-in-conditions,
|
bugprone-inc-dec-in-conditions,
|
||||||
# bugprone-incorrect-enable-if,
|
bugprone-incorrect-enable-if,
|
||||||
# bugprone-incorrect-roundings,
|
bugprone-incorrect-roundings,
|
||||||
# bugprone-infinite-loop,
|
bugprone-infinite-loop,
|
||||||
# bugprone-integer-division,
|
bugprone-integer-division,
|
||||||
bugprone-lambda-function-name,
|
bugprone-lambda-function-name,
|
||||||
# bugprone-macro-parentheses, # has issues
|
bugprone-macro-parentheses,
|
||||||
bugprone-macro-repeated-side-effects,
|
bugprone-macro-repeated-side-effects,
|
||||||
bugprone-misplaced-operator-in-strlen-in-alloc,
|
bugprone-misplaced-operator-in-strlen-in-alloc,
|
||||||
bugprone-misplaced-pointer-arithmetic-in-alloc,
|
bugprone-misplaced-pointer-arithmetic-in-alloc,
|
||||||
bugprone-misplaced-widening-cast,
|
bugprone-misplaced-widening-cast,
|
||||||
bugprone-move-forwarding-reference,
|
bugprone-move-forwarding-reference,
|
||||||
# bugprone-multi-level-implicit-pointer-conversion, # has issues
|
bugprone-multi-level-implicit-pointer-conversion,
|
||||||
bugprone-multiple-new-in-one-expression,
|
bugprone-multiple-new-in-one-expression,
|
||||||
bugprone-multiple-statement-macro,
|
bugprone-multiple-statement-macro,
|
||||||
bugprone-no-escape,
|
bugprone-no-escape,
|
||||||
@@ -39,13 +39,13 @@ Checks: "-*,
|
|||||||
bugprone-pointer-arithmetic-on-polymorphic-object,
|
bugprone-pointer-arithmetic-on-polymorphic-object,
|
||||||
bugprone-posix-return,
|
bugprone-posix-return,
|
||||||
bugprone-redundant-branch-condition,
|
bugprone-redundant-branch-condition,
|
||||||
# bugprone-reserved-identifier, # has issues
|
bugprone-reserved-identifier,
|
||||||
# bugprone-return-const-ref-from-parameter, # has issues
|
bugprone-return-const-ref-from-parameter,
|
||||||
bugprone-shared-ptr-array-mismatch,
|
bugprone-shared-ptr-array-mismatch,
|
||||||
bugprone-signal-handler,
|
bugprone-signal-handler,
|
||||||
bugprone-signed-char-misuse,
|
bugprone-signed-char-misuse,
|
||||||
bugprone-sizeof-container,
|
bugprone-sizeof-container,
|
||||||
# bugprone-sizeof-expression, # has issues
|
bugprone-sizeof-expression,
|
||||||
bugprone-spuriously-wake-up-functions,
|
bugprone-spuriously-wake-up-functions,
|
||||||
bugprone-standalone-empty,
|
bugprone-standalone-empty,
|
||||||
bugprone-string-constructor,
|
bugprone-string-constructor,
|
||||||
@@ -62,7 +62,7 @@ Checks: "-*,
|
|||||||
bugprone-suspicious-string-compare,
|
bugprone-suspicious-string-compare,
|
||||||
bugprone-suspicious-stringview-data-usage,
|
bugprone-suspicious-stringview-data-usage,
|
||||||
bugprone-swapped-arguments,
|
bugprone-swapped-arguments,
|
||||||
# bugprone-switch-missing-default-case, # has issues
|
bugprone-switch-missing-default-case,
|
||||||
bugprone-terminating-continue,
|
bugprone-terminating-continue,
|
||||||
bugprone-throw-keyword-missing,
|
bugprone-throw-keyword-missing,
|
||||||
bugprone-too-small-loop-variable,
|
bugprone-too-small-loop-variable,
|
||||||
@@ -73,30 +73,33 @@ Checks: "-*,
|
|||||||
bugprone-unhandled-self-assignment,
|
bugprone-unhandled-self-assignment,
|
||||||
bugprone-unique-ptr-array-mismatch,
|
bugprone-unique-ptr-array-mismatch,
|
||||||
bugprone-unsafe-functions,
|
bugprone-unsafe-functions,
|
||||||
# bugprone-use-after-move, # has issues
|
bugprone-use-after-move, # has issues
|
||||||
bugprone-unused-raii,
|
bugprone-unused-raii,
|
||||||
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, # has issues
|
cppcoreguidelines-init-variables,
|
||||||
# cppcoreguidelines-misleading-capture-default-by-value, # has issues
|
cppcoreguidelines-misleading-capture-default-by-value,
|
||||||
cppcoreguidelines-no-suspend-with-lock,
|
cppcoreguidelines-no-suspend-with-lock,
|
||||||
# cppcoreguidelines-pro-type-member-init, # has issues
|
cppcoreguidelines-pro-type-member-init,
|
||||||
cppcoreguidelines-pro-type-static-cast-downcast,
|
cppcoreguidelines-pro-type-static-cast-downcast,
|
||||||
# cppcoreguidelines-rvalue-reference-param-not-moved, # has issues
|
cppcoreguidelines-rvalue-reference-param-not-moved,
|
||||||
# cppcoreguidelines-use-default-member-init, # has issues
|
cppcoreguidelines-use-default-member-init,
|
||||||
# cppcoreguidelines-virtual-class-destructor, # has issues
|
cppcoreguidelines-virtual-class-destructor,
|
||||||
hicpp-ignored-remove-result,
|
hicpp-ignored-remove-result,
|
||||||
# misc-definitions-in-headers, # has issues
|
misc-const-correctness,
|
||||||
|
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, # has issues
|
misc-throw-by-value-catch-by-reference,
|
||||||
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,
|
||||||
@@ -134,10 +137,7 @@ 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
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/feature_request.md
vendored
4
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: Feature Request
|
name: Feature Request
|
||||||
about: Suggest a new feature for the rippled project
|
about: Suggest a new feature for the xrpld project
|
||||||
title: "[Title with short description] (Version: [rippled version])"
|
title: "[Title with short description] (Version: [xrpld version])"
|
||||||
labels: Feature Request
|
labels: Feature Request
|
||||||
assignees: ""
|
assignees: ""
|
||||||
---
|
---
|
||||||
|
|||||||
12
.github/scripts/levelization/README.md
vendored
12
.github/scripts/levelization/README.md
vendored
@@ -1,14 +1,14 @@
|
|||||||
# Levelization
|
# Levelization
|
||||||
|
|
||||||
Levelization is the term used to describe efforts to prevent rippled from
|
Levelization is the term used to describe efforts to prevent xrpld from
|
||||||
having or creating cyclic dependencies.
|
having or creating cyclic dependencies.
|
||||||
|
|
||||||
rippled code is organized into directories under `src/xrpld`, `src/libxrpl` (and
|
xrpld code is organized into directories under `src/xrpld`, `src/libxrpl` (and
|
||||||
`src/test`) representing modules. The modules are intended to be
|
`src/test`) representing modules. The modules are intended to be
|
||||||
organized into "tiers" or "levels" such that a module from one level can
|
organized into "tiers" or "levels" such that a module from one level can
|
||||||
only include code from lower levels. Additionally, a module
|
only include code from lower levels. Additionally, a module
|
||||||
in one level should never include code in an `impl` or `detail` folder of any level
|
in one level should never include code in an `impl` or `detail` folder of any level
|
||||||
other than it's own.
|
other than its own.
|
||||||
|
|
||||||
The codebase is split into two main areas:
|
The codebase is split into two main areas:
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ levelization violations they find (by moving files or individual
|
|||||||
classes). At the very least, don't make things worse.
|
classes). At the very least, don't make things worse.
|
||||||
|
|
||||||
The table below summarizes the _desired_ division of modules, based on the current
|
The table below summarizes the _desired_ division of modules, based on the current
|
||||||
state of the rippled code. The levels are numbered from
|
state of the xrpld code. The levels are numbered from
|
||||||
the bottom up with the lower level, lower numbered, more independent
|
the bottom up with the lower level, lower numbered, more independent
|
||||||
modules listed first, and the higher level, higher numbered modules with
|
modules listed first, and the higher level, higher numbered modules with
|
||||||
more dependencies listed later.
|
more dependencies listed later.
|
||||||
@@ -72,10 +72,10 @@ that `test` code should _never_ be included in `xrpl` or `xrpld` code.)
|
|||||||
|
|
||||||
The [levelization](generate.py) script takes no parameters,
|
The [levelization](generate.py) script takes no parameters,
|
||||||
reads no environment variables, and can be run from any directory,
|
reads no environment variables, and can be run from any directory,
|
||||||
as long as it is in the expected location in the rippled repo.
|
as long as it is in the expected location in the xrpld repo.
|
||||||
It can be run at any time from within a checked out repo, and will
|
It can be run at any time from within a checked out repo, and will
|
||||||
do an analysis of all the `#include`s in
|
do an analysis of all the `#include`s in
|
||||||
the rippled source. The only caveat is that it runs much slower
|
the xrpld source. The only caveat is that it runs much slower
|
||||||
under Windows than in Linux. It hasn't yet been tested under MacOS.
|
under Windows than in Linux. It hasn't yet been tested under MacOS.
|
||||||
It generates many files of [results](results):
|
It generates many files of [results](results):
|
||||||
|
|
||||||
|
|||||||
3
.github/scripts/rename/README.md
vendored
3
.github/scripts/rename/README.md
vendored
@@ -34,6 +34,8 @@ run from the repository root.
|
|||||||
6. `.github/scripts/rename/config.sh`: This script will rename the config from
|
6. `.github/scripts/rename/config.sh`: This script will rename the config from
|
||||||
`rippled.cfg` to `xrpld.cfg`, and updating the code accordingly. The old
|
`rippled.cfg` to `xrpld.cfg`, and updating the code accordingly. The old
|
||||||
filename will still be accepted.
|
filename will still be accepted.
|
||||||
|
7. `.github/scripts/rename/docs.sh`: This script will rename any lingering
|
||||||
|
references of `ripple(d)` to `xrpl(d)` in code, comments, and documentation.
|
||||||
|
|
||||||
You can run all these scripts from the repository root as follows:
|
You can run all these scripts from the repository root as follows:
|
||||||
|
|
||||||
@@ -44,4 +46,5 @@ You can run all these scripts from the repository root as follows:
|
|||||||
./.github/scripts/rename/binary.sh .
|
./.github/scripts/rename/binary.sh .
|
||||||
./.github/scripts/rename/namespace.sh .
|
./.github/scripts/rename/namespace.sh .
|
||||||
./.github/scripts/rename/config.sh .
|
./.github/scripts/rename/config.sh .
|
||||||
|
./.github/scripts/rename/docs.sh .
|
||||||
```
|
```
|
||||||
|
|||||||
3
.github/scripts/rename/binary.sh
vendored
3
.github/scripts/rename/binary.sh
vendored
@@ -29,7 +29,7 @@ if [ ! -d "${DIRECTORY}" ]; then
|
|||||||
echo "Error: Directory '${DIRECTORY}' does not exist."
|
echo "Error: Directory '${DIRECTORY}' does not exist."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
pushd ${DIRECTORY}
|
pushd "${DIRECTORY}"
|
||||||
|
|
||||||
# Remove the binary name override added by the cmake.sh script.
|
# Remove the binary name override added by the cmake.sh script.
|
||||||
${SED_COMMAND} -z -i -E 's@\s+# For the time being.+"rippled"\)@@' cmake/XrplCore.cmake
|
${SED_COMMAND} -z -i -E 's@\s+# For the time being.+"rippled"\)@@' cmake/XrplCore.cmake
|
||||||
@@ -49,6 +49,7 @@ ${SED_COMMAND} -i -E 's@ripple/xrpld@XRPLF/rippled@g' BUILD.md
|
|||||||
${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' BUILD.md
|
${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' BUILD.md
|
||||||
${SED_COMMAND} -i -E 's@xrpld \(`xrpld`\)@xrpld@g' BUILD.md
|
${SED_COMMAND} -i -E 's@xrpld \(`xrpld`\)@xrpld@g' BUILD.md
|
||||||
${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' CONTRIBUTING.md
|
${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' CONTRIBUTING.md
|
||||||
|
${SED_COMMAND} -i -E 's@XRPLF/xrpld@XRPLF/rippled@g' docs/build/install.md
|
||||||
|
|
||||||
popd
|
popd
|
||||||
echo "Processing complete."
|
echo "Processing complete."
|
||||||
|
|||||||
2
.github/scripts/rename/cmake.sh
vendored
2
.github/scripts/rename/cmake.sh
vendored
@@ -38,7 +38,7 @@ if [ ! -d "${DIRECTORY}" ]; then
|
|||||||
echo "Error: Directory '${DIRECTORY}' does not exist."
|
echo "Error: Directory '${DIRECTORY}' does not exist."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
pushd ${DIRECTORY}
|
pushd "${DIRECTORY}"
|
||||||
|
|
||||||
# Rename the files.
|
# Rename the files.
|
||||||
find cmake -type f -name 'Rippled*.cmake' -exec bash -c 'mv "${1}" "${1/Rippled/Xrpl}"' - {} \;
|
find cmake -type f -name 'Rippled*.cmake' -exec bash -c 'mv "${1}" "${1/Rippled/Xrpl}"' - {} \;
|
||||||
|
|||||||
5
.github/scripts/rename/config.sh
vendored
5
.github/scripts/rename/config.sh
vendored
@@ -28,7 +28,7 @@ if [ ! -d "${DIRECTORY}" ]; then
|
|||||||
echo "Error: Directory '${DIRECTORY}' does not exist."
|
echo "Error: Directory '${DIRECTORY}' does not exist."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
pushd ${DIRECTORY}
|
pushd "${DIRECTORY}"
|
||||||
|
|
||||||
# Add the xrpld.cfg to the .gitignore.
|
# Add the xrpld.cfg to the .gitignore.
|
||||||
if ! grep -q 'xrpld.cfg' .gitignore; then
|
if ! grep -q 'xrpld.cfg' .gitignore; then
|
||||||
@@ -52,16 +52,15 @@ for DIRECTORY in "${DIRECTORIES[@]}"; do
|
|||||||
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.cmake" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" \) | while read -r FILE; do
|
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.cmake" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" \) | while read -r FILE; do
|
||||||
echo "Processing file: ${FILE}"
|
echo "Processing file: ${FILE}"
|
||||||
${SED_COMMAND} -i -E 's/rippled(-example)?[ .]cfg/xrpld\1.cfg/g' "${FILE}"
|
${SED_COMMAND} -i -E 's/rippled(-example)?[ .]cfg/xrpld\1.cfg/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/rippleConfig/xrpldConfig/g' "${FILE}"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
${SED_COMMAND} -i 's/rippled/xrpld/g' cfg/xrpld-example.cfg
|
${SED_COMMAND} -i 's/rippled/xrpld/g' cfg/xrpld-example.cfg
|
||||||
${SED_COMMAND} -i 's/rippled/xrpld/g' src/test/core/Config_test.cpp
|
${SED_COMMAND} -i 's/rippled/xrpld/g' src/test/core/Config_test.cpp
|
||||||
${SED_COMMAND} -i 's/ripplevalidators/xrplvalidators/g' src/test/core/Config_test.cpp # cspell: disable-line
|
${SED_COMMAND} -i 's/ripplevalidators/xrplvalidators/g' src/test/core/Config_test.cpp # cspell: disable-line
|
||||||
${SED_COMMAND} -i 's/rippleConfig/xrpldConfig/g' src/test/core/Config_test.cpp
|
|
||||||
${SED_COMMAND} -i 's@ripple/@xrpld/@g' src/test/core/Config_test.cpp
|
${SED_COMMAND} -i 's@ripple/@xrpld/@g' src/test/core/Config_test.cpp
|
||||||
${SED_COMMAND} -i 's/Rippled/File/g' src/test/core/Config_test.cpp
|
${SED_COMMAND} -i 's/Rippled/File/g' src/test/core/Config_test.cpp
|
||||||
|
|
||||||
|
|
||||||
# Restore the old config file name in the code that maintains support for now.
|
# Restore the old config file name in the code that maintains support for now.
|
||||||
${SED_COMMAND} -i 's/configLegacyName = "xrpld.cfg"/configLegacyName = "rippled.cfg"/g' src/xrpld/core/detail/Config.cpp
|
${SED_COMMAND} -i 's/configLegacyName = "xrpld.cfg"/configLegacyName = "rippled.cfg"/g' src/xrpld/core/detail/Config.cpp
|
||||||
|
|
||||||
|
|||||||
10
.github/scripts/rename/copyright.sh
vendored
10
.github/scripts/rename/copyright.sh
vendored
@@ -31,7 +31,7 @@ if [ ! -d "${DIRECTORY}" ]; then
|
|||||||
echo "Error: Directory '${DIRECTORY}' does not exist."
|
echo "Error: Directory '${DIRECTORY}' does not exist."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
pushd ${DIRECTORY}
|
pushd "${DIRECTORY}"
|
||||||
|
|
||||||
# Prevent sed and echo from removing newlines and tabs in string literals by
|
# Prevent sed and echo from removing newlines and tabs in string literals by
|
||||||
# temporarily replacing them with placeholders. This only affects one file.
|
# temporarily replacing them with placeholders. This only affects one 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/DoManifest.cpp; then
|
if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/server_info/Manifest.cpp; then
|
||||||
echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/DoManifest.cpp)" > src/xrpld/rpc/handlers/DoManifest.cpp
|
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
|
||||||
fi
|
fi
|
||||||
if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/ValidatorInfo.cpp; then
|
if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/admin/status/ValidatorInfo.cpp; then
|
||||||
echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/ValidatorInfo.cpp)" > src/xrpld/rpc/handlers/ValidatorInfo.cpp
|
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
|
||||||
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
|
||||||
|
|||||||
96
.github/scripts/rename/docs.sh
vendored
Executable file
96
.github/scripts/rename/docs.sh
vendored
Executable file
@@ -0,0 +1,96 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit the script as soon as an error occurs.
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# On MacOS, ensure that GNU sed is installed and available as `gsed`.
|
||||||
|
SED_COMMAND=sed
|
||||||
|
if [[ "${OSTYPE}" == 'darwin'* ]]; then
|
||||||
|
if ! command -v gsed &> /dev/null; then
|
||||||
|
echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
SED_COMMAND=gsed
|
||||||
|
fi
|
||||||
|
|
||||||
|
# This script renames all remaining references to `ripple` and `rippled` to
|
||||||
|
# `xrpl` and `xrpld`, respectively, in code, comments, and documentation.
|
||||||
|
# Usage: .github/scripts/rename/docs.sh <repository directory>
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <repository directory>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DIRECTORY=$1
|
||||||
|
echo "Processing directory: ${DIRECTORY}"
|
||||||
|
if [ ! -d "${DIRECTORY}" ]; then
|
||||||
|
echo "Error: Directory '${DIRECTORY}' does not exist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
pushd "${DIRECTORY}"
|
||||||
|
|
||||||
|
find . -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" -o -name "*.proto" \) -not -path "./.github/scripts/*" | while read -r FILE; do
|
||||||
|
echo "Processing file: ${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/rippleLockEscrowMPT/lockEscrowMPT/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/rippleUnlockEscrowMPT/unlockEscrowMPT/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/rippleCredit/directSendNoFee/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/rippleSend/directSendNoLimit/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's@([^/+-])rippled@\1xrpld@g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's@([^/+-])Rippled@\1Xrpld@g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/^rippled/xrpld/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/^Rippled/Xrpld/g' "${FILE}"
|
||||||
|
# cspell: disable
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (a|A)ddress/XRPL address/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (a|A)ccount/XRPL account/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (a|A)lgorithm/XRPL algorithm/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (c|C)lient/XRPL client/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (c|C)luster/XRPL cluster/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (c|C)onsensus/XRPL consensus/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (d|D)efault/XRPL default/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (e|E)poch/XRPL epoch/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (f|F)eature/XRPL feature/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (n|N)etwork/XRPL network/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (p|P)ayment/XRPL payment/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (p|P)rotocol/XRPL protocol/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (r|R)epository/XRPL repository/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple RPC/XRPL RPC/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (s|S)erialization/XRPL serialization/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (s|S)erver/XRPL server/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (s|S)pecific/XRPL specific/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple Source/XRPL Source/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (t|T)imestamp/XRPL timestamp/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple uses the consensus/XRPL uses the consensus/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's/(r|R)ipple (v|V)alidator/XRPL validator/g' "${FILE}"
|
||||||
|
# cspell: enable
|
||||||
|
${SED_COMMAND} -i 's/RippleLib/XrplLib/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/ripple-lib/XrplLib/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's@opt/ripple/@opt/xrpld/@g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's@src/ripple/@src/xrpld/@g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's@ripple/app/@xrpld/app/@g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's@github.com/ripple/rippled@github.com/XRPLF/rippled@g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/\ba xrpl/an xrpl/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/\ba XRPL/an XRPL/g' "${FILE}"
|
||||||
|
done
|
||||||
|
${SED_COMMAND} -i 's/ripple_libs/xrpl_libs/' BUILD.md
|
||||||
|
${SED_COMMAND} -i 's/Ripple integrators/XRPL developers/' README.md
|
||||||
|
${SED_COMMAND} -i 's/sanitizer-configuration-for-rippled/sanitizer-configuration-for-xrpld/' docs/build/sanitizers.md
|
||||||
|
${SED_COMMAND} -i 's/rippled/xrpld/g' .github/scripts/levelization/README.md
|
||||||
|
${SED_COMMAND} -i 's/rippled/xrpld/g' .github/scripts/strategy-matrix/generate.py
|
||||||
|
${SED_COMMAND} -i 's@/rippled@/xrpld@g' docs/build/install.md
|
||||||
|
${SED_COMMAND} -i 's@github.com/XRPLF/xrpld@github.com/XRPLF/rippled@g' docs/build/install.md
|
||||||
|
${SED_COMMAND} -i 's/rippled/xrpld/g' docs/Doxyfile
|
||||||
|
${SED_COMMAND} -i 's/ripple_basics/basics/' include/xrpl/basics/CountedObject.h
|
||||||
|
${SED_COMMAND} -i 's/<ripple/<xrpl/' include/xrpl/protocol/AccountID.h
|
||||||
|
${SED_COMMAND} -i 's/Ripple:/the XRPL:/g' include/xrpl/protocol/SecretKey.h
|
||||||
|
${SED_COMMAND} -i 's/Ripple:/the XRPL:/g' include/xrpl/protocol/Seed.h
|
||||||
|
${SED_COMMAND} -i 's/ripple/xrpl/g' src/test/README.md
|
||||||
|
${SED_COMMAND} -i 's/www.ripple.com/www.xrpl.org/g' src/test/protocol/Seed_test.cpp
|
||||||
|
|
||||||
|
# Restore specific changes.
|
||||||
|
${SED_COMMAND} -i 's@b5efcc/src/xrpld@b5efcc/src/ripple@' include/xrpl/protocol/README.md
|
||||||
|
${SED_COMMAND} -i 's/dbPrefix_ = "xrpldb"/dbPrefix_ = "rippledb"/' src/xrpld/app/misc/SHAMapStoreImp.h # cspell: disable-line
|
||||||
|
${SED_COMMAND} -i 's/configLegacyName = "xrpld.cfg"/configLegacyName = "rippled.cfg"/' src/xrpld/core/detail/Config.cpp
|
||||||
|
|
||||||
|
popd
|
||||||
|
echo "Renaming complete."
|
||||||
5
.github/scripts/rename/namespace.sh
vendored
5
.github/scripts/rename/namespace.sh
vendored
@@ -31,16 +31,17 @@ if [ ! -d "${DIRECTORY}" ]; then
|
|||||||
echo "Error: Directory '${DIRECTORY}' does not exist."
|
echo "Error: Directory '${DIRECTORY}' does not exist."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
pushd ${DIRECTORY}
|
pushd "${DIRECTORY}"
|
||||||
|
|
||||||
DIRECTORIES=("include" "src" "tests")
|
DIRECTORIES=("include" "src" "tests")
|
||||||
for DIRECTORY in "${DIRECTORIES[@]}"; do
|
for DIRECTORY in "${DIRECTORIES[@]}"; do
|
||||||
echo "Processing directory: ${DIRECTORY}"
|
echo "Processing directory: ${DIRECTORY}"
|
||||||
|
|
||||||
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" \) | while read -r FILE; do
|
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.macro" \) | while read -r FILE; do
|
||||||
echo "Processing file: ${FILE}"
|
echo "Processing file: ${FILE}"
|
||||||
${SED_COMMAND} -i 's/namespace ripple/namespace xrpl/g' "${FILE}"
|
${SED_COMMAND} -i 's/namespace ripple/namespace xrpl/g' "${FILE}"
|
||||||
${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}"
|
${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/"ripple:/"xrpl::/g' "${FILE}"
|
||||||
${SED_COMMAND} -i -E 's/(BEAST_DEFINE_TESTSUITE.+)ripple(.+)/\1xrpl\2/g' "${FILE}"
|
${SED_COMMAND} -i -E 's/(BEAST_DEFINE_TESTSUITE.+)ripple(.+)/\1xrpl\2/g' "${FILE}"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|||||||
2
.github/scripts/strategy-matrix/generate.py
vendored
2
.github/scripts/strategy-matrix/generate.py
vendored
@@ -235,7 +235,7 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
|||||||
# so that they are easier to identify in the GitHub Actions UI, as long
|
# so that they are easier to identify in the GitHub Actions UI, as long
|
||||||
# names get truncated.
|
# names get truncated.
|
||||||
# Add Address and Thread (both coupled with UB) sanitizers for specific bookworm distros.
|
# Add Address and Thread (both coupled with UB) sanitizers for specific bookworm distros.
|
||||||
# GCC-Asan rippled-embedded tests are failing because of https://github.com/google/sanitizers/issues/856
|
# GCC-Asan xrpld-embedded tests are failing because of https://github.com/google/sanitizers/issues/856
|
||||||
if (
|
if (
|
||||||
os["distro_version"] == "bookworm"
|
os["distro_version"] == "bookworm"
|
||||||
and f"{os['compiler_name']}-{os['compiler_version']}" == "clang-20"
|
and f"{os['compiler_name']}-{os['compiler_version']}" == "clang-20"
|
||||||
|
|||||||
4
.github/workflows/check-pr-commits.yml
vendored
4
.github/workflows/check-pr-commits.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: Check PR commits
|
name: Check PR commits
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request_target:
|
||||||
|
|
||||||
# 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@481048b78b94ac3343d1292b4ef125a813879f2b
|
uses: XRPLF/actions/.github/workflows/check-pr-commits.yml@e2c7f400d1e85ae65dad552fd425169fbacca4a3
|
||||||
|
|||||||
2
.github/workflows/check-pr-title.yml
vendored
2
.github/workflows/check-pr-title.yml
vendored
@@ -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@e2c7f400d1e85ae65dad552fd425169fbacca4a3
|
uses: XRPLF/actions/.github/workflows/check-pr-title.yml@a5d8dd35be543365e90a11358447130c8763871d
|
||||||
|
|||||||
2
.github/workflows/pre-commit.yml
vendored
2
.github/workflows/pre-commit.yml
vendored
@@ -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@e7896f15cc60d0da1a272c77ee5c4026b424f9c7
|
uses: XRPLF/actions/.github/workflows/pre-commit.yml@9307df762265e15c745ddcdb38a581c989f7f349
|
||||||
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" }'
|
||||||
|
|||||||
6
.github/workflows/publish-docs.yml
vendored
6
.github/workflows/publish-docs.yml
vendored
@@ -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.private && '1' || '2' }}
|
NPROC_SUBTRACT: ${{ github.event.repository.visibility == 'public' && '2' || '1' }}
|
||||||
|
|
||||||
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@2bbc2dc1abeec7bfaa886804ab86871ac201764e
|
uses: XRPLF/actions/prepare-runner@90f11ee655d1687824fb8793db770477d52afbab
|
||||||
with:
|
with:
|
||||||
enable_ccache: false
|
enable_ccache: false
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ jobs:
|
|||||||
path: ${{ env.BUILD_DIR }}/docs/html
|
path: ${{ env.BUILD_DIR }}/docs/html
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
if: ${{ github.event.repository.visibility == 'public' && github.event_name == 'push' }}
|
if: ${{ github.repository == 'XRPLF/rippled' && github.event_name == 'push' }}
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
17
.github/workflows/reusable-build-test-config.yml
vendored
17
.github/workflows/reusable-build-test-config.yml
vendored
@@ -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@2bbc2dc1abeec7bfaa886804ab86871ac201764e
|
uses: XRPLF/actions/prepare-runner@90f11ee655d1687824fb8793db770477d52afbab
|
||||||
with:
|
with:
|
||||||
enable_ccache: ${{ inputs.ccache_enabled }}
|
enable_ccache: ${{ inputs.ccache_enabled }}
|
||||||
|
|
||||||
@@ -154,24 +154,27 @@ jobs:
|
|||||||
..
|
..
|
||||||
|
|
||||||
- name: Check protocol autogen files are up-to-date
|
- name: Check protocol autogen files are up-to-date
|
||||||
|
working-directory: ${{ env.BUILD_DIR }}
|
||||||
env:
|
env:
|
||||||
MESSAGE: |
|
MESSAGE: |
|
||||||
|
|
||||||
The generated protocol wrapper classes are out of date.
|
The generated protocol wrapper classes are out of date.
|
||||||
|
|
||||||
This typically happens when your branch is behind develop and
|
This typically happens when the macro files or generator scripts
|
||||||
the macro files or generator scripts have changed.
|
have changed but the generated files were not regenerated.
|
||||||
|
|
||||||
To fix this:
|
To fix this:
|
||||||
1. Update your branch from develop (merge or rebase)
|
1. Run: cmake --build . --target setup_code_gen
|
||||||
2. Build with code generation enabled (XRPL_NO_CODEGEN=OFF)
|
2. Run: cmake --build . --target code_gen
|
||||||
3. Commit and push the regenerated files
|
3. Commit and push the regenerated files
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
DIFF=$(git status --porcelain -- include/xrpl/protocol_autogen src/tests/libxrpl/protocol_autogen)
|
cmake --build . --target setup_code_gen
|
||||||
|
cmake --build . --target code_gen
|
||||||
|
DIFF=$(git -C .. status --porcelain -- include/xrpl/protocol_autogen src/tests/libxrpl/protocol_autogen)
|
||||||
if [ -n "${DIFF}" ]; then
|
if [ -n "${DIFF}" ]; then
|
||||||
echo "::error::Generated protocol files are out of date"
|
echo "::error::Generated protocol files are out of date"
|
||||||
git diff -- include/xrpl/protocol_autogen src/tests/libxrpl/protocol_autogen
|
git -C .. diff -- include/xrpl/protocol_autogen src/tests/libxrpl/protocol_autogen
|
||||||
echo "${MESSAGE}"
|
echo "${MESSAGE}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
2
.github/workflows/reusable-check-rename.yml
vendored
2
.github/workflows/reusable-check-rename.yml
vendored
@@ -33,6 +33,8 @@ jobs:
|
|||||||
run: .github/scripts/rename/config.sh .
|
run: .github/scripts/rename/config.sh .
|
||||||
- name: Check include guards
|
- name: Check include guards
|
||||||
run: .github/scripts/rename/include.sh .
|
run: .github/scripts/rename/include.sh .
|
||||||
|
- name: Check documentation
|
||||||
|
run: .github/scripts/rename/docs.sh .
|
||||||
- name: Check for differences
|
- name: Check for differences
|
||||||
env:
|
env:
|
||||||
MESSAGE: |
|
MESSAGE: |
|
||||||
|
|||||||
@@ -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@2bbc2dc1abeec7bfaa886804ab86871ac201764e
|
uses: XRPLF/actions/prepare-runner@90f11ee655d1687824fb8793db770477d52afbab
|
||||||
with:
|
with:
|
||||||
enable_ccache: false
|
enable_ccache: false
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ 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}" ${TARGETS} 2>&1 | tee clang-tidy-output.txt
|
run-clang-tidy -j ${{ steps.nproc.outputs.nproc }} -p "${BUILD_DIR}" -quiet -allow-no-checks ${TARGETS} 2>&1 | tee clang-tidy-output.txt
|
||||||
|
|
||||||
- name: Upload clang-tidy output
|
- name: Upload clang-tidy output
|
||||||
if: ${{ github.event.repository.visibility == 'public' && steps.run_clang_tidy.outcome != 'success' }}
|
if: ${{ github.event.repository.visibility == 'public' && steps.run_clang_tidy.outcome != 'success' }}
|
||||||
|
|||||||
2
.github/workflows/upload-conan-deps.yml
vendored
2
.github/workflows/upload-conan-deps.yml
vendored
@@ -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@2bbc2dc1abeec7bfaa886804ab86871ac201764e
|
uses: XRPLF/actions/prepare-runner@90f11ee655d1687824fb8793db770477d52afbab
|
||||||
with:
|
with:
|
||||||
enable_ccache: false
|
enable_ccache: false
|
||||||
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,6 +13,7 @@
|
|||||||
Debug/
|
Debug/
|
||||||
Release/
|
Release/
|
||||||
/.build/
|
/.build/
|
||||||
|
/.venv/
|
||||||
/build/
|
/build/
|
||||||
/db/
|
/db/
|
||||||
/out.txt
|
/out.txt
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ repos:
|
|||||||
args: [--maxkb=400, --enforce-all]
|
args: [--maxkb=400, --enforce-all]
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: mixed-line-ending
|
|
||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
args: [--assume-in-merge]
|
args: [--assume-in-merge]
|
||||||
|
|
||||||
@@ -38,6 +37,7 @@ repos:
|
|||||||
rev: c2bc67fe8f8f549cc489e00ba8b45aa18ee713b1 # frozen: v3.8.1
|
rev: c2bc67fe8f8f549cc489e00ba8b45aa18ee713b1 # frozen: v3.8.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: prettier
|
- id: prettier
|
||||||
|
args: [--end-of-line=auto]
|
||||||
|
|
||||||
- repo: https://github.com/psf/black-pre-commit-mirror
|
- repo: https://github.com/psf/black-pre-commit-mirror
|
||||||
rev: ea488cebbfd88a5f50b8bd95d5c829d0bb76feb8 # frozen: 26.1.0
|
rev: ea488cebbfd88a5f50b8bd95d5c829d0bb76feb8 # frozen: 26.1.0
|
||||||
|
|||||||
@@ -4,23 +4,23 @@ This changelog is intended to list all updates to the [public API methods](https
|
|||||||
|
|
||||||
For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior.
|
For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior.
|
||||||
|
|
||||||
The API version controls the API behavior you see. This includes what properties you see in responses, what parameters you're permitted to send in requests, and so on. You specify the API version in each of your requests. When a breaking change is introduced to the `rippled` API, a new version is released. To avoid breaking your code, you should set (or increase) your version when you're ready to upgrade.
|
The API version controls the API behavior you see. This includes what properties you see in responses, what parameters you're permitted to send in requests, and so on. You specify the API version in each of your requests. When a breaking change is introduced to the `xrpld` API, a new version is released. To avoid breaking your code, you should set (or increase) your version when you're ready to upgrade.
|
||||||
|
|
||||||
The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#commandline-format) always uses the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code.
|
The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#commandline-format) always uses the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code.
|
||||||
|
|
||||||
For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`rippled`) release.
|
For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`xrpld`) release.
|
||||||
|
|
||||||
## API Version 3 (Beta)
|
## API Version 3 (Beta)
|
||||||
|
|
||||||
API version 3 is currently a beta API. It requires enabling `[beta_rpc_api]` in the rippled configuration to use. See [API-VERSION-3.md](API-VERSION-3.md) for the full list of changes in API version 3.
|
API version 3 is currently a beta API. It requires enabling `[beta_rpc_api]` in the xrpld configuration to use. See [API-VERSION-3.md](API-VERSION-3.md) for the full list of changes in API version 3.
|
||||||
|
|
||||||
## API Version 2
|
## API Version 2
|
||||||
|
|
||||||
API version 2 is available in `rippled` version 2.0.0 and later. See [API-VERSION-2.md](API-VERSION-2.md) for the full list of changes in API version 2.
|
API version 2 is available in `xrpld` version 2.0.0 and later. See [API-VERSION-2.md](API-VERSION-2.md) for the full list of changes in API version 2.
|
||||||
|
|
||||||
## API Version 1
|
## API Version 1
|
||||||
|
|
||||||
This version is supported by all `rippled` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified.
|
This version is supported by all `xrpld` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified.
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
@@ -38,6 +38,8 @@ 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
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# API Version 2
|
# API Version 2
|
||||||
|
|
||||||
API version 2 is available in `rippled` version 2.0.0 and later. To use this API, clients specify `"api_version" : 2` in each request.
|
API version 2 is available in `xrpld` version 2.0.0 and later. To use this API, clients specify `"api_version" : 2` in each request.
|
||||||
|
|
||||||
For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior.
|
For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# API Version 3
|
# API Version 3
|
||||||
|
|
||||||
API version 3 is currently a **beta API**. It requires enabling `[beta_rpc_api]` in the rippled configuration to use. To use this API, clients specify `"api_version" : 3` in each request.
|
API version 3 is currently a **beta API**. It requires enabling `[beta_rpc_api]` in the xrpld configuration to use. To use this API, clients specify `"api_version" : 3` in each request.
|
||||||
|
|
||||||
For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior.
|
For info about how [API versioning](https://xrpl.org/request-formatting.html#api-versioning) works, including examples, please view the [XLS-22d spec](https://github.com/XRPLF/XRPL-Standards/discussions/54). For details about the implementation of API versioning, view the [implementation PR](https://github.com/XRPLF/rippled/pull/3155). API versioning ensures existing integrations and users continue to receive existing behavior, while those that request a higher API version will experience new behavior.
|
||||||
|
|
||||||
|
|||||||
21
BUILD.md
21
BUILD.md
@@ -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' 'nudb' 'openssl' 'secp256k1' 'snappy' 'soci' 'wasm-xrplf' 'wasmi')
|
recipes=('abseil' 'ed25519' 'grpc' 'm4' 'mpt-crypto' '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
|
||||||
@@ -459,6 +459,21 @@ install ccache --version 4.11.3 --allow-downgrade`.
|
|||||||
The location of `xrpld` binary in your build directory depends on your
|
The location of `xrpld` binary in your build directory depends on your
|
||||||
CMake generator. Pass `--help` to see the rest of the command line options.
|
CMake generator. Pass `--help` to see the rest of the command line options.
|
||||||
|
|
||||||
|
## Code generation
|
||||||
|
|
||||||
|
The protocol wrapper classes in `include/xrpl/protocol_autogen/` are generated
|
||||||
|
from macro definition files in `include/xrpl/protocol/detail/`. If you modify
|
||||||
|
the macro files (e.g. `transactions.macro`, `ledger_entries.macro`) or the
|
||||||
|
generation scripts/templates in `cmake/scripts/codegen/`, you need to regenerate the
|
||||||
|
files:
|
||||||
|
|
||||||
|
```
|
||||||
|
cmake --build . --target setup_code_gen # create venv and install dependencies (once)
|
||||||
|
cmake --build . --target code_gen # regenerate code
|
||||||
|
```
|
||||||
|
|
||||||
|
The regenerated files should be committed alongside your changes.
|
||||||
|
|
||||||
## Coverage report
|
## Coverage report
|
||||||
|
|
||||||
The coverage report is intended for developers using compilers GCC
|
The coverage report is intended for developers using compilers GCC
|
||||||
@@ -603,8 +618,8 @@ If you want to experiment with a new package, follow these steps:
|
|||||||
`default_options` property (with syntax `'$package:$option': $value`).
|
`default_options` property (with syntax `'$package:$option': $value`).
|
||||||
3. Modify [`CMakeLists.txt`](./CMakeLists.txt):
|
3. Modify [`CMakeLists.txt`](./CMakeLists.txt):
|
||||||
- Add a call to `find_package($package REQUIRED)`.
|
- Add a call to `find_package($package REQUIRED)`.
|
||||||
- Link a library from the package to the target `ripple_libs`
|
- Link a library from the package to the target `xrpl_libs`
|
||||||
(search for the existing call to `target_link_libraries(ripple_libs INTERFACE ...)`).
|
(search for the existing call to `target_link_libraries(xrpl_libs INTERFACE ...)`).
|
||||||
4. Start coding! Don't forget to include whatever headers you need from the package.
|
4. Start coding! Don't forget to include whatever headers you need from the package.
|
||||||
|
|
||||||
[1]: https://github.com/conan-io/conan-center-index/issues/13168
|
[1]: https://github.com/conan-io/conan-center-index/issues/13168
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ if(coverage)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(XrplCore)
|
include(XrplCore)
|
||||||
|
include(XrplProtocolAutogen)
|
||||||
include(XrplInstall)
|
include(XrplInstall)
|
||||||
include(XrplValidatorKeys)
|
include(XrplValidatorKeys)
|
||||||
|
|
||||||
|
|||||||
@@ -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 src include tests
|
run-clang-tidy -p build -allow-no-checks src 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 -fix src include tests
|
run-clang-tidy -p build -quiet -fix -allow-no-checks src tests
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contracts and instrumentation
|
## Contracts and instrumentation
|
||||||
@@ -533,7 +533,7 @@ All releases, including release candidates and betas, are handled
|
|||||||
differently from typical PRs. Most importantly, never use
|
differently from typical PRs. Most importantly, never use
|
||||||
the Github UI to merge a release.
|
the Github UI to merge a release.
|
||||||
|
|
||||||
Rippled uses a linear workflow model that can be summarized as:
|
Xrpld uses a linear workflow model that can be summarized as:
|
||||||
|
|
||||||
1. In between releases, developers work against the `develop` branch.
|
1. In between releases, developers work against the `develop` branch.
|
||||||
2. Periodically, a maintainer will build and tag a beta version from
|
2. Periodically, a maintainer will build and tag a beta version from
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -8,11 +8,11 @@ The [XRP Ledger](https://xrpl.org/) is a decentralized cryptographic ledger powe
|
|||||||
|
|
||||||
[XRP](https://xrpl.org/xrp.html) is a public, counterparty-free crypto-asset native to the XRP Ledger, and is designed as a gas token for network services and to bridge different currencies. XRP is traded on the open-market and is available for anyone to access. The XRP Ledger was created in 2012 with a finite supply of 100 billion units of XRP.
|
[XRP](https://xrpl.org/xrp.html) is a public, counterparty-free crypto-asset native to the XRP Ledger, and is designed as a gas token for network services and to bridge different currencies. XRP is traded on the open-market and is available for anyone to access. The XRP Ledger was created in 2012 with a finite supply of 100 billion units of XRP.
|
||||||
|
|
||||||
## rippled
|
## xrpld
|
||||||
|
|
||||||
The server software that powers the XRP Ledger is called `rippled` and is available in this repository under the permissive [ISC open-source license](LICENSE.md). The `rippled` server software is written primarily in C++ and runs on a variety of platforms. The `rippled` server software can run in several modes depending on its [configuration](https://xrpl.org/rippled-server-modes.html).
|
The server software that powers the XRP Ledger is called `xrpld` and is available in this repository under the permissive [ISC open-source license](LICENSE.md). The `xrpld` server software is written primarily in C++ and runs on a variety of platforms. The `xrpld` server software can run in several modes depending on its [configuration](https://xrpl.org/rippled-server-modes.html).
|
||||||
|
|
||||||
If you are interested in running an **API Server** (including a **Full History Server**), take a look at [Clio](https://github.com/XRPLF/clio). (rippled Reporting Mode has been replaced by Clio.)
|
If you are interested in running an **API Server** (including a **Full History Server**), take a look at [Clio](https://github.com/XRPLF/clio). (xrpld Reporting Mode has been replaced by Clio.)
|
||||||
|
|
||||||
### Build from Source
|
### Build from Source
|
||||||
|
|
||||||
@@ -41,19 +41,19 @@ If you are interested in running an **API Server** (including a **Full History S
|
|||||||
|
|
||||||
Here are some good places to start learning the source code:
|
Here are some good places to start learning the source code:
|
||||||
|
|
||||||
- Read the markdown files in the source tree: `src/ripple/**/*.md`.
|
- Read the markdown files in the source tree: `src/xrpld/**/*.md`.
|
||||||
- Read [the levelization document](.github/scripts/levelization) to get an idea of the internal dependency graph.
|
- Read [the levelization document](.github/scripts/levelization) to get an idea of the internal dependency graph.
|
||||||
- In the big picture, the `main` function constructs an `ApplicationImp` object, which implements the `Application` virtual interface. Almost every component in the application takes an `Application&` parameter in its constructor, typically named `app` and stored as a member variable `app_`. This allows most components to depend on any other component.
|
- In the big picture, the `main` function constructs an `ApplicationImp` object, which implements the `Application` virtual interface. Almost every component in the application takes an `Application&` parameter in its constructor, typically named `app` and stored as a member variable `app_`. This allows most components to depend on any other component.
|
||||||
|
|
||||||
### Repository Contents
|
### Repository Contents
|
||||||
|
|
||||||
| Folder | Contents |
|
| Folder | Contents |
|
||||||
| :--------- | :----------------------------------------------- |
|
| :--------- | :--------------------------------------------- |
|
||||||
| `./bin` | Scripts and data files for Ripple integrators. |
|
| `./bin` | Scripts and data files for XRPL developers. |
|
||||||
| `./Builds` | Platform-specific guides for building `rippled`. |
|
| `./Builds` | Platform-specific guides for building `xrpld`. |
|
||||||
| `./docs` | Source documentation files and doxygen config. |
|
| `./docs` | Source documentation files and doxygen config. |
|
||||||
| `./cfg` | Example configuration files. |
|
| `./cfg` | Example configuration files. |
|
||||||
| `./src` | Source code. |
|
| `./src` | Source code. |
|
||||||
|
|
||||||
Some of the directories under `src` are external repositories included using
|
Some of the directories under `src` are external repositories included using
|
||||||
git-subtree. See those directories' README files for more details.
|
git-subtree. See those directories' README files for more details.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ For more details on operating an XRP Ledger server securely, please visit https:
|
|||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|
||||||
Software constantly evolves. In order to focus resources, we only generally only accept vulnerability reports that affect recent and current versions of the software. We always accept reports for issues present in the **master**, **release** or **develop** branches, and with proposed, [open pull requests](https://github.com/ripple/rippled/pulls).
|
Software constantly evolves. In order to focus resources, we generally only accept vulnerability reports that affect recent and current versions of the software. We always accept reports for issues present in the **master**, **release** or **develop** branches, and with proposed, [open pull requests](https://github.com/XRPLF/rippled/pulls).
|
||||||
|
|
||||||
## Identifying and Reporting Vulnerabilities
|
## Identifying and Reporting Vulnerabilities
|
||||||
|
|
||||||
@@ -59,11 +59,11 @@ While we commit to responding with 24 hours of your initial report with our tria
|
|||||||
|
|
||||||
## Bug Bounty Program
|
## Bug Bounty Program
|
||||||
|
|
||||||
[Ripple](https://ripple.com) is generously sponsoring a bug bounty program for vulnerabilities in [`rippled`](https://github.com/XRPLF/rippled) (and other related projects, like [`xrpl.js`](https://github.com/XRPLF/xrpl.js), [`xrpl-py`](https://github.com/XRPLF/xrpl-py), [`xrpl4j`](https://github.com/XRPLF/xrpl4j)).
|
[Ripple](https://ripple.com) is generously sponsoring a bug bounty program for vulnerabilities in [`xrpld`](https://github.com/XRPLF/rippled) (and other related projects, like [`xrpl.js`](https://github.com/XRPLF/xrpl.js), [`xrpl-py`](https://github.com/XRPLF/xrpl-py), [`xrpl4j`](https://github.com/XRPLF/xrpl4j)).
|
||||||
|
|
||||||
This program allows us to recognize and reward individuals or groups that identify and report bugs. In summary, in order to qualify for a bounty, the bug must be:
|
This program allows us to recognize and reward individuals or groups that identify and report bugs. In summary, in order to qualify for a bounty, the bug must be:
|
||||||
|
|
||||||
1. **In scope**. Only bugs in software under the scope of the program qualify. Currently, that means `rippled`, `xrpl.js`, `xrpl-py`, `xrpl4j`.
|
1. **In scope**. Only bugs in software under the scope of the program qualify. Currently, that means `xrpld`, `xrpl.js`, `xrpl-py`, `xrpl4j`.
|
||||||
2. **Relevant**. A security issue, posing a danger to user funds, privacy, or the operation of the XRP Ledger.
|
2. **Relevant**. A security issue, posing a danger to user funds, privacy, or the operation of the XRP Ledger.
|
||||||
3. **Original and previously unknown**. Bugs that are already known and discussed in public do not qualify. Previously reported bugs, even if publicly unknown, are not eligible.
|
3. **Original and previously unknown**. Bugs that are already known and discussed in public do not qualify. Previously reported bugs, even if publicly unknown, are not eligible.
|
||||||
4. **Specific**. We welcome general security advice or recommendations, but we cannot pay bounties for that.
|
4. **Specific**. We welcome general security advice or recommendations, but we cannot pay bounties for that.
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
# https://vl.ripple.com
|
# https://vl.ripple.com
|
||||||
# https://unl.xrplf.org
|
# https://unl.xrplf.org
|
||||||
# http://127.0.0.1:8000
|
# http://127.0.0.1:8000
|
||||||
# file:///etc/opt/ripple/vl.txt
|
# file:///etc/opt/xrpld/vl.txt
|
||||||
#
|
#
|
||||||
# [validator_list_keys]
|
# [validator_list_keys]
|
||||||
#
|
#
|
||||||
@@ -43,11 +43,11 @@
|
|||||||
# ED307A760EE34F2D0CAA103377B1969117C38B8AA0AA1E2A24DAC1F32FC97087ED
|
# ED307A760EE34F2D0CAA103377B1969117C38B8AA0AA1E2A24DAC1F32FC97087ED
|
||||||
#
|
#
|
||||||
|
|
||||||
# The default validator list publishers that the rippled instance
|
# The default validator list publishers that the xrpld instance
|
||||||
# trusts.
|
# trusts.
|
||||||
#
|
#
|
||||||
# WARNING: Changing these values can cause your rippled instance to see a
|
# WARNING: Changing these values can cause your xrpld instance to see a
|
||||||
# validated ledger that contradicts other rippled instances'
|
# validated ledger that contradicts other xrpld instances'
|
||||||
# validated ledgers (aka a ledger fork) if your validator list(s)
|
# validated ledgers (aka a ledger fork) if your validator list(s)
|
||||||
# do not sufficiently overlap with the list(s) used by others.
|
# do not sufficiently overlap with the list(s) used by others.
|
||||||
# See: https://arxiv.org/pdf/1802.07242.pdf
|
# See: https://arxiv.org/pdf/1802.07242.pdf
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#
|
#
|
||||||
# 2. Peer Protocol
|
# 2. Peer Protocol
|
||||||
#
|
#
|
||||||
# 3. Ripple Protocol
|
# 3. XRPL protocol
|
||||||
#
|
#
|
||||||
# 4. HTTPS Client
|
# 4. HTTPS Client
|
||||||
#
|
#
|
||||||
@@ -383,7 +383,7 @@
|
|||||||
#
|
#
|
||||||
# These settings control security and access attributes of the Peer to Peer
|
# These settings control security and access attributes of the Peer to Peer
|
||||||
# server section of the xrpld process. Peer Protocol implements the
|
# server section of the xrpld process. Peer Protocol implements the
|
||||||
# Ripple Payment protocol. It is over peer connections that transactions
|
# XRPL payment protocol. It is over peer connections that transactions
|
||||||
# and validations are passed from to machine to machine, to determine the
|
# and validations are passed from to machine to machine, to determine the
|
||||||
# contents of validated ledgers.
|
# contents of validated ledgers.
|
||||||
#
|
#
|
||||||
@@ -406,7 +406,7 @@
|
|||||||
#
|
#
|
||||||
# [ips]
|
# [ips]
|
||||||
#
|
#
|
||||||
# List of hostnames or ips where the Ripple protocol is served. A default
|
# List of hostnames or ips where the XRPL protocol is served. A default
|
||||||
# starter list is included in the code and used if no other hostnames are
|
# starter list is included in the code and used if no other hostnames are
|
||||||
# available.
|
# available.
|
||||||
#
|
#
|
||||||
@@ -435,7 +435,7 @@
|
|||||||
# List of IP addresses or hostnames to which xrpld should always attempt to
|
# List of IP addresses or hostnames to which xrpld should always attempt to
|
||||||
# maintain peer connections with. This is useful for manually forming private
|
# maintain peer connections with. This is useful for manually forming private
|
||||||
# networks, for example to configure a validation server that connects to the
|
# networks, for example to configure a validation server that connects to the
|
||||||
# Ripple network through a public-facing server, or for building a set
|
# XRPL network through a public-facing server, or for building a set
|
||||||
# of cluster peers.
|
# of cluster peers.
|
||||||
#
|
#
|
||||||
# One address or domain names per line is allowed. A port must be specified
|
# One address or domain names per line is allowed. A port must be specified
|
||||||
@@ -748,8 +748,8 @@
|
|||||||
# the folder in which the xrpld.cfg file is located.
|
# the folder in which the xrpld.cfg file is located.
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
# /home/ripple/validators.txt
|
# /home/username/validators.txt
|
||||||
# C:/home/ripple/validators.txt
|
# C:/home/username/validators.txt
|
||||||
#
|
#
|
||||||
# Example content:
|
# Example content:
|
||||||
# [validators]
|
# [validators]
|
||||||
@@ -840,7 +840,7 @@
|
|||||||
#
|
#
|
||||||
# 0: Disable the ledger replay feature [default]
|
# 0: Disable the ledger replay feature [default]
|
||||||
# 1: Enable the ledger replay feature. With this feature enabled, when
|
# 1: Enable the ledger replay feature. With this feature enabled, when
|
||||||
# acquiring a ledger from the network, a xrpld node only downloads
|
# acquiring a ledger from the network, an xrpld node only downloads
|
||||||
# the ledger header and the transactions instead of the whole ledger.
|
# the ledger header and the transactions instead of the whole ledger.
|
||||||
# And the ledger is built by applying the transactions to the parent
|
# And the ledger is built by applying the transactions to the parent
|
||||||
# ledger.
|
# ledger.
|
||||||
@@ -853,7 +853,7 @@
|
|||||||
#
|
#
|
||||||
# The xrpld server instance uses HTTPS GET requests in a variety of
|
# The xrpld server instance uses HTTPS GET requests in a variety of
|
||||||
# circumstances, including but not limited to contacting trusted domains to
|
# circumstances, including but not limited to contacting trusted domains to
|
||||||
# fetch information such as mapping an email address to a Ripple Payment
|
# fetch information such as mapping an email address to an XRPL payment
|
||||||
# Network address.
|
# Network address.
|
||||||
#
|
#
|
||||||
# [ssl_verify]
|
# [ssl_verify]
|
||||||
@@ -1227,7 +1227,7 @@
|
|||||||
#
|
#
|
||||||
#----------
|
#----------
|
||||||
#
|
#
|
||||||
# The vote settings configure settings for the entire Ripple network.
|
# The vote settings configure settings for the entire XRPL network.
|
||||||
# While a single instance of xrpld cannot unilaterally enforce network-wide
|
# While a single instance of xrpld cannot unilaterally enforce network-wide
|
||||||
# settings, these choices become part of the instance's vote during the
|
# settings, these choices become part of the instance's vote during the
|
||||||
# consensus process for each voting ledger.
|
# consensus process for each voting ledger.
|
||||||
|
|||||||
@@ -108,12 +108,6 @@ target_link_libraries(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Level 05
|
# Level 05
|
||||||
## Set up code generation for protocol_autogen module.
|
|
||||||
## Generation runs at configure time (when the stamp is stale),
|
|
||||||
## so generated files are always present before add_module GLOBs them.
|
|
||||||
include(XrplProtocolAutogen)
|
|
||||||
setup_protocol_autogen()
|
|
||||||
|
|
||||||
add_module(xrpl protocol_autogen)
|
add_module(xrpl protocol_autogen)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
xrpl.libxrpl.protocol_autogen
|
xrpl.libxrpl.protocol_autogen
|
||||||
|
|||||||
@@ -2,293 +2,145 @@
|
|||||||
Protocol Autogen - Code generation for protocol wrapper classes
|
Protocol Autogen - Code generation for protocol wrapper classes
|
||||||
#]===================================================================]
|
#]===================================================================]
|
||||||
|
|
||||||
# Options for code generation
|
|
||||||
option(
|
|
||||||
XRPL_NO_CODEGEN
|
|
||||||
"Disable code generation (use pre-generated files from repository)"
|
|
||||||
OFF
|
|
||||||
)
|
|
||||||
set(CODEGEN_VENV_DIR
|
set(CODEGEN_VENV_DIR
|
||||||
""
|
"${CMAKE_CURRENT_SOURCE_DIR}/.venv"
|
||||||
CACHE PATH
|
CACHE PATH
|
||||||
"Path to Python virtual environment for code generation. If provided, automatic venv setup is skipped."
|
"Path to a Python virtual environment for code generation. A venv will be created here by setup_code_gen and used to run generation scripts."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Function to set up code generation for protocol_autogen module
|
# Directory paths
|
||||||
function(setup_protocol_autogen)
|
set(MACRO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol/detail")
|
||||||
# Directory paths
|
set(AUTOGEN_HEADER_DIR
|
||||||
set(MACRO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol/detail")
|
"${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol_autogen"
|
||||||
set(AUTOGEN_HEADER_DIR
|
)
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl/protocol_autogen"
|
set(AUTOGEN_TEST_DIR
|
||||||
)
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/tests/libxrpl/protocol_autogen"
|
||||||
set(AUTOGEN_TEST_DIR
|
)
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/tests/libxrpl/protocol_autogen"
|
set(SCRIPTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/scripts/codegen")
|
||||||
)
|
|
||||||
set(SCRIPTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/scripts/codegen")
|
|
||||||
|
|
||||||
# Input macro files
|
# Input macro files
|
||||||
set(TRANSACTIONS_MACRO "${MACRO_DIR}/transactions.macro")
|
set(TRANSACTIONS_MACRO "${MACRO_DIR}/transactions.macro")
|
||||||
set(LEDGER_ENTRIES_MACRO "${MACRO_DIR}/ledger_entries.macro")
|
set(LEDGER_ENTRIES_MACRO "${MACRO_DIR}/ledger_entries.macro")
|
||||||
set(SFIELDS_MACRO "${MACRO_DIR}/sfields.macro")
|
set(SFIELDS_MACRO "${MACRO_DIR}/sfields.macro")
|
||||||
|
|
||||||
# Python scripts and templates
|
# Python scripts and templates
|
||||||
set(GENERATE_TX_SCRIPT "${SCRIPTS_DIR}/generate_tx_classes.py")
|
set(GENERATE_TX_SCRIPT "${SCRIPTS_DIR}/generate_tx_classes.py")
|
||||||
set(GENERATE_LEDGER_SCRIPT "${SCRIPTS_DIR}/generate_ledger_classes.py")
|
set(GENERATE_LEDGER_SCRIPT "${SCRIPTS_DIR}/generate_ledger_classes.py")
|
||||||
set(REQUIREMENTS_FILE "${SCRIPTS_DIR}/requirements.txt")
|
set(REQUIREMENTS_FILE "${SCRIPTS_DIR}/requirements.txt")
|
||||||
set(MACRO_PARSER_COMMON "${SCRIPTS_DIR}/macro_parser_common.py")
|
set(MACRO_PARSER_COMMON "${SCRIPTS_DIR}/macro_parser_common.py")
|
||||||
set(TX_TEMPLATE "${SCRIPTS_DIR}/templates/Transaction.h.mako")
|
set(TX_TEMPLATE "${SCRIPTS_DIR}/templates/Transaction.h.mako")
|
||||||
set(TX_TEST_TEMPLATE "${SCRIPTS_DIR}/templates/TransactionTests.cpp.mako")
|
set(TX_TEST_TEMPLATE "${SCRIPTS_DIR}/templates/TransactionTests.cpp.mako")
|
||||||
set(LEDGER_TEMPLATE "${SCRIPTS_DIR}/templates/LedgerEntry.h.mako")
|
set(LEDGER_TEMPLATE "${SCRIPTS_DIR}/templates/LedgerEntry.h.mako")
|
||||||
set(LEDGER_TEST_TEMPLATE
|
set(LEDGER_TEST_TEMPLATE "${SCRIPTS_DIR}/templates/LedgerEntryTests.cpp.mako")
|
||||||
"${SCRIPTS_DIR}/templates/LedgerEntryTests.cpp.mako"
|
set(ALL_INPUT_FILES
|
||||||
|
"${TRANSACTIONS_MACRO}"
|
||||||
|
"${LEDGER_ENTRIES_MACRO}"
|
||||||
|
"${SFIELDS_MACRO}"
|
||||||
|
"${GENERATE_TX_SCRIPT}"
|
||||||
|
"${GENERATE_LEDGER_SCRIPT}"
|
||||||
|
"${REQUIREMENTS_FILE}"
|
||||||
|
"${MACRO_PARSER_COMMON}"
|
||||||
|
"${TX_TEMPLATE}"
|
||||||
|
"${TX_TEST_TEMPLATE}"
|
||||||
|
"${LEDGER_TEMPLATE}"
|
||||||
|
"${LEDGER_TEST_TEMPLATE}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Create output directories
|
||||||
|
file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/transactions")
|
||||||
|
file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/ledger_entries")
|
||||||
|
file(MAKE_DIRECTORY "${AUTOGEN_TEST_DIR}/ledger_entries")
|
||||||
|
file(MAKE_DIRECTORY "${AUTOGEN_TEST_DIR}/transactions")
|
||||||
|
|
||||||
|
# Find Python3
|
||||||
|
if(NOT Python3_EXECUTABLE)
|
||||||
|
find_package(Python3 COMPONENTS Interpreter QUIET)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT Python3_EXECUTABLE)
|
||||||
|
find_program(Python3_EXECUTABLE NAMES python3 python)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT Python3_EXECUTABLE)
|
||||||
|
message(
|
||||||
|
WARNING
|
||||||
|
"Python3 not found. The 'code_gen' and 'setup_code_gen' targets will not be available."
|
||||||
)
|
)
|
||||||
set(UPDATE_STAMP_SCRIPT "${SCRIPTS_DIR}/update_codegen_stamp.py")
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Check if code generation is disabled
|
# Warn if pip is configured with a non-default index (may need VPN).
|
||||||
if(XRPL_NO_CODEGEN)
|
execute_process(
|
||||||
|
COMMAND ${Python3_EXECUTABLE} -m pip config get global.index-url
|
||||||
|
OUTPUT_VARIABLE PIP_INDEX_URL
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
ERROR_QUIET
|
||||||
|
RESULT_VARIABLE PIP_CONFIG_RESULT
|
||||||
|
)
|
||||||
|
if(PIP_CONFIG_RESULT EQUAL 0 AND PIP_INDEX_URL)
|
||||||
|
if(
|
||||||
|
NOT PIP_INDEX_URL STREQUAL "https://pypi.org/simple"
|
||||||
|
AND NOT PIP_INDEX_URL STREQUAL "https://pypi.python.org/simple"
|
||||||
|
)
|
||||||
message(
|
message(
|
||||||
WARNING
|
WARNING
|
||||||
"Protocol autogen: Code generation is disabled (XRPL_NO_CODEGEN=ON). "
|
"Private pip index URL detected: ${PIP_INDEX_URL}\n"
|
||||||
"Generated files may be out of date."
|
"You may need to connect to VPN to access this URL."
|
||||||
)
|
)
|
||||||
return()
|
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Create output directories
|
# Determine which Python interpreter to use for code generation.
|
||||||
file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/transactions")
|
if(CODEGEN_VENV_DIR)
|
||||||
file(MAKE_DIRECTORY "${AUTOGEN_HEADER_DIR}/ledger_entries")
|
|
||||||
file(MAKE_DIRECTORY "${AUTOGEN_TEST_DIR}/ledger_entries")
|
|
||||||
file(MAKE_DIRECTORY "${AUTOGEN_TEST_DIR}/transactions")
|
|
||||||
|
|
||||||
# === Stamp file check ===
|
|
||||||
# All input files whose content affects code generation output.
|
|
||||||
set(STAMP_FILE "${CMAKE_CURRENT_SOURCE_DIR}/scripts/codegen/.codegen_stamp")
|
|
||||||
set(ALL_INPUT_FILES
|
|
||||||
"${TRANSACTIONS_MACRO}"
|
|
||||||
"${LEDGER_ENTRIES_MACRO}"
|
|
||||||
"${SFIELDS_MACRO}"
|
|
||||||
"${GENERATE_TX_SCRIPT}"
|
|
||||||
"${GENERATE_LEDGER_SCRIPT}"
|
|
||||||
"${REQUIREMENTS_FILE}"
|
|
||||||
"${MACRO_PARSER_COMMON}"
|
|
||||||
"${TX_TEMPLATE}"
|
|
||||||
"${TX_TEST_TEMPLATE}"
|
|
||||||
"${LEDGER_TEMPLATE}"
|
|
||||||
"${LEDGER_TEST_TEMPLATE}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Tell CMake to reconfigure automatically when any input file changes.
|
|
||||||
# The reconfigure itself is cheap — it runs the stamp check below
|
|
||||||
# which only invokes stdlib Python (no venv needed).
|
|
||||||
set_property(
|
|
||||||
DIRECTORY
|
|
||||||
APPEND
|
|
||||||
PROPERTY CMAKE_CONFIGURE_DEPENDS ${ALL_INPUT_FILES}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Find Python3 (needed for stamp check; no venv required).
|
|
||||||
if(NOT Python3_EXECUTABLE)
|
|
||||||
find_package(Python3 COMPONENTS Interpreter QUIET)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT Python3_EXECUTABLE)
|
|
||||||
# Try finding python3 executable directly
|
|
||||||
find_program(Python3_EXECUTABLE NAMES python3 python)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT Python3_EXECUTABLE)
|
|
||||||
message(
|
|
||||||
FATAL_ERROR
|
|
||||||
"Python3 not found. Code generation cannot proceed.\n"
|
|
||||||
"Please install Python 3, or set -DXRPL_NO_CODEGEN=ON to use existing generated files."
|
|
||||||
)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Check whether the stamp is up-to-date (stdlib-only, no venv).
|
|
||||||
execute_process(
|
|
||||||
COMMAND
|
|
||||||
${Python3_EXECUTABLE} "${UPDATE_STAMP_SCRIPT}" --check
|
|
||||||
"${STAMP_FILE}" ${ALL_INPUT_FILES}
|
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
||||||
RESULT_VARIABLE STAMP_CHECK_RESULT
|
|
||||||
)
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
# Fast path: stamp matches — generated files are up to date.
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
if(STAMP_CHECK_RESULT EQUAL 0)
|
|
||||||
message(
|
|
||||||
STATUS
|
|
||||||
"Protocol autogen: inputs unchanged (stamp matches), skipping generation"
|
|
||||||
)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
# Slow path: stamp mismatch — run generation at configure time.
|
|
||||||
# ------------------------------------------------------------------
|
|
||||||
message(
|
|
||||||
STATUS
|
|
||||||
"Protocol autogen: inputs changed, running code generation..."
|
|
||||||
)
|
|
||||||
|
|
||||||
# Set up Python virtual environment for code generation.
|
|
||||||
if(CODEGEN_VENV_DIR)
|
|
||||||
# User-provided venv - skip automatic setup.
|
|
||||||
set(VENV_DIR "${CODEGEN_VENV_DIR}")
|
|
||||||
message(STATUS "Using user-provided Python venv: ${VENV_DIR}")
|
|
||||||
else()
|
|
||||||
# Use default venv in build directory.
|
|
||||||
set(VENV_DIR "${CMAKE_CURRENT_BINARY_DIR}/codegen_venv")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Determine the Python/pip executables inside the venv.
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(VENV_PYTHON "${VENV_DIR}/Scripts/python.exe")
|
set(CODEGEN_PYTHON "${CODEGEN_VENV_DIR}/Scripts/python.exe")
|
||||||
set(VENV_PIP "${VENV_DIR}/Scripts/pip.exe")
|
|
||||||
else()
|
else()
|
||||||
set(VENV_PYTHON "${VENV_DIR}/bin/python")
|
set(CODEGEN_PYTHON "${CODEGEN_VENV_DIR}/bin/python")
|
||||||
set(VENV_PIP "${VENV_DIR}/bin/pip")
|
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
# Create or update the virtual environment if needed.
|
set(CODEGEN_PYTHON "${Python3_EXECUTABLE}")
|
||||||
if(NOT CODEGEN_VENV_DIR)
|
message(
|
||||||
# Check if venv needs to be created or updated.
|
WARNING
|
||||||
set(VENV_NEEDS_UPDATE FALSE)
|
"CODEGEN_VENV_DIR is not set. Dependencies will be installed globally.\n"
|
||||||
if(NOT EXISTS "${VENV_PYTHON}")
|
"If this is not intended, reconfigure with:\n"
|
||||||
set(VENV_NEEDS_UPDATE TRUE)
|
" cmake . -UCODEGEN_VENV_DIR"
|
||||||
message(
|
|
||||||
STATUS
|
|
||||||
"Creating Python virtual environment for code generation..."
|
|
||||||
)
|
|
||||||
elseif(
|
|
||||||
"${REQUIREMENTS_FILE}"
|
|
||||||
IS_NEWER_THAN
|
|
||||||
"${VENV_DIR}/.requirements_installed"
|
|
||||||
)
|
|
||||||
set(VENV_NEEDS_UPDATE TRUE)
|
|
||||||
message(
|
|
||||||
STATUS
|
|
||||||
"Updating Python virtual environment (requirements changed)..."
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Create/update virtual environment if needed.
|
|
||||||
if(VENV_NEEDS_UPDATE)
|
|
||||||
# Create the venv.
|
|
||||||
message(
|
|
||||||
STATUS
|
|
||||||
"Setting up Python virtual environment at ${VENV_DIR}"
|
|
||||||
)
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${Python3_EXECUTABLE} -m venv "${VENV_DIR}"
|
|
||||||
RESULT_VARIABLE VENV_RESULT
|
|
||||||
ERROR_VARIABLE VENV_ERROR
|
|
||||||
)
|
|
||||||
if(NOT VENV_RESULT EQUAL 0)
|
|
||||||
message(
|
|
||||||
FATAL_ERROR
|
|
||||||
"Failed to create virtual environment: ${VENV_ERROR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Warn if pip is configured with a non-default index (may need VPN).
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${VENV_PIP} config get global.index-url
|
|
||||||
OUTPUT_VARIABLE PIP_INDEX_URL
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
ERROR_QUIET
|
|
||||||
)
|
|
||||||
|
|
||||||
# Default PyPI URL
|
|
||||||
set(DEFAULT_PIP_INDEX "https://pypi.org/simple")
|
|
||||||
|
|
||||||
# Show warning if using non-default index
|
|
||||||
if(PIP_INDEX_URL AND NOT PIP_INDEX_URL STREQUAL "")
|
|
||||||
if(NOT PIP_INDEX_URL STREQUAL DEFAULT_PIP_INDEX)
|
|
||||||
message(
|
|
||||||
WARNING
|
|
||||||
"Private pip index URL detected: ${PIP_INDEX_URL}\n"
|
|
||||||
"You may need to connect to VPN to access this URL."
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Install dependencies.
|
|
||||||
message(STATUS "Installing Python dependencies...")
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${VENV_PIP} install --upgrade pip
|
|
||||||
RESULT_VARIABLE PIP_UPGRADE_RESULT
|
|
||||||
OUTPUT_QUIET
|
|
||||||
ERROR_VARIABLE PIP_UPGRADE_ERROR
|
|
||||||
)
|
|
||||||
if(NOT PIP_UPGRADE_RESULT EQUAL 0)
|
|
||||||
message(WARNING "Failed to upgrade pip: ${PIP_UPGRADE_ERROR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${VENV_PIP} install -r "${REQUIREMENTS_FILE}"
|
|
||||||
RESULT_VARIABLE PIP_INSTALL_RESULT
|
|
||||||
ERROR_VARIABLE PIP_INSTALL_ERROR
|
|
||||||
)
|
|
||||||
if(NOT PIP_INSTALL_RESULT EQUAL 0)
|
|
||||||
message(
|
|
||||||
FATAL_ERROR
|
|
||||||
"Failed to install Python dependencies: ${PIP_INSTALL_ERROR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Mark requirements as installed.
|
|
||||||
file(TOUCH "${VENV_DIR}/.requirements_installed")
|
|
||||||
message(STATUS "Python virtual environment ready")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Generate transaction classes.
|
|
||||||
execute_process(
|
|
||||||
COMMAND
|
|
||||||
${VENV_PYTHON} "${GENERATE_TX_SCRIPT}" "${TRANSACTIONS_MACRO}"
|
|
||||||
--header-dir "${AUTOGEN_HEADER_DIR}/transactions" --test-dir
|
|
||||||
"${AUTOGEN_TEST_DIR}/transactions" --sfields-macro
|
|
||||||
"${SFIELDS_MACRO}"
|
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
||||||
RESULT_VARIABLE TX_RESULT
|
|
||||||
ERROR_VARIABLE TX_ERROR
|
|
||||||
)
|
)
|
||||||
if(NOT TX_RESULT EQUAL 0)
|
endif()
|
||||||
message(FATAL_ERROR "Transaction code generation failed:\n${TX_ERROR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Generate ledger entry classes.
|
# Custom target to create a venv and install Python dependencies.
|
||||||
execute_process(
|
# Run manually with: cmake --build . --target setup_code_gen
|
||||||
COMMAND
|
if(CODEGEN_VENV_DIR)
|
||||||
${VENV_PYTHON} "${GENERATE_LEDGER_SCRIPT}" "${LEDGER_ENTRIES_MACRO}"
|
add_custom_target(
|
||||||
--header-dir "${AUTOGEN_HEADER_DIR}/ledger_entries" --test-dir
|
setup_code_gen
|
||||||
"${AUTOGEN_TEST_DIR}/ledger_entries" --sfields-macro
|
COMMAND ${Python3_EXECUTABLE} -m venv "${CODEGEN_VENV_DIR}"
|
||||||
"${SFIELDS_MACRO}"
|
COMMAND ${CODEGEN_PYTHON} -m pip install -r "${REQUIREMENTS_FILE}"
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
RESULT_VARIABLE LEDGER_RESULT
|
COMMENT "Creating venv and installing code generation dependencies..."
|
||||||
ERROR_VARIABLE LEDGER_ERROR
|
|
||||||
)
|
)
|
||||||
if(NOT LEDGER_RESULT EQUAL 0)
|
else()
|
||||||
message(
|
add_custom_target(
|
||||||
FATAL_ERROR
|
setup_code_gen
|
||||||
"Ledger entry code generation failed:\n${LEDGER_ERROR}"
|
COMMAND ${Python3_EXECUTABLE} -m pip install -r "${REQUIREMENTS_FILE}"
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Update the stamp file so subsequent configures skip generation.
|
|
||||||
execute_process(
|
|
||||||
COMMAND
|
|
||||||
${Python3_EXECUTABLE} "${UPDATE_STAMP_SCRIPT}" --update
|
|
||||||
"${STAMP_FILE}" ${ALL_INPUT_FILES}
|
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
RESULT_VARIABLE STAMP_RESULT
|
COMMENT "Installing code generation dependencies..."
|
||||||
)
|
)
|
||||||
if(NOT STAMP_RESULT EQUAL 0)
|
endif()
|
||||||
message(WARNING "Failed to update codegen stamp file")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
message(STATUS "Protocol autogen: code generation complete")
|
# Custom target for code generation, excluded from ALL.
|
||||||
endfunction()
|
# Run manually with: cmake --build . --target code_gen
|
||||||
|
add_custom_target(
|
||||||
|
code_gen
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_COMMAND} -DCODEGEN_PYTHON=${CODEGEN_PYTHON}
|
||||||
|
-DGENERATE_TX_SCRIPT=${GENERATE_TX_SCRIPT}
|
||||||
|
-DGENERATE_LEDGER_SCRIPT=${GENERATE_LEDGER_SCRIPT}
|
||||||
|
-DTRANSACTIONS_MACRO=${TRANSACTIONS_MACRO}
|
||||||
|
-DLEDGER_ENTRIES_MACRO=${LEDGER_ENTRIES_MACRO}
|
||||||
|
-DSFIELDS_MACRO=${SFIELDS_MACRO}
|
||||||
|
-DAUTOGEN_HEADER_DIR=${AUTOGEN_HEADER_DIR}
|
||||||
|
-DAUTOGEN_TEST_DIR=${AUTOGEN_TEST_DIR} -P
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/XrplProtocolAutogenRun.cmake"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
COMMENT "Running protocol code generation..."
|
||||||
|
SOURCES ${ALL_INPUT_FILES}
|
||||||
|
)
|
||||||
|
|||||||
39
cmake/XrplProtocolAutogenRun.cmake
Normal file
39
cmake/XrplProtocolAutogenRun.cmake
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
#[===================================================================[
|
||||||
|
Protocol Autogen - Run script invoked by the 'code_gen' target
|
||||||
|
#]===================================================================]
|
||||||
|
|
||||||
|
# Generate transaction classes.
|
||||||
|
execute_process(
|
||||||
|
COMMAND
|
||||||
|
${CODEGEN_PYTHON} "${GENERATE_TX_SCRIPT}" "${TRANSACTIONS_MACRO}"
|
||||||
|
--header-dir "${AUTOGEN_HEADER_DIR}/transactions" --test-dir
|
||||||
|
"${AUTOGEN_TEST_DIR}/transactions" --sfields-macro "${SFIELDS_MACRO}"
|
||||||
|
RESULT_VARIABLE TX_RESULT
|
||||||
|
OUTPUT_VARIABLE TX_OUTPUT
|
||||||
|
ERROR_VARIABLE TX_ERROR
|
||||||
|
)
|
||||||
|
if(NOT TX_RESULT EQUAL 0)
|
||||||
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"Transaction code generation failed:\n${TX_OUTPUT}\n${TX_ERROR}\n${TX_RESULT}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Generate ledger entry classes.
|
||||||
|
execute_process(
|
||||||
|
COMMAND
|
||||||
|
${CODEGEN_PYTHON} "${GENERATE_LEDGER_SCRIPT}" "${LEDGER_ENTRIES_MACRO}"
|
||||||
|
--header-dir "${AUTOGEN_HEADER_DIR}/ledger_entries" --test-dir
|
||||||
|
"${AUTOGEN_TEST_DIR}/ledger_entries" --sfields-macro "${SFIELDS_MACRO}"
|
||||||
|
RESULT_VARIABLE LEDGER_RESULT
|
||||||
|
OUTPUT_VARIABLE LEDGER_OUTPUT
|
||||||
|
ERROR_VARIABLE LEDGER_ERROR
|
||||||
|
)
|
||||||
|
if(NOT LEDGER_RESULT EQUAL 0)
|
||||||
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"Ledger entry code generation failed:\n${LEDGER_OUTPUT}\n${LEDGER_ERROR}\n${TX_RESULT}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Protocol autogen: code generation complete")
|
||||||
@@ -138,6 +138,7 @@ def main():
|
|||||||
"--sfields-macro",
|
"--sfields-macro",
|
||||||
help="Path to sfields.macro (default: auto-detect from macro_path)",
|
help="Path to sfields.macro (default: auto-detect from macro_path)",
|
||||||
)
|
)
|
||||||
|
parser.add_argument("--venv-dir", help=argparse.SUPPRESS)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Parse the macro file to get ledger entry names
|
# Parse the macro file to get ledger entry names
|
||||||
@@ -147,6 +147,7 @@ def main():
|
|||||||
"--sfields-macro",
|
"--sfields-macro",
|
||||||
help="Path to sfields.macro (default: auto-detect from macro_path)",
|
help="Path to sfields.macro (default: auto-detect from macro_path)",
|
||||||
)
|
)
|
||||||
|
parser.add_argument("--venv-dir", help=argparse.SUPPRESS)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Parse the macro file to get transaction names
|
# Parse the macro file to get transaction names
|
||||||
17
conan.lock
17
conan.lock
@@ -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%1763899256.358",
|
"sqlite3/3.51.0#66aa11eabd0e34954c5c1c061ad44abe%1774467355.988",
|
||||||
"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%1773224203.27",
|
"protobuf/6.33.5#d96d52ba5baaaa532f47bda866ad87a5%1774467363.12",
|
||||||
"openssl/3.6.1#e6399de266349245a4542fc5f6c71552%1774458290.139",
|
"openssl/3.6.1#e6399de266349245a4542fc5f6c71552%1774458290.139",
|
||||||
"nudb/2.0.9#0432758a24204da08fee953ec9ea03cb%1769436073.32",
|
"nudb/2.0.9#11149c73f8f2baff9a0198fe25971fc7%1774883011.384",
|
||||||
"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%1772623605.068",
|
"grpc/1.78.1#b1a9e74b145cc471bed4dc64dc6eb2c1%1774467387.342",
|
||||||
"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%1773224203.27",
|
"protobuf/6.33.5#d96d52ba5baaaa532f47bda866ad87a5%1774467363.12",
|
||||||
"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,16 +41,15 @@
|
|||||||
],
|
],
|
||||||
"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"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ suggestWords:
|
|||||||
words:
|
words:
|
||||||
- abempty
|
- abempty
|
||||||
- AMMID
|
- AMMID
|
||||||
|
- AMMMPT
|
||||||
|
- AMMMPToken
|
||||||
|
- AMMMPTokens
|
||||||
|
- AMMXRP
|
||||||
- amt
|
- amt
|
||||||
- amts
|
- amts
|
||||||
- asnode
|
- asnode
|
||||||
@@ -96,6 +100,7 @@ words:
|
|||||||
- distro
|
- distro
|
||||||
- doxyfile
|
- doxyfile
|
||||||
- dxrpl
|
- dxrpl
|
||||||
|
- enabled
|
||||||
- endmacro
|
- endmacro
|
||||||
- exceptioned
|
- exceptioned
|
||||||
- Falco
|
- Falco
|
||||||
@@ -148,6 +153,8 @@ words:
|
|||||||
- ltype
|
- ltype
|
||||||
- mcmodel
|
- mcmodel
|
||||||
- MEMORYSTATUSEX
|
- MEMORYSTATUSEX
|
||||||
|
- MPTAMM
|
||||||
|
- MPTDEX
|
||||||
- Merkle
|
- Merkle
|
||||||
- Metafuncton
|
- Metafuncton
|
||||||
- misprediction
|
- misprediction
|
||||||
@@ -157,6 +164,7 @@ words:
|
|||||||
- mptid
|
- mptid
|
||||||
- mptissuance
|
- mptissuance
|
||||||
- mptissuanceid
|
- mptissuanceid
|
||||||
|
- mptissue
|
||||||
- mptoken
|
- mptoken
|
||||||
- mptokenid
|
- mptokenid
|
||||||
- mptokenissuance
|
- mptokenissuance
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ network delay. A test case specifies:
|
|||||||
1. a UNL with different number of validators for different test cases,
|
1. a UNL with different number of validators for different test cases,
|
||||||
1. a network with zero or more non-validator nodes,
|
1. a network with zero or more non-validator nodes,
|
||||||
1. a sequence of validator reliability change events (by killing/restarting
|
1. a sequence of validator reliability change events (by killing/restarting
|
||||||
nodes, or by running modified rippled that does not send all validation
|
nodes, or by running modified xrpld that does not send all validation
|
||||||
messages),
|
messages),
|
||||||
1. the correct outcomes.
|
1. the correct outcomes.
|
||||||
|
|
||||||
@@ -566,7 +566,7 @@ For all the test cases, the correct outcomes are verified by examining logs. We
|
|||||||
will grep the log to see if the correct negative UNLs are generated, and whether
|
will grep the log to see if the correct negative UNLs are generated, and whether
|
||||||
or not the network is making progress when it should be. The ripdtop tool will
|
or not the network is making progress when it should be. The ripdtop tool will
|
||||||
be helpful for monitoring validators' states and ledger progress. Some of the
|
be helpful for monitoring validators' states and ledger progress. Some of the
|
||||||
timing parameters of rippled will be changed to have faster ledger time. Most if
|
timing parameters of xrpld will be changed to have faster ledger time. Most if
|
||||||
not all test cases do not need client transactions.
|
not all test cases do not need client transactions.
|
||||||
|
|
||||||
For example, the test cases for the prototype:
|
For example, the test cases for the prototype:
|
||||||
@@ -583,7 +583,7 @@ For example, the test cases for the prototype:
|
|||||||
|
|
||||||
We considered testing with the current unit test framework, specifically the
|
We considered testing with the current unit test framework, specifically the
|
||||||
[Consensus Simulation
|
[Consensus Simulation
|
||||||
Framework](https://github.com/ripple/rippled/blob/develop/src/test/csf/README.md)
|
Framework](https://github.com/XRPLF/rippled/blob/develop/src/test/csf/README.md)
|
||||||
(CSF). However, the CSF currently can only test the generic consensus algorithm
|
(CSF). However, the CSF currently can only test the generic consensus algorithm
|
||||||
as in the paper: [Analysis of the XRP Ledger Consensus
|
as in the paper: [Analysis of the XRP Ledger Consensus
|
||||||
Protocol](https://arxiv.org/abs/1802.07242).
|
Protocol](https://arxiv.org/abs/1802.07242).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ skinparam sequenceArrowThickness 2
|
|||||||
skinparam roundcorner 20
|
skinparam roundcorner 20
|
||||||
skinparam maxmessagesize 160
|
skinparam maxmessagesize 160
|
||||||
|
|
||||||
actor "Rippled Start" as RS
|
actor "Xrpld Start" as RS
|
||||||
participant "Timer" as T
|
participant "Timer" as T
|
||||||
participant "NetworkOPs" as NOP
|
participant "NetworkOPs" as NOP
|
||||||
participant "ValidatorList" as VL #lightgreen
|
participant "ValidatorList" as VL #lightgreen
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# `rippled` Docker Image
|
# `xrpld` Docker Image
|
||||||
|
|
||||||
- Some info relating to Docker containers can be found here: [../Builds/containers](../Builds/containers)
|
- Some info relating to Docker containers can be found here: [../Builds/containers](../Builds/containers)
|
||||||
- Images for building and testing rippled can be found here: [thejohnfreeman/rippled-docker](https://github.com/thejohnfreeman/rippled-docker/)
|
- Images for building and testing xrpld can be found here: [thejohnfreeman/rippled-docker](https://github.com/thejohnfreeman/rippled-docker/)
|
||||||
- These images do not have rippled. They have all the tools necessary to build rippled.
|
- These images do not have xrpld. They have all the tools necessary to build xrpld.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Project related configuration options
|
# Project related configuration options
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
DOXYFILE_ENCODING = UTF-8
|
DOXYFILE_ENCODING = UTF-8
|
||||||
PROJECT_NAME = "rippled"
|
PROJECT_NAME = "xrpld"
|
||||||
PROJECT_NUMBER =
|
PROJECT_NUMBER =
|
||||||
PROJECT_BRIEF =
|
PROJECT_BRIEF =
|
||||||
PROJECT_LOGO =
|
PROJECT_LOGO =
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
## Heap profiling of rippled with jemalloc
|
## Heap profiling of xrpld with jemalloc
|
||||||
|
|
||||||
The jemalloc library provides a good API for doing heap analysis,
|
The jemalloc library provides a good API for doing heap analysis,
|
||||||
including a mechanism to dump a description of the heap from within the
|
including a mechanism to dump a description of the heap from within the
|
||||||
@@ -7,26 +7,26 @@ activity in general, as well as how to acquire the software, are available on
|
|||||||
the jemalloc site:
|
the jemalloc site:
|
||||||
[https://github.com/jemalloc/jemalloc/wiki/Use-Case:-Heap-Profiling](https://github.com/jemalloc/jemalloc/wiki/Use-Case:-Heap-Profiling)
|
[https://github.com/jemalloc/jemalloc/wiki/Use-Case:-Heap-Profiling](https://github.com/jemalloc/jemalloc/wiki/Use-Case:-Heap-Profiling)
|
||||||
|
|
||||||
jemalloc is acquired separately from rippled, and is not affiliated
|
jemalloc is acquired separately from xrpld, and is not affiliated
|
||||||
with Ripple Labs. If you compile and install jemalloc from the
|
with Ripple Labs. If you compile and install jemalloc from the
|
||||||
source release with default options, it will install the library and header
|
source release with default options, it will install the library and header
|
||||||
under `/usr/local/lib` and `/usr/local/include`, respectively. Heap
|
under `/usr/local/lib` and `/usr/local/include`, respectively. Heap
|
||||||
profiling has been tested with rippled on a Linux platform. It should
|
profiling has been tested with xrpld on a Linux platform. It should
|
||||||
work on platforms on which both rippled and jemalloc are available.
|
work on platforms on which both xrpld and jemalloc are available.
|
||||||
|
|
||||||
To link rippled with jemalloc, the argument
|
To link xrpld with jemalloc, the argument
|
||||||
`profile-jemalloc=<jemalloc_dir>` is provided after the optional target.
|
`profile-jemalloc=<jemalloc_dir>` is provided after the optional target.
|
||||||
The `<jemalloc_dir>` argument should be the same as that of the
|
The `<jemalloc_dir>` argument should be the same as that of the
|
||||||
`--prefix` parameter passed to the jemalloc configure script when building.
|
`--prefix` parameter passed to the jemalloc configure script when building.
|
||||||
|
|
||||||
## Examples:
|
## Examples:
|
||||||
|
|
||||||
Build rippled with jemalloc library under /usr/local/lib and
|
Build xrpld with jemalloc library under /usr/local/lib and
|
||||||
header under /usr/local/include:
|
header under /usr/local/include:
|
||||||
|
|
||||||
$ scons profile-jemalloc=/usr/local
|
$ scons profile-jemalloc=/usr/local
|
||||||
|
|
||||||
Build rippled using clang with the jemalloc library under /opt/local/lib
|
Build xrpld using clang with the jemalloc library under /opt/local/lib
|
||||||
and header under /opt/local/include:
|
and header under /opt/local/include:
|
||||||
|
|
||||||
$ scons clang profile-jemalloc=/opt/local
|
$ scons clang profile-jemalloc=/opt/local
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
# Building documentation
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
Install these dependencies:
|
|
||||||
|
|
||||||
- [Doxygen](http://www.doxygen.nl): All major platforms have [official binary
|
|
||||||
distributions](http://www.doxygen.nl/download.html#srcbin), or you can
|
|
||||||
build from [source](http://www.doxygen.nl/download.html#srcbin).
|
|
||||||
- MacOS: We recommend installing via Homebrew: `brew install doxygen`.
|
|
||||||
The executable will be installed in `/usr/local/bin` which is already
|
|
||||||
in the default `PATH`.
|
|
||||||
|
|
||||||
If you use the official binary distribution, then you'll need to make
|
|
||||||
Doxygen available to your command line. You can do this by adding
|
|
||||||
a symbolic link from `/usr/local/bin` to the `doxygen` executable. For
|
|
||||||
example,
|
|
||||||
|
|
||||||
```
|
|
||||||
$ ln -s /Applications/Doxygen.app/Contents/Resources/doxygen /usr/local/bin/doxygen
|
|
||||||
```
|
|
||||||
|
|
||||||
- [PlantUML](http://plantuml.com):
|
|
||||||
1. Install a functioning Java runtime, if you don't already have one.
|
|
||||||
2. Download [`plantuml.jar`](http://sourceforge.net/projects/plantuml/files/plantuml.jar/download).
|
|
||||||
|
|
||||||
- [Graphviz](https://www.graphviz.org):
|
|
||||||
- Linux: Install from your package manager.
|
|
||||||
- Windows: Use an [official installer](https://graphviz.gitlab.io/_pages/Download/Download_windows.html).
|
|
||||||
- MacOS: Install via Homebrew: `brew install graphviz`.
|
|
||||||
|
|
||||||
## Docker
|
|
||||||
|
|
||||||
Instead of installing the above dependencies locally, you can use the official
|
|
||||||
build environment Docker image, which has all of them installed already.
|
|
||||||
|
|
||||||
1. Install [Docker](https://docs.docker.com/engine/installation/)
|
|
||||||
2. Pull the image:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo docker pull rippleci/rippled-ci-builder:2944b78d22db
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Run the image from the project folder:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo docker run -v $PWD:/opt/rippled --rm rippleci/rippled-ci-builder:2944b78d22db
|
|
||||||
```
|
|
||||||
|
|
||||||
## Build
|
|
||||||
|
|
||||||
There is a `docs` target in the CMake configuration.
|
|
||||||
|
|
||||||
```
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake -Donly_docs=ON ..
|
|
||||||
cmake --build . --target docs --parallel
|
|
||||||
```
|
|
||||||
|
|
||||||
The output will be in `build/docs/html`.
|
|
||||||
8
docs/build/depend.md
vendored
8
docs/build/depend.md
vendored
@@ -20,7 +20,7 @@ CMakeToolchain
|
|||||||
|
|
||||||
```
|
```
|
||||||
# If you want to depend on a version of libxrpl that is not in ConanCenter,
|
# If you want to depend on a version of libxrpl that is not in ConanCenter,
|
||||||
# then you can export the recipe from the rippled project.
|
# then you can export the recipe from the xrpld project.
|
||||||
conan export <path>
|
conan export <path>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -49,9 +49,9 @@ cmake --build . --parallel
|
|||||||
|
|
||||||
## CMake subdirectory
|
## CMake subdirectory
|
||||||
|
|
||||||
The second method adds the [rippled][] project as a CMake
|
The second method adds the [xrpld][] project as a CMake
|
||||||
[subdirectory][add_subdirectory].
|
[subdirectory][add_subdirectory].
|
||||||
This method works well when you keep the rippled project as a Git
|
This method works well when you keep the xrpld project as a Git
|
||||||
[submodule][].
|
[submodule][].
|
||||||
It's good for when you want to make changes to libxrpl as part of your own
|
It's good for when you want to make changes to libxrpl as part of your own
|
||||||
project.
|
project.
|
||||||
@@ -90,6 +90,6 @@ cmake --build . --parallel
|
|||||||
|
|
||||||
[add_subdirectory]: https://cmake.org/cmake/help/latest/command/add_subdirectory.html
|
[add_subdirectory]: https://cmake.org/cmake/help/latest/command/add_subdirectory.html
|
||||||
[submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
|
[submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
|
||||||
[rippled]: https://github.com/ripple/rippled
|
[xrpld]: https://github.com/XRPLF/rippled
|
||||||
[Conan]: https://docs.conan.io/
|
[Conan]: https://docs.conan.io/
|
||||||
[CMake]: https://cmake.org/cmake/help/latest/
|
[CMake]: https://cmake.org/cmake/help/latest/
|
||||||
|
|||||||
2
docs/build/environment.md
vendored
2
docs/build/environment.md
vendored
@@ -55,7 +55,7 @@ clang --version
|
|||||||
### Install Xcode Specific Version (Optional)
|
### Install Xcode Specific Version (Optional)
|
||||||
|
|
||||||
If you develop other applications using XCode you might be consistently updating to the newest version of Apple Clang.
|
If you develop other applications using XCode you might be consistently updating to the newest version of Apple Clang.
|
||||||
This will likely cause issues building rippled. You may want to install a specific version of Xcode:
|
This will likely cause issues building xrpld. You may want to install a specific version of Xcode:
|
||||||
|
|
||||||
1. **Download Xcode**
|
1. **Download Xcode**
|
||||||
- Visit [Apple Developer Downloads](https://developer.apple.com/download/more/)
|
- Visit [Apple Developer Downloads](https://developer.apple.com/download/more/)
|
||||||
|
|||||||
58
docs/build/install.md
vendored
58
docs/build/install.md
vendored
@@ -1,4 +1,4 @@
|
|||||||
This document contains instructions for installing rippled.
|
This document contains instructions for installing xrpld.
|
||||||
The APT package manager is common on Debian-based Linux distributions like
|
The APT package manager is common on Debian-based Linux distributions like
|
||||||
Ubuntu,
|
Ubuntu,
|
||||||
while the YUM package manager is common on Red Hat-based Linux distributions
|
while the YUM package manager is common on Red Hat-based Linux distributions
|
||||||
@@ -8,7 +8,7 @@ and the only supported option for installing custom builds.
|
|||||||
|
|
||||||
## From source
|
## From source
|
||||||
|
|
||||||
From a source build, you can install rippled and libxrpl using CMake's
|
From a source build, you can install xrpld and libxrpl using CMake's
|
||||||
`--install` mode:
|
`--install` mode:
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -16,7 +16,7 @@ cmake --install . --prefix /opt/local
|
|||||||
```
|
```
|
||||||
|
|
||||||
The default [prefix][1] is typically `/usr/local` on Linux and macOS and
|
The default [prefix][1] is typically `/usr/local` on Linux and macOS and
|
||||||
`C:/Program Files/rippled` on Windows.
|
`C:/Program Files/xrpld` on Windows.
|
||||||
|
|
||||||
[1]: https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html
|
[1]: https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html
|
||||||
|
|
||||||
@@ -50,9 +50,9 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and
|
|||||||
|
|
||||||
In particular, make sure that the fingerprint matches. (In the above example, the fingerprint is on the third line, starting with `C001`.)
|
In particular, make sure that the fingerprint matches. (In the above example, the fingerprint is on the third line, starting with `C001`.)
|
||||||
|
|
||||||
5. Add the appropriate Ripple repository for your operating system version:
|
5. Add the appropriate XRPL repository for your operating system version:
|
||||||
|
|
||||||
echo "deb [signed-by=/usr/local/share/keyrings/ripple-key.gpg] https://repos.ripple.com/repos/rippled-deb focal stable" | \
|
echo "deb [signed-by=/usr/local/share/keyrings/ripple-key.gpg] https://repos.ripple.com/repos/xrpld-deb focal stable" | \
|
||||||
sudo tee -a /etc/apt/sources.list.d/ripple.list
|
sudo tee -a /etc/apt/sources.list.d/ripple.list
|
||||||
|
|
||||||
The above example is appropriate for **Ubuntu 20.04 Focal Fossa**. For other operating systems, replace the word `focal` with one of the following:
|
The above example is appropriate for **Ubuntu 20.04 Focal Fossa**. For other operating systems, replace the word `focal` with one of the following:
|
||||||
@@ -61,33 +61,33 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and
|
|||||||
- `bullseye` for **Debian 11 Bullseye**
|
- `bullseye` for **Debian 11 Bullseye**
|
||||||
- `buster` for **Debian 10 Buster**
|
- `buster` for **Debian 10 Buster**
|
||||||
|
|
||||||
If you want access to development or pre-release versions of `rippled`, use one of the following instead of `stable`:
|
If you want access to development or pre-release versions of `xrpld`, use one of the following instead of `stable`:
|
||||||
- `unstable` - Pre-release builds ([`release` branch](https://github.com/ripple/rippled/tree/release))
|
- `unstable` - Pre-release builds ([`release` branch](https://github.com/XRPLF/rippled/tree/release))
|
||||||
- `nightly` - Experimental/development builds ([`develop` branch](https://github.com/ripple/rippled/tree/develop))
|
- `nightly` - Experimental/development builds ([`develop` branch](https://github.com/XRPLF/rippled/tree/develop))
|
||||||
|
|
||||||
**Warning:** Unstable and nightly builds may be broken at any time. Do not use these builds for production servers.
|
**Warning:** Unstable and nightly builds may be broken at any time. Do not use these builds for production servers.
|
||||||
|
|
||||||
6. Fetch the Ripple repository.
|
6. Fetch the XRPL repository.
|
||||||
|
|
||||||
sudo apt -y update
|
sudo apt -y update
|
||||||
|
|
||||||
7. Install the `rippled` software package:
|
7. Install the `xrpld` software package:
|
||||||
|
|
||||||
sudo apt -y install rippled
|
sudo apt -y install xrpld
|
||||||
|
|
||||||
8. Check the status of the `rippled` service:
|
8. Check the status of the `xrpld` service:
|
||||||
|
|
||||||
systemctl status rippled.service
|
systemctl status xrpld.service
|
||||||
|
|
||||||
The `rippled` service should start automatically. If not, you can start it manually:
|
The `xrpld` service should start automatically. If not, you can start it manually:
|
||||||
|
|
||||||
sudo systemctl start rippled.service
|
sudo systemctl start xrpld.service
|
||||||
|
|
||||||
9. Optional: allow `rippled` to bind to privileged ports.
|
9. Optional: allow `xrpld` to bind to privileged ports.
|
||||||
|
|
||||||
This allows you to serve incoming API requests on port 80 or 443. (If you want to do so, you must also update the config file's port settings.)
|
This allows you to serve incoming API requests on port 80 or 443. (If you want to do so, you must also update the config file's port settings.)
|
||||||
|
|
||||||
sudo setcap 'cap_net_bind_service=+ep' /opt/ripple/bin/rippled
|
sudo setcap 'cap_net_bind_service=+ep' /opt/xrpld/bin/xrpld
|
||||||
|
|
||||||
## With the YUM package manager
|
## With the YUM package manager
|
||||||
|
|
||||||
@@ -106,8 +106,8 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and
|
|||||||
enabled=1
|
enabled=1
|
||||||
gpgcheck=0
|
gpgcheck=0
|
||||||
repo_gpgcheck=1
|
repo_gpgcheck=1
|
||||||
baseurl=https://repos.ripple.com/repos/rippled-rpm/stable/
|
baseurl=https://repos.ripple.com/repos/xrpld-rpm/stable/
|
||||||
gpgkey=https://repos.ripple.com/repos/rippled-rpm/stable/repodata/repomd.xml.key
|
gpgkey=https://repos.ripple.com/repos/xrpld-rpm/stable/repodata/repomd.xml.key
|
||||||
REPOFILE
|
REPOFILE
|
||||||
|
|
||||||
_Unstable_
|
_Unstable_
|
||||||
@@ -118,8 +118,8 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and
|
|||||||
enabled=1
|
enabled=1
|
||||||
gpgcheck=0
|
gpgcheck=0
|
||||||
repo_gpgcheck=1
|
repo_gpgcheck=1
|
||||||
baseurl=https://repos.ripple.com/repos/rippled-rpm/unstable/
|
baseurl=https://repos.ripple.com/repos/xrpld-rpm/unstable/
|
||||||
gpgkey=https://repos.ripple.com/repos/rippled-rpm/unstable/repodata/repomd.xml.key
|
gpgkey=https://repos.ripple.com/repos/xrpld-rpm/unstable/repodata/repomd.xml.key
|
||||||
REPOFILE
|
REPOFILE
|
||||||
|
|
||||||
_Nightly_
|
_Nightly_
|
||||||
@@ -130,22 +130,22 @@ The default [prefix][1] is typically `/usr/local` on Linux and macOS and
|
|||||||
enabled=1
|
enabled=1
|
||||||
gpgcheck=0
|
gpgcheck=0
|
||||||
repo_gpgcheck=1
|
repo_gpgcheck=1
|
||||||
baseurl=https://repos.ripple.com/repos/rippled-rpm/nightly/
|
baseurl=https://repos.ripple.com/repos/xrpld-rpm/nightly/
|
||||||
gpgkey=https://repos.ripple.com/repos/rippled-rpm/nightly/repodata/repomd.xml.key
|
gpgkey=https://repos.ripple.com/repos/xrpld-rpm/nightly/repodata/repomd.xml.key
|
||||||
REPOFILE
|
REPOFILE
|
||||||
|
|
||||||
2. Fetch the latest repo updates:
|
2. Fetch the latest repo updates:
|
||||||
|
|
||||||
sudo yum -y update
|
sudo yum -y update
|
||||||
|
|
||||||
3. Install the new `rippled` package:
|
3. Install the new `xrpld` package:
|
||||||
|
|
||||||
sudo yum install -y rippled
|
sudo yum install -y xrpld
|
||||||
|
|
||||||
4. Configure the `rippled` service to start on boot:
|
4. Configure the `xrpld` service to start on boot:
|
||||||
|
|
||||||
sudo systemctl enable rippled.service
|
sudo systemctl enable xrpld.service
|
||||||
|
|
||||||
5. Start the `rippled` service:
|
5. Start the `xrpld` service:
|
||||||
|
|
||||||
sudo systemctl start rippled.service
|
sudo systemctl start xrpld.service
|
||||||
|
|||||||
6
docs/build/sanitizers.md
vendored
6
docs/build/sanitizers.md
vendored
@@ -1,9 +1,9 @@
|
|||||||
# Sanitizer Configuration for Rippled
|
# Sanitizer Configuration for Xrpld
|
||||||
|
|
||||||
This document explains how to properly configure and run sanitizers (AddressSanitizer, undefinedbehaviorSanitizer, ThreadSanitizer) with the xrpld project.
|
This document explains how to properly configure and run sanitizers (AddressSanitizer, undefinedbehaviorSanitizer, ThreadSanitizer) with the xrpld project.
|
||||||
Corresponding suppression files are located in the `sanitizers/suppressions` directory.
|
Corresponding suppression files are located in the `sanitizers/suppressions` directory.
|
||||||
|
|
||||||
- [Sanitizer Configuration for Rippled](#sanitizer-configuration-for-rippled)
|
- [Sanitizer Configuration for Xrpld](#sanitizer-configuration-for-xrpld)
|
||||||
- [Building with Sanitizers](#building-with-sanitizers)
|
- [Building with Sanitizers](#building-with-sanitizers)
|
||||||
- [Summary](#summary)
|
- [Summary](#summary)
|
||||||
- [Build steps:](#build-steps)
|
- [Build steps:](#build-steps)
|
||||||
@@ -100,7 +100,7 @@ export LSAN_OPTIONS="include=sanitizers/suppressions/runtime-lsan-options.txt:su
|
|||||||
|
|
||||||
- Boost intrusive containers (used in `aged_unordered_container`) trigger false positives
|
- Boost intrusive containers (used in `aged_unordered_container`) trigger false positives
|
||||||
- Boost context switching (used in `Workers.cpp`) confuses ASAN's stack tracking
|
- Boost context switching (used in `Workers.cpp`) confuses ASAN's stack tracking
|
||||||
- Since we usually don't build Boost (because we don't want to instrument Boost and detect issues in Boost code) with ASAN but use Boost containers in ASAN instrumented rippled code, it generates false positives.
|
- Since we usually don't build Boost (because we don't want to instrument Boost and detect issues in Boost code) with ASAN but use Boost containers in ASAN instrumented xrpld code, it generates false positives.
|
||||||
- Building dependencies with ASAN instrumentation reduces false positives. But we don't want to instrument dependencies like Boost with ASAN because it is slow (to compile as well as run tests) and not necessary.
|
- Building dependencies with ASAN instrumentation reduces false positives. But we don't want to instrument dependencies like Boost with ASAN because it is slow (to compile as well as run tests) and not necessary.
|
||||||
- See: https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow
|
- See: https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow
|
||||||
- More such flags are detailed [here](https://github.com/google/sanitizers/wiki/AddressSanitizerFlags)
|
- More such flags are detailed [here](https://github.com/google/sanitizers/wiki/AddressSanitizerFlags)
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
Consensus is the task of reaching agreement within a distributed system in the
|
Consensus is the task of reaching agreement within a distributed system in the
|
||||||
presence of faulty or even malicious participants. This document outlines the
|
presence of faulty or even malicious participants. This document outlines the
|
||||||
[XRP Ledger Consensus Algorithm](https://arxiv.org/abs/1802.07242)
|
[XRP Ledger Consensus Algorithm](https://arxiv.org/abs/1802.07242)
|
||||||
as implemented in [rippled](https://github.com/ripple/rippled), but
|
as implemented in [xrpld](https://github.com/XRPLF/rippled), but
|
||||||
focuses on its utility as a generic consensus algorithm independent of the
|
focuses on its utility as a generic consensus algorithm independent of the
|
||||||
detailed mechanics of the Ripple Consensus Ledger. Most notably, the algorithm
|
detailed mechanics of the XRPL consensus Ledger. Most notably, the algorithm
|
||||||
does not require fully synchronous communication between all nodes in the
|
does not require fully synchronous communication between all nodes in the
|
||||||
network, or even a fixed network topology, but instead achieves consensus via
|
network, or even a fixed network topology, but instead achieves consensus via
|
||||||
collectively trusted subnetworks.
|
collectively trusted subnetworks.
|
||||||
@@ -15,7 +15,7 @@ collectively trusted subnetworks.
|
|||||||
## Distributed Agreement
|
## Distributed Agreement
|
||||||
|
|
||||||
A challenge for distributed systems is reaching agreement on changes in shared
|
A challenge for distributed systems is reaching agreement on changes in shared
|
||||||
state. For the Ripple network, the shared state is the current ledger--account
|
state. For the XRPL network, the shared state is the current ledger--account
|
||||||
information, account balances, order books and other financial data. We will
|
information, account balances, order books and other financial data. We will
|
||||||
refer to shared distributed state as a /ledger/ throughout the remainder of this
|
refer to shared distributed state as a /ledger/ throughout the remainder of this
|
||||||
document.
|
document.
|
||||||
@@ -23,7 +23,7 @@ document.
|
|||||||

|

|
||||||
|
|
||||||
As shown above, new ledgers are made by applying a set of transactions to the
|
As shown above, new ledgers are made by applying a set of transactions to the
|
||||||
prior ledger. For the Ripple network, transactions include payments,
|
prior ledger. For the XRPL network, transactions include payments,
|
||||||
modification of account settings, updates to offers and more.
|
modification of account settings, updates to offers and more.
|
||||||
|
|
||||||
In a centralized system, generating the next ledger is trivial since there is a
|
In a centralized system, generating the next ledger is trivial since there is a
|
||||||
@@ -33,10 +33,10 @@ the set of transactions to include, the order to apply those transactions, and
|
|||||||
even the resulting ledger after applying the transactions. This is even more
|
even the resulting ledger after applying the transactions. This is even more
|
||||||
difficult when some participants are faulty or malicious.
|
difficult when some participants are faulty or malicious.
|
||||||
|
|
||||||
The Ripple network is a decentralized and **trust-full** network. Anyone is free
|
The XRPL network is a decentralized and **trust-full** network. Anyone is free
|
||||||
to join and participants are free to choose a subset of peers that are
|
to join and participants are free to choose a subset of peers that are
|
||||||
collectively trusted to not collude in an attempt to defraud the participant.
|
collectively trusted to not collude in an attempt to defraud the participant.
|
||||||
Leveraging this network of trust, the Ripple algorithm has two main components.
|
Leveraging this network of trust, the XRPL algorithm has two main components.
|
||||||
|
|
||||||
- _Consensus_ in which network participants agree on the transactions to apply
|
- _Consensus_ in which network participants agree on the transactions to apply
|
||||||
to a prior ledger, based on the positions of their chosen peers.
|
to a prior ledger, based on the positions of their chosen peers.
|
||||||
@@ -54,9 +54,9 @@ and was abandoned.
|
|||||||
|
|
||||||
The remainder of this section describes the Consensus and Validation algorithms
|
The remainder of this section describes the Consensus and Validation algorithms
|
||||||
in more detail and is meant as a companion guide to understanding the generic
|
in more detail and is meant as a companion guide to understanding the generic
|
||||||
implementation in `rippled`. The document **does not** discuss correctness,
|
implementation in `xrpld`. The document **does not** discuss correctness,
|
||||||
fault-tolerance or liveness properties of the algorithms or the full details of
|
fault-tolerance or liveness properties of the algorithms or the full details of
|
||||||
how they integrate within `rippled` to support the Ripple Consensus Ledger.
|
how they integrate within `xrpld` to support the XRPL consensus Ledger.
|
||||||
|
|
||||||
## Consensus Overview
|
## Consensus Overview
|
||||||
|
|
||||||
|
|||||||
2
external/README.md
vendored
2
external/README.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
# External Conan recipes
|
# External Conan recipes
|
||||||
|
|
||||||
The subdirectories in this directory contain external libraries used by rippled.
|
The subdirectories in this directory contain external libraries used by xrpld.
|
||||||
|
|
||||||
| Folder | Upstream | Description |
|
| Folder | Upstream | Description |
|
||||||
| :--------------- | :------------------------------------------------------------- | :------------------------------------------------------------------------------------------- |
|
| :--------------- | :------------------------------------------------------------- | :------------------------------------------------------------------------------------------- |
|
||||||
|
|||||||
4
external/antithesis-sdk/CMakeLists.txt
vendored
4
external/antithesis-sdk/CMakeLists.txt
vendored
@@ -1,11 +1,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.18)
|
cmake_minimum_required(VERSION 3.18)
|
||||||
|
|
||||||
# Note, version set explicitly by rippled project
|
# Note, version set explicitly by xrpld project
|
||||||
project(antithesis-sdk-cpp VERSION 0.4.4 LANGUAGES CXX)
|
project(antithesis-sdk-cpp VERSION 0.4.4 LANGUAGES CXX)
|
||||||
|
|
||||||
add_library(antithesis-sdk-cpp INTERFACE antithesis_sdk.h)
|
add_library(antithesis-sdk-cpp INTERFACE antithesis_sdk.h)
|
||||||
|
|
||||||
# Note, both sections below created by rippled project
|
# Note, both sections below created by xrpld project
|
||||||
target_include_directories(antithesis-sdk-cpp INTERFACE
|
target_include_directories(antithesis-sdk-cpp INTERFACE
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ set(T& target, std::string const& name, Section const& section)
|
|||||||
if ((found_and_valid = val.has_value()))
|
if ((found_and_valid = val.has_value()))
|
||||||
target = *val;
|
target = *val;
|
||||||
}
|
}
|
||||||
catch (boost::bad_lexical_cast&)
|
catch (boost::bad_lexical_cast const&) // NOLINT(bugprone-empty-catch)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
return found_and_valid;
|
return found_and_valid;
|
||||||
@@ -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 found_and_valid = set<T>(target, name, section);
|
bool const 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;
|
||||||
@@ -330,7 +330,7 @@ get(Section const& section, std::string const& name, T const& defaultValue = T{}
|
|||||||
{
|
{
|
||||||
return section.value_or<T>(name, defaultValue);
|
return section.value_or<T>(name, defaultValue);
|
||||||
}
|
}
|
||||||
catch (boost::bad_lexical_cast&)
|
catch (boost::bad_lexical_cast const&) // NOLINT(bugprone-empty-catch)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
@@ -345,7 +345,7 @@ get(Section const& section, std::string const& name, char const* defaultValue)
|
|||||||
if (val.has_value())
|
if (val.has_value())
|
||||||
return *val;
|
return *val;
|
||||||
}
|
}
|
||||||
catch (boost::bad_lexical_cast&)
|
catch (boost::bad_lexical_cast const&) // NOLINT(bugprone-empty-catch)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
|
|||||||
@@ -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;
|
Counter* head = nullptr;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@ private:
|
|||||||
Derived classes have their instances counted automatically. This is used
|
Derived classes have their instances counted automatically. This is used
|
||||||
for reporting purposes.
|
for reporting purposes.
|
||||||
|
|
||||||
@ingroup ripple_basics
|
@ingroup basics
|
||||||
*/
|
*/
|
||||||
template <class Object>
|
template <class Object>
|
||||||
class CountedObject
|
class CountedObject
|
||||||
@@ -112,7 +112,6 @@ private:
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
|
||||||
CountedObject() noexcept
|
CountedObject() noexcept
|
||||||
{
|
{
|
||||||
getCounter().increment();
|
getCounter().increment();
|
||||||
@@ -126,10 +125,13 @@ public:
|
|||||||
CountedObject&
|
CountedObject&
|
||||||
operator=(CountedObject const&) noexcept = default;
|
operator=(CountedObject const&) noexcept = default;
|
||||||
|
|
||||||
|
public:
|
||||||
~CountedObject() noexcept
|
~CountedObject() noexcept
|
||||||
{
|
{
|
||||||
getCounter().decrement();
|
getCounter().decrement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
friend Object;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace xrpl
|
} // namespace xrpl
|
||||||
|
|||||||
@@ -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) : value_(0), when_(now)
|
explicit DecayWindow(time_point now) : when_(now)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ private:
|
|||||||
when_ = now;
|
when_ = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
double value_;
|
double value_{0};
|
||||||
time_point when_;
|
time_point when_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ concept CAdoptTag = std::is_same_v<T, SharedIntrusiveAdoptIncrementStrongTag> ||
|
|||||||
still retaining the reference counts. For example, for SHAMapInnerNodes the
|
still retaining the reference counts. For example, for SHAMapInnerNodes the
|
||||||
children may be reset in that function. Note that std::shared_pointer WILL
|
children may be reset in that function. Note that std::shared_pointer WILL
|
||||||
run the destructor when the strong count reaches zero, but may not free the
|
run the destructor when the strong count reaches zero, but may not free the
|
||||||
memory used by the object until the weak count reaches zero. In rippled, we
|
memory used by the object until the weak count reaches zero. In xrpld, we
|
||||||
typically allocate shared pointers with the `make_shared` function. When
|
typically allocate shared pointers with the `make_shared` function. When
|
||||||
that is used, the memory is not reclaimed until the weak count reaches zero.
|
that is used, the memory is not reclaimed until the weak count reaches zero.
|
||||||
*/
|
*/
|
||||||
@@ -84,7 +84,8 @@ public:
|
|||||||
|
|
||||||
template <class TT>
|
template <class TT>
|
||||||
requires std::convertible_to<TT*, T*>
|
requires std::convertible_to<TT*, T*>
|
||||||
SharedIntrusive(SharedIntrusive<TT>&& rhs);
|
SharedIntrusive(
|
||||||
|
SharedIntrusive<TT>&& rhs); // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
|
||||||
|
|
||||||
SharedIntrusive&
|
SharedIntrusive&
|
||||||
operator=(SharedIntrusive const& rhs);
|
operator=(SharedIntrusive const& rhs);
|
||||||
@@ -106,7 +107,8 @@ public:
|
|||||||
template <class TT>
|
template <class TT>
|
||||||
requires std::convertible_to<TT*, T*>
|
requires std::convertible_to<TT*, T*>
|
||||||
SharedIntrusive&
|
SharedIntrusive&
|
||||||
operator=(SharedIntrusive<TT>&& rhs);
|
operator=(
|
||||||
|
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
|
||||||
@@ -314,7 +316,8 @@ public:
|
|||||||
|
|
||||||
template <class TT>
|
template <class TT>
|
||||||
requires std::convertible_to<TT*, T*>
|
requires std::convertible_to<TT*, T*>
|
||||||
SharedWeakUnion(SharedIntrusive<TT>&& rhs);
|
SharedWeakUnion(
|
||||||
|
SharedIntrusive<TT>&& rhs); // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
|
||||||
|
|
||||||
SharedWeakUnion&
|
SharedWeakUnion&
|
||||||
operator=(SharedWeakUnion const& rhs);
|
operator=(SharedWeakUnion const& rhs);
|
||||||
@@ -327,7 +330,8 @@ public:
|
|||||||
template <class TT>
|
template <class TT>
|
||||||
requires std::convertible_to<TT*, T*>
|
requires std::convertible_to<TT*, T*>
|
||||||
SharedWeakUnion&
|
SharedWeakUnion&
|
||||||
operator=(SharedIntrusive<TT>&& rhs);
|
operator=(
|
||||||
|
SharedIntrusive<TT>&& rhs); // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
|
||||||
|
|
||||||
~SharedWeakUnion();
|
~SharedWeakUnion();
|
||||||
|
|
||||||
|
|||||||
@@ -68,9 +68,7 @@ SharedIntrusive<T>::operator=(SharedIntrusive const& rhs)
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
template <class TT>
|
template <class TT>
|
||||||
// clang-format off
|
requires std::convertible_to<TT*, T*>
|
||||||
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)
|
||||||
{
|
{
|
||||||
@@ -101,9 +99,7 @@ SharedIntrusive<T>::operator=(SharedIntrusive&& rhs)
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
template <class TT>
|
template <class TT>
|
||||||
// clang-format off
|
requires std::convertible_to<TT*, T*>
|
||||||
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)
|
||||||
{
|
{
|
||||||
@@ -307,9 +303,7 @@ WeakIntrusive<T>::WeakIntrusive(SharedIntrusive<T> const& rhs) : ptr_{rhs.unsafe
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
template <class TT>
|
template <class TT>
|
||||||
// clang-format off
|
requires std::convertible_to<TT*, T*>
|
||||||
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)
|
||||||
{
|
{
|
||||||
@@ -454,9 +448,7 @@ SharedWeakUnion<T>::operator=(SharedWeakUnion const& rhs)
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
template <class TT>
|
template <class TT>
|
||||||
// clang-format off
|
requires std::convertible_to<TT*, T*>
|
||||||
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)
|
||||||
{
|
{
|
||||||
@@ -470,9 +462,7 @@ SharedWeakUnion<T>::operator=(SharedIntrusive<TT> const& rhs)
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
template <class TT>
|
template <class TT>
|
||||||
// clang-format off
|
requires std::convertible_to<TT*, T*>
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ enum class ReleaseWeakRefAction { noop, destroy };
|
|||||||
/** Implement the strong count, weak count, and bit flags for an intrusive
|
/** Implement the strong count, weak count, and bit flags for an intrusive
|
||||||
pointer.
|
pointer.
|
||||||
|
|
||||||
A class can satisfy the requirements of a xrpl::IntrusivePointer by
|
A class can satisfy the requirements of an xrpl::IntrusivePointer by
|
||||||
inheriting from this class.
|
inheriting from this class.
|
||||||
*/
|
*/
|
||||||
struct IntrusiveRefCounts
|
struct IntrusiveRefCounts
|
||||||
@@ -448,7 +448,7 @@ inline void
|
|||||||
partialDestructorFinished(T** o)
|
partialDestructorFinished(T** o)
|
||||||
{
|
{
|
||||||
T& self = **o;
|
T& self = **o;
|
||||||
IntrusiveRefCounts::RefCountPair p =
|
IntrusiveRefCounts::RefCountPair const 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),
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ private:
|
|||||||
// expensive argument lists if the stream is not active.
|
// expensive argument lists if the stream is not active.
|
||||||
#ifndef JLOG
|
#ifndef JLOG
|
||||||
#define JLOG(x) \
|
#define JLOG(x) \
|
||||||
if (!x) \
|
if (!(x)) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
@@ -235,7 +235,7 @@ private:
|
|||||||
|
|
||||||
#ifndef CLOG
|
#ifndef CLOG
|
||||||
#define CLOG(ss) \
|
#define CLOG(ss) \
|
||||||
if (!ss) \
|
if (!(ss)) \
|
||||||
; \
|
; \
|
||||||
else \
|
else \
|
||||||
*ss
|
*ss
|
||||||
|
|||||||
@@ -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_)), max(min * 10 - 1), log(logTen(min).value_or(-1)), scale(scale_)
|
: min(getMin(scale_)), log(logTen(min).value_or(-1)), scale(scale_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
rep min;
|
rep min;
|
||||||
rep max;
|
rep max{min * 10 - 1};
|
||||||
int log;
|
int log;
|
||||||
mantissa_scale scale;
|
mantissa_scale scale;
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
Utility functions and classes.
|
Utility functions and classes.
|
||||||
|
|
||||||
ripple/basic should contain no dependencies on other modules.
|
The module xrpl/basics should contain no dependencies on other modules.
|
||||||
|
|
||||||
# Choosing a rippled container.
|
# Choosing an xrpld container.
|
||||||
|
|
||||||
- `std::vector`
|
- `std::vector`
|
||||||
- For ordered containers with most insertions or erases at the end.
|
- For ordered containers with most insertions or erases at the end.
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class SlabAllocator
|
|||||||
{
|
{
|
||||||
// Use memcpy to avoid unaligned UB
|
// Use memcpy to avoid unaligned UB
|
||||||
// (will optimize to equivalent code)
|
// (will optimize to equivalent code)
|
||||||
std::memcpy(data, &l_, sizeof(std::uint8_t*));
|
std::memcpy(data, static_cast<void const*>(&l_), sizeof(std::uint8_t*));
|
||||||
l_ = data;
|
l_ = data;
|
||||||
data += item;
|
data += item;
|
||||||
}
|
}
|
||||||
@@ -91,10 +91,10 @@ class SlabAllocator
|
|||||||
std::uint8_t*
|
std::uint8_t*
|
||||||
allocate() noexcept
|
allocate() noexcept
|
||||||
{
|
{
|
||||||
std::uint8_t* ret;
|
std::uint8_t* ret = nullptr; // NOLINT(misc-const-correctness)
|
||||||
|
|
||||||
{
|
{
|
||||||
std::lock_guard l(m_);
|
std::lock_guard const l(m_);
|
||||||
|
|
||||||
ret = l_;
|
ret = l_;
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ class SlabAllocator
|
|||||||
{
|
{
|
||||||
// Use memcpy to avoid unaligned UB
|
// Use memcpy to avoid unaligned UB
|
||||||
// (will optimize to equivalent code)
|
// (will optimize to equivalent code)
|
||||||
std::memcpy(&l_, ret, sizeof(std::uint8_t*));
|
std::memcpy(static_cast<void*>(&l_), ret, sizeof(std::uint8_t*));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,11 +123,11 @@ 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 l(m_);
|
std::lock_guard const l(m_);
|
||||||
|
|
||||||
// Use memcpy to avoid unaligned UB
|
// Use memcpy to avoid unaligned UB
|
||||||
// (will optimize to equivalent code)
|
// (will optimize to equivalent code)
|
||||||
std::memcpy(ptr, &l_, sizeof(std::uint8_t*));
|
std::memcpy(ptr, static_cast<void const*>(&l_), sizeof(std::uint8_t*));
|
||||||
l_ = ptr;
|
l_ = ptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -210,16 +210,13 @@ 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 size = slabSize_;
|
std::size_t const 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
|
||||||
|
|||||||
@@ -66,12 +66,12 @@ strUnHex(std::size_t strSize, Iterator begin, Iterator end)
|
|||||||
|
|
||||||
while (iter != end)
|
while (iter != end)
|
||||||
{
|
{
|
||||||
int cHigh = digitLookupTable[*iter++];
|
int const cHigh = digitLookupTable[*iter++];
|
||||||
|
|
||||||
if (cHigh < 0)
|
if (cHigh < 0)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
int cLow = digitLookupTable[*iter++];
|
int const cLow = digitLookupTable[*iter++];
|
||||||
|
|
||||||
if (cLow < 0)
|
if (cLow < 0)
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@@ -182,8 +182,7 @@ 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)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,8 +190,8 @@ private:
|
|||||||
beast::insight::Gauge size;
|
beast::insight::Gauge size;
|
||||||
beast::insight::Gauge hit_rate;
|
beast::insight::Gauge hit_rate;
|
||||||
|
|
||||||
std::size_t hits;
|
std::size_t hits{0};
|
||||||
std::size_t misses;
|
std::size_t misses{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
class KeyOnlyEntry
|
class KeyOnlyEntry
|
||||||
@@ -294,10 +293,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;
|
int m_cache_count{0};
|
||||||
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;
|
std::uint64_t m_hits{0};
|
||||||
std::uint64_t m_misses;
|
std::uint64_t m_misses{0};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace xrpl
|
} // namespace xrpl
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ 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)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public:
|
|||||||
explicit UptimeClock() = default;
|
explicit UptimeClock() = default;
|
||||||
|
|
||||||
static time_point
|
static time_point
|
||||||
now(); // seconds since rippled program start
|
now(); // seconds since xrpld program start
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::atomic<rep> now_;
|
static std::atomic<rep> now_;
|
||||||
|
|||||||
@@ -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 shift : {4u, 0u, 12u, 8u, 20u, 16u, 28u, 24u})
|
for (std::uint32_t const 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,11 +335,13 @@ 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];
|
||||||
@@ -444,7 +446,7 @@ public:
|
|||||||
|
|
||||||
for (int i = WIDTH; i--;)
|
for (int i = WIDTH; i--;)
|
||||||
{
|
{
|
||||||
std::uint64_t n = carry + boost::endian::big_to_native(data_[i]) +
|
std::uint64_t const 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));
|
||||||
@@ -621,7 +623,7 @@ template <>
|
|||||||
inline std::size_t
|
inline std::size_t
|
||||||
extract(uint256 const& key)
|
extract(uint256 const& key)
|
||||||
{
|
{
|
||||||
std::size_t result;
|
std::size_t result = 0;
|
||||||
// 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));
|
||||||
|
|||||||
@@ -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 e;
|
throw std::move(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when faulty logic causes a broken invariant. */
|
/** Called when faulty logic causes a broken invariant. */
|
||||||
|
|||||||
@@ -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 lock(state.mutex);
|
std::lock_guard const lock(state.mutex);
|
||||||
return {state.dist(state.gen), state.dist(state.gen)};
|
return {state.dist(state.gen), state.dist(state.gen)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,14 +14,16 @@ 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 XRPL 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 XRPL default PRNG engine return must be at least 64 bits wide.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
@@ -56,9 +58,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;
|
std::uint64_t seed = 0;
|
||||||
{
|
{
|
||||||
std::lock_guard lk(m);
|
std::lock_guard const 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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
std::size_t m_count{1};
|
||||||
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;
|
bool m_cancel{false};
|
||||||
|
|
||||||
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_count(1), m_period(period), m_ios(ios), m_timer(m_ios), m_cancel(false)
|
: m_period(period), m_ios(ios), m_timer(m_ios)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
void
|
void
|
||||||
sample_one(Handler&& handler)
|
sample_one(Handler&& handler)
|
||||||
{
|
{
|
||||||
std::lock_guard lock(m_mutex);
|
std::lock_guard const 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 lock(m_mutex);
|
std::lock_guard const 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 lock(m_mutex);
|
std::lock_guard const lock(m_mutex);
|
||||||
++m_count;
|
++m_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
release()
|
release()
|
||||||
{
|
{
|
||||||
std::lock_guard lock(m_mutex);
|
std::lock_guard const 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 lock(m_probe->m_mutex);
|
std::lock_guard const lock(m_probe->m_mutex);
|
||||||
if (m_probe->m_cancel)
|
if (m_probe->m_cancel)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ struct aged_associative_container_extract_t<false>
|
|||||||
Value const&
|
Value const&
|
||||||
operator()(Value const& value) const
|
operator()(Value const& value) const
|
||||||
{
|
{
|
||||||
return value;
|
return value; // NOLINT(bugprone-return-const-ref-from-parameter)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -257,12 +257,15 @@ private:
|
|||||||
|
|
||||||
config_t(config_t&& other)
|
config_t(config_t&& other)
|
||||||
: KeyValueCompare(std::move(other.key_compare()))
|
: KeyValueCompare(std::move(other.key_compare()))
|
||||||
, beast::detail::empty_base_optimization<ElementAllocator>(std::move(other))
|
, beast::detail::empty_base_optimization<ElementAllocator>(std::move(
|
||||||
|
static_cast<beast::detail::empty_base_optimization<ElementAllocator>&>(other)))
|
||||||
, clock(other.clock)
|
, clock(other.clock)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
config_t(config_t&& other, Allocator const& alloc)
|
config_t(
|
||||||
|
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)
|
||||||
@@ -552,7 +555,10 @@ public:
|
|||||||
|
|
||||||
aged_ordered_container(aged_ordered_container&& other);
|
aged_ordered_container(aged_ordered_container&& other);
|
||||||
|
|
||||||
aged_ordered_container(aged_ordered_container&& other, Allocator const& alloc);
|
aged_ordered_container(
|
||||||
|
// 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);
|
||||||
|
|
||||||
@@ -1290,7 +1296,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,
|
aged_ordered_container&& other, // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved)
|
||||||
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
|
||||||
|
|||||||
@@ -318,7 +318,9 @@ private:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
config_t(config_t&& other, Allocator const& alloc)
|
config_t(
|
||||||
|
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)
|
||||||
@@ -774,7 +776,10 @@ public:
|
|||||||
|
|
||||||
aged_unordered_container(aged_unordered_container&& other);
|
aged_unordered_container(aged_unordered_container&& other);
|
||||||
|
|
||||||
aged_unordered_container(aged_unordered_container&& other, Allocator const& alloc);
|
aged_unordered_container(
|
||||||
|
// 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);
|
||||||
|
|
||||||
@@ -1838,7 +1843,10 @@ 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&& other, Allocator const& alloc)
|
aged_unordered_container(
|
||||||
|
// 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()))
|
||||||
|
|||||||
@@ -35,9 +35,11 @@ struct CopyConst<T const, U>
|
|||||||
template <typename T, typename Tag>
|
template <typename T, typename Tag>
|
||||||
class ListNode
|
class ListNode
|
||||||
{
|
{
|
||||||
private:
|
ListNode() = default;
|
||||||
|
|
||||||
using value_type = T;
|
using value_type = T;
|
||||||
|
|
||||||
|
friend T;
|
||||||
friend class List<T, Tag>;
|
friend class List<T, Tag>;
|
||||||
|
|
||||||
template <typename>
|
template <typename>
|
||||||
@@ -449,7 +451,7 @@ public:
|
|||||||
iterator
|
iterator
|
||||||
erase(iterator pos) noexcept
|
erase(iterator pos) noexcept
|
||||||
{
|
{
|
||||||
Node* node = &*pos;
|
Node const* 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;
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ public:
|
|||||||
bool
|
bool
|
||||||
push_front(Node* node)
|
push_front(Node* node)
|
||||||
{
|
{
|
||||||
bool first;
|
bool first = false;
|
||||||
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;
|
Node* new_head = nullptr;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (node == &m_end)
|
if (node == &m_end)
|
||||||
|
|||||||
@@ -203,7 +203,8 @@ template <class Hasher, class T>
|
|||||||
inline std::enable_if_t<is_contiguously_hashable<T, Hasher>::value>
|
inline std::enable_if_t<is_contiguously_hashable<T, Hasher>::value>
|
||||||
hash_append(Hasher& h, T const& t) noexcept
|
hash_append(Hasher& h, T const& t) noexcept
|
||||||
{
|
{
|
||||||
h(std::addressof(t), sizeof(t));
|
// NOLINTNEXTLINE(bugprone-sizeof-expression)
|
||||||
|
h(static_cast<void const*>(std::addressof(t)), sizeof(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Hasher, class T>
|
template <class Hasher, class T>
|
||||||
|
|||||||
@@ -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_;
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,9 @@ is_white(char c)
|
|||||||
case '\t':
|
case '\t':
|
||||||
case '\v':
|
case '\v':
|
||||||
return true;
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
};
|
};
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class FwdIter>
|
template <class FwdIter>
|
||||||
|
|||||||
@@ -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 lock{m_};
|
std::lock_guard const lock{m_};
|
||||||
if (--running_ == 0)
|
if (--running_ == 0)
|
||||||
cv_.notify_all();
|
cv_.notify_all();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -118,18 +118,18 @@ private:
|
|||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
void
|
void
|
||||||
reporter<_>::suite_results::add(case_results const& r)
|
reporter<Unused>::suite_results::add(case_results const& r)
|
||||||
{
|
{
|
||||||
++cases;
|
++cases;
|
||||||
total += r.total;
|
total += r.total;
|
||||||
failed += r.failed;
|
failed += r.failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
void
|
void
|
||||||
reporter<_>::results::add(suite_results const& r)
|
reporter<Unused>::results::add(suite_results const& r)
|
||||||
{
|
{
|
||||||
++suites;
|
++suites;
|
||||||
total += r.total;
|
total += r.total;
|
||||||
@@ -160,13 +160,13 @@ reporter<_>::results::add(suite_results const& r)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
reporter<_>::reporter(std::ostream& os) : os_(os)
|
reporter<Unused>::reporter(std::ostream& os) : os_(os)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
reporter<_>::~reporter()
|
reporter<Unused>::~reporter()
|
||||||
{
|
{
|
||||||
if (results_.top.size() > 0)
|
if (results_.top.size() > 0)
|
||||||
{
|
{
|
||||||
@@ -180,9 +180,9 @@ reporter<_>::~reporter()
|
|||||||
<< amount{results_.failed, "failure"} << std::endl;
|
<< amount{results_.failed, "failure"} << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
std::string
|
std::string
|
||||||
reporter<_>::fmtdur(typename clock_type::duration const& d)
|
reporter<Unused>::fmtdur(typename clock_type::duration const& d)
|
||||||
{
|
{
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
auto const ms = duration_cast<milliseconds>(d);
|
auto const ms = duration_cast<milliseconds>(d);
|
||||||
@@ -193,46 +193,46 @@ reporter<_>::fmtdur(typename clock_type::duration const& d)
|
|||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
void
|
void
|
||||||
reporter<_>::on_suite_begin(suite_info const& info)
|
reporter<Unused>::on_suite_begin(suite_info const& info)
|
||||||
{
|
{
|
||||||
suite_results_ = suite_results{info.full_name()};
|
suite_results_ = suite_results{info.full_name()};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
void
|
void
|
||||||
reporter<_>::on_suite_end()
|
reporter<Unused>::on_suite_end()
|
||||||
{
|
{
|
||||||
results_.add(suite_results_);
|
results_.add(suite_results_);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
void
|
void
|
||||||
reporter<_>::on_case_begin(std::string const& name)
|
reporter<Unused>::on_case_begin(std::string const& name)
|
||||||
{
|
{
|
||||||
case_results_ = case_results(name);
|
case_results_ = case_results(name);
|
||||||
os_ << suite_results_.name << (case_results_.name.empty() ? "" : (" " + case_results_.name))
|
os_ << suite_results_.name << (case_results_.name.empty() ? "" : (" " + case_results_.name))
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
void
|
void
|
||||||
reporter<_>::on_case_end()
|
reporter<Unused>::on_case_end()
|
||||||
{
|
{
|
||||||
suite_results_.add(case_results_);
|
suite_results_.add(case_results_);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
void
|
void
|
||||||
reporter<_>::on_pass()
|
reporter<Unused>::on_pass()
|
||||||
{
|
{
|
||||||
++case_results_.total;
|
++case_results_.total;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
void
|
void
|
||||||
reporter<_>::on_fail(std::string const& reason)
|
reporter<Unused>::on_fail(std::string const& reason)
|
||||||
{
|
{
|
||||||
++case_results_.failed;
|
++case_results_.failed;
|
||||||
++case_results_.total;
|
++case_results_.total;
|
||||||
@@ -240,9 +240,9 @@ reporter<_>::on_fail(std::string const& reason)
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _>
|
template <class Unused>
|
||||||
void
|
void
|
||||||
reporter<_>::on_log(std::string const& s)
|
reporter<Unused>::on_log(std::string const& s)
|
||||||
{
|
{
|
||||||
os_ << s;
|
os_ << s;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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_;
|
std::size_t failed_{0};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
tests_t() : failed_(0)
|
tests_t()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,9 +145,9 @@ public:
|
|||||||
void
|
void
|
||||||
insert(case_results&& r)
|
insert(case_results&& r)
|
||||||
{
|
{
|
||||||
cont().emplace_back(std::move(r));
|
|
||||||
total_ += r.tests.total();
|
total_ += r.tests.total();
|
||||||
failed_ += r.tests.failed();
|
failed_ += r.tests.failed();
|
||||||
|
cont().emplace_back(std::move(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -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;
|
std::size_t m_cases{0};
|
||||||
std::size_t total_;
|
std::size_t total_{0};
|
||||||
std::size_t failed_;
|
std::size_t failed_{0};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
results() : m_cases(0), total_(0), failed_(0)
|
results()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ template <class>
|
|||||||
void
|
void
|
||||||
runner::testcase(std::string const& name)
|
runner::testcase(std::string const& name)
|
||||||
{
|
{
|
||||||
std::lock_guard lock(mutex_);
|
std::lock_guard const 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 lock(mutex_);
|
std::lock_guard const 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 lock(mutex_);
|
std::lock_guard const 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 lock(mutex_);
|
std::lock_guard const lock(mutex_);
|
||||||
if (default_)
|
if (default_)
|
||||||
testcase("");
|
testcase("");
|
||||||
on_log(s);
|
on_log(s);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ make_reason(String const& reason, char const* file, int line)
|
|||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
class thread;
|
class Thread;
|
||||||
|
|
||||||
enum abort_t { no_abort_on_fail, abort_on_fail };
|
enum abort_t { no_abort_on_fail, abort_on_fail };
|
||||||
|
|
||||||
@@ -295,12 +295,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class thread;
|
friend class Thread;
|
||||||
|
|
||||||
static suite**
|
static suite**
|
||||||
p_this_suite()
|
p_this_suite()
|
||||||
{
|
{
|
||||||
static suite* pts = nullptr;
|
static suite* pts = nullptr; // NOLINT(misc-const-correctness)
|
||||||
return &pts;
|
return &pts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,7 +538,7 @@ suite::run(runner& r)
|
|||||||
{
|
{
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
catch (abort_exception const&)
|
catch (abort_exception const&) // NOLINT(bugprone-empty-catch)
|
||||||
{
|
{
|
||||||
// ends the suite
|
// ends the suite
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace beast {
|
|||||||
namespace unit_test {
|
namespace unit_test {
|
||||||
|
|
||||||
/** Replacement for std::thread that handles exceptions in unit tests. */
|
/** Replacement for std::thread that handles exceptions in unit tests. */
|
||||||
class thread
|
class Thread
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
suite* s_ = nullptr;
|
suite* s_ = nullptr;
|
||||||
@@ -24,17 +24,17 @@ public:
|
|||||||
using id = std::thread::id;
|
using id = std::thread::id;
|
||||||
using native_handle_type = std::thread::native_handle_type;
|
using native_handle_type = std::thread::native_handle_type;
|
||||||
|
|
||||||
thread() = default;
|
Thread() = default;
|
||||||
thread(thread const&) = delete;
|
Thread(Thread const&) = delete;
|
||||||
thread&
|
Thread&
|
||||||
operator=(thread const&) = delete;
|
operator=(Thread const&) = delete;
|
||||||
|
|
||||||
thread(thread&& other) : s_(other.s_), t_(std::move(other.t_))
|
Thread(Thread&& other) : s_(other.s_), t_(std::move(other.t_))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
thread&
|
Thread&
|
||||||
operator=(thread&& other)
|
operator=(Thread&& other)
|
||||||
{
|
{
|
||||||
s_ = other.s_;
|
s_ = other.s_;
|
||||||
t_ = std::move(other.t_);
|
t_ = std::move(other.t_);
|
||||||
@@ -42,10 +42,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class F, class... Args>
|
template <class F, class... Args>
|
||||||
explicit thread(suite& s, F&& f, Args&&... args) : s_(&s)
|
explicit Thread(suite& s, F&& f, Args&&... args) : s_(&s)
|
||||||
{
|
{
|
||||||
std::function<void(void)> b = std::bind(std::forward<F>(f), std::forward<Args>(args)...);
|
std::function<void(void)> b = std::bind(std::forward<F>(f), std::forward<Args>(args)...);
|
||||||
t_ = std::thread(&thread::run, this, std::move(b));
|
t_ = std::thread(&Thread::run, this, std::move(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
swap(thread& other)
|
swap(Thread& other)
|
||||||
{
|
{
|
||||||
std::swap(s_, other.s_);
|
std::swap(s_, other.s_);
|
||||||
std::swap(t_, other.t_);
|
std::swap(t_, other.t_);
|
||||||
@@ -94,7 +94,7 @@ private:
|
|||||||
{
|
{
|
||||||
f();
|
f();
|
||||||
}
|
}
|
||||||
catch (suite::abort_exception const&)
|
catch (suite::abort_exception const&) // NOLINT(bugprone-empty-catch)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
catch (std::exception const& e)
|
catch (std::exception const& e)
|
||||||
|
|||||||
@@ -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_;
|
Source* parent_{nullptr};
|
||||||
List<Item> children_;
|
List<Item> children_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user