mirror of
				https://github.com/XRPLF/rippled.git
				synced 2025-11-04 11:15:56 +00:00 
			
		
		
		
	Compare commits
	
		
			177 Commits
		
	
	
		
			tapanito/b
			...
			945c362559
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					945c362559 | ||
| 
						 | 
					8ac8a47c99 | ||
| 
						 | 
					12c4b5a632 | ||
| 
						 | 
					25c5e3b17f | ||
| 
						 | 
					8eb233c2ea | ||
| 
						 | 
					50fc93f742 | ||
| 
						 | 
					ab45a8a737 | ||
| 
						 | 
					dfafb141cc | ||
| 
						 | 
					4e32d2ed98 | ||
| 
						 | 
					fa69918124 | ||
| 
						 | 
					9546c52013 | ||
| 
						 | 
					cbbb2b1be0 | ||
| 
						 | 
					3a099aeb64 | ||
| 
						 | 
					cf2d763fa1 | ||
| 
						 | 
					2dd1d682ac | ||
| 
						 | 
					4cb1084c02 | ||
| 
						 | 
					8d1b3b3994 | ||
| 
						 | 
					b39d7a6519 | ||
| 
						 | 
					b0910e359e | ||
| 
						 | 
					44e027e516 | ||
| 
						 | 
					a10f42a3aa | ||
| 
						 | 
					efd4c1b95d | ||
| 
						 | 
					8567bd0d12 | ||
| 
						 | 
					f8b4f692f1 | ||
| 
						 | 
					3cb1851537 | ||
| 
						 | 
					80a3ae6386 | ||
| 
						 | 
					48d38c1e2c | ||
| 
						 | 
					55feea308e | ||
| 
						 | 
					553fb5be3b | ||
| 
						 | 
					efa917d9f3 | ||
| 
						 | 
					bd3bc917f8 | ||
| 
						 | 
					ed5d6f3e22 | ||
| 
						 | 
					a8e4da0b11 | ||
| 
						 | 
					1dd60242de | ||
| 
						 | 
					a6692af17a | ||
| 
						 | 
					76611c3f46 | ||
| 
						 | 
					5efaf0c328 | ||
| 
						 | 
					0aa23933ea | ||
| 
						 | 
					21f3c12d85 | ||
| 
						 | 
					7d5ed0cd8d | ||
| 
						 | 
					d9960d5ba0 | ||
| 
						 | 
					91fa6b2295 | ||
| 
						 | 
					76f774e22d | ||
| 
						 | 
					f4f7618173 | ||
| 
						 | 
					66f16469f9 | ||
| 
						 | 
					1845b1c656 | ||
| 
						 | 
					1d058a5d78 | ||
| 
						 | 
					e192ffe964 | ||
| 
						 | 
					a70821adc5 | ||
| 
						 | 
					2bf77cc8f6 | ||
| 
						 | 
					5e33ca56fd | ||
| 
						 | 
					bfeb60d3f5 | ||
| 
						 | 
					7c39c810eb | ||
| 
						 | 
					c86bfa32f7 | ||
| 
						 | 
					a7792ebcae | ||
| 
						 | 
					83ee3788e1 | ||
| 
						 | 
					ae719b86d3 | ||
| 
						 | 
					dd722f8b3f | ||
| 
						 | 
					30190a5feb | ||
| 
						 | 
					0f44d619b6 | ||
| 
						 | 
					afb6e0e41b | ||
| 
						 | 
					5523557226 | ||
| 
						 | 
					b64707f53b | ||
| 
						 | 
					0b113f371f | ||
| 
						 | 
					b4c894c1ba | ||
| 
						 | 
					2add6a7917 | ||
| 
						 | 
					92281a4ede | ||
| 
						 | 
					d21c4f3218 | ||
| 
						 | 
					e80642fc12 | ||
| 
						 | 
					640ce4988f | ||
| 
						 | 
					a422855ea7 | ||
| 
						 | 
					108f90586c | ||
| 
						 | 
					519d1dbc34 | ||
| 
						 | 
					3d44758e5a | ||
| 
						 | 
					97bc94a7f6 | ||
| 
						 | 
					34619f2504 | ||
| 
						 | 
					3509de9c5f | ||
| 
						 | 
					459d0da010 | ||
| 
						 | 
					8637d606a4 | ||
| 
						 | 
					265a504301 | ||
| 
						 | 
					8456b8275e | ||
| 
						 | 
					3c88786bb0 | ||
| 
						 | 
					b1e576d3d1 | ||
| 
						 | 
					46ba8a28fe | ||
| 
						 | 
					d2d3039ce6 | ||
| 
						 | 
					5ecde3cf39 | ||
| 
						 | 
					620fb26823 | ||
| 
						 | 
					6b6b213cf5 | ||
| 
						 | 
					f61086b43c | ||
| 
						 | 
					176fd2b6e4 | ||
| 
						 | 
					2df730438d | ||
| 
						 | 
					16e85a7b79 | ||
| 
						 | 
					5d79bfc531 | ||
| 
						 | 
					4ae1c01e13 | ||
| 
						 | 
					51ef35ab55 | ||
| 
						 | 
					8807afc074 | ||
| 
						 | 
					330a3215bc | ||
| 
						 | 
					a4e13e07d5 | ||
| 
						 | 
					85c2ceacde | ||
| 
						 | 
					70d5c624e8 | ||
| 
						 | 
					8e4fda160d | ||
| 
						 | 
					072b1c442c | ||
| 
						 | 
					294e03ecf5 | ||
| 
						 | 
					6067d59336 | ||
| 
						 | 
					550f90a75e | ||
| 
						 | 
					d67dcfe3c4 | ||
| 
						 | 
					e14aecee66 | ||
| 
						 | 
					0fd2f715bb | ||
| 
						 | 
					0e4c3e3427 | ||
| 
						 | 
					807462b191 | ||
| 
						 | 
					19c4226d3d | ||
| 
						 | 
					da5c563426 | ||
| 
						 | 
					d02c306f1e | ||
| 
						 | 
					b9f5d8b1c5 | ||
| 
						 | 
					cfd26f444c | ||
| 
						 | 
					2c3024716b | ||
| 
						 | 
					5ea7b562a2 | ||
| 
						 | 
					8450970b80 | ||
| 
						 | 
					a12f5de68d | ||
| 
						 | 
					51c5f2bfc9 | ||
| 
						 | 
					14d4cff530 | ||
| 
						 | 
					88ac659d86 | ||
| 
						 | 
					73ff54143d | ||
| 
						 | 
					08b136528e | ||
| 
						 | 
					6b8a589447 | ||
| 
						 | 
					43fdbf27b9 | ||
| 
						 | 
					ffeabc9642 | ||
| 
						 | 
					1e33f8e868 | ||
| 
						 | 
					3cbdf818a7 | ||
| 
						 | 
					c46888f8f7 | ||
| 
						 | 
					2ae65d2fdb | ||
| 
						 | 
					a6e30857df | ||
| 
						 | 
					bd834c87e0 | ||
| 
						 | 
					dc8b37a524 | ||
| 
						 | 
					617a895af5 | ||
| 
						 | 
					1af1048c58 | ||
| 
						 | 
					f07ba87e51 | ||
| 
						 | 
					e66558a883 | ||
| 
						 | 
					510314d344 | ||
| 
						 | 
					37b951859c | ||
| 
						 | 
					563f24edb0 | ||
| 
						 | 
					9494fc9668 | ||
| 
						 | 
					8d01f35eb9 | ||
| 
						 | 
					1020a32d76 | ||
| 
						 | 
					a89f6d5da2 | ||
| 
						 | 
					17a2606591 | ||
| 
						 | 
					5b2e91986a | ||
| 
						 | 
					fbc5056817 | ||
| 
						 | 
					b7cafed040 | ||
| 
						 | 
					b6ebd34b30 | ||
| 
						 | 
					74c2765159 | ||
| 
						 | 
					62c7fdadba | ||
| 
						 | 
					372c66e684 | ||
| 
						 | 
					a2fab5bcaf | ||
| 
						 | 
					2e4f41571c | ||
| 
						 | 
					8799a6dbfd | ||
| 
						 | 
					e655087027 | ||
| 
						 | 
					16c2ff97cc | ||
| 
						 | 
					32043463a8 | ||
| 
						 | 
					46bd2a4090 | ||
| 
						 | 
					f3b8a8aef3 | ||
| 
						 | 
					ee0c917e95 | ||
| 
						 | 
					375aedd340 | ||
| 
						 | 
					95397a7710 | ||
| 
						 | 
					7af8a52d27 | ||
| 
						 | 
					326a8093c9 | ||
| 
						 | 
					9f0e159205 | ||
| 
						 | 
					2fda101b44 | ||
| 
						 | 
					e6e1e4f9dd | ||
| 
						 | 
					70591265e5 | ||
| 
						 | 
					ed1d477a45 | ||
| 
						 | 
					cd58f636d3 | ||
| 
						 | 
					3152f2233f | ||
| 
						 | 
					0c147a895c | ||
| 
						 | 
					cf80710ef1 | ||
| 
						 | 
					fc929ab984 | ||
| 
						 | 
					145a8817dc | 
@@ -33,5 +33,6 @@ slack_app: false
 | 
			
		||||
 | 
			
		||||
ignore:
 | 
			
		||||
  - "src/test/"
 | 
			
		||||
  - "src/tests/"
 | 
			
		||||
  - "include/xrpl/beast/test/"
 | 
			
		||||
  - "include/xrpl/beast/unit_test/"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										28
									
								
								.github/actions/build-deps/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								.github/actions/build-deps/action.yml
									
									
									
									
										vendored
									
									
								
							@@ -10,24 +10,40 @@ inputs:
 | 
			
		||||
  build_type:
 | 
			
		||||
    description: 'The build type to use ("Debug", "Release").'
 | 
			
		||||
    required: true
 | 
			
		||||
  build_nproc:
 | 
			
		||||
    description: "The number of processors to use for building."
 | 
			
		||||
    required: true
 | 
			
		||||
  force_build:
 | 
			
		||||
    description: 'Force building of all dependencies ("true", "false").'
 | 
			
		||||
    required: false
 | 
			
		||||
    default: "false"
 | 
			
		||||
  log_verbosity:
 | 
			
		||||
    description: "The logging verbosity."
 | 
			
		||||
    required: false
 | 
			
		||||
    default: "verbose"
 | 
			
		||||
 | 
			
		||||
runs:
 | 
			
		||||
  using: composite
 | 
			
		||||
  steps:
 | 
			
		||||
    - name: Install Conan dependencies
 | 
			
		||||
      shell: bash
 | 
			
		||||
      env:
 | 
			
		||||
        BUILD_DIR: ${{ inputs.build_dir }}
 | 
			
		||||
        BUILD_NPROC: ${{ inputs.build_nproc }}
 | 
			
		||||
        BUILD_OPTION: ${{ inputs.force_build == 'true' && '*' || 'missing' }}
 | 
			
		||||
        BUILD_TYPE: ${{ inputs.build_type }}
 | 
			
		||||
        LOG_VERBOSITY: ${{ inputs.log_verbosity }}
 | 
			
		||||
      run: |
 | 
			
		||||
        echo 'Installing dependencies.'
 | 
			
		||||
        mkdir -p ${{ inputs.build_dir }}
 | 
			
		||||
        cd ${{ inputs.build_dir }}
 | 
			
		||||
        mkdir -p "${BUILD_DIR}"
 | 
			
		||||
        cd "${BUILD_DIR}"
 | 
			
		||||
        conan install \
 | 
			
		||||
          --output-folder . \
 | 
			
		||||
          --build ${{ inputs.force_build == 'true' && '"*"' || 'missing' }} \
 | 
			
		||||
          --options:host '&:tests=True' \
 | 
			
		||||
          --options:host '&:xrpld=True' \
 | 
			
		||||
          --settings:all build_type=${{ inputs.build_type }} \
 | 
			
		||||
          --build="${BUILD_OPTION}" \
 | 
			
		||||
          --options:host='&:tests=True' \
 | 
			
		||||
          --options:host='&:xrpld=True' \
 | 
			
		||||
          --settings:all build_type="${BUILD_TYPE}" \
 | 
			
		||||
          --conf:all tools.build:jobs=${BUILD_NPROC} \
 | 
			
		||||
          --conf:all tools.build:verbosity="${LOG_VERBOSITY}" \
 | 
			
		||||
          --conf:all tools.compilation:verbosity="${LOG_VERBOSITY}" \
 | 
			
		||||
          ..
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										96
									
								
								.github/actions/build-test/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										96
									
								
								.github/actions/build-test/action.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,96 +0,0 @@
 | 
			
		||||
# This action build and tests the binary. The Conan dependencies must have
 | 
			
		||||
# already been installed (see the build-deps action).
 | 
			
		||||
name: Build and Test
 | 
			
		||||
description: "Build and test the binary."
 | 
			
		||||
 | 
			
		||||
# Note that actions do not support 'type' and all inputs are strings, see
 | 
			
		||||
# https://docs.github.com/en/actions/reference/workflows-and-actions/metadata-syntax#inputs.
 | 
			
		||||
inputs:
 | 
			
		||||
  build_dir:
 | 
			
		||||
    description: "The directory where to build."
 | 
			
		||||
    required: true
 | 
			
		||||
  build_only:
 | 
			
		||||
    description: 'Whether to only build or to build and test the code ("true", "false").'
 | 
			
		||||
    required: false
 | 
			
		||||
    default: "false"
 | 
			
		||||
  build_type:
 | 
			
		||||
    description: 'The build type to use ("Debug", "Release").'
 | 
			
		||||
    required: true
 | 
			
		||||
  cmake_args:
 | 
			
		||||
    description: "Additional arguments to pass to CMake."
 | 
			
		||||
    required: false
 | 
			
		||||
    default: ""
 | 
			
		||||
  cmake_target:
 | 
			
		||||
    description: "The CMake target to build."
 | 
			
		||||
    required: true
 | 
			
		||||
  codecov_token:
 | 
			
		||||
    description: "The Codecov token to use for uploading coverage reports."
 | 
			
		||||
    required: false
 | 
			
		||||
    default: ""
 | 
			
		||||
  os:
 | 
			
		||||
    description: 'The operating system to use for the build ("linux", "macos", "windows").'
 | 
			
		||||
    required: true
 | 
			
		||||
 | 
			
		||||
runs:
 | 
			
		||||
  using: composite
 | 
			
		||||
  steps:
 | 
			
		||||
    - name: Configure CMake
 | 
			
		||||
      shell: bash
 | 
			
		||||
      working-directory: ${{ inputs.build_dir }}
 | 
			
		||||
      run: |
 | 
			
		||||
        echo 'Configuring CMake.'
 | 
			
		||||
        cmake \
 | 
			
		||||
          -G '${{ inputs.os == 'windows' && 'Visual Studio 17 2022' || 'Ninja' }}' \
 | 
			
		||||
          -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
 | 
			
		||||
          -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
 | 
			
		||||
          ${{ inputs.cmake_args }} \
 | 
			
		||||
          ..
 | 
			
		||||
    - name: Build the binary
 | 
			
		||||
      shell: bash
 | 
			
		||||
      working-directory: ${{ inputs.build_dir }}
 | 
			
		||||
      run: |
 | 
			
		||||
        echo 'Building binary.'
 | 
			
		||||
        cmake \
 | 
			
		||||
          --build . \
 | 
			
		||||
          --config ${{ inputs.build_type }} \
 | 
			
		||||
          --parallel $(nproc) \
 | 
			
		||||
          --target ${{ inputs.cmake_target }}
 | 
			
		||||
    - name: Check linking
 | 
			
		||||
      if: ${{ inputs.os == 'linux' }}
 | 
			
		||||
      shell: bash
 | 
			
		||||
      working-directory: ${{ inputs.build_dir }}
 | 
			
		||||
      run: |
 | 
			
		||||
        echo 'Checking linking.'
 | 
			
		||||
        ldd ./rippled
 | 
			
		||||
        if [ "$(ldd ./rippled | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then
 | 
			
		||||
          echo 'The binary is statically linked.'
 | 
			
		||||
        else
 | 
			
		||||
          echo 'The binary is dynamically linked.'
 | 
			
		||||
          exit 1
 | 
			
		||||
        fi
 | 
			
		||||
    - name: Verify voidstar
 | 
			
		||||
      if: ${{ contains(inputs.cmake_args, '-Dvoidstar=ON') }}
 | 
			
		||||
      shell: bash
 | 
			
		||||
      working-directory: ${{ inputs.build_dir }}
 | 
			
		||||
      run: |
 | 
			
		||||
        echo 'Verifying presence of instrumentation.'
 | 
			
		||||
        ./rippled --version | grep libvoidstar
 | 
			
		||||
    - name: Test the binary
 | 
			
		||||
      if: ${{ inputs.build_only == 'false' }}
 | 
			
		||||
      shell: bash
 | 
			
		||||
      working-directory: ${{ inputs.build_dir }}/${{ inputs.os == 'windows' && inputs.build_type || '' }}
 | 
			
		||||
      run: |
 | 
			
		||||
        echo 'Testing binary.'
 | 
			
		||||
        ./rippled --unittest --unittest-jobs $(nproc)
 | 
			
		||||
        ctest -j $(nproc) --output-on-failure
 | 
			
		||||
    - name: Upload coverage report
 | 
			
		||||
      if: ${{ inputs.cmake_target == 'coverage' }}
 | 
			
		||||
      uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
 | 
			
		||||
      with:
 | 
			
		||||
        disable_search: true
 | 
			
		||||
        disable_telem: true
 | 
			
		||||
        fail_ci_if_error: true
 | 
			
		||||
        files: ${{ inputs.build_dir }}/coverage.xml
 | 
			
		||||
        plugins: noop
 | 
			
		||||
        token: ${{ inputs.codecov_token }}
 | 
			
		||||
        verbose: true
 | 
			
		||||
							
								
								
									
										43
									
								
								.github/actions/print-env/action.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								.github/actions/print-env/action.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
name: Print build environment
 | 
			
		||||
description: "Print environment and some tooling versions"
 | 
			
		||||
 | 
			
		||||
runs:
 | 
			
		||||
  using: composite
 | 
			
		||||
  steps:
 | 
			
		||||
    - name: Check configuration (Windows)
 | 
			
		||||
      if: ${{ runner.os == 'Windows' }}
 | 
			
		||||
      shell: bash
 | 
			
		||||
      run: |
 | 
			
		||||
        echo 'Checking environment variables.'
 | 
			
		||||
        set
 | 
			
		||||
 | 
			
		||||
        echo 'Checking CMake version.'
 | 
			
		||||
        cmake --version
 | 
			
		||||
 | 
			
		||||
        echo 'Checking Conan version.'
 | 
			
		||||
        conan --version
 | 
			
		||||
 | 
			
		||||
    - name: Check configuration (Linux and macOS)
 | 
			
		||||
      if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
 | 
			
		||||
      shell: bash
 | 
			
		||||
      run: |
 | 
			
		||||
        echo 'Checking path.'
 | 
			
		||||
        echo ${PATH} | tr ':' '\n'
 | 
			
		||||
 | 
			
		||||
        echo 'Checking environment variables.'
 | 
			
		||||
        env | sort
 | 
			
		||||
 | 
			
		||||
        echo 'Checking CMake version.'
 | 
			
		||||
        cmake --version
 | 
			
		||||
 | 
			
		||||
        echo 'Checking compiler version.'
 | 
			
		||||
        ${{ runner.os == 'Linux' && '${CC}' || 'clang' }} --version
 | 
			
		||||
 | 
			
		||||
        echo 'Checking Conan version.'
 | 
			
		||||
        conan --version
 | 
			
		||||
 | 
			
		||||
        echo 'Checking Ninja version.'
 | 
			
		||||
        ninja --version
 | 
			
		||||
 | 
			
		||||
        echo 'Checking nproc version.'
 | 
			
		||||
        nproc --version
 | 
			
		||||
							
								
								
									
										7
									
								
								.github/actions/setup-conan/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/actions/setup-conan/action.yml
									
									
									
									
										vendored
									
									
								
							@@ -35,9 +35,12 @@ runs:
 | 
			
		||||
 | 
			
		||||
    - name: Set up Conan remote
 | 
			
		||||
      shell: bash
 | 
			
		||||
      env:
 | 
			
		||||
        CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
 | 
			
		||||
        CONAN_REMOTE_URL: ${{ inputs.conan_remote_url }}
 | 
			
		||||
      run: |
 | 
			
		||||
        echo "Adding Conan remote '${{ inputs.conan_remote_name }}' at ${{ inputs.conan_remote_url }}."
 | 
			
		||||
        conan remote add --index 0 --force ${{ inputs.conan_remote_name }} ${{ inputs.conan_remote_url }}
 | 
			
		||||
        echo "Adding Conan remote '${CONAN_REMOTE_NAME}' at '${CONAN_REMOTE_URL}'."
 | 
			
		||||
        conan remote add --index 0 --force "${CONAN_REMOTE_NAME}" "${CONAN_REMOTE_URL}"
 | 
			
		||||
 | 
			
		||||
        echo 'Listing Conan remotes.'
 | 
			
		||||
        conan remote list
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								.github/scripts/levelization/README.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/scripts/levelization/README.md
									
									
									
									
										vendored
									
									
								
							@@ -72,15 +72,15 @@ It generates many files of [results](results):
 | 
			
		||||
  desired as described above. In a perfect repo, this file will be
 | 
			
		||||
  empty.
 | 
			
		||||
  This file is committed to the repo, and is used by the [levelization
 | 
			
		||||
  Github workflow](../../workflows/check-levelization.yml) to validate
 | 
			
		||||
  Github workflow](../../workflows/reusable-check-levelization.yml) to validate
 | 
			
		||||
  that nothing changed.
 | 
			
		||||
- [`ordering.txt`](results/ordering.txt): A list showing relationships
 | 
			
		||||
  between modules where there are no loops as they actually exist, as
 | 
			
		||||
  opposed to how they are desired as described above.
 | 
			
		||||
  This file is committed to the repo, and is used by the [levelization
 | 
			
		||||
  Github workflow](../../workflows/check-levelization.yml) to validate
 | 
			
		||||
  Github workflow](../../workflows/reusable-check-levelization.yml) to validate
 | 
			
		||||
  that nothing changed.
 | 
			
		||||
- [`levelization.yml`](../../workflows/check-levelization.yml)
 | 
			
		||||
- [`levelization.yml`](../../workflows/reusable-check-levelization.yml)
 | 
			
		||||
  Github Actions workflow to test that levelization loops haven't
 | 
			
		||||
  changed. Unfortunately, if changes are detected, it can't tell if
 | 
			
		||||
  they are improvements or not, so if you have resolved any issues or
 | 
			
		||||
 
 | 
			
		||||
@@ -7,9 +7,6 @@ Loop: test.jtx test.unit_test
 | 
			
		||||
Loop: xrpld.app xrpld.core
 | 
			
		||||
  xrpld.app > xrpld.core
 | 
			
		||||
 | 
			
		||||
Loop: xrpld.app xrpld.ledger
 | 
			
		||||
  xrpld.app > xrpld.ledger
 | 
			
		||||
 | 
			
		||||
Loop: xrpld.app xrpld.overlay
 | 
			
		||||
  xrpld.overlay > xrpld.app
 | 
			
		||||
 | 
			
		||||
@@ -20,7 +17,7 @@ Loop: xrpld.app xrpld.rpc
 | 
			
		||||
  xrpld.rpc > xrpld.app
 | 
			
		||||
 | 
			
		||||
Loop: xrpld.app xrpld.shamap
 | 
			
		||||
  xrpld.app > xrpld.shamap
 | 
			
		||||
  xrpld.shamap ~= xrpld.app
 | 
			
		||||
 | 
			
		||||
Loop: xrpld.core xrpld.perflog
 | 
			
		||||
  xrpld.perflog == xrpld.core
 | 
			
		||||
 
 | 
			
		||||
@@ -2,8 +2,16 @@ libxrpl.basics > xrpl.basics
 | 
			
		||||
libxrpl.crypto > xrpl.basics
 | 
			
		||||
libxrpl.json > xrpl.basics
 | 
			
		||||
libxrpl.json > xrpl.json
 | 
			
		||||
libxrpl.ledger > xrpl.basics
 | 
			
		||||
libxrpl.ledger > xrpl.json
 | 
			
		||||
libxrpl.ledger > xrpl.ledger
 | 
			
		||||
libxrpl.ledger > xrpl.protocol
 | 
			
		||||
libxrpl.net > xrpl.basics
 | 
			
		||||
libxrpl.net > xrpl.net
 | 
			
		||||
libxrpl.nodestore > xrpl.basics
 | 
			
		||||
libxrpl.nodestore > xrpl.json
 | 
			
		||||
libxrpl.nodestore > xrpl.nodestore
 | 
			
		||||
libxrpl.nodestore > xrpl.protocol
 | 
			
		||||
libxrpl.protocol > xrpl.basics
 | 
			
		||||
libxrpl.protocol > xrpl.json
 | 
			
		||||
libxrpl.protocol > xrpl.protocol
 | 
			
		||||
@@ -14,6 +22,9 @@ libxrpl.server > xrpl.basics
 | 
			
		||||
libxrpl.server > xrpl.json
 | 
			
		||||
libxrpl.server > xrpl.protocol
 | 
			
		||||
libxrpl.server > xrpl.server
 | 
			
		||||
libxrpl.shamap > xrpl.basics
 | 
			
		||||
libxrpl.shamap > xrpl.protocol
 | 
			
		||||
libxrpl.shamap > xrpl.shamap
 | 
			
		||||
test.app > test.jtx
 | 
			
		||||
test.app > test.rpc
 | 
			
		||||
test.app > test.toplevel
 | 
			
		||||
@@ -21,11 +32,11 @@ test.app > test.unit_test
 | 
			
		||||
test.app > xrpl.basics
 | 
			
		||||
test.app > xrpld.app
 | 
			
		||||
test.app > xrpld.core
 | 
			
		||||
test.app > xrpld.ledger
 | 
			
		||||
test.app > xrpld.nodestore
 | 
			
		||||
test.app > xrpld.overlay
 | 
			
		||||
test.app > xrpld.rpc
 | 
			
		||||
test.app > xrpl.json
 | 
			
		||||
test.app > xrpl.ledger
 | 
			
		||||
test.app > xrpl.nodestore
 | 
			
		||||
test.app > xrpl.protocol
 | 
			
		||||
test.app > xrpl.resource
 | 
			
		||||
test.basics > test.jtx
 | 
			
		||||
@@ -44,8 +55,8 @@ test.consensus > test.unit_test
 | 
			
		||||
test.consensus > xrpl.basics
 | 
			
		||||
test.consensus > xrpld.app
 | 
			
		||||
test.consensus > xrpld.consensus
 | 
			
		||||
test.consensus > xrpld.ledger
 | 
			
		||||
test.consensus > xrpl.json
 | 
			
		||||
test.consensus > xrpl.ledger
 | 
			
		||||
test.core > test.jtx
 | 
			
		||||
test.core > test.toplevel
 | 
			
		||||
test.core > test.unit_test
 | 
			
		||||
@@ -63,9 +74,9 @@ test.json > xrpl.json
 | 
			
		||||
test.jtx > xrpl.basics
 | 
			
		||||
test.jtx > xrpld.app
 | 
			
		||||
test.jtx > xrpld.core
 | 
			
		||||
test.jtx > xrpld.ledger
 | 
			
		||||
test.jtx > xrpld.rpc
 | 
			
		||||
test.jtx > xrpl.json
 | 
			
		||||
test.jtx > xrpl.ledger
 | 
			
		||||
test.jtx > xrpl.net
 | 
			
		||||
test.jtx > xrpl.protocol
 | 
			
		||||
test.jtx > xrpl.resource
 | 
			
		||||
@@ -75,15 +86,14 @@ test.ledger > test.toplevel
 | 
			
		||||
test.ledger > xrpl.basics
 | 
			
		||||
test.ledger > xrpld.app
 | 
			
		||||
test.ledger > xrpld.core
 | 
			
		||||
test.ledger > xrpld.ledger
 | 
			
		||||
test.ledger > xrpl.ledger
 | 
			
		||||
test.ledger > xrpl.protocol
 | 
			
		||||
test.nodestore > test.jtx
 | 
			
		||||
test.nodestore > test.toplevel
 | 
			
		||||
test.nodestore > test.unit_test
 | 
			
		||||
test.nodestore > xrpl.basics
 | 
			
		||||
test.nodestore > xrpld.core
 | 
			
		||||
test.nodestore > xrpld.nodestore
 | 
			
		||||
test.nodestore > xrpld.unity
 | 
			
		||||
test.nodestore > xrpl.nodestore
 | 
			
		||||
test.overlay > test.jtx
 | 
			
		||||
test.overlay > test.toplevel
 | 
			
		||||
test.overlay > test.unit_test
 | 
			
		||||
@@ -91,8 +101,8 @@ test.overlay > xrpl.basics
 | 
			
		||||
test.overlay > xrpld.app
 | 
			
		||||
test.overlay > xrpld.overlay
 | 
			
		||||
test.overlay > xrpld.peerfinder
 | 
			
		||||
test.overlay > xrpld.shamap
 | 
			
		||||
test.overlay > xrpl.protocol
 | 
			
		||||
test.overlay > xrpl.shamap
 | 
			
		||||
test.peerfinder > test.beast
 | 
			
		||||
test.peerfinder > test.unit_test
 | 
			
		||||
test.peerfinder > xrpl.basics
 | 
			
		||||
@@ -127,15 +137,21 @@ test.server > xrpl.json
 | 
			
		||||
test.server > xrpl.server
 | 
			
		||||
test.shamap > test.unit_test
 | 
			
		||||
test.shamap > xrpl.basics
 | 
			
		||||
test.shamap > xrpld.nodestore
 | 
			
		||||
test.shamap > xrpld.shamap
 | 
			
		||||
test.shamap > xrpl.nodestore
 | 
			
		||||
test.shamap > xrpl.protocol
 | 
			
		||||
test.shamap > xrpl.shamap
 | 
			
		||||
test.toplevel > test.csf
 | 
			
		||||
test.toplevel > xrpl.json
 | 
			
		||||
test.unit_test > xrpl.basics
 | 
			
		||||
tests.libxrpl > xrpl.basics
 | 
			
		||||
tests.libxrpl > xrpl.json
 | 
			
		||||
tests.libxrpl > xrpl.net
 | 
			
		||||
xrpl.json > xrpl.basics
 | 
			
		||||
xrpl.ledger > xrpl.basics
 | 
			
		||||
xrpl.ledger > xrpl.protocol
 | 
			
		||||
xrpl.net > xrpl.basics
 | 
			
		||||
xrpl.nodestore > xrpl.basics
 | 
			
		||||
xrpl.nodestore > xrpl.protocol
 | 
			
		||||
xrpl.protocol > xrpl.basics
 | 
			
		||||
xrpl.protocol > xrpl.json
 | 
			
		||||
xrpl.resource > xrpl.basics
 | 
			
		||||
@@ -144,16 +160,21 @@ xrpl.resource > xrpl.protocol
 | 
			
		||||
xrpl.server > xrpl.basics
 | 
			
		||||
xrpl.server > xrpl.json
 | 
			
		||||
xrpl.server > xrpl.protocol
 | 
			
		||||
xrpl.shamap > xrpl.basics
 | 
			
		||||
xrpl.shamap > xrpl.nodestore
 | 
			
		||||
xrpl.shamap > xrpl.protocol
 | 
			
		||||
xrpld.app > test.unit_test
 | 
			
		||||
xrpld.app > xrpl.basics
 | 
			
		||||
xrpld.app > xrpld.conditions
 | 
			
		||||
xrpld.app > xrpld.consensus
 | 
			
		||||
xrpld.app > xrpld.nodestore
 | 
			
		||||
xrpld.app > xrpld.perflog
 | 
			
		||||
xrpld.app > xrpl.json
 | 
			
		||||
xrpld.app > xrpl.ledger
 | 
			
		||||
xrpld.app > xrpl.net
 | 
			
		||||
xrpld.app > xrpl.nodestore
 | 
			
		||||
xrpld.app > xrpl.protocol
 | 
			
		||||
xrpld.app > xrpl.resource
 | 
			
		||||
xrpld.app > xrpl.shamap
 | 
			
		||||
xrpld.conditions > xrpl.basics
 | 
			
		||||
xrpld.conditions > xrpl.protocol
 | 
			
		||||
xrpld.consensus > xrpl.basics
 | 
			
		||||
@@ -163,14 +184,6 @@ xrpld.core > xrpl.basics
 | 
			
		||||
xrpld.core > xrpl.json
 | 
			
		||||
xrpld.core > xrpl.net
 | 
			
		||||
xrpld.core > xrpl.protocol
 | 
			
		||||
xrpld.ledger > xrpl.basics
 | 
			
		||||
xrpld.ledger > xrpl.json
 | 
			
		||||
xrpld.ledger > xrpl.protocol
 | 
			
		||||
xrpld.nodestore > xrpl.basics
 | 
			
		||||
xrpld.nodestore > xrpld.core
 | 
			
		||||
xrpld.nodestore > xrpld.unity
 | 
			
		||||
xrpld.nodestore > xrpl.json
 | 
			
		||||
xrpld.nodestore > xrpl.protocol
 | 
			
		||||
xrpld.overlay > xrpl.basics
 | 
			
		||||
xrpld.overlay > xrpld.core
 | 
			
		||||
xrpld.overlay > xrpld.peerfinder
 | 
			
		||||
@@ -186,13 +199,11 @@ xrpld.perflog > xrpl.basics
 | 
			
		||||
xrpld.perflog > xrpl.json
 | 
			
		||||
xrpld.rpc > xrpl.basics
 | 
			
		||||
xrpld.rpc > xrpld.core
 | 
			
		||||
xrpld.rpc > xrpld.ledger
 | 
			
		||||
xrpld.rpc > xrpld.nodestore
 | 
			
		||||
xrpld.rpc > xrpl.json
 | 
			
		||||
xrpld.rpc > xrpl.ledger
 | 
			
		||||
xrpld.rpc > xrpl.net
 | 
			
		||||
xrpld.rpc > xrpl.nodestore
 | 
			
		||||
xrpld.rpc > xrpl.protocol
 | 
			
		||||
xrpld.rpc > xrpl.resource
 | 
			
		||||
xrpld.rpc > xrpl.server
 | 
			
		||||
xrpld.shamap > xrpl.basics
 | 
			
		||||
xrpld.shamap > xrpld.nodestore
 | 
			
		||||
xrpld.shamap > xrpl.protocol
 | 
			
		||||
xrpld.shamap > xrpl.shamap
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								.github/scripts/strategy-matrix/generate.py
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.github/scripts/strategy-matrix/generate.py
									
									
									
									
										vendored
									
									
								
							@@ -74,14 +74,14 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
 | 
			
		||||
                    continue
 | 
			
		||||
 | 
			
		||||
            # RHEL:
 | 
			
		||||
            # - 9.4 using GCC 12: Debug and Unity on linux/amd64.
 | 
			
		||||
            # - 9.6 using Clang: Release and no Unity on linux/amd64.
 | 
			
		||||
            # - 9 using GCC 12: Debug and Unity on linux/amd64.
 | 
			
		||||
            # - 10 using Clang: Release and no Unity on linux/amd64.
 | 
			
		||||
            if os['distro_name'] == 'rhel':
 | 
			
		||||
                skip = True
 | 
			
		||||
                if os['distro_version'] == '9.4':
 | 
			
		||||
                if os['distro_version'] == '9':
 | 
			
		||||
                    if f'{os['compiler_name']}-{os['compiler_version']}' == 'gcc-12' and build_type == 'Debug' and '-Dunity=ON' in cmake_args and architecture['platform'] == 'linux/amd64':
 | 
			
		||||
                        skip = False
 | 
			
		||||
                elif os['distro_version'] == '9.6':
 | 
			
		||||
                elif os['distro_version'] == '10':
 | 
			
		||||
                    if f'{os['compiler_name']}-{os['compiler_version']}' == 'clang-any' and build_type == 'Release' and '-Dunity=OFF' in cmake_args and architecture['platform'] == 'linux/amd64':
 | 
			
		||||
                        skip = False
 | 
			
		||||
                if skip:
 | 
			
		||||
@@ -162,7 +162,7 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
 | 
			
		||||
            'config_name': config_name,
 | 
			
		||||
            'cmake_args': cmake_args,
 | 
			
		||||
            'cmake_target': cmake_target,
 | 
			
		||||
            'build_only': 'true' if build_only else 'false',
 | 
			
		||||
            'build_only': build_only,
 | 
			
		||||
            'build_type': build_type,
 | 
			
		||||
            'os': os,
 | 
			
		||||
            'architecture': architecture,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										122
									
								
								.github/scripts/strategy-matrix/linux.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										122
									
								
								.github/scripts/strategy-matrix/linux.json
									
									
									
									
										vendored
									
									
								
							@@ -14,139 +14,169 @@
 | 
			
		||||
      "distro_name": "debian",
 | 
			
		||||
      "distro_version": "bookworm",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "12"
 | 
			
		||||
      "compiler_version": "12",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "debian",
 | 
			
		||||
      "distro_version": "bookworm",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "13"
 | 
			
		||||
      "compiler_version": "13",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "debian",
 | 
			
		||||
      "distro_version": "bookworm",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "14"
 | 
			
		||||
      "compiler_version": "14",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "debian",
 | 
			
		||||
      "distro_version": "bookworm",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "15"
 | 
			
		||||
      "compiler_version": "15",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "debian",
 | 
			
		||||
      "distro_version": "bookworm",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "16"
 | 
			
		||||
      "compiler_version": "16",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "debian",
 | 
			
		||||
      "distro_version": "bookworm",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "17"
 | 
			
		||||
      "compiler_version": "17",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "debian",
 | 
			
		||||
      "distro_version": "bookworm",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "18"
 | 
			
		||||
      "compiler_version": "18",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "debian",
 | 
			
		||||
      "distro_version": "bookworm",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "19"
 | 
			
		||||
      "compiler_version": "19",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "debian",
 | 
			
		||||
      "distro_version": "bookworm",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "20"
 | 
			
		||||
      "compiler_version": "20",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9.4",
 | 
			
		||||
      "distro_version": "8",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "12"
 | 
			
		||||
      "compiler_version": "14",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9.4",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "13"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9.4",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "14"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9.6",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "13"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9.6",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "14"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9.4",
 | 
			
		||||
      "distro_version": "8",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "any"
 | 
			
		||||
      "compiler_version": "any",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9.6",
 | 
			
		||||
      "distro_version": "9",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "12",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "13",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "14",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "9",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "any"
 | 
			
		||||
      "compiler_version": "any",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "10",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "14",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "rhel",
 | 
			
		||||
      "distro_version": "10",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "any",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "ubuntu",
 | 
			
		||||
      "distro_version": "jammy",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "12"
 | 
			
		||||
      "compiler_version": "12",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "ubuntu",
 | 
			
		||||
      "distro_version": "noble",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "13"
 | 
			
		||||
      "compiler_version": "13",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "ubuntu",
 | 
			
		||||
      "distro_version": "noble",
 | 
			
		||||
      "compiler_name": "gcc",
 | 
			
		||||
      "compiler_version": "14"
 | 
			
		||||
      "compiler_version": "14",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "ubuntu",
 | 
			
		||||
      "distro_version": "noble",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "16"
 | 
			
		||||
      "compiler_version": "16",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "ubuntu",
 | 
			
		||||
      "distro_version": "noble",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "17"
 | 
			
		||||
      "compiler_version": "17",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "ubuntu",
 | 
			
		||||
      "distro_version": "noble",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "18"
 | 
			
		||||
      "compiler_version": "18",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "distro_name": "ubuntu",
 | 
			
		||||
      "distro_version": "noble",
 | 
			
		||||
      "compiler_name": "clang",
 | 
			
		||||
      "compiler_version": "19"
 | 
			
		||||
      "compiler_version": "19",
 | 
			
		||||
      "image_sha": "97ba375"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "build_type": ["Debug", "Release"],
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								.github/scripts/strategy-matrix/macos.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/scripts/strategy-matrix/macos.json
									
									
									
									
										vendored
									
									
								
							@@ -10,7 +10,8 @@
 | 
			
		||||
      "distro_name": "macos",
 | 
			
		||||
      "distro_version": "",
 | 
			
		||||
      "compiler_name": "",
 | 
			
		||||
      "compiler_version": ""
 | 
			
		||||
      "compiler_version": "",
 | 
			
		||||
      "image_sha": ""
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "build_type": ["Debug", "Release"],
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								.github/scripts/strategy-matrix/windows.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/scripts/strategy-matrix/windows.json
									
									
									
									
										vendored
									
									
								
							@@ -2,7 +2,7 @@
 | 
			
		||||
  "architecture": [
 | 
			
		||||
    {
 | 
			
		||||
      "platform": "windows/amd64",
 | 
			
		||||
      "runner": ["windows-latest"]
 | 
			
		||||
      "runner": ["self-hosted", "Windows", "devbox"]
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "os": [
 | 
			
		||||
@@ -10,7 +10,8 @@
 | 
			
		||||
      "distro_name": "windows",
 | 
			
		||||
      "distro_version": "",
 | 
			
		||||
      "compiler_name": "",
 | 
			
		||||
      "compiler_version": ""
 | 
			
		||||
      "compiler_version": "",
 | 
			
		||||
      "image_sha": ""
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "build_type": ["Debug", "Release"],
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										146
									
								
								.github/workflows/build-test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										146
									
								
								.github/workflows/build-test.yml
									
									
									
									
										vendored
									
									
								
							@@ -1,146 +0,0 @@
 | 
			
		||||
# This workflow builds and tests the binary for various configurations.
 | 
			
		||||
name: Build and test
 | 
			
		||||
 | 
			
		||||
# This workflow can only be triggered by other workflows. Note that the
 | 
			
		||||
# workflow_call event does not support the 'choice' input type, see
 | 
			
		||||
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onworkflow_callinputsinput_idtype,
 | 
			
		||||
# so we use 'string' instead.
 | 
			
		||||
on:
 | 
			
		||||
  workflow_call:
 | 
			
		||||
    inputs:
 | 
			
		||||
      build_dir:
 | 
			
		||||
        description: "The directory where to build."
 | 
			
		||||
        required: false
 | 
			
		||||
        type: string
 | 
			
		||||
        default: ".build"
 | 
			
		||||
      dependencies_force_build:
 | 
			
		||||
        description: "Force building of all dependencies."
 | 
			
		||||
        required: false
 | 
			
		||||
        type: boolean
 | 
			
		||||
        default: false
 | 
			
		||||
      dependencies_force_upload:
 | 
			
		||||
        description: "Force uploading of all dependencies."
 | 
			
		||||
        required: false
 | 
			
		||||
        type: boolean
 | 
			
		||||
        default: false
 | 
			
		||||
      os:
 | 
			
		||||
        description: 'The operating system to use for the build ("linux", "macos", "windows").'
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
      strategy_matrix:
 | 
			
		||||
        # TODO: Support additional strategies, e.g. "ubuntu" for generating all Ubuntu configurations.
 | 
			
		||||
        description: 'The strategy matrix to use for generating the configurations ("minimal", "all").'
 | 
			
		||||
        required: false
 | 
			
		||||
        type: string
 | 
			
		||||
        default: "minimal"
 | 
			
		||||
    secrets:
 | 
			
		||||
      codecov_token:
 | 
			
		||||
        description: "The Codecov token to use for uploading coverage reports."
 | 
			
		||||
        required: false
 | 
			
		||||
 | 
			
		||||
concurrency:
 | 
			
		||||
  group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.os }}
 | 
			
		||||
  cancel-in-progress: true
 | 
			
		||||
 | 
			
		||||
defaults:
 | 
			
		||||
  run:
 | 
			
		||||
    shell: bash
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  # Generate the strategy matrix to be used by the following job.
 | 
			
		||||
  generate-matrix:
 | 
			
		||||
    uses: ./.github/workflows/reusable-strategy-matrix.yml
 | 
			
		||||
    with:
 | 
			
		||||
      os: ${{ inputs.os }}
 | 
			
		||||
      strategy_matrix: ${{ inputs.strategy_matrix }}
 | 
			
		||||
 | 
			
		||||
  # Build and test the binary.
 | 
			
		||||
  build-test:
 | 
			
		||||
    needs:
 | 
			
		||||
      - generate-matrix
 | 
			
		||||
    strategy:
 | 
			
		||||
      fail-fast: false
 | 
			
		||||
      matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
 | 
			
		||||
    runs-on: ${{ matrix.architecture.runner }}
 | 
			
		||||
    container: ${{ inputs.os == 'linux' && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version) || null }}
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Check strategy matrix
 | 
			
		||||
        run: |
 | 
			
		||||
          echo 'Operating system distro name: ${{ matrix.os.distro_name }}'
 | 
			
		||||
          echo 'Operating system distro version: ${{ matrix.os.distro_version }}'
 | 
			
		||||
          echo 'Operating system compiler name: ${{ matrix.os.compiler_name }}'
 | 
			
		||||
          echo 'Operating system compiler version: ${{ matrix.os.compiler_version }}'
 | 
			
		||||
          echo 'Architecture platform: ${{ matrix.architecture.platform }}'
 | 
			
		||||
          echo 'Architecture runner: ${{ toJson(matrix.architecture.runner) }}'
 | 
			
		||||
          echo 'Build type: ${{ matrix.build_type }}'
 | 
			
		||||
          echo 'Build only: ${{ matrix.build_only }}'
 | 
			
		||||
          echo 'CMake arguments: ${{ matrix.cmake_args }}'
 | 
			
		||||
          echo 'CMake target: ${{ matrix.cmake_target }}'
 | 
			
		||||
          echo 'Config name: ${{ matrix.config_name }}'
 | 
			
		||||
 | 
			
		||||
      - name: Cleanup workspace
 | 
			
		||||
        if: ${{ runner.os == 'macOS' }}
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e
 | 
			
		||||
 | 
			
		||||
      - name: Checkout repository
 | 
			
		||||
        uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
 | 
			
		||||
      - name: Prepare runner
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/prepare-runner@638e0dc11ea230f91bd26622fb542116bb5254d5
 | 
			
		||||
        with:
 | 
			
		||||
          disable_ccache: false
 | 
			
		||||
 | 
			
		||||
      - name: Check configuration (Windows)
 | 
			
		||||
        if: ${{ inputs.os == 'windows' }}
 | 
			
		||||
        run: |
 | 
			
		||||
          echo 'Checking environment variables.'
 | 
			
		||||
          set
 | 
			
		||||
 | 
			
		||||
          echo 'Checking CMake version.'
 | 
			
		||||
          cmake --version
 | 
			
		||||
 | 
			
		||||
          echo 'Checking Conan version.'
 | 
			
		||||
          conan --version
 | 
			
		||||
      - name: Check configuration (Linux and MacOS)
 | 
			
		||||
        if: ${{ inputs.os == 'linux' || inputs.os == 'macos' }}
 | 
			
		||||
        run: |
 | 
			
		||||
          echo 'Checking path.'
 | 
			
		||||
          echo ${PATH} | tr ':' '\n'
 | 
			
		||||
 | 
			
		||||
          echo 'Checking environment variables.'
 | 
			
		||||
          env | sort
 | 
			
		||||
 | 
			
		||||
          echo 'Checking CMake version.'
 | 
			
		||||
          cmake --version
 | 
			
		||||
 | 
			
		||||
          echo 'Checking compiler version.'
 | 
			
		||||
          ${{ inputs.os == 'linux' && '${CC}' || 'clang' }} --version
 | 
			
		||||
 | 
			
		||||
          echo 'Checking Conan version.'
 | 
			
		||||
          conan --version
 | 
			
		||||
 | 
			
		||||
          echo 'Checking Ninja version.'
 | 
			
		||||
          ninja --version
 | 
			
		||||
 | 
			
		||||
          echo 'Checking nproc version.'
 | 
			
		||||
          nproc --version
 | 
			
		||||
 | 
			
		||||
      - name: Setup Conan
 | 
			
		||||
        uses: ./.github/actions/setup-conan
 | 
			
		||||
 | 
			
		||||
      - name: Build dependencies
 | 
			
		||||
        uses: ./.github/actions/build-deps
 | 
			
		||||
        with:
 | 
			
		||||
          build_dir: ${{ inputs.build_dir }}
 | 
			
		||||
          build_type: ${{ matrix.build_type }}
 | 
			
		||||
          force_build: ${{ inputs.dependencies_force_build }}
 | 
			
		||||
 | 
			
		||||
      - name: Build and test binary
 | 
			
		||||
        uses: ./.github/actions/build-test
 | 
			
		||||
        with:
 | 
			
		||||
          build_dir: ${{ inputs.build_dir }}
 | 
			
		||||
          build_only: ${{ matrix.build_only }}
 | 
			
		||||
          build_type: ${{ matrix.build_type }}
 | 
			
		||||
          cmake_args: ${{ matrix.cmake_args }}
 | 
			
		||||
          cmake_target: ${{ matrix.cmake_target }}
 | 
			
		||||
          codecov_token: ${{ secrets.codecov_token }}
 | 
			
		||||
          os: ${{ inputs.os }}
 | 
			
		||||
							
								
								
									
										18
									
								
								.github/workflows/on-pr.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/on-pr.yml
									
									
									
									
										vendored
									
									
								
							@@ -50,8 +50,8 @@ jobs:
 | 
			
		||||
          files: |
 | 
			
		||||
            # These paths are unique to `on-pr.yml`.
 | 
			
		||||
            .github/scripts/levelization/**
 | 
			
		||||
            .github/workflows/check-levelization.yml
 | 
			
		||||
            .github/workflows/notify-clio.yml
 | 
			
		||||
            .github/workflows/reusable-check-levelization.yml
 | 
			
		||||
            .github/workflows/reusable-notify-clio.yml
 | 
			
		||||
            .github/workflows/on-pr.yml
 | 
			
		||||
 | 
			
		||||
            # Keep the paths below in sync with those in `on-trigger.yml`.
 | 
			
		||||
@@ -59,8 +59,11 @@ jobs:
 | 
			
		||||
            .github/actions/build-test/**
 | 
			
		||||
            .github/actions/setup-conan/**
 | 
			
		||||
            .github/scripts/strategy-matrix/**
 | 
			
		||||
            .github/workflows/build-test.yml
 | 
			
		||||
            .github/workflows/reusable-build.yml
 | 
			
		||||
            .github/workflows/reusable-build-test-config.yml
 | 
			
		||||
            .github/workflows/reusable-build-test.yml
 | 
			
		||||
            .github/workflows/reusable-strategy-matrix.yml
 | 
			
		||||
            .github/workflows/reusable-test.yml
 | 
			
		||||
            .codecov.yml
 | 
			
		||||
            cmake/**
 | 
			
		||||
            conan/**
 | 
			
		||||
@@ -93,26 +96,27 @@ jobs:
 | 
			
		||||
  check-levelization:
 | 
			
		||||
    needs: should-run
 | 
			
		||||
    if: ${{ needs.should-run.outputs.go == 'true' }}
 | 
			
		||||
    uses: ./.github/workflows/check-levelization.yml
 | 
			
		||||
    uses: ./.github/workflows/reusable-check-levelization.yml
 | 
			
		||||
 | 
			
		||||
  build-test:
 | 
			
		||||
    needs: should-run
 | 
			
		||||
    if: ${{ needs.should-run.outputs.go == 'true' }}
 | 
			
		||||
    uses: ./.github/workflows/build-test.yml
 | 
			
		||||
    uses: ./.github/workflows/reusable-build-test.yml
 | 
			
		||||
    strategy:
 | 
			
		||||
      fail-fast: false
 | 
			
		||||
      matrix:
 | 
			
		||||
        os: [linux, macos, windows]
 | 
			
		||||
    with:
 | 
			
		||||
      os: ${{ matrix.os }}
 | 
			
		||||
    secrets:
 | 
			
		||||
      codecov_token: ${{ secrets.CODECOV_TOKEN }}
 | 
			
		||||
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
 | 
			
		||||
 | 
			
		||||
  notify-clio:
 | 
			
		||||
    needs:
 | 
			
		||||
      - should-run
 | 
			
		||||
      - build-test
 | 
			
		||||
    if: ${{ needs.should-run.outputs.go == 'true' && contains(fromJSON('["release", "master"]'), github.ref_name) }}
 | 
			
		||||
    uses: ./.github/workflows/notify-clio.yml
 | 
			
		||||
    uses: ./.github/workflows/reusable-notify-clio.yml
 | 
			
		||||
    secrets:
 | 
			
		||||
      clio_notify_token: ${{ secrets.CLIO_NOTIFY_TOKEN }}
 | 
			
		||||
      conan_remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										45
									
								
								.github/workflows/on-trigger.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										45
									
								
								.github/workflows/on-trigger.yml
									
									
									
									
										vendored
									
									
								
							@@ -9,12 +9,12 @@ name: Trigger
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
      - develop
 | 
			
		||||
      - release
 | 
			
		||||
      - master
 | 
			
		||||
      - "develop"
 | 
			
		||||
      - "release*"
 | 
			
		||||
      - "master"
 | 
			
		||||
    paths:
 | 
			
		||||
      # These paths are unique to `on-trigger.yml`.
 | 
			
		||||
      - ".github/workflows/check-missing-commits.yml"
 | 
			
		||||
      - ".github/workflows/reusable-check-missing-commits.yml"
 | 
			
		||||
      - ".github/workflows/on-trigger.yml"
 | 
			
		||||
      - ".github/workflows/publish-docs.yml"
 | 
			
		||||
 | 
			
		||||
@@ -23,8 +23,11 @@ on:
 | 
			
		||||
      - ".github/actions/build-test/**"
 | 
			
		||||
      - ".github/actions/setup-conan/**"
 | 
			
		||||
      - ".github/scripts/strategy-matrix/**"
 | 
			
		||||
      - ".github/workflows/build-test.yml"
 | 
			
		||||
      - ".github/workflows/reusable-build.yml"
 | 
			
		||||
      - ".github/workflows/reusable-build-test-config.yml"
 | 
			
		||||
      - ".github/workflows/reusable-build-test.yml"
 | 
			
		||||
      - ".github/workflows/reusable-strategy-matrix.yml"
 | 
			
		||||
      - ".github/workflows/reusable-test.yml"
 | 
			
		||||
      - ".codecov.yml"
 | 
			
		||||
      - "cmake/**"
 | 
			
		||||
      - "conan/**"
 | 
			
		||||
@@ -43,25 +46,16 @@ on:
 | 
			
		||||
  schedule:
 | 
			
		||||
    - cron: "32 6 * * 1-5"
 | 
			
		||||
 | 
			
		||||
  # Run when manually triggered via the GitHub UI or API. If `force_upload` is
 | 
			
		||||
  # true, then the dependencies that were missing (`force_rebuild` is false) or
 | 
			
		||||
  # rebuilt (`force_rebuild` is true) will be uploaded, overwriting existing
 | 
			
		||||
  # dependencies if needed.
 | 
			
		||||
  # Run when manually triggered via the GitHub UI or API.
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
    inputs:
 | 
			
		||||
      dependencies_force_build:
 | 
			
		||||
        description: "Force building of all dependencies."
 | 
			
		||||
        required: false
 | 
			
		||||
        type: boolean
 | 
			
		||||
        default: false
 | 
			
		||||
      dependencies_force_upload:
 | 
			
		||||
        description: "Force uploading of all dependencies."
 | 
			
		||||
        required: false
 | 
			
		||||
        type: boolean
 | 
			
		||||
        default: false
 | 
			
		||||
 | 
			
		||||
concurrency:
 | 
			
		||||
  group: ${{ github.workflow }}-${{ github.ref }}
 | 
			
		||||
  # When a PR is merged into the develop branch it will be assigned a unique
 | 
			
		||||
  # group identifier, so execution will continue even if another PR is merged
 | 
			
		||||
  # while it is still running. In all other cases the group identifier is shared
 | 
			
		||||
  # per branch, so that any in-progress runs are cancelled when a new commit is
 | 
			
		||||
  # pushed.
 | 
			
		||||
  group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' && github.sha || github.ref }}
 | 
			
		||||
  cancel-in-progress: true
 | 
			
		||||
 | 
			
		||||
defaults:
 | 
			
		||||
@@ -71,15 +65,16 @@ defaults:
 | 
			
		||||
jobs:
 | 
			
		||||
  check-missing-commits:
 | 
			
		||||
    if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && contains(fromJSON('["develop", "release"]'), github.ref_name) }}
 | 
			
		||||
    uses: ./.github/workflows/check-missing-commits.yml
 | 
			
		||||
    uses: ./.github/workflows/reusable-check-missing-commits.yml
 | 
			
		||||
 | 
			
		||||
  build-test:
 | 
			
		||||
    uses: ./.github/workflows/build-test.yml
 | 
			
		||||
    uses: ./.github/workflows/reusable-build-test.yml
 | 
			
		||||
    strategy:
 | 
			
		||||
      fail-fast: ${{ github.event_name == 'merge_group' }}
 | 
			
		||||
      matrix:
 | 
			
		||||
        os: [linux, macos, windows]
 | 
			
		||||
    with:
 | 
			
		||||
      os: ${{ matrix.os }}
 | 
			
		||||
      strategy_matrix: "minimal"
 | 
			
		||||
      strategy_matrix: ${{ github.event_name == 'schedule' && 'all' || 'minimal' }}
 | 
			
		||||
    secrets:
 | 
			
		||||
      codecov_token: ${{ secrets.CODECOV_TOKEN }}
 | 
			
		||||
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								.github/workflows/pre-commit.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.github/workflows/pre-commit.yml
									
									
									
									
										vendored
									
									
								
							@@ -7,8 +7,9 @@ on:
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  # Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks.
 | 
			
		||||
  run-hooks:
 | 
			
		||||
    uses: XRPLF/actions/.github/workflows/pre-commit.yml@af1b0f0d764cda2e5435f5ac97b240d4bd4d95d3
 | 
			
		||||
    uses: XRPLF/actions/.github/workflows/pre-commit.yml@34790936fae4c6c751f62ec8c06696f9c1a5753a
 | 
			
		||||
    with:
 | 
			
		||||
      runs_on: ubuntu-latest
 | 
			
		||||
      container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit" }'
 | 
			
		||||
      container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-a8c7be1" }'
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								.github/workflows/publish-docs.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								.github/workflows/publish-docs.yml
									
									
									
									
										vendored
									
									
								
							@@ -23,16 +23,24 @@ defaults:
 | 
			
		||||
 | 
			
		||||
env:
 | 
			
		||||
  BUILD_DIR: .build
 | 
			
		||||
  NPROC_SUBTRACT: 2
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  publish:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    container: ghcr.io/xrplf/ci/tools-rippled-documentation
 | 
			
		||||
    container: ghcr.io/xrplf/ci/tools-rippled-documentation:sha-a8c7be1
 | 
			
		||||
    permissions:
 | 
			
		||||
      contents: write
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Checkout repository
 | 
			
		||||
        uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
 | 
			
		||||
 | 
			
		||||
      - name: Get number of processors
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
 | 
			
		||||
        id: nproc
 | 
			
		||||
        with:
 | 
			
		||||
          subtract: ${{ env.NPROC_SUBTRACT }}
 | 
			
		||||
 | 
			
		||||
      - name: Check configuration
 | 
			
		||||
        run: |
 | 
			
		||||
          echo 'Checking path.'
 | 
			
		||||
@@ -46,12 +54,16 @@ jobs:
 | 
			
		||||
 | 
			
		||||
          echo 'Checking Doxygen version.'
 | 
			
		||||
          doxygen --version
 | 
			
		||||
 | 
			
		||||
      - name: Build documentation
 | 
			
		||||
        env:
 | 
			
		||||
          BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
 | 
			
		||||
        run: |
 | 
			
		||||
          mkdir -p ${{ env.BUILD_DIR }}
 | 
			
		||||
          cd ${{ env.BUILD_DIR }}
 | 
			
		||||
          mkdir -p "${BUILD_DIR}"
 | 
			
		||||
          cd "${BUILD_DIR}"
 | 
			
		||||
          cmake -Donly_docs=ON ..
 | 
			
		||||
          cmake --build . --target docs --parallel $(nproc)
 | 
			
		||||
          cmake --build . --target docs --parallel ${BUILD_NPROC}
 | 
			
		||||
 | 
			
		||||
      - name: Publish documentation
 | 
			
		||||
        if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
 | 
			
		||||
        uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										77
									
								
								.github/workflows/reusable-build-test-config.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								.github/workflows/reusable-build-test-config.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,77 @@
 | 
			
		||||
name: Build and test configuration
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  workflow_call:
 | 
			
		||||
    inputs:
 | 
			
		||||
      build_dir:
 | 
			
		||||
        description: "The directory where to build."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
      build_only:
 | 
			
		||||
        description: 'Whether to only build or to build and test the code ("true", "false").'
 | 
			
		||||
        required: true
 | 
			
		||||
        type: boolean
 | 
			
		||||
      build_type:
 | 
			
		||||
        description: 'The build type to use ("Debug", "Release").'
 | 
			
		||||
        type: string
 | 
			
		||||
        required: true
 | 
			
		||||
      cmake_args:
 | 
			
		||||
        description: "Additional arguments to pass to CMake."
 | 
			
		||||
        required: false
 | 
			
		||||
        type: string
 | 
			
		||||
        default: ""
 | 
			
		||||
      cmake_target:
 | 
			
		||||
        description: "The CMake target to build."
 | 
			
		||||
        type: string
 | 
			
		||||
        required: true
 | 
			
		||||
 | 
			
		||||
      runs_on:
 | 
			
		||||
        description: Runner to run the job on as a JSON string
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
      image:
 | 
			
		||||
        description: "The image to run in (leave empty to run natively)"
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
 | 
			
		||||
      config_name:
 | 
			
		||||
        description: "The configuration string (used for naming artifacts and such)."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
 | 
			
		||||
      nproc_subtract:
 | 
			
		||||
        description: "The number of processors to subtract when calculating parallelism."
 | 
			
		||||
        required: false
 | 
			
		||||
        type: number
 | 
			
		||||
        default: 2
 | 
			
		||||
 | 
			
		||||
    secrets:
 | 
			
		||||
      CODECOV_TOKEN:
 | 
			
		||||
        description: "The Codecov token to use for uploading coverage reports."
 | 
			
		||||
        required: true
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  build:
 | 
			
		||||
    uses: ./.github/workflows/reusable-build.yml
 | 
			
		||||
    with:
 | 
			
		||||
      build_dir: ${{ inputs.build_dir }}
 | 
			
		||||
      build_type: ${{ inputs.build_type }}
 | 
			
		||||
      cmake_args: ${{ inputs.cmake_args }}
 | 
			
		||||
      cmake_target: ${{ inputs.cmake_target }}
 | 
			
		||||
      runs_on: ${{ inputs.runs_on }}
 | 
			
		||||
      image: ${{ inputs.image }}
 | 
			
		||||
      config_name: ${{ inputs.config_name }}
 | 
			
		||||
      nproc_subtract: ${{ inputs.nproc_subtract }}
 | 
			
		||||
    secrets:
 | 
			
		||||
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
 | 
			
		||||
 | 
			
		||||
  test:
 | 
			
		||||
    needs: build
 | 
			
		||||
    uses: ./.github/workflows/reusable-test.yml
 | 
			
		||||
    with:
 | 
			
		||||
      run_tests: ${{ !inputs.build_only }}
 | 
			
		||||
      verify_voidstar: ${{ contains(inputs.cmake_args, '-Dvoidstar=ON') }}
 | 
			
		||||
      runs_on: ${{ inputs.runs_on }}
 | 
			
		||||
      image: ${{ inputs.image }}
 | 
			
		||||
      config_name: ${{ inputs.config_name }}
 | 
			
		||||
      nproc_subtract: ${{ inputs.nproc_subtract }}
 | 
			
		||||
							
								
								
									
										58
									
								
								.github/workflows/reusable-build-test.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								.github/workflows/reusable-build-test.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
			
		||||
# This workflow builds and tests the binary for various configurations.
 | 
			
		||||
name: Build and test
 | 
			
		||||
 | 
			
		||||
# This workflow can only be triggered by other workflows. Note that the
 | 
			
		||||
# workflow_call event does not support the 'choice' input type, see
 | 
			
		||||
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onworkflow_callinputsinput_idtype,
 | 
			
		||||
# so we use 'string' instead.
 | 
			
		||||
on:
 | 
			
		||||
  workflow_call:
 | 
			
		||||
    inputs:
 | 
			
		||||
      build_dir:
 | 
			
		||||
        description: "The directory where to build."
 | 
			
		||||
        required: false
 | 
			
		||||
        type: string
 | 
			
		||||
        default: ".build"
 | 
			
		||||
      os:
 | 
			
		||||
        description: 'The operating system to use for the build ("linux", "macos", "windows").'
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
      strategy_matrix:
 | 
			
		||||
        # TODO: Support additional strategies, e.g. "ubuntu" for generating all Ubuntu configurations.
 | 
			
		||||
        description: 'The strategy matrix to use for generating the configurations ("minimal", "all").'
 | 
			
		||||
        required: false
 | 
			
		||||
        type: string
 | 
			
		||||
        default: "minimal"
 | 
			
		||||
    secrets:
 | 
			
		||||
      CODECOV_TOKEN:
 | 
			
		||||
        description: "The Codecov token to use for uploading coverage reports."
 | 
			
		||||
        required: true
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  # Generate the strategy matrix to be used by the following job.
 | 
			
		||||
  generate-matrix:
 | 
			
		||||
    uses: ./.github/workflows/reusable-strategy-matrix.yml
 | 
			
		||||
    with:
 | 
			
		||||
      os: ${{ inputs.os }}
 | 
			
		||||
      strategy_matrix: ${{ inputs.strategy_matrix }}
 | 
			
		||||
 | 
			
		||||
  # Build and test the binary for each configuration.
 | 
			
		||||
  build-test-config:
 | 
			
		||||
    needs:
 | 
			
		||||
      - generate-matrix
 | 
			
		||||
    uses: ./.github/workflows/reusable-build-test-config.yml
 | 
			
		||||
    strategy:
 | 
			
		||||
      fail-fast: ${{ github.event_name == 'merge_group' }}
 | 
			
		||||
      matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
 | 
			
		||||
      max-parallel: 10
 | 
			
		||||
    with:
 | 
			
		||||
      build_dir: ${{ inputs.build_dir }}
 | 
			
		||||
      build_only: ${{ matrix.build_only }}
 | 
			
		||||
      build_type: ${{ matrix.build_type }}
 | 
			
		||||
      cmake_args: ${{ matrix.cmake_args }}
 | 
			
		||||
      cmake_target: ${{ matrix.cmake_target }}
 | 
			
		||||
      runs_on: ${{ toJSON(matrix.architecture.runner) }}
 | 
			
		||||
      image: ${{ contains(matrix.architecture.platform, 'linux') && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}-sha-{4}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version, matrix.os.image_sha) || '' }}
 | 
			
		||||
      config_name: ${{ matrix.config_name }}
 | 
			
		||||
    secrets:
 | 
			
		||||
      CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
 | 
			
		||||
							
								
								
									
										154
									
								
								.github/workflows/reusable-build.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										154
									
								
								.github/workflows/reusable-build.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,154 @@
 | 
			
		||||
name: Build rippled
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  workflow_call:
 | 
			
		||||
    inputs:
 | 
			
		||||
      build_dir:
 | 
			
		||||
        description: "The directory where to build."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
      build_type:
 | 
			
		||||
        description: 'The build type to use ("Debug", "Release").'
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
      cmake_args:
 | 
			
		||||
        description: "Additional arguments to pass to CMake."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
      cmake_target:
 | 
			
		||||
        description: "The CMake target to build."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
 | 
			
		||||
      runs_on:
 | 
			
		||||
        description: Runner to run the job on as a JSON string
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
      image:
 | 
			
		||||
        description: "The image to run in (leave empty to run natively)"
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
 | 
			
		||||
      config_name:
 | 
			
		||||
        description: "The name of the configuration."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
 | 
			
		||||
      nproc_subtract:
 | 
			
		||||
        description: "The number of processors to subtract when calculating parallelism."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: number
 | 
			
		||||
 | 
			
		||||
    secrets:
 | 
			
		||||
      CODECOV_TOKEN:
 | 
			
		||||
        description: "The Codecov token to use for uploading coverage reports."
 | 
			
		||||
        required: true
 | 
			
		||||
 | 
			
		||||
defaults:
 | 
			
		||||
  run:
 | 
			
		||||
    shell: bash
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  build:
 | 
			
		||||
    name: Build ${{ inputs.config_name }}
 | 
			
		||||
    runs-on: ${{ fromJSON(inputs.runs_on) }}
 | 
			
		||||
    container: ${{ inputs.image != '' && inputs.image || null }}
 | 
			
		||||
    timeout-minutes: 60
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Cleanup workspace
 | 
			
		||||
        if: ${{ runner.os == 'macOS' }}
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e
 | 
			
		||||
 | 
			
		||||
      - name: Checkout repository
 | 
			
		||||
        uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
 | 
			
		||||
 | 
			
		||||
      - name: Prepare runner
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a
 | 
			
		||||
        with:
 | 
			
		||||
          disable_ccache: false
 | 
			
		||||
 | 
			
		||||
      - name: Print build environment
 | 
			
		||||
        uses: ./.github/actions/print-env
 | 
			
		||||
 | 
			
		||||
      - name: Get number of processors
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
 | 
			
		||||
        id: nproc
 | 
			
		||||
        with:
 | 
			
		||||
          subtract: ${{ inputs.nproc_subtract }}
 | 
			
		||||
 | 
			
		||||
      - name: Setup Conan
 | 
			
		||||
        uses: ./.github/actions/setup-conan
 | 
			
		||||
 | 
			
		||||
      - name: Build dependencies
 | 
			
		||||
        uses: ./.github/actions/build-deps
 | 
			
		||||
        with:
 | 
			
		||||
          build_dir: ${{ inputs.build_dir }}
 | 
			
		||||
          build_nproc: ${{ steps.nproc.outputs.nproc }}
 | 
			
		||||
          build_type: ${{ inputs.build_type }}
 | 
			
		||||
          # Set the verbosity to "quiet" for Windows to avoid an excessive
 | 
			
		||||
          # amount of logs. For other OSes, the "verbose" logs are more useful.
 | 
			
		||||
          log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
 | 
			
		||||
 | 
			
		||||
      - name: Configure CMake
 | 
			
		||||
        shell: bash
 | 
			
		||||
        working-directory: ${{ inputs.build_dir }}
 | 
			
		||||
        env:
 | 
			
		||||
          BUILD_TYPE: ${{ inputs.build_type }}
 | 
			
		||||
          CMAKE_ARGS: ${{ inputs.cmake_args }}
 | 
			
		||||
        run: |
 | 
			
		||||
          cmake \
 | 
			
		||||
            -G '${{ runner.os == 'Windows' && 'Visual Studio 17 2022' || 'Ninja' }}' \
 | 
			
		||||
            -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
 | 
			
		||||
            -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
 | 
			
		||||
            ${CMAKE_ARGS} \
 | 
			
		||||
            ..
 | 
			
		||||
 | 
			
		||||
      - name: Build the binary
 | 
			
		||||
        shell: bash
 | 
			
		||||
        working-directory: ${{ inputs.build_dir }}
 | 
			
		||||
        env:
 | 
			
		||||
          BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
 | 
			
		||||
          BUILD_TYPE: ${{ inputs.build_type }}
 | 
			
		||||
          CMAKE_TARGET: ${{ inputs.cmake_target }}
 | 
			
		||||
        run: |
 | 
			
		||||
          cmake \
 | 
			
		||||
            --build . \
 | 
			
		||||
            --config "${BUILD_TYPE}" \
 | 
			
		||||
            --parallel ${BUILD_NPROC} \
 | 
			
		||||
            --target "${CMAKE_TARGET}"
 | 
			
		||||
 | 
			
		||||
      - name: Put built binaries in one location
 | 
			
		||||
        shell: bash
 | 
			
		||||
        working-directory: ${{ inputs.build_dir }}
 | 
			
		||||
        env:
 | 
			
		||||
          BUILD_TYPE_DIR: ${{ runner.os == 'Windows' && inputs.build_type || '' }}
 | 
			
		||||
          CMAKE_TARGET: ${{ inputs.cmake_target }}
 | 
			
		||||
        run: |
 | 
			
		||||
          mkdir -p ./binaries/doctest/
 | 
			
		||||
 | 
			
		||||
          cp ./${BUILD_TYPE_DIR}/rippled* ./binaries/
 | 
			
		||||
          if [ "${CMAKE_TARGET}" != 'coverage' ]; then
 | 
			
		||||
            cp ./src/tests/libxrpl/${BUILD_TYPE_DIR}/xrpl.test.* ./binaries/doctest/
 | 
			
		||||
          fi
 | 
			
		||||
 | 
			
		||||
      - name: Upload rippled artifact
 | 
			
		||||
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
 | 
			
		||||
        env:
 | 
			
		||||
          BUILD_DIR: ${{ inputs.build_dir }}
 | 
			
		||||
        with:
 | 
			
		||||
          name: rippled-${{ inputs.config_name }}
 | 
			
		||||
          path: ${{ env.BUILD_DIR }}/binaries/
 | 
			
		||||
          retention-days: 3
 | 
			
		||||
          if-no-files-found: error
 | 
			
		||||
 | 
			
		||||
      - name: Upload coverage report
 | 
			
		||||
        if: ${{ github.repository_owner == 'XRPLF' && inputs.cmake_target == 'coverage' }}
 | 
			
		||||
        uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
 | 
			
		||||
        with:
 | 
			
		||||
          disable_search: true
 | 
			
		||||
          disable_telem: true
 | 
			
		||||
          fail_ci_if_error: true
 | 
			
		||||
          files: ${{ inputs.build_dir }}/coverage.xml
 | 
			
		||||
          plugins: noop
 | 
			
		||||
          token: ${{ secrets.CODECOV_TOKEN }}
 | 
			
		||||
          verbose: true
 | 
			
		||||
@@ -40,47 +40,52 @@ jobs:
 | 
			
		||||
  upload:
 | 
			
		||||
    if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    container: ghcr.io/xrplf/ci/ubuntu-noble:gcc-13
 | 
			
		||||
    container: ghcr.io/xrplf/ci/ubuntu-noble:gcc-13-sha-5dd7158
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Checkout repository
 | 
			
		||||
        uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
 | 
			
		||||
      - name: Generate outputs
 | 
			
		||||
        id: generate
 | 
			
		||||
        env:
 | 
			
		||||
          PR_NUMBER: ${{ github.event.pull_request.number }}
 | 
			
		||||
        run: |
 | 
			
		||||
          echo 'Generating user and channel.'
 | 
			
		||||
          echo "user=clio" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
          echo "channel=pr_${{ github.event.pull_request.number }}" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
          echo "channel=pr_${PR_NUMBER}" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
          echo 'Extracting version.'
 | 
			
		||||
          echo "version=$(cat src/libxrpl/protocol/BuildInfo.cpp | grep "versionString =" | awk -F '"' '{print $2}')" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
      - name: Calculate conan reference
 | 
			
		||||
        id: conan_ref
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "conan_ref=${{ steps.generate.outputs.version }}@${{ steps.generate.outputs.user }}/${{ steps.generate.outputs.channel }}" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
 | 
			
		||||
      - name: Set up Conan
 | 
			
		||||
        uses: ./.github/actions/setup-conan
 | 
			
		||||
        with:
 | 
			
		||||
          conan_remote_name: ${{ inputs.conan_remote_name }}
 | 
			
		||||
          conan_remote_url: ${{ inputs.conan_remote_url }}
 | 
			
		||||
 | 
			
		||||
      - name: Log into Conan remote
 | 
			
		||||
        run: conan remote login ${{ inputs.conan_remote_name }} "${{ secrets.conan_remote_username }}" --password "${{ secrets.conan_remote_password }}"
 | 
			
		||||
        env:
 | 
			
		||||
          CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
 | 
			
		||||
        run: conan remote login "${CONAN_REMOTE_NAME}" "${{ secrets.conan_remote_username }}" --password "${{ secrets.conan_remote_password }}"
 | 
			
		||||
      - name: Upload package
 | 
			
		||||
        env:
 | 
			
		||||
          CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
 | 
			
		||||
        run: |
 | 
			
		||||
          conan export --user=${{ steps.generate.outputs.user }} --channel=${{ steps.generate.outputs.channel }} .
 | 
			
		||||
          conan upload --confirm --check --remote=${{ inputs.conan_remote_name }} xrpl/${{ steps.conan_ref.outputs.conan_ref }}
 | 
			
		||||
          conan upload --confirm --check --remote="${CONAN_REMOTE_NAME}" xrpl/${{ steps.conan_ref.outputs.conan_ref }}
 | 
			
		||||
    outputs:
 | 
			
		||||
      conan_ref: ${{ steps.conan_ref.outputs.conan_ref }}
 | 
			
		||||
 | 
			
		||||
  notify:
 | 
			
		||||
    needs: upload
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    env:
 | 
			
		||||
      GH_TOKEN: ${{ secrets.clio_notify_token }}
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Notify Clio
 | 
			
		||||
        env:
 | 
			
		||||
          GH_TOKEN: ${{ secrets.clio_notify_token }}
 | 
			
		||||
          PR_URL: ${{ github.event.pull_request.html_url }}
 | 
			
		||||
        run: |
 | 
			
		||||
          gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \
 | 
			
		||||
          /repos/xrplf/clio/dispatches -f "event_type=check_libxrpl" \
 | 
			
		||||
          -F "client_payload[conan_ref]=${{ needs.upload.outputs.conan_ref }}" \
 | 
			
		||||
          -F "client_payload[pr_url]=${{ github.event.pull_request.html_url }}"
 | 
			
		||||
          -F "client_payload[pr_url]=${PR_URL}"
 | 
			
		||||
@@ -35,4 +35,7 @@ jobs:
 | 
			
		||||
      - name: Generate strategy matrix
 | 
			
		||||
        working-directory: .github/scripts/strategy-matrix
 | 
			
		||||
        id: generate
 | 
			
		||||
        run: ./generate.py ${{ inputs.strategy_matrix == 'all' && '--all' || '' }} ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }} >> "${GITHUB_OUTPUT}"
 | 
			
		||||
        env:
 | 
			
		||||
          GENERATE_CONFIG: ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }}
 | 
			
		||||
          GENERATE_OPTION: ${{ inputs.strategy_matrix == 'all' && '--all' || '' }}
 | 
			
		||||
        run: ./generate.py ${GENERATE_OPTION} ${GENERATE_CONFIG} >> "${GITHUB_OUTPUT}"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										111
									
								
								.github/workflows/reusable-test.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										111
									
								
								.github/workflows/reusable-test.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,111 @@
 | 
			
		||||
name: Test rippled
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  workflow_call:
 | 
			
		||||
    inputs:
 | 
			
		||||
      verify_voidstar:
 | 
			
		||||
        description: "Whether to verify the presence of voidstar instrumentation."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: boolean
 | 
			
		||||
      run_tests:
 | 
			
		||||
        description: "Whether to run unit tests"
 | 
			
		||||
        required: true
 | 
			
		||||
        type: boolean
 | 
			
		||||
 | 
			
		||||
      runs_on:
 | 
			
		||||
        description: Runner to run the job on as a JSON string
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
      image:
 | 
			
		||||
        description: "The image to run in (leave empty to run natively)"
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
 | 
			
		||||
      config_name:
 | 
			
		||||
        description: "The name of the configuration."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: string
 | 
			
		||||
 | 
			
		||||
      nproc_subtract:
 | 
			
		||||
        description: "The number of processors to subtract when calculating parallelism."
 | 
			
		||||
        required: true
 | 
			
		||||
        type: number
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  test:
 | 
			
		||||
    name: Test ${{ inputs.config_name }}
 | 
			
		||||
    runs-on: ${{ fromJSON(inputs.runs_on) }}
 | 
			
		||||
    container: ${{ inputs.image != '' && inputs.image || null }}
 | 
			
		||||
    timeout-minutes: 30
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Cleanup workspace
 | 
			
		||||
        if: ${{ runner.os == 'macOS' }}
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e
 | 
			
		||||
 | 
			
		||||
      - name: Get number of processors
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
 | 
			
		||||
        id: nproc
 | 
			
		||||
        with:
 | 
			
		||||
          subtract: ${{ inputs.nproc_subtract }}
 | 
			
		||||
 | 
			
		||||
      - name: Download rippled artifact
 | 
			
		||||
        uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
 | 
			
		||||
        with:
 | 
			
		||||
          name: rippled-${{ inputs.config_name }}
 | 
			
		||||
 | 
			
		||||
      - name: Make binary executable (Linux and macOS)
 | 
			
		||||
        shell: bash
 | 
			
		||||
        if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
 | 
			
		||||
        run: |
 | 
			
		||||
          chmod +x ./rippled
 | 
			
		||||
 | 
			
		||||
      - name: Check linking (Linux)
 | 
			
		||||
        if: ${{ runner.os == 'Linux' }}
 | 
			
		||||
        shell: bash
 | 
			
		||||
        run: |
 | 
			
		||||
          ldd ./rippled
 | 
			
		||||
          if [ "$(ldd ./rippled | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then
 | 
			
		||||
            echo 'The binary is statically linked.'
 | 
			
		||||
          else
 | 
			
		||||
            echo 'The binary is dynamically linked.'
 | 
			
		||||
            exit 1
 | 
			
		||||
          fi
 | 
			
		||||
 | 
			
		||||
      - name: Verifying presence of instrumentation
 | 
			
		||||
        if: ${{ inputs.verify_voidstar }}
 | 
			
		||||
        shell: bash
 | 
			
		||||
        run: |
 | 
			
		||||
          ./rippled --version | grep libvoidstar
 | 
			
		||||
 | 
			
		||||
      - name: Run the embedded tests
 | 
			
		||||
        if: ${{ inputs.run_tests }}
 | 
			
		||||
        shell: bash
 | 
			
		||||
        env:
 | 
			
		||||
          BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
 | 
			
		||||
        run: |
 | 
			
		||||
          ./rippled --unittest --unittest-jobs ${BUILD_NPROC}
 | 
			
		||||
 | 
			
		||||
      - name: Run the separate tests
 | 
			
		||||
        if: ${{ inputs.run_tests }}
 | 
			
		||||
        env:
 | 
			
		||||
          EXT: ${{ runner.os == 'Windows' && '.exe' || '' }}
 | 
			
		||||
        shell: bash
 | 
			
		||||
        run: |
 | 
			
		||||
          for test_file in ./doctest/*${EXT}; do
 | 
			
		||||
            echo "Executing $test_file"
 | 
			
		||||
            chmod +x "$test_file"
 | 
			
		||||
            if [[ "${{ runner.os }}" == "Windows" && "$test_file" == "./doctest/xrpl.test.net.exe" ]]; then
 | 
			
		||||
              echo "Skipping $test_file on Windows"
 | 
			
		||||
            else
 | 
			
		||||
              "$test_file"
 | 
			
		||||
            fi
 | 
			
		||||
          done
 | 
			
		||||
 | 
			
		||||
      - name: Debug failure (Linux)
 | 
			
		||||
        if: ${{ failure() && runner.os == 'Linux' && inputs.run_tests }}
 | 
			
		||||
        shell: bash
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "IPv4 local port range:"
 | 
			
		||||
          cat /proc/sys/net/ipv4/ip_local_port_range
 | 
			
		||||
          echo "Netstat:"
 | 
			
		||||
          netstat -an
 | 
			
		||||
							
								
								
									
										38
									
								
								.github/workflows/upload-conan-deps.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										38
									
								
								.github/workflows/upload-conan-deps.yml
									
									
									
									
										vendored
									
									
								
							@@ -24,30 +24,30 @@ on:
 | 
			
		||||
    branches: [develop]
 | 
			
		||||
    paths:
 | 
			
		||||
      - .github/workflows/upload-conan-deps.yml
 | 
			
		||||
 | 
			
		||||
      - .github/workflows/reusable-strategy-matrix.yml
 | 
			
		||||
 | 
			
		||||
      - .github/actions/build-deps/action.yml
 | 
			
		||||
      - .github/actions/setup-conan/action.yml
 | 
			
		||||
      - ".github/scripts/strategy-matrix/**"
 | 
			
		||||
 | 
			
		||||
      - conanfile.py
 | 
			
		||||
      - conan.lock
 | 
			
		||||
 | 
			
		||||
env:
 | 
			
		||||
  CONAN_REMOTE_NAME: xrplf
 | 
			
		||||
  CONAN_REMOTE_URL: https://conan.ripplex.io
 | 
			
		||||
  NPROC_SUBTRACT: 2
 | 
			
		||||
 | 
			
		||||
concurrency:
 | 
			
		||||
  group: ${{ github.workflow }}-${{ github.ref }}
 | 
			
		||||
  cancel-in-progress: true
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  # Generate the strategy matrix to be used by the following job.
 | 
			
		||||
  generate-matrix:
 | 
			
		||||
    uses: ./.github/workflows/reusable-strategy-matrix.yml
 | 
			
		||||
    with:
 | 
			
		||||
      strategy_matrix: ${{ github.event_name == 'pull_request' && 'minimal' || 'all' }}
 | 
			
		||||
 | 
			
		||||
  # Build and upload the dependencies for each configuration.
 | 
			
		||||
  run-upload-conan-deps:
 | 
			
		||||
    needs:
 | 
			
		||||
      - generate-matrix
 | 
			
		||||
@@ -56,19 +56,29 @@ jobs:
 | 
			
		||||
      matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
 | 
			
		||||
      max-parallel: 10
 | 
			
		||||
    runs-on: ${{ matrix.architecture.runner }}
 | 
			
		||||
    container: ${{ contains(matrix.architecture.platform, 'linux') && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version) || null }}
 | 
			
		||||
 | 
			
		||||
    container: ${{ contains(matrix.architecture.platform, 'linux') && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}-sha-{4}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version, matrix.os.image_sha) || null }}
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Cleanup workspace
 | 
			
		||||
        if: ${{ runner.os == 'macOS' }}
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e
 | 
			
		||||
 | 
			
		||||
      - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
 | 
			
		||||
      - name: Checkout repository
 | 
			
		||||
        uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
 | 
			
		||||
 | 
			
		||||
      - name: Prepare runner
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/prepare-runner@638e0dc11ea230f91bd26622fb542116bb5254d5
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a
 | 
			
		||||
        with:
 | 
			
		||||
          disable_ccache: false
 | 
			
		||||
 | 
			
		||||
      - name: Print build environment
 | 
			
		||||
        uses: ./.github/actions/print-env
 | 
			
		||||
 | 
			
		||||
      - name: Get number of processors
 | 
			
		||||
        uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
 | 
			
		||||
        id: nproc
 | 
			
		||||
        with:
 | 
			
		||||
          subtract: ${{ env.NPROC_SUBTRACT }}
 | 
			
		||||
 | 
			
		||||
      - name: Setup Conan
 | 
			
		||||
        uses: ./.github/actions/setup-conan
 | 
			
		||||
        with:
 | 
			
		||||
@@ -79,13 +89,19 @@ jobs:
 | 
			
		||||
        uses: ./.github/actions/build-deps
 | 
			
		||||
        with:
 | 
			
		||||
          build_dir: .build
 | 
			
		||||
          build_nproc: ${{ steps.nproc.outputs.nproc }}
 | 
			
		||||
          build_type: ${{ matrix.build_type }}
 | 
			
		||||
          force_build: ${{ github.event_name == 'schedule' || github.event.inputs.force_source_build == 'true' }}
 | 
			
		||||
          # Set the verbosity to "quiet" for Windows to avoid an excessive
 | 
			
		||||
          # amount of logs. For other OSes, the "verbose" logs are more useful.
 | 
			
		||||
          log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
 | 
			
		||||
 | 
			
		||||
      - name: Log into Conan remote
 | 
			
		||||
        if: ${{ github.repository_owner == 'XRPLF' && github.event_name != 'pull_request' }}
 | 
			
		||||
        run: conan remote login ${{ env.CONAN_REMOTE_NAME }} "${{ secrets.CONAN_REMOTE_USERNAME }}" --password "${{ secrets.CONAN_REMOTE_PASSWORD }}"
 | 
			
		||||
        if: ${{ github.repository_owner == 'XRPLF' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
 | 
			
		||||
        run: conan remote login "${CONAN_REMOTE_NAME}" "${{ secrets.CONAN_REMOTE_USERNAME }}" --password "${{ secrets.CONAN_REMOTE_PASSWORD }}"
 | 
			
		||||
 | 
			
		||||
      - name: Upload Conan packages
 | 
			
		||||
        if: ${{ github.repository_owner == 'XRPLF' && github.event_name != 'pull_request' && github.event_name != 'schedule' }}
 | 
			
		||||
        run: conan upload "*" -r=${{ env.CONAN_REMOTE_NAME }} --confirm ${{ github.event.inputs.force_upload == 'true' && '--force' || '' }}
 | 
			
		||||
        if: ${{ github.repository_owner == 'XRPLF' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
 | 
			
		||||
        env:
 | 
			
		||||
          FORCE_OPTION: ${{ github.event.inputs.force_upload == 'true' && '--force' || '' }}
 | 
			
		||||
        run: conan upload "*" --remote="${CONAN_REMOTE_NAME}" --confirm ${FORCE_OPTION}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										22
									
								
								BUILD.md
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								BUILD.md
									
									
									
									
									
								
							@@ -39,17 +39,12 @@ found here](./docs/build/environment.md).
 | 
			
		||||
 | 
			
		||||
- [Python 3.11](https://www.python.org/downloads/), or higher
 | 
			
		||||
- [Conan 2.17](https://conan.io/downloads.html)[^1], or higher
 | 
			
		||||
- [CMake 3.22](https://cmake.org/download/)[^2], or higher
 | 
			
		||||
- [CMake 3.22](https://cmake.org/download/), or higher
 | 
			
		||||
 | 
			
		||||
[^1]:
 | 
			
		||||
    It is possible to build with Conan 1.60+, but the instructions are
 | 
			
		||||
    significantly different, which is why we are not recommending it.
 | 
			
		||||
 | 
			
		||||
[^2]:
 | 
			
		||||
    CMake 4 is not yet supported by all dependencies required by this project.
 | 
			
		||||
    If you are affected by this issue, follow [conan workaround for cmake
 | 
			
		||||
    4](#workaround-for-cmake-4)
 | 
			
		||||
 | 
			
		||||
`rippled` is written in the C++20 dialect and includes the `<concepts>` header.
 | 
			
		||||
The [minimum compiler versions][2] required are:
 | 
			
		||||
 | 
			
		||||
@@ -282,21 +277,6 @@ sed -i.bak -e 's|^arch=.*$|arch=x86_64|' $(conan config home)/profiles/default
 | 
			
		||||
sed -i.bak -e 's|^compiler\.runtime=.*$|compiler.runtime=static|' $(conan config home)/profiles/default
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### Workaround for CMake 4
 | 
			
		||||
 | 
			
		||||
If your system CMake is version 4 rather than 3, you may have to configure Conan
 | 
			
		||||
profile to use CMake version 3 for dependencies, by adding the following two
 | 
			
		||||
lines to your profile:
 | 
			
		||||
 | 
			
		||||
```text
 | 
			
		||||
[tool_requires]
 | 
			
		||||
!cmake/*: cmake/[>=3 <4]
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
This will force Conan to download and use a locally cached CMake 3 version, and
 | 
			
		||||
is needed because some of the dependencies used by this project do not support
 | 
			
		||||
CMake 4.
 | 
			
		||||
 | 
			
		||||
#### Clang workaround for grpc
 | 
			
		||||
 | 
			
		||||
If your compiler is clang, version 19 or later, or apple-clang, version 17 or
 | 
			
		||||
 
 | 
			
		||||
@@ -975,6 +975,47 @@
 | 
			
		||||
#                           number of ledger records online. Must be greater
 | 
			
		||||
#                           than or equal to ledger_history.
 | 
			
		||||
#
 | 
			
		||||
#   Optional keys for NuDB only:
 | 
			
		||||
#
 | 
			
		||||
#       nudb_block_size     EXPERIMENTAL: Block size in bytes for NuDB storage.
 | 
			
		||||
#                           Must be a power of 2 between 4096 and 32768. Default is 4096.
 | 
			
		||||
#
 | 
			
		||||
#                           This parameter controls the fundamental storage unit
 | 
			
		||||
#                           size for NuDB's internal data structures. The choice
 | 
			
		||||
#                           of block size can significantly impact performance
 | 
			
		||||
#                           depending on your storage hardware and filesystem:
 | 
			
		||||
#
 | 
			
		||||
#                           - 4096 bytes: Optimal for most standard SSDs and
 | 
			
		||||
#                             traditional filesystems (ext4, NTFS, HFS+).
 | 
			
		||||
#                             Provides good balance of performance and storage
 | 
			
		||||
#                             efficiency. Recommended for most deployments.
 | 
			
		||||
#                             Minimizes memory footprint and provides consistent
 | 
			
		||||
#                             low-latency access patterns across diverse hardware.
 | 
			
		||||
#
 | 
			
		||||
#                           - 8192-16384 bytes: May improve performance on
 | 
			
		||||
#                             high-end NVMe SSDs and copy-on-write filesystems
 | 
			
		||||
#                             like ZFS or Btrfs that benefit from larger block
 | 
			
		||||
#                             alignment. Can reduce metadata overhead for large
 | 
			
		||||
#                             databases. Offers better sequential throughput and
 | 
			
		||||
#                             reduced I/O operations at the cost of higher memory
 | 
			
		||||
#                             usage per operation.
 | 
			
		||||
#
 | 
			
		||||
#                           - 32768 bytes (32K): Maximum supported block size
 | 
			
		||||
#                             for high-performance scenarios with very fast
 | 
			
		||||
#                             storage. May increase memory usage and reduce
 | 
			
		||||
#                             efficiency for smaller databases. Best suited for
 | 
			
		||||
#                             enterprise environments with abundant RAM.
 | 
			
		||||
#
 | 
			
		||||
#                           Performance testing is recommended before deploying
 | 
			
		||||
#                           any non-default block size in production environments.
 | 
			
		||||
#
 | 
			
		||||
#                           Note: This setting cannot be changed after database
 | 
			
		||||
#                           creation without rebuilding the entire database.
 | 
			
		||||
#                           Choose carefully based on your hardware and expected
 | 
			
		||||
#                           database size.
 | 
			
		||||
#
 | 
			
		||||
#                           Example: nudb_block_size=4096
 | 
			
		||||
#
 | 
			
		||||
#       These keys modify the behavior of online_delete, and thus are only
 | 
			
		||||
#       relevant if online_delete is defined and non-zero:
 | 
			
		||||
#
 | 
			
		||||
@@ -1471,6 +1512,7 @@ secure_gateway = 127.0.0.1
 | 
			
		||||
[node_db]
 | 
			
		||||
type=NuDB
 | 
			
		||||
path=/var/lib/rippled/db/nudb
 | 
			
		||||
nudb_block_size=4096
 | 
			
		||||
online_delete=512
 | 
			
		||||
advisory_delete=0
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ if (static OR APPLE OR MSVC)
 | 
			
		||||
  set (OPENSSL_USE_STATIC_LIBS ON)
 | 
			
		||||
endif ()
 | 
			
		||||
set (OPENSSL_MSVC_STATIC_RT ON)
 | 
			
		||||
find_dependency (OpenSSL 1.1.1 REQUIRED)
 | 
			
		||||
find_dependency (OpenSSL REQUIRED)
 | 
			
		||||
find_dependency (ZLIB)
 | 
			
		||||
find_dependency (date)
 | 
			
		||||
if (TARGET ZLIB::ZLIB)
 | 
			
		||||
 
 | 
			
		||||
@@ -53,14 +53,15 @@ add_library(xrpl.imports.main INTERFACE)
 | 
			
		||||
 | 
			
		||||
target_link_libraries(xrpl.imports.main
 | 
			
		||||
  INTERFACE
 | 
			
		||||
    LibArchive::LibArchive
 | 
			
		||||
    OpenSSL::Crypto
 | 
			
		||||
    Ripple::boost
 | 
			
		||||
    Ripple::opts
 | 
			
		||||
    Ripple::syslibs
 | 
			
		||||
    absl::random_random
 | 
			
		||||
    date::date
 | 
			
		||||
    ed25519::ed25519
 | 
			
		||||
    LibArchive::LibArchive
 | 
			
		||||
    OpenSSL::Crypto
 | 
			
		||||
    Ripple::boost
 | 
			
		||||
    Ripple::libs
 | 
			
		||||
    Ripple::opts
 | 
			
		||||
    Ripple::syslibs
 | 
			
		||||
    secp256k1::secp256k1
 | 
			
		||||
    xrpl.libpb
 | 
			
		||||
    xxHash::xxhash
 | 
			
		||||
@@ -111,6 +112,27 @@ target_link_libraries(xrpl.libxrpl.net PUBLIC
 | 
			
		||||
add_module(xrpl server)
 | 
			
		||||
target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol)
 | 
			
		||||
 | 
			
		||||
add_module(xrpl nodestore)
 | 
			
		||||
target_link_libraries(xrpl.libxrpl.nodestore PUBLIC
 | 
			
		||||
        xrpl.libxrpl.basics
 | 
			
		||||
        xrpl.libxrpl.json
 | 
			
		||||
        xrpl.libxrpl.protocol
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
add_module(xrpl shamap)
 | 
			
		||||
target_link_libraries(xrpl.libxrpl.shamap PUBLIC
 | 
			
		||||
        xrpl.libxrpl.basics
 | 
			
		||||
        xrpl.libxrpl.crypto
 | 
			
		||||
        xrpl.libxrpl.protocol
 | 
			
		||||
        xrpl.libxrpl.nodestore
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
add_module(xrpl ledger)
 | 
			
		||||
target_link_libraries(xrpl.libxrpl.ledger PUBLIC
 | 
			
		||||
  xrpl.libxrpl.basics
 | 
			
		||||
  xrpl.libxrpl.json
 | 
			
		||||
  xrpl.libxrpl.protocol
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
add_library(xrpl.libxrpl)
 | 
			
		||||
set_target_properties(xrpl.libxrpl PROPERTIES OUTPUT_NAME xrpl)
 | 
			
		||||
@@ -130,7 +152,10 @@ target_link_modules(xrpl PUBLIC
 | 
			
		||||
  protocol
 | 
			
		||||
  resource
 | 
			
		||||
  server
 | 
			
		||||
  nodestore
 | 
			
		||||
  shamap
 | 
			
		||||
  net
 | 
			
		||||
  ledger
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# All headers in libxrpl are in modules.
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ setup_target_for_coverage_gcovr(
 | 
			
		||||
  FORMAT ${coverage_format}
 | 
			
		||||
  EXECUTABLE rippled
 | 
			
		||||
  EXECUTABLE_ARGS --unittest$<$<BOOL:${coverage_test}>:=${coverage_test}> --unittest-jobs ${coverage_test_parallelism} --quiet --unittest-log
 | 
			
		||||
  EXCLUDE "src/test" "include/xrpl/beast/test" "include/xrpl/beast/unit_test" "${CMAKE_BINARY_DIR}/pb-xrpl.libpb"
 | 
			
		||||
  EXCLUDE "src/test" "src/tests" "include/xrpl/beast/test" "include/xrpl/beast/unit_test" "${CMAKE_BINARY_DIR}/pb-xrpl.libpb"
 | 
			
		||||
  DEPENDENCIES rippled
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,19 +8,23 @@ install (
 | 
			
		||||
  TARGETS
 | 
			
		||||
    common
 | 
			
		||||
    opts
 | 
			
		||||
    ripple_syslibs
 | 
			
		||||
    ripple_boost
 | 
			
		||||
    ripple_libs
 | 
			
		||||
    ripple_syslibs
 | 
			
		||||
    xrpl.imports.main
 | 
			
		||||
    xrpl.libpb
 | 
			
		||||
    xrpl.libxrpl
 | 
			
		||||
    xrpl.libxrpl.basics
 | 
			
		||||
    xrpl.libxrpl.beast
 | 
			
		||||
    xrpl.libxrpl.crypto
 | 
			
		||||
    xrpl.libxrpl.json
 | 
			
		||||
    xrpl.libxrpl.ledger
 | 
			
		||||
    xrpl.libxrpl.net
 | 
			
		||||
    xrpl.libxrpl.nodestore
 | 
			
		||||
    xrpl.libxrpl.protocol
 | 
			
		||||
    xrpl.libxrpl.resource
 | 
			
		||||
    xrpl.libxrpl.server
 | 
			
		||||
    xrpl.libxrpl.net
 | 
			
		||||
    xrpl.libxrpl
 | 
			
		||||
    xrpl.libxrpl.shamap
 | 
			
		||||
    antithesis-sdk-cpp
 | 
			
		||||
  EXPORT RippleExports
 | 
			
		||||
  LIBRARY DESTINATION lib
 | 
			
		||||
@@ -37,7 +41,7 @@ install(CODE "
 | 
			
		||||
  set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
 | 
			
		||||
  include(create_symbolic_link)
 | 
			
		||||
  create_symbolic_link(xrpl \
 | 
			
		||||
    \${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/ripple)
 | 
			
		||||
    \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/ripple)
 | 
			
		||||
")
 | 
			
		||||
 | 
			
		||||
install (EXPORT RippleExports
 | 
			
		||||
@@ -71,7 +75,7 @@ if (is_root_project AND TARGET rippled)
 | 
			
		||||
    set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
 | 
			
		||||
    include(create_symbolic_link)
 | 
			
		||||
    create_symbolic_link(rippled${suffix} \
 | 
			
		||||
      \${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/xrpld${suffix})
 | 
			
		||||
       \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/xrpld${suffix})
 | 
			
		||||
  ")
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
option (validator_keys "Enables building of validator-keys-tool as a separate target (imported via FetchContent)" OFF)
 | 
			
		||||
option (validator_keys "Enables building of validator-keys tool as a separate target (imported via FetchContent)" OFF)
 | 
			
		||||
 | 
			
		||||
if (validator_keys)
 | 
			
		||||
  git_branch (current_branch)
 | 
			
		||||
@@ -6,17 +6,15 @@ if (validator_keys)
 | 
			
		||||
  if (NOT (current_branch STREQUAL "release"))
 | 
			
		||||
    set (current_branch "master")
 | 
			
		||||
  endif ()
 | 
			
		||||
  message (STATUS "tracking ValidatorKeys branch: ${current_branch}")
 | 
			
		||||
  message (STATUS "Tracking ValidatorKeys branch: ${current_branch}")
 | 
			
		||||
 | 
			
		||||
  FetchContent_Declare (
 | 
			
		||||
    validator_keys_src
 | 
			
		||||
    validator_keys
 | 
			
		||||
    GIT_REPOSITORY https://github.com/ripple/validator-keys-tool.git
 | 
			
		||||
    GIT_TAG        "${current_branch}"
 | 
			
		||||
  )
 | 
			
		||||
  FetchContent_GetProperties (validator_keys_src)
 | 
			
		||||
  if (NOT validator_keys_src_POPULATED)
 | 
			
		||||
    message (STATUS "Pausing to download ValidatorKeys...")
 | 
			
		||||
    FetchContent_Populate (validator_keys_src)
 | 
			
		||||
  endif ()
 | 
			
		||||
  add_subdirectory (${validator_keys_src_SOURCE_DIR} ${CMAKE_BINARY_DIR}/validator-keys)
 | 
			
		||||
  FetchContent_MakeAvailable(validator_keys)
 | 
			
		||||
  set_target_properties(validator-keys PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
 | 
			
		||||
  install(TARGETS validator-keys RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
 | 
			
		||||
 | 
			
		||||
endif ()
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ function(xrpl_add_test name)
 | 
			
		||||
  "${CMAKE_CURRENT_SOURCE_DIR}/${name}/*.cpp"
 | 
			
		||||
  "${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp"
 | 
			
		||||
  )
 | 
			
		||||
  add_executable(${target} EXCLUDE_FROM_ALL ${ARGN} ${sources})
 | 
			
		||||
  add_executable(${target} ${ARGN} ${sources})
 | 
			
		||||
 | 
			
		||||
  isolate_headers(
 | 
			
		||||
    ${target}
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@
 | 
			
		||||
        "rocksdb/10.0.1#85537f46e538974d67da0c3977de48ac%1756234304.347",
 | 
			
		||||
        "re2/20230301#dfd6e2bf050eb90ddd8729cfb4c844a4%1756234257.976",
 | 
			
		||||
        "protobuf/3.21.12#d927114e28de9f4691a6bbcdd9a529d1%1756234251.614",
 | 
			
		||||
        "openssl/3.5.2#0c5a5e15ae569f45dff57adcf1770cf7%1756234259.61",
 | 
			
		||||
        "openssl/3.5.4#a1d5835cc6ed5c5b8f3cd5b9b5d24205%1759746684.671",
 | 
			
		||||
        "nudb/2.0.9#c62cfd501e57055a7e0d8ee3d5e5427d%1756234237.107",
 | 
			
		||||
        "lz4/1.10.0#59fc63cac7f10fbe8e05c7e62c2f3504%1756234228.999",
 | 
			
		||||
        "libiconv/1.17#1e65319e945f2d31941a9d28cc13c058%1756223727.64",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,5 @@
 | 
			
		||||
# Global configuration for Conan. This is used to set the number of parallel
 | 
			
		||||
# downloads, uploads, and build jobs. The verbosity is set to verbose to
 | 
			
		||||
# provide more information during the build process.
 | 
			
		||||
# downloads and uploads.
 | 
			
		||||
core:non_interactive=True
 | 
			
		||||
core.download:parallel={{ os.cpu_count() }}
 | 
			
		||||
core.upload:parallel={{ os.cpu_count() }}
 | 
			
		||||
tools.build:jobs={{ (os.cpu_count() * 4/5) | int }}
 | 
			
		||||
tools.build:verbosity=verbose
 | 
			
		||||
tools.compilation:verbosity=verbose
 | 
			
		||||
 
 | 
			
		||||
@@ -21,14 +21,11 @@ compiler.libcxx={{detect_api.detect_libcxx(compiler, version, compiler_exe)}}
 | 
			
		||||
 | 
			
		||||
[conf]
 | 
			
		||||
{% if compiler == "clang" and compiler_version >= 19 %}
 | 
			
		||||
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
 | 
			
		||||
grpc/1.50.1:tools.build:cxxflags+=['-Wno-missing-template-arg-list-after-template-kw']
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% if compiler == "apple-clang" and compiler_version >= 17 %}
 | 
			
		||||
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
 | 
			
		||||
grpc/1.50.1:tools.build:cxxflags+=['-Wno-missing-template-arg-list-after-template-kw']
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% if compiler == "gcc" and compiler_version < 13 %}
 | 
			
		||||
tools.build:cxxflags=['-Wno-restrict']
 | 
			
		||||
tools.build:cxxflags+=['-Wno-restrict']
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
[tool_requires]
 | 
			
		||||
!cmake/*: cmake/[>=3 <4]
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ class Xrpl(ConanFile):
 | 
			
		||||
        'grpc/1.50.1',
 | 
			
		||||
        'libarchive/3.8.1',
 | 
			
		||||
        'nudb/2.0.9',
 | 
			
		||||
        'openssl/3.5.2',
 | 
			
		||||
        'openssl/3.5.4',
 | 
			
		||||
        'soci/4.0.3',
 | 
			
		||||
        'zlib/1.3.1',
 | 
			
		||||
    ]
 | 
			
		||||
 
 | 
			
		||||
@@ -654,12 +654,14 @@ SharedWeakUnion<T>::convertToWeak()
 | 
			
		||||
            break;
 | 
			
		||||
        case destroy:
 | 
			
		||||
            // We just added a weak ref. How could we destroy?
 | 
			
		||||
            // LCOV_EXCL_START
 | 
			
		||||
            UNREACHABLE(
 | 
			
		||||
                "ripple::SharedWeakUnion::convertToWeak : destroying freshly "
 | 
			
		||||
                "added ref");
 | 
			
		||||
            delete p;
 | 
			
		||||
            unsafeSetRawPtr(nullptr);
 | 
			
		||||
            return true;  // Should never happen
 | 
			
		||||
            // LCOV_EXCL_STOP
 | 
			
		||||
        case partialDestroy:
 | 
			
		||||
            // This is a weird case. We just converted the last strong
 | 
			
		||||
            // pointer to a weak pointer.
 | 
			
		||||
 
 | 
			
		||||
@@ -632,6 +632,16 @@ to_string(base_uint<Bits, Tag> const& a)
 | 
			
		||||
    return strHex(a.cbegin(), a.cend());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <std::size_t Bits, class Tag>
 | 
			
		||||
inline std::string
 | 
			
		||||
to_short_string(base_uint<Bits, Tag> const& a)
 | 
			
		||||
{
 | 
			
		||||
    static_assert(
 | 
			
		||||
        base_uint<Bits, Tag>::bytes > 4,
 | 
			
		||||
        "For 4 bytes or less, use a native type");
 | 
			
		||||
    return strHex(a.cbegin(), a.cbegin() + 4) + "...";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <std::size_t Bits, class Tag>
 | 
			
		||||
inline std::ostream&
 | 
			
		||||
operator<<(std::ostream& out, base_uint<Bits, Tag> const& u)
 | 
			
		||||
 
 | 
			
		||||
@@ -28,9 +28,8 @@ namespace ripple {
 | 
			
		||||
// the destination can hold all values of the source.  This is particularly
 | 
			
		||||
// handy when the source or destination is an enumeration type.
 | 
			
		||||
 | 
			
		||||
template <class Dest, class Src>
 | 
			
		||||
static constexpr bool is_safetocasttovalue_v =
 | 
			
		||||
    (std::is_integral_v<Src> && std::is_integral_v<Dest>) &&
 | 
			
		||||
template <class Src, class Dest>
 | 
			
		||||
concept SafeToCast = (std::is_integral_v<Src> && std::is_integral_v<Dest>) &&
 | 
			
		||||
    (std::is_signed<Src>::value || std::is_unsigned<Dest>::value) &&
 | 
			
		||||
    (std::is_signed<Src>::value != std::is_signed<Dest>::value
 | 
			
		||||
         ? sizeof(Dest) > sizeof(Src)
 | 
			
		||||
@@ -78,7 +77,7 @@ inline constexpr std::
 | 
			
		||||
    unsafe_cast(Src s) noexcept
 | 
			
		||||
{
 | 
			
		||||
    static_assert(
 | 
			
		||||
        !is_safetocasttovalue_v<Dest, Src>,
 | 
			
		||||
        !SafeToCast<Src, Dest>,
 | 
			
		||||
        "Only unsafe if casting signed to unsigned or "
 | 
			
		||||
        "destination is too small");
 | 
			
		||||
    return static_cast<Dest>(s);
 | 
			
		||||
 
 | 
			
		||||
@@ -94,7 +94,11 @@ hash_append(Hasher& h, beast::IP::Address const& addr) noexcept
 | 
			
		||||
    else if (addr.is_v6())
 | 
			
		||||
        hash_append(h, addr.to_v6().to_bytes());
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        // LCOV_EXCL_START
 | 
			
		||||
        UNREACHABLE("beast::hash_append : invalid address type");
 | 
			
		||||
        // LCOV_EXCL_STOP
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}  // namespace beast
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -39,11 +39,16 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define XRPL_ASSERT ALWAYS_OR_UNREACHABLE
 | 
			
		||||
#define XRPL_ASSERT_PARTS(cond, function, description, ...) \
 | 
			
		||||
    XRPL_ASSERT(cond, function " : " description)
 | 
			
		||||
 | 
			
		||||
// How to use the instrumentation macros:
 | 
			
		||||
//
 | 
			
		||||
// * XRPL_ASSERT if cond must be true but the line might not be reached during
 | 
			
		||||
//   fuzzing. Same like `assert` in normal use.
 | 
			
		||||
// * XRPL_ASSERT_PARTS is for convenience, and works like XRPL_ASSERT, but
 | 
			
		||||
//   splits the message param into "function" and "description", then joins
 | 
			
		||||
//   them with " : " before passing to XRPL_ASSERT.
 | 
			
		||||
// * ALWAYS if cond must be true _and_ the line must be reached during fuzzing.
 | 
			
		||||
//   Same like `assert` in normal use.
 | 
			
		||||
// * REACHABLE if the line must be reached during fuzzing
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ public:
 | 
			
		||||
 * without formatting (not human friendly).
 | 
			
		||||
 *
 | 
			
		||||
 * The JSON document is written in a single line. It is not intended for 'human'
 | 
			
		||||
 * consumption, but may be useful to support feature such as RPC where bandwith
 | 
			
		||||
 * consumption, but may be useful to support feature such as RPC where bandwidth
 | 
			
		||||
 * is limited. \sa Reader, Value
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -20,11 +20,10 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_APPLYVIEW_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_APPLYVIEW_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/RawView.h>
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/safe_cast.h>
 | 
			
		||||
#include <xrpl/beast/utility/instrumentation.h>
 | 
			
		||||
#include <xrpl/ledger/RawView.h>
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
 | 
			
		||||
@@ -285,12 +284,14 @@ public:
 | 
			
		||||
    {
 | 
			
		||||
        if (key.type != ltOFFER)
 | 
			
		||||
        {
 | 
			
		||||
            // LCOV_EXCL_START
 | 
			
		||||
            UNREACHABLE(
 | 
			
		||||
                "ripple::ApplyView::dirAppend : only Offers are appended to "
 | 
			
		||||
                "book directories");
 | 
			
		||||
            // Only Offers are appended to book directories. Call dirInsert()
 | 
			
		||||
            // instead
 | 
			
		||||
            return std::nullopt;
 | 
			
		||||
            // LCOV_EXCL_STOP
 | 
			
		||||
        }
 | 
			
		||||
        return dirAdd(true, directory, key.key, describe);
 | 
			
		||||
    }
 | 
			
		||||
@@ -20,9 +20,8 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_APPLYVIEWIMPL_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_APPLYVIEWIMPL_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/OpenView.h>
 | 
			
		||||
#include <xrpld/ledger/detail/ApplyViewBase.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/ledger/OpenView.h>
 | 
			
		||||
#include <xrpl/ledger/detail/ApplyViewBase.h>
 | 
			
		||||
#include <xrpl/protocol/STAmount.h>
 | 
			
		||||
#include <xrpl/protocol/TER.h>
 | 
			
		||||
 | 
			
		||||
@@ -20,9 +20,8 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_BOOK_DIRS_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_BOOK_DIRS_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/beast/utility/Journal.h>
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
 | 
			
		||||
@@ -20,10 +20,9 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_CACHEDVIEW_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_CACHEDVIEW_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/CachedSLEs.h>
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/hardened_hash.h>
 | 
			
		||||
#include <xrpl/ledger/CachedSLEs.h>
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <mutex>
 | 
			
		||||
#include <type_traits>
 | 
			
		||||
@@ -20,12 +20,11 @@
 | 
			
		||||
#ifndef RIPPLE_APP_MISC_CREDENTIALHELPERS_H_INCLUDED
 | 
			
		||||
#define RIPPLE_APP_MISC_CREDENTIALHELPERS_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/ApplyView.h>
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/Log.h>
 | 
			
		||||
#include <xrpl/basics/base_uint.h>
 | 
			
		||||
#include <xrpl/beast/utility/Journal.h>
 | 
			
		||||
#include <xrpl/ledger/ApplyView.h>
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
#include <xrpl/protocol/AccountID.h>
 | 
			
		||||
#include <xrpl/protocol/STArray.h>
 | 
			
		||||
#include <xrpl/protocol/STTx.h>
 | 
			
		||||
@@ -20,8 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_DIR_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_DIR_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
#include <xrpl/protocol/Indexes.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
@@ -20,10 +20,9 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_OPENVIEW_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_OPENVIEW_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/RawView.h>
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
#include <xrpld/ledger/detail/RawStateTable.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/ledger/RawView.h>
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
#include <xrpl/ledger/detail/RawStateTable.h>
 | 
			
		||||
#include <xrpl/protocol/STArray.h>
 | 
			
		||||
#include <xrpl/protocol/XRPAmount.h>
 | 
			
		||||
 | 
			
		||||
@@ -20,10 +20,9 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_PAYMENTSANDBOX_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_PAYMENTSANDBOX_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/RawView.h>
 | 
			
		||||
#include <xrpld/ledger/Sandbox.h>
 | 
			
		||||
#include <xrpld/ledger/detail/ApplyViewBase.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/ledger/RawView.h>
 | 
			
		||||
#include <xrpl/ledger/Sandbox.h>
 | 
			
		||||
#include <xrpl/ledger/detail/ApplyViewBase.h>
 | 
			
		||||
#include <xrpl/protocol/AccountID.h>
 | 
			
		||||
 | 
			
		||||
#include <map>
 | 
			
		||||
@@ -20,8 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_RAWVIEW_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_RAWVIEW_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
#include <xrpl/protocol/STLedgerEntry.h>
 | 
			
		||||
#include <xrpl/protocol/Serializer.h>
 | 
			
		||||
 | 
			
		||||
@@ -20,10 +20,9 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_READVIEW_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_READVIEW_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/detail/ReadViewFwdRange.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/chrono.h>
 | 
			
		||||
#include <xrpl/beast/hash/uhash.h>
 | 
			
		||||
#include <xrpl/ledger/detail/ReadViewFwdRange.h>
 | 
			
		||||
#include <xrpl/protocol/Fees.h>
 | 
			
		||||
#include <xrpl/protocol/IOUAmount.h>
 | 
			
		||||
#include <xrpl/protocol/Indexes.h>
 | 
			
		||||
@@ -280,6 +279,6 @@ makeRulesGivenLedger(
 | 
			
		||||
 | 
			
		||||
}  // namespace ripple
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/detail/ReadViewFwdRange.ipp>
 | 
			
		||||
#include <xrpl/ledger/detail/ReadViewFwdRange.ipp>
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -20,8 +20,8 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_SANDBOX_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_SANDBOX_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/RawView.h>
 | 
			
		||||
#include <xrpld/ledger/detail/ApplyViewBase.h>
 | 
			
		||||
#include <xrpl/ledger/RawView.h>
 | 
			
		||||
#include <xrpl/ledger/detail/ApplyViewBase.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
 | 
			
		||||
@@ -20,11 +20,10 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_VIEW_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_VIEW_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/ApplyView.h>
 | 
			
		||||
#include <xrpld/ledger/OpenView.h>
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/beast/utility/Journal.h>
 | 
			
		||||
#include <xrpl/ledger/ApplyView.h>
 | 
			
		||||
#include <xrpl/ledger/OpenView.h>
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
#include <xrpl/protocol/Indexes.h>
 | 
			
		||||
#include <xrpl/protocol/MPTIssue.h>
 | 
			
		||||
#include <xrpl/protocol/Protocol.h>
 | 
			
		||||
@@ -562,12 +561,28 @@ createPseudoAccount(
 | 
			
		||||
[[nodiscard]] bool
 | 
			
		||||
isPseudoAccount(std::shared_ptr<SLE const> sleAcct);
 | 
			
		||||
 | 
			
		||||
// Returns the list of fields that define an ACCOUNT_ROOT as a pseudo-account if
 | 
			
		||||
// set
 | 
			
		||||
// Pseudo-account designator fields MUST be maintained by including the
 | 
			
		||||
// SField::sMD_PseudoAccount flag in the SField definition. (Don't forget to
 | 
			
		||||
// "| SField::sMD_Default"!) The fields do NOT need to be amendment-gated,
 | 
			
		||||
// since a non-active amendment will not set any field, by definition.
 | 
			
		||||
// Specific properties of a pseudo-account are NOT checked here, that's what
 | 
			
		||||
// InvariantCheck is for.
 | 
			
		||||
[[nodiscard]] std::vector<SField const*> const&
 | 
			
		||||
getPseudoAccountFields();
 | 
			
		||||
 | 
			
		||||
[[nodiscard]] inline bool
 | 
			
		||||
isPseudoAccount(ReadView const& view, AccountID accountId)
 | 
			
		||||
{
 | 
			
		||||
    return isPseudoAccount(view.read(keylet::account(accountId)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
[[nodiscard]] TER
 | 
			
		||||
canAddHolding(ReadView const& view, Asset const& asset);
 | 
			
		||||
 | 
			
		||||
/// Any transactors that call addEmptyHolding() in doApply must call
 | 
			
		||||
/// canAddHolding() in preflight with the same View and Asset
 | 
			
		||||
[[nodiscard]] TER
 | 
			
		||||
addEmptyHolding(
 | 
			
		||||
    ApplyView& view,
 | 
			
		||||
@@ -20,11 +20,10 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_APPLYSTATETABLE_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_APPLYSTATETABLE_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/OpenView.h>
 | 
			
		||||
#include <xrpld/ledger/RawView.h>
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/beast/utility/Journal.h>
 | 
			
		||||
#include <xrpl/ledger/OpenView.h>
 | 
			
		||||
#include <xrpl/ledger/RawView.h>
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
#include <xrpl/protocol/TER.h>
 | 
			
		||||
#include <xrpl/protocol/TxMeta.h>
 | 
			
		||||
#include <xrpl/protocol/XRPAmount.h>
 | 
			
		||||
@@ -20,10 +20,9 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_APPLYVIEWBASE_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_APPLYVIEWBASE_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/ApplyView.h>
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
#include <xrpld/ledger/detail/ApplyStateTable.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/ledger/ApplyView.h>
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
#include <xrpl/ledger/detail/ApplyStateTable.h>
 | 
			
		||||
#include <xrpl/protocol/XRPAmount.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
@@ -20,8 +20,8 @@
 | 
			
		||||
#ifndef RIPPLE_LEDGER_RAWSTATETABLE_H_INCLUDED
 | 
			
		||||
#define RIPPLE_LEDGER_RAWSTATETABLE_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/ledger/RawView.h>
 | 
			
		||||
#include <xrpld/ledger/ReadView.h>
 | 
			
		||||
#include <xrpl/ledger/RawView.h>
 | 
			
		||||
#include <xrpl/ledger/ReadView.h>
 | 
			
		||||
 | 
			
		||||
#include <boost/container/pmr/monotonic_buffer_resource.hpp>
 | 
			
		||||
#include <boost/container/pmr/polymorphic_allocator.hpp>
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_BACKEND_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_BACKEND_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/Types.h>
 | 
			
		||||
#include <xrpl/nodestore/Types.h>
 | 
			
		||||
 | 
			
		||||
#include <cstdint>
 | 
			
		||||
 | 
			
		||||
@@ -53,6 +53,14 @@ public:
 | 
			
		||||
    virtual std::string
 | 
			
		||||
    getName() = 0;
 | 
			
		||||
 | 
			
		||||
    /** Get the block size for backends that support it
 | 
			
		||||
     */
 | 
			
		||||
    virtual std::optional<std::size_t>
 | 
			
		||||
    getBlockSize() const
 | 
			
		||||
    {
 | 
			
		||||
        return std::nullopt;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Open the backend.
 | 
			
		||||
        @param createIfMissing Create the database files if necessary.
 | 
			
		||||
        This allows the caller to catch exceptions.
 | 
			
		||||
@@ -20,13 +20,12 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_DATABASE_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_DATABASE_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/Backend.h>
 | 
			
		||||
#include <xrpld/nodestore/NodeObject.h>
 | 
			
		||||
#include <xrpld/nodestore/Scheduler.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/BasicConfig.h>
 | 
			
		||||
#include <xrpl/basics/Log.h>
 | 
			
		||||
#include <xrpl/basics/TaggedCache.ipp>
 | 
			
		||||
#include <xrpl/nodestore/Backend.h>
 | 
			
		||||
#include <xrpl/nodestore/NodeObject.h>
 | 
			
		||||
#include <xrpl/nodestore/Scheduler.h>
 | 
			
		||||
#include <xrpl/protocol/SystemParameters.h>
 | 
			
		||||
 | 
			
		||||
#include <condition_variable>
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_DATABASEROTATING_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_DATABASEROTATING_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/Database.h>
 | 
			
		||||
#include <xrpl/nodestore/Database.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
namespace NodeStore {
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_DUMMYSCHEDULER_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_DUMMYSCHEDULER_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/Scheduler.h>
 | 
			
		||||
#include <xrpl/nodestore/Scheduler.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
namespace NodeStore {
 | 
			
		||||
@@ -20,11 +20,10 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_FACTORY_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_FACTORY_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/Backend.h>
 | 
			
		||||
#include <xrpld/nodestore/Scheduler.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/BasicConfig.h>
 | 
			
		||||
#include <xrpl/beast/utility/Journal.h>
 | 
			
		||||
#include <xrpl/nodestore/Backend.h>
 | 
			
		||||
#include <xrpl/nodestore/Scheduler.h>
 | 
			
		||||
 | 
			
		||||
#include <nudb/store.hpp>
 | 
			
		||||
 | 
			
		||||
@@ -20,8 +20,8 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_MANAGER_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_MANAGER_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/DatabaseRotating.h>
 | 
			
		||||
#include <xrpld/nodestore/Factory.h>
 | 
			
		||||
#include <xrpl/nodestore/DatabaseRotating.h>
 | 
			
		||||
#include <xrpl/nodestore/Factory.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_SCHEDULER_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_SCHEDULER_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/Task.h>
 | 
			
		||||
#include <xrpl/nodestore/Task.h>
 | 
			
		||||
 | 
			
		||||
#include <chrono>
 | 
			
		||||
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_TYPES_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_TYPES_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/NodeObject.h>
 | 
			
		||||
#include <xrpl/nodestore/NodeObject.h>
 | 
			
		||||
 | 
			
		||||
#include <vector>
 | 
			
		||||
 | 
			
		||||
@@ -20,9 +20,9 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_BATCHWRITER_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_BATCHWRITER_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/Scheduler.h>
 | 
			
		||||
#include <xrpld/nodestore/Task.h>
 | 
			
		||||
#include <xrpld/nodestore/Types.h>
 | 
			
		||||
#include <xrpl/nodestore/Scheduler.h>
 | 
			
		||||
#include <xrpl/nodestore/Task.h>
 | 
			
		||||
#include <xrpl/nodestore/Types.h>
 | 
			
		||||
 | 
			
		||||
#include <condition_variable>
 | 
			
		||||
#include <mutex>
 | 
			
		||||
@@ -20,10 +20,9 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_DATABASENODEIMP_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/Database.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/TaggedCache.h>
 | 
			
		||||
#include <xrpl/basics/chrono.h>
 | 
			
		||||
#include <xrpl/nodestore/Database.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
namespace NodeStore {
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_DATABASEROTATINGIMP_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/DatabaseRotating.h>
 | 
			
		||||
#include <xrpl/nodestore/DatabaseRotating.h>
 | 
			
		||||
 | 
			
		||||
#include <mutex>
 | 
			
		||||
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_DECODEDBLOB_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_DECODEDBLOB_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/NodeObject.h>
 | 
			
		||||
#include <xrpl/nodestore/NodeObject.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
namespace NodeStore {
 | 
			
		||||
@@ -20,9 +20,8 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_ENCODEDBLOB_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/NodeObject.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/beast/utility/instrumentation.h>
 | 
			
		||||
#include <xrpl/nodestore/NodeObject.h>
 | 
			
		||||
 | 
			
		||||
#include <boost/align/align_up.hpp>
 | 
			
		||||
 | 
			
		||||
@@ -20,7 +20,7 @@
 | 
			
		||||
#ifndef RIPPLE_NODESTORE_MANAGERIMP_H_INCLUDED
 | 
			
		||||
#define RIPPLE_NODESTORE_MANAGERIMP_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/Manager.h>
 | 
			
		||||
#include <xrpl/nodestore/Manager.h>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
 | 
			
		||||
@@ -39,7 +39,7 @@ public:
 | 
			
		||||
    static void
 | 
			
		||||
    missing_backend();
 | 
			
		||||
 | 
			
		||||
    ManagerImp() = default;
 | 
			
		||||
    ManagerImp();
 | 
			
		||||
 | 
			
		||||
    ~ManagerImp() = default;
 | 
			
		||||
 | 
			
		||||
@@ -23,11 +23,10 @@
 | 
			
		||||
// Disable lz4 deprecation warning due to incompatibility with clang attributes
 | 
			
		||||
#define LZ4_DISABLE_DEPRECATE_WARNINGS
 | 
			
		||||
 | 
			
		||||
#include <xrpld/nodestore/NodeObject.h>
 | 
			
		||||
#include <xrpld/nodestore/detail/varint.h>
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/contract.h>
 | 
			
		||||
#include <xrpl/basics/safe_cast.h>
 | 
			
		||||
#include <xrpl/nodestore/NodeObject.h>
 | 
			
		||||
#include <xrpl/nodestore/detail/varint.h>
 | 
			
		||||
#include <xrpl/protocol/HashPrefix.h>
 | 
			
		||||
 | 
			
		||||
#include <nudb/detail/field.hpp>
 | 
			
		||||
@@ -1,565 +0,0 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
/*
 | 
			
		||||
    This file is part of rippled: https://github.com/ripple/rippled
 | 
			
		||||
    Copyright (c) 2019 Ripple Labs Inc.
 | 
			
		||||
 | 
			
		||||
    Permission to use, copy, modify, and/or distribute this software for any
 | 
			
		||||
    purpose  with  or without fee is hereby granted, provided that the above
 | 
			
		||||
    copyright notice and this permission notice appear in all copies.
 | 
			
		||||
 | 
			
		||||
    THE  SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 | 
			
		||||
    WITH  REGARD  TO  THIS  SOFTWARE  INCLUDING  ALL  IMPLIED  WARRANTIES  OF
 | 
			
		||||
    MERCHANTABILITY  AND  FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 | 
			
		||||
    ANY  SPECIAL ,  DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 | 
			
		||||
    WHATSOEVER  RESULTING  FROM  LOSS  OF USE, DATA OR PROFITS, WHETHER IN AN
 | 
			
		||||
    ACTION  OF  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 | 
			
		||||
    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#ifndef BASICS_FEES_H_INCLUDED
 | 
			
		||||
#define BASICS_FEES_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/safe_cast.h>
 | 
			
		||||
#include <xrpl/beast/utility/Zero.h>
 | 
			
		||||
#include <xrpl/beast/utility/instrumentation.h>
 | 
			
		||||
#include <xrpl/json/json_value.h>
 | 
			
		||||
 | 
			
		||||
#include <boost/multiprecision/cpp_int.hpp>
 | 
			
		||||
#include <boost/operators.hpp>
 | 
			
		||||
 | 
			
		||||
#include <iosfwd>
 | 
			
		||||
#include <limits>
 | 
			
		||||
#include <optional>
 | 
			
		||||
 | 
			
		||||
namespace ripple {
 | 
			
		||||
 | 
			
		||||
namespace feeunit {
 | 
			
		||||
 | 
			
		||||
/** "drops" are the smallest divisible amount of XRP. This is what most
 | 
			
		||||
    of the code uses. */
 | 
			
		||||
struct dropTag;
 | 
			
		||||
/** "fee units" calculations are a not-really-unitless value that is used
 | 
			
		||||
    to express the cost of a given transaction vs. a reference transaction.
 | 
			
		||||
    They are primarily used by the Transactor classes. */
 | 
			
		||||
struct feeunitTag;
 | 
			
		||||
/** "fee levels" are used by the transaction queue to compare the relative
 | 
			
		||||
    cost of transactions that require different levels of effort to process.
 | 
			
		||||
    See also: src/ripple/app/misc/FeeEscalation.md#fee-level */
 | 
			
		||||
struct feelevelTag;
 | 
			
		||||
/** unitless values are plain scalars wrapped in a TaggedFee. They are
 | 
			
		||||
    used for calculations in this header. */
 | 
			
		||||
struct unitlessTag;
 | 
			
		||||
 | 
			
		||||
template <class T>
 | 
			
		||||
using enable_if_unit_t = typename std::enable_if_t<
 | 
			
		||||
    std::is_class_v<T> && std::is_object_v<typename T::unit_type> &&
 | 
			
		||||
    std::is_object_v<typename T::value_type>>;
 | 
			
		||||
 | 
			
		||||
/** `is_usable_unit_v` is checked to ensure that only values with
 | 
			
		||||
    known valid type tags can be used (sometimes transparently) in
 | 
			
		||||
    non-fee contexts. At the time of implementation, this includes
 | 
			
		||||
    all known tags, but more may be added in the future, and they
 | 
			
		||||
    should not be added automatically unless determined to be
 | 
			
		||||
    appropriate.
 | 
			
		||||
*/
 | 
			
		||||
template <class T, class = enable_if_unit_t<T>>
 | 
			
		||||
constexpr bool is_usable_unit_v =
 | 
			
		||||
    std::is_same_v<typename T::unit_type, feeunitTag> ||
 | 
			
		||||
    std::is_same_v<typename T::unit_type, feelevelTag> ||
 | 
			
		||||
    std::is_same_v<typename T::unit_type, unitlessTag> ||
 | 
			
		||||
    std::is_same_v<typename T::unit_type, dropTag>;
 | 
			
		||||
 | 
			
		||||
template <class UnitTag, class T>
 | 
			
		||||
class TaggedFee : private boost::totally_ordered<TaggedFee<UnitTag, T>>,
 | 
			
		||||
                  private boost::additive<TaggedFee<UnitTag, T>>,
 | 
			
		||||
                  private boost::equality_comparable<TaggedFee<UnitTag, T>, T>,
 | 
			
		||||
                  private boost::dividable<TaggedFee<UnitTag, T>, T>,
 | 
			
		||||
                  private boost::modable<TaggedFee<UnitTag, T>, T>,
 | 
			
		||||
                  private boost::unit_steppable<TaggedFee<UnitTag, T>>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    using unit_type = UnitTag;
 | 
			
		||||
    using value_type = T;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    value_type fee_;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    template <class Other>
 | 
			
		||||
    static constexpr bool is_compatible_v =
 | 
			
		||||
        std::is_arithmetic_v<Other> && std::is_arithmetic_v<value_type> &&
 | 
			
		||||
        std::is_convertible_v<Other, value_type>;
 | 
			
		||||
 | 
			
		||||
    template <class OtherFee, class = enable_if_unit_t<OtherFee>>
 | 
			
		||||
    static constexpr bool is_compatiblefee_v =
 | 
			
		||||
        is_compatible_v<typename OtherFee::value_type> &&
 | 
			
		||||
        std::is_same_v<UnitTag, typename OtherFee::unit_type>;
 | 
			
		||||
 | 
			
		||||
    template <class Other>
 | 
			
		||||
    using enable_if_compatible_t =
 | 
			
		||||
        typename std::enable_if_t<is_compatible_v<Other>>;
 | 
			
		||||
 | 
			
		||||
    template <class OtherFee>
 | 
			
		||||
    using enable_if_compatiblefee_t =
 | 
			
		||||
        typename std::enable_if_t<is_compatiblefee_v<OtherFee>>;
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    TaggedFee() = default;
 | 
			
		||||
    constexpr TaggedFee(TaggedFee const& other) = default;
 | 
			
		||||
    constexpr TaggedFee&
 | 
			
		||||
    operator=(TaggedFee const& other) = default;
 | 
			
		||||
 | 
			
		||||
    constexpr explicit TaggedFee(beast::Zero) : fee_(0)
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    constexpr TaggedFee&
 | 
			
		||||
    operator=(beast::Zero)
 | 
			
		||||
    {
 | 
			
		||||
        fee_ = 0;
 | 
			
		||||
        return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    constexpr explicit TaggedFee(value_type fee) : fee_(fee)
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TaggedFee&
 | 
			
		||||
    operator=(value_type fee)
 | 
			
		||||
    {
 | 
			
		||||
        fee_ = fee;
 | 
			
		||||
        return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Instances with the same unit, and a type that is
 | 
			
		||||
        "safe" to convert to this one can be converted
 | 
			
		||||
        implicitly */
 | 
			
		||||
    template <
 | 
			
		||||
        class Other,
 | 
			
		||||
        class = std::enable_if_t<
 | 
			
		||||
            is_compatible_v<Other> &&
 | 
			
		||||
            is_safetocasttovalue_v<value_type, Other>>>
 | 
			
		||||
    constexpr TaggedFee(TaggedFee<unit_type, Other> const& fee)
 | 
			
		||||
        : TaggedFee(safe_cast<value_type>(fee.fee()))
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    constexpr TaggedFee
 | 
			
		||||
    operator*(value_type const& rhs) const
 | 
			
		||||
    {
 | 
			
		||||
        return TaggedFee{fee_ * rhs};
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    friend constexpr TaggedFee
 | 
			
		||||
    operator*(value_type lhs, TaggedFee const& rhs)
 | 
			
		||||
    {
 | 
			
		||||
        // multiplication is commutative
 | 
			
		||||
        return rhs * lhs;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    constexpr value_type
 | 
			
		||||
    operator/(TaggedFee const& rhs) const
 | 
			
		||||
    {
 | 
			
		||||
        return fee_ / rhs.fee_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TaggedFee&
 | 
			
		||||
    operator+=(TaggedFee const& other)
 | 
			
		||||
    {
 | 
			
		||||
        fee_ += other.fee();
 | 
			
		||||
        return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TaggedFee&
 | 
			
		||||
    operator-=(TaggedFee const& other)
 | 
			
		||||
    {
 | 
			
		||||
        fee_ -= other.fee();
 | 
			
		||||
        return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TaggedFee&
 | 
			
		||||
    operator++()
 | 
			
		||||
    {
 | 
			
		||||
        ++fee_;
 | 
			
		||||
        return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TaggedFee&
 | 
			
		||||
    operator--()
 | 
			
		||||
    {
 | 
			
		||||
        --fee_;
 | 
			
		||||
        return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TaggedFee&
 | 
			
		||||
    operator*=(value_type const& rhs)
 | 
			
		||||
    {
 | 
			
		||||
        fee_ *= rhs;
 | 
			
		||||
        return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TaggedFee&
 | 
			
		||||
    operator/=(value_type const& rhs)
 | 
			
		||||
    {
 | 
			
		||||
        fee_ /= rhs;
 | 
			
		||||
        return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    template <class transparent = value_type>
 | 
			
		||||
    std::enable_if_t<std::is_integral_v<transparent>, TaggedFee&>
 | 
			
		||||
    operator%=(value_type const& rhs)
 | 
			
		||||
    {
 | 
			
		||||
        fee_ %= rhs;
 | 
			
		||||
        return *this;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    TaggedFee
 | 
			
		||||
    operator-() const
 | 
			
		||||
    {
 | 
			
		||||
        static_assert(
 | 
			
		||||
            std::is_signed_v<T>, "- operator illegal on unsigned fee types");
 | 
			
		||||
        return TaggedFee{-fee_};
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool
 | 
			
		||||
    operator==(TaggedFee const& other) const
 | 
			
		||||
    {
 | 
			
		||||
        return fee_ == other.fee_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    template <class Other, class = enable_if_compatible_t<Other>>
 | 
			
		||||
    bool
 | 
			
		||||
    operator==(TaggedFee<unit_type, Other> const& other) const
 | 
			
		||||
    {
 | 
			
		||||
        return fee_ == other.fee();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool
 | 
			
		||||
    operator==(value_type other) const
 | 
			
		||||
    {
 | 
			
		||||
        return fee_ == other;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    template <class Other, class = enable_if_compatible_t<Other>>
 | 
			
		||||
    bool
 | 
			
		||||
    operator!=(TaggedFee<unit_type, Other> const& other) const
 | 
			
		||||
    {
 | 
			
		||||
        return !operator==(other);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool
 | 
			
		||||
    operator<(TaggedFee const& other) const
 | 
			
		||||
    {
 | 
			
		||||
        return fee_ < other.fee_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Returns true if the amount is not zero */
 | 
			
		||||
    explicit constexpr
 | 
			
		||||
    operator bool() const noexcept
 | 
			
		||||
    {
 | 
			
		||||
        return fee_ != 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Return the sign of the amount */
 | 
			
		||||
    constexpr int
 | 
			
		||||
    signum() const noexcept
 | 
			
		||||
    {
 | 
			
		||||
        return (fee_ < 0) ? -1 : (fee_ ? 1 : 0);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Returns the number of drops */
 | 
			
		||||
    constexpr value_type
 | 
			
		||||
    fee() const
 | 
			
		||||
    {
 | 
			
		||||
        return fee_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    template <class Other>
 | 
			
		||||
    constexpr double
 | 
			
		||||
    decimalFromReference(TaggedFee<unit_type, Other> reference) const
 | 
			
		||||
    {
 | 
			
		||||
        return static_cast<double>(fee_) / reference.fee();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // `is_usable_unit_v` is checked to ensure that only values with
 | 
			
		||||
    // known valid type tags can be converted to JSON. At the time
 | 
			
		||||
    // of implementation, that includes all known tags, but more may
 | 
			
		||||
    // be added in the future.
 | 
			
		||||
    std::enable_if_t<is_usable_unit_v<TaggedFee>, Json::Value>
 | 
			
		||||
    jsonClipped() const
 | 
			
		||||
    {
 | 
			
		||||
        if constexpr (std::is_integral_v<value_type>)
 | 
			
		||||
        {
 | 
			
		||||
            using jsontype = std::conditional_t<
 | 
			
		||||
                std::is_signed_v<value_type>,
 | 
			
		||||
                Json::Int,
 | 
			
		||||
                Json::UInt>;
 | 
			
		||||
 | 
			
		||||
            constexpr auto min = std::numeric_limits<jsontype>::min();
 | 
			
		||||
            constexpr auto max = std::numeric_limits<jsontype>::max();
 | 
			
		||||
 | 
			
		||||
            if (fee_ < min)
 | 
			
		||||
                return min;
 | 
			
		||||
            if (fee_ > max)
 | 
			
		||||
                return max;
 | 
			
		||||
            return static_cast<jsontype>(fee_);
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            return fee_;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Returns the underlying value. Code SHOULD NOT call this
 | 
			
		||||
        function unless the type has been abstracted away,
 | 
			
		||||
        e.g. in a templated function.
 | 
			
		||||
    */
 | 
			
		||||
    constexpr value_type
 | 
			
		||||
    value() const
 | 
			
		||||
    {
 | 
			
		||||
        return fee_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    friend std::istream&
 | 
			
		||||
    operator>>(std::istream& s, TaggedFee& val)
 | 
			
		||||
    {
 | 
			
		||||
        s >> val.fee_;
 | 
			
		||||
        return s;
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Output Fees as just their numeric value.
 | 
			
		||||
template <class Char, class Traits, class UnitTag, class T>
 | 
			
		||||
std::basic_ostream<Char, Traits>&
 | 
			
		||||
operator<<(std::basic_ostream<Char, Traits>& os, TaggedFee<UnitTag, T> const& q)
 | 
			
		||||
{
 | 
			
		||||
    return os << q.value();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class UnitTag, class T>
 | 
			
		||||
std::string
 | 
			
		||||
to_string(TaggedFee<UnitTag, T> const& amount)
 | 
			
		||||
{
 | 
			
		||||
    return std::to_string(amount.fee());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class Source, class = enable_if_unit_t<Source>>
 | 
			
		||||
constexpr bool can_muldiv_source_v =
 | 
			
		||||
    std::is_convertible_v<typename Source::value_type, std::uint64_t>;
 | 
			
		||||
 | 
			
		||||
template <class Dest, class = enable_if_unit_t<Dest>>
 | 
			
		||||
constexpr bool can_muldiv_dest_v =
 | 
			
		||||
    can_muldiv_source_v<Dest> &&  // Dest is also a source
 | 
			
		||||
    std::is_convertible_v<std::uint64_t, typename Dest::value_type> &&
 | 
			
		||||
    sizeof(typename Dest::value_type) >= sizeof(std::uint64_t);
 | 
			
		||||
 | 
			
		||||
template <
 | 
			
		||||
    class Source1,
 | 
			
		||||
    class Source2,
 | 
			
		||||
    class = enable_if_unit_t<Source1>,
 | 
			
		||||
    class = enable_if_unit_t<Source2>>
 | 
			
		||||
constexpr bool can_muldiv_sources_v =
 | 
			
		||||
    can_muldiv_source_v<Source1> && can_muldiv_source_v<Source2> &&
 | 
			
		||||
    std::is_same_v<typename Source1::unit_type, typename Source2::unit_type>;
 | 
			
		||||
 | 
			
		||||
template <
 | 
			
		||||
    class Source1,
 | 
			
		||||
    class Source2,
 | 
			
		||||
    class Dest,
 | 
			
		||||
    class = enable_if_unit_t<Source1>,
 | 
			
		||||
    class = enable_if_unit_t<Source2>,
 | 
			
		||||
    class = enable_if_unit_t<Dest>>
 | 
			
		||||
constexpr bool can_muldiv_v =
 | 
			
		||||
    can_muldiv_sources_v<Source1, Source2> && can_muldiv_dest_v<Dest>;
 | 
			
		||||
// Source and Dest can be the same by default
 | 
			
		||||
 | 
			
		||||
template <
 | 
			
		||||
    class Source1,
 | 
			
		||||
    class Source2,
 | 
			
		||||
    class Dest,
 | 
			
		||||
    class = enable_if_unit_t<Source1>,
 | 
			
		||||
    class = enable_if_unit_t<Source2>,
 | 
			
		||||
    class = enable_if_unit_t<Dest>>
 | 
			
		||||
constexpr bool can_muldiv_commute_v = can_muldiv_v<Source1, Source2, Dest> &&
 | 
			
		||||
    !std::is_same_v<typename Source1::unit_type, typename Dest::unit_type>;
 | 
			
		||||
 | 
			
		||||
template <class T>
 | 
			
		||||
using enable_muldiv_source_t =
 | 
			
		||||
    typename std::enable_if_t<can_muldiv_source_v<T>>;
 | 
			
		||||
 | 
			
		||||
template <class T>
 | 
			
		||||
using enable_muldiv_dest_t = typename std::enable_if_t<can_muldiv_dest_v<T>>;
 | 
			
		||||
 | 
			
		||||
template <class Source1, class Source2>
 | 
			
		||||
using enable_muldiv_sources_t =
 | 
			
		||||
    typename std::enable_if_t<can_muldiv_sources_v<Source1, Source2>>;
 | 
			
		||||
 | 
			
		||||
template <class Source1, class Source2, class Dest>
 | 
			
		||||
using enable_muldiv_t =
 | 
			
		||||
    typename std::enable_if_t<can_muldiv_v<Source1, Source2, Dest>>;
 | 
			
		||||
 | 
			
		||||
template <class Source1, class Source2, class Dest>
 | 
			
		||||
using enable_muldiv_commute_t =
 | 
			
		||||
    typename std::enable_if_t<can_muldiv_commute_v<Source1, Source2, Dest>>;
 | 
			
		||||
 | 
			
		||||
template <class T>
 | 
			
		||||
TaggedFee<unitlessTag, T>
 | 
			
		||||
scalar(T value)
 | 
			
		||||
{
 | 
			
		||||
    return TaggedFee<unitlessTag, T>{value};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <
 | 
			
		||||
    class Source1,
 | 
			
		||||
    class Source2,
 | 
			
		||||
    class Dest,
 | 
			
		||||
    class = enable_muldiv_t<Source1, Source2, Dest>>
 | 
			
		||||
std::optional<Dest>
 | 
			
		||||
mulDivU(Source1 value, Dest mul, Source2 div)
 | 
			
		||||
{
 | 
			
		||||
    // Fees can never be negative in any context.
 | 
			
		||||
    if (value.value() < 0 || mul.value() < 0 || div.value() < 0)
 | 
			
		||||
    {
 | 
			
		||||
        // split the asserts so if one hits, the user can tell which
 | 
			
		||||
        // without a debugger.
 | 
			
		||||
        XRPL_ASSERT(
 | 
			
		||||
            value.value() >= 0,
 | 
			
		||||
            "ripple::feeunit::mulDivU : minimum value input");
 | 
			
		||||
        XRPL_ASSERT(
 | 
			
		||||
            mul.value() >= 0, "ripple::feeunit::mulDivU : minimum mul input");
 | 
			
		||||
        XRPL_ASSERT(
 | 
			
		||||
            div.value() >= 0, "ripple::feeunit::mulDivU : minimum div input");
 | 
			
		||||
        return std::nullopt;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    using desttype = typename Dest::value_type;
 | 
			
		||||
    constexpr auto max = std::numeric_limits<desttype>::max();
 | 
			
		||||
 | 
			
		||||
    // Shortcuts, since these happen a lot in the real world
 | 
			
		||||
    if (value == div)
 | 
			
		||||
        return mul;
 | 
			
		||||
    if (mul.value() == div.value())
 | 
			
		||||
    {
 | 
			
		||||
        if (value.value() > max)
 | 
			
		||||
            return std::nullopt;
 | 
			
		||||
        return Dest{static_cast<desttype>(value.value())};
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    using namespace boost::multiprecision;
 | 
			
		||||
 | 
			
		||||
    uint128_t product;
 | 
			
		||||
    product = multiply(
 | 
			
		||||
        product,
 | 
			
		||||
        static_cast<std::uint64_t>(value.value()),
 | 
			
		||||
        static_cast<std::uint64_t>(mul.value()));
 | 
			
		||||
 | 
			
		||||
    auto quotient = product / div.value();
 | 
			
		||||
 | 
			
		||||
    if (quotient > max)
 | 
			
		||||
        return std::nullopt;
 | 
			
		||||
 | 
			
		||||
    return Dest{static_cast<desttype>(quotient)};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}  // namespace feeunit
 | 
			
		||||
 | 
			
		||||
template <class T>
 | 
			
		||||
using FeeLevel = feeunit::TaggedFee<feeunit::feelevelTag, T>;
 | 
			
		||||
using FeeLevel64 = FeeLevel<std::uint64_t>;
 | 
			
		||||
using FeeLevelDouble = FeeLevel<double>;
 | 
			
		||||
 | 
			
		||||
template <
 | 
			
		||||
    class Source1,
 | 
			
		||||
    class Source2,
 | 
			
		||||
    class Dest,
 | 
			
		||||
    class = feeunit::enable_muldiv_t<Source1, Source2, Dest>>
 | 
			
		||||
std::optional<Dest>
 | 
			
		||||
mulDiv(Source1 value, Dest mul, Source2 div)
 | 
			
		||||
{
 | 
			
		||||
    return feeunit::mulDivU(value, mul, div);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <
 | 
			
		||||
    class Source1,
 | 
			
		||||
    class Source2,
 | 
			
		||||
    class Dest,
 | 
			
		||||
    class = feeunit::enable_muldiv_commute_t<Source1, Source2, Dest>>
 | 
			
		||||
std::optional<Dest>
 | 
			
		||||
mulDiv(Dest value, Source1 mul, Source2 div)
 | 
			
		||||
{
 | 
			
		||||
    // Multiplication is commutative
 | 
			
		||||
    return feeunit::mulDivU(mul, value, div);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class Dest, class = feeunit::enable_muldiv_dest_t<Dest>>
 | 
			
		||||
std::optional<Dest>
 | 
			
		||||
mulDiv(std::uint64_t value, Dest mul, std::uint64_t div)
 | 
			
		||||
{
 | 
			
		||||
    // Give the scalars a non-tag so the
 | 
			
		||||
    // unit-handling version gets called.
 | 
			
		||||
    return feeunit::mulDivU(feeunit::scalar(value), mul, feeunit::scalar(div));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class Dest, class = feeunit::enable_muldiv_dest_t<Dest>>
 | 
			
		||||
std::optional<Dest>
 | 
			
		||||
mulDiv(Dest value, std::uint64_t mul, std::uint64_t div)
 | 
			
		||||
{
 | 
			
		||||
    // Multiplication is commutative
 | 
			
		||||
    return mulDiv(mul, value, div);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <
 | 
			
		||||
    class Source1,
 | 
			
		||||
    class Source2,
 | 
			
		||||
    class = feeunit::enable_muldiv_sources_t<Source1, Source2>>
 | 
			
		||||
std::optional<std::uint64_t>
 | 
			
		||||
mulDiv(Source1 value, std::uint64_t mul, Source2 div)
 | 
			
		||||
{
 | 
			
		||||
    // Give the scalars a dimensionless unit so the
 | 
			
		||||
    // unit-handling version gets called.
 | 
			
		||||
    auto unitresult = feeunit::mulDivU(value, feeunit::scalar(mul), div);
 | 
			
		||||
 | 
			
		||||
    if (!unitresult)
 | 
			
		||||
        return std::nullopt;
 | 
			
		||||
 | 
			
		||||
    return unitresult->value();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <
 | 
			
		||||
    class Source1,
 | 
			
		||||
    class Source2,
 | 
			
		||||
    class = feeunit::enable_muldiv_sources_t<Source1, Source2>>
 | 
			
		||||
std::optional<std::uint64_t>
 | 
			
		||||
mulDiv(std::uint64_t value, Source1 mul, Source2 div)
 | 
			
		||||
{
 | 
			
		||||
    // Multiplication is commutative
 | 
			
		||||
    return mulDiv(mul, value, div);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class Dest, class Src>
 | 
			
		||||
constexpr std::enable_if_t<
 | 
			
		||||
    std::is_same_v<typename Dest::unit_type, typename Src::unit_type> &&
 | 
			
		||||
        std::is_integral_v<typename Dest::value_type> &&
 | 
			
		||||
        std::is_integral_v<typename Src::value_type>,
 | 
			
		||||
    Dest>
 | 
			
		||||
safe_cast(Src s) noexcept
 | 
			
		||||
{
 | 
			
		||||
    // Dest may not have an explicit value constructor
 | 
			
		||||
    return Dest{safe_cast<typename Dest::value_type>(s.value())};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <class Dest, class Src>
 | 
			
		||||
constexpr std::enable_if_t<
 | 
			
		||||
    std::is_same_v<typename Dest::unit_type, typename Src::unit_type> &&
 | 
			
		||||
        std::is_integral_v<typename Dest::value_type> &&
 | 
			
		||||
        std::is_integral_v<typename Src::value_type>,
 | 
			
		||||
    Dest>
 | 
			
		||||
unsafe_cast(Src s) noexcept
 | 
			
		||||
{
 | 
			
		||||
    // Dest may not have an explicit value constructor
 | 
			
		||||
    return Dest{unsafe_cast<typename Dest::value_type>(s.value())};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
}  // namespace ripple
 | 
			
		||||
 | 
			
		||||
#endif  // BASICS_FEES_H_INCLUDED
 | 
			
		||||
@@ -287,9 +287,11 @@ delegate(AccountID const& account, AccountID const& authorizedAccount) noexcept;
 | 
			
		||||
Keylet
 | 
			
		||||
bridge(STXChainBridge const& bridge, STXChainBridge::ChainType chainType);
 | 
			
		||||
 | 
			
		||||
// `seq` is stored as `sfXChainClaimID` in the object
 | 
			
		||||
Keylet
 | 
			
		||||
xChainClaimID(STXChainBridge const& bridge, std::uint64_t seq);
 | 
			
		||||
 | 
			
		||||
// `seq` is stored as `sfXChainAccountCreateCount` in the object
 | 
			
		||||
Keylet
 | 
			
		||||
xChainCreateAccountClaimID(STXChainBridge const& bridge, std::uint64_t seq);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ enum LedgerEntryType : std::uint16_t
 | 
			
		||||
#pragma push_macro("LEDGER_ENTRY")
 | 
			
		||||
#undef LEDGER_ENTRY
 | 
			
		||||
 | 
			
		||||
#define LEDGER_ENTRY(tag, value, name, rpcName, fields) tag = value,
 | 
			
		||||
#define LEDGER_ENTRY(tag, value, ...) tag = value,
 | 
			
		||||
 | 
			
		||||
#include <xrpl/protocol/detail/ledger_entries.macro>
 | 
			
		||||
 | 
			
		||||
@@ -188,14 +188,14 @@ enum LedgerSpecificFlags {
 | 
			
		||||
    lsfMPTCanTransfer = 0x00000020,
 | 
			
		||||
    lsfMPTCanClawback = 0x00000040,
 | 
			
		||||
 | 
			
		||||
    lsfMPTCanMutateCanLock = 0x00000002,
 | 
			
		||||
    lsfMPTCanMutateRequireAuth = 0x00000004,
 | 
			
		||||
    lsfMPTCanMutateCanEscrow = 0x00000008,
 | 
			
		||||
    lsfMPTCanMutateCanTrade = 0x00000010,
 | 
			
		||||
    lsfMPTCanMutateCanTransfer = 0x00000020,
 | 
			
		||||
    lsfMPTCanMutateCanClawback = 0x00000040,
 | 
			
		||||
    lsfMPTCanMutateMetadata = 0x00010000,
 | 
			
		||||
    lsfMPTCanMutateTransferFee = 0x00020000,
 | 
			
		||||
    lsmfMPTCanMutateCanLock = 0x00000002,
 | 
			
		||||
    lsmfMPTCanMutateRequireAuth = 0x00000004,
 | 
			
		||||
    lsmfMPTCanMutateCanEscrow = 0x00000008,
 | 
			
		||||
    lsmfMPTCanMutateCanTrade = 0x00000010,
 | 
			
		||||
    lsmfMPTCanMutateCanTransfer = 0x00000020,
 | 
			
		||||
    lsmfMPTCanMutateCanClawback = 0x00000040,
 | 
			
		||||
    lsmfMPTCanMutateMetadata = 0x00010000,
 | 
			
		||||
    lsmfMPTCanMutateTransferFee = 0x00020000,
 | 
			
		||||
 | 
			
		||||
    // ltMPTOKEN
 | 
			
		||||
    lsfMPTAuthorized = 0x00000002,
 | 
			
		||||
 
 | 
			
		||||
@@ -74,6 +74,9 @@ public:
 | 
			
		||||
    Permission&
 | 
			
		||||
    operator=(Permission const&) = delete;
 | 
			
		||||
 | 
			
		||||
    std::optional<std::string>
 | 
			
		||||
    getPermissionName(std::uint32_t const value) const;
 | 
			
		||||
 | 
			
		||||
    std::optional<std::uint32_t>
 | 
			
		||||
    getGranularValue(std::string const& name) const;
 | 
			
		||||
 | 
			
		||||
@@ -83,6 +86,9 @@ public:
 | 
			
		||||
    std::optional<TxType>
 | 
			
		||||
    getGranularTxType(GranularPermissionType const& gpType) const;
 | 
			
		||||
 | 
			
		||||
    std::optional<std::reference_wrapper<uint256 const>> const
 | 
			
		||||
    getTxFeature(TxType txType) const;
 | 
			
		||||
 | 
			
		||||
    bool
 | 
			
		||||
    isDelegatable(std::uint32_t const& permissionValue, Rules const& rules)
 | 
			
		||||
        const;
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,6 @@
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/ByteUtilities.h>
 | 
			
		||||
#include <xrpl/basics/base_uint.h>
 | 
			
		||||
#include <xrpl/basics/partitioned_unordered_map.h>
 | 
			
		||||
 | 
			
		||||
#include <cstdint>
 | 
			
		||||
 | 
			
		||||
@@ -56,7 +55,10 @@ std::size_t constexpr oversizeMetaDataCap = 5200;
 | 
			
		||||
/** The maximum number of entries per directory page */
 | 
			
		||||
std::size_t constexpr dirNodeMaxEntries = 32;
 | 
			
		||||
 | 
			
		||||
/** The maximum number of pages allowed in a directory */
 | 
			
		||||
/** The maximum number of pages allowed in a directory
 | 
			
		||||
 | 
			
		||||
    Made obsolete by fixDirectoryLimit amendment.
 | 
			
		||||
*/
 | 
			
		||||
std::uint64_t constexpr dirNodeMaxPages = 262144;
 | 
			
		||||
 | 
			
		||||
/** The maximum number of items in an NFT page */
 | 
			
		||||
 
 | 
			
		||||
@@ -21,6 +21,7 @@
 | 
			
		||||
#define RIPPLE_PROTOCOL_PUBLICKEY_H_INCLUDED
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/Slice.h>
 | 
			
		||||
#include <xrpl/beast/net/IPEndpoint.h>
 | 
			
		||||
#include <xrpl/protocol/KeyType.h>
 | 
			
		||||
#include <xrpl/protocol/STExchange.h>
 | 
			
		||||
#include <xrpl/protocol/UintTypes.h>
 | 
			
		||||
@@ -264,6 +265,24 @@ calcNodeID(PublicKey const&);
 | 
			
		||||
AccountID
 | 
			
		||||
calcAccountID(PublicKey const& pk);
 | 
			
		||||
 | 
			
		||||
inline std::string
 | 
			
		||||
getFingerprint(
 | 
			
		||||
    beast::IP::Endpoint const& address,
 | 
			
		||||
    std::optional<PublicKey> const& publicKey = std::nullopt,
 | 
			
		||||
    std::optional<std::string> const& id = std::nullopt)
 | 
			
		||||
{
 | 
			
		||||
    std::stringstream ss;
 | 
			
		||||
    ss << "IP Address: " << address;
 | 
			
		||||
    if (publicKey.has_value())
 | 
			
		||||
    {
 | 
			
		||||
        ss << ", Public Key: " << toBase58(TokenType::NodePublic, *publicKey);
 | 
			
		||||
    }
 | 
			
		||||
    if (id.has_value())
 | 
			
		||||
    {
 | 
			
		||||
        ss << ", Id: " << id.value();
 | 
			
		||||
    }
 | 
			
		||||
    return ss.str();
 | 
			
		||||
}
 | 
			
		||||
}  // namespace ripple
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/safe_cast.h>
 | 
			
		||||
#include <xrpl/json/json_value.h>
 | 
			
		||||
#include <xrpl/protocol/Units.h>
 | 
			
		||||
 | 
			
		||||
#include <cstdint>
 | 
			
		||||
#include <map>
 | 
			
		||||
@@ -71,8 +72,10 @@ class STCurrency;
 | 
			
		||||
    STYPE(STI_VL, 7)                              \
 | 
			
		||||
    STYPE(STI_ACCOUNT, 8)                         \
 | 
			
		||||
    STYPE(STI_NUMBER, 9)                          \
 | 
			
		||||
    STYPE(STI_INT32, 10)                          \
 | 
			
		||||
    STYPE(STI_INT64, 11)                          \
 | 
			
		||||
                                                  \
 | 
			
		||||
    /* 10-13 are reserved */                      \
 | 
			
		||||
    /* 12-13 are reserved */                      \
 | 
			
		||||
    STYPE(STI_OBJECT, 14)                         \
 | 
			
		||||
    STYPE(STI_ARRAY, 15)                          \
 | 
			
		||||
                                                  \
 | 
			
		||||
@@ -148,8 +151,10 @@ public:
 | 
			
		||||
        sMD_ChangeNew = 0x02,    // new value when it changes
 | 
			
		||||
        sMD_DeleteFinal = 0x04,  // final value when it is deleted
 | 
			
		||||
        sMD_Create = 0x08,       // value when it's created
 | 
			
		||||
        sMD_Always = 0x10,  // value when node containing it is affected at all
 | 
			
		||||
        sMD_BaseTen = 0x20,
 | 
			
		||||
        sMD_Always = 0x10,   // value when node containing it is affected at all
 | 
			
		||||
        sMD_BaseTen = 0x20,  // value is treated as base 10, overriding behavior
 | 
			
		||||
        sMD_PseudoAccount = 0x40,  // if this field is set in an ACCOUNT_ROOT
 | 
			
		||||
        // _only_, then it is a pseudo-account
 | 
			
		||||
        sMD_Default =
 | 
			
		||||
            sMD_ChangeOrig | sMD_ChangeNew | sMD_DeleteFinal | sMD_Create
 | 
			
		||||
    };
 | 
			
		||||
@@ -184,7 +189,7 @@ public:
 | 
			
		||||
        char const* fn,
 | 
			
		||||
        int meta = sMD_Default,
 | 
			
		||||
        IsSigning signing = IsSigning::yes);
 | 
			
		||||
    explicit SField(private_access_tag_t, int fc);
 | 
			
		||||
    explicit SField(private_access_tag_t, int fc, char const* fn);
 | 
			
		||||
 | 
			
		||||
    static SField const&
 | 
			
		||||
    getField(int fieldCode);
 | 
			
		||||
@@ -297,7 +302,7 @@ public:
 | 
			
		||||
    static int
 | 
			
		||||
    compare(SField const& f1, SField const& f2);
 | 
			
		||||
 | 
			
		||||
    static std::map<int, SField const*> const&
 | 
			
		||||
    static std::unordered_map<int, SField const*> const&
 | 
			
		||||
    getKnownCodeToField()
 | 
			
		||||
    {
 | 
			
		||||
        return knownCodeToField;
 | 
			
		||||
@@ -305,7 +310,8 @@ public:
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    static int num;
 | 
			
		||||
    static std::map<int, SField const*> knownCodeToField;
 | 
			
		||||
    static std::unordered_map<int, SField const*> knownCodeToField;
 | 
			
		||||
    static std::unordered_map<std::string, SField const*> knownNameToField;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/** A field with a type known at compile time. */
 | 
			
		||||
@@ -352,6 +358,9 @@ using SF_UINT256 = TypedField<STBitString<256>>;
 | 
			
		||||
using SF_UINT384 = TypedField<STBitString<384>>;
 | 
			
		||||
using SF_UINT512 = TypedField<STBitString<512>>;
 | 
			
		||||
 | 
			
		||||
using SF_INT32 = TypedField<STInteger<std::int32_t>>;
 | 
			
		||||
using SF_INT64 = TypedField<STInteger<std::int64_t>>;
 | 
			
		||||
 | 
			
		||||
using SF_ACCOUNT = TypedField<STAccount>;
 | 
			
		||||
using SF_AMOUNT = TypedField<STAmount>;
 | 
			
		||||
using SF_ISSUE = TypedField<STIssue>;
 | 
			
		||||
 
 | 
			
		||||
@@ -709,37 +709,6 @@ 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
 | 
			
		||||
// the low-level routine stAmountCanonicalize on an amendment switch. Only
 | 
			
		||||
// transactions need to use this switchover. Outside of a transaction it's safe
 | 
			
		||||
// to unconditionally use the new behavior.
 | 
			
		||||
 | 
			
		||||
bool
 | 
			
		||||
getSTAmountCanonicalizeSwitchover();
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
setSTAmountCanonicalizeSwitchover(bool v);
 | 
			
		||||
 | 
			
		||||
/** RAII class to set and restore the STAmount canonicalize switchover.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
class STAmountSO
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    explicit STAmountSO(bool v) : saved_(getSTAmountCanonicalizeSwitchover())
 | 
			
		||||
    {
 | 
			
		||||
        setSTAmountCanonicalizeSwitchover(v);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ~STAmountSO()
 | 
			
		||||
    {
 | 
			
		||||
        setSTAmountCanonicalizeSwitchover(saved_);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    bool saved_;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
}  // namespace ripple
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -81,6 +81,8 @@ using STUInt16 = STInteger<std::uint16_t>;
 | 
			
		||||
using STUInt32 = STInteger<std::uint32_t>;
 | 
			
		||||
using STUInt64 = STInteger<std::uint64_t>;
 | 
			
		||||
 | 
			
		||||
using STInt32 = STInteger<std::int32_t>;
 | 
			
		||||
 | 
			
		||||
template <typename Integer>
 | 
			
		||||
inline STInteger<Integer>::STInteger(Integer v) : value_(v)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,9 @@
 | 
			
		||||
namespace ripple {
 | 
			
		||||
 | 
			
		||||
class Rules;
 | 
			
		||||
namespace test {
 | 
			
		||||
class Invariants_test;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class STLedgerEntry final : public STObject, public CountedObject<STLedgerEntry>
 | 
			
		||||
{
 | 
			
		||||
@@ -36,6 +38,8 @@ class STLedgerEntry final : public STObject, public CountedObject<STLedgerEntry>
 | 
			
		||||
public:
 | 
			
		||||
    using pointer = std::shared_ptr<STLedgerEntry>;
 | 
			
		||||
    using ref = std::shared_ptr<STLedgerEntry> const&;
 | 
			
		||||
    using const_pointer = std::shared_ptr<STLedgerEntry const>;
 | 
			
		||||
    using const_ref = std::shared_ptr<STLedgerEntry const> const&;
 | 
			
		||||
 | 
			
		||||
    /** Create an empty object with the given key and type. */
 | 
			
		||||
    explicit STLedgerEntry(Keylet const& k);
 | 
			
		||||
@@ -54,7 +58,7 @@ public:
 | 
			
		||||
    getText() const override;
 | 
			
		||||
 | 
			
		||||
    Json::Value
 | 
			
		||||
    getJson(JsonOptions options) const override;
 | 
			
		||||
    getJson(JsonOptions options = JsonOptions::none) const override;
 | 
			
		||||
 | 
			
		||||
    /** Returns the 'key' (or 'index') of this item.
 | 
			
		||||
        The key identifies this entry's position in
 | 
			
		||||
@@ -84,7 +88,8 @@ private:
 | 
			
		||||
    void
 | 
			
		||||
    setSLEType();
 | 
			
		||||
 | 
			
		||||
    friend Invariants_test;  // this test wants access to the private type_
 | 
			
		||||
    friend test::Invariants_test;  // this test wants access to the private
 | 
			
		||||
                                   // type_
 | 
			
		||||
 | 
			
		||||
    STBase*
 | 
			
		||||
    copy(std::size_t n, void* buf) const override;
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,6 @@
 | 
			
		||||
#include <xrpl/basics/chrono.h>
 | 
			
		||||
#include <xrpl/basics/contract.h>
 | 
			
		||||
#include <xrpl/beast/utility/instrumentation.h>
 | 
			
		||||
#include <xrpl/protocol/FeeUnits.h>
 | 
			
		||||
#include <xrpl/protocol/HashPrefix.h>
 | 
			
		||||
#include <xrpl/protocol/SOTemplate.h>
 | 
			
		||||
#include <xrpl/protocol/STAmount.h>
 | 
			
		||||
@@ -34,6 +33,7 @@
 | 
			
		||||
#include <xrpl/protocol/STIssue.h>
 | 
			
		||||
#include <xrpl/protocol/STPathSet.h>
 | 
			
		||||
#include <xrpl/protocol/STVector256.h>
 | 
			
		||||
#include <xrpl/protocol/Units.h>
 | 
			
		||||
#include <xrpl/protocol/detail/STVar.h>
 | 
			
		||||
 | 
			
		||||
#include <boost/iterator/transform_iterator.hpp>
 | 
			
		||||
@@ -231,6 +231,8 @@ public:
 | 
			
		||||
    getFieldH192(SField const& field) const;
 | 
			
		||||
    uint256
 | 
			
		||||
    getFieldH256(SField const& field) const;
 | 
			
		||||
    std::int32_t
 | 
			
		||||
    getFieldI32(SField const& field) const;
 | 
			
		||||
    AccountID
 | 
			
		||||
    getAccountID(SField const& field) const;
 | 
			
		||||
 | 
			
		||||
@@ -242,6 +244,9 @@ public:
 | 
			
		||||
    getFieldPathSet(SField const& field) const;
 | 
			
		||||
    STVector256 const&
 | 
			
		||||
    getFieldV256(SField const& field) const;
 | 
			
		||||
    // If not found, returns an object constructed with the given field
 | 
			
		||||
    STObject
 | 
			
		||||
    getFieldObject(SField const& field) const;
 | 
			
		||||
    STArray const&
 | 
			
		||||
    getFieldArray(SField const& field) const;
 | 
			
		||||
    STCurrency const&
 | 
			
		||||
@@ -365,6 +370,8 @@ public:
 | 
			
		||||
    void
 | 
			
		||||
    setFieldH256(SField const& field, uint256 const&);
 | 
			
		||||
    void
 | 
			
		||||
    setFieldI32(SField const& field, std::int32_t);
 | 
			
		||||
    void
 | 
			
		||||
    setFieldVL(SField const& field, Blob const&);
 | 
			
		||||
    void
 | 
			
		||||
    setFieldVL(SField const& field, Slice const&);
 | 
			
		||||
@@ -386,6 +393,8 @@ public:
 | 
			
		||||
    setFieldV256(SField const& field, STVector256 const& v);
 | 
			
		||||
    void
 | 
			
		||||
    setFieldArray(SField const& field, STArray const& v);
 | 
			
		||||
    void
 | 
			
		||||
    setFieldObject(SField const& field, STObject const& v);
 | 
			
		||||
 | 
			
		||||
    template <class Tag>
 | 
			
		||||
    void
 | 
			
		||||
 
 | 
			
		||||
@@ -54,34 +54,6 @@ public:
 | 
			
		||||
    Json::Value error;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/** Holds the serialized result of parsing an input JSON array.
 | 
			
		||||
    This does validation and checking on the provided JSON.
 | 
			
		||||
*/
 | 
			
		||||
class STParsedJSONArray
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    /** Parses and creates an STParsedJSON array.
 | 
			
		||||
        The result of the parsing is stored in array and error.
 | 
			
		||||
        Exceptions:
 | 
			
		||||
            Does not throw.
 | 
			
		||||
        @param name The name of the JSON field, used in diagnostics.
 | 
			
		||||
        @param json The JSON-RPC to parse.
 | 
			
		||||
    */
 | 
			
		||||
    STParsedJSONArray(std::string const& name, Json::Value const& json);
 | 
			
		||||
 | 
			
		||||
    STParsedJSONArray() = delete;
 | 
			
		||||
    STParsedJSONArray(STParsedJSONArray const&) = delete;
 | 
			
		||||
    STParsedJSONArray&
 | 
			
		||||
    operator=(STParsedJSONArray const&) = delete;
 | 
			
		||||
    ~STParsedJSONArray() = default;
 | 
			
		||||
 | 
			
		||||
    /** The STArray if the parse was successful. */
 | 
			
		||||
    std::optional<STArray> array;
 | 
			
		||||
 | 
			
		||||
    /** On failure, an appropriate set of error values. */
 | 
			
		||||
    Json::Value error;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
}  // namespace ripple
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -87,8 +87,14 @@ public:
 | 
			
		||||
    getFullText() const override;
 | 
			
		||||
 | 
			
		||||
    // Outer transaction functions / signature functions.
 | 
			
		||||
    static Blob
 | 
			
		||||
    getSignature(STObject const& sigObject);
 | 
			
		||||
 | 
			
		||||
    Blob
 | 
			
		||||
    getSignature() const;
 | 
			
		||||
    getSignature() const
 | 
			
		||||
    {
 | 
			
		||||
        return getSignature(*this);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    uint256
 | 
			
		||||
    getSigningHash() const;
 | 
			
		||||
@@ -119,13 +125,20 @@ public:
 | 
			
		||||
    getJson(JsonOptions options, bool binary) const;
 | 
			
		||||
 | 
			
		||||
    void
 | 
			
		||||
    sign(PublicKey const& publicKey, SecretKey const& secretKey);
 | 
			
		||||
    sign(
 | 
			
		||||
        PublicKey const& publicKey,
 | 
			
		||||
        SecretKey const& secretKey,
 | 
			
		||||
        std::optional<std::reference_wrapper<SField const>> signatureTarget =
 | 
			
		||||
            {});
 | 
			
		||||
 | 
			
		||||
    /** Check the signature.
 | 
			
		||||
        @return `true` if valid signature. If invalid, the error message string.
 | 
			
		||||
    */
 | 
			
		||||
    enum class RequireFullyCanonicalSig : bool { no, yes };
 | 
			
		||||
 | 
			
		||||
    /** Check the signature.
 | 
			
		||||
        @param requireCanonicalSig If `true`, check that the signature is fully
 | 
			
		||||
            canonical. If `false`, only check that the signature is valid.
 | 
			
		||||
        @param rules The current ledger rules.
 | 
			
		||||
        @return `true` if valid signature. If invalid, the error message string.
 | 
			
		||||
    */
 | 
			
		||||
    Expected<void, std::string>
 | 
			
		||||
    checkSign(RequireFullyCanonicalSig requireCanonicalSig, Rules const& rules)
 | 
			
		||||
        const;
 | 
			
		||||
@@ -150,17 +163,34 @@ public:
 | 
			
		||||
        char status,
 | 
			
		||||
        std::string const& escapedMetaData) const;
 | 
			
		||||
 | 
			
		||||
    std::vector<uint256>
 | 
			
		||||
    std::vector<uint256> const&
 | 
			
		||||
    getBatchTransactionIDs() const;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    /** Check the signature.
 | 
			
		||||
        @param requireCanonicalSig If `true`, check that the signature is fully
 | 
			
		||||
            canonical. If `false`, only check that the signature is valid.
 | 
			
		||||
        @param rules The current ledger rules.
 | 
			
		||||
        @param sigObject Reference to object that contains the signature fields.
 | 
			
		||||
            Will be *this more often than not.
 | 
			
		||||
        @return `true` if valid signature. If invalid, the error message string.
 | 
			
		||||
    */
 | 
			
		||||
    Expected<void, std::string>
 | 
			
		||||
    checkSingleSign(RequireFullyCanonicalSig requireCanonicalSig) const;
 | 
			
		||||
    checkSign(
 | 
			
		||||
        RequireFullyCanonicalSig requireCanonicalSig,
 | 
			
		||||
        Rules const& rules,
 | 
			
		||||
        STObject const& sigObject) const;
 | 
			
		||||
 | 
			
		||||
    Expected<void, std::string>
 | 
			
		||||
    checkSingleSign(
 | 
			
		||||
        RequireFullyCanonicalSig requireCanonicalSig,
 | 
			
		||||
        STObject const& sigObject) const;
 | 
			
		||||
 | 
			
		||||
    Expected<void, std::string>
 | 
			
		||||
    checkMultiSign(
 | 
			
		||||
        RequireFullyCanonicalSig requireCanonicalSig,
 | 
			
		||||
        Rules const& rules) const;
 | 
			
		||||
        Rules const& rules,
 | 
			
		||||
        STObject const& sigObject) const;
 | 
			
		||||
 | 
			
		||||
    Expected<void, std::string>
 | 
			
		||||
    checkBatchSingleSign(
 | 
			
		||||
@@ -179,7 +209,7 @@ private:
 | 
			
		||||
    move(std::size_t n, void* buf) override;
 | 
			
		||||
 | 
			
		||||
    friend class detail::STVar;
 | 
			
		||||
    mutable std::vector<uint256> batch_txn_ids_;
 | 
			
		||||
    mutable std::vector<uint256> batchTxnIds_;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
bool
 | 
			
		||||
 
 | 
			
		||||
@@ -22,10 +22,10 @@
 | 
			
		||||
 | 
			
		||||
#include <xrpl/basics/Log.h>
 | 
			
		||||
#include <xrpl/beast/utility/instrumentation.h>
 | 
			
		||||
#include <xrpl/protocol/FeeUnits.h>
 | 
			
		||||
#include <xrpl/protocol/PublicKey.h>
 | 
			
		||||
#include <xrpl/protocol/STObject.h>
 | 
			
		||||
#include <xrpl/protocol/SecretKey.h>
 | 
			
		||||
#include <xrpl/protocol/Units.h>
 | 
			
		||||
 | 
			
		||||
#include <cstdint>
 | 
			
		||||
#include <optional>
 | 
			
		||||
 
 | 
			
		||||
@@ -73,14 +73,8 @@ static constexpr std::uint32_t XRP_LEDGER_EARLIEST_SEQ{32570u};
 | 
			
		||||
 * used in asserts and tests. */
 | 
			
		||||
static constexpr std::uint32_t XRP_LEDGER_EARLIEST_FEES{562177u};
 | 
			
		||||
 | 
			
		||||
/** The minimum amount of support an amendment should have.
 | 
			
		||||
 | 
			
		||||
    @note This value is used by legacy code and will become obsolete
 | 
			
		||||
          once the fixAmendmentMajorityCalc amendment activates.
 | 
			
		||||
*/
 | 
			
		||||
constexpr std::ratio<204, 256> preFixAmendmentMajorityCalcThreshold;
 | 
			
		||||
 | 
			
		||||
constexpr std::ratio<80, 100> postFixAmendmentMajorityCalcThreshold;
 | 
			
		||||
/** The minimum amount of support an amendment should have. */
 | 
			
		||||
constexpr std::ratio<80, 100> amendmentMajorityCalcThreshold;
 | 
			
		||||
 | 
			
		||||
/** The minimum amount of time an amendment must hold a majority */
 | 
			
		||||
constexpr std::chrono::seconds const defaultAmendmentMajorityTime = weeks{2};
 | 
			
		||||
 
 | 
			
		||||
@@ -225,8 +225,9 @@ enum TERcodes : TERUnderlyingType {
 | 
			
		||||
    terQUEUED,       // Transaction is being held in TxQ until fee drops
 | 
			
		||||
    terPRE_TICKET,   // Ticket is not yet in ledger but might be on its way
 | 
			
		||||
    terNO_AMM,       // AMM doesn't exist for the asset pair
 | 
			
		||||
    terADDRESS_COLLISION,  // Failed to allocate AccountID when trying to
 | 
			
		||||
                           // create a pseudo-account
 | 
			
		||||
    terADDRESS_COLLISION,       // Failed to allocate AccountID when trying to
 | 
			
		||||
                                // create a pseudo-account
 | 
			
		||||
    terNO_DELEGATE_PERMISSION,  // Delegate does not have permission
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
@@ -361,6 +362,9 @@ enum TECcodes : TERUnderlyingType {
 | 
			
		||||
    tecLIMIT_EXCEEDED = 195,
 | 
			
		||||
    tecPSEUDO_ACCOUNT = 196,
 | 
			
		||||
    tecPRECISION_LOSS = 197,
 | 
			
		||||
    // DEPRECATED: This error code tecNO_DELEGATE_PERMISSION is reserved for
 | 
			
		||||
    // backward compatibility with historical data on non-prod networks, can be
 | 
			
		||||
    // reclaimed after those networks reset.
 | 
			
		||||
    tecNO_DELEGATE_PERMISSION = 198,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -673,7 +677,8 @@ isTerRetry(TER x) noexcept
 | 
			
		||||
inline bool
 | 
			
		||||
isTesSuccess(TER x) noexcept
 | 
			
		||||
{
 | 
			
		||||
    return (x == tesSUCCESS);
 | 
			
		||||
    // Makes use of TERSubset::operator bool()
 | 
			
		||||
    return !(x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
inline bool
 | 
			
		||||
 
 | 
			
		||||
@@ -127,6 +127,8 @@ constexpr std::uint32_t tfTrustSetPermissionMask = ~(tfUniversal | tfSetfAuth |
 | 
			
		||||
// EnableAmendment flags:
 | 
			
		||||
constexpr std::uint32_t tfGotMajority                      = 0x00010000;
 | 
			
		||||
constexpr std::uint32_t tfLostMajority                     = 0x00020000;
 | 
			
		||||
constexpr std::uint32_t tfChangeMask =
 | 
			
		||||
    ~( tfUniversal | tfGotMajority | tfLostMajority);
 | 
			
		||||
 | 
			
		||||
// PaymentChannelClaim flags:
 | 
			
		||||
constexpr std::uint32_t tfRenew                            = 0x00010000;
 | 
			
		||||
@@ -141,7 +143,8 @@ constexpr std::uint32_t const tfTransferable               = 0x00000008;
 | 
			
		||||
constexpr std::uint32_t const tfMutable                    = 0x00000010;
 | 
			
		||||
 | 
			
		||||
// MPTokenIssuanceCreate flags:
 | 
			
		||||
// NOTE - there is intentionally no flag here for lsfMPTLocked, which this transaction cannot mutate.
 | 
			
		||||
// Note: tf/lsfMPTLocked is intentionally omitted, since this transaction
 | 
			
		||||
// is not allowed to modify it.
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanLock                 = lsfMPTCanLock;
 | 
			
		||||
constexpr std::uint32_t const tfMPTRequireAuth             = lsfMPTRequireAuth;
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanEscrow               = lsfMPTCanEscrow;
 | 
			
		||||
@@ -153,17 +156,17 @@ constexpr std::uint32_t const tfMPTokenIssuanceCreateMask  =
 | 
			
		||||
 | 
			
		||||
// MPTokenIssuanceCreate MutableFlags:
 | 
			
		||||
// Indicating specific fields or flags may be changed after issuance.
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanMutateCanLock = lsfMPTCanMutateCanLock;
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanMutateRequireAuth = lsfMPTCanMutateRequireAuth;
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanMutateCanEscrow = lsfMPTCanMutateCanEscrow;
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanMutateCanTrade = lsfMPTCanMutateCanTrade;
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanMutateCanTransfer = lsfMPTCanMutateCanTransfer;
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanMutateCanClawback = lsfMPTCanMutateCanClawback;
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanMutateMetadata = lsfMPTCanMutateMetadata;
 | 
			
		||||
constexpr std::uint32_t const tfMPTCanMutateTransferFee = lsfMPTCanMutateTransferFee;
 | 
			
		||||
constexpr std::uint32_t const tfMPTokenIssuanceCreateMutableMask =
 | 
			
		||||
  ~(tfMPTCanMutateCanLock | tfMPTCanMutateRequireAuth | tfMPTCanMutateCanEscrow | tfMPTCanMutateCanTrade
 | 
			
		||||
    | tfMPTCanMutateCanTransfer | tfMPTCanMutateCanClawback | tfMPTCanMutateMetadata | tfMPTCanMutateTransferFee);
 | 
			
		||||
constexpr std::uint32_t const tmfMPTCanMutateCanLock = lsmfMPTCanMutateCanLock;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTCanMutateRequireAuth = lsmfMPTCanMutateRequireAuth;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTCanMutateCanEscrow = lsmfMPTCanMutateCanEscrow;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTCanMutateCanTrade = lsmfMPTCanMutateCanTrade;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTCanMutateCanTransfer = lsmfMPTCanMutateCanTransfer;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTCanMutateCanClawback = lsmfMPTCanMutateCanClawback;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTCanMutateMetadata = lsmfMPTCanMutateMetadata;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTCanMutateTransferFee = lsmfMPTCanMutateTransferFee;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTokenIssuanceCreateMutableMask =
 | 
			
		||||
  ~(tmfMPTCanMutateCanLock | tmfMPTCanMutateRequireAuth | tmfMPTCanMutateCanEscrow | tmfMPTCanMutateCanTrade
 | 
			
		||||
    | tmfMPTCanMutateCanTransfer | tmfMPTCanMutateCanClawback | tmfMPTCanMutateMetadata | tmfMPTCanMutateTransferFee);
 | 
			
		||||
 | 
			
		||||
// MPTokenAuthorize flags:
 | 
			
		||||
constexpr std::uint32_t const tfMPTUnauthorize             = 0x00000001;
 | 
			
		||||
@@ -177,22 +180,22 @@ constexpr std::uint32_t const tfMPTokenIssuanceSetPermissionMask = ~(tfUniversal
 | 
			
		||||
 | 
			
		||||
// MPTokenIssuanceSet MutableFlags:
 | 
			
		||||
// Set or Clear flags.
 | 
			
		||||
constexpr std::uint32_t const tfMPTSetCanLock             = 0x00000001;
 | 
			
		||||
constexpr std::uint32_t const tfMPTClearCanLock           = 0x00000002;
 | 
			
		||||
constexpr std::uint32_t const tfMPTSetRequireAuth         = 0x00000004;
 | 
			
		||||
constexpr std::uint32_t const tfMPTClearRequireAuth       = 0x00000008;
 | 
			
		||||
constexpr std::uint32_t const tfMPTSetCanEscrow           = 0x00000010;
 | 
			
		||||
constexpr std::uint32_t const tfMPTClearCanEscrow         = 0x00000020;
 | 
			
		||||
constexpr std::uint32_t const tfMPTSetCanTrade            = 0x00000040;
 | 
			
		||||
constexpr std::uint32_t const tfMPTClearCanTrade          = 0x00000080;
 | 
			
		||||
constexpr std::uint32_t const tfMPTSetCanTransfer         = 0x00000100;
 | 
			
		||||
constexpr std::uint32_t const tfMPTClearCanTransfer       = 0x00000200;
 | 
			
		||||
constexpr std::uint32_t const tfMPTSetCanClawback         = 0x00000400;
 | 
			
		||||
constexpr std::uint32_t const tfMPTClearCanClawback       = 0x00000800;
 | 
			
		||||
constexpr std::uint32_t const tfMPTokenIssuanceSetMutableMask = ~(tfMPTSetCanLock | tfMPTClearCanLock |
 | 
			
		||||
    tfMPTSetRequireAuth | tfMPTClearRequireAuth | tfMPTSetCanEscrow | tfMPTClearCanEscrow |
 | 
			
		||||
    tfMPTSetCanTrade | tfMPTClearCanTrade | tfMPTSetCanTransfer | tfMPTClearCanTransfer |
 | 
			
		||||
    tfMPTSetCanClawback | tfMPTClearCanClawback);
 | 
			
		||||
constexpr std::uint32_t const tmfMPTSetCanLock             = 0x00000001;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTClearCanLock           = 0x00000002;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTSetRequireAuth         = 0x00000004;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTClearRequireAuth       = 0x00000008;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTSetCanEscrow           = 0x00000010;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTClearCanEscrow         = 0x00000020;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTSetCanTrade            = 0x00000040;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTClearCanTrade          = 0x00000080;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTSetCanTransfer         = 0x00000100;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTClearCanTransfer       = 0x00000200;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTSetCanClawback         = 0x00000400;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTClearCanClawback       = 0x00000800;
 | 
			
		||||
constexpr std::uint32_t const tmfMPTokenIssuanceSetMutableMask = ~(tmfMPTSetCanLock | tmfMPTClearCanLock |
 | 
			
		||||
    tmfMPTSetRequireAuth | tmfMPTClearRequireAuth | tmfMPTSetCanEscrow | tmfMPTClearCanEscrow |
 | 
			
		||||
    tmfMPTSetCanTrade | tmfMPTClearCanTrade | tmfMPTSetCanTransfer | tmfMPTClearCanTransfer |
 | 
			
		||||
    tmfMPTSetCanClawback | tmfMPTClearCanClawback);
 | 
			
		||||
 | 
			
		||||
// MPTokenIssuanceDestroy flags:
 | 
			
		||||
constexpr std::uint32_t const tfMPTokenIssuanceDestroyMask  = ~tfUniversal;
 | 
			
		||||
 
 | 
			
		||||
@@ -33,51 +33,35 @@ namespace ripple {
 | 
			
		||||
 | 
			
		||||
class TxMeta
 | 
			
		||||
{
 | 
			
		||||
private:
 | 
			
		||||
    struct CtorHelper
 | 
			
		||||
    {
 | 
			
		||||
        explicit CtorHelper() = default;
 | 
			
		||||
    };
 | 
			
		||||
    template <class T>
 | 
			
		||||
    TxMeta(
 | 
			
		||||
        uint256 const& txID,
 | 
			
		||||
        std::uint32_t ledger,
 | 
			
		||||
        T const& data,
 | 
			
		||||
        CtorHelper);
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    TxMeta(
 | 
			
		||||
        uint256 const& transactionID,
 | 
			
		||||
        std::uint32_t ledger,
 | 
			
		||||
        std::optional<uint256> parentBatchId = std::nullopt);
 | 
			
		||||
    TxMeta(uint256 const& transactionID, std::uint32_t ledger);
 | 
			
		||||
    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, STObject const&);
 | 
			
		||||
 | 
			
		||||
    uint256 const&
 | 
			
		||||
    getTxID() const
 | 
			
		||||
    {
 | 
			
		||||
        return mTransactionID;
 | 
			
		||||
        return transactionID_;
 | 
			
		||||
    }
 | 
			
		||||
    std::uint32_t
 | 
			
		||||
    getLgrSeq() const
 | 
			
		||||
    {
 | 
			
		||||
        return mLedger;
 | 
			
		||||
        return ledgerSeq_;
 | 
			
		||||
    }
 | 
			
		||||
    int
 | 
			
		||||
    getResult() const
 | 
			
		||||
    {
 | 
			
		||||
        return mResult;
 | 
			
		||||
        return result_;
 | 
			
		||||
    }
 | 
			
		||||
    TER
 | 
			
		||||
    getResultTER() const
 | 
			
		||||
    {
 | 
			
		||||
        return TER::fromInt(mResult);
 | 
			
		||||
        return TER::fromInt(result_);
 | 
			
		||||
    }
 | 
			
		||||
    std::uint32_t
 | 
			
		||||
    getIndex() const
 | 
			
		||||
    {
 | 
			
		||||
        return mIndex;
 | 
			
		||||
        return index_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void
 | 
			
		||||
@@ -104,66 +88,52 @@ public:
 | 
			
		||||
    STArray&
 | 
			
		||||
    getNodes()
 | 
			
		||||
    {
 | 
			
		||||
        return (mNodes);
 | 
			
		||||
        return nodes_;
 | 
			
		||||
    }
 | 
			
		||||
    STArray const&
 | 
			
		||||
    getNodes() const
 | 
			
		||||
    {
 | 
			
		||||
        return (mNodes);
 | 
			
		||||
        return nodes_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void
 | 
			
		||||
    setDeliveredAmount(STAmount const& delivered)
 | 
			
		||||
    setAdditionalFields(STObject const& obj)
 | 
			
		||||
    {
 | 
			
		||||
        mDelivered = delivered;
 | 
			
		||||
        if (obj.isFieldPresent(sfDeliveredAmount))
 | 
			
		||||
            deliveredAmount_ = obj.getFieldAmount(sfDeliveredAmount);
 | 
			
		||||
 | 
			
		||||
        if (obj.isFieldPresent(sfParentBatchID))
 | 
			
		||||
            parentBatchID_ = obj.getFieldH256(sfParentBatchID);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    STAmount
 | 
			
		||||
    std::optional<STAmount> const&
 | 
			
		||||
    getDeliveredAmount() const
 | 
			
		||||
    {
 | 
			
		||||
        XRPL_ASSERT(
 | 
			
		||||
            hasDeliveredAmount(),
 | 
			
		||||
            "ripple::TxMeta::getDeliveredAmount : non-null delivered amount");
 | 
			
		||||
        return *mDelivered;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool
 | 
			
		||||
    hasDeliveredAmount() const
 | 
			
		||||
    {
 | 
			
		||||
        return static_cast<bool>(mDelivered);
 | 
			
		||||
        return deliveredAmount_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void
 | 
			
		||||
    setParentBatchId(uint256 const& parentBatchId)
 | 
			
		||||
    setDeliveredAmount(std::optional<STAmount> const& amount)
 | 
			
		||||
    {
 | 
			
		||||
        mParentBatchId = parentBatchId;
 | 
			
		||||
        deliveredAmount_ = amount;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    uint256
 | 
			
		||||
    getParentBatchId() const
 | 
			
		||||
    void
 | 
			
		||||
    setParentBatchID(std::optional<uint256> const& id)
 | 
			
		||||
    {
 | 
			
		||||
        XRPL_ASSERT(
 | 
			
		||||
            hasParentBatchId(),
 | 
			
		||||
            "ripple::TxMeta::getParentBatchId : non-null batch id");
 | 
			
		||||
        return *mParentBatchId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool
 | 
			
		||||
    hasParentBatchId() const
 | 
			
		||||
    {
 | 
			
		||||
        return static_cast<bool>(mParentBatchId);
 | 
			
		||||
        parentBatchID_ = id;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    uint256 mTransactionID;
 | 
			
		||||
    std::uint32_t mLedger;
 | 
			
		||||
    std::uint32_t mIndex;
 | 
			
		||||
    int mResult;
 | 
			
		||||
    uint256 transactionID_;
 | 
			
		||||
    std::uint32_t ledgerSeq_;
 | 
			
		||||
    std::uint32_t index_;
 | 
			
		||||
    int result_;
 | 
			
		||||
 | 
			
		||||
    std::optional<STAmount> mDelivered;
 | 
			
		||||
    std::optional<uint256> mParentBatchId;
 | 
			
		||||
    std::optional<STAmount> deliveredAmount_;
 | 
			
		||||
    std::optional<uint256> parentBatchID_;
 | 
			
		||||
 | 
			
		||||
    STArray mNodes;
 | 
			
		||||
    STArray nodes_;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
}  // namespace ripple
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user