mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-07 04:35:49 +00:00
Compare commits
144 Commits
bthomee/di
...
bthomee/re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d10c9e661f | ||
|
|
fafe87f547 | ||
|
|
c39726c0b3 | ||
|
|
d2ba575593 | ||
|
|
1ba1ca775b | ||
|
|
96732f8b4c | ||
|
|
13c3d28568 | ||
|
|
45dd129f83 | ||
|
|
b516a17cac | ||
|
|
972ddde705 | ||
|
|
487bc23e23 | ||
|
|
8eb233c2ea | ||
|
|
50fc93f742 | ||
|
|
ab45a8a737 | ||
|
|
dfafb141cc | ||
|
|
4e32d2ed98 | ||
|
|
fa69918124 | ||
|
|
cbbb2b1be0 | ||
|
|
cf2d763fa1 | ||
|
|
2dd1d682ac | ||
|
|
4cb1084c02 | ||
|
|
fe515e8ab4 | ||
|
|
dc966e8a4d | ||
|
|
bf6308cb4e | ||
|
|
36ad664623 | ||
|
|
296f82629a | ||
|
|
8d1b3b3994 | ||
|
|
808dcfb389 | ||
|
|
115f01978d | ||
|
|
b39d7a6519 | ||
|
|
b0910e359e | ||
|
|
44e027e516 | ||
|
|
a10f42a3aa | ||
|
|
efd4c1b95d | ||
|
|
f8b4f692f1 | ||
|
|
80a3ae6386 | ||
|
|
48d38c1e2c | ||
|
|
553fb5be3b | ||
|
|
efa917d9f3 | ||
|
|
bd3bc917f8 | ||
|
|
ed5d6f3e22 | ||
|
|
a8e4da0b11 | ||
|
|
1dd60242de | ||
|
|
76611c3f46 | ||
|
|
5efaf0c328 | ||
|
|
0aa23933ea | ||
|
|
21f3c12d85 | ||
|
|
7d5ed0cd8d | ||
|
|
d9960d5ba0 | ||
|
|
91fa6b2295 | ||
|
|
76f774e22d | ||
|
|
f4f7618173 | ||
|
|
66f16469f9 | ||
|
|
1845b1c656 | ||
|
|
e192ffe964 | ||
|
|
4af408fcd6 | ||
|
|
b50bd88aba | ||
|
|
ac7cd17472 | ||
|
|
fc33a8e0ce | ||
|
|
154d6fa740 | ||
|
|
594b81bd72 | ||
|
|
cbc69ed62f | ||
|
|
613954184a | ||
|
|
18c459f903 | ||
|
|
2bf77cc8f6 | ||
|
|
5e33ca56fd | ||
|
|
7c39c810eb | ||
|
|
56ac3a7323 | ||
|
|
a7792ebcae | ||
|
|
83ee3788e1 | ||
|
|
ae719b86d3 | ||
|
|
dd722f8b3f | ||
|
|
30190a5feb | ||
|
|
5bf234337e | ||
|
|
afb6e0e41b | ||
|
|
5523557226 | ||
|
|
b64707f53b | ||
|
|
0b113f371f | ||
|
|
b4c894c1ba | ||
|
|
92281a4ede | ||
|
|
e80642fc12 | ||
|
|
640ce4988f | ||
|
|
a422855ea7 | ||
|
|
108f90586c | ||
|
|
519d1dbc34 | ||
|
|
3d44758e5a | ||
|
|
97bc94a7f6 | ||
|
|
34619f2504 | ||
|
|
3509de9c5f | ||
|
|
459d0da010 | ||
|
|
8637d606a4 | ||
|
|
8456b8275e | ||
|
|
3c88786bb0 | ||
|
|
46ba8a28fe | ||
|
|
b985a108cb | ||
|
|
5ecde3cf39 | ||
|
|
620fb26823 | ||
|
|
6b6b213cf5 | ||
|
|
f61086b43c | ||
|
|
176fd2b6e4 | ||
|
|
2df730438d | ||
|
|
5d79bfc531 | ||
|
|
51ef35ab55 | ||
|
|
330a3215bc | ||
|
|
85c2ceacde | ||
|
|
70d5c624e8 | ||
|
|
8e4fda160d | ||
|
|
072b1c442c | ||
|
|
294e03ecf5 | ||
|
|
550f90a75e | ||
|
|
d67dcfe3c4 | ||
|
|
ec128fe1e1 | ||
|
|
c420ceb84a | ||
|
|
e0691144ae | ||
|
|
1570e2e057 | ||
|
|
e7c72f0c05 | ||
|
|
0fd2f715bb | ||
|
|
807462b191 | ||
|
|
656d4b4100 | ||
|
|
19c4226d3d | ||
|
|
d02c306f1e | ||
|
|
cfd26f444c | ||
|
|
2c3024716b | ||
|
|
a12f5de68d | ||
|
|
51c5f2bfc9 | ||
|
|
73ff54143d | ||
|
|
08b136528e | ||
|
|
6b8a589447 | ||
|
|
ffeabc9642 | ||
|
|
3cbdf818a7 | ||
|
|
c46888f8f7 | ||
|
|
2ae65d2fdb | ||
|
|
bd834c87e0 | ||
|
|
dc8b37a524 | ||
|
|
617a895af5 | ||
|
|
1af1048c58 | ||
|
|
f07ba87e51 | ||
|
|
e66558a883 | ||
|
|
510314d344 | ||
|
|
37b951859c | ||
|
|
8d01f35eb9 | ||
|
|
1020a32d76 | ||
|
|
16c2ff97cc | ||
|
|
32043463a8 |
@@ -33,5 +33,6 @@ slack_app: false
|
|||||||
|
|
||||||
ignore:
|
ignore:
|
||||||
- "src/test/"
|
- "src/test/"
|
||||||
|
- "src/tests/"
|
||||||
- "include/xrpl/beast/test/"
|
- "include/xrpl/beast/test/"
|
||||||
- "include/xrpl/beast/unit_test/"
|
- "include/xrpl/beast/unit_test/"
|
||||||
|
|||||||
28
.github/actions/build-deps/action.yml
vendored
28
.github/actions/build-deps/action.yml
vendored
@@ -10,24 +10,40 @@ inputs:
|
|||||||
build_type:
|
build_type:
|
||||||
description: 'The build type to use ("Debug", "Release").'
|
description: 'The build type to use ("Debug", "Release").'
|
||||||
required: true
|
required: true
|
||||||
|
build_nproc:
|
||||||
|
description: "The number of processors to use for building."
|
||||||
|
required: true
|
||||||
force_build:
|
force_build:
|
||||||
description: 'Force building of all dependencies ("true", "false").'
|
description: 'Force building of all dependencies ("true", "false").'
|
||||||
required: false
|
required: false
|
||||||
default: "false"
|
default: "false"
|
||||||
|
log_verbosity:
|
||||||
|
description: "The logging verbosity."
|
||||||
|
required: false
|
||||||
|
default: "verbose"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Install Conan dependencies
|
- name: Install Conan dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
BUILD_DIR: ${{ inputs.build_dir }}
|
||||||
|
BUILD_NPROC: ${{ inputs.build_nproc }}
|
||||||
|
BUILD_OPTION: ${{ inputs.force_build == 'true' && '*' || 'missing' }}
|
||||||
|
BUILD_TYPE: ${{ inputs.build_type }}
|
||||||
|
LOG_VERBOSITY: ${{ inputs.log_verbosity }}
|
||||||
run: |
|
run: |
|
||||||
echo 'Installing dependencies.'
|
echo 'Installing dependencies.'
|
||||||
mkdir -p ${{ inputs.build_dir }}
|
mkdir -p "${BUILD_DIR}"
|
||||||
cd ${{ inputs.build_dir }}
|
cd "${BUILD_DIR}"
|
||||||
conan install \
|
conan install \
|
||||||
--output-folder . \
|
--output-folder . \
|
||||||
--build ${{ inputs.force_build == 'true' && '"*"' || 'missing' }} \
|
--build="${BUILD_OPTION}" \
|
||||||
--options:host '&:tests=True' \
|
--options:host='&:tests=True' \
|
||||||
--options:host '&:xrpld=True' \
|
--options:host='&:xrpld=True' \
|
||||||
--settings:all build_type=${{ inputs.build_type }} \
|
--settings:all build_type="${BUILD_TYPE}" \
|
||||||
|
--conf:all tools.build:jobs=${BUILD_NPROC} \
|
||||||
|
--conf:all tools.build:verbosity="${LOG_VERBOSITY}" \
|
||||||
|
--conf:all tools.compilation:verbosity="${LOG_VERBOSITY}" \
|
||||||
..
|
..
|
||||||
|
|||||||
96
.github/actions/build-test/action.yml
vendored
96
.github/actions/build-test/action.yml
vendored
@@ -1,96 +0,0 @@
|
|||||||
# This action build and tests the binary. The Conan dependencies must have
|
|
||||||
# already been installed (see the build-deps action).
|
|
||||||
name: Build and Test
|
|
||||||
description: "Build and test the binary."
|
|
||||||
|
|
||||||
# Note that actions do not support 'type' and all inputs are strings, see
|
|
||||||
# https://docs.github.com/en/actions/reference/workflows-and-actions/metadata-syntax#inputs.
|
|
||||||
inputs:
|
|
||||||
build_dir:
|
|
||||||
description: "The directory where to build."
|
|
||||||
required: true
|
|
||||||
build_only:
|
|
||||||
description: 'Whether to only build or to build and test the code ("true", "false").'
|
|
||||||
required: false
|
|
||||||
default: "false"
|
|
||||||
build_type:
|
|
||||||
description: 'The build type to use ("Debug", "Release").'
|
|
||||||
required: true
|
|
||||||
cmake_args:
|
|
||||||
description: "Additional arguments to pass to CMake."
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
cmake_target:
|
|
||||||
description: "The CMake target to build."
|
|
||||||
required: true
|
|
||||||
codecov_token:
|
|
||||||
description: "The Codecov token to use for uploading coverage reports."
|
|
||||||
required: false
|
|
||||||
default: ""
|
|
||||||
os:
|
|
||||||
description: 'The operating system to use for the build ("linux", "macos", "windows").'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: composite
|
|
||||||
steps:
|
|
||||||
- name: Configure CMake
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ inputs.build_dir }}
|
|
||||||
run: |
|
|
||||||
echo 'Configuring CMake.'
|
|
||||||
cmake \
|
|
||||||
-G '${{ inputs.os == 'windows' && 'Visual Studio 17 2022' || 'Ninja' }}' \
|
|
||||||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
|
||||||
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
|
|
||||||
${{ inputs.cmake_args }} \
|
|
||||||
..
|
|
||||||
- name: Build the binary
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ inputs.build_dir }}
|
|
||||||
run: |
|
|
||||||
echo 'Building binary.'
|
|
||||||
cmake \
|
|
||||||
--build . \
|
|
||||||
--config ${{ inputs.build_type }} \
|
|
||||||
--parallel $(nproc) \
|
|
||||||
--target ${{ inputs.cmake_target }}
|
|
||||||
- name: Check linking
|
|
||||||
if: ${{ inputs.os == 'linux' }}
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ inputs.build_dir }}
|
|
||||||
run: |
|
|
||||||
echo 'Checking linking.'
|
|
||||||
ldd ./rippled
|
|
||||||
if [ "$(ldd ./rippled | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then
|
|
||||||
echo 'The binary is statically linked.'
|
|
||||||
else
|
|
||||||
echo 'The binary is dynamically linked.'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- name: Verify voidstar
|
|
||||||
if: ${{ contains(inputs.cmake_args, '-Dvoidstar=ON') }}
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ inputs.build_dir }}
|
|
||||||
run: |
|
|
||||||
echo 'Verifying presence of instrumentation.'
|
|
||||||
./rippled --version | grep libvoidstar
|
|
||||||
- name: Test the binary
|
|
||||||
if: ${{ inputs.build_only == 'false' }}
|
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ inputs.build_dir }}/${{ inputs.os == 'windows' && inputs.build_type || '' }}
|
|
||||||
run: |
|
|
||||||
echo 'Testing binary.'
|
|
||||||
./rippled --unittest --unittest-jobs $(nproc)
|
|
||||||
ctest -j $(nproc) --output-on-failure
|
|
||||||
- name: Upload coverage report
|
|
||||||
if: ${{ inputs.cmake_target == 'coverage' }}
|
|
||||||
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
|
|
||||||
with:
|
|
||||||
disable_search: true
|
|
||||||
disable_telem: true
|
|
||||||
fail_ci_if_error: true
|
|
||||||
files: ${{ inputs.build_dir }}/coverage.xml
|
|
||||||
plugins: noop
|
|
||||||
token: ${{ inputs.codecov_token }}
|
|
||||||
verbose: true
|
|
||||||
43
.github/actions/print-env/action.yml
vendored
Normal file
43
.github/actions/print-env/action.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
name: Print build environment
|
||||||
|
description: "Print environment and some tooling versions"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Check configuration (Windows)
|
||||||
|
if: ${{ runner.os == 'Windows' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo 'Checking environment variables.'
|
||||||
|
set
|
||||||
|
|
||||||
|
echo 'Checking CMake version.'
|
||||||
|
cmake --version
|
||||||
|
|
||||||
|
echo 'Checking Conan version.'
|
||||||
|
conan --version
|
||||||
|
|
||||||
|
- name: Check configuration (Linux and macOS)
|
||||||
|
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo 'Checking path.'
|
||||||
|
echo ${PATH} | tr ':' '\n'
|
||||||
|
|
||||||
|
echo 'Checking environment variables.'
|
||||||
|
env | sort
|
||||||
|
|
||||||
|
echo 'Checking CMake version.'
|
||||||
|
cmake --version
|
||||||
|
|
||||||
|
echo 'Checking compiler version.'
|
||||||
|
${{ runner.os == 'Linux' && '${CC}' || 'clang' }} --version
|
||||||
|
|
||||||
|
echo 'Checking Conan version.'
|
||||||
|
conan --version
|
||||||
|
|
||||||
|
echo 'Checking Ninja version.'
|
||||||
|
ninja --version
|
||||||
|
|
||||||
|
echo 'Checking nproc version.'
|
||||||
|
nproc --version
|
||||||
7
.github/actions/setup-conan/action.yml
vendored
7
.github/actions/setup-conan/action.yml
vendored
@@ -35,9 +35,12 @@ runs:
|
|||||||
|
|
||||||
- name: Set up Conan remote
|
- name: Set up Conan remote
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
|
||||||
|
CONAN_REMOTE_URL: ${{ inputs.conan_remote_url }}
|
||||||
run: |
|
run: |
|
||||||
echo "Adding Conan remote '${{ inputs.conan_remote_name }}' at ${{ inputs.conan_remote_url }}."
|
echo "Adding Conan remote '${CONAN_REMOTE_NAME}' at '${CONAN_REMOTE_URL}'."
|
||||||
conan remote add --index 0 --force ${{ inputs.conan_remote_name }} ${{ inputs.conan_remote_url }}
|
conan remote add --index 0 --force "${CONAN_REMOTE_NAME}" "${CONAN_REMOTE_URL}"
|
||||||
|
|
||||||
echo 'Listing Conan remotes.'
|
echo 'Listing Conan remotes.'
|
||||||
conan remote list
|
conan remote list
|
||||||
|
|||||||
6
.github/scripts/levelization/README.md
vendored
6
.github/scripts/levelization/README.md
vendored
@@ -72,15 +72,15 @@ It generates many files of [results](results):
|
|||||||
desired as described above. In a perfect repo, this file will be
|
desired as described above. In a perfect repo, this file will be
|
||||||
empty.
|
empty.
|
||||||
This file is committed to the repo, and is used by the [levelization
|
This file is committed to the repo, and is used by the [levelization
|
||||||
Github workflow](../../workflows/check-levelization.yml) to validate
|
Github workflow](../../workflows/reusable-check-levelization.yml) to validate
|
||||||
that nothing changed.
|
that nothing changed.
|
||||||
- [`ordering.txt`](results/ordering.txt): A list showing relationships
|
- [`ordering.txt`](results/ordering.txt): A list showing relationships
|
||||||
between modules where there are no loops as they actually exist, as
|
between modules where there are no loops as they actually exist, as
|
||||||
opposed to how they are desired as described above.
|
opposed to how they are desired as described above.
|
||||||
This file is committed to the repo, and is used by the [levelization
|
This file is committed to the repo, and is used by the [levelization
|
||||||
Github workflow](../../workflows/check-levelization.yml) to validate
|
Github workflow](../../workflows/reusable-check-levelization.yml) to validate
|
||||||
that nothing changed.
|
that nothing changed.
|
||||||
- [`levelization.yml`](../../workflows/check-levelization.yml)
|
- [`levelization.yml`](../../workflows/reusable-check-levelization.yml)
|
||||||
Github Actions workflow to test that levelization loops haven't
|
Github Actions workflow to test that levelization loops haven't
|
||||||
changed. Unfortunately, if changes are detected, it can't tell if
|
changed. Unfortunately, if changes are detected, it can't tell if
|
||||||
they are improvements or not, so if you have resolved any issues or
|
they are improvements or not, so if you have resolved any issues or
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ Loop: test.jtx test.unit_test
|
|||||||
Loop: xrpld.app xrpld.core
|
Loop: xrpld.app xrpld.core
|
||||||
xrpld.app > xrpld.core
|
xrpld.app > xrpld.core
|
||||||
|
|
||||||
Loop: xrpld.app xrpld.ledger
|
|
||||||
xrpld.app > xrpld.ledger
|
|
||||||
|
|
||||||
Loop: xrpld.app xrpld.overlay
|
Loop: xrpld.app xrpld.overlay
|
||||||
xrpld.overlay > xrpld.app
|
xrpld.overlay > xrpld.app
|
||||||
|
|
||||||
@@ -20,7 +17,7 @@ Loop: xrpld.app xrpld.rpc
|
|||||||
xrpld.rpc > xrpld.app
|
xrpld.rpc > xrpld.app
|
||||||
|
|
||||||
Loop: xrpld.app xrpld.shamap
|
Loop: xrpld.app xrpld.shamap
|
||||||
xrpld.app > xrpld.shamap
|
xrpld.shamap ~= xrpld.app
|
||||||
|
|
||||||
Loop: xrpld.core xrpld.perflog
|
Loop: xrpld.core xrpld.perflog
|
||||||
xrpld.perflog == xrpld.core
|
xrpld.perflog == xrpld.core
|
||||||
|
|||||||
@@ -2,8 +2,16 @@ libxrpl.basics > xrpl.basics
|
|||||||
libxrpl.crypto > xrpl.basics
|
libxrpl.crypto > xrpl.basics
|
||||||
libxrpl.json > xrpl.basics
|
libxrpl.json > xrpl.basics
|
||||||
libxrpl.json > xrpl.json
|
libxrpl.json > xrpl.json
|
||||||
|
libxrpl.ledger > xrpl.basics
|
||||||
|
libxrpl.ledger > xrpl.json
|
||||||
|
libxrpl.ledger > xrpl.ledger
|
||||||
|
libxrpl.ledger > xrpl.protocol
|
||||||
libxrpl.net > xrpl.basics
|
libxrpl.net > xrpl.basics
|
||||||
libxrpl.net > xrpl.net
|
libxrpl.net > xrpl.net
|
||||||
|
libxrpl.nodestore > xrpl.basics
|
||||||
|
libxrpl.nodestore > xrpl.json
|
||||||
|
libxrpl.nodestore > xrpl.nodestore
|
||||||
|
libxrpl.nodestore > xrpl.protocol
|
||||||
libxrpl.protocol > xrpl.basics
|
libxrpl.protocol > xrpl.basics
|
||||||
libxrpl.protocol > xrpl.json
|
libxrpl.protocol > xrpl.json
|
||||||
libxrpl.protocol > xrpl.protocol
|
libxrpl.protocol > xrpl.protocol
|
||||||
@@ -14,6 +22,9 @@ libxrpl.server > xrpl.basics
|
|||||||
libxrpl.server > xrpl.json
|
libxrpl.server > xrpl.json
|
||||||
libxrpl.server > xrpl.protocol
|
libxrpl.server > xrpl.protocol
|
||||||
libxrpl.server > xrpl.server
|
libxrpl.server > xrpl.server
|
||||||
|
libxrpl.shamap > xrpl.basics
|
||||||
|
libxrpl.shamap > xrpl.protocol
|
||||||
|
libxrpl.shamap > xrpl.shamap
|
||||||
test.app > test.jtx
|
test.app > test.jtx
|
||||||
test.app > test.rpc
|
test.app > test.rpc
|
||||||
test.app > test.toplevel
|
test.app > test.toplevel
|
||||||
@@ -21,11 +32,11 @@ test.app > test.unit_test
|
|||||||
test.app > xrpl.basics
|
test.app > xrpl.basics
|
||||||
test.app > xrpld.app
|
test.app > xrpld.app
|
||||||
test.app > xrpld.core
|
test.app > xrpld.core
|
||||||
test.app > xrpld.ledger
|
|
||||||
test.app > xrpld.nodestore
|
|
||||||
test.app > xrpld.overlay
|
test.app > xrpld.overlay
|
||||||
test.app > xrpld.rpc
|
test.app > xrpld.rpc
|
||||||
test.app > xrpl.json
|
test.app > xrpl.json
|
||||||
|
test.app > xrpl.ledger
|
||||||
|
test.app > xrpl.nodestore
|
||||||
test.app > xrpl.protocol
|
test.app > xrpl.protocol
|
||||||
test.app > xrpl.resource
|
test.app > xrpl.resource
|
||||||
test.basics > test.jtx
|
test.basics > test.jtx
|
||||||
@@ -44,8 +55,8 @@ test.consensus > test.unit_test
|
|||||||
test.consensus > xrpl.basics
|
test.consensus > xrpl.basics
|
||||||
test.consensus > xrpld.app
|
test.consensus > xrpld.app
|
||||||
test.consensus > xrpld.consensus
|
test.consensus > xrpld.consensus
|
||||||
test.consensus > xrpld.ledger
|
|
||||||
test.consensus > xrpl.json
|
test.consensus > xrpl.json
|
||||||
|
test.consensus > xrpl.ledger
|
||||||
test.core > test.jtx
|
test.core > test.jtx
|
||||||
test.core > test.toplevel
|
test.core > test.toplevel
|
||||||
test.core > test.unit_test
|
test.core > test.unit_test
|
||||||
@@ -63,9 +74,9 @@ test.json > xrpl.json
|
|||||||
test.jtx > xrpl.basics
|
test.jtx > xrpl.basics
|
||||||
test.jtx > xrpld.app
|
test.jtx > xrpld.app
|
||||||
test.jtx > xrpld.core
|
test.jtx > xrpld.core
|
||||||
test.jtx > xrpld.ledger
|
|
||||||
test.jtx > xrpld.rpc
|
test.jtx > xrpld.rpc
|
||||||
test.jtx > xrpl.json
|
test.jtx > xrpl.json
|
||||||
|
test.jtx > xrpl.ledger
|
||||||
test.jtx > xrpl.net
|
test.jtx > xrpl.net
|
||||||
test.jtx > xrpl.protocol
|
test.jtx > xrpl.protocol
|
||||||
test.jtx > xrpl.resource
|
test.jtx > xrpl.resource
|
||||||
@@ -75,15 +86,14 @@ test.ledger > test.toplevel
|
|||||||
test.ledger > xrpl.basics
|
test.ledger > xrpl.basics
|
||||||
test.ledger > xrpld.app
|
test.ledger > xrpld.app
|
||||||
test.ledger > xrpld.core
|
test.ledger > xrpld.core
|
||||||
test.ledger > xrpld.ledger
|
test.ledger > xrpl.ledger
|
||||||
test.ledger > xrpl.protocol
|
test.ledger > xrpl.protocol
|
||||||
test.nodestore > test.jtx
|
test.nodestore > test.jtx
|
||||||
test.nodestore > test.toplevel
|
test.nodestore > test.toplevel
|
||||||
test.nodestore > test.unit_test
|
test.nodestore > test.unit_test
|
||||||
test.nodestore > xrpl.basics
|
test.nodestore > xrpl.basics
|
||||||
test.nodestore > xrpld.core
|
test.nodestore > xrpld.core
|
||||||
test.nodestore > xrpld.nodestore
|
test.nodestore > xrpl.nodestore
|
||||||
test.nodestore > xrpld.unity
|
|
||||||
test.overlay > test.jtx
|
test.overlay > test.jtx
|
||||||
test.overlay > test.toplevel
|
test.overlay > test.toplevel
|
||||||
test.overlay > test.unit_test
|
test.overlay > test.unit_test
|
||||||
@@ -91,8 +101,8 @@ test.overlay > xrpl.basics
|
|||||||
test.overlay > xrpld.app
|
test.overlay > xrpld.app
|
||||||
test.overlay > xrpld.overlay
|
test.overlay > xrpld.overlay
|
||||||
test.overlay > xrpld.peerfinder
|
test.overlay > xrpld.peerfinder
|
||||||
test.overlay > xrpld.shamap
|
|
||||||
test.overlay > xrpl.protocol
|
test.overlay > xrpl.protocol
|
||||||
|
test.overlay > xrpl.shamap
|
||||||
test.peerfinder > test.beast
|
test.peerfinder > test.beast
|
||||||
test.peerfinder > test.unit_test
|
test.peerfinder > test.unit_test
|
||||||
test.peerfinder > xrpl.basics
|
test.peerfinder > xrpl.basics
|
||||||
@@ -127,15 +137,21 @@ test.server > xrpl.json
|
|||||||
test.server > xrpl.server
|
test.server > xrpl.server
|
||||||
test.shamap > test.unit_test
|
test.shamap > test.unit_test
|
||||||
test.shamap > xrpl.basics
|
test.shamap > xrpl.basics
|
||||||
test.shamap > xrpld.nodestore
|
test.shamap > xrpl.nodestore
|
||||||
test.shamap > xrpld.shamap
|
|
||||||
test.shamap > xrpl.protocol
|
test.shamap > xrpl.protocol
|
||||||
|
test.shamap > xrpl.shamap
|
||||||
test.toplevel > test.csf
|
test.toplevel > test.csf
|
||||||
test.toplevel > xrpl.json
|
test.toplevel > xrpl.json
|
||||||
test.unit_test > xrpl.basics
|
test.unit_test > xrpl.basics
|
||||||
tests.libxrpl > xrpl.basics
|
tests.libxrpl > xrpl.basics
|
||||||
|
tests.libxrpl > xrpl.json
|
||||||
|
tests.libxrpl > xrpl.net
|
||||||
xrpl.json > xrpl.basics
|
xrpl.json > xrpl.basics
|
||||||
|
xrpl.ledger > xrpl.basics
|
||||||
|
xrpl.ledger > xrpl.protocol
|
||||||
xrpl.net > xrpl.basics
|
xrpl.net > xrpl.basics
|
||||||
|
xrpl.nodestore > xrpl.basics
|
||||||
|
xrpl.nodestore > xrpl.protocol
|
||||||
xrpl.protocol > xrpl.basics
|
xrpl.protocol > xrpl.basics
|
||||||
xrpl.protocol > xrpl.json
|
xrpl.protocol > xrpl.json
|
||||||
xrpl.resource > xrpl.basics
|
xrpl.resource > xrpl.basics
|
||||||
@@ -144,16 +160,21 @@ xrpl.resource > xrpl.protocol
|
|||||||
xrpl.server > xrpl.basics
|
xrpl.server > xrpl.basics
|
||||||
xrpl.server > xrpl.json
|
xrpl.server > xrpl.json
|
||||||
xrpl.server > xrpl.protocol
|
xrpl.server > xrpl.protocol
|
||||||
|
xrpl.shamap > xrpl.basics
|
||||||
|
xrpl.shamap > xrpl.nodestore
|
||||||
|
xrpl.shamap > xrpl.protocol
|
||||||
xrpld.app > test.unit_test
|
xrpld.app > test.unit_test
|
||||||
xrpld.app > xrpl.basics
|
xrpld.app > xrpl.basics
|
||||||
xrpld.app > xrpld.conditions
|
xrpld.app > xrpld.conditions
|
||||||
xrpld.app > xrpld.consensus
|
xrpld.app > xrpld.consensus
|
||||||
xrpld.app > xrpld.nodestore
|
|
||||||
xrpld.app > xrpld.perflog
|
xrpld.app > xrpld.perflog
|
||||||
xrpld.app > xrpl.json
|
xrpld.app > xrpl.json
|
||||||
|
xrpld.app > xrpl.ledger
|
||||||
xrpld.app > xrpl.net
|
xrpld.app > xrpl.net
|
||||||
|
xrpld.app > xrpl.nodestore
|
||||||
xrpld.app > xrpl.protocol
|
xrpld.app > xrpl.protocol
|
||||||
xrpld.app > xrpl.resource
|
xrpld.app > xrpl.resource
|
||||||
|
xrpld.app > xrpl.shamap
|
||||||
xrpld.conditions > xrpl.basics
|
xrpld.conditions > xrpl.basics
|
||||||
xrpld.conditions > xrpl.protocol
|
xrpld.conditions > xrpl.protocol
|
||||||
xrpld.consensus > xrpl.basics
|
xrpld.consensus > xrpl.basics
|
||||||
@@ -163,14 +184,6 @@ xrpld.core > xrpl.basics
|
|||||||
xrpld.core > xrpl.json
|
xrpld.core > xrpl.json
|
||||||
xrpld.core > xrpl.net
|
xrpld.core > xrpl.net
|
||||||
xrpld.core > xrpl.protocol
|
xrpld.core > xrpl.protocol
|
||||||
xrpld.ledger > xrpl.basics
|
|
||||||
xrpld.ledger > xrpl.json
|
|
||||||
xrpld.ledger > xrpl.protocol
|
|
||||||
xrpld.nodestore > xrpl.basics
|
|
||||||
xrpld.nodestore > xrpld.core
|
|
||||||
xrpld.nodestore > xrpld.unity
|
|
||||||
xrpld.nodestore > xrpl.json
|
|
||||||
xrpld.nodestore > xrpl.protocol
|
|
||||||
xrpld.overlay > xrpl.basics
|
xrpld.overlay > xrpl.basics
|
||||||
xrpld.overlay > xrpld.core
|
xrpld.overlay > xrpld.core
|
||||||
xrpld.overlay > xrpld.peerfinder
|
xrpld.overlay > xrpld.peerfinder
|
||||||
@@ -186,13 +199,11 @@ xrpld.perflog > xrpl.basics
|
|||||||
xrpld.perflog > xrpl.json
|
xrpld.perflog > xrpl.json
|
||||||
xrpld.rpc > xrpl.basics
|
xrpld.rpc > xrpl.basics
|
||||||
xrpld.rpc > xrpld.core
|
xrpld.rpc > xrpld.core
|
||||||
xrpld.rpc > xrpld.ledger
|
|
||||||
xrpld.rpc > xrpld.nodestore
|
|
||||||
xrpld.rpc > xrpl.json
|
xrpld.rpc > xrpl.json
|
||||||
|
xrpld.rpc > xrpl.ledger
|
||||||
xrpld.rpc > xrpl.net
|
xrpld.rpc > xrpl.net
|
||||||
|
xrpld.rpc > xrpl.nodestore
|
||||||
xrpld.rpc > xrpl.protocol
|
xrpld.rpc > xrpl.protocol
|
||||||
xrpld.rpc > xrpl.resource
|
xrpld.rpc > xrpl.resource
|
||||||
xrpld.rpc > xrpl.server
|
xrpld.rpc > xrpl.server
|
||||||
xrpld.shamap > xrpl.basics
|
xrpld.shamap > xrpl.shamap
|
||||||
xrpld.shamap > xrpld.nodestore
|
|
||||||
xrpld.shamap > xrpl.protocol
|
|
||||||
|
|||||||
39
.github/scripts/rename/README.md
vendored
Normal file
39
.github/scripts/rename/README.md
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
## Renaming ripple(d) to xrpl(d)
|
||||||
|
|
||||||
|
In the initial phases of development of the XRPL, the open source codebase was
|
||||||
|
called "rippled" and it remains with that name even today. Today, over 1000
|
||||||
|
nodes run the application, and code contributions have been submitted by
|
||||||
|
developers located around the world. The XRPL community is larger than ever.
|
||||||
|
In light of the decentralized and diversified nature of XRPL, we will rename any
|
||||||
|
references to `ripple` and `rippled` to `xrpl` and `xrpld`, when appropriate.
|
||||||
|
|
||||||
|
See [here](https://xls.xrpl.org/xls/XLS-0095-rename-rippled-to-xrpld.html) for
|
||||||
|
more information.
|
||||||
|
|
||||||
|
### Scripts
|
||||||
|
|
||||||
|
To facilitate this transition, there will be multiple scripts that developers
|
||||||
|
can run on their own PRs and forks to minimize conflicts. Each script should be
|
||||||
|
run from the repository root.
|
||||||
|
|
||||||
|
1. `.github/scripts/rename/definitions.sh`: This script will rename all
|
||||||
|
definitions, such as include guards, from `RIPPLE_XXX` and `RIPPLED_XXX` to
|
||||||
|
`XRPL_XXX`.
|
||||||
|
2. `.github/scripts/rename/copyright.sh`: This script will remove superflous
|
||||||
|
copyright notices.
|
||||||
|
3. `.github/scripts/rename/cmake.sh`: This script will rename all CMake files
|
||||||
|
from `RippleXXX.cmake` or `RippledXXX.cmake` to `XrplXXX.cmake`, and any
|
||||||
|
references to `ripple` and `rippled` (with or without capital letters) to
|
||||||
|
`xrpl` and `xrpld`, respectively. The name of the binary will remain as-is,
|
||||||
|
and will only be renamed to `xrpld` by a later script.
|
||||||
|
4. `.github/scripts/rename/namespace.sh`: This script will rename the C++
|
||||||
|
namespaces from `ripple` to `xrpl`.
|
||||||
|
|
||||||
|
You can run all these scripts from the repository root as follows:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
./.github/scripts/rename/definitions.sh .
|
||||||
|
./.github/scripts/rename/copyright.sh .
|
||||||
|
./.github/scripts/rename/cmake.sh .
|
||||||
|
./.github/scripts/rename/namespace.sh .
|
||||||
|
```
|
||||||
84
.github/scripts/rename/cmake.sh
vendored
Executable file
84
.github/scripts/rename/cmake.sh
vendored
Executable file
@@ -0,0 +1,84 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit the script as soon as an error occurs.
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# On MacOS, ensure that GNU sed and head are installed and available as `gsed`
|
||||||
|
# and `ghead`, respectively.
|
||||||
|
SED_COMMAND=sed
|
||||||
|
HEAD_COMMAND=head
|
||||||
|
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
|
||||||
|
if ! command -v ghead &> /dev/null; then
|
||||||
|
echo "Error: ghead is not installed. Please install it using 'brew install coreutils'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
HEAD_COMMAND=ghead
|
||||||
|
fi
|
||||||
|
|
||||||
|
# This script renames CMake files from `RippleXXX.cmake` or `RippledXXX.cmake`
|
||||||
|
# to `XrplXXX.cmake`, and any references to `ripple` and `rippled` (with or
|
||||||
|
# without capital letters) to `xrpl` and `xrpld`, respectively. The name of the
|
||||||
|
# binary will remain as-is, and will only be renamed to `xrpld` in a different
|
||||||
|
# script, but the proto file will be renamed.
|
||||||
|
# Usage: .github/scripts/rename/cmake.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
|
||||||
|
|
||||||
|
# Rename the files.
|
||||||
|
find ${DIRECTORY}/cmake -type f -name "Rippled*.cmake" -exec bash -c 'mv "${1}" "${1/Rippled/Xrpl}"' - {} \;
|
||||||
|
find ${DIRECTORY}/cmake -type f -name "Ripple*.cmake" -exec bash -c 'mv "${1}" "${1/Ripple/Xrpl}"' - {} \;
|
||||||
|
if [ -e "${DIRECTORY}/cmake/xrpl_add_test.cmake" ]; then
|
||||||
|
mv "${DIRECTORY}/cmake/xrpl_add_test.cmake" "${DIRECTORY}/cmake/XrplAddTest.cmake"
|
||||||
|
fi
|
||||||
|
if [ -e "${DIRECTORY}/include/xrpl/proto/ripple.proto" ]; then
|
||||||
|
mv "${DIRECTORY}/include/xrpl/proto/ripple.proto" "${DIRECTORY}/include/xrpl/proto/xrpl.proto"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Rename inside the files.
|
||||||
|
find "${DIRECTORY}/cmake" -type f -name "*.cmake" | while read -r FILE; do
|
||||||
|
echo "Processing file: ${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/Rippled/Xrpld/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/Ripple/Xrpl/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/rippled/xrpld/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/ripple/xrpl/g' "${FILE}"
|
||||||
|
done
|
||||||
|
${SED_COMMAND} -i -E 's/Rippled?/Xrpl/g' "${DIRECTORY}/CMakeLists.txt"
|
||||||
|
${SED_COMMAND} -i 's/ripple/xrpl/g' "${DIRECTORY}/CMakeLists.txt"
|
||||||
|
${SED_COMMAND} -i 's/include(xrpl_add_test)/include(XrplAddTest)/' "${DIRECTORY}/src/tests/libxrpl/CMakeLists.txt"
|
||||||
|
${SED_COMMAND} -i 's/ripple.pb.h/xrpl.pb.h/' "${DIRECTORY}/include/xrpl/protocol/messages.h"
|
||||||
|
${SED_COMMAND} -i 's/ripple.pb.h/xrpl.pb.h/' "${DIRECTORY}/BUILD.md"
|
||||||
|
${SED_COMMAND} -i 's/ripple.pb.h/xrpl.pb.h/' "${DIRECTORY}/BUILD.md"
|
||||||
|
|
||||||
|
# Restore the name of the validator keys repository.
|
||||||
|
${SED_COMMAND} -i 's@xrpl/validator-keys-tool@ripple/validator-keys-tool@' "${DIRECTORY}/cmake/XrplValidatorKeys.cmake"
|
||||||
|
|
||||||
|
# Ensure the name of the binary and config remain 'rippled' for now.
|
||||||
|
${SED_COMMAND} -i -E 's/xrpld(-example)?\.cfg/rippled\1.cfg/g' "${DIRECTORY}/cmake/XrplInstall.cmake"
|
||||||
|
if grep -q '"xrpld"' "${DIRECTORY}/cmake/XrplCore.cmake"; then
|
||||||
|
# The script has been rerun, so just restore the name of the binary.
|
||||||
|
${SED_COMMAND} -i 's/"xrpld"/"rippled"/' "${DIRECTORY}/cmake/XrplCore.cmake"
|
||||||
|
elif ! grep -q '"rippled"' "${DIRECTORY}/cmake/XrplCore.cmake"; then
|
||||||
|
ghead -n -2 "${DIRECTORY}/cmake/XrplCore.cmake" > cmake.tmp
|
||||||
|
echo ''
|
||||||
|
echo ' # For the time being, we will keep the name of the binary as it was.' >> cmake.tmp
|
||||||
|
echo ' set_target_properties(xrpld PROPERTIES OUTPUT_NAME "rippled")' >> cmake.tmp
|
||||||
|
tail -2 "${DIRECTORY}/cmake/XrplCore.cmake" >> cmake.tmp
|
||||||
|
mv cmake.tmp "${DIRECTORY}/cmake/XrplCore.cmake"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Renaming complete."
|
||||||
102
.github/scripts/rename/copyright.sh
vendored
Executable file
102
.github/scripts/rename/copyright.sh
vendored
Executable file
@@ -0,0 +1,102 @@
|
|||||||
|
#!/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 removes superfluous copyright notices in source and header files
|
||||||
|
# in this project. Specifically, it removes all notices referencing Ripple,
|
||||||
|
# XRPLF, and certain individual contributors upon mutual agreement, so the one
|
||||||
|
# in the LICENSE.md file applies throughout. Copyright notices referencing
|
||||||
|
# external contributions, e.g. from Bitcoin, remain as-is.
|
||||||
|
# Usage: .github/scripts/rename/copyright.sh <repository directory>
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <repository directory>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prevent sed and echo from removing newlines and tabs in string literals by
|
||||||
|
# temporarily replacing them with placeholders. This only affects one file.
|
||||||
|
PLACEHOLDER_NEWLINE="__NEWLINE__"
|
||||||
|
PLACEHOLDER_TAB="__TAB__"
|
||||||
|
${SED_COMMAND} -i -E "s@\\\n@${PLACEHOLDER_NEWLINE}@g" src/test/rpc/ValidatorInfo_test.cpp
|
||||||
|
${SED_COMMAND} -i -E "s@\\\t@${PLACEHOLDER_TAB}@g" src/test/rpc/ValidatorInfo_test.cpp
|
||||||
|
|
||||||
|
# Process the include/ and src/ directories.
|
||||||
|
DIRECTORIES=("include" "src")
|
||||||
|
for DIRECTORY in "${DIRECTORIES[@]}"; do
|
||||||
|
DIRECTORY=$1/${DIRECTORY}
|
||||||
|
echo "Processing directory: ${DIRECTORY}"
|
||||||
|
if [ ! -d "${DIRECTORY}" ]; then
|
||||||
|
echo "Error: Directory '${DIRECTORY}' does not exist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
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}"
|
||||||
|
# Handle the cases where the copyright notice is enclosed in /* ... */
|
||||||
|
# and usually surrounded by //---- and //======.
|
||||||
|
${SED_COMMAND} -z -i -E 's@^//-------+\n+@@' "${FILE}"
|
||||||
|
${SED_COMMAND} -z -i -E 's@^.*Copyright.+(Ripple|Bougalis|Falco|Hinnant|Null|Ritchford|XRPLF).+PERFORMANCE OF THIS SOFTWARE\.\n\*/\n+@@' "${FILE}"
|
||||||
|
${SED_COMMAND} -z -i -E 's@^//=======+\n+@@' "${FILE}"
|
||||||
|
|
||||||
|
# Handle the cases where the copyright notice is commented out with //.
|
||||||
|
${SED_COMMAND} -z -i -E 's@^//\n// Copyright.+Falco \(vinnie dot falco at gmail dot com\)\n//\n+@@' "${FILE}"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
# Restore copyright notices that were removed from specific files, without
|
||||||
|
# restoring the verbiage that is already present in LICENSE.md. Ensure that if
|
||||||
|
# the script is run multiple times, duplicate notices are not added.
|
||||||
|
if ! grep -q 'Raw Material Software' include/xrpl/beast/core/CurrentThreadName.h; then
|
||||||
|
echo -e "// Portions of this file are from JUCE (http://www.juce.com).\n// Copyright (c) 2013 - Raw Material Software Ltd.\n// Please visit http://www.juce.com\n\n$(cat include/xrpl/beast/core/CurrentThreadName.h)" > include/xrpl/beast/core/CurrentThreadName.h
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Dev Null' src/test/app/NetworkID_test.cpp; then
|
||||||
|
echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/app/NetworkID_test.cpp)" > src/test/app/NetworkID_test.cpp
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Dev Null' src/test/app/tx/apply_test.cpp; then
|
||||||
|
echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/app/tx/apply_test.cpp)" > src/test/app/tx/apply_test.cpp
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Dev Null' src/test/app/NetworkOPs_test.cpp; then
|
||||||
|
echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/app/NetworkOPs_test.cpp)" > src/test/app/NetworkOPs_test.cpp
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Dev Null' src/test/rpc/ManifestRPC_test.cpp; then
|
||||||
|
echo -e "// Copyright (c) 2020 Dev Null Productions\n\n$(cat src/test/rpc/ManifestRPC_test.cpp)" > src/test/rpc/ManifestRPC_test.cpp
|
||||||
|
fi
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/DoManifest.cpp; then
|
||||||
|
echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/DoManifest.cpp)" > src/xrpld/rpc/handlers/DoManifest.cpp
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Dev Null' src/xrpld/rpc/handlers/ValidatorInfo.cpp; then
|
||||||
|
echo -e "// Copyright (c) 2019 Dev Null Productions\n\n$(cat src/xrpld/rpc/handlers/ValidatorInfo.cpp)" > src/xrpld/rpc/handlers/ValidatorInfo.cpp
|
||||||
|
fi
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Bougalis' include/xrpl/basics/spinlock.h; then
|
||||||
|
echo -e "// Copyright (c) 2022, Nikolaos D. Bougalis <nikb@bougalis.net>\n\n$(cat include/xrpl/basics/spinlock.h)" > include/xrpl/basics/spinlock.h
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Bougalis' include/xrpl/basics/tagged_integer.h; then
|
||||||
|
echo -e "// Copyright (c) 2014, Nikolaos D. Bougalis <nikb@bougalis.net>\n\n$(cat include/xrpl/basics/tagged_integer.h)" > include/xrpl/basics/tagged_integer.h
|
||||||
|
fi
|
||||||
|
if ! grep -q 'Ritchford' include/xrpl/beast/utility/Zero.h; then
|
||||||
|
echo -e "// Copyright (c) 2014, Tom Ritchford <tom@swirly.com>\n\n$(cat include/xrpl/beast/utility/Zero.h)" > include/xrpl/beast/utility/Zero.h
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Restore newlines and tabs in string literals in the affected file.
|
||||||
|
${SED_COMMAND} -i -E "s@${PLACEHOLDER_NEWLINE}@\\\n@g" src/test/rpc/ValidatorInfo_test.cpp
|
||||||
|
${SED_COMMAND} -i -E "s@${PLACEHOLDER_TAB}@\\\t@g" src/test/rpc/ValidatorInfo_test.cpp
|
||||||
|
|
||||||
|
echo "Removal complete."
|
||||||
42
.github/scripts/rename/definitions.sh
vendored
Executable file
42
.github/scripts/rename/definitions.sh
vendored
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
#!/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 definitions, such as include guards, in this project.
|
||||||
|
# Specifically, it renames "RIPPLED_XXX" and "RIPPLE_XXX" to "XRPL_XXX" by
|
||||||
|
# scanning all cmake, header, and source files in the specified directory and
|
||||||
|
# its subdirectories.
|
||||||
|
# Usage: .github/scripts/rename/definitions.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
|
||||||
|
|
||||||
|
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" \) | while read -r FILE; do
|
||||||
|
echo "Processing file: ${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's@#(define|endif|if|ifdef|ifndef)(.*)(RIPPLED_|RIPPLE_)([A-Z0-9_]+)@#\1\2XRPL_\4@g' "${FILE}"
|
||||||
|
done
|
||||||
|
find "${DIRECTORY}" -type f \( -name "*.cmake" -o -name "*.txt" \) | while read -r FILE; do
|
||||||
|
echo "Processing file: ${FILE}"
|
||||||
|
${SED_COMMAND} -i -E 's@(RIPPLED_|RIPPLE_)([A-Z0-9_]+)@XRPL_\2@g' "${FILE}"
|
||||||
|
done
|
||||||
|
echo "Renaming complete."
|
||||||
50
.github/scripts/rename/namespace.sh
vendored
Executable file
50
.github/scripts/rename/namespace.sh
vendored
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/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 the `ripple` namespace to `xrpl` in this project.
|
||||||
|
# Specifically, it renames all occurrences of `namespace ripple` and `ripple::`
|
||||||
|
# to `namespace xrpl` and `xrpl::`, respectively, by scanning all header and
|
||||||
|
# source files in the specified directory and its subdirectories, as well as any
|
||||||
|
# occurrences in the documentation.
|
||||||
|
# Usage: .github/scripts/rename/namespace.sh <repository directory>
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <repository directory>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
DIRECTORIES=("include" "src" "tests")
|
||||||
|
for DIRECTORY in "${DIRECTORIES[@]}"; do
|
||||||
|
DIRECTORY=$1/${DIRECTORY}
|
||||||
|
echo "Processing directory: ${DIRECTORY}"
|
||||||
|
if [ ! -d "${DIRECTORY}" ]; then
|
||||||
|
echo "Error: Directory '${DIRECTORY}' does not exist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" \) | while read -r FILE; do
|
||||||
|
echo "Processing file: ${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/namespace ripple/namespace xrpl/g' "${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
DIRECTORY=$1
|
||||||
|
find "${DIRECTORY}" -type f -name "*.md" | while read -r FILE; do
|
||||||
|
echo "Processing file: ${FILE}"
|
||||||
|
${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Renaming complete."
|
||||||
10
.github/scripts/strategy-matrix/generate.py
vendored
10
.github/scripts/strategy-matrix/generate.py
vendored
@@ -74,14 +74,14 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# RHEL:
|
# RHEL:
|
||||||
# - 9.4 using GCC 12: Debug and Unity on linux/amd64.
|
# - 9 using GCC 12: Debug and Unity on linux/amd64.
|
||||||
# - 9.6 using Clang: Release and no Unity on linux/amd64.
|
# - 10 using Clang: Release and no Unity on linux/amd64.
|
||||||
if os['distro_name'] == 'rhel':
|
if os['distro_name'] == 'rhel':
|
||||||
skip = True
|
skip = True
|
||||||
if os['distro_version'] == '9.4':
|
if os['distro_version'] == '9':
|
||||||
if f'{os['compiler_name']}-{os['compiler_version']}' == 'gcc-12' and build_type == 'Debug' and '-Dunity=ON' in cmake_args and architecture['platform'] == 'linux/amd64':
|
if f'{os['compiler_name']}-{os['compiler_version']}' == 'gcc-12' and build_type == 'Debug' and '-Dunity=ON' in cmake_args and architecture['platform'] == 'linux/amd64':
|
||||||
skip = False
|
skip = False
|
||||||
elif os['distro_version'] == '9.6':
|
elif os['distro_version'] == '10':
|
||||||
if f'{os['compiler_name']}-{os['compiler_version']}' == 'clang-any' and build_type == 'Release' and '-Dunity=OFF' in cmake_args and architecture['platform'] == 'linux/amd64':
|
if f'{os['compiler_name']}-{os['compiler_version']}' == 'clang-any' and build_type == 'Release' and '-Dunity=OFF' in cmake_args and architecture['platform'] == 'linux/amd64':
|
||||||
skip = False
|
skip = False
|
||||||
if skip:
|
if skip:
|
||||||
@@ -162,7 +162,7 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
|||||||
'config_name': config_name,
|
'config_name': config_name,
|
||||||
'cmake_args': cmake_args,
|
'cmake_args': cmake_args,
|
||||||
'cmake_target': cmake_target,
|
'cmake_target': cmake_target,
|
||||||
'build_only': 'true' if build_only else 'false',
|
'build_only': build_only,
|
||||||
'build_type': build_type,
|
'build_type': build_type,
|
||||||
'os': os,
|
'os': os,
|
||||||
'architecture': architecture,
|
'architecture': architecture,
|
||||||
|
|||||||
122
.github/scripts/strategy-matrix/linux.json
vendored
122
.github/scripts/strategy-matrix/linux.json
vendored
@@ -14,139 +14,169 @@
|
|||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "12"
|
"compiler_version": "12",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "13"
|
"compiler_version": "13",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14"
|
"compiler_version": "14",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "15"
|
"compiler_version": "15",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "16"
|
"compiler_version": "16",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "17"
|
"compiler_version": "17",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "18"
|
"compiler_version": "18",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "19"
|
"compiler_version": "19",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "debian",
|
"distro_name": "debian",
|
||||||
"distro_version": "bookworm",
|
"distro_version": "bookworm",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "20"
|
"compiler_version": "20",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9.4",
|
"distro_version": "8",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "12"
|
"compiler_version": "14",
|
||||||
|
"image_sha": "10e69b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9.4",
|
"distro_version": "8",
|
||||||
"compiler_name": "gcc",
|
|
||||||
"compiler_version": "13"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"distro_name": "rhel",
|
|
||||||
"distro_version": "9.4",
|
|
||||||
"compiler_name": "gcc",
|
|
||||||
"compiler_version": "14"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"distro_name": "rhel",
|
|
||||||
"distro_version": "9.6",
|
|
||||||
"compiler_name": "gcc",
|
|
||||||
"compiler_version": "13"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"distro_name": "rhel",
|
|
||||||
"distro_version": "9.6",
|
|
||||||
"compiler_name": "gcc",
|
|
||||||
"compiler_version": "14"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"distro_name": "rhel",
|
|
||||||
"distro_version": "9.4",
|
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "any"
|
"compiler_version": "any",
|
||||||
|
"image_sha": "10e69b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "rhel",
|
"distro_name": "rhel",
|
||||||
"distro_version": "9.6",
|
"distro_version": "9",
|
||||||
|
"compiler_name": "gcc",
|
||||||
|
"compiler_version": "12",
|
||||||
|
"image_sha": "10e69b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"distro_name": "rhel",
|
||||||
|
"distro_version": "9",
|
||||||
|
"compiler_name": "gcc",
|
||||||
|
"compiler_version": "13",
|
||||||
|
"image_sha": "10e69b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"distro_name": "rhel",
|
||||||
|
"distro_version": "9",
|
||||||
|
"compiler_name": "gcc",
|
||||||
|
"compiler_version": "14",
|
||||||
|
"image_sha": "10e69b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"distro_name": "rhel",
|
||||||
|
"distro_version": "9",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "any"
|
"compiler_version": "any",
|
||||||
|
"image_sha": "10e69b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"distro_name": "rhel",
|
||||||
|
"distro_version": "10",
|
||||||
|
"compiler_name": "gcc",
|
||||||
|
"compiler_version": "14",
|
||||||
|
"image_sha": "10e69b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"distro_name": "rhel",
|
||||||
|
"distro_version": "10",
|
||||||
|
"compiler_name": "clang",
|
||||||
|
"compiler_version": "any",
|
||||||
|
"image_sha": "10e69b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "jammy",
|
"distro_version": "jammy",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "12"
|
"compiler_version": "12",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "13"
|
"compiler_version": "13",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "gcc",
|
"compiler_name": "gcc",
|
||||||
"compiler_version": "14"
|
"compiler_version": "14",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "16"
|
"compiler_version": "16",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "17"
|
"compiler_version": "17",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "18"
|
"compiler_version": "18",
|
||||||
|
"image_sha": "6948666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"distro_name": "ubuntu",
|
"distro_name": "ubuntu",
|
||||||
"distro_version": "noble",
|
"distro_version": "noble",
|
||||||
"compiler_name": "clang",
|
"compiler_name": "clang",
|
||||||
"compiler_version": "19"
|
"compiler_version": "19",
|
||||||
|
"image_sha": "6948666"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"build_type": ["Debug", "Release"],
|
"build_type": ["Debug", "Release"],
|
||||||
|
|||||||
3
.github/scripts/strategy-matrix/macos.json
vendored
3
.github/scripts/strategy-matrix/macos.json
vendored
@@ -10,7 +10,8 @@
|
|||||||
"distro_name": "macos",
|
"distro_name": "macos",
|
||||||
"distro_version": "",
|
"distro_version": "",
|
||||||
"compiler_name": "",
|
"compiler_name": "",
|
||||||
"compiler_version": ""
|
"compiler_version": "",
|
||||||
|
"image_sha": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"build_type": ["Debug", "Release"],
|
"build_type": ["Debug", "Release"],
|
||||||
|
|||||||
3
.github/scripts/strategy-matrix/windows.json
vendored
3
.github/scripts/strategy-matrix/windows.json
vendored
@@ -10,7 +10,8 @@
|
|||||||
"distro_name": "windows",
|
"distro_name": "windows",
|
||||||
"distro_version": "",
|
"distro_version": "",
|
||||||
"compiler_name": "",
|
"compiler_name": "",
|
||||||
"compiler_version": ""
|
"compiler_version": "",
|
||||||
|
"image_sha": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"build_type": ["Debug", "Release"],
|
"build_type": ["Debug", "Release"],
|
||||||
|
|||||||
146
.github/workflows/build-test.yml
vendored
146
.github/workflows/build-test.yml
vendored
@@ -1,146 +0,0 @@
|
|||||||
# This workflow builds and tests the binary for various configurations.
|
|
||||||
name: Build and test
|
|
||||||
|
|
||||||
# This workflow can only be triggered by other workflows. Note that the
|
|
||||||
# workflow_call event does not support the 'choice' input type, see
|
|
||||||
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onworkflow_callinputsinput_idtype,
|
|
||||||
# so we use 'string' instead.
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
build_dir:
|
|
||||||
description: "The directory where to build."
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ".build"
|
|
||||||
dependencies_force_build:
|
|
||||||
description: "Force building of all dependencies."
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
dependencies_force_upload:
|
|
||||||
description: "Force uploading of all dependencies."
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
os:
|
|
||||||
description: 'The operating system to use for the build ("linux", "macos", "windows").'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
strategy_matrix:
|
|
||||||
# TODO: Support additional strategies, e.g. "ubuntu" for generating all Ubuntu configurations.
|
|
||||||
description: 'The strategy matrix to use for generating the configurations ("minimal", "all").'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: "minimal"
|
|
||||||
secrets:
|
|
||||||
codecov_token:
|
|
||||||
description: "The Codecov token to use for uploading coverage reports."
|
|
||||||
required: false
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.os }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# Generate the strategy matrix to be used by the following job.
|
|
||||||
generate-matrix:
|
|
||||||
uses: ./.github/workflows/reusable-strategy-matrix.yml
|
|
||||||
with:
|
|
||||||
os: ${{ inputs.os }}
|
|
||||||
strategy_matrix: ${{ inputs.strategy_matrix }}
|
|
||||||
|
|
||||||
# Build and test the binary.
|
|
||||||
build-test:
|
|
||||||
needs:
|
|
||||||
- generate-matrix
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
|
|
||||||
runs-on: ${{ matrix.architecture.runner }}
|
|
||||||
container: ${{ inputs.os == 'linux' && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version) || null }}
|
|
||||||
steps:
|
|
||||||
- name: Check strategy matrix
|
|
||||||
run: |
|
|
||||||
echo 'Operating system distro name: ${{ matrix.os.distro_name }}'
|
|
||||||
echo 'Operating system distro version: ${{ matrix.os.distro_version }}'
|
|
||||||
echo 'Operating system compiler name: ${{ matrix.os.compiler_name }}'
|
|
||||||
echo 'Operating system compiler version: ${{ matrix.os.compiler_version }}'
|
|
||||||
echo 'Architecture platform: ${{ matrix.architecture.platform }}'
|
|
||||||
echo 'Architecture runner: ${{ toJson(matrix.architecture.runner) }}'
|
|
||||||
echo 'Build type: ${{ matrix.build_type }}'
|
|
||||||
echo 'Build only: ${{ matrix.build_only }}'
|
|
||||||
echo 'CMake arguments: ${{ matrix.cmake_args }}'
|
|
||||||
echo 'CMake target: ${{ matrix.cmake_target }}'
|
|
||||||
echo 'Config name: ${{ matrix.config_name }}'
|
|
||||||
|
|
||||||
- name: Cleanup workspace
|
|
||||||
if: ${{ runner.os == 'macOS' }}
|
|
||||||
uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e
|
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
||||||
- name: Prepare runner
|
|
||||||
uses: XRPLF/actions/.github/actions/prepare-runner@638e0dc11ea230f91bd26622fb542116bb5254d5
|
|
||||||
with:
|
|
||||||
disable_ccache: false
|
|
||||||
|
|
||||||
- name: Check configuration (Windows)
|
|
||||||
if: ${{ inputs.os == 'windows' }}
|
|
||||||
run: |
|
|
||||||
echo 'Checking environment variables.'
|
|
||||||
set
|
|
||||||
|
|
||||||
echo 'Checking CMake version.'
|
|
||||||
cmake --version
|
|
||||||
|
|
||||||
echo 'Checking Conan version.'
|
|
||||||
conan --version
|
|
||||||
- name: Check configuration (Linux and MacOS)
|
|
||||||
if: ${{ inputs.os == 'linux' || inputs.os == 'macos' }}
|
|
||||||
run: |
|
|
||||||
echo 'Checking path.'
|
|
||||||
echo ${PATH} | tr ':' '\n'
|
|
||||||
|
|
||||||
echo 'Checking environment variables.'
|
|
||||||
env | sort
|
|
||||||
|
|
||||||
echo 'Checking CMake version.'
|
|
||||||
cmake --version
|
|
||||||
|
|
||||||
echo 'Checking compiler version.'
|
|
||||||
${{ inputs.os == 'linux' && '${CC}' || 'clang' }} --version
|
|
||||||
|
|
||||||
echo 'Checking Conan version.'
|
|
||||||
conan --version
|
|
||||||
|
|
||||||
echo 'Checking Ninja version.'
|
|
||||||
ninja --version
|
|
||||||
|
|
||||||
echo 'Checking nproc version.'
|
|
||||||
nproc --version
|
|
||||||
|
|
||||||
- name: Setup Conan
|
|
||||||
uses: ./.github/actions/setup-conan
|
|
||||||
|
|
||||||
- name: Build dependencies
|
|
||||||
uses: ./.github/actions/build-deps
|
|
||||||
with:
|
|
||||||
build_dir: ${{ inputs.build_dir }}
|
|
||||||
build_type: ${{ matrix.build_type }}
|
|
||||||
force_build: ${{ inputs.dependencies_force_build }}
|
|
||||||
|
|
||||||
- name: Build and test binary
|
|
||||||
uses: ./.github/actions/build-test
|
|
||||||
with:
|
|
||||||
build_dir: ${{ inputs.build_dir }}
|
|
||||||
build_only: ${{ matrix.build_only }}
|
|
||||||
build_type: ${{ matrix.build_type }}
|
|
||||||
cmake_args: ${{ matrix.cmake_args }}
|
|
||||||
cmake_target: ${{ matrix.cmake_target }}
|
|
||||||
codecov_token: ${{ secrets.codecov_token }}
|
|
||||||
os: ${{ inputs.os }}
|
|
||||||
25
.github/workflows/on-pr.yml
vendored
25
.github/workflows/on-pr.yml
vendored
@@ -50,8 +50,10 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
# These paths are unique to `on-pr.yml`.
|
# These paths are unique to `on-pr.yml`.
|
||||||
.github/scripts/levelization/**
|
.github/scripts/levelization/**
|
||||||
.github/workflows/check-levelization.yml
|
.github/scripts/rename/**
|
||||||
.github/workflows/notify-clio.yml
|
.github/workflows/reusable-check-levelization.yml
|
||||||
|
.github/workflows/reusable-check-rename.yml
|
||||||
|
.github/workflows/reusable-notify-clio.yml
|
||||||
.github/workflows/on-pr.yml
|
.github/workflows/on-pr.yml
|
||||||
|
|
||||||
# Keep the paths below in sync with those in `on-trigger.yml`.
|
# Keep the paths below in sync with those in `on-trigger.yml`.
|
||||||
@@ -59,8 +61,11 @@ jobs:
|
|||||||
.github/actions/build-test/**
|
.github/actions/build-test/**
|
||||||
.github/actions/setup-conan/**
|
.github/actions/setup-conan/**
|
||||||
.github/scripts/strategy-matrix/**
|
.github/scripts/strategy-matrix/**
|
||||||
.github/workflows/build-test.yml
|
.github/workflows/reusable-build.yml
|
||||||
|
.github/workflows/reusable-build-test-config.yml
|
||||||
|
.github/workflows/reusable-build-test.yml
|
||||||
.github/workflows/reusable-strategy-matrix.yml
|
.github/workflows/reusable-strategy-matrix.yml
|
||||||
|
.github/workflows/reusable-test.yml
|
||||||
.codecov.yml
|
.codecov.yml
|
||||||
cmake/**
|
cmake/**
|
||||||
conan/**
|
conan/**
|
||||||
@@ -93,26 +98,32 @@ jobs:
|
|||||||
check-levelization:
|
check-levelization:
|
||||||
needs: should-run
|
needs: should-run
|
||||||
if: ${{ needs.should-run.outputs.go == 'true' }}
|
if: ${{ needs.should-run.outputs.go == 'true' }}
|
||||||
uses: ./.github/workflows/check-levelization.yml
|
uses: ./.github/workflows/reusable-check-levelization.yml
|
||||||
|
|
||||||
|
check-rename:
|
||||||
|
needs: should-run
|
||||||
|
if: ${{ needs.should-run.outputs.go == 'true' }}
|
||||||
|
uses: ./.github/workflows/reusable-check-rename.yml
|
||||||
|
|
||||||
build-test:
|
build-test:
|
||||||
needs: should-run
|
needs: should-run
|
||||||
if: ${{ needs.should-run.outputs.go == 'true' }}
|
if: ${{ needs.should-run.outputs.go == 'true' }}
|
||||||
uses: ./.github/workflows/build-test.yml
|
uses: ./.github/workflows/reusable-build-test.yml
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [linux, macos, windows]
|
os: [linux, macos, windows]
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
secrets:
|
secrets:
|
||||||
codecov_token: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
notify-clio:
|
notify-clio:
|
||||||
needs:
|
needs:
|
||||||
- should-run
|
- should-run
|
||||||
- build-test
|
- build-test
|
||||||
if: ${{ needs.should-run.outputs.go == 'true' && contains(fromJSON('["release", "master"]'), github.ref_name) }}
|
if: ${{ needs.should-run.outputs.go == 'true' && contains(fromJSON('["release", "master"]'), github.ref_name) }}
|
||||||
uses: ./.github/workflows/notify-clio.yml
|
uses: ./.github/workflows/reusable-notify-clio.yml
|
||||||
secrets:
|
secrets:
|
||||||
clio_notify_token: ${{ secrets.CLIO_NOTIFY_TOKEN }}
|
clio_notify_token: ${{ secrets.CLIO_NOTIFY_TOKEN }}
|
||||||
conan_remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
conan_remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }}
|
||||||
|
|||||||
45
.github/workflows/on-trigger.yml
vendored
45
.github/workflows/on-trigger.yml
vendored
@@ -9,12 +9,12 @@ name: Trigger
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- "develop"
|
||||||
- release
|
- "release*"
|
||||||
- master
|
- "master"
|
||||||
paths:
|
paths:
|
||||||
# These paths are unique to `on-trigger.yml`.
|
# These paths are unique to `on-trigger.yml`.
|
||||||
- ".github/workflows/check-missing-commits.yml"
|
- ".github/workflows/reusable-check-missing-commits.yml"
|
||||||
- ".github/workflows/on-trigger.yml"
|
- ".github/workflows/on-trigger.yml"
|
||||||
- ".github/workflows/publish-docs.yml"
|
- ".github/workflows/publish-docs.yml"
|
||||||
|
|
||||||
@@ -23,8 +23,11 @@ on:
|
|||||||
- ".github/actions/build-test/**"
|
- ".github/actions/build-test/**"
|
||||||
- ".github/actions/setup-conan/**"
|
- ".github/actions/setup-conan/**"
|
||||||
- ".github/scripts/strategy-matrix/**"
|
- ".github/scripts/strategy-matrix/**"
|
||||||
- ".github/workflows/build-test.yml"
|
- ".github/workflows/reusable-build.yml"
|
||||||
|
- ".github/workflows/reusable-build-test-config.yml"
|
||||||
|
- ".github/workflows/reusable-build-test.yml"
|
||||||
- ".github/workflows/reusable-strategy-matrix.yml"
|
- ".github/workflows/reusable-strategy-matrix.yml"
|
||||||
|
- ".github/workflows/reusable-test.yml"
|
||||||
- ".codecov.yml"
|
- ".codecov.yml"
|
||||||
- "cmake/**"
|
- "cmake/**"
|
||||||
- "conan/**"
|
- "conan/**"
|
||||||
@@ -43,25 +46,16 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: "32 6 * * 1-5"
|
- cron: "32 6 * * 1-5"
|
||||||
|
|
||||||
# Run when manually triggered via the GitHub UI or API. If `force_upload` is
|
# Run when manually triggered via the GitHub UI or API.
|
||||||
# true, then the dependencies that were missing (`force_rebuild` is false) or
|
|
||||||
# rebuilt (`force_rebuild` is true) will be uploaded, overwriting existing
|
|
||||||
# dependencies if needed.
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
dependencies_force_build:
|
|
||||||
description: "Force building of all dependencies."
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
dependencies_force_upload:
|
|
||||||
description: "Force uploading of all dependencies."
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
# When a PR is merged into the develop branch it will be assigned a unique
|
||||||
|
# group identifier, so execution will continue even if another PR is merged
|
||||||
|
# while it is still running. In all other cases the group identifier is shared
|
||||||
|
# per branch, so that any in-progress runs are cancelled when a new commit is
|
||||||
|
# pushed.
|
||||||
|
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' && github.sha || github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
@@ -71,15 +65,16 @@ defaults:
|
|||||||
jobs:
|
jobs:
|
||||||
check-missing-commits:
|
check-missing-commits:
|
||||||
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && contains(fromJSON('["develop", "release"]'), github.ref_name) }}
|
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && contains(fromJSON('["develop", "release"]'), github.ref_name) }}
|
||||||
uses: ./.github/workflows/check-missing-commits.yml
|
uses: ./.github/workflows/reusable-check-missing-commits.yml
|
||||||
|
|
||||||
build-test:
|
build-test:
|
||||||
uses: ./.github/workflows/build-test.yml
|
uses: ./.github/workflows/reusable-build-test.yml
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: ${{ github.event_name == 'merge_group' }}
|
||||||
matrix:
|
matrix:
|
||||||
os: [linux, macos, windows]
|
os: [linux, macos, windows]
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
strategy_matrix: "minimal"
|
strategy_matrix: ${{ github.event_name == 'schedule' && 'all' || 'minimal' }}
|
||||||
secrets:
|
secrets:
|
||||||
codecov_token: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|||||||
5
.github/workflows/pre-commit.yml
vendored
5
.github/workflows/pre-commit.yml
vendored
@@ -7,8 +7,9 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# 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@af1b0f0d764cda2e5435f5ac97b240d4bd4d95d3
|
uses: XRPLF/actions/.github/workflows/pre-commit.yml@34790936fae4c6c751f62ec8c06696f9c1a5753a
|
||||||
with:
|
with:
|
||||||
runs_on: ubuntu-latest
|
runs_on: ubuntu-latest
|
||||||
container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit" }'
|
container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-a8c7be1" }'
|
||||||
|
|||||||
20
.github/workflows/publish-docs.yml
vendored
20
.github/workflows/publish-docs.yml
vendored
@@ -23,16 +23,24 @@ defaults:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_DIR: .build
|
BUILD_DIR: .build
|
||||||
|
NPROC_SUBTRACT: 2
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: ghcr.io/xrplf/ci/tools-rippled-documentation
|
container: ghcr.io/xrplf/ci/tools-rippled-documentation:sha-a8c7be1
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
|
|
||||||
|
- name: Get number of processors
|
||||||
|
uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
|
||||||
|
id: nproc
|
||||||
|
with:
|
||||||
|
subtract: ${{ env.NPROC_SUBTRACT }}
|
||||||
|
|
||||||
- name: Check configuration
|
- name: Check configuration
|
||||||
run: |
|
run: |
|
||||||
echo 'Checking path.'
|
echo 'Checking path.'
|
||||||
@@ -46,12 +54,16 @@ jobs:
|
|||||||
|
|
||||||
echo 'Checking Doxygen version.'
|
echo 'Checking Doxygen version.'
|
||||||
doxygen --version
|
doxygen --version
|
||||||
|
|
||||||
- name: Build documentation
|
- name: Build documentation
|
||||||
|
env:
|
||||||
|
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ${{ env.BUILD_DIR }}
|
mkdir -p "${BUILD_DIR}"
|
||||||
cd ${{ env.BUILD_DIR }}
|
cd "${BUILD_DIR}"
|
||||||
cmake -Donly_docs=ON ..
|
cmake -Donly_docs=ON ..
|
||||||
cmake --build . --target docs --parallel $(nproc)
|
cmake --build . --target docs --parallel ${BUILD_NPROC}
|
||||||
|
|
||||||
- name: Publish documentation
|
- name: Publish documentation
|
||||||
if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
|
if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
|
||||||
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
|
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
|
||||||
|
|||||||
77
.github/workflows/reusable-build-test-config.yml
vendored
Normal file
77
.github/workflows/reusable-build-test-config.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
name: Build and test configuration
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
build_dir:
|
||||||
|
description: "The directory where to build."
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
build_only:
|
||||||
|
description: 'Whether to only build or to build and test the code ("true", "false").'
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
build_type:
|
||||||
|
description: 'The build type to use ("Debug", "Release").'
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
cmake_args:
|
||||||
|
description: "Additional arguments to pass to CMake."
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
cmake_target:
|
||||||
|
description: "The CMake target to build."
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs_on:
|
||||||
|
description: Runner to run the job on as a JSON string
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
image:
|
||||||
|
description: "The image to run in (leave empty to run natively)"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
config_name:
|
||||||
|
description: "The configuration string (used for naming artifacts and such)."
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
nproc_subtract:
|
||||||
|
description: "The number of processors to subtract when calculating parallelism."
|
||||||
|
required: false
|
||||||
|
type: number
|
||||||
|
default: 2
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
CODECOV_TOKEN:
|
||||||
|
description: "The Codecov token to use for uploading coverage reports."
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
uses: ./.github/workflows/reusable-build.yml
|
||||||
|
with:
|
||||||
|
build_dir: ${{ inputs.build_dir }}
|
||||||
|
build_type: ${{ inputs.build_type }}
|
||||||
|
cmake_args: ${{ inputs.cmake_args }}
|
||||||
|
cmake_target: ${{ inputs.cmake_target }}
|
||||||
|
runs_on: ${{ inputs.runs_on }}
|
||||||
|
image: ${{ inputs.image }}
|
||||||
|
config_name: ${{ inputs.config_name }}
|
||||||
|
nproc_subtract: ${{ inputs.nproc_subtract }}
|
||||||
|
secrets:
|
||||||
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: build
|
||||||
|
uses: ./.github/workflows/reusable-test.yml
|
||||||
|
with:
|
||||||
|
run_tests: ${{ !inputs.build_only }}
|
||||||
|
verify_voidstar: ${{ contains(inputs.cmake_args, '-Dvoidstar=ON') }}
|
||||||
|
runs_on: ${{ inputs.runs_on }}
|
||||||
|
image: ${{ inputs.image }}
|
||||||
|
config_name: ${{ inputs.config_name }}
|
||||||
|
nproc_subtract: ${{ inputs.nproc_subtract }}
|
||||||
58
.github/workflows/reusable-build-test.yml
vendored
Normal file
58
.github/workflows/reusable-build-test.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# This workflow builds and tests the binary for various configurations.
|
||||||
|
name: Build and test
|
||||||
|
|
||||||
|
# This workflow can only be triggered by other workflows. Note that the
|
||||||
|
# workflow_call event does not support the 'choice' input type, see
|
||||||
|
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onworkflow_callinputsinput_idtype,
|
||||||
|
# so we use 'string' instead.
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
build_dir:
|
||||||
|
description: "The directory where to build."
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ".build"
|
||||||
|
os:
|
||||||
|
description: 'The operating system to use for the build ("linux", "macos", "windows").'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
strategy_matrix:
|
||||||
|
# TODO: Support additional strategies, e.g. "ubuntu" for generating all Ubuntu configurations.
|
||||||
|
description: 'The strategy matrix to use for generating the configurations ("minimal", "all").'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: "minimal"
|
||||||
|
secrets:
|
||||||
|
CODECOV_TOKEN:
|
||||||
|
description: "The Codecov token to use for uploading coverage reports."
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# Generate the strategy matrix to be used by the following job.
|
||||||
|
generate-matrix:
|
||||||
|
uses: ./.github/workflows/reusable-strategy-matrix.yml
|
||||||
|
with:
|
||||||
|
os: ${{ inputs.os }}
|
||||||
|
strategy_matrix: ${{ inputs.strategy_matrix }}
|
||||||
|
|
||||||
|
# Build and test the binary for each configuration.
|
||||||
|
build-test-config:
|
||||||
|
needs:
|
||||||
|
- generate-matrix
|
||||||
|
uses: ./.github/workflows/reusable-build-test-config.yml
|
||||||
|
strategy:
|
||||||
|
fail-fast: ${{ github.event_name == 'merge_group' }}
|
||||||
|
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
|
||||||
|
max-parallel: 10
|
||||||
|
with:
|
||||||
|
build_dir: ${{ inputs.build_dir }}
|
||||||
|
build_only: ${{ matrix.build_only }}
|
||||||
|
build_type: ${{ matrix.build_type }}
|
||||||
|
cmake_args: ${{ matrix.cmake_args }}
|
||||||
|
cmake_target: ${{ matrix.cmake_target }}
|
||||||
|
runs_on: ${{ toJSON(matrix.architecture.runner) }}
|
||||||
|
image: ${{ contains(matrix.architecture.platform, 'linux') && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}-sha-{4}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version, matrix.os.image_sha) || '' }}
|
||||||
|
config_name: ${{ matrix.config_name }}
|
||||||
|
secrets:
|
||||||
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
154
.github/workflows/reusable-build.yml
vendored
Normal file
154
.github/workflows/reusable-build.yml
vendored
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
name: Build rippled
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
build_dir:
|
||||||
|
description: "The directory where to build."
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
build_type:
|
||||||
|
description: 'The build type to use ("Debug", "Release").'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
cmake_args:
|
||||||
|
description: "Additional arguments to pass to CMake."
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
cmake_target:
|
||||||
|
description: "The CMake target to build."
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
runs_on:
|
||||||
|
description: Runner to run the job on as a JSON string
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
image:
|
||||||
|
description: "The image to run in (leave empty to run natively)"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
config_name:
|
||||||
|
description: "The name of the configuration."
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
nproc_subtract:
|
||||||
|
description: "The number of processors to subtract when calculating parallelism."
|
||||||
|
required: true
|
||||||
|
type: number
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
CODECOV_TOKEN:
|
||||||
|
description: "The Codecov token to use for uploading coverage reports."
|
||||||
|
required: true
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build ${{ inputs.config_name }}
|
||||||
|
runs-on: ${{ fromJSON(inputs.runs_on) }}
|
||||||
|
container: ${{ inputs.image != '' && inputs.image || null }}
|
||||||
|
timeout-minutes: 60
|
||||||
|
steps:
|
||||||
|
- name: Cleanup workspace
|
||||||
|
if: ${{ runner.os == 'macOS' }}
|
||||||
|
uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
|
|
||||||
|
- name: Prepare runner
|
||||||
|
uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a
|
||||||
|
with:
|
||||||
|
disable_ccache: false
|
||||||
|
|
||||||
|
- name: Print build environment
|
||||||
|
uses: ./.github/actions/print-env
|
||||||
|
|
||||||
|
- name: Get number of processors
|
||||||
|
uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
|
||||||
|
id: nproc
|
||||||
|
with:
|
||||||
|
subtract: ${{ inputs.nproc_subtract }}
|
||||||
|
|
||||||
|
- name: Setup Conan
|
||||||
|
uses: ./.github/actions/setup-conan
|
||||||
|
|
||||||
|
- name: Build dependencies
|
||||||
|
uses: ./.github/actions/build-deps
|
||||||
|
with:
|
||||||
|
build_dir: ${{ inputs.build_dir }}
|
||||||
|
build_nproc: ${{ steps.nproc.outputs.nproc }}
|
||||||
|
build_type: ${{ inputs.build_type }}
|
||||||
|
# Set the verbosity to "quiet" for Windows to avoid an excessive
|
||||||
|
# amount of logs. For other OSes, the "verbose" logs are more useful.
|
||||||
|
log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
|
||||||
|
|
||||||
|
- name: Configure CMake
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ inputs.build_dir }}
|
||||||
|
env:
|
||||||
|
BUILD_TYPE: ${{ inputs.build_type }}
|
||||||
|
CMAKE_ARGS: ${{ inputs.cmake_args }}
|
||||||
|
run: |
|
||||||
|
cmake \
|
||||||
|
-G '${{ runner.os == 'Windows' && 'Visual Studio 17 2022' || 'Ninja' }}' \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
|
||||||
|
${CMAKE_ARGS} \
|
||||||
|
..
|
||||||
|
|
||||||
|
- name: Build the binary
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ inputs.build_dir }}
|
||||||
|
env:
|
||||||
|
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
|
||||||
|
BUILD_TYPE: ${{ inputs.build_type }}
|
||||||
|
CMAKE_TARGET: ${{ inputs.cmake_target }}
|
||||||
|
run: |
|
||||||
|
cmake \
|
||||||
|
--build . \
|
||||||
|
--config "${BUILD_TYPE}" \
|
||||||
|
--parallel ${BUILD_NPROC} \
|
||||||
|
--target "${CMAKE_TARGET}"
|
||||||
|
|
||||||
|
- name: Put built binaries in one location
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ inputs.build_dir }}
|
||||||
|
env:
|
||||||
|
BUILD_TYPE_DIR: ${{ runner.os == 'Windows' && inputs.build_type || '' }}
|
||||||
|
CMAKE_TARGET: ${{ inputs.cmake_target }}
|
||||||
|
run: |
|
||||||
|
mkdir -p ./binaries/doctest/
|
||||||
|
|
||||||
|
cp ./${BUILD_TYPE_DIR}/rippled* ./binaries/
|
||||||
|
if [ "${CMAKE_TARGET}" != 'coverage' ]; then
|
||||||
|
cp ./src/tests/libxrpl/${BUILD_TYPE_DIR}/xrpl.test.* ./binaries/doctest/
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Upload rippled artifact
|
||||||
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
|
env:
|
||||||
|
BUILD_DIR: ${{ inputs.build_dir }}
|
||||||
|
with:
|
||||||
|
name: rippled-${{ inputs.config_name }}
|
||||||
|
path: ${{ env.BUILD_DIR }}/binaries/
|
||||||
|
retention-days: 3
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload coverage report
|
||||||
|
if: ${{ github.repository_owner == 'XRPLF' && inputs.cmake_target == 'coverage' }}
|
||||||
|
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
|
||||||
|
with:
|
||||||
|
disable_search: true
|
||||||
|
disable_telem: true
|
||||||
|
fail_ci_if_error: true
|
||||||
|
files: ${{ inputs.build_dir }}/coverage.xml
|
||||||
|
plugins: noop
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
verbose: true
|
||||||
48
.github/workflows/reusable-check-rename.yml
vendored
Normal file
48
.github/workflows/reusable-check-rename.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# This workflow checks if the codebase is properly renamed, see more info in
|
||||||
|
# .github/scripts/rename/README.md.
|
||||||
|
name: Check rename
|
||||||
|
|
||||||
|
# This workflow can only be triggered by other workflows.
|
||||||
|
on: workflow_call
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}-rename
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
rename:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
|
- name: Check definitions
|
||||||
|
run: .github/scripts/rename/definitions.sh .
|
||||||
|
- name: Check copyright notices
|
||||||
|
run: .github/scripts/rename/copyright.sh .
|
||||||
|
- name: Check CMake configs
|
||||||
|
run: .github/scripts/rename/cmake.sh .
|
||||||
|
- name: Check namespaces
|
||||||
|
run: .github/scripts/rename/namespace.sh .
|
||||||
|
- name: Check for differences
|
||||||
|
env:
|
||||||
|
MESSAGE: |
|
||||||
|
|
||||||
|
One or more files contain changes that do not adhere to new naming
|
||||||
|
conventions.
|
||||||
|
|
||||||
|
Run the scripts in '.github/scripts/rename/' in your repo, commit
|
||||||
|
and push the changes. See .github/scripts/rename/README.md for
|
||||||
|
more info.
|
||||||
|
run: |
|
||||||
|
DIFF=$(git status --porcelain)
|
||||||
|
if [ -n "${DIFF}" ]; then
|
||||||
|
# Print the differences to give the contributor a hint about what to
|
||||||
|
# expect when running the renaming scripts on their own machine.
|
||||||
|
git diff
|
||||||
|
echo "${MESSAGE}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -40,47 +40,52 @@ jobs:
|
|||||||
upload:
|
upload:
|
||||||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
|
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: ghcr.io/xrplf/ci/ubuntu-noble:gcc-13
|
container: ghcr.io/xrplf/ci/ubuntu-noble:gcc-13-sha-5dd7158
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
- name: Generate outputs
|
- name: Generate outputs
|
||||||
id: generate
|
id: generate
|
||||||
|
env:
|
||||||
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||||
run: |
|
run: |
|
||||||
echo 'Generating user and channel.'
|
echo 'Generating user and channel.'
|
||||||
echo "user=clio" >> "${GITHUB_OUTPUT}"
|
echo "user=clio" >> "${GITHUB_OUTPUT}"
|
||||||
echo "channel=pr_${{ github.event.pull_request.number }}" >> "${GITHUB_OUTPUT}"
|
echo "channel=pr_${PR_NUMBER}" >> "${GITHUB_OUTPUT}"
|
||||||
echo 'Extracting version.'
|
echo 'Extracting version.'
|
||||||
echo "version=$(cat src/libxrpl/protocol/BuildInfo.cpp | grep "versionString =" | awk -F '"' '{print $2}')" >> "${GITHUB_OUTPUT}"
|
echo "version=$(cat src/libxrpl/protocol/BuildInfo.cpp | grep "versionString =" | awk -F '"' '{print $2}')" >> "${GITHUB_OUTPUT}"
|
||||||
- name: Calculate conan reference
|
- name: Calculate conan reference
|
||||||
id: conan_ref
|
id: conan_ref
|
||||||
run: |
|
run: |
|
||||||
echo "conan_ref=${{ steps.generate.outputs.version }}@${{ steps.generate.outputs.user }}/${{ steps.generate.outputs.channel }}" >> "${GITHUB_OUTPUT}"
|
echo "conan_ref=${{ steps.generate.outputs.version }}@${{ steps.generate.outputs.user }}/${{ steps.generate.outputs.channel }}" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
- name: Set up Conan
|
- name: Set up Conan
|
||||||
uses: ./.github/actions/setup-conan
|
uses: ./.github/actions/setup-conan
|
||||||
with:
|
with:
|
||||||
conan_remote_name: ${{ inputs.conan_remote_name }}
|
conan_remote_name: ${{ inputs.conan_remote_name }}
|
||||||
conan_remote_url: ${{ inputs.conan_remote_url }}
|
conan_remote_url: ${{ inputs.conan_remote_url }}
|
||||||
|
|
||||||
- name: Log into Conan remote
|
- name: Log into Conan remote
|
||||||
run: conan remote login ${{ inputs.conan_remote_name }} "${{ secrets.conan_remote_username }}" --password "${{ secrets.conan_remote_password }}"
|
env:
|
||||||
|
CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
|
||||||
|
run: conan remote login "${CONAN_REMOTE_NAME}" "${{ secrets.conan_remote_username }}" --password "${{ secrets.conan_remote_password }}"
|
||||||
- name: Upload package
|
- name: Upload package
|
||||||
|
env:
|
||||||
|
CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
|
||||||
run: |
|
run: |
|
||||||
conan export --user=${{ steps.generate.outputs.user }} --channel=${{ steps.generate.outputs.channel }} .
|
conan export --user=${{ steps.generate.outputs.user }} --channel=${{ steps.generate.outputs.channel }} .
|
||||||
conan upload --confirm --check --remote=${{ inputs.conan_remote_name }} xrpl/${{ steps.conan_ref.outputs.conan_ref }}
|
conan upload --confirm --check --remote="${CONAN_REMOTE_NAME}" xrpl/${{ steps.conan_ref.outputs.conan_ref }}
|
||||||
outputs:
|
outputs:
|
||||||
conan_ref: ${{ steps.conan_ref.outputs.conan_ref }}
|
conan_ref: ${{ steps.conan_ref.outputs.conan_ref }}
|
||||||
|
|
||||||
notify:
|
notify:
|
||||||
needs: upload
|
needs: upload
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.clio_notify_token }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Notify Clio
|
- name: Notify Clio
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.clio_notify_token }}
|
||||||
|
PR_URL: ${{ github.event.pull_request.html_url }}
|
||||||
run: |
|
run: |
|
||||||
gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
|
gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
/repos/xrplf/clio/dispatches -f "event_type=check_libxrpl" \
|
/repos/xrplf/clio/dispatches -f "event_type=check_libxrpl" \
|
||||||
-F "client_payload[conan_ref]=${{ needs.upload.outputs.conan_ref }}" \
|
-F "client_payload[conan_ref]=${{ needs.upload.outputs.conan_ref }}" \
|
||||||
-F "client_payload[pr_url]=${{ github.event.pull_request.html_url }}"
|
-F "client_payload[pr_url]=${PR_URL}"
|
||||||
@@ -35,4 +35,7 @@ jobs:
|
|||||||
- name: Generate strategy matrix
|
- name: Generate strategy matrix
|
||||||
working-directory: .github/scripts/strategy-matrix
|
working-directory: .github/scripts/strategy-matrix
|
||||||
id: generate
|
id: generate
|
||||||
run: ./generate.py ${{ inputs.strategy_matrix == 'all' && '--all' || '' }} ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }} >> "${GITHUB_OUTPUT}"
|
env:
|
||||||
|
GENERATE_CONFIG: ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }}
|
||||||
|
GENERATE_OPTION: ${{ inputs.strategy_matrix == 'all' && '--all' || '' }}
|
||||||
|
run: ./generate.py ${GENERATE_OPTION} ${GENERATE_CONFIG} >> "${GITHUB_OUTPUT}"
|
||||||
|
|||||||
111
.github/workflows/reusable-test.yml
vendored
Normal file
111
.github/workflows/reusable-test.yml
vendored
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
name: Test rippled
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
verify_voidstar:
|
||||||
|
description: "Whether to verify the presence of voidstar instrumentation."
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
run_tests:
|
||||||
|
description: "Whether to run unit tests"
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
runs_on:
|
||||||
|
description: Runner to run the job on as a JSON string
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
image:
|
||||||
|
description: "The image to run in (leave empty to run natively)"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
config_name:
|
||||||
|
description: "The name of the configuration."
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
nproc_subtract:
|
||||||
|
description: "The number of processors to subtract when calculating parallelism."
|
||||||
|
required: true
|
||||||
|
type: number
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Test ${{ inputs.config_name }}
|
||||||
|
runs-on: ${{ fromJSON(inputs.runs_on) }}
|
||||||
|
container: ${{ inputs.image != '' && inputs.image || null }}
|
||||||
|
timeout-minutes: 30
|
||||||
|
steps:
|
||||||
|
- name: Cleanup workspace
|
||||||
|
if: ${{ runner.os == 'macOS' }}
|
||||||
|
uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e
|
||||||
|
|
||||||
|
- name: Get number of processors
|
||||||
|
uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
|
||||||
|
id: nproc
|
||||||
|
with:
|
||||||
|
subtract: ${{ inputs.nproc_subtract }}
|
||||||
|
|
||||||
|
- name: Download rippled artifact
|
||||||
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||||
|
with:
|
||||||
|
name: rippled-${{ inputs.config_name }}
|
||||||
|
|
||||||
|
- name: Make binary executable (Linux and macOS)
|
||||||
|
shell: bash
|
||||||
|
if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
|
||||||
|
run: |
|
||||||
|
chmod +x ./rippled
|
||||||
|
|
||||||
|
- name: Check linking (Linux)
|
||||||
|
if: ${{ runner.os == 'Linux' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
ldd ./rippled
|
||||||
|
if [ "$(ldd ./rippled | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then
|
||||||
|
echo 'The binary is statically linked.'
|
||||||
|
else
|
||||||
|
echo 'The binary is dynamically linked.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Verifying presence of instrumentation
|
||||||
|
if: ${{ inputs.verify_voidstar }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
./rippled --version | grep libvoidstar
|
||||||
|
|
||||||
|
- name: Run the embedded tests
|
||||||
|
if: ${{ inputs.run_tests }}
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
|
||||||
|
run: |
|
||||||
|
./rippled --unittest --unittest-jobs ${BUILD_NPROC}
|
||||||
|
|
||||||
|
- name: Run the separate tests
|
||||||
|
if: ${{ inputs.run_tests }}
|
||||||
|
env:
|
||||||
|
EXT: ${{ runner.os == 'Windows' && '.exe' || '' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
for test_file in ./doctest/*${EXT}; do
|
||||||
|
echo "Executing $test_file"
|
||||||
|
chmod +x "$test_file"
|
||||||
|
if [[ "${{ runner.os }}" == "Windows" && "$test_file" == "./doctest/xrpl.test.net.exe" ]]; then
|
||||||
|
echo "Skipping $test_file on Windows"
|
||||||
|
else
|
||||||
|
"$test_file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Debug failure (Linux)
|
||||||
|
if: ${{ failure() && runner.os == 'Linux' && inputs.run_tests }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "IPv4 local port range:"
|
||||||
|
cat /proc/sys/net/ipv4/ip_local_port_range
|
||||||
|
echo "Netstat:"
|
||||||
|
netstat -an
|
||||||
38
.github/workflows/upload-conan-deps.yml
vendored
38
.github/workflows/upload-conan-deps.yml
vendored
@@ -24,30 +24,30 @@ on:
|
|||||||
branches: [develop]
|
branches: [develop]
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/upload-conan-deps.yml
|
- .github/workflows/upload-conan-deps.yml
|
||||||
|
|
||||||
- .github/workflows/reusable-strategy-matrix.yml
|
- .github/workflows/reusable-strategy-matrix.yml
|
||||||
|
|
||||||
- .github/actions/build-deps/action.yml
|
- .github/actions/build-deps/action.yml
|
||||||
- .github/actions/setup-conan/action.yml
|
- .github/actions/setup-conan/action.yml
|
||||||
- ".github/scripts/strategy-matrix/**"
|
- ".github/scripts/strategy-matrix/**"
|
||||||
|
|
||||||
- conanfile.py
|
- conanfile.py
|
||||||
- conan.lock
|
- conan.lock
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CONAN_REMOTE_NAME: xrplf
|
CONAN_REMOTE_NAME: xrplf
|
||||||
CONAN_REMOTE_URL: https://conan.ripplex.io
|
CONAN_REMOTE_URL: https://conan.ripplex.io
|
||||||
|
NPROC_SUBTRACT: 2
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Generate the strategy matrix to be used by the following job.
|
||||||
generate-matrix:
|
generate-matrix:
|
||||||
uses: ./.github/workflows/reusable-strategy-matrix.yml
|
uses: ./.github/workflows/reusable-strategy-matrix.yml
|
||||||
with:
|
with:
|
||||||
strategy_matrix: ${{ github.event_name == 'pull_request' && 'minimal' || 'all' }}
|
strategy_matrix: ${{ github.event_name == 'pull_request' && 'minimal' || 'all' }}
|
||||||
|
|
||||||
|
# Build and upload the dependencies for each configuration.
|
||||||
run-upload-conan-deps:
|
run-upload-conan-deps:
|
||||||
needs:
|
needs:
|
||||||
- generate-matrix
|
- generate-matrix
|
||||||
@@ -56,19 +56,29 @@ jobs:
|
|||||||
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
|
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
|
||||||
max-parallel: 10
|
max-parallel: 10
|
||||||
runs-on: ${{ matrix.architecture.runner }}
|
runs-on: ${{ matrix.architecture.runner }}
|
||||||
container: ${{ contains(matrix.architecture.platform, 'linux') && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version) || null }}
|
container: ${{ contains(matrix.architecture.platform, 'linux') && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}-sha-{4}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version, matrix.os.image_sha) || null }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cleanup workspace
|
- name: Cleanup workspace
|
||||||
if: ${{ runner.os == 'macOS' }}
|
if: ${{ runner.os == 'macOS' }}
|
||||||
uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e
|
uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e
|
||||||
|
|
||||||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
|
|
||||||
- name: Prepare runner
|
- name: Prepare runner
|
||||||
uses: XRPLF/actions/.github/actions/prepare-runner@638e0dc11ea230f91bd26622fb542116bb5254d5
|
uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a
|
||||||
with:
|
with:
|
||||||
disable_ccache: false
|
disable_ccache: false
|
||||||
|
|
||||||
|
- name: Print build environment
|
||||||
|
uses: ./.github/actions/print-env
|
||||||
|
|
||||||
|
- name: Get number of processors
|
||||||
|
uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
|
||||||
|
id: nproc
|
||||||
|
with:
|
||||||
|
subtract: ${{ env.NPROC_SUBTRACT }}
|
||||||
|
|
||||||
- name: Setup Conan
|
- name: Setup Conan
|
||||||
uses: ./.github/actions/setup-conan
|
uses: ./.github/actions/setup-conan
|
||||||
with:
|
with:
|
||||||
@@ -79,13 +89,19 @@ jobs:
|
|||||||
uses: ./.github/actions/build-deps
|
uses: ./.github/actions/build-deps
|
||||||
with:
|
with:
|
||||||
build_dir: .build
|
build_dir: .build
|
||||||
|
build_nproc: ${{ steps.nproc.outputs.nproc }}
|
||||||
build_type: ${{ matrix.build_type }}
|
build_type: ${{ matrix.build_type }}
|
||||||
force_build: ${{ github.event_name == 'schedule' || github.event.inputs.force_source_build == 'true' }}
|
force_build: ${{ github.event_name == 'schedule' || github.event.inputs.force_source_build == 'true' }}
|
||||||
|
# Set the verbosity to "quiet" for Windows to avoid an excessive
|
||||||
|
# amount of logs. For other OSes, the "verbose" logs are more useful.
|
||||||
|
log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
|
||||||
|
|
||||||
- name: Log into Conan remote
|
- name: Log into Conan remote
|
||||||
if: ${{ github.repository_owner == 'XRPLF' && github.event_name != 'pull_request' }}
|
if: ${{ github.repository_owner == 'XRPLF' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
|
||||||
run: conan remote login ${{ env.CONAN_REMOTE_NAME }} "${{ secrets.CONAN_REMOTE_USERNAME }}" --password "${{ secrets.CONAN_REMOTE_PASSWORD }}"
|
run: conan remote login "${CONAN_REMOTE_NAME}" "${{ secrets.CONAN_REMOTE_USERNAME }}" --password "${{ secrets.CONAN_REMOTE_PASSWORD }}"
|
||||||
|
|
||||||
- name: Upload Conan packages
|
- name: Upload Conan packages
|
||||||
if: ${{ github.repository_owner == 'XRPLF' && github.event_name != 'pull_request' && github.event_name != 'schedule' }}
|
if: ${{ github.repository_owner == 'XRPLF' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
|
||||||
run: conan upload "*" -r=${{ env.CONAN_REMOTE_NAME }} --confirm ${{ github.event.inputs.force_upload == 'true' && '--force' || '' }}
|
env:
|
||||||
|
FORCE_OPTION: ${{ github.event.inputs.force_upload == 'true' && '--force' || '' }}
|
||||||
|
run: conan upload "*" --remote="${CONAN_REMOTE_NAME}" --confirm ${FORCE_OPTION}
|
||||||
|
|||||||
24
BUILD.md
24
BUILD.md
@@ -39,17 +39,12 @@ found here](./docs/build/environment.md).
|
|||||||
|
|
||||||
- [Python 3.11](https://www.python.org/downloads/), or higher
|
- [Python 3.11](https://www.python.org/downloads/), or higher
|
||||||
- [Conan 2.17](https://conan.io/downloads.html)[^1], or higher
|
- [Conan 2.17](https://conan.io/downloads.html)[^1], or higher
|
||||||
- [CMake 3.22](https://cmake.org/download/)[^2], or higher
|
- [CMake 3.22](https://cmake.org/download/), or higher
|
||||||
|
|
||||||
[^1]:
|
[^1]:
|
||||||
It is possible to build with Conan 1.60+, but the instructions are
|
It is possible to build with Conan 1.60+, but the instructions are
|
||||||
significantly different, which is why we are not recommending it.
|
significantly different, which is why we are not recommending it.
|
||||||
|
|
||||||
[^2]:
|
|
||||||
CMake 4 is not yet supported by all dependencies required by this project.
|
|
||||||
If you are affected by this issue, follow [conan workaround for cmake
|
|
||||||
4](#workaround-for-cmake-4)
|
|
||||||
|
|
||||||
`rippled` is written in the C++20 dialect and includes the `<concepts>` header.
|
`rippled` is written in the C++20 dialect and includes the `<concepts>` header.
|
||||||
The [minimum compiler versions][2] required are:
|
The [minimum compiler versions][2] required are:
|
||||||
|
|
||||||
@@ -282,21 +277,6 @@ sed -i.bak -e 's|^arch=.*$|arch=x86_64|' $(conan config home)/profiles/default
|
|||||||
sed -i.bak -e 's|^compiler\.runtime=.*$|compiler.runtime=static|' $(conan config home)/profiles/default
|
sed -i.bak -e 's|^compiler\.runtime=.*$|compiler.runtime=static|' $(conan config home)/profiles/default
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Workaround for CMake 4
|
|
||||||
|
|
||||||
If your system CMake is version 4 rather than 3, you may have to configure Conan
|
|
||||||
profile to use CMake version 3 for dependencies, by adding the following two
|
|
||||||
lines to your profile:
|
|
||||||
|
|
||||||
```text
|
|
||||||
[tool_requires]
|
|
||||||
!cmake/*: cmake/[>=3 <4]
|
|
||||||
```
|
|
||||||
|
|
||||||
This will force Conan to download and use a locally cached CMake 3 version, and
|
|
||||||
is needed because some of the dependencies used by this project do not support
|
|
||||||
CMake 4.
|
|
||||||
|
|
||||||
#### Clang workaround for grpc
|
#### Clang workaround for grpc
|
||||||
|
|
||||||
If your compiler is clang, version 19 or later, or apple-clang, version 17 or
|
If your compiler is clang, version 19 or later, or apple-clang, version 17 or
|
||||||
@@ -610,7 +590,7 @@ you might have generated CMake files for a different `build_type` than the
|
|||||||
`CMAKE_BUILD_TYPE` you passed to Conan.
|
`CMAKE_BUILD_TYPE` you passed to Conan.
|
||||||
|
|
||||||
```
|
```
|
||||||
/rippled/.build/pb-xrpl.libpb/xrpl/proto/ripple.pb.h:10:10: fatal error: 'google/protobuf/port_def.inc' file not found
|
/rippled/.build/pb-xrpl.libpb/xrpl/proto/xrpl.pb.h:10:10: fatal error: 'google/protobuf/port_def.inc' file not found
|
||||||
10 | #include <google/protobuf/port_def.inc>
|
10 | #include <google/protobuf/port_def.inc>
|
||||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
1 error generated.
|
1 error generated.
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ if(Git_FOUND)
|
|||||||
endif() #git
|
endif() #git
|
||||||
|
|
||||||
if(thread_safety_analysis)
|
if(thread_safety_analysis)
|
||||||
add_compile_options(-Wthread-safety -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -DRIPPLE_ENABLE_THREAD_SAFETY_ANNOTATIONS)
|
add_compile_options(-Wthread-safety -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -DXRPL_ENABLE_THREAD_SAFETY_ANNOTATIONS)
|
||||||
add_compile_options("-stdlib=libc++")
|
add_compile_options("-stdlib=libc++")
|
||||||
add_link_options("-stdlib=libc++")
|
add_link_options("-stdlib=libc++")
|
||||||
endif()
|
endif()
|
||||||
@@ -62,9 +62,9 @@ if (target)
|
|||||||
message (FATAL_ERROR "The target option has been removed - use native cmake options to control build")
|
message (FATAL_ERROR "The target option has been removed - use native cmake options to control build")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(RippledSanity)
|
include(XrplSanity)
|
||||||
include(RippledVersion)
|
include(XrplVersion)
|
||||||
include(RippledSettings)
|
include(XrplSettings)
|
||||||
# this check has to remain in the top-level cmake
|
# this check has to remain in the top-level cmake
|
||||||
# because of the early return statement
|
# because of the early return statement
|
||||||
if (packages_only)
|
if (packages_only)
|
||||||
@@ -73,11 +73,11 @@ if (packages_only)
|
|||||||
endif()
|
endif()
|
||||||
return ()
|
return ()
|
||||||
endif ()
|
endif ()
|
||||||
include(RippledCompiler)
|
include(XrplCompiler)
|
||||||
include(RippledInterface)
|
include(XrplInterface)
|
||||||
|
|
||||||
option(only_docs "Include only the docs target?" FALSE)
|
option(only_docs "Include only the docs target?" FALSE)
|
||||||
include(RippledDocs)
|
include(XrplDocs)
|
||||||
if(only_docs)
|
if(only_docs)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
@@ -112,16 +112,16 @@ option(rocksdb "Enable RocksDB" ON)
|
|||||||
if(rocksdb)
|
if(rocksdb)
|
||||||
find_package(RocksDB REQUIRED)
|
find_package(RocksDB REQUIRED)
|
||||||
set_target_properties(RocksDB::rocksdb PROPERTIES
|
set_target_properties(RocksDB::rocksdb PROPERTIES
|
||||||
INTERFACE_COMPILE_DEFINITIONS RIPPLE_ROCKSDB_AVAILABLE=1
|
INTERFACE_COMPILE_DEFINITIONS XRPL_ROCKSDB_AVAILABLE=1
|
||||||
)
|
)
|
||||||
target_link_libraries(ripple_libs INTERFACE RocksDB::rocksdb)
|
target_link_libraries(xrpl_libs INTERFACE RocksDB::rocksdb)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(nudb REQUIRED)
|
find_package(nudb REQUIRED)
|
||||||
find_package(date REQUIRED)
|
find_package(date REQUIRED)
|
||||||
find_package(xxHash REQUIRED)
|
find_package(xxHash REQUIRED)
|
||||||
|
|
||||||
target_link_libraries(ripple_libs INTERFACE
|
target_link_libraries(xrpl_libs INTERFACE
|
||||||
ed25519::ed25519
|
ed25519::ed25519
|
||||||
lz4::lz4
|
lz4::lz4
|
||||||
OpenSSL::Crypto
|
OpenSSL::Crypto
|
||||||
@@ -139,16 +139,16 @@ elseif(TARGET NuDB::nudb)
|
|||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "unknown nudb target")
|
message(FATAL_ERROR "unknown nudb target")
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(ripple_libs INTERFACE ${nudb})
|
target_link_libraries(xrpl_libs INTERFACE ${nudb})
|
||||||
|
|
||||||
if(coverage)
|
if(coverage)
|
||||||
include(RippledCov)
|
include(XrplCov)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PROJECT_EXPORT_SET RippleExports)
|
set(PROJECT_EXPORT_SET XrplExports)
|
||||||
include(RippledCore)
|
include(XrplCore)
|
||||||
include(RippledInstall)
|
include(XrplInstall)
|
||||||
include(RippledValidatorKeys)
|
include(XrplValidatorKeys)
|
||||||
|
|
||||||
if(tests)
|
if(tests)
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ For this reason:
|
|||||||
- Example **bad** name
|
- Example **bad** name
|
||||||
`"RFC1751::insert(char* s, int x, int start, int length) : length is greater than or equal zero"`
|
`"RFC1751::insert(char* s, int x, int start, int length) : length is greater than or equal zero"`
|
||||||
(missing namespace, unnecessary full function signature, description too verbose).
|
(missing namespace, unnecessary full function signature, description too verbose).
|
||||||
Good name: `"ripple::RFC1751::insert : minimum length"`.
|
Good name: `"xrpl::RFC1751::insert : minimum length"`.
|
||||||
- In **few** well-justified cases a non-standard name can be used, in which case a
|
- In **few** well-justified cases a non-standard name can be used, in which case a
|
||||||
comment should be placed to explain the rationale (example in `contract.cpp`)
|
comment should be placed to explain the rationale (example in `contract.cpp`)
|
||||||
- Do **not** rename a contract without a good reason (e.g. the name no longer
|
- Do **not** rename a contract without a good reason (e.g. the name no longer
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
ISC License
|
ISC License
|
||||||
|
|
||||||
Copyright (c) 2011, Arthur Britto, David Schwartz, Jed McCaleb, Vinnie Falco, Bob Way, Eric Lombrozo, Nikolaos D. Bougalis, Howard Hinnant.
|
Copyright (c) 2011, Arthur Britto, David Schwartz, Jed McCaleb, Vinnie Falco, Bob Way, Eric Lombrozo, Nikolaos D. Bougalis, Howard Hinnant.
|
||||||
Copyright (c) 2012-2020, the XRP Ledger developers.
|
Copyright (c) 2012-2025, the XRP Ledger developers.
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software for any
|
Permission to use, copy, modify, and distribute this software for any
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|||||||
@@ -975,6 +975,47 @@
|
|||||||
# number of ledger records online. Must be greater
|
# number of ledger records online. Must be greater
|
||||||
# than or equal to ledger_history.
|
# than or equal to ledger_history.
|
||||||
#
|
#
|
||||||
|
# Optional keys for NuDB only:
|
||||||
|
#
|
||||||
|
# nudb_block_size EXPERIMENTAL: Block size in bytes for NuDB storage.
|
||||||
|
# Must be a power of 2 between 4096 and 32768. Default is 4096.
|
||||||
|
#
|
||||||
|
# This parameter controls the fundamental storage unit
|
||||||
|
# size for NuDB's internal data structures. The choice
|
||||||
|
# of block size can significantly impact performance
|
||||||
|
# depending on your storage hardware and filesystem:
|
||||||
|
#
|
||||||
|
# - 4096 bytes: Optimal for most standard SSDs and
|
||||||
|
# traditional filesystems (ext4, NTFS, HFS+).
|
||||||
|
# Provides good balance of performance and storage
|
||||||
|
# efficiency. Recommended for most deployments.
|
||||||
|
# Minimizes memory footprint and provides consistent
|
||||||
|
# low-latency access patterns across diverse hardware.
|
||||||
|
#
|
||||||
|
# - 8192-16384 bytes: May improve performance on
|
||||||
|
# high-end NVMe SSDs and copy-on-write filesystems
|
||||||
|
# like ZFS or Btrfs that benefit from larger block
|
||||||
|
# alignment. Can reduce metadata overhead for large
|
||||||
|
# databases. Offers better sequential throughput and
|
||||||
|
# reduced I/O operations at the cost of higher memory
|
||||||
|
# usage per operation.
|
||||||
|
#
|
||||||
|
# - 32768 bytes (32K): Maximum supported block size
|
||||||
|
# for high-performance scenarios with very fast
|
||||||
|
# storage. May increase memory usage and reduce
|
||||||
|
# efficiency for smaller databases. Best suited for
|
||||||
|
# enterprise environments with abundant RAM.
|
||||||
|
#
|
||||||
|
# Performance testing is recommended before deploying
|
||||||
|
# any non-default block size in production environments.
|
||||||
|
#
|
||||||
|
# Note: This setting cannot be changed after database
|
||||||
|
# creation without rebuilding the entire database.
|
||||||
|
# Choose carefully based on your hardware and expected
|
||||||
|
# database size.
|
||||||
|
#
|
||||||
|
# Example: nudb_block_size=4096
|
||||||
|
#
|
||||||
# These keys modify the behavior of online_delete, and thus are only
|
# These keys modify the behavior of online_delete, and thus are only
|
||||||
# relevant if online_delete is defined and non-zero:
|
# relevant if online_delete is defined and non-zero:
|
||||||
#
|
#
|
||||||
@@ -1471,6 +1512,7 @@ secure_gateway = 127.0.0.1
|
|||||||
[node_db]
|
[node_db]
|
||||||
type=NuDB
|
type=NuDB
|
||||||
path=/var/lib/rippled/db/nudb
|
path=/var/lib/rippled/db/nudb
|
||||||
|
nudb_block_size=4096
|
||||||
online_delete=512
|
online_delete=512
|
||||||
advisory_delete=0
|
advisory_delete=0
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
option (validator_keys "Enables building of validator-keys-tool as a separate target (imported via FetchContent)" OFF)
|
|
||||||
|
|
||||||
if (validator_keys)
|
|
||||||
git_branch (current_branch)
|
|
||||||
# default to tracking VK master branch unless we are on release
|
|
||||||
if (NOT (current_branch STREQUAL "release"))
|
|
||||||
set (current_branch "master")
|
|
||||||
endif ()
|
|
||||||
message (STATUS "tracking ValidatorKeys branch: ${current_branch}")
|
|
||||||
|
|
||||||
FetchContent_Declare (
|
|
||||||
validator_keys_src
|
|
||||||
GIT_REPOSITORY https://github.com/ripple/validator-keys-tool.git
|
|
||||||
GIT_TAG "${current_branch}"
|
|
||||||
)
|
|
||||||
FetchContent_GetProperties (validator_keys_src)
|
|
||||||
if (NOT validator_keys_src_POPULATED)
|
|
||||||
message (STATUS "Pausing to download ValidatorKeys...")
|
|
||||||
FetchContent_Populate (validator_keys_src)
|
|
||||||
endif ()
|
|
||||||
add_subdirectory (${validator_keys_src_SOURCE_DIR} ${CMAKE_BINARY_DIR}/validator-keys)
|
|
||||||
endif ()
|
|
||||||
@@ -7,7 +7,7 @@ function(xrpl_add_test name)
|
|||||||
"${CMAKE_CURRENT_SOURCE_DIR}/${name}/*.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/${name}/*.cpp"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp"
|
||||||
)
|
)
|
||||||
add_executable(${target} EXCLUDE_FROM_ALL ${ARGN} ${sources})
|
add_executable(${target} ${ARGN} ${sources})
|
||||||
|
|
||||||
isolate_headers(
|
isolate_headers(
|
||||||
${target}
|
${target}
|
||||||
@@ -7,9 +7,9 @@
|
|||||||
toolchain file, especially the ABI-impacting ones
|
toolchain file, especially the ABI-impacting ones
|
||||||
#]=========================================================]
|
#]=========================================================]
|
||||||
add_library (common INTERFACE)
|
add_library (common INTERFACE)
|
||||||
add_library (Ripple::common ALIAS common)
|
add_library (Xrpl::common ALIAS common)
|
||||||
# add a single global dependency on this interface lib
|
# add a single global dependency on this interface lib
|
||||||
link_libraries (Ripple::common)
|
link_libraries (Xrpl::common)
|
||||||
set_target_properties (common
|
set_target_properties (common
|
||||||
PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
|
PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
@@ -53,4 +53,4 @@ if (TARGET ZLIB::ZLIB)
|
|||||||
INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
|
INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include ("${CMAKE_CURRENT_LIST_DIR}/RippleTargets.cmake")
|
include ("${CMAKE_CURRENT_LIST_DIR}/XrplTargets.cmake")
|
||||||
@@ -13,7 +13,7 @@ set_target_properties(xrpl.libpb PROPERTIES UNITY_BUILD OFF)
|
|||||||
target_protobuf_sources(xrpl.libpb xrpl/proto
|
target_protobuf_sources(xrpl.libpb xrpl/proto
|
||||||
LANGUAGE cpp
|
LANGUAGE cpp
|
||||||
IMPORT_DIRS include/xrpl/proto
|
IMPORT_DIRS include/xrpl/proto
|
||||||
PROTOS include/xrpl/proto/ripple.proto
|
PROTOS include/xrpl/proto/xrpl.proto
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB_RECURSE protos "include/xrpl/proto/org/*.proto")
|
file(GLOB_RECURSE protos "include/xrpl/proto/org/*.proto")
|
||||||
@@ -53,14 +53,15 @@ add_library(xrpl.imports.main INTERFACE)
|
|||||||
|
|
||||||
target_link_libraries(xrpl.imports.main
|
target_link_libraries(xrpl.imports.main
|
||||||
INTERFACE
|
INTERFACE
|
||||||
LibArchive::LibArchive
|
|
||||||
OpenSSL::Crypto
|
|
||||||
Ripple::boost
|
|
||||||
Ripple::opts
|
|
||||||
Ripple::syslibs
|
|
||||||
absl::random_random
|
absl::random_random
|
||||||
date::date
|
date::date
|
||||||
ed25519::ed25519
|
ed25519::ed25519
|
||||||
|
LibArchive::LibArchive
|
||||||
|
OpenSSL::Crypto
|
||||||
|
Xrpl::boost
|
||||||
|
Xrpl::libs
|
||||||
|
Xrpl::opts
|
||||||
|
Xrpl::syslibs
|
||||||
secp256k1::secp256k1
|
secp256k1::secp256k1
|
||||||
xrpl.libpb
|
xrpl.libpb
|
||||||
xxHash::xxhash
|
xxHash::xxhash
|
||||||
@@ -111,6 +112,27 @@ target_link_libraries(xrpl.libxrpl.net PUBLIC
|
|||||||
add_module(xrpl server)
|
add_module(xrpl server)
|
||||||
target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol)
|
target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol)
|
||||||
|
|
||||||
|
add_module(xrpl nodestore)
|
||||||
|
target_link_libraries(xrpl.libxrpl.nodestore PUBLIC
|
||||||
|
xrpl.libxrpl.basics
|
||||||
|
xrpl.libxrpl.json
|
||||||
|
xrpl.libxrpl.protocol
|
||||||
|
)
|
||||||
|
|
||||||
|
add_module(xrpl shamap)
|
||||||
|
target_link_libraries(xrpl.libxrpl.shamap PUBLIC
|
||||||
|
xrpl.libxrpl.basics
|
||||||
|
xrpl.libxrpl.crypto
|
||||||
|
xrpl.libxrpl.protocol
|
||||||
|
xrpl.libxrpl.nodestore
|
||||||
|
)
|
||||||
|
|
||||||
|
add_module(xrpl ledger)
|
||||||
|
target_link_libraries(xrpl.libxrpl.ledger PUBLIC
|
||||||
|
xrpl.libxrpl.basics
|
||||||
|
xrpl.libxrpl.json
|
||||||
|
xrpl.libxrpl.protocol
|
||||||
|
)
|
||||||
|
|
||||||
add_library(xrpl.libxrpl)
|
add_library(xrpl.libxrpl)
|
||||||
set_target_properties(xrpl.libxrpl PROPERTIES OUTPUT_NAME xrpl)
|
set_target_properties(xrpl.libxrpl PROPERTIES OUTPUT_NAME xrpl)
|
||||||
@@ -130,7 +152,10 @@ target_link_modules(xrpl PUBLIC
|
|||||||
protocol
|
protocol
|
||||||
resource
|
resource
|
||||||
server
|
server
|
||||||
|
nodestore
|
||||||
|
shamap
|
||||||
net
|
net
|
||||||
|
ledger
|
||||||
)
|
)
|
||||||
|
|
||||||
# All headers in libxrpl are in modules.
|
# All headers in libxrpl are in modules.
|
||||||
@@ -143,14 +168,14 @@ target_link_modules(xrpl PUBLIC
|
|||||||
# $<INSTALL_INTERFACE:include>)
|
# $<INSTALL_INTERFACE:include>)
|
||||||
|
|
||||||
if(xrpld)
|
if(xrpld)
|
||||||
add_executable(rippled)
|
add_executable(xrpld)
|
||||||
if(tests)
|
if(tests)
|
||||||
target_compile_definitions(rippled PUBLIC ENABLE_TESTS)
|
target_compile_definitions(xrpld PUBLIC ENABLE_TESTS)
|
||||||
target_compile_definitions(rippled PRIVATE
|
target_compile_definitions(xrpld PRIVATE
|
||||||
UNIT_TEST_REFERENCE_FEE=${UNIT_TEST_REFERENCE_FEE}
|
UNIT_TEST_REFERENCE_FEE=${UNIT_TEST_REFERENCE_FEE}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
target_include_directories(rippled
|
target_include_directories(xrpld
|
||||||
PRIVATE
|
PRIVATE
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
||||||
)
|
)
|
||||||
@@ -158,36 +183,36 @@ if(xrpld)
|
|||||||
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
|
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/xrpld/*.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/xrpld/*.cpp"
|
||||||
)
|
)
|
||||||
target_sources(rippled PRIVATE ${sources})
|
target_sources(xrpld PRIVATE ${sources})
|
||||||
|
|
||||||
if(tests)
|
if(tests)
|
||||||
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
|
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/test/*.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/test/*.cpp"
|
||||||
)
|
)
|
||||||
target_sources(rippled PRIVATE ${sources})
|
target_sources(xrpld PRIVATE ${sources})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(rippled
|
target_link_libraries(xrpld
|
||||||
Ripple::boost
|
Xrpl::boost
|
||||||
Ripple::opts
|
Xrpl::opts
|
||||||
Ripple::libs
|
Xrpl::libs
|
||||||
xrpl.libxrpl
|
xrpl.libxrpl
|
||||||
)
|
)
|
||||||
exclude_if_included(rippled)
|
exclude_if_included(xrpld)
|
||||||
# define a macro for tests that might need to
|
# define a macro for tests that might need to
|
||||||
# be exluded or run differently in CI environment
|
# be exluded or run differently in CI environment
|
||||||
if(is_ci)
|
if(is_ci)
|
||||||
target_compile_definitions(rippled PRIVATE RIPPLED_RUNNING_IN_CI)
|
target_compile_definitions(xrpld PRIVATE XRPL_RUNNING_IN_CI)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if(voidstar)
|
if(voidstar)
|
||||||
target_compile_options(rippled
|
target_compile_options(xrpld
|
||||||
PRIVATE
|
PRIVATE
|
||||||
-fsanitize-coverage=trace-pc-guard
|
-fsanitize-coverage=trace-pc-guard
|
||||||
)
|
)
|
||||||
# rippled requires access to antithesis-sdk-cpp implementation file
|
# xrpld requires access to antithesis-sdk-cpp implementation file
|
||||||
# antithesis_instrumentation.h, which is not exported as INTERFACE
|
# antithesis_instrumentation.h, which is not exported as INTERFACE
|
||||||
target_include_directories(rippled
|
target_include_directories(xrpld
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${CMAKE_SOURCE_DIR}/external/antithesis-sdk
|
${CMAKE_SOURCE_DIR}/external/antithesis-sdk
|
||||||
)
|
)
|
||||||
@@ -200,5 +225,7 @@ if(xrpld)
|
|||||||
src/test/rpc/ValidatorRPC_test.cpp
|
src/test/rpc/ValidatorRPC_test.cpp
|
||||||
src/test/ledger/Invariants_test.cpp
|
src/test/ledger/Invariants_test.cpp
|
||||||
PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
|
PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
|
||||||
|
# For the time being, we will keep the name of the binary as it was.
|
||||||
|
set_target_properties(xrpld PROPERTIES OUTPUT_NAME "rippled")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -31,10 +31,10 @@ list(APPEND GCOVR_ADDITIONAL_ARGS
|
|||||||
setup_target_for_coverage_gcovr(
|
setup_target_for_coverage_gcovr(
|
||||||
NAME coverage
|
NAME coverage
|
||||||
FORMAT ${coverage_format}
|
FORMAT ${coverage_format}
|
||||||
EXECUTABLE rippled
|
EXECUTABLE xrpld
|
||||||
EXECUTABLE_ARGS --unittest$<$<BOOL:${coverage_test}>:=${coverage_test}> --unittest-jobs ${coverage_test_parallelism} --quiet --unittest-log
|
EXECUTABLE_ARGS --unittest$<$<BOOL:${coverage_test}>:=${coverage_test}> --unittest-jobs ${coverage_test_parallelism} --quiet --unittest-log
|
||||||
EXCLUDE "src/test" "include/xrpl/beast/test" "include/xrpl/beast/unit_test" "${CMAKE_BINARY_DIR}/pb-xrpl.libpb"
|
EXCLUDE "src/test" "src/tests" "include/xrpl/beast/test" "include/xrpl/beast/unit_test" "${CMAKE_BINARY_DIR}/pb-xrpl.libpb"
|
||||||
DEPENDENCIES rippled
|
DEPENDENCIES xrpld
|
||||||
)
|
)
|
||||||
|
|
||||||
add_code_coverage_to_target(opts INTERFACE)
|
add_code_coverage_to_target(opts INTERFACE)
|
||||||
@@ -8,21 +8,25 @@ install (
|
|||||||
TARGETS
|
TARGETS
|
||||||
common
|
common
|
||||||
opts
|
opts
|
||||||
ripple_syslibs
|
xrpl_boost
|
||||||
ripple_boost
|
xrpl_libs
|
||||||
|
xrpl_syslibs
|
||||||
xrpl.imports.main
|
xrpl.imports.main
|
||||||
xrpl.libpb
|
xrpl.libpb
|
||||||
|
xrpl.libxrpl
|
||||||
xrpl.libxrpl.basics
|
xrpl.libxrpl.basics
|
||||||
xrpl.libxrpl.beast
|
xrpl.libxrpl.beast
|
||||||
xrpl.libxrpl.crypto
|
xrpl.libxrpl.crypto
|
||||||
xrpl.libxrpl.json
|
xrpl.libxrpl.json
|
||||||
|
xrpl.libxrpl.ledger
|
||||||
|
xrpl.libxrpl.net
|
||||||
|
xrpl.libxrpl.nodestore
|
||||||
xrpl.libxrpl.protocol
|
xrpl.libxrpl.protocol
|
||||||
xrpl.libxrpl.resource
|
xrpl.libxrpl.resource
|
||||||
xrpl.libxrpl.server
|
xrpl.libxrpl.server
|
||||||
xrpl.libxrpl.net
|
xrpl.libxrpl.shamap
|
||||||
xrpl.libxrpl
|
|
||||||
antithesis-sdk-cpp
|
antithesis-sdk-cpp
|
||||||
EXPORT RippleExports
|
EXPORT XrplExports
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
@@ -37,22 +41,22 @@ install(CODE "
|
|||||||
set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
|
set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
|
||||||
include(create_symbolic_link)
|
include(create_symbolic_link)
|
||||||
create_symbolic_link(xrpl \
|
create_symbolic_link(xrpl \
|
||||||
\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/ripple)
|
\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/xrpl)
|
||||||
")
|
")
|
||||||
|
|
||||||
install (EXPORT RippleExports
|
install (EXPORT XrplExports
|
||||||
FILE RippleTargets.cmake
|
FILE XrplTargets.cmake
|
||||||
NAMESPACE Ripple::
|
NAMESPACE Xrpl::
|
||||||
DESTINATION lib/cmake/ripple)
|
DESTINATION lib/cmake/xrpl)
|
||||||
include (CMakePackageConfigHelpers)
|
include (CMakePackageConfigHelpers)
|
||||||
write_basic_package_version_file (
|
write_basic_package_version_file (
|
||||||
RippleConfigVersion.cmake
|
XrplConfigVersion.cmake
|
||||||
VERSION ${rippled_version}
|
VERSION ${xrpld_version}
|
||||||
COMPATIBILITY SameMajorVersion)
|
COMPATIBILITY SameMajorVersion)
|
||||||
|
|
||||||
if (is_root_project AND TARGET rippled)
|
if (is_root_project AND TARGET xrpld)
|
||||||
install (TARGETS rippled RUNTIME DESTINATION bin)
|
install (TARGETS xrpld RUNTIME DESTINATION bin)
|
||||||
set_target_properties(rippled PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
|
set_target_properties(xrpld PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
|
||||||
# sample configs should not overwrite existing files
|
# sample configs should not overwrite existing files
|
||||||
# install if-not-exists workaround as suggested by
|
# install if-not-exists workaround as suggested by
|
||||||
# https://cmake.org/Bug/view.php?id=12646
|
# https://cmake.org/Bug/view.php?id=12646
|
||||||
@@ -70,13 +74,13 @@ if (is_root_project AND TARGET rippled)
|
|||||||
install(CODE "
|
install(CODE "
|
||||||
set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
|
set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
|
||||||
include(create_symbolic_link)
|
include(create_symbolic_link)
|
||||||
create_symbolic_link(rippled${suffix} \
|
create_symbolic_link(xrpld${suffix} \
|
||||||
\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/xrpld${suffix})
|
\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/xrpld${suffix})
|
||||||
")
|
")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
install (
|
install (
|
||||||
FILES
|
FILES
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/RippleConfig.cmake
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/XrplConfig.cmake
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/RippleConfigVersion.cmake
|
${CMAKE_CURRENT_BINARY_DIR}/XrplConfigVersion.cmake
|
||||||
DESTINATION lib/cmake/ripple)
|
DESTINATION lib/cmake/xrpl)
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
#[===================================================================[
|
#[===================================================================[
|
||||||
rippled compile options/settings via an interface library
|
xrpld compile options/settings via an interface library
|
||||||
#]===================================================================]
|
#]===================================================================]
|
||||||
|
|
||||||
add_library (opts INTERFACE)
|
add_library (opts INTERFACE)
|
||||||
add_library (Ripple::opts ALIAS opts)
|
add_library (Xrpl::opts ALIAS opts)
|
||||||
target_compile_definitions (opts
|
target_compile_definitions (opts
|
||||||
INTERFACE
|
INTERFACE
|
||||||
BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS
|
BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS
|
||||||
@@ -21,7 +21,7 @@ target_compile_definitions (opts
|
|||||||
>
|
>
|
||||||
$<$<BOOL:${beast_no_unit_test_inline}>:BEAST_NO_UNIT_TEST_INLINE=1>
|
$<$<BOOL:${beast_no_unit_test_inline}>:BEAST_NO_UNIT_TEST_INLINE=1>
|
||||||
$<$<BOOL:${beast_disable_autolink}>:BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES=1>
|
$<$<BOOL:${beast_disable_autolink}>:BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES=1>
|
||||||
$<$<BOOL:${single_io_service_thread}>:RIPPLE_SINGLE_IO_SERVICE_THREAD=1>
|
$<$<BOOL:${single_io_service_thread}>:XRPL_SINGLE_IO_SERVICE_THREAD=1>
|
||||||
$<$<BOOL:${voidstar}>:ENABLE_VOIDSTAR>)
|
$<$<BOOL:${voidstar}>:ENABLE_VOIDSTAR>)
|
||||||
target_compile_options (opts
|
target_compile_options (opts
|
||||||
INTERFACE
|
INTERFACE
|
||||||
@@ -59,12 +59,12 @@ if (san)
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
#[===================================================================[
|
#[===================================================================[
|
||||||
rippled transitive library deps via an interface library
|
xrpld transitive library deps via an interface library
|
||||||
#]===================================================================]
|
#]===================================================================]
|
||||||
|
|
||||||
add_library (ripple_syslibs INTERFACE)
|
add_library (xrpl_syslibs INTERFACE)
|
||||||
add_library (Ripple::syslibs ALIAS ripple_syslibs)
|
add_library (Xrpl::syslibs ALIAS xrpl_syslibs)
|
||||||
target_link_libraries (ripple_syslibs
|
target_link_libraries (xrpl_syslibs
|
||||||
INTERFACE
|
INTERFACE
|
||||||
$<$<BOOL:${MSVC}>:
|
$<$<BOOL:${MSVC}>:
|
||||||
legacy_stdio_definitions.lib
|
legacy_stdio_definitions.lib
|
||||||
@@ -89,9 +89,9 @@ target_link_libraries (ripple_syslibs
|
|||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
set (THREADS_PREFER_PTHREAD_FLAG ON)
|
set (THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
find_package (Threads)
|
find_package (Threads)
|
||||||
target_link_libraries (ripple_syslibs INTERFACE Threads::Threads)
|
target_link_libraries (xrpl_syslibs INTERFACE Threads::Threads)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_library (ripple_libs INTERFACE)
|
add_library (xrpl_libs INTERFACE)
|
||||||
add_library (Ripple::libs ALIAS ripple_libs)
|
add_library (Xrpl::libs ALIAS xrpl_libs)
|
||||||
target_link_libraries (ripple_libs INTERFACE Ripple::syslibs)
|
target_link_libraries (xrpl_libs INTERFACE Xrpl::syslibs)
|
||||||
@@ -61,8 +61,8 @@ if (MSVC AND CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
message (FATAL_ERROR "Rippled requires a 64 bit target architecture.\n"
|
message (FATAL_ERROR "Xrpld requires a 64 bit target architecture.\n"
|
||||||
"The most likely cause of this warning is trying to build rippled with a 32-bit OS.")
|
"The most likely cause of this warning is trying to build xrpld with a 32-bit OS.")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (APPLE AND NOT HOMEBREW)
|
if (APPLE AND NOT HOMEBREW)
|
||||||
@@ -49,7 +49,7 @@ else()
|
|||||||
set(wextra OFF CACHE BOOL "gcc/clang only" FORCE)
|
set(wextra OFF CACHE BOOL "gcc/clang only" FORCE)
|
||||||
endif()
|
endif()
|
||||||
if(is_linux)
|
if(is_linux)
|
||||||
option(BUILD_SHARED_LIBS "build shared ripple libraries" OFF)
|
option(BUILD_SHARED_LIBS "build shared xrpl libraries" OFF)
|
||||||
option(static "link protobuf, openssl, libc++, and boost statically" ON)
|
option(static "link protobuf, openssl, libc++, and boost statically" ON)
|
||||||
option(perf "Enables flags that assist with perf recording" OFF)
|
option(perf "Enables flags that assist with perf recording" OFF)
|
||||||
option(use_gold "enables detection of gold (binutils) linker" ON)
|
option(use_gold "enables detection of gold (binutils) linker" ON)
|
||||||
@@ -58,7 +58,7 @@ else()
|
|||||||
# we are not ready to allow shared-libs on windows because it would require
|
# we are not ready to allow shared-libs on windows because it would require
|
||||||
# export declarations. On macos it's more feasible, but static openssl
|
# export declarations. On macos it's more feasible, but static openssl
|
||||||
# produces odd linker errors, thus we disable shared lib builds for now.
|
# produces odd linker errors, thus we disable shared lib builds for now.
|
||||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "build shared ripple libraries - OFF for win/macos" FORCE)
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "build shared xrpl libraries - OFF for win/macos" FORCE)
|
||||||
set(static ON CACHE BOOL "static link, linux only. ON for WIN/macos" FORCE)
|
set(static ON CACHE BOOL "static link, linux only. ON for WIN/macos" FORCE)
|
||||||
set(perf OFF CACHE BOOL "perf flags, linux only" FORCE)
|
set(perf OFF CACHE BOOL "perf flags, linux only" FORCE)
|
||||||
set(use_gold OFF CACHE BOOL "gold linker, linux only" FORCE)
|
set(use_gold OFF CACHE BOOL "gold linker, linux only" FORCE)
|
||||||
20
cmake/XrplValidatorKeys.cmake
Normal file
20
cmake/XrplValidatorKeys.cmake
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
option (validator_keys "Enables building of validator-keys tool as a separate target (imported via FetchContent)" OFF)
|
||||||
|
|
||||||
|
if (validator_keys)
|
||||||
|
git_branch (current_branch)
|
||||||
|
# default to tracking VK master branch unless we are on release
|
||||||
|
if (NOT (current_branch STREQUAL "release"))
|
||||||
|
set (current_branch "master")
|
||||||
|
endif ()
|
||||||
|
message (STATUS "Tracking ValidatorKeys branch: ${current_branch}")
|
||||||
|
|
||||||
|
FetchContent_Declare (
|
||||||
|
validator_keys
|
||||||
|
GIT_REPOSITORY https://github.com/ripple/validator-keys-tool.git
|
||||||
|
GIT_TAG "${current_branch}"
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(validator_keys)
|
||||||
|
set_target_properties(validator-keys PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||||
|
install(TARGETS validator-keys RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
||||||
|
endif ()
|
||||||
@@ -5,11 +5,11 @@
|
|||||||
file(STRINGS src/libxrpl/protocol/BuildInfo.cpp BUILD_INFO)
|
file(STRINGS src/libxrpl/protocol/BuildInfo.cpp BUILD_INFO)
|
||||||
foreach(line_ ${BUILD_INFO})
|
foreach(line_ ${BUILD_INFO})
|
||||||
if(line_ MATCHES "versionString[ ]*=[ ]*\"(.+)\"")
|
if(line_ MATCHES "versionString[ ]*=[ ]*\"(.+)\"")
|
||||||
set(rippled_version ${CMAKE_MATCH_1})
|
set(xrpld_version ${CMAKE_MATCH_1})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
if(rippled_version)
|
if(xrpld_version)
|
||||||
message(STATUS "rippled version: ${rippled_version}")
|
message(STATUS "xrpld version: ${xrpld_version}")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "unable to determine rippled version")
|
message(FATAL_ERROR "unable to determine xrpld version")
|
||||||
endif()
|
endif()
|
||||||
@@ -12,10 +12,10 @@ find_package(Boost 1.82 REQUIRED
|
|||||||
thread
|
thread
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(ripple_boost INTERFACE)
|
add_library(xrpl_boost INTERFACE)
|
||||||
add_library(Ripple::boost ALIAS ripple_boost)
|
add_library(Xrpl::boost ALIAS xrpl_boost)
|
||||||
|
|
||||||
target_link_libraries(ripple_boost
|
target_link_libraries(xrpl_boost
|
||||||
INTERFACE
|
INTERFACE
|
||||||
Boost::headers
|
Boost::headers
|
||||||
Boost::chrono
|
Boost::chrono
|
||||||
@@ -30,7 +30,7 @@ target_link_libraries(ripple_boost
|
|||||||
Boost::system
|
Boost::system
|
||||||
Boost::thread)
|
Boost::thread)
|
||||||
if(Boost_COMPILER)
|
if(Boost_COMPILER)
|
||||||
target_link_libraries(ripple_boost INTERFACE Boost::disable_autolinking)
|
target_link_libraries(xrpl_boost INTERFACE Boost::disable_autolinking)
|
||||||
endif()
|
endif()
|
||||||
if(san AND is_clang)
|
if(san AND is_clang)
|
||||||
# TODO: gcc does not support -fsanitize-blacklist...can we do something else
|
# TODO: gcc does not support -fsanitize-blacklist...can we do something else
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"rocksdb/10.0.1#85537f46e538974d67da0c3977de48ac%1756234304.347",
|
"rocksdb/10.0.1#85537f46e538974d67da0c3977de48ac%1756234304.347",
|
||||||
"re2/20230301#dfd6e2bf050eb90ddd8729cfb4c844a4%1756234257.976",
|
"re2/20230301#dfd6e2bf050eb90ddd8729cfb4c844a4%1756234257.976",
|
||||||
"protobuf/3.21.12#d927114e28de9f4691a6bbcdd9a529d1%1756234251.614",
|
"protobuf/3.21.12#d927114e28de9f4691a6bbcdd9a529d1%1756234251.614",
|
||||||
"openssl/3.5.2#0c5a5e15ae569f45dff57adcf1770cf7%1756234259.61",
|
"openssl/3.5.4#a1d5835cc6ed5c5b8f3cd5b9b5d24205%1759746684.671",
|
||||||
"nudb/2.0.9#c62cfd501e57055a7e0d8ee3d5e5427d%1756234237.107",
|
"nudb/2.0.9#c62cfd501e57055a7e0d8ee3d5e5427d%1756234237.107",
|
||||||
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1756234228.999",
|
"lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1756234228.999",
|
||||||
"libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1756223727.64",
|
"libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1756223727.64",
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
# Global configuration for Conan. This is used to set the number of parallel
|
# Global configuration for Conan. This is used to set the number of parallel
|
||||||
# downloads, uploads, and build jobs. The verbosity is set to verbose to
|
# downloads and uploads.
|
||||||
# provide more information during the build process.
|
|
||||||
core:non_interactive=True
|
core:non_interactive=True
|
||||||
core.download:parallel={{ os.cpu_count() }}
|
core.download:parallel={{ os.cpu_count() }}
|
||||||
core.upload:parallel={{ os.cpu_count() }}
|
core.upload:parallel={{ os.cpu_count() }}
|
||||||
tools.build:jobs={{ (os.cpu_count() * 4/5) | int }}
|
|
||||||
tools.build:verbosity=verbose
|
|
||||||
tools.compilation:verbosity=verbose
|
|
||||||
|
|||||||
@@ -21,14 +21,11 @@ compiler.libcxx={{detect_api.detect_libcxx(compiler, version, compiler_exe)}}
|
|||||||
|
|
||||||
[conf]
|
[conf]
|
||||||
{% if compiler == "clang" and compiler_version >= 19 %}
|
{% if compiler == "clang" and compiler_version >= 19 %}
|
||||||
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
|
grpc/1.50.1:tools.build:cxxflags+=['-Wno-missing-template-arg-list-after-template-kw']
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if compiler == "apple-clang" and compiler_version >= 17 %}
|
{% if compiler == "apple-clang" and compiler_version >= 17 %}
|
||||||
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
|
grpc/1.50.1:tools.build:cxxflags+=['-Wno-missing-template-arg-list-after-template-kw']
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if compiler == "gcc" and compiler_version < 13 %}
|
{% if compiler == "gcc" and compiler_version < 13 %}
|
||||||
tools.build:cxxflags=['-Wno-restrict']
|
tools.build:cxxflags+=['-Wno-restrict']
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
[tool_requires]
|
|
||||||
!cmake/*: cmake/[>=3 <4]
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class Xrpl(ConanFile):
|
|||||||
'grpc/1.50.1',
|
'grpc/1.50.1',
|
||||||
'libarchive/3.8.1',
|
'libarchive/3.8.1',
|
||||||
'nudb/2.0.9',
|
'nudb/2.0.9',
|
||||||
'openssl/3.5.2',
|
'openssl/3.5.4',
|
||||||
'soci/4.0.3',
|
'soci/4.0.3',
|
||||||
'zlib/1.3.1',
|
'zlib/1.3.1',
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,28 +1,9 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_ARCHIVE_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_ARCHIVE_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2018 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_ARCHIVE_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_ARCHIVE_H_INCLUDED
|
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Extract a tar archive compressed with lz4
|
/** Extract a tar archive compressed with lz4
|
||||||
|
|
||||||
@@ -36,6 +17,6 @@ extractTarLz4(
|
|||||||
boost::filesystem::path const& src,
|
boost::filesystem::path const& src,
|
||||||
boost::filesystem::path const& dst);
|
boost::filesystem::path const& dst);
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_BASICCONFIG_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_BASICCONFIG_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_BASICCONFIG_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_BASICCONFIG_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
|
|
||||||
@@ -31,7 +12,7 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
using IniFileSections =
|
using IniFileSections =
|
||||||
std::unordered_map<std::string, std::vector<std::string>>;
|
std::unordered_map<std::string, std::vector<std::string>>;
|
||||||
@@ -399,6 +380,6 @@ get_if_exists<bool>(Section const& section, std::string const& name, bool& v)
|
|||||||
return stat;
|
return stat;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,34 +1,15 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_BLOB_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_BLOB_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_BLOB_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_BLOB_H_INCLUDED
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Storage for linear binary data.
|
/** Storage for linear binary data.
|
||||||
Blocks of binary data appear often in various idioms and structures.
|
Blocks of binary data appear often in various idioms and structures.
|
||||||
*/
|
*/
|
||||||
using Blob = std::vector<unsigned char>;
|
using Blob = std::vector<unsigned char>;
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_BUFFER_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_BUFFER_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_BUFFER_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_BUFFER_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/Slice.h>
|
#include <xrpl/basics/Slice.h>
|
||||||
#include <xrpl/beast/utility/instrumentation.h>
|
#include <xrpl/beast/utility/instrumentation.h>
|
||||||
@@ -27,7 +8,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Like std::vector<char> but better.
|
/** Like std::vector<char> but better.
|
||||||
Meets the requirements of BufferFactory.
|
Meets the requirements of BufferFactory.
|
||||||
@@ -115,7 +96,7 @@ public:
|
|||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
s.size() == 0 || size_ == 0 || s.data() < p_.get() ||
|
s.size() == 0 || size_ == 0 || s.data() < p_.get() ||
|
||||||
s.data() >= p_.get() + size_,
|
s.data() >= p_.get() + size_,
|
||||||
"ripple::Buffer::operator=(Slice) : input not a subset");
|
"xrpl::Buffer::operator=(Slice) : input not a subset");
|
||||||
|
|
||||||
if (auto p = alloc(s.size()))
|
if (auto p = alloc(s.size()))
|
||||||
std::memcpy(p, s.data(), s.size());
|
std::memcpy(p, s.data(), s.size());
|
||||||
@@ -234,6 +215,6 @@ operator!=(Buffer const& lhs, Buffer const& rhs) noexcept
|
|||||||
return !(lhs == rhs);
|
return !(lhs == rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,26 +1,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_BYTEUTILITIES_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_BYTEUTILITIES_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2018 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
namespace xrpl {
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_BYTEUTILITIES_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_BYTEUTILITIES_H_INCLUDED
|
|
||||||
|
|
||||||
namespace ripple {
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
constexpr auto
|
constexpr auto
|
||||||
@@ -38,6 +19,6 @@ megabytes(T value) noexcept
|
|||||||
|
|
||||||
static_assert(kilobytes(2) == 2048, "kilobytes(2) == 2048");
|
static_assert(kilobytes(2) == 2048, "kilobytes(2) == 2048");
|
||||||
static_assert(megabytes(3) == 3145728, "megabytes(3) == 3145728");
|
static_assert(megabytes(3) == 3145728, "megabytes(3) == 3145728");
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_COMPRESSIONALGORITHMS_H_INCLUDED
|
||||||
/*
|
#define XRPL_COMPRESSIONALGORITHMS_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2020 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLED_COMPRESSIONALGORITHMS_H_INCLUDED
|
|
||||||
#define RIPPLED_COMPRESSIONALGORITHMS_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
|
|
||||||
@@ -29,7 +10,7 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
namespace compression_algorithms {
|
namespace compression_algorithms {
|
||||||
|
|
||||||
@@ -163,6 +144,6 @@ lz4Decompress(
|
|||||||
|
|
||||||
} // namespace compression_algorithms
|
} // namespace compression_algorithms
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif // RIPPLED_COMPRESSIONALGORITHMS_H_INCLUDED
|
#endif // XRPL_COMPRESSIONALGORITHMS_H_INCLUDED
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_COUNTEDOBJECT_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_COUNTEDOBJECT_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_COUNTEDOBJECT_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_COUNTEDOBJECT_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/beast/type_name.h>
|
#include <xrpl/beast/type_name.h>
|
||||||
|
|
||||||
@@ -27,7 +8,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Manages all counted object types. */
|
/** Manages all counted object types. */
|
||||||
class CountedObjects
|
class CountedObjects
|
||||||
@@ -152,6 +133,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_DECAYINGSAMPLE_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_DECAYINGSAMPLE_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_DECAYINGSAMPLE_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_DECAYINGSAMPLE_H_INCLUDED
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Sampling function using exponential decay to provide a continuous value.
|
/** Sampling function using exponential decay to provide a continuous value.
|
||||||
@tparam The number of seconds in the decay window.
|
@tparam The number of seconds in the decay window.
|
||||||
@@ -150,6 +131,6 @@ private:
|
|||||||
time_point when_;
|
time_point when_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_EXPECTED_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_EXPECTED_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2021 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_EXPECTED_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_EXPECTED_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
|
|
||||||
@@ -26,7 +7,7 @@
|
|||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Expected is an approximation of std::expected (hoped for in C++23)
|
/** Expected is an approximation of std::expected (hoped for in C++23)
|
||||||
|
|
||||||
@@ -251,6 +232,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif // RIPPLE_BASICS_EXPECTED_H_INCLUDED
|
#endif // XRPL_BASICS_EXPECTED_H_INCLUDED
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_FILEUTILITIES_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_FILEUTILITIES_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2018 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_FILEUTILITIES_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_FILEUTILITIES_H_INCLUDED
|
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/system/error_code.hpp>
|
#include <boost/system/error_code.hpp>
|
||||||
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
getFileContents(
|
getFileContents(
|
||||||
@@ -39,6 +20,6 @@ writeFileContents(
|
|||||||
boost::filesystem::path const& destPath,
|
boost::filesystem::path const& destPath,
|
||||||
std::string const& contents);
|
std::string const& contents);
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_INTRUSIVEPOINTER_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_INTRUSIVEPOINTER_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2023 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_INTRUSIVEPOINTER_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_INTRUSIVEPOINTER_H_INCLUDED
|
|
||||||
|
|
||||||
#include <concepts>
|
#include <concepts>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -511,5 +492,5 @@ dynamic_pointer_cast(TT const& v)
|
|||||||
return SharedPtr<T>(DynamicCastTagSharedIntrusive{}, v);
|
return SharedPtr<T>(DynamicCastTagSharedIntrusive{}, v);
|
||||||
}
|
}
|
||||||
} // namespace intr_ptr
|
} // namespace intr_ptr
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_INTRUSIVEPOINTER_IPP_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_INTRUSIVEPOINTER_IPP_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2023 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_INTRUSIVEPOINTER_IPP_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_INTRUSIVEPOINTER_IPP_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.h>
|
#include <xrpl/basics/IntrusivePointer.h>
|
||||||
#include <xrpl/basics/IntrusiveRefCounts.h>
|
#include <xrpl/basics/IntrusiveRefCounts.h>
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
template <CAdoptTag TAdoptTag>
|
template <CAdoptTag TAdoptTag>
|
||||||
@@ -627,7 +608,7 @@ SharedWeakUnion<T>::convertToStrong()
|
|||||||
[[maybe_unused]] auto action = p->releaseWeakRef();
|
[[maybe_unused]] auto action = p->releaseWeakRef();
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(action == ReleaseWeakRefAction::noop),
|
(action == ReleaseWeakRefAction::noop),
|
||||||
"ripple::SharedWeakUnion::convertToStrong : "
|
"xrpl::SharedWeakUnion::convertToStrong : "
|
||||||
"action is noop");
|
"action is noop");
|
||||||
unsafeSetRawPtr(p, RefStrength::strong);
|
unsafeSetRawPtr(p, RefStrength::strong);
|
||||||
return true;
|
return true;
|
||||||
@@ -654,12 +635,14 @@ SharedWeakUnion<T>::convertToWeak()
|
|||||||
break;
|
break;
|
||||||
case destroy:
|
case destroy:
|
||||||
// We just added a weak ref. How could we destroy?
|
// We just added a weak ref. How could we destroy?
|
||||||
|
// LCOV_EXCL_START
|
||||||
UNREACHABLE(
|
UNREACHABLE(
|
||||||
"ripple::SharedWeakUnion::convertToWeak : destroying freshly "
|
"xrpl::SharedWeakUnion::convertToWeak : destroying freshly "
|
||||||
"added ref");
|
"added ref");
|
||||||
delete p;
|
delete p;
|
||||||
unsafeSetRawPtr(nullptr);
|
unsafeSetRawPtr(nullptr);
|
||||||
return true; // Should never happen
|
return true; // Should never happen
|
||||||
|
// LCOV_EXCL_STOP
|
||||||
case partialDestroy:
|
case partialDestroy:
|
||||||
// This is a weird case. We just converted the last strong
|
// This is a weird case. We just converted the last strong
|
||||||
// pointer to a weak pointer.
|
// pointer to a weak pointer.
|
||||||
@@ -736,5 +719,5 @@ SharedWeakUnion<T>::unsafeReleaseNoStore()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_INTRUSIVEREFCOUNTS_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_INTRUSIVEREFCOUNTS_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2023 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_INTRUSIVEREFCOUNTS_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_INTRUSIVEREFCOUNTS_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/beast/utility/instrumentation.h>
|
#include <xrpl/beast/utility/instrumentation.h>
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Action to perform when releasing a strong pointer.
|
/** Action to perform when releasing a strong pointer.
|
||||||
|
|
||||||
@@ -53,7 +34,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 ripple::IntrusivePointer by
|
A class can satisfy the requirements of a xrpl::IntrusivePointer by
|
||||||
inheriting from this class.
|
inheriting from this class.
|
||||||
*/
|
*/
|
||||||
struct IntrusiveRefCounts
|
struct IntrusiveRefCounts
|
||||||
@@ -276,7 +257,7 @@ IntrusiveRefCounts::releaseStrongRef() const
|
|||||||
RefCountPair const prevVal{prevIntVal};
|
RefCountPair const prevVal{prevIntVal};
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(prevVal.strong >= strongDelta),
|
(prevVal.strong >= strongDelta),
|
||||||
"ripple::IntrusiveRefCounts::releaseStrongRef : previous ref "
|
"xrpl::IntrusiveRefCounts::releaseStrongRef : previous ref "
|
||||||
"higher than new");
|
"higher than new");
|
||||||
auto nextIntVal = prevIntVal - strongDelta;
|
auto nextIntVal = prevIntVal - strongDelta;
|
||||||
ReleaseStrongRefAction action = noop;
|
ReleaseStrongRefAction action = noop;
|
||||||
@@ -301,7 +282,7 @@ IntrusiveRefCounts::releaseStrongRef() const
|
|||||||
// twice.
|
// twice.
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(action == noop) || !(prevIntVal & partialDestroyStartedMask),
|
(action == noop) || !(prevIntVal & partialDestroyStartedMask),
|
||||||
"ripple::IntrusiveRefCounts::releaseStrongRef : not in partial "
|
"xrpl::IntrusiveRefCounts::releaseStrongRef : not in partial "
|
||||||
"destroy");
|
"destroy");
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
@@ -333,7 +314,7 @@ IntrusiveRefCounts::addWeakReleaseStrongRef() const
|
|||||||
// can't happen twice.
|
// can't happen twice.
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(!prevVal.partialDestroyStartedBit),
|
(!prevVal.partialDestroyStartedBit),
|
||||||
"ripple::IntrusiveRefCounts::addWeakReleaseStrongRef : not in "
|
"xrpl::IntrusiveRefCounts::addWeakReleaseStrongRef : not in "
|
||||||
"partial destroy");
|
"partial destroy");
|
||||||
|
|
||||||
auto nextIntVal = prevIntVal + delta;
|
auto nextIntVal = prevIntVal + delta;
|
||||||
@@ -355,7 +336,7 @@ IntrusiveRefCounts::addWeakReleaseStrongRef() const
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(!(prevIntVal & partialDestroyStartedMask)),
|
(!(prevIntVal & partialDestroyStartedMask)),
|
||||||
"ripple::IntrusiveRefCounts::addWeakReleaseStrongRef : not "
|
"xrpl::IntrusiveRefCounts::addWeakReleaseStrongRef : not "
|
||||||
"started partial destroy");
|
"started partial destroy");
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
@@ -427,11 +408,11 @@ inline IntrusiveRefCounts::~IntrusiveRefCounts() noexcept
|
|||||||
auto v = refCounts.load(std::memory_order_acquire);
|
auto v = refCounts.load(std::memory_order_acquire);
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(!(v & valueMask)),
|
(!(v & valueMask)),
|
||||||
"ripple::IntrusiveRefCounts::~IntrusiveRefCounts : count must be zero");
|
"xrpl::IntrusiveRefCounts::~IntrusiveRefCounts : count must be zero");
|
||||||
auto t = v & tagMask;
|
auto t = v & tagMask;
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(!t || t == tagMask),
|
(!t || t == tagMask),
|
||||||
"ripple::IntrusiveRefCounts::~IntrusiveRefCounts : valid tag");
|
"xrpl::IntrusiveRefCounts::~IntrusiveRefCounts : valid tag");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -446,7 +427,7 @@ inline IntrusiveRefCounts::RefCountPair::RefCountPair(
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(strong < checkStrongMaxValue && weak < checkWeakMaxValue),
|
(strong < checkStrongMaxValue && weak < checkWeakMaxValue),
|
||||||
"ripple::IntrusiveRefCounts::RefCountPair(FieldType) : inputs inside "
|
"xrpl::IntrusiveRefCounts::RefCountPair(FieldType) : inputs inside "
|
||||||
"range");
|
"range");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -457,7 +438,7 @@ inline IntrusiveRefCounts::RefCountPair::RefCountPair(
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(strong < checkStrongMaxValue && weak < checkWeakMaxValue),
|
(strong < checkStrongMaxValue && weak < checkWeakMaxValue),
|
||||||
"ripple::IntrusiveRefCounts::RefCountPair(CountType, CountType) : "
|
"xrpl::IntrusiveRefCounts::RefCountPair(CountType, CountType) : "
|
||||||
"inputs inside range");
|
"inputs inside range");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,7 +447,7 @@ IntrusiveRefCounts::RefCountPair::combinedValue() const noexcept
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(strong < checkStrongMaxValue && weak < checkWeakMaxValue),
|
(strong < checkStrongMaxValue && weak < checkWeakMaxValue),
|
||||||
"ripple::IntrusiveRefCounts::RefCountPair::combinedValue : inputs "
|
"xrpl::IntrusiveRefCounts::RefCountPair::combinedValue : inputs "
|
||||||
"inside range");
|
"inside range");
|
||||||
return (static_cast<IntrusiveRefCounts::FieldType>(weak)
|
return (static_cast<IntrusiveRefCounts::FieldType>(weak)
|
||||||
<< IntrusiveRefCounts::StrongCountNumBits) |
|
<< IntrusiveRefCounts::StrongCountNumBits) |
|
||||||
@@ -484,7 +465,7 @@ partialDestructorFinished(T** o)
|
|||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(!p.partialDestroyFinishedBit && p.partialDestroyStartedBit &&
|
(!p.partialDestroyFinishedBit && p.partialDestroyStartedBit &&
|
||||||
!p.strong),
|
!p.strong),
|
||||||
"ripple::partialDestructorFinished : not a weak ref");
|
"xrpl::partialDestructorFinished : not a weak ref");
|
||||||
if (!p.weak)
|
if (!p.weak)
|
||||||
{
|
{
|
||||||
// There was a weak count before the partial destructor ran (or we would
|
// There was a weak count before the partial destructor ran (or we would
|
||||||
@@ -498,5 +479,5 @@ partialDestructorFinished(T** o)
|
|||||||
}
|
}
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,32 +1,13 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_KEYCACHE_H
|
||||||
/*
|
#define XRPL_BASICS_KEYCACHE_H
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2021 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_KEYCACHE_H
|
|
||||||
#define RIPPLE_BASICS_KEYCACHE_H
|
|
||||||
|
|
||||||
#include <xrpl/basics/TaggedCache.h>
|
#include <xrpl/basics/TaggedCache.h>
|
||||||
#include <xrpl/basics/base_uint.h>
|
#include <xrpl/basics/base_uint.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
using KeyCache = TaggedCache<uint256, int, true>;
|
using KeyCache = TaggedCache<uint256, int, true>;
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif // RIPPLE_BASICS_KEYCACHE_H
|
#endif // XRPL_BASICS_KEYCACHE_H
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_LOCALVALUE_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_LOCALVALUE_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_LOCALVALUE_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_LOCALVALUE_H_INCLUDED
|
|
||||||
|
|
||||||
#include <boost/thread/tss.hpp>
|
#include <boost/thread/tss.hpp>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
@@ -128,6 +109,6 @@ LocalValue<T>::operator*()
|
|||||||
.emplace(this, std::make_unique<detail::LocalValues::Value<T>>(t_))
|
.emplace(this, std::make_unique<detail::LocalValues::Value<T>>(t_))
|
||||||
.first->second->get());
|
.first->second->get());
|
||||||
}
|
}
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_LOG_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_LOG_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_LOG_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_LOG_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/UnorderedContainers.h>
|
#include <xrpl/basics/UnorderedContainers.h>
|
||||||
#include <xrpl/beast/utility/Journal.h>
|
#include <xrpl/beast/utility/Journal.h>
|
||||||
@@ -32,7 +13,7 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
// DEPRECATED use beast::severities::Severity instead
|
// DEPRECATED use beast::severities::Severity instead
|
||||||
enum LogSeverity {
|
enum LogSeverity {
|
||||||
@@ -290,6 +271,6 @@ setDebugLogSink(std::unique_ptr<beast::Journal::Sink> sink);
|
|||||||
beast::Journal
|
beast::Journal
|
||||||
debugLog();
|
debugLog();
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,30 +1,11 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_MATHUTILITIES_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_MATHUTILITIES_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2020 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_MATHUTILITIES_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_MATHUTILITIES_H_INCLUDED
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Calculate one number divided by another number in percentage.
|
/** Calculate one number divided by another number in percentage.
|
||||||
* The result is rounded up to the next integer, and capped in the range [0,100]
|
* The result is rounded up to the next integer, and capped in the range [0,100]
|
||||||
@@ -63,6 +44,6 @@ static_assert(calculatePercent(50'000'000, 100'000'000) == 50);
|
|||||||
static_assert(calculatePercent(50'000'001, 100'000'000) == 51);
|
static_assert(calculatePercent(50'000'001, 100'000'000) == 51);
|
||||||
static_assert(calculatePercent(99'999'999, 100'000'000) == 100);
|
static_assert(calculatePercent(99'999'999, 100'000'000) == 100);
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_NUMBER_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_NUMBER_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2022 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_NUMBER_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_NUMBER_H_INCLUDED
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
class Number;
|
class Number;
|
||||||
|
|
||||||
@@ -423,6 +404,6 @@ public:
|
|||||||
operator=(NumberRoundModeGuard const&) = delete;
|
operator=(NumberRoundModeGuard const&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif // RIPPLE_BASICS_NUMBER_H_INCLUDED
|
#endif // XRPL_BASICS_NUMBER_H_INCLUDED
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ ripple/basic should contain no dependencies on other modules.
|
|||||||
- `std::set`
|
- `std::set`
|
||||||
- For sorted containers.
|
- For sorted containers.
|
||||||
|
|
||||||
- `ripple::hash_set`
|
- `xrpl::hash_set`
|
||||||
- Where inserts and contains need to be O(1).
|
- Where inserts and contains need to be O(1).
|
||||||
- For "small" sets, `std::set` might be faster and smaller.
|
- For "small" sets, `std::set` might be faster and smaller.
|
||||||
|
|
||||||
- `ripple::hardened_hash_set`
|
- `xrpl::hardened_hash_set`
|
||||||
- For data sets where the key could be manipulated by an attacker
|
- For data sets where the key could be manipulated by an attacker
|
||||||
in an attempt to mount an algorithmic complexity attack: see
|
in an attempt to mount an algorithmic complexity attack: see
|
||||||
http://en.wikipedia.org/wiki/Algorithmic_complexity_attack
|
http://en.wikipedia.org/wiki/Algorithmic_complexity_attack
|
||||||
@@ -33,5 +33,5 @@ ripple/basic should contain no dependencies on other modules.
|
|||||||
The following container is deprecated
|
The following container is deprecated
|
||||||
|
|
||||||
- `std::unordered_set`
|
- `std::unordered_set`
|
||||||
- Use `ripple::hash_set` instead, which uses a better hashing algorithm.
|
- Use `xrpl::hash_set` instead, which uses a better hashing algorithm.
|
||||||
- Or use `ripple::hardened_hash_set` to prevent algorithmic complexity attacks.
|
- Or use `xrpl::hardened_hash_set` to prevent algorithmic complexity attacks.
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_RANGESET_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_RANGESET_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_RANGESET_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_RANGESET_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/beast/core/LexicalCast.h>
|
#include <xrpl/beast/core/LexicalCast.h>
|
||||||
|
|
||||||
@@ -30,7 +11,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** A closed interval over the domain T.
|
/** A closed interval over the domain T.
|
||||||
|
|
||||||
@@ -104,7 +85,7 @@ to_string(RangeSet<T> const& rs)
|
|||||||
|
|
||||||
std::string s;
|
std::string s;
|
||||||
for (auto const& interval : rs)
|
for (auto const& interval : rs)
|
||||||
s += ripple::to_string(interval) + ",";
|
s += xrpl::to_string(interval) + ",";
|
||||||
s.pop_back();
|
s.pop_back();
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
@@ -191,6 +172,6 @@ prevMissing(RangeSet<T> const& rs, T t, T minVal = 0)
|
|||||||
return boost::icl::last(tgt);
|
return boost::icl::last(tgt);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_RESOLVER_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_RESOLVER_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_RESOLVER_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_RESOLVER_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/beast/net/IPEndpoint.h>
|
#include <xrpl/beast/net/IPEndpoint.h>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
class Resolver
|
class Resolver
|
||||||
{
|
{
|
||||||
@@ -66,6 +47,6 @@ public:
|
|||||||
/** @} */
|
/** @} */
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_RESOLVERASIO_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_RESOLVERASIO_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_RESOLVERASIO_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_RESOLVERASIO_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/Resolver.h>
|
#include <xrpl/basics/Resolver.h>
|
||||||
#include <xrpl/beast/utility/Journal.h>
|
#include <xrpl/beast/utility/Journal.h>
|
||||||
|
|
||||||
#include <boost/asio/io_context.hpp>
|
#include <boost/asio/io_context.hpp>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
class ResolverAsio : public Resolver
|
class ResolverAsio : public Resolver
|
||||||
{
|
{
|
||||||
@@ -36,6 +17,6 @@ public:
|
|||||||
New(boost::asio::io_context&, beast::Journal);
|
New(boost::asio::io_context&, beast::Journal);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_SHAMAP_HASH_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_SHAMAP_HASH_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2021 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_SHAMAP_HASH_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_SHAMAP_HASH_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/base_uint.h>
|
#include <xrpl/basics/base_uint.h>
|
||||||
#include <xrpl/basics/partitioned_unordered_map.h>
|
#include <xrpl/basics/partitioned_unordered_map.h>
|
||||||
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
// A SHAMapHash is the hash of a node in a SHAMap, and also the
|
// A SHAMapHash is the hash of a node in a SHAMap, and also the
|
||||||
// type of the hash of the entire SHAMap.
|
// type of the hash of the entire SHAMap.
|
||||||
@@ -116,6 +97,6 @@ extract(SHAMapHash const& key)
|
|||||||
return *reinterpret_cast<std::size_t const*>(key.as_uint256().data());
|
return *reinterpret_cast<std::size_t const*>(key.as_uint256().data());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif // RIPPLE_BASICS_SHAMAP_HASH_H_INCLUDED
|
#endif // XRPL_BASICS_SHAMAP_HASH_H_INCLUDED
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_SHAREDWEAKCACHEPOINTER_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_SHAREDWEAKCACHEPOINTER_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2023 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_SHAREDWEAKCACHEPOINTER_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_SHAREDWEAKCACHEPOINTER_H_INCLUDED
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** A combination of a std::shared_ptr and a std::weak_pointer.
|
/** A combination of a std::shared_ptr and a std::weak_pointer.
|
||||||
|
|
||||||
@@ -131,5 +112,5 @@ public:
|
|||||||
private:
|
private:
|
||||||
std::variant<std::shared_ptr<T>, std::weak_ptr<T>> combo_;
|
std::variant<std::shared_ptr<T>, std::weak_ptr<T>> combo_;
|
||||||
};
|
};
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,28 +1,9 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_SHAREDWEAKCACHEPOINTER_IPP_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_SHAREDWEAKCACHEPOINTER_IPP_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2023 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_SHAREDWEAKCACHEPOINTER_IPP_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_SHAREDWEAKCACHEPOINTER_IPP_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/SharedWeakCachePointer.h>
|
#include <xrpl/basics/SharedWeakCachePointer.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
template <class T>
|
template <class T>
|
||||||
SharedWeakCachePointer<T>::SharedWeakCachePointer(
|
SharedWeakCachePointer<T>::SharedWeakCachePointer(
|
||||||
SharedWeakCachePointer const& rhs) = default;
|
SharedWeakCachePointer const& rhs) = default;
|
||||||
@@ -188,5 +169,5 @@ SharedWeakCachePointer<T>::convertToWeak()
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,7 @@
|
|||||||
//------------------------------------------------------------------------------
|
// Copyright (c) 2022, Nikolaos D. Bougalis <nikb@bougalis.net>
|
||||||
/*
|
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright 2022, Nikolaos D. Bougalis <nikb@bougalis.net>
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
#ifndef XRPL_BASICS_SLABALLOCATOR_H_INCLUDED
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
#define XRPL_BASICS_SLABALLOCATOR_H_INCLUDED
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_SLABALLOCATOR_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_SLABALLOCATOR_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/ByteUtilities.h>
|
#include <xrpl/basics/ByteUtilities.h>
|
||||||
#include <xrpl/beast/type_name.h>
|
#include <xrpl/beast/type_name.h>
|
||||||
@@ -39,7 +22,7 @@
|
|||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
class SlabAllocator
|
class SlabAllocator
|
||||||
@@ -145,7 +128,7 @@ class SlabAllocator
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
own(ptr),
|
own(ptr),
|
||||||
"ripple::SlabAllocator::SlabBlock::deallocate : own input");
|
"xrpl::SlabAllocator::SlabBlock::deallocate : own input");
|
||||||
|
|
||||||
std::lock_guard l(m_);
|
std::lock_guard l(m_);
|
||||||
|
|
||||||
@@ -190,7 +173,7 @@ public:
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
(itemAlignment_ & (itemAlignment_ - 1)) == 0,
|
(itemAlignment_ & (itemAlignment_ - 1)) == 0,
|
||||||
"ripple::SlabAllocator::SlabAllocator : valid alignment");
|
"xrpl::SlabAllocator::SlabAllocator : valid alignment");
|
||||||
}
|
}
|
||||||
|
|
||||||
SlabAllocator(SlabAllocator const& other) = delete;
|
SlabAllocator(SlabAllocator const& other) = delete;
|
||||||
@@ -302,7 +285,7 @@ public:
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
ptr,
|
ptr,
|
||||||
"ripple::SlabAllocator::SlabAllocator::deallocate : non-null "
|
"xrpl::SlabAllocator::SlabAllocator::deallocate : non-null "
|
||||||
"input");
|
"input");
|
||||||
|
|
||||||
for (auto slab = slabs_.load(); slab != nullptr; slab = slab->next_)
|
for (auto slab = slabs_.load(); slab != nullptr; slab = slab->next_)
|
||||||
@@ -436,6 +419,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif // RIPPLE_BASICS_SLABALLOCATOR_H_INCLUDED
|
#endif // XRPL_BASICS_SLABALLOCATOR_H_INCLUDED
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_SLICE_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_SLICE_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_SLICE_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_SLICE_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/contract.h>
|
#include <xrpl/basics/contract.h>
|
||||||
#include <xrpl/basics/strHex.h>
|
#include <xrpl/basics/strHex.h>
|
||||||
@@ -34,7 +15,7 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** An immutable linear range of bytes.
|
/** An immutable linear range of bytes.
|
||||||
|
|
||||||
@@ -106,7 +87,7 @@ public:
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
i < size_,
|
i < size_,
|
||||||
"ripple::Slice::operator[](std::size_t) const : valid input");
|
"xrpl::Slice::operator[](std::size_t) const : valid input");
|
||||||
return data_[i];
|
return data_[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,6 +243,6 @@ makeSlice(std::basic_string<char, Traits, Alloc> const& s)
|
|||||||
return Slice(s.data(), s.size());
|
return Slice(s.data(), s.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_STRINGUTILITIES_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_STRINGUTILITIES_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_STRINGUTILITIES_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/Blob.h>
|
#include <xrpl/basics/Blob.h>
|
||||||
#include <xrpl/basics/strHex.h>
|
#include <xrpl/basics/strHex.h>
|
||||||
@@ -31,7 +12,7 @@
|
|||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Format arbitrary binary data as an SQLite "blob literal".
|
/** Format arbitrary binary data as an SQLite "blob literal".
|
||||||
|
|
||||||
@@ -151,6 +132,6 @@ to_uint64(std::string const& s);
|
|||||||
bool
|
bool
|
||||||
isProperlyFormedTomlDomain(std::string_view domain);
|
isProperlyFormedTomlDomain(std::string_view domain);
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_TAGGEDCACHE_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_TAGGEDCACHE_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_TAGGEDCACHE_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_TAGGEDCACHE_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.h>
|
#include <xrpl/basics/IntrusivePointer.h>
|
||||||
#include <xrpl/basics/Log.h>
|
#include <xrpl/basics/Log.h>
|
||||||
@@ -35,7 +16,7 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Map/cache combination.
|
/** Map/cache combination.
|
||||||
This class implements a cache and a map. The cache keeps objects alive
|
This class implements a cache and a map. The cache keeps objects alive
|
||||||
@@ -334,6 +315,6 @@ private:
|
|||||||
std::uint64_t m_misses;
|
std::uint64_t m_misses;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_TAGGEDCACHE_IPP_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_TAGGEDCACHE_IPP_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_TAGGEDCACHE_IPP_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_TAGGEDCACHE_IPP_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/IntrusivePointer.ipp>
|
#include <xrpl/basics/IntrusivePointer.ipp>
|
||||||
#include <xrpl/basics/TaggedCache.h>
|
#include <xrpl/basics/TaggedCache.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
template <
|
template <
|
||||||
class Key,
|
class Key,
|
||||||
@@ -1024,6 +1005,6 @@ TaggedCache<
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_TOSTRING_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_TOSTRING_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_TOSTRING_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_TOSTRING_H_INCLUDED
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** to_string() generalizes std::to_string to handle bools, chars, and strings.
|
/** to_string() generalizes std::to_string to handle bools, chars, and strings.
|
||||||
|
|
||||||
@@ -62,6 +43,6 @@ to_string(char const* s)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/basics/hardened_hash.h>
|
#include <xrpl/basics/hardened_hash.h>
|
||||||
#include <xrpl/basics/partitioned_unordered_map.h>
|
#include <xrpl/basics/partitioned_unordered_map.h>
|
||||||
@@ -41,7 +22,7 @@
|
|||||||
* what container it is.
|
* what container it is.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
// hash containers
|
// hash containers
|
||||||
|
|
||||||
@@ -121,6 +102,6 @@ template <
|
|||||||
using hardened_hash_multiset =
|
using hardened_hash_multiset =
|
||||||
std::unordered_multiset<Value, Hash, Pred, Allocator>;
|
std::unordered_multiset<Value, Hash, Pred, Allocator>;
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,31 +1,12 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_UPTIMETIMER_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_UPTIMETIMER_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_UPTIMETIMER_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_UPTIMETIMER_H_INCLUDED
|
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <ratio>
|
#include <ratio>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Tracks program uptime to seconds precision.
|
/** Tracks program uptime to seconds precision.
|
||||||
|
|
||||||
@@ -64,6 +45,6 @@ private:
|
|||||||
start_clock();
|
start_clock();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,28 +1,9 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_ALGORITHM_H_INCLUDED
|
||||||
/*
|
#define XRPL_ALGORITHM_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2019 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_ALGORITHM_H_INCLUDED
|
|
||||||
#define RIPPLE_ALGORITHM_H_INCLUDED
|
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
// Requires: [first1, last1) and [first2, last2) are ordered ranges according to
|
// Requires: [first1, last1) and [first2, last2) are ordered ranges according to
|
||||||
// comp.
|
// comp.
|
||||||
@@ -114,6 +95,6 @@ remove_if_intersect_or_match(
|
|||||||
return first1;
|
return first1;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,25 +1,3 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
/*
|
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012-2018 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
//
|
|
||||||
// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
|
|
||||||
//
|
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//
|
//
|
||||||
@@ -54,13 +32,13 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_BASE64_H_INCLUDED
|
#ifndef XRPL_BASICS_BASE64_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_BASE64_H_INCLUDED
|
#define XRPL_BASICS_BASE64_H_INCLUDED
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
base64_encode(std::uint8_t const* data, std::size_t len);
|
base64_encode(std::uint8_t const* data, std::size_t len);
|
||||||
@@ -75,6 +53,6 @@ base64_encode(std::string const& s)
|
|||||||
std::string
|
std::string
|
||||||
base64_decode(std::string_view data);
|
base64_decode(std::string_view data);
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
/*
|
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||||
// Copyright (c) 2011 The Bitcoin developers
|
// Copyright (c) 2011 The Bitcoin developers
|
||||||
// Distributed under the MIT/X11 software license, see the accompanying
|
// Distributed under the MIT/X11 software license, see the accompanying
|
||||||
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_BASE_UINT_H_INCLUDED
|
#ifndef XRPL_BASICS_BASE_UINT_H_INCLUDED
|
||||||
#define RIPPLE_BASICS_BASE_UINT_H_INCLUDED
|
#define XRPL_BASICS_BASE_UINT_H_INCLUDED
|
||||||
|
|
||||||
#include <xrpl/basics/Expected.h>
|
#include <xrpl/basics/Expected.h>
|
||||||
#include <xrpl/basics/Slice.h>
|
#include <xrpl/basics/Slice.h>
|
||||||
@@ -42,7 +23,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
@@ -294,7 +275,7 @@ public:
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
c.size() * sizeof(typename Container::value_type) == size(),
|
c.size() * sizeof(typename Container::value_type) == size(),
|
||||||
"ripple::base_uint::base_uint(Container auto) : input size match");
|
"xrpl::base_uint::base_uint(Container auto) : input size match");
|
||||||
std::memcpy(data_.data(), c.data(), size());
|
std::memcpy(data_.data(), c.data(), size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,7 +288,7 @@ public:
|
|||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
c.size() * sizeof(typename Container::value_type) == size(),
|
c.size() * sizeof(typename Container::value_type) == size(),
|
||||||
"ripple::base_uint::operator=(Container auto) : input size match");
|
"xrpl::base_uint::operator=(Container auto) : input size match");
|
||||||
std::memcpy(data_.data(), c.data(), size());
|
std::memcpy(data_.data(), c.data(), size());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -632,6 +613,16 @@ to_string(base_uint<Bits, Tag> const& a)
|
|||||||
return strHex(a.cbegin(), a.cend());
|
return strHex(a.cbegin(), a.cend());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <std::size_t Bits, class Tag>
|
||||||
|
inline std::string
|
||||||
|
to_short_string(base_uint<Bits, Tag> const& a)
|
||||||
|
{
|
||||||
|
static_assert(
|
||||||
|
base_uint<Bits, Tag>::bytes > 4,
|
||||||
|
"For 4 bytes or less, use a native type");
|
||||||
|
return strHex(a.cbegin(), a.cbegin() + 4) + "...";
|
||||||
|
}
|
||||||
|
|
||||||
template <std::size_t Bits, class Tag>
|
template <std::size_t Bits, class Tag>
|
||||||
inline std::ostream&
|
inline std::ostream&
|
||||||
operator<<(std::ostream& out, base_uint<Bits, Tag> const& u)
|
operator<<(std::ostream& out, base_uint<Bits, Tag> const& u)
|
||||||
@@ -657,12 +648,12 @@ static_assert(sizeof(uint192) == 192 / 8, "There should be no padding bytes");
|
|||||||
static_assert(sizeof(uint256) == 256 / 8, "There should be no padding bytes");
|
static_assert(sizeof(uint256) == 256 / 8, "There should be no padding bytes");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
namespace beast {
|
namespace beast {
|
||||||
|
|
||||||
template <std::size_t Bits, class Tag>
|
template <std::size_t Bits, class Tag>
|
||||||
struct is_uniquely_represented<ripple::base_uint<Bits, Tag>>
|
struct is_uniquely_represented<xrpl::base_uint<Bits, Tag>>
|
||||||
: public std::true_type
|
: public std::true_type
|
||||||
{
|
{
|
||||||
explicit is_uniquely_represented() = default;
|
explicit is_uniquely_represented() = default;
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_CHRONO_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_CHRONO_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_CHRONO_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_CHRONO_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/beast/clock/abstract_clock.h>
|
#include <xrpl/beast/clock/abstract_clock.h>
|
||||||
#include <xrpl/beast/clock/basic_seconds_clock.h>
|
#include <xrpl/beast/clock/basic_seconds_clock.h>
|
||||||
@@ -31,7 +12,7 @@
|
|||||||
#include <ratio>
|
#include <ratio>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
// A few handy aliases
|
// A few handy aliases
|
||||||
|
|
||||||
@@ -123,6 +104,6 @@ stopwatch()
|
|||||||
return beast::get_abstract_clock<Facade, Clock>();
|
return beast::get_abstract_clock<Facade, Clock>();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,28 +1,9 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_COMPARATORS_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_COMPARATORS_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_COMPARATORS_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_COMPARATORS_H_INCLUDED
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
@@ -71,6 +52,6 @@ using equal_to = std::equal_to<T>;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_CONTRACT_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_CONTRACT_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2014 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_CONTRACT_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_CONTRACT_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/beast/type_name.h>
|
#include <xrpl/beast/type_name.h>
|
||||||
|
|
||||||
@@ -26,7 +7,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/* Programming By Contract
|
/* Programming By Contract
|
||||||
|
|
||||||
@@ -71,6 +52,6 @@ Throw(Args&&... args)
|
|||||||
[[noreturn]] void
|
[[noreturn]] void
|
||||||
LogicError(std::string const& how) noexcept;
|
LogicError(std::string const& how) noexcept;
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_HARDENED_HASH_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_HARDENED_HASH_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2014 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_HARDENED_HASH_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_HARDENED_HASH_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/beast/hash/hash_append.h>
|
#include <xrpl/beast/hash/hash_append.h>
|
||||||
#include <xrpl/beast/hash/xxhasher.h>
|
#include <xrpl/beast/hash/xxhasher.h>
|
||||||
@@ -28,7 +9,7 @@
|
|||||||
#include <random>
|
#include <random>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
@@ -111,6 +92,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,27 +1,9 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
/*
|
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2022 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef JOIN_H_INCLUDED
|
#ifndef JOIN_H_INCLUDED
|
||||||
#define JOIN_H_INCLUDED
|
#define JOIN_H_INCLUDED
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
template <class Stream, class Iter>
|
template <class Stream, class Iter>
|
||||||
Stream&
|
Stream&
|
||||||
@@ -103,6 +85,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,30 +1,11 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_MAKE_SSLCONTEXT_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_MAKE_SSLCONTEXT_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_MAKE_SSLCONTEXT_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_MAKE_SSLCONTEXT_H_INCLUDED
|
|
||||||
|
|
||||||
#include <boost/asio/ssl/context.hpp>
|
#include <boost/asio/ssl/context.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
/** Create a self-signed SSL context that allows anonymous Diffie Hellman. */
|
/** Create a self-signed SSL context that allows anonymous Diffie Hellman. */
|
||||||
std::shared_ptr<boost::asio::ssl::context>
|
std::shared_ptr<boost::asio::ssl::context>
|
||||||
@@ -38,6 +19,6 @@ make_SSLContextAuthed(
|
|||||||
std::string const& chainFile,
|
std::string const& chainFile,
|
||||||
std::string const& cipherList);
|
std::string const& cipherList);
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,30 +1,11 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_MULDIV_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_MULDIV_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012-2015 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_MULDIV_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_MULDIV_H_INCLUDED
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
auto constexpr muldiv_max = std::numeric_limits<std::uint64_t>::max();
|
auto constexpr muldiv_max = std::numeric_limits<std::uint64_t>::max();
|
||||||
|
|
||||||
/** Return value*mul/div accurately.
|
/** Return value*mul/div accurately.
|
||||||
@@ -40,6 +21,6 @@ auto constexpr muldiv_max = std::numeric_limits<std::uint64_t>::max();
|
|||||||
std::optional<std::uint64_t>
|
std::optional<std::uint64_t>
|
||||||
mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div);
|
mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div);
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H
|
||||||
/*
|
#define XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2021 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_PARTITIONED_UNORDERED_MAP_H
|
|
||||||
#define RIPPLE_BASICS_PARTITIONED_UNORDERED_MAP_H
|
|
||||||
|
|
||||||
#include <xrpl/beast/hash/uhash.h>
|
#include <xrpl/beast/hash/uhash.h>
|
||||||
#include <xrpl/beast/utility/instrumentation.h>
|
#include <xrpl/beast/utility/instrumentation.h>
|
||||||
@@ -31,7 +12,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
template <typename Key>
|
template <typename Key>
|
||||||
static std::size_t
|
static std::size_t
|
||||||
@@ -261,7 +242,7 @@ public:
|
|||||||
map_.resize(partitions_);
|
map_.resize(partitions_);
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
partitions_,
|
partitions_,
|
||||||
"ripple::partitioned_unordered_map::partitioned_unordered_map : "
|
"xrpl::partitioned_unordered_map::partitioned_unordered_map : "
|
||||||
"nonzero partitions");
|
"nonzero partitions");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,6 +401,6 @@ private:
|
|||||||
mutable partition_map_type map_{};
|
mutable partition_map_type map_{};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif // RIPPLE_BASICS_PARTITIONED_UNORDERED_MAP_H
|
#endif // XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
//------------------------------------------------------------------------------
|
#ifndef XRPL_BASICS_RANDOM_H_INCLUDED
|
||||||
/*
|
#define XRPL_BASICS_RANDOM_H_INCLUDED
|
||||||
This file is part of rippled: https://github.com/ripple/rippled
|
|
||||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef RIPPLE_BASICS_RANDOM_H_INCLUDED
|
|
||||||
#define RIPPLE_BASICS_RANDOM_H_INCLUDED
|
|
||||||
|
|
||||||
#include <xrpl/beast/utility/instrumentation.h>
|
#include <xrpl/beast/utility/instrumentation.h>
|
||||||
#include <xrpl/beast/xor_shift_engine.h>
|
#include <xrpl/beast/xor_shift_engine.h>
|
||||||
@@ -30,7 +11,7 @@
|
|||||||
#include <random>
|
#include <random>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
namespace ripple {
|
namespace xrpl {
|
||||||
|
|
||||||
#ifndef __INTELLISENSE__
|
#ifndef __INTELLISENSE__
|
||||||
static_assert(
|
static_assert(
|
||||||
@@ -114,7 +95,7 @@ std::enable_if_t<
|
|||||||
Integral>
|
Integral>
|
||||||
rand_int(Engine& engine, Integral min, Integral max)
|
rand_int(Engine& engine, Integral min, Integral max)
|
||||||
{
|
{
|
||||||
XRPL_ASSERT(max > min, "ripple::rand_int : max over min inputs");
|
XRPL_ASSERT(max > min, "xrpl::rand_int : max over min inputs");
|
||||||
|
|
||||||
// This should have no state and constructing it should
|
// This should have no state and constructing it should
|
||||||
// be very cheap. If that turns out not to be the case
|
// be very cheap. If that turns out not to be the case
|
||||||
@@ -205,6 +186,6 @@ rand_bool()
|
|||||||
}
|
}
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace xrpl
|
||||||
|
|
||||||
#endif // RIPPLE_BASICS_RANDOM_H_INCLUDED
|
#endif // XRPL_BASICS_RANDOM_H_INCLUDED
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user