Merge remote-tracking branch 'upstream/develop' into ximinez/lending-refactoring-1

* upstream/develop: (56 commits)
  Remove `include(default)` from libxrpl profile (#5587)
  refactor: Change boost::shared_mutex to std::shared_mutex (#5576)
  Fix macos runner (#5585)
  Remove the type filter from "ledger" RPC command (#4934)
  refactor: Update date, libarchive, nudb, openssl, sqlite3, xxhash packages (#5567)
  test: Run unit tests regardless of 'Supported' amendment status (#5537)
  Retire Flow Cross amendment (#5562)
  chore: Update CI to use Conan 2 (#5556)
  fixAMMClawbackRounding: adjust last holder's LPToken balance (#5513)
  chore: Add gcc-12 workaround (#5554)
  Add MPT related txns into issuer's account history  (#5530)
  chore: Remove unused headers (#5526)
  fix: add allowTrustLineLocking flag for account_info (#5525)
  Downgrade required CMake version for Antithesis SDK (#5548)
  fix: Link with boost libraries explicitly (#5546)
  chore: Fix compilation error with clang-20 and cleanup (#5543)
  test: Remove circular jtx.h dependencies (#5544)
  Decouple CredentialHelpers from xrpld/app/tx (#5487)
  fix: crash when trace-logging in tests (#5529)
  test: switch some unit tests to doctest (#5383)
  ...
This commit is contained in:
Ed Hennis
2025-07-21 19:21:55 -04:00
352 changed files with 25016 additions and 10043 deletions

View File

@@ -7,13 +7,13 @@ comment:
show_carryforward_flags: false show_carryforward_flags: false
coverage: coverage:
range: "60..80" range: "70..85"
precision: 1 precision: 1
round: nearest round: nearest
status: status:
project: project:
default: default:
target: 60% target: 75%
threshold: 2% threshold: 2%
patch: patch:
default: default:

View File

@@ -6,36 +6,32 @@ inputs:
runs: runs:
using: composite using: composite
steps: steps:
- name: unlock Conan
shell: bash
run: conan remove --locks
- name: export custom recipes - name: export custom recipes
shell: bash shell: bash
run: | run: |
conan config set general.revisions_enabled=1 conan export --version 1.1.10 external/snappy
conan export external/snappy snappy/1.1.10@ conan export --version 9.7.3 external/rocksdb
conan export external/rocksdb rocksdb/9.7.3@ conan export --version 4.0.3 external/soci
conan export external/soci soci/4.0.3@
conan export external/nudb nudb/2.0.8@
- name: add Ripple Conan remote - name: add Ripple Conan remote
if: env.CONAN_URL != ''
shell: bash shell: bash
run: | run: |
conan remote list if conan remote list | grep -q "ripple"; then
conan remote remove ripple || true conan remote remove ripple
# Do not quote the URL. An empty string will be accepted (with echo "Removed conan remote ripple"
# a non-fatal warning), but a missing argument will not. fi
conan remote add ripple ${{ env.CONAN_URL }} --insert 0 conan remote add --index 0 ripple "${CONAN_URL}"
echo "Added conan remote ripple at ${CONAN_URL}"
- name: try to authenticate to Ripple Conan remote - name: try to authenticate to Ripple Conan remote
if: env.CONAN_LOGIN_USERNAME_RIPPLE != '' && env.CONAN_PASSWORD_RIPPLE != ''
id: remote id: remote
shell: bash shell: bash
run: | run: |
# `conan user` implicitly uses the environment variables echo "Authenticating to ripple remote..."
# CONAN_LOGIN_USERNAME_<REMOTE> and CONAN_PASSWORD_<REMOTE>. conan remote auth ripple --force
# https://docs.conan.io/1/reference/commands/misc/user.html#using-environment-variables conan remote list-users
# https://docs.conan.io/1/reference/env_vars.html#conan-login-username-conan-login-username-remote-name
# https://docs.conan.io/1/reference/env_vars.html#conan-password-conan-password-remote-name
echo outcome=$(conan user --remote ripple --password >&2 \
&& echo success || echo failure) | tee ${GITHUB_OUTPUT}
- name: list missing binaries - name: list missing binaries
id: binaries id: binaries
shell: bash shell: bash
@@ -51,7 +47,7 @@ runs:
conan install \ conan install \
--output-folder . \ --output-folder . \
--build missing \ --build missing \
--options tests=True \ --options:host "&:tests=True" \
--options xrpld=True \ --options:host "&:xrpld=True" \
--settings build_type=${{ inputs.configuration }} \ --settings:all build_type=${{ inputs.configuration }} \
.. ..

View File

@@ -9,24 +9,16 @@ jobs:
check: check:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }} if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
env: container: ghcr.io/xrplf/ci/tools-rippled-clang-format
CLANG_VERSION: 18
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install clang-format
run: |
codename=$( lsb_release --codename --short )
sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null <<EOF
deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
deb-src http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${CLANG_VERSION} main
EOF
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add
sudo apt-get update
sudo apt-get install clang-format-${CLANG_VERSION}
- name: Format first-party sources - name: Format first-party sources
run: find include src tests -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.ipp' \) -exec clang-format-${CLANG_VERSION} -i {} + run: |
clang-format --version
find include src tests -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.ipp' \) -exec clang-format -i {} +
- name: Check for differences - name: Check for differences
id: assert id: assert
shell: bash
run: | run: |
set -o pipefail set -o pipefail
git diff --exit-code | tee "clang-format.patch" git diff --exit-code | tee "clang-format.patch"
@@ -58,6 +50,6 @@ jobs:
in your repo, commit, and push. in your repo, commit, and push.
run: | run: |
echo "${PREAMBLE}" echo "${PREAMBLE}"
clang-format-${CLANG_VERSION} --version clang-format --version
echo "${SUGGESTION}" echo "${SUGGESTION}"
exit 1 exit 1

View File

@@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
job: documentation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write

View File

@@ -1,6 +1,6 @@
name: Check libXRPL compatibility with Clio name: Check libXRPL compatibility with Clio
env: env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/dev
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }} CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }} CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
on: on:

View File

@@ -15,6 +15,20 @@ on:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
# This part of Conan configuration is specific to this workflow only; we do not want
# to pollute conan/profiles directory with settings which might not work for others
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/dev
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
CONAN_GLOBAL_CONF: |
core.download:parallel={{os.cpu_count()}}
core.upload:parallel={{os.cpu_count()}}
core:default_build_profile=libxrpl
core:default_profile=libxrpl
tools.build:jobs={{ (os.cpu_count() * 4/5) | int }}
tools.build:verbosity=verbose
tools.compilation:verbosity=verbose
jobs: jobs:
@@ -28,23 +42,22 @@ jobs:
- Ninja - Ninja
configuration: configuration:
- Release - Release
runs-on: [self-hosted, macOS] runs-on: [self-hosted, macOS, mac-runner-m1]
env: env:
# The `build` action requires these variables. # The `build` action requires these variables.
build_dir: .build build_dir: .build
NUM_PROCESSORS: 12 NUM_PROCESSORS: 12
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: install Conan - name: install Conan
run: | run: |
brew install conan@1 brew install conan
echo '/opt/homebrew/opt/conan@1/bin' >> $GITHUB_PATH
- name: install Ninja - name: install Ninja
if: matrix.generator == 'Ninja' if: matrix.generator == 'Ninja'
run: brew install ninja run: brew install ninja
- name: install python - name: install python
run: | run: |
if which python > /dev/null 2>&1; then if which python > /dev/null 2>&1; then
echo "Python executable exists" echo "Python executable exists"
else else
@@ -76,14 +89,27 @@ jobs:
clang --version clang --version
- name: configure Conan - name: configure Conan
run : | run : |
conan profile new default --detect || true echo "${CONAN_GLOBAL_CONF}" >> $(conan config home)/global.conf
conan profile update settings.compiler.cppstd=20 default conan config install conan/profiles/ -tf $(conan config home)/profiles/
conan profile show
- name: export custom recipes
shell: bash
run: |
conan export --version 1.1.10 external/snappy
conan export --version 9.7.3 external/rocksdb
conan export --version 4.0.3 external/soci
- name: add Ripple Conan remote
if: env.CONAN_URL != ''
shell: bash
run: |
if conan remote list | grep -q "ripple"; then
conan remote remove ripple
echo "Removed conan remote ripple"
fi
conan remote add --index 0 ripple "${CONAN_URL}"
echo "Added conan remote ripple at ${CONAN_URL}"
- name: build dependencies - name: build dependencies
uses: ./.github/actions/dependencies uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
with: with:
configuration: ${{ matrix.configuration }} configuration: ${{ matrix.configuration }}
- name: build - name: build
@@ -96,4 +122,7 @@ jobs:
run: | run: |
n=$(nproc) n=$(nproc)
echo "Using $n test jobs" echo "Using $n test jobs"
${build_dir}/rippled --unittest --unittest-jobs $n
cd ${build_dir}
./rippled --unittest --unittest-jobs $n
ctest -j $n --output-on-failure

View File

@@ -16,6 +16,21 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
# This part of Conan configuration is specific to this workflow only; we do not want
# to pollute conan/profiles directory with settings which might not work for others
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/dev
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
CONAN_GLOBAL_CONF: |
core.download:parallel={{ os.cpu_count() }}
core.upload:parallel={{ os.cpu_count() }}
core:default_build_profile=libxrpl
core:default_profile=libxrpl
tools.build:jobs={{ (os.cpu_count() * 4/5) | int }}
tools.build:verbosity=verbose
tools.compilation:verbosity=verbose
# This workflow has multiple job matrixes. # This workflow has multiple job matrixes.
# They can be considered phases because most of the matrices ("test", # They can be considered phases because most of the matrices ("test",
# "coverage", "conan", ) depend on the first ("dependencies"). # "coverage", "conan", ) depend on the first ("dependencies").
@@ -54,59 +69,46 @@ jobs:
- Release - Release
include: include:
- compiler: gcc - compiler: gcc
profile: compiler_version: 12
version: 11 distro: ubuntu
cc: /usr/bin/gcc codename: jammy
cxx: /usr/bin/g++
- compiler: clang - compiler: clang
profile: compiler_version: 16
version: 14 distro: debian
cc: /usr/bin/clang-14 codename: bookworm
cxx: /usr/bin/clang++-14
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/ci/${{ matrix.distro }}-${{ matrix.codename }}:${{ matrix.compiler }}-${{ matrix.compiler_version }}
env: env:
build_dir: .build build_dir: .build
steps: steps:
- name: upgrade conan
run: |
pip install --upgrade "conan<2"
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: check environment - name: check environment
run: | run: |
echo ${PATH} | tr ':' '\n' echo ${PATH} | tr ':' '\n'
lsb_release -a || true lsb_release -a || true
${{ matrix.profile.cc }} --version ${{ matrix.compiler }}-${{ matrix.compiler_version }} --version
conan --version conan --version
cmake --version cmake --version
env | sort env | sort
- name: configure Conan - name: configure Conan
run: | run: |
conan profile new default --detect echo "${CONAN_GLOBAL_CONF}" >> $(conan config home)/global.conf
conan profile update settings.compiler.cppstd=20 default conan config install conan/profiles/ -tf $(conan config home)/profiles/
conan profile update settings.compiler=${{ matrix.compiler }} default conan profile show
conan profile update settings.compiler.version=${{ matrix.profile.version }} default
conan profile update settings.compiler.libcxx=libstdc++11 default
conan profile update env.CC=${{ matrix.profile.cc }} default
conan profile update env.CXX=${{ matrix.profile.cxx }} default
conan profile update conf.tools.build:compiler_executables='{"c": "${{ matrix.profile.cc }}", "cpp": "${{ matrix.profile.cxx }}"}' default
- name: archive profile - name: archive profile
# Create this archive before dependencies are added to the local cache. # Create this archive before dependencies are added to the local cache.
run: tar -czf conan.tar -C ~/.conan . run: tar -czf conan.tar.gz -C ${CONAN_HOME} .
- name: build dependencies - name: build dependencies
uses: ./.github/actions/dependencies uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
with: with:
configuration: ${{ matrix.configuration }} configuration: ${{ matrix.configuration }}
- name: upload archive - name: upload archive
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with: with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }} name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
path: conan.tar path: conan.tar.gz
if-no-files-found: error if-no-files-found: error
test: test:
@@ -121,26 +123,32 @@ jobs:
configuration: configuration:
- Debug - Debug
- Release - Release
include:
- compiler: gcc
compiler_version: 12
distro: ubuntu
codename: jammy
- compiler: clang
compiler_version: 16
distro: debian
codename: bookworm
cmake-args: cmake-args:
- -
- "-Dunity=ON" - "-Dunity=ON"
needs: dependencies needs: dependencies
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/ci/${{ matrix.distro }}-${{ matrix.codename }}:${{ matrix.compiler }}-${{ matrix.compiler_version }}
env: env:
build_dir: .build build_dir: .build
steps: steps:
- name: upgrade conan
run: |
pip install --upgrade "conan<2"
- name: download cache - name: download cache
uses: actions/download-artifact@v4 uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with: with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }} name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
- name: extract cache - name: extract cache
run: | run: |
mkdir -p ~/.conan mkdir -p ${CONAN_HOME}
tar -xzf conan.tar -C ~/.conan tar -xzf conan.tar.gz -C ${CONAN_HOME}
- name: check environment - name: check environment
run: | run: |
env | sort env | sort
@@ -148,11 +156,9 @@ jobs:
conan --version conan --version
cmake --version cmake --version
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: dependencies - name: dependencies
uses: ./.github/actions/dependencies uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
with: with:
configuration: ${{ matrix.configuration }} configuration: ${{ matrix.configuration }}
- name: build - name: build
@@ -161,9 +167,21 @@ jobs:
generator: Ninja generator: Ninja
configuration: ${{ matrix.configuration }} configuration: ${{ matrix.configuration }}
cmake-args: "-Dassert=TRUE -Dwerr=TRUE ${{ matrix.cmake-args }}" cmake-args: "-Dassert=TRUE -Dwerr=TRUE ${{ matrix.cmake-args }}"
- name: check linking
run: |
cd ${build_dir}
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: test - name: test
run: | run: |
${build_dir}/rippled --unittest --unittest-jobs $(nproc) cd ${build_dir}
./rippled --unittest --unittest-jobs $(nproc)
ctest -j $(nproc) --output-on-failure
reference-fee-test: reference-fee-test:
strategy: strategy:
@@ -180,21 +198,18 @@ jobs:
- "-DUNIT_TEST_REFERENCE_FEE=1000" - "-DUNIT_TEST_REFERENCE_FEE=1000"
needs: dependencies needs: dependencies
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/ci/ubuntu-jammy:gcc-12
env: env:
build_dir: .build build_dir: .build
steps: steps:
- name: upgrade conan
run: |
pip install --upgrade "conan<2"
- name: download cache - name: download cache
uses: actions/download-artifact@v4 uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with: with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }} name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
- name: extract cache - name: extract cache
run: | run: |
mkdir -p ~/.conan mkdir -p ${CONAN_HOME}
tar -xzf conan.tar -C ~/.conan tar -xzf conan.tar.gz -C ${CONAN_HOME}
- name: check environment - name: check environment
run: | run: |
env | sort env | sort
@@ -202,11 +217,9 @@ jobs:
conan --version conan --version
cmake --version cmake --version
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: dependencies - name: dependencies
uses: ./.github/actions/dependencies uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
with: with:
configuration: ${{ matrix.configuration }} configuration: ${{ matrix.configuration }}
- name: build - name: build
@@ -217,7 +230,9 @@ jobs:
cmake-args: "-Dassert=TRUE -Dwerr=TRUE ${{ matrix.cmake-args }}" cmake-args: "-Dassert=TRUE -Dwerr=TRUE ${{ matrix.cmake-args }}"
- name: test - name: test
run: | run: |
${build_dir}/rippled --unittest --unittest-jobs $(nproc) cd ${build_dir}
./rippled --unittest --unittest-jobs $(nproc)
ctest -j $(nproc) --output-on-failure
coverage: coverage:
strategy: strategy:
@@ -231,23 +246,18 @@ jobs:
- Debug - Debug
needs: dependencies needs: dependencies
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e container: ghcr.io/xrplf/ci/ubuntu-jammy:gcc-12
env: env:
build_dir: .build build_dir: .build
steps: steps:
- name: upgrade conan
run: |
pip install --upgrade "conan<2"
- name: download cache - name: download cache
uses: actions/download-artifact@v4 uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with: with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }} name: ${{ matrix.platform }}-${{ matrix.compiler }}-${{ matrix.configuration }}
- name: extract cache - name: extract cache
run: | run: |
mkdir -p ~/.conan mkdir -p ${CONAN_HOME}
tar -xzf conan.tar -C ~/.conan tar -xzf conan.tar.gz -C ${CONAN_HOME}
- name: install gcovr
run: pip install "gcovr>=7,<9"
- name: check environment - name: check environment
run: | run: |
echo ${PATH} | tr ':' '\n' echo ${PATH} | tr ':' '\n'
@@ -255,13 +265,11 @@ jobs:
cmake --version cmake --version
gcovr --version gcovr --version
env | sort env | sort
ls ~/.conan ls ${CONAN_HOME}
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: dependencies - name: dependencies
uses: ./.github/actions/dependencies uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
with: with:
configuration: ${{ matrix.configuration }} configuration: ${{ matrix.configuration }}
- name: build - name: build
@@ -283,7 +291,7 @@ jobs:
run: | run: |
mv "${build_dir}/coverage.xml" ./ mv "${build_dir}/coverage.xml" ./
- name: archive coverage report - name: archive coverage report
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with: with:
name: coverage.xml name: coverage.xml
path: coverage.xml path: coverage.xml
@@ -305,22 +313,23 @@ jobs:
conan: conan:
needs: dependencies needs: dependencies
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: ghcr.io/xrplf/rippled-build-ubuntu:aaf5e3e container:
image: ghcr.io/xrplf/ci/ubuntu-jammy:gcc-12
env: env:
build_dir: .build build_dir: .build
platform: linux
compiler: gcc
compiler_version: 12
configuration: Release configuration: Release
steps: steps:
- name: upgrade conan
run: |
pip install --upgrade "conan<2"
- name: download cache - name: download cache
uses: actions/download-artifact@v4 uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with: with:
name: linux-gcc-${{ env.configuration }} name: ${{ env.platform }}-${{ env.compiler }}-${{ env.configuration }}
- name: extract cache - name: extract cache
run: | run: |
mkdir -p ~/.conan mkdir -p ${CONAN_HOME}
tar -xzf conan.tar -C ~/.conan tar -xzf conan.tar.gz -C ${CONAN_HOME}
- name: check environment - name: check environment
run: | run: |
env | sort env | sort
@@ -328,27 +337,22 @@ jobs:
conan --version conan --version
cmake --version cmake --version
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: dependencies - name: dependencies
uses: ./.github/actions/dependencies uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
with: with:
configuration: ${{ env.configuration }} configuration: ${{ env.configuration }}
- name: export - name: export
run: | run: |
version=$(conan inspect --raw version .) conan export . --version head
reference="xrpl/${version}@local/test"
conan remove -f ${reference} || true
conan export . local/test
echo "reference=${reference}" >> "${GITHUB_ENV}"
- name: build - name: build
run: | run: |
cd tests/conan cd tests/conan
mkdir ${build_dir} mkdir ${build_dir} && cd ${build_dir}
cd ${build_dir} conan install .. \
conan install .. --output-folder . \ --settings:all build_type=${configuration} \
--require-override ${reference} --build missing --output-folder . \
--build missing
cmake .. \ cmake .. \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=./build/${configuration}/generators/conan_toolchain.cmake \ -DCMAKE_TOOLCHAIN_FILE:FILEPATH=./build/${configuration}/generators/conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE=${configuration} -DCMAKE_BUILD_TYPE=${configuration}
@@ -363,60 +367,31 @@ jobs:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }} if: ${{ github.event_name == 'push' || github.event.pull_request.draft != true || contains(github.event.pull_request.labels.*.name, 'DraftRunCI') }}
env: env:
CLANG_RELEASE: 16 CLANG_RELEASE: 16
strategy:
fail-fast: false
runs-on: [self-hosted, heavy] runs-on: [self-hosted, heavy]
container: debian:bookworm container: ghcr.io/xrplf/ci/debian-bookworm:clang-16
steps:
- name: install prerequisites
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get install --yes --no-install-recommends \
clang-${CLANG_RELEASE} clang++-${CLANG_RELEASE} \
python3-pip python-is-python3 make cmake git wget
apt-get clean
update-alternatives --install \
/usr/bin/clang clang /usr/bin/clang-${CLANG_RELEASE} 100 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_RELEASE}
update-alternatives --auto clang
pip install --no-cache --break-system-packages "conan<2"
steps:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: prepare environment - name: prepare environment
run: | run: |
mkdir ${GITHUB_WORKSPACE}/.build mkdir ${GITHUB_WORKSPACE}/.build
echo "SOURCE_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV echo "SOURCE_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "BUILD_DIR=$GITHUB_WORKSPACE/.build" >> $GITHUB_ENV echo "BUILD_DIR=$GITHUB_WORKSPACE/.build" >> $GITHUB_ENV
echo "CC=/usr/bin/clang" >> $GITHUB_ENV
echo "CXX=/usr/bin/clang++" >> $GITHUB_ENV
- name: configure Conan - name: configure Conan
run: | run: |
conan profile new --detect default echo "${CONAN_GLOBAL_CONF}" >> $(conan config home)/global.conf
conan profile update settings.compiler=clang default conan config install conan/profiles/ -tf $(conan config home)/profiles/
conan profile update settings.compiler.version=${CLANG_RELEASE} default conan profile show
conan profile update settings.compiler.libcxx=libstdc++11 default
conan profile update settings.compiler.cppstd=20 default
conan profile update options.rocksdb=False default
conan profile update \
'conf.tools.build:compiler_executables={"c": "/usr/bin/clang", "cpp": "/usr/bin/clang++"}' default
conan profile update 'env.CXXFLAGS="-DBOOST_ASIO_DISABLE_CONCEPTS"' default
conan profile update 'conf.tools.build:cxxflags+=["-DBOOST_ASIO_DISABLE_CONCEPTS"]' default
conan export external/snappy snappy/1.1.10@
conan export external/soci soci/4.0.3@
- name: build dependencies - name: build dependencies
run: | run: |
cd ${BUILD_DIR} cd ${BUILD_DIR}
conan install ${SOURCE_DIR} \ conan install ${SOURCE_DIR} \
--output-folder ${BUILD_DIR} \ --output-folder ${BUILD_DIR} \
--install-folder ${BUILD_DIR} \
--build missing \ --build missing \
--settings build_type=Debug --settings:all build_type=Debug
- name: build with instrumentation - name: build with instrumentation
run: | run: |
@@ -441,3 +416,4 @@ jobs:
run: | run: |
cd ${BUILD_DIR} cd ${BUILD_DIR}
./rippled -u --unittest-jobs $(( $(nproc)/4 )) ./rippled -u --unittest-jobs $(( $(nproc)/4 ))
ctest -j $(nproc) --output-on-failure

View File

@@ -18,6 +18,20 @@ on:
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
# This part of Conan configuration is specific to this workflow only; we do not want
# to pollute conan/profiles directory with settings which might not work for others
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/dev
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
CONAN_GLOBAL_CONF: |
core.download:parallel={{os.cpu_count()}}
core.upload:parallel={{os.cpu_count()}}
core:default_build_profile=libxrpl
core:default_profile=libxrpl
tools.build:jobs=24
tools.build:verbosity=verbose
tools.compilation:verbosity=verbose
jobs: jobs:
@@ -42,11 +56,11 @@ jobs:
build_dir: .build build_dir: .build
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v4 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: choose Python - name: choose Python
uses: actions/setup-python@v5 uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with: with:
python-version: 3.9 python-version: 3.13
- name: learn Python cache directory - name: learn Python cache directory
id: pip-cache id: pip-cache
shell: bash shell: bash
@@ -54,12 +68,12 @@ jobs:
python -m pip install --upgrade pip python -m pip install --upgrade pip
echo "dir=$(pip cache dir)" | tee ${GITHUB_OUTPUT} echo "dir=$(pip cache dir)" | tee ${GITHUB_OUTPUT}
- name: restore Python cache directory - name: restore Python cache directory
uses: actions/cache@v4 uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with: with:
path: ${{ steps.pip-cache.outputs.dir }} path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }} key: ${{ runner.os }}-${{ hashFiles('.github/workflows/windows.yml') }}
- name: install Conan - name: install Conan
run: pip install wheel 'conan<2' run: pip install wheel conan
- name: check environment - name: check environment
run: | run: |
dir env: dir env:
@@ -70,17 +84,27 @@ jobs:
- name: configure Conan - name: configure Conan
shell: bash shell: bash
run: | run: |
conan profile new default --detect echo "${CONAN_GLOBAL_CONF}" >> $(conan config home)/global.conf
conan profile update settings.compiler.cppstd=20 default conan config install conan/profiles/ -tf $(conan config home)/profiles/
conan profile update \ conan profile show
settings.compiler.runtime=MT${{ matrix.configuration.runtime }} \ - name: export custom recipes
default shell: bash
run: |
conan export --version 1.1.10 external/snappy
conan export --version 9.7.3 external/rocksdb
conan export --version 4.0.3 external/soci
- name: add Ripple Conan remote
if: env.CONAN_URL != ''
shell: bash
run: |
if conan remote list | grep -q "ripple"; then
conan remote remove ripple
echo "Removed conan remote ripple"
fi
conan remote add --index 0 ripple "${CONAN_URL}"
echo "Added conan remote ripple at ${CONAN_URL}"
- name: build dependencies - name: build dependencies
uses: ./.github/actions/dependencies uses: ./.github/actions/dependencies
env:
CONAN_URL: http://18.143.149.228:8081/artifactory/api/conan/conan-non-prod
CONAN_LOGIN_USERNAME_RIPPLE: ${{ secrets.CONAN_USERNAME }}
CONAN_PASSWORD_RIPPLE: ${{ secrets.CONAN_TOKEN }}
with: with:
configuration: ${{ matrix.configuration.type }} configuration: ${{ matrix.configuration.type }}
- name: build - name: build
@@ -95,5 +119,6 @@ jobs:
shell: bash shell: bash
if: ${{ matrix.configuration.tests }} if: ${{ matrix.configuration.tests }}
run: | run: |
${build_dir}/${{ matrix.configuration.type }}/rippled --unittest \ cd ${build_dir}/${{ matrix.configuration.type }}
--unittest-jobs $(nproc) ./rippled --unittest --unittest-jobs $(nproc)
ctest -j $(nproc) --output-on-failure

View File

@@ -1,6 +1,6 @@
# .pre-commit-config.yaml # .pre-commit-config.yaml
repos: repos:
- repo: https://github.com/pre-commit/mirrors-clang-format - repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.3 rev: v18.1.8
hooks: hooks:
- id: clang-format - id: clang-format

View File

@@ -167,8 +167,6 @@ It does not explicitly link the C++ standard library,
which allows you to statically link it with GCC, if you want. which allows you to statically link it with GCC, if you want.
``` ```
# Conan 1.x
conan export external/snappy snappy/1.1.10@
# Conan 2.x # Conan 2.x
conan export --version 1.1.10 external/snappy conan export --version 1.1.10 external/snappy
``` ```
@@ -177,8 +175,6 @@ Export our [Conan recipe for RocksDB](./external/rocksdb).
It does not override paths to dependencies when building with Visual Studio. It does not override paths to dependencies when building with Visual Studio.
``` ```
# Conan 1.x
conan export external/rocksdb rocksdb/9.7.3@
# Conan 2.x # Conan 2.x
conan export --version 9.7.3 external/rocksdb conan export --version 9.7.3 external/rocksdb
``` ```
@@ -187,23 +183,10 @@ Export our [Conan recipe for SOCI](./external/soci).
It patches their CMake to correctly import its dependencies. It patches their CMake to correctly import its dependencies.
``` ```
# Conan 1.x
conan export external/soci soci/4.0.3@
# Conan 2.x # Conan 2.x
conan export --version 4.0.3 external/soci conan export --version 4.0.3 external/soci
``` ```
Export our [Conan recipe for NuDB](./external/nudb).
It fixes some source files to add missing `#include`s.
```
# Conan 1.x
conan export external/nudb nudb/2.0.8@
# Conan 2.x
conan export --version 2.0.8 external/nudb
```
### Build and Test ### Build and Test
1. Create a build directory and move into it. 1. Create a build directory and move into it.
@@ -288,7 +271,7 @@ It fixes some source files to add missing `#include`s.
Single-config generators: Single-config generators:
``` ```
cmake --build . cmake --build . -j $(nproc)
``` ```
Multi-config generators: Multi-config generators:

View File

@@ -132,6 +132,7 @@ test.shamap > xrpl.protocol
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
xrpl.json > xrpl.basics xrpl.json > xrpl.basics
xrpl.protocol > xrpl.basics xrpl.protocol > xrpl.basics
xrpl.protocol > xrpl.json xrpl.protocol > xrpl.json

View File

@@ -90,6 +90,11 @@ set_target_properties(OpenSSL::SSL PROPERTIES
INTERFACE_COMPILE_DEFINITIONS OPENSSL_NO_SSL2 INTERFACE_COMPILE_DEFINITIONS OPENSSL_NO_SSL2
) )
set(SECP256K1_INSTALL TRUE) set(SECP256K1_INSTALL TRUE)
set(SECP256K1_BUILD_BENCHMARK FALSE)
set(SECP256K1_BUILD_TESTS FALSE)
set(SECP256K1_BUILD_EXHAUSTIVE_TESTS FALSE)
set(SECP256K1_BUILD_CTIME_TESTS FALSE)
set(SECP256K1_BUILD_EXAMPLES FALSE)
add_subdirectory(external/secp256k1) add_subdirectory(external/secp256k1)
add_library(secp256k1::secp256k1 ALIAS secp256k1) add_library(secp256k1::secp256k1 ALIAS secp256k1)
add_subdirectory(external/ed25519-donna) add_subdirectory(external/ed25519-donna)
@@ -144,3 +149,8 @@ set(PROJECT_EXPORT_SET RippleExports)
include(RippledCore) include(RippledCore)
include(RippledInstall) include(RippledInstall)
include(RippledValidatorKeys) include(RippledValidatorKeys)
if(tests)
include(CTest)
add_subdirectory(src/tests/libxrpl)
endif()

View File

@@ -1,3 +1,5 @@
[![codecov](https://codecov.io/gh/XRPLF/rippled/graph/badge.svg?token=WyFr5ajq3O)](https://codecov.io/gh/XRPLF/rippled)
# The XRP Ledger # The XRP Ledger
The [XRP Ledger](https://xrpl.org/) is a decentralized cryptographic ledger powered by a network of peer-to-peer nodes. The XRP Ledger uses a novel Byzantine Fault Tolerant consensus algorithm to settle and record transactions in a secure distributed database without a central operator. The [XRP Ledger](https://xrpl.org/) is a decentralized cryptographic ledger powered by a network of peer-to-peer nodes. The XRP Ledger uses a novel Byzantine Fault Tolerant consensus algorithm to settle and record transactions in a secure distributed database without a central operator.

File diff suppressed because it is too large Load Diff

View File

@@ -83,7 +83,7 @@ To report a qualifying bug, please send a detailed report to:
|Long Key ID | `0xCD49A0AFC57929BE` | |Long Key ID | `0xCD49A0AFC57929BE` |
|Fingerprint | `24E6 3B02 37E0 FA9C 5E96 8974 CD49 A0AF C579 29BE` | |Fingerprint | `24E6 3B02 37E0 FA9C 5E96 8974 CD49 A0AF C579 29BE` |
The full PGP key for this address, which is also available on several key servers (e.g. on [keys.gnupg.net](https://keys.gnupg.net)), is: The full PGP key for this address, which is also available on several key servers (e.g. on [keyserver.ubuntu.com](https://keyserver.ubuntu.com)), is:
``` ```
-----BEGIN PGP PUBLIC KEY BLOCK----- -----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFUwGHYBEAC0wpGpBPkd8W1UdQjg9+cEFzeIEJRaoZoeuJD8mofwI5Ejnjdt mQINBFUwGHYBEAC0wpGpBPkd8W1UdQjg9+cEFzeIEJRaoZoeuJD8mofwI5Ejnjdt

View File

@@ -53,9 +53,9 @@ set(download_script "${CMAKE_BINARY_DIR}/docs/download-cppreference.cmake")
file(WRITE file(WRITE
"${download_script}" "${download_script}"
"file(DOWNLOAD \ "file(DOWNLOAD \
http://upload.cppreference.com/mwiki/images/b/b2/html_book_20190607.zip \ https://github.com/PeterFeicht/cppreference-doc/releases/download/v20250209/html-book-20250209.zip \
${CMAKE_BINARY_DIR}/docs/cppreference.zip \ ${CMAKE_BINARY_DIR}/docs/cppreference.zip \
EXPECTED_HASH MD5=82b3a612d7d35a83e3cb1195a63689ab \ EXPECTED_HASH MD5=bda585f72fbca4b817b29a3d5746567b \
)\n \ )\n \
execute_process( \ execute_process( \
COMMAND \"${CMAKE_COMMAND}\" -E tar -xf cppreference.zip \ COMMAND \"${CMAKE_COMMAND}\" -E tar -xf cppreference.zip \

View File

@@ -2,16 +2,6 @@
convenience variables and sanity checks convenience variables and sanity checks
#]===================================================================] #]===================================================================]
include(ProcessorCount)
if (NOT ep_procs)
ProcessorCount(ep_procs)
if (ep_procs GREATER 1)
# never use more than half of cores for EP builds
math (EXPR ep_procs "${ep_procs} / 2")
message (STATUS "Using ${ep_procs} cores for ExternalProject builds.")
endif ()
endif ()
get_property(is_multiconfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(is_multiconfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE) set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)

View File

@@ -18,7 +18,7 @@ if(tests)
endif() endif()
endif() endif()
option(unity "Creates a build using UNITY support in cmake. This is the default" ON) option(unity "Creates a build using UNITY support in cmake." OFF)
if(unity) if(unity)
if(NOT is_ci) if(NOT is_ci)
set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "") set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")

View File

@@ -2,7 +2,6 @@ find_package(Boost 1.82 REQUIRED
COMPONENTS COMPONENTS
chrono chrono
container container
context
coroutine coroutine
date_time date_time
filesystem filesystem
@@ -24,7 +23,7 @@ endif()
target_link_libraries(ripple_boost target_link_libraries(ripple_boost
INTERFACE INTERFACE
Boost::boost Boost::headers
Boost::chrono Boost::chrono
Boost::container Boost::container
Boost::coroutine Boost::coroutine

41
cmake/xrpl_add_test.cmake Normal file
View File

@@ -0,0 +1,41 @@
include(isolate_headers)
function(xrpl_add_test name)
set(target ${PROJECT_NAME}.test.${name})
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/${name}/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp"
)
add_executable(${target} EXCLUDE_FROM_ALL ${ARGN} ${sources})
isolate_headers(
${target}
"${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/tests/${name}"
PRIVATE
)
# Make sure the test isn't optimized away in unity builds
set_target_properties(${target} PROPERTIES
UNITY_BUILD_MODE GROUP
UNITY_BUILD_BATCH_SIZE 0) # Adjust as needed
add_test(NAME ${target} COMMAND ${target})
set_tests_properties(
${target} PROPERTIES
FIXTURES_REQUIRED ${target}_fixture
)
add_test(
NAME ${target}.build
COMMAND
${CMAKE_COMMAND}
--build ${CMAKE_BINARY_DIR}
--config $<CONFIG>
--target ${target}
)
set_tests_properties(${target}.build PROPERTIES
FIXTURES_SETUP ${target}_fixture
)
endfunction()

19
conan/profiles/libxrpl Normal file
View File

@@ -0,0 +1,19 @@
{% set os = detect_api.detect_os() %}
{% set arch = detect_api.detect_arch() %}
{% set compiler, version, compiler_exe = detect_api.detect_default_compiler() %}
{% set compiler_version = version %}
{% if os == "Linux" %}
{% set compiler_version = detect_api.default_compiler_version(compiler, version) %}
{% endif %}
[settings]
os={{ os }}
arch={{ arch }}
compiler={{compiler}}
compiler.version={{ compiler_version }}
compiler.cppstd=20
{% if os == "Windows" %}
compiler.runtime=static
{% else %}
compiler.libcxx={{detect_api.detect_libcxx(compiler, version, compiler_exe)}}
{% endif %}

View File

@@ -1,4 +1,4 @@
from conan import ConanFile from conan import ConanFile, __version__ as conan_version
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
import re import re
@@ -24,18 +24,20 @@ class Xrpl(ConanFile):
} }
requires = [ requires = [
'date/3.0.3',
'grpc/1.50.1', 'grpc/1.50.1',
'libarchive/3.7.6', 'libarchive/3.8.1',
'nudb/2.0.8', 'nudb/2.0.9',
'openssl/1.1.1v', 'openssl/1.1.1w',
'soci/4.0.3', 'soci/4.0.3',
'xxhash/0.8.2',
'zlib/1.3.1', 'zlib/1.3.1',
] ]
test_requires = [
'doctest/2.4.11',
]
tool_requires = [ tool_requires = [
'protobuf/3.21.9', 'protobuf/3.21.12',
] ]
default_options = { default_options = {
@@ -87,26 +89,31 @@ class Xrpl(ConanFile):
} }
def set_version(self): def set_version(self):
path = f'{self.recipe_folder}/src/libxrpl/protocol/BuildInfo.cpp' if self.version is None:
regex = r'versionString\s?=\s?\"(.*)\"' path = f'{self.recipe_folder}/src/libxrpl/protocol/BuildInfo.cpp'
with open(path, 'r') as file: regex = r'versionString\s?=\s?\"(.*)\"'
matches = (re.search(regex, line) for line in file) with open(path, encoding='utf-8') as file:
match = next(m for m in matches if m) matches = (re.search(regex, line) for line in file)
self.version = match.group(1) match = next(m for m in matches if m)
self.version = match.group(1)
def configure(self): def configure(self):
if self.settings.compiler == 'apple-clang': if self.settings.compiler == 'apple-clang':
self.options['boost'].visibility = 'global' self.options['boost'].visibility = 'global'
def requirements(self): def requirements(self):
self.requires('boost/1.83.0', force=True) # Conan 2 requires transitive headers to be specified
transitive_headers_opt = {'transitive_headers': True} if conan_version.split('.')[0] == '2' else {}
self.requires('boost/1.83.0', force=True, **transitive_headers_opt)
self.requires('date/3.0.4', **transitive_headers_opt)
self.requires('lz4/1.10.0', force=True) self.requires('lz4/1.10.0', force=True)
self.requires('protobuf/3.21.9', force=True) self.requires('protobuf/3.21.12', force=True)
self.requires('sqlite3/3.47.0', force=True) self.requires('sqlite3/3.49.1', force=True)
if self.options.jemalloc: if self.options.jemalloc:
self.requires('jemalloc/5.3.0') self.requires('jemalloc/5.3.0')
if self.options.rocksdb: if self.options.rocksdb:
self.requires('rocksdb/9.7.3') self.requires('rocksdb/9.7.3')
self.requires('xxhash/0.8.3', **transitive_headers_opt)
exports_sources = ( exports_sources = (
'CMakeLists.txt', 'CMakeLists.txt',
@@ -136,6 +143,8 @@ class Xrpl(ConanFile):
tc.variables['static'] = self.options.static tc.variables['static'] = self.options.static
tc.variables['unity'] = self.options.unity tc.variables['unity'] = self.options.unity
tc.variables['xrpld'] = self.options.xrpld tc.variables['xrpld'] = self.options.xrpld
if self.settings.compiler == 'clang' and self.settings.compiler.version == 16:
tc.extra_cxxflags = ["-DBOOST_ASIO_DISABLE_CONCEPTS"]
tc.generate() tc.generate()
def build(self): def build(self):
@@ -161,7 +170,17 @@ class Xrpl(ConanFile):
# `include/`, not `include/ripple/proto/`. # `include/`, not `include/ripple/proto/`.
libxrpl.includedirs = ['include', 'include/ripple/proto'] libxrpl.includedirs = ['include', 'include/ripple/proto']
libxrpl.requires = [ libxrpl.requires = [
'boost::boost', 'boost::headers',
'boost::chrono',
'boost::container',
'boost::coroutine',
'boost::date_time',
'boost::filesystem',
'boost::json',
'boost::program_options',
'boost::regex',
'boost::system',
'boost::thread',
'date::date', 'date::date',
'grpc::grpc++', 'grpc::grpc++',
'libarchive::libarchive', 'libarchive::libarchive',

View File

@@ -23,7 +23,7 @@ direction.
``` ```
apt update apt update
apt install --yes curl git libssl-dev python3.10-dev python3-pip make g++-11 libprotobuf-dev protobuf-compiler apt install --yes curl git libssl-dev pipx python3.10-dev python3-pip make g++-11 libprotobuf-dev protobuf-compiler
curl --location --remote-name \ curl --location --remote-name \
"https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1.tar.gz" "https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1.tar.gz"
@@ -35,7 +35,8 @@ make --jobs $(nproc)
make install make install
cd .. cd ..
pip3 install 'conan<2' pipx install 'conan<2'
pipx ensurepath
``` ```
[1]: https://github.com/thejohnfreeman/rippled-docker/blob/master/ubuntu-22.04/install.sh [1]: https://github.com/thejohnfreeman/rippled-docker/blob/master/ubuntu-22.04/install.sh

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.25) cmake_minimum_required(VERSION 3.18)
# Note, version set explicitly by rippled project # Note, version set explicitly by rippled project
project(antithesis-sdk-cpp VERSION 0.4.4 LANGUAGES CXX) project(antithesis-sdk-cpp VERSION 0.4.4 LANGUAGES CXX)

View File

@@ -1,10 +0,0 @@
sources:
"2.0.8":
url: "https://github.com/CPPAlliance/NuDB/archive/2.0.8.tar.gz"
sha256: "9b71903d8ba111cd893ab064b9a8b6ac4124ed8bd6b4f67250205bc43c7f13a8"
patches:
"2.0.8":
- patch_file: "patches/2.0.8-0001-add-include-stdexcept-for-msvc.patch"
patch_description: "Fix build for MSVC by including stdexcept"
patch_type: "portability"
patch_source: "https://github.com/cppalliance/NuDB/pull/100/files"

View File

@@ -1,72 +0,0 @@
import os
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
from conan.tools.layout import basic_layout
required_conan_version = ">=1.52.0"
class NudbConan(ConanFile):
name = "nudb"
description = "A fast key/value insert-only database for SSD drives in C++11"
license = "BSL-1.0"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/CPPAlliance/NuDB"
topics = ("header-only", "KVS", "insert-only")
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True
@property
def _min_cppstd(self):
return 11
def export_sources(self):
export_conandata_patches(self)
def layout(self):
basic_layout(self, src_folder="src")
def requirements(self):
self.requires("boost/1.83.0")
def package_id(self):
self.info.clear()
def validate(self):
if self.settings.compiler.cppstd:
check_min_cppstd(self, self._min_cppstd)
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def build(self):
apply_conandata_patches(self)
def package(self):
copy(self, "LICENSE*",
dst=os.path.join(self.package_folder, "licenses"),
src=self.source_folder)
copy(self, "*",
dst=os.path.join(self.package_folder, "include"),
src=os.path.join(self.source_folder, "include"))
def package_info(self):
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
self.cpp_info.set_property("cmake_target_name", "NuDB")
self.cpp_info.set_property("cmake_target_aliases", ["NuDB::nudb"])
self.cpp_info.set_property("cmake_find_mode", "both")
self.cpp_info.components["core"].set_property("cmake_target_name", "nudb")
self.cpp_info.components["core"].names["cmake_find_package"] = "nudb"
self.cpp_info.components["core"].names["cmake_find_package_multi"] = "nudb"
self.cpp_info.components["core"].requires = ["boost::thread", "boost::system"]
# TODO: to remove in conan v2 once cmake_find_package_* generators removed
self.cpp_info.names["cmake_find_package"] = "NuDB"
self.cpp_info.names["cmake_find_package_multi"] = "NuDB"

View File

@@ -1,24 +0,0 @@
diff --git a/include/nudb/detail/stream.hpp b/include/nudb/detail/stream.hpp
index 6c07bf1..e0ce8ed 100644
--- a/include/nudb/detail/stream.hpp
+++ b/include/nudb/detail/stream.hpp
@@ -14,6 +14,7 @@
#include <cstdint>
#include <cstring>
#include <memory>
+#include <stdexcept>
namespace nudb {
namespace detail {
diff --git a/include/nudb/impl/context.ipp b/include/nudb/impl/context.ipp
index beb7058..ffde0b3 100644
--- a/include/nudb/impl/context.ipp
+++ b/include/nudb/impl/context.ipp
@@ -9,6 +9,7 @@
#define NUDB_IMPL_CONTEXT_IPP
#include <nudb/detail/store_base.hpp>
+#include <stdexcept>
namespace nudb {

View File

@@ -25,6 +25,7 @@
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
#include <memory>
namespace ripple { namespace ripple {

View File

@@ -22,8 +22,18 @@
#include <xrpl/basics/contract.h> #include <xrpl/basics/contract.h>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#include <boost/outcome.hpp> #include <boost/outcome.hpp>
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#include <stdexcept> #include <stdexcept>
namespace ripple { namespace ripple {

View File

@@ -29,7 +29,6 @@
#include <array> #include <array>
#include <cstdint> #include <cstdint>
#include <optional> #include <optional>
#include <sstream>
#include <string> #include <string>
namespace ripple { namespace ripple {

View File

@@ -20,7 +20,6 @@
#ifndef RIPPLE_ALGORITHM_H_INCLUDED #ifndef RIPPLE_ALGORITHM_H_INCLUDED
#define RIPPLE_ALGORITHM_H_INCLUDED #define RIPPLE_ALGORITHM_H_INCLUDED
#include <iterator>
#include <utility> #include <utility>
namespace ripple { namespace ripple {

View File

@@ -24,12 +24,8 @@
#include <xrpl/beast/hash/xxhasher.h> #include <xrpl/beast/hash/xxhasher.h>
#include <cstdint> #include <cstdint>
#include <functional>
#include <mutex> #include <mutex>
#include <random> #include <random>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility> #include <utility>
namespace ripple { namespace ripple {

View File

@@ -23,7 +23,6 @@
#include <cstdint> #include <cstdint>
#include <limits> #include <limits>
#include <optional> #include <optional>
#include <utility>
namespace ripple { namespace ripple {
auto constexpr muldiv_max = std::numeric_limits<std::uint64_t>::max(); auto constexpr muldiv_max = std::numeric_limits<std::uint64_t>::max();

View File

@@ -24,10 +24,8 @@
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include <functional>
#include <iostream> #include <iostream>
#include <type_traits> #include <type_traits>
#include <utility>
namespace ripple { namespace ripple {

View File

@@ -20,9 +20,6 @@
#ifndef BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED #ifndef BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED
#define BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED #define BEAST_CHRONO_ABSTRACT_CLOCK_H_INCLUDED
#include <chrono>
#include <string>
namespace beast { namespace beast {
/** Abstract interface to a clock. /** Abstract interface to a clock.

View File

@@ -23,6 +23,8 @@
#include <xrpl/beast/clock/abstract_clock.h> #include <xrpl/beast/clock/abstract_clock.h>
#include <xrpl/beast/utility/instrumentation.h> #include <xrpl/beast/utility/instrumentation.h>
#include <chrono>
namespace beast { namespace beast {
/** Manual clock implementation. /** Manual clock implementation.

View File

@@ -22,6 +22,7 @@
#include <xrpl/beast/container/aged_container.h> #include <xrpl/beast/container/aged_container.h>
#include <chrono>
#include <type_traits> #include <type_traits>
namespace beast { namespace beast {

View File

@@ -20,8 +20,6 @@
#ifndef BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED #ifndef BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
#define BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED #define BEAST_CONTAINER_DETAIL_AGED_ASSOCIATIVE_CONTAINER_H_INCLUDED
#include <type_traits>
namespace beast { namespace beast {
namespace detail { namespace detail {

View File

@@ -33,7 +33,6 @@
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
#include <initializer_list> #include <initializer_list>
#include <iterator>
#include <memory> #include <memory>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>

View File

@@ -29,11 +29,9 @@
#include <charconv> #include <charconv>
#include <cstdlib> #include <cstdlib>
#include <iterator> #include <iterator>
#include <limits>
#include <string> #include <string>
#include <type_traits> #include <type_traits>
#include <typeinfo> #include <typeinfo>
#include <utility>
namespace beast { namespace beast {

View File

@@ -24,14 +24,36 @@
#include <boost/container/flat_set.hpp> #include <boost/container/flat_set.hpp>
#include <boost/endian/conversion.hpp> #include <boost/endian/conversion.hpp>
/*
Workaround for overzealous clang warning, which trips on libstdc++ headers
In file included from
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:61:
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tempbuf.h:263:8:
error: 'get_temporary_buffer<std::pair<ripple::Quality, const
std::vector<std::unique_ptr<ripple::Step>> *>>' is deprecated
[-Werror,-Wdeprecated-declarations] 263 |
std::get_temporary_buffer<value_type>(_M_original_len));
^
*/
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#include <functional>
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#include <array> #include <array>
#include <chrono> #include <chrono>
#include <cstdint>
#include <cstring> #include <cstring>
#include <functional>
#include <map>
#include <memory> #include <memory>
#include <set>
#include <string> #include <string>
#include <system_error> #include <system_error>
#include <tuple> #include <tuple>

View File

@@ -30,7 +30,7 @@ namespace beast {
template <class Hasher = xxhasher> template <class Hasher = xxhasher>
struct uhash struct uhash
{ {
explicit uhash() = default; uhash() = default;
using result_type = typename Hasher::result_type; using result_type = typename Hasher::result_type;

View File

@@ -29,11 +29,7 @@
#include <boost/asio/ip/address.hpp> #include <boost/asio/ip/address.hpp>
#include <boost/functional/hash.hpp> #include <boost/functional/hash.hpp>
#include <cstdint>
#include <ios>
#include <sstream>
#include <string> #include <string>
#include <typeinfo>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@@ -24,12 +24,6 @@
#include <boost/asio/ip/address_v4.hpp> #include <boost/asio/ip/address_v4.hpp>
#include <cstdint>
#include <functional>
#include <ios>
#include <string>
#include <utility>
namespace beast { namespace beast {
namespace IP { namespace IP {

View File

@@ -24,12 +24,6 @@
#include <boost/asio/ip/address_v6.hpp> #include <boost/asio/ip/address_v6.hpp>
#include <cstdint>
#include <functional>
#include <ios>
#include <string>
#include <utility>
namespace beast { namespace beast {
namespace IP { namespace IP {

View File

@@ -25,7 +25,6 @@
#include <xrpl/beast/net/IPAddress.h> #include <xrpl/beast/net/IPAddress.h>
#include <cstdint> #include <cstdint>
#include <ios>
#include <optional> #include <optional>
#include <string> #include <string>
@@ -215,7 +214,7 @@ namespace std {
template <> template <>
struct hash<::beast::IP::Endpoint> struct hash<::beast::IP::Endpoint>
{ {
explicit hash() = default; hash() = default;
std::size_t std::size_t
operator()(::beast::IP::Endpoint const& endpoint) const operator()(::beast::IP::Endpoint const& endpoint) const
@@ -230,7 +229,7 @@ namespace boost {
template <> template <>
struct hash<::beast::IP::Endpoint> struct hash<::beast::IP::Endpoint>
{ {
explicit hash() = default; hash() = default;
std::size_t std::size_t
operator()(::beast::IP::Endpoint const& endpoint) const operator()(::beast::IP::Endpoint const& endpoint) const

View File

@@ -28,10 +28,8 @@
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>
#include <cstdint>
#include <iterator> #include <iterator>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
namespace beast { namespace beast {

View File

@@ -13,7 +13,6 @@
#include <boost/optional.hpp> #include <boost/optional.hpp>
#include <condition_variable> #include <condition_variable>
#include <functional>
#include <mutex> #include <mutex>
#include <thread> #include <thread>
#include <vector> #include <vector>

View File

@@ -16,7 +16,6 @@
#include <algorithm> #include <algorithm>
#include <chrono> #include <chrono>
#include <functional>
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>

View File

@@ -13,7 +13,6 @@
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <mutex> #include <mutex>
#include <ostream>
#include <string> #include <string>
namespace beast { namespace beast {

View File

@@ -48,8 +48,10 @@ rngfill(void* buffer, std::size_t bytes, Generator& g)
#ifdef __GNUC__ #ifdef __GNUC__
// gcc 11.1 (falsely) warns about an array-bounds overflow in release mode. // gcc 11.1 (falsely) warns about an array-bounds overflow in release mode.
// gcc 12.1 (also falsely) warns about an string overflow in release mode.
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif #endif
if (bytes > 0) if (bytes > 0)

View File

@@ -26,7 +26,6 @@
#include <cstring> #include <cstring>
#include <map> #include <map>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
/** \brief JSON (JavaScript Object Notation). /** \brief JSON (JavaScript Object Notation).

View File

@@ -29,7 +29,6 @@
#include <xrpl/protocol/json_get_or_throw.h> #include <xrpl/protocol/json_get_or_throw.h>
#include <cstddef> #include <cstddef>
#include <mutex>
#include <optional> #include <optional>
#include <string> #include <string>
@@ -149,7 +148,7 @@ namespace std {
template <> template <>
struct hash<ripple::AccountID> : ripple::AccountID::hasher struct hash<ripple::AccountID> : ripple::AccountID::hasher
{ {
explicit hash() = default; hash() = default;
}; };
} // namespace std } // namespace std

View File

@@ -20,7 +20,6 @@
#ifndef RIPPLE_PROTOCOL_APIVERSION_H_INCLUDED #ifndef RIPPLE_PROTOCOL_APIVERSION_H_INCLUDED
#define RIPPLE_PROTOCOL_APIVERSION_H_INCLUDED #define RIPPLE_PROTOCOL_APIVERSION_H_INCLUDED
#include <functional>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>

View File

@@ -0,0 +1,37 @@
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2024 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.
*/
//==============================================================================
#include <xrpl/protocol/HashPrefix.h>
#include <xrpl/protocol/STVector256.h>
#include <xrpl/protocol/Serializer.h>
namespace ripple {
inline void
serializeBatch(
Serializer& msg,
std::uint32_t const& flags,
std::vector<uint256> const& txids)
{
msg.add32(HashPrefix::batch);
msg.add32(flags);
msg.add32(std::uint32_t(txids.size()));
for (auto const& txid : txids)
msg.addBitString(txid);
}
} // namespace ripple

View File

@@ -21,6 +21,7 @@
#define RIPPLE_PROTOCOL_BOOK_H_INCLUDED #define RIPPLE_PROTOCOL_BOOK_H_INCLUDED
#include <xrpl/basics/CountedObject.h> #include <xrpl/basics/CountedObject.h>
#include <xrpl/basics/base_uint.h>
#include <xrpl/protocol/Issue.h> #include <xrpl/protocol/Issue.h>
#include <boost/utility/base_from_member.hpp> #include <boost/utility/base_from_member.hpp>
@@ -36,12 +37,17 @@ class Book final : public CountedObject<Book>
public: public:
Issue in; Issue in;
Issue out; Issue out;
std::optional<uint256> domain;
Book() Book()
{ {
} }
Book(Issue const& in_, Issue const& out_) : in(in_), out(out_) Book(
Issue const& in_,
Issue const& out_,
std::optional<uint256> const& domain_)
: in(in_), out(out_), domain(domain_)
{ {
} }
}; };
@@ -61,6 +67,8 @@ hash_append(Hasher& h, Book const& b)
{ {
using beast::hash_append; using beast::hash_append;
hash_append(h, b.in, b.out); hash_append(h, b.in, b.out);
if (b.domain)
hash_append(h, *(b.domain));
} }
Book Book
@@ -71,7 +79,8 @@ reversed(Book const& book);
[[nodiscard]] inline constexpr bool [[nodiscard]] inline constexpr bool
operator==(Book const& lhs, Book const& rhs) operator==(Book const& lhs, Book const& rhs)
{ {
return (lhs.in == rhs.in) && (lhs.out == rhs.out); return (lhs.in == rhs.in) && (lhs.out == rhs.out) &&
(lhs.domain == rhs.domain);
} }
/** @} */ /** @} */
@@ -82,7 +91,18 @@ operator<=>(Book const& lhs, Book const& rhs)
{ {
if (auto const c{lhs.in <=> rhs.in}; c != 0) if (auto const c{lhs.in <=> rhs.in}; c != 0)
return c; return c;
return lhs.out <=> rhs.out; if (auto const c{lhs.out <=> rhs.out}; c != 0)
return c;
// Manually compare optionals
if (lhs.domain && rhs.domain)
return *lhs.domain <=> *rhs.domain; // Compare values if both exist
if (!lhs.domain && rhs.domain)
return std::weak_ordering::less; // Empty is considered less
if (lhs.domain && !rhs.domain)
return std::weak_ordering::greater; // Non-empty is greater
return std::weak_ordering::equivalent; // Both are empty
} }
/** @} */ /** @} */
@@ -104,7 +124,7 @@ private:
boost::base_from_member<std::hash<ripple::AccountID>, 1>; boost::base_from_member<std::hash<ripple::AccountID>, 1>;
public: public:
explicit hash() = default; hash() = default;
using value_type = std::size_t; using value_type = std::size_t;
using argument_type = ripple::Issue; using argument_type = ripple::Issue;
@@ -126,12 +146,14 @@ template <>
struct hash<ripple::Book> struct hash<ripple::Book>
{ {
private: private:
using hasher = std::hash<ripple::Issue>; using issue_hasher = std::hash<ripple::Issue>;
using uint256_hasher = ripple::uint256::hasher;
hasher m_hasher; issue_hasher m_issue_hasher;
uint256_hasher m_uint256_hasher;
public: public:
explicit hash() = default; hash() = default;
using value_type = std::size_t; using value_type = std::size_t;
using argument_type = ripple::Book; using argument_type = ripple::Book;
@@ -139,8 +161,12 @@ public:
value_type value_type
operator()(argument_type const& value) const operator()(argument_type const& value) const
{ {
value_type result(m_hasher(value.in)); value_type result(m_issue_hasher(value.in));
boost::hash_combine(result, m_hasher(value.out)); boost::hash_combine(result, m_issue_hasher(value.out));
if (value.domain)
boost::hash_combine(result, m_uint256_hasher(*value.domain));
return result; return result;
} }
}; };
@@ -154,7 +180,7 @@ namespace boost {
template <> template <>
struct hash<ripple::Issue> : std::hash<ripple::Issue> struct hash<ripple::Issue> : std::hash<ripple::Issue>
{ {
explicit hash() = default; hash() = default;
using Base = std::hash<ripple::Issue>; using Base = std::hash<ripple::Issue>;
// VFALCO NOTE broken in vs2012 // VFALCO NOTE broken in vs2012
@@ -164,7 +190,7 @@ struct hash<ripple::Issue> : std::hash<ripple::Issue>
template <> template <>
struct hash<ripple::Book> : std::hash<ripple::Book> struct hash<ripple::Book> : std::hash<ripple::Book>
{ {
explicit hash() = default; hash() = default;
using Base = std::hash<ripple::Book>; using Base = std::hash<ripple::Book>;
// VFALCO NOTE broken in vs2012 // VFALCO NOTE broken in vs2012

View File

@@ -154,7 +154,10 @@ enum error_code_i {
// Simulate // Simulate
rpcTX_SIGNED = 96, rpcTX_SIGNED = 96,
rpcLAST = rpcTX_SIGNED // rpcLAST should always equal the last code. // Pathfinding
rpcDOMAIN_MALFORMED = 97,
rpcLAST = rpcDOMAIN_MALFORMED // rpcLAST should always equal the last code.
}; };
/** Codes returned in the `warnings` array of certain RPC commands. /** Codes returned in the `warnings` array of certain RPC commands.
@@ -166,6 +169,8 @@ enum warning_code_i {
warnRPC_AMENDMENT_BLOCKED = 1002, warnRPC_AMENDMENT_BLOCKED = 1002,
warnRPC_EXPIRED_VALIDATOR_LIST = 1003, warnRPC_EXPIRED_VALIDATOR_LIST = 1003,
// unused = 1004 // unused = 1004
warnRPC_FIELDS_DEPRECATED = 2004, // rippled needs to maintain
// compatibility with Clio on this code.
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@@ -24,7 +24,6 @@
#include <boost/container/flat_map.hpp> #include <boost/container/flat_map.hpp>
#include <array>
#include <bitset> #include <bitset>
#include <map> #include <map>
#include <optional> #include <optional>
@@ -55,6 +54,18 @@
* `VoteBehavior::DefaultYes`. The communication process is beyond * `VoteBehavior::DefaultYes`. The communication process is beyond
* the scope of these instructions. * the scope of these instructions.
* *
* 5) A feature marked as Obsolete can mean either:
* 1) It is in the ledger (marked as Supported::yes) and it is on its way to
* become Retired
* 2) The feature is not in the ledger (has always been marked as
* Supported::no) and the code to support it has been removed
*
* If we want to discontinue a feature that we've never fully supported and
* the feature has never been enabled, we should remove all the related
* code, and mark the feature as "abandoned". To do this:
*
* 1) Open features.macro, move the feature to the abandoned section and
* change the macro to XRPL_ABANDON
* *
* When a feature has been enabled for several years, the conditional code * When a feature has been enabled for several years, the conditional code
* may be removed, and the feature "retired". To retire a feature: * may be removed, and the feature "retired". To retire a feature:
@@ -88,10 +99,13 @@ namespace detail {
#undef XRPL_FIX #undef XRPL_FIX
#pragma push_macro("XRPL_RETIRE") #pragma push_macro("XRPL_RETIRE")
#undef XRPL_RETIRE #undef XRPL_RETIRE
#pragma push_macro("XRPL_ABANDON")
#undef XRPL_ABANDON
#define XRPL_FEATURE(name, supported, vote) +1 #define XRPL_FEATURE(name, supported, vote) +1
#define XRPL_FIX(name, supported, vote) +1 #define XRPL_FIX(name, supported, vote) +1
#define XRPL_RETIRE(name) +1 #define XRPL_RETIRE(name) +1
#define XRPL_ABANDON(name) +1
// This value SHOULD be equal to the number of amendments registered in // This value SHOULD be equal to the number of amendments registered in
// Feature.cpp. Because it's only used to reserve storage, and determine how // Feature.cpp. Because it's only used to reserve storage, and determine how
@@ -108,6 +122,8 @@ static constexpr std::size_t numFeatures =
#pragma pop_macro("XRPL_FIX") #pragma pop_macro("XRPL_FIX")
#undef XRPL_FEATURE #undef XRPL_FEATURE
#pragma pop_macro("XRPL_FEATURE") #pragma pop_macro("XRPL_FEATURE")
#undef XRPL_ABANDON
#pragma pop_macro("XRPL_ABANDON")
/** Amendments that this server supports and the default voting behavior. /** Amendments that this server supports and the default voting behavior.
Whether they are enabled depends on the Rules defined in the validated Whether they are enabled depends on the Rules defined in the validated
@@ -349,10 +365,13 @@ foreachFeature(FeatureBitset bs, F&& f)
#undef XRPL_FIX #undef XRPL_FIX
#pragma push_macro("XRPL_RETIRE") #pragma push_macro("XRPL_RETIRE")
#undef XRPL_RETIRE #undef XRPL_RETIRE
#pragma push_macro("XRPL_ABANDON")
#undef XRPL_ABANDON
#define XRPL_FEATURE(name, supported, vote) extern uint256 const feature##name; #define XRPL_FEATURE(name, supported, vote) extern uint256 const feature##name;
#define XRPL_FIX(name, supported, vote) extern uint256 const fix##name; #define XRPL_FIX(name, supported, vote) extern uint256 const fix##name;
#define XRPL_RETIRE(name) #define XRPL_RETIRE(name)
#define XRPL_ABANDON(name)
#include <xrpl/protocol/detail/features.macro> #include <xrpl/protocol/detail/features.macro>
@@ -362,6 +381,8 @@ foreachFeature(FeatureBitset bs, F&& f)
#pragma pop_macro("XRPL_FIX") #pragma pop_macro("XRPL_FIX")
#undef XRPL_FEATURE #undef XRPL_FEATURE
#pragma pop_macro("XRPL_FEATURE") #pragma pop_macro("XRPL_FEATURE")
#undef XRPL_ABANDON
#pragma pop_macro("XRPL_ABANDON")
} // namespace ripple } // namespace ripple

View File

@@ -88,6 +88,9 @@ enum class HashPrefix : std::uint32_t {
/** Credentials signature */ /** Credentials signature */
credential = detail::make_hash_prefix('C', 'R', 'D'), credential = detail::make_hash_prefix('C', 'R', 'D'),
/** Batch */
batch = detail::make_hash_prefix('B', 'C', 'H'),
}; };
template <class Hasher> template <class Hasher>

View File

@@ -98,6 +98,12 @@ public:
static IOUAmount static IOUAmount
minPositiveAmount(); minPositiveAmount();
friend std::ostream&
operator<<(std::ostream& os, IOUAmount const& x)
{
return os << to_string(x);
}
}; };
inline IOUAmount::IOUAmount(beast::Zero) inline IOUAmount::IOUAmount(beast::Zero)

View File

@@ -32,6 +32,7 @@
#include <xrpl/protocol/jss.h> #include <xrpl/protocol/jss.h>
#include <cstdint> #include <cstdint>
#include <set>
namespace ripple { namespace ripple {

View File

@@ -24,9 +24,6 @@
#include <xrpl/json/json_value.h> #include <xrpl/json/json_value.h>
#include <xrpl/protocol/UintTypes.h> #include <xrpl/protocol/UintTypes.h>
#include <functional>
#include <type_traits>
namespace ripple { namespace ripple {
/** A currency issued by an account. /** A currency issued by an account.

View File

@@ -145,13 +145,15 @@ enum LedgerSpecificFlags {
0x10000000, // True, reject new paychans 0x10000000, // True, reject new paychans
lsfDisallowIncomingTrustline = lsfDisallowIncomingTrustline =
0x20000000, // True, reject new trustlines (only if no issued assets) 0x20000000, // True, reject new trustlines (only if no issued assets)
// 0x40000000 is available lsfAllowTrustLineLocking =
0x40000000, // True, enable trustline locking
lsfAllowTrustLineClawback = lsfAllowTrustLineClawback =
0x80000000, // True, enable clawback 0x80000000, // True, enable clawback
// ltOFFER // ltOFFER
lsfPassive = 0x00010000, lsfPassive = 0x00010000,
lsfSell = 0x00020000, // True, offer was placed as a sell. lsfSell = 0x00020000, // True, offer was placed as a sell.
lsfHybrid = 0x00040000, // True, offer is hybrid.
// ltRIPPLE_STATE // ltRIPPLE_STATE
lsfLowReserve = 0x00010000, // True, if entry counts toward reserve. lsfLowReserve = 0x00010000, // True, if entry counts toward reserve.

View File

@@ -28,7 +28,6 @@
#include <concepts> #include <concepts>
#include <cstdlib> #include <cstdlib>
#include <functional> #include <functional>
#include <limits>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>

View File

@@ -28,6 +28,8 @@
namespace ripple { namespace ripple {
namespace RPC {
/** /**
Adds common synthetic fields to transaction-related JSON responses Adds common synthetic fields to transaction-related JSON responses
@@ -40,6 +42,7 @@ insertNFTSyntheticInJson(
TxMeta const&); TxMeta const&);
/** @} */ /** @} */
} // namespace RPC
} // namespace ripple } // namespace ripple
#endif #endif

View File

@@ -25,7 +25,6 @@
#include <optional> #include <optional>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <unordered_set>
namespace ripple { namespace ripple {
/** /**

View File

@@ -171,6 +171,9 @@ std::size_t constexpr maxTrim = 25;
*/ */
std::size_t constexpr permissionMaxSize = 10; std::size_t constexpr permissionMaxSize = 10;
/** The maximum number of transactions that can be in a batch. */
std::size_t constexpr maxBatchTxCount = 8;
} // namespace ripple } // namespace ripple
#endif #endif

View File

@@ -32,7 +32,6 @@
#include <cstring> #include <cstring>
#include <optional> #include <optional>
#include <ostream> #include <ostream>
#include <utility>
namespace ripple { namespace ripple {

View File

@@ -28,6 +28,9 @@
namespace ripple { namespace ripple {
bool
isFeatureEnabled(uint256 const& feature);
class DigestAwareReadView; class DigestAwareReadView;
/** Rules controlling protocol behavior. */ /** Rules controlling protocol behavior. */

View File

@@ -25,7 +25,6 @@
#include <functional> #include <functional>
#include <initializer_list> #include <initializer_list>
#include <memory>
#include <stdexcept> #include <stdexcept>
namespace ripple { namespace ripple {

View File

@@ -703,6 +703,12 @@ isXRP(STAmount const& amount)
return amount.native(); return amount.native();
} }
bool
canAdd(STAmount const& amt1, STAmount const& amt2);
bool
canSubtract(STAmount const& amt1, STAmount const& amt2);
// Since `canonicalize` does not have access to a ledger, this is needed to put // Since `canonicalize` does not have access to a ledger, this is needed to put
// the low-level routine stAmountCanonicalize on an amendment switch. Only // the low-level routine stAmountCanonicalize on an amendment switch. Only
// transactions need to use this switchover. Outside of a transaction it's safe // transactions need to use this switchover. Outside of a transaction it's safe

View File

@@ -24,7 +24,6 @@
#include <xrpl/protocol/SField.h> #include <xrpl/protocol/SField.h>
#include <xrpl/protocol/Serializer.h> #include <xrpl/protocol/Serializer.h>
#include <memory>
#include <ostream> #include <ostream>
#include <string> #include <string>
#include <type_traits> #include <type_traits>

View File

@@ -27,7 +27,6 @@
#include <xrpl/protocol/STBase.h> #include <xrpl/protocol/STBase.h>
#include <cstring> #include <cstring>
#include <memory>
namespace ripple { namespace ripple {

View File

@@ -125,10 +125,16 @@ public:
@return `true` if valid signature. If invalid, the error message string. @return `true` if valid signature. If invalid, the error message string.
*/ */
enum class RequireFullyCanonicalSig : bool { no, yes }; enum class RequireFullyCanonicalSig : bool { no, yes };
Expected<void, std::string> Expected<void, std::string>
checkSign(RequireFullyCanonicalSig requireCanonicalSig, Rules const& rules) checkSign(RequireFullyCanonicalSig requireCanonicalSig, Rules const& rules)
const; const;
Expected<void, std::string>
checkBatchSign(
RequireFullyCanonicalSig requireCanonicalSig,
Rules const& rules) const;
// SQL Functions with metadata. // SQL Functions with metadata.
static std::string const& static std::string const&
getMetaSQLInsertReplaceHeader(); getMetaSQLInsertReplaceHeader();
@@ -144,6 +150,9 @@ public:
char status, char status,
std::string const& escapedMetaData) const; std::string const& escapedMetaData) const;
std::vector<uint256>
getBatchTransactionIDs() const;
private: private:
Expected<void, std::string> Expected<void, std::string>
checkSingleSign(RequireFullyCanonicalSig requireCanonicalSig) const; checkSingleSign(RequireFullyCanonicalSig requireCanonicalSig) const;
@@ -153,12 +162,24 @@ private:
RequireFullyCanonicalSig requireCanonicalSig, RequireFullyCanonicalSig requireCanonicalSig,
Rules const& rules) const; Rules const& rules) const;
Expected<void, std::string>
checkBatchSingleSign(
STObject const& batchSigner,
RequireFullyCanonicalSig requireCanonicalSig) const;
Expected<void, std::string>
checkBatchMultiSign(
STObject const& batchSigner,
RequireFullyCanonicalSig requireCanonicalSig,
Rules const& rules) const;
STBase* STBase*
copy(std::size_t n, void* buf) const override; copy(std::size_t n, void* buf) const override;
STBase* STBase*
move(std::size_t n, void* buf) override; move(std::size_t n, void* buf) override;
friend class detail::STVar; friend class detail::STVar;
mutable std::vector<uint256> batch_txn_ids_;
}; };
bool bool

View File

@@ -28,8 +28,6 @@
#include <xrpl/protocol/Units.h> #include <xrpl/protocol/Units.h>
#include <cstdint> #include <cstdint>
#include <functional>
#include <memory>
#include <optional> #include <optional>
#include <sstream> #include <sstream>

View File

@@ -33,7 +33,6 @@
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
#include <iomanip>
#include <type_traits> #include <type_traits>
namespace ripple { namespace ripple {

View File

@@ -25,8 +25,6 @@
#include <xrpl/protocol/STObject.h> #include <xrpl/protocol/STObject.h>
#include <xrpl/protocol/SecretKey.h> #include <xrpl/protocol/SecretKey.h>
#include <utility>
namespace ripple { namespace ripple {
/** Sign an STObject /** Sign an STObject

View File

@@ -139,8 +139,8 @@ enum TEMcodes : TERUnderlyingType {
temARRAY_EMPTY, temARRAY_EMPTY,
temARRAY_TOO_LARGE, temARRAY_TOO_LARGE,
temBAD_TRANSFER_FEE, temBAD_TRANSFER_FEE,
temINVALID_INNER_BATCH,
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@@ -360,6 +360,8 @@ enum TECcodes : TERUnderlyingType {
tecWRONG_ASSET = 194, tecWRONG_ASSET = 194,
tecLIMIT_EXCEEDED = 195, tecLIMIT_EXCEEDED = 195,
tecPSEUDO_ACCOUNT = 196, tecPSEUDO_ACCOUNT = 196,
tecPRECISION_LOSS = 197,
tecNO_DELEGATE_PERMISSION = 198,
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@@ -645,37 +647,37 @@ using TER = TERSubset<CanCvtToTER>;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
inline bool inline bool
isTelLocal(TER x) isTelLocal(TER x) noexcept
{ {
return ((x) >= telLOCAL_ERROR && (x) < temMALFORMED); return (x >= telLOCAL_ERROR && x < temMALFORMED);
} }
inline bool inline bool
isTemMalformed(TER x) isTemMalformed(TER x) noexcept
{ {
return ((x) >= temMALFORMED && (x) < tefFAILURE); return (x >= temMALFORMED && x < tefFAILURE);
} }
inline bool inline bool
isTefFailure(TER x) isTefFailure(TER x) noexcept
{ {
return ((x) >= tefFAILURE && (x) < terRETRY); return (x >= tefFAILURE && x < terRETRY);
} }
inline bool inline bool
isTerRetry(TER x) isTerRetry(TER x) noexcept
{ {
return ((x) >= terRETRY && (x) < tesSUCCESS); return (x >= terRETRY && x < tesSUCCESS);
} }
inline bool inline bool
isTesSuccess(TER x) isTesSuccess(TER x) noexcept
{ {
return ((x) == tesSUCCESS); return (x == tesSUCCESS);
} }
inline bool inline bool
isTecClaim(TER x) isTecClaim(TER x) noexcept
{ {
return ((x) >= tecCLAIM); return ((x) >= tecCLAIM);
} }

View File

@@ -58,7 +58,8 @@ namespace ripple {
// clang-format off // clang-format off
// Universal Transaction flags: // Universal Transaction flags:
constexpr std::uint32_t tfFullyCanonicalSig = 0x80000000; constexpr std::uint32_t tfFullyCanonicalSig = 0x80000000;
constexpr std::uint32_t tfUniversal = tfFullyCanonicalSig; constexpr std::uint32_t tfInnerBatchTxn = 0x40000000;
constexpr std::uint32_t tfUniversal = tfFullyCanonicalSig | tfInnerBatchTxn;
constexpr std::uint32_t tfUniversalMask = ~tfUniversal; constexpr std::uint32_t tfUniversalMask = ~tfUniversal;
// AccountSet flags: // AccountSet flags:
@@ -91,14 +92,16 @@ constexpr std::uint32_t asfDisallowIncomingCheck = 13;
constexpr std::uint32_t asfDisallowIncomingPayChan = 14; constexpr std::uint32_t asfDisallowIncomingPayChan = 14;
constexpr std::uint32_t asfDisallowIncomingTrustline = 15; constexpr std::uint32_t asfDisallowIncomingTrustline = 15;
constexpr std::uint32_t asfAllowTrustLineClawback = 16; constexpr std::uint32_t asfAllowTrustLineClawback = 16;
constexpr std::uint32_t asfAllowTrustLineLocking = 17;
// OfferCreate flags: // OfferCreate flags:
constexpr std::uint32_t tfPassive = 0x00010000; constexpr std::uint32_t tfPassive = 0x00010000;
constexpr std::uint32_t tfImmediateOrCancel = 0x00020000; constexpr std::uint32_t tfImmediateOrCancel = 0x00020000;
constexpr std::uint32_t tfFillOrKill = 0x00040000; constexpr std::uint32_t tfFillOrKill = 0x00040000;
constexpr std::uint32_t tfSell = 0x00080000; constexpr std::uint32_t tfSell = 0x00080000;
constexpr std::uint32_t tfHybrid = 0x00100000;
constexpr std::uint32_t tfOfferCreateMask = constexpr std::uint32_t tfOfferCreateMask =
~(tfUniversal | tfPassive | tfImmediateOrCancel | tfFillOrKill | tfSell); ~(tfUniversal | tfPassive | tfImmediateOrCancel | tfFillOrKill | tfSell | tfHybrid);
// Payment flags: // Payment flags:
constexpr std::uint32_t tfNoRippleDirect = 0x00010000; constexpr std::uint32_t tfNoRippleDirect = 0x00010000;
@@ -119,13 +122,7 @@ constexpr std::uint32_t tfClearDeepFreeze = 0x00800000;
constexpr std::uint32_t tfTrustSetMask = constexpr std::uint32_t tfTrustSetMask =
~(tfUniversal | tfSetfAuth | tfSetNoRipple | tfClearNoRipple | tfSetFreeze | ~(tfUniversal | tfSetfAuth | tfSetNoRipple | tfClearNoRipple | tfSetFreeze |
tfClearFreeze | tfSetDeepFreeze | tfClearDeepFreeze); tfClearFreeze | tfSetDeepFreeze | tfClearDeepFreeze);
constexpr std::uint32_t tfTrustSetPermissionMask = ~(tfUniversal | tfSetfAuth | tfSetFreeze | tfClearFreeze);
// valid flags for granular permission
constexpr std::uint32_t tfTrustSetGranularMask = tfSetfAuth | tfSetFreeze | tfClearFreeze;
// bits representing supportedGranularMask are set to 0 and the bits
// representing other flags are set to 1 in tfPermissionMask.
constexpr std::uint32_t tfTrustSetPermissionMask = (~tfTrustSetMask) & (~tfTrustSetGranularMask);
// EnableAmendment flags: // EnableAmendment flags:
constexpr std::uint32_t tfGotMajority = 0x00010000; constexpr std::uint32_t tfGotMajority = 0x00010000;
@@ -165,8 +162,7 @@ constexpr std::uint32_t const tfMPTokenAuthorizeMask = ~(tfUniversal | tfMPTUna
constexpr std::uint32_t const tfMPTLock = 0x00000001; constexpr std::uint32_t const tfMPTLock = 0x00000001;
constexpr std::uint32_t const tfMPTUnlock = 0x00000002; constexpr std::uint32_t const tfMPTUnlock = 0x00000002;
constexpr std::uint32_t const tfMPTokenIssuanceSetMask = ~(tfUniversal | tfMPTLock | tfMPTUnlock); constexpr std::uint32_t const tfMPTokenIssuanceSetMask = ~(tfUniversal | tfMPTLock | tfMPTUnlock);
constexpr std::uint32_t const tfMPTokenIssuanceSetGranularMask = tfMPTLock | tfMPTUnlock; constexpr std::uint32_t const tfMPTokenIssuanceSetPermissionMask = ~(tfUniversal | tfMPTLock | tfMPTUnlock);
constexpr std::uint32_t const tfMPTokenIssuanceSetPermissionMask = (~tfMPTokenIssuanceSetMask) & (~tfMPTokenIssuanceSetGranularMask);
// MPTokenIssuanceDestroy flags: // MPTokenIssuanceDestroy flags:
constexpr std::uint32_t const tfMPTokenIssuanceDestroyMask = ~tfUniversal; constexpr std::uint32_t const tfMPTokenIssuanceDestroyMask = ~tfUniversal;
@@ -242,6 +238,20 @@ constexpr std::uint32_t const tfVaultPrivate = 0x00010000;
static_assert(tfVaultPrivate == lsfVaultPrivate); static_assert(tfVaultPrivate == lsfVaultPrivate);
constexpr std::uint32_t const tfVaultShareNonTransferable = 0x00020000; constexpr std::uint32_t const tfVaultShareNonTransferable = 0x00020000;
constexpr std::uint32_t const tfVaultCreateMask = ~(tfUniversal | tfVaultPrivate | tfVaultShareNonTransferable); constexpr std::uint32_t const tfVaultCreateMask = ~(tfUniversal | tfVaultPrivate | tfVaultShareNonTransferable);
// Batch Flags:
constexpr std::uint32_t tfAllOrNothing = 0x00010000;
constexpr std::uint32_t tfOnlyOne = 0x00020000;
constexpr std::uint32_t tfUntilFailure = 0x00040000;
constexpr std::uint32_t tfIndependent = 0x00080000;
/**
* @note If nested Batch transactions are supported in the future, the tfInnerBatchTxn flag
* will need to be removed from this mask to allow Batch transaction to be inside
* the sfRawTransactions array.
*/
constexpr std::uint32_t const tfBatchMask =
~(tfUniversal | tfAllOrNothing | tfOnlyOne | tfUntilFailure | tfIndependent) | tfInnerBatchTxn;
// clang-format on // clang-format on
} // namespace ripple } // namespace ripple

View File

@@ -46,7 +46,10 @@ private:
CtorHelper); CtorHelper);
public: public:
TxMeta(uint256 const& transactionID, std::uint32_t ledger); TxMeta(
uint256 const& transactionID,
std::uint32_t ledger,
std::optional<uint256> parentBatchId = std::nullopt);
TxMeta(uint256 const& txID, std::uint32_t ledger, Blob const&); TxMeta(uint256 const& txID, std::uint32_t ledger, Blob const&);
TxMeta(uint256 const& txID, std::uint32_t ledger, std::string const&); TxMeta(uint256 const& txID, std::uint32_t ledger, std::string const&);
TxMeta(uint256 const& txID, std::uint32_t ledger, STObject const&); TxMeta(uint256 const& txID, std::uint32_t ledger, STObject const&);
@@ -130,6 +133,27 @@ public:
return static_cast<bool>(mDelivered); return static_cast<bool>(mDelivered);
} }
void
setParentBatchId(uint256 const& parentBatchId)
{
mParentBatchId = parentBatchId;
}
uint256
getParentBatchId() const
{
XRPL_ASSERT(
hasParentBatchId(),
"ripple::TxMeta::getParentBatchId : non-null batch id");
return *mParentBatchId;
}
bool
hasParentBatchId() const
{
return static_cast<bool>(mParentBatchId);
}
private: private:
uint256 mTransactionID; uint256 mTransactionID;
std::uint32_t mLedger; std::uint32_t mLedger;
@@ -137,6 +161,7 @@ private:
int mResult; int mResult;
std::optional<STAmount> mDelivered; std::optional<STAmount> mDelivered;
std::optional<uint256> mParentBatchId;
STArray mNodes; STArray mNodes;
}; };

View File

@@ -63,6 +63,9 @@ using NodeID = base_uint<160, detail::NodeIDTag>;
* and a 160-bit account */ * and a 160-bit account */
using MPTID = base_uint<192>; using MPTID = base_uint<192>;
/** Domain is a 256-bit hash representing a specific domain. */
using Domain = base_uint<256>;
/** XRP currency. */ /** XRP currency. */
Currency const& Currency const&
xrpCurrency(); xrpCurrency();
@@ -119,25 +122,25 @@ namespace std {
template <> template <>
struct hash<ripple::Currency> : ripple::Currency::hasher struct hash<ripple::Currency> : ripple::Currency::hasher
{ {
explicit hash() = default; hash() = default;
}; };
template <> template <>
struct hash<ripple::NodeID> : ripple::NodeID::hasher struct hash<ripple::NodeID> : ripple::NodeID::hasher
{ {
explicit hash() = default; hash() = default;
}; };
template <> template <>
struct hash<ripple::Directory> : ripple::Directory::hasher struct hash<ripple::Directory> : ripple::Directory::hasher
{ {
explicit hash() = default; hash() = default;
}; };
template <> template <>
struct hash<ripple::uint256> : ripple::uint256::hasher struct hash<ripple::uint256> : ripple::uint256::hasher
{ {
explicit hash() = default; hash() = default;
}; };
} // namespace std } // namespace std

View File

@@ -27,14 +27,9 @@
#include <boost/multiprecision/cpp_int.hpp> #include <boost/multiprecision/cpp_int.hpp>
#include <boost/operators.hpp> #include <boost/operators.hpp>
#include <cmath>
#include <ios>
#include <iosfwd> #include <iosfwd>
#include <limits> #include <limits>
#include <optional> #include <optional>
#include <sstream>
#include <string>
#include <utility>
namespace ripple { namespace ripple {

View File

@@ -35,8 +35,6 @@
#include <boost/container/vector.hpp> #include <boost/container/vector.hpp>
#include <cstddef> #include <cstddef>
#include <type_traits>
#include <unordered_map>
#include <vector> #include <vector>
namespace ripple { namespace ripple {

View File

@@ -27,7 +27,6 @@
#include <boost/outcome.hpp> #include <boost/outcome.hpp>
#include <boost/outcome/result.hpp> #include <boost/outcome/result.hpp>
#include <cinttypes>
#include <span> #include <span>
#include <system_error> #include <system_error>
#include <tuple> #include <tuple>

View File

@@ -26,12 +26,21 @@
#if !defined(XRPL_RETIRE) #if !defined(XRPL_RETIRE)
#error "undefined macro: XRPL_RETIRE" #error "undefined macro: XRPL_RETIRE"
#endif #endif
#if !defined(XRPL_ABANDON)
#error "undefined macro: XRPL_ABANDON"
#endif
// Add new amendments to the top of this list. // Add new amendments to the top of this list.
// Keep it sorted in reverse chronological order. // Keep it sorted in reverse chronological order.
// If you add an amendment here, then do not forget to increment `numFeatures` // If you add an amendment here, then do not forget to increment `numFeatures`
// in include/xrpl/protocol/Feature.h. // in include/xrpl/protocol/Feature.h.
XRPL_FIX (AMMClawbackRounding, Supported::no, VoteBehavior::DefaultNo)
XRPL_FEATURE(TokenEscrow, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (EnforceNFTokenTrustlineV2, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (AMMv1_3, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(PermissionedDEX, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(Batch, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(SingleAssetVault, Supported::no, VoteBehavior::DefaultNo) XRPL_FEATURE(SingleAssetVault, Supported::no, VoteBehavior::DefaultNo)
XRPL_FEATURE(PermissionDelegation, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(PermissionDelegation, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (PayChanCancelAfter, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (PayChanCancelAfter, Supported::yes, VoteBehavior::DefaultNo)
@@ -89,7 +98,6 @@ XRPL_FEATURE(HardenedValidations, Supported::yes, VoteBehavior::DefaultYe
// fix1781: XRPEndpointSteps should be included in the circular payment check // fix1781: XRPEndpointSteps should be included in the circular payment check
XRPL_FIX (1781, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (1781, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(RequireFullyCanonicalSig, Supported::yes, VoteBehavior::DefaultYes)
// fixQualityUpperBound should be activated before FlowCross
XRPL_FIX (QualityUpperBound, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (QualityUpperBound, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(DeletableAccounts, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (PayChanRecipientOwnerDir, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (PayChanRecipientOwnerDir, Supported::yes, VoteBehavior::DefaultYes)
@@ -107,9 +115,7 @@ XRPL_FIX (1571, Supported::yes, VoteBehavior::DefaultYe
XRPL_FEATURE(Checks, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(Checks, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(DepositAuth, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(DepositAuth, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FIX (1513, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (1513, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(FlowCross, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(Flow, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(Flow, Supported::yes, VoteBehavior::DefaultYes)
XRPL_FEATURE(OwnerPaysFee, Supported::no, VoteBehavior::DefaultNo)
// The following amendments are obsolete, but must remain supported // The following amendments are obsolete, but must remain supported
// because they could potentially get enabled. // because they could potentially get enabled.
@@ -127,6 +133,11 @@ XRPL_FIX (NFTokenDirV1, Supported::yes, VoteBehavior::Obsolete)
XRPL_FEATURE(NonFungibleTokensV1, Supported::yes, VoteBehavior::Obsolete) XRPL_FEATURE(NonFungibleTokensV1, Supported::yes, VoteBehavior::Obsolete)
XRPL_FEATURE(CryptoConditionsSuite, Supported::yes, VoteBehavior::Obsolete) XRPL_FEATURE(CryptoConditionsSuite, Supported::yes, VoteBehavior::Obsolete)
// The following amendments were never supported, never enabled, and
// we've abanded them. These features should never be in the ledger,
// and we've removed all the related code.
XRPL_ABANDON(OwnerPaysFee)
// The following amendments have been active for at least two years. Their // The following amendments have been active for at least two years. Their
// pre-amendment code has been removed and the identifiers are deprecated. // pre-amendment code has been removed and the identifiers are deprecated.
// All known amendments and amendments that may appear in a validated // All known amendments and amendments that may appear in a validated
@@ -146,3 +157,4 @@ XRPL_RETIRE(fix1201)
XRPL_RETIRE(fix1512) XRPL_RETIRE(fix1512)
XRPL_RETIRE(fix1523) XRPL_RETIRE(fix1523)
XRPL_RETIRE(fix1528) XRPL_RETIRE(fix1528)
XRPL_RETIRE(FlowCross)

View File

@@ -188,6 +188,7 @@ LEDGER_ENTRY(ltDIR_NODE, 0x0064, DirectoryNode, directory, ({
{sfNFTokenID, soeOPTIONAL}, {sfNFTokenID, soeOPTIONAL},
{sfPreviousTxnID, soeOPTIONAL}, {sfPreviousTxnID, soeOPTIONAL},
{sfPreviousTxnLgrSeq, soeOPTIONAL}, {sfPreviousTxnLgrSeq, soeOPTIONAL},
{sfDomainID, soeOPTIONAL}
})) }))
/** The ledger object which lists details about amendments on the network. /** The ledger object which lists details about amendments on the network.
@@ -249,6 +250,8 @@ LEDGER_ENTRY(ltOFFER, 0x006f, Offer, offer, ({
{sfPreviousTxnID, soeREQUIRED}, {sfPreviousTxnID, soeREQUIRED},
{sfPreviousTxnLgrSeq, soeREQUIRED}, {sfPreviousTxnLgrSeq, soeREQUIRED},
{sfExpiration, soeOPTIONAL}, {sfExpiration, soeOPTIONAL},
{sfDomainID, soeOPTIONAL},
{sfAdditionalBooks, soeOPTIONAL},
})) }))
/** A ledger object which describes a deposit preauthorization. /** A ledger object which describes a deposit preauthorization.
@@ -351,6 +354,8 @@ LEDGER_ENTRY(ltESCROW, 0x0075, Escrow, escrow, ({
{sfPreviousTxnID, soeREQUIRED}, {sfPreviousTxnID, soeREQUIRED},
{sfPreviousTxnLgrSeq, soeREQUIRED}, {sfPreviousTxnLgrSeq, soeREQUIRED},
{sfDestinationNode, soeOPTIONAL}, {sfDestinationNode, soeOPTIONAL},
{sfTransferRate, soeOPTIONAL},
{sfIssuerNode, soeOPTIONAL},
})) }))
/** A ledger object describing a single unidirectional XRP payment channel. /** A ledger object describing a single unidirectional XRP payment channel.
@@ -402,6 +407,7 @@ LEDGER_ENTRY(ltMPTOKEN_ISSUANCE, 0x007e, MPTokenIssuance, mpt_issuance, ({
{sfAssetScale, soeDEFAULT}, {sfAssetScale, soeDEFAULT},
{sfMaximumAmount, soeOPTIONAL}, {sfMaximumAmount, soeOPTIONAL},
{sfOutstandingAmount, soeREQUIRED}, {sfOutstandingAmount, soeREQUIRED},
{sfLockedAmount, soeOPTIONAL},
{sfMPTokenMetadata, soeOPTIONAL}, {sfMPTokenMetadata, soeOPTIONAL},
{sfPreviousTxnID, soeREQUIRED}, {sfPreviousTxnID, soeREQUIRED},
{sfPreviousTxnLgrSeq, soeREQUIRED}, {sfPreviousTxnLgrSeq, soeREQUIRED},
@@ -415,6 +421,7 @@ LEDGER_ENTRY(ltMPTOKEN, 0x007f, MPToken, mptoken, ({
{sfAccount, soeREQUIRED}, {sfAccount, soeREQUIRED},
{sfMPTokenIssuanceID, soeREQUIRED}, {sfMPTokenIssuanceID, soeREQUIRED},
{sfMPTAmount, soeDEFAULT}, {sfMPTAmount, soeDEFAULT},
{sfLockedAmount, soeOPTIONAL},
{sfOwnerNode, soeREQUIRED}, {sfOwnerNode, soeREQUIRED},
{sfPreviousTxnID, soeREQUIRED}, {sfPreviousTxnID, soeREQUIRED},
{sfPreviousTxnLgrSeq, soeREQUIRED}, {sfPreviousTxnLgrSeq, soeREQUIRED},

View File

@@ -144,6 +144,7 @@ TYPED_SFIELD(sfOutstandingAmount, UINT64, 25, SField::sMD_BaseTen|SFie
TYPED_SFIELD(sfMPTAmount, UINT64, 26, SField::sMD_BaseTen|SField::sMD_Default) TYPED_SFIELD(sfMPTAmount, UINT64, 26, SField::sMD_BaseTen|SField::sMD_Default)
TYPED_SFIELD(sfIssuerNode, UINT64, 27) TYPED_SFIELD(sfIssuerNode, UINT64, 27)
TYPED_SFIELD(sfSubjectNode, UINT64, 28) TYPED_SFIELD(sfSubjectNode, UINT64, 28)
TYPED_SFIELD(sfLockedAmount, UINT64, 29, SField::sMD_BaseTen|SField::sMD_Default)
// 128-bit // 128-bit
TYPED_SFIELD(sfEmailHash, UINT128, 1) TYPED_SFIELD(sfEmailHash, UINT128, 1)
@@ -197,6 +198,7 @@ TYPED_SFIELD(sfHookSetTxnID, UINT256, 33)
TYPED_SFIELD(sfDomainID, UINT256, 34) TYPED_SFIELD(sfDomainID, UINT256, 34)
TYPED_SFIELD(sfVaultID, UINT256, 35, TYPED_SFIELD(sfVaultID, UINT256, 35,
SField::sMD_PseudoAccount | SField::sMD_Default) SField::sMD_PseudoAccount | SField::sMD_Default)
TYPED_SFIELD(sfParentBatchID, UINT256, 36)
// number (common) // number (common)
TYPED_SFIELD(sfNumber, NUMBER, 1) TYPED_SFIELD(sfNumber, NUMBER, 1)
@@ -359,6 +361,9 @@ UNTYPED_SFIELD(sfXChainClaimAttestationCollectionElement, OBJECT, 30)
UNTYPED_SFIELD(sfXChainCreateAccountAttestationCollectionElement, OBJECT, 31) UNTYPED_SFIELD(sfXChainCreateAccountAttestationCollectionElement, OBJECT, 31)
UNTYPED_SFIELD(sfPriceData, OBJECT, 32) UNTYPED_SFIELD(sfPriceData, OBJECT, 32)
UNTYPED_SFIELD(sfCredential, OBJECT, 33) UNTYPED_SFIELD(sfCredential, OBJECT, 33)
UNTYPED_SFIELD(sfRawTransaction, OBJECT, 34)
UNTYPED_SFIELD(sfBatchSigner, OBJECT, 35)
UNTYPED_SFIELD(sfBook, OBJECT, 36)
// array of objects (common) // array of objects (common)
// ARRAY/1 is reserved for end of array // ARRAY/1 is reserved for end of array
@@ -374,6 +379,7 @@ UNTYPED_SFIELD(sfMemos, ARRAY, 9)
UNTYPED_SFIELD(sfNFTokens, ARRAY, 10) UNTYPED_SFIELD(sfNFTokens, ARRAY, 10)
UNTYPED_SFIELD(sfHooks, ARRAY, 11) UNTYPED_SFIELD(sfHooks, ARRAY, 11)
UNTYPED_SFIELD(sfVoteSlots, ARRAY, 12) UNTYPED_SFIELD(sfVoteSlots, ARRAY, 12)
UNTYPED_SFIELD(sfAdditionalBooks, ARRAY, 13)
// array of objects (uncommon) // array of objects (uncommon)
UNTYPED_SFIELD(sfMajorities, ARRAY, 16) UNTYPED_SFIELD(sfMajorities, ARRAY, 16)
@@ -390,3 +396,5 @@ UNTYPED_SFIELD(sfAuthorizeCredentials, ARRAY, 26)
UNTYPED_SFIELD(sfUnauthorizeCredentials, ARRAY, 27) UNTYPED_SFIELD(sfUnauthorizeCredentials, ARRAY, 27)
UNTYPED_SFIELD(sfAcceptedCredentials, ARRAY, 28) UNTYPED_SFIELD(sfAcceptedCredentials, ARRAY, 28)
UNTYPED_SFIELD(sfPermissions, ARRAY, 29) UNTYPED_SFIELD(sfPermissions, ARRAY, 29)
UNTYPED_SFIELD(sfRawTransactions, ARRAY, 30)
UNTYPED_SFIELD(sfBatchSigners, ARRAY, 31, SField::sMD_Default, SField::notSigning)

View File

@@ -71,6 +71,7 @@ TRANSACTION(ttPAYMENT, 0, Payment,
{sfDestinationTag, soeOPTIONAL}, {sfDestinationTag, soeOPTIONAL},
{sfDeliverMin, soeOPTIONAL, soeMPTSupported}, {sfDeliverMin, soeOPTIONAL, soeMPTSupported},
{sfCredentialIDs, soeOPTIONAL}, {sfCredentialIDs, soeOPTIONAL},
{sfDomainID, soeOPTIONAL},
})) }))
/** This transaction type creates an escrow object. */ /** This transaction type creates an escrow object. */
@@ -81,7 +82,7 @@ TRANSACTION(ttESCROW_CREATE, 1, EscrowCreate,
Delegation::delegatable, Delegation::delegatable,
noPriv, ({ noPriv, ({
{sfDestination, soeREQUIRED}, {sfDestination, soeREQUIRED},
{sfAmount, soeREQUIRED}, {sfAmount, soeREQUIRED, soeMPTSupported},
{sfCondition, soeOPTIONAL}, {sfCondition, soeOPTIONAL},
{sfCancelAfter, soeOPTIONAL}, {sfCancelAfter, soeOPTIONAL},
{sfFinishAfter, soeOPTIONAL}, {sfFinishAfter, soeOPTIONAL},
@@ -153,6 +154,7 @@ TRANSACTION(ttOFFER_CREATE, 7, OfferCreate,
{sfTakerGets, soeREQUIRED}, {sfTakerGets, soeREQUIRED},
{sfExpiration, soeOPTIONAL}, {sfExpiration, soeOPTIONAL},
{sfOfferSequence, soeOPTIONAL}, {sfOfferSequence, soeOPTIONAL},
{sfDomainID, soeOPTIONAL},
})) }))
/** This transaction type cancels existing offers to trade one asset for another. */ /** This transaction type cancels existing offers to trade one asset for another. */
@@ -814,6 +816,18 @@ TRANSACTION(ttVAULT_CLAWBACK, 70, VaultClawback,
{sfAmount, soeOPTIONAL, soeMPTSupported}, {sfAmount, soeOPTIONAL, soeMPTSupported},
})) }))
/** This transaction type batches together transactions. */
#if TRANSACTION_INCLUDE
# include <xrpld/app/tx/detail/Batch.h>
#endif
TRANSACTION(ttBATCH, 71, Batch,
Delegation::notDelegatable,
noPriv,
({
{sfRawTransactions, soeREQUIRED},
{sfBatchSigners, soeOPTIONAL},
}))
/** This system-generated transaction type is used to update the status of the various amendments. /** This system-generated transaction type is used to update the status of the various amendments.
For details, see: https://xrpl.org/amendments.html For details, see: https://xrpl.org/amendments.html
@@ -857,4 +871,3 @@ TRANSACTION(ttUNL_MODIFY, 102, UNLModify,
{sfLedgerSequence, soeREQUIRED}, {sfLedgerSequence, soeREQUIRED},
{sfUNLModifyValidator, soeREQUIRED}, {sfUNLModifyValidator, soeREQUIRED},
})) }))

View File

@@ -25,7 +25,6 @@
#include <boost/endian/conversion.hpp> #include <boost/endian/conversion.hpp>
#include <algorithm>
#include <array> #include <array>
namespace ripple { namespace ripple {

View File

@@ -10,7 +10,6 @@
#include <charconv> #include <charconv>
#include <exception> #include <exception>
#include <optional> #include <optional>
#include <string>
namespace Json { namespace Json {
struct JsonMissingKeyError : std::exception struct JsonMissingKeyError : std::exception

View File

@@ -83,6 +83,8 @@ JSS(PriceDataSeries); // field.
JSS(PriceData); // field. JSS(PriceData); // field.
JSS(Provider); // field. JSS(Provider); // field.
JSS(QuoteAsset); // in: Oracle. JSS(QuoteAsset); // in: Oracle.
JSS(RawTransaction); // in: Batch
JSS(RawTransactions); // in: Batch
JSS(SLE_hit_rate); // out: GetCounts. JSS(SLE_hit_rate); // out: GetCounts.
JSS(Scale); // field. JSS(Scale); // field.
JSS(SettleDelay); // in: TransactionSign JSS(SettleDelay); // in: TransactionSign
@@ -389,6 +391,7 @@ JSS(load_fee); // out: LoadFeeTrackImp, NetworkOPs
JSS(local); // out: resource/Logic.h JSS(local); // out: resource/Logic.h
JSS(local_txs); // out: GetCounts JSS(local_txs); // out: GetCounts
JSS(local_static_keys); // out: ValidatorList JSS(local_static_keys); // out: ValidatorList
JSS(locked); // out: GatewayBalances
JSS(low); // out: BookChanges JSS(low); // out: BookChanges
JSS(lowest_sequence); // out: AccountInfo JSS(lowest_sequence); // out: AccountInfo
JSS(lowest_ticket); // out: AccountInfo JSS(lowest_ticket); // out: AccountInfo

View File

@@ -20,7 +20,6 @@
#ifndef RIPPLE_RESOURCE_CHARGE_H_INCLUDED #ifndef RIPPLE_RESOURCE_CHARGE_H_INCLUDED
#define RIPPLE_RESOURCE_CHARGE_H_INCLUDED #define RIPPLE_RESOURCE_CHARGE_H_INCLUDED
#include <ios>
#include <string> #include <string>
namespace ripple { namespace ripple {

View File

@@ -22,6 +22,8 @@
#include <xrpl/beast/net/IPEndpoint.h> #include <xrpl/beast/net/IPEndpoint.h>
#include <vector>
namespace ripple { namespace ripple {
namespace Resource { namespace Resource {

View File

@@ -53,7 +53,7 @@ struct Key
struct key_equal struct key_equal
{ {
explicit key_equal() = default; key_equal() = default;
bool bool
operator()(Key const& lhs, Key const& rhs) const operator()(Key const& lhs, Key const& rhs) const

View File

@@ -41,7 +41,6 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <type_traits>
#include <vector> #include <vector>
namespace ripple { namespace ripple {

View File

@@ -37,10 +37,8 @@
#include <boost/container/flat_map.hpp> #include <boost/container/flat_map.hpp>
#include <chrono> #include <chrono>
#include <condition_variable>
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <mutex>
namespace ripple { namespace ripple {

View File

@@ -26,7 +26,6 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <stdexcept>
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>

View File

@@ -48,7 +48,7 @@ operator<<(std::ostream& os, Book const& x)
Book Book
reversed(Book const& book) reversed(Book const& book)
{ {
return Book(book.out, book.in); return Book(book.out, book.in, book.domain);
} }
} // namespace ripple } // namespace ripple

View File

@@ -36,7 +36,7 @@ namespace BuildInfo {
// and follow the format described at http://semver.org/ // and follow the format described at http://semver.org/
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// clang-format off // clang-format off
char const* const versionString = "2.5.0-b1" char const* const versionString = "2.5.0"
// clang-format on // clang-format on
#if defined(DEBUG) || defined(SANITIZER) #if defined(DEBUG) || defined(SANITIZER)

View File

@@ -116,7 +116,8 @@ constexpr static ErrorInfo unorderedErrorInfos[]{
{rpcUNKNOWN_COMMAND, "unknownCmd", "Unknown method.", 405}, {rpcUNKNOWN_COMMAND, "unknownCmd", "Unknown method.", 405},
{rpcORACLE_MALFORMED, "oracleMalformed", "Oracle request is malformed.", 400}, {rpcORACLE_MALFORMED, "oracleMalformed", "Oracle request is malformed.", 400},
{rpcBAD_CREDENTIALS, "badCredentials", "Credentials do not exist, are not accepted, or have expired.", 400}, {rpcBAD_CREDENTIALS, "badCredentials", "Credentials do not exist, are not accepted, or have expired.", 400},
{rpcTX_SIGNED, "transactionSigned", "Transaction should not be signed.", 400}}; {rpcTX_SIGNED, "transactionSigned", "Transaction should not be signed.", 400},
{rpcDOMAIN_MALFORMED, "domainMalformed", "Domain is malformed.", 400}};
// clang-format on // clang-format on
// Sort and validate unorderedErrorInfos at compile time. Should be // Sort and validate unorderedErrorInfos at compile time. Should be

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