Compare commits

..

239 Commits

Author SHA1 Message Date
Pratik Mankawde
f5ea82f32a Merge branch 'pratik/Add-sanitizers-to-CI-builds' into pratik/Fix-ubsan-flagged-issues
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-01-07 16:50:27 +00:00
Pratik Mankawde
75226af325 renaming and doc update
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-01-07 16:43:59 +00:00
Pratik Mankawde
95a6bbb097 Merge remote-tracking branch 'origin/develop' into pratik/Add-sanitizers-to-CI-builds 2026-01-07 16:06:38 +00:00
Pratik Mankawde
1223bb497c add . in version string
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-01-07 16:03:53 +00:00
Pratik Mankawde
9646537c62 code review changes
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-01-07 15:18:14 +00:00
Pratik Mankawde
8b89ae8c52 Merge remote-tracking branch 'origin/develop' into pratik/Add-sanitizers-to-CI-builds
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-01-07 11:51:27 +00:00
Bart
f80059e467 ci: Move variable into right place (#6179)
This change moves the `enable_ccache` variable in the `on-trigger.yml` file to the correct location.
2026-01-07 06:07:53 -05:00
Bart
d734c8dddd ci: Use ccache to cache build objects for speeding up building (#6104)
Right now, each pipeline invocation builds the source code from scratch. Although compiled Conan dependencies are cached in a remote server, the source build objects are not. We are able to further speed up our builds by leveraging `ccache`. This change enables caching of build objects using `ccache` on Linux, macOS, and Windows.
2026-01-07 01:34:21 +00:00
Mayukha Vadari
44d21b8f6d test: add more tests for ledger_entry RPC (#5858)
This change adds some basic tests for all the `ledger_entry` helper functions, so each ledger entry type is covered. There are further some minor refactors in `parseAMM` to provide better error messages. Finally, to improve readability, alphabetization was applied in the helper functions.
2026-01-05 10:54:24 -05:00
Bart
3d1b3a49b3 refactor: Rename rippled.cfg to xrpld.cfg (#6098)
This change renames all occurrences of `rippled.cfg` to `xrpld.cfg`. It also provides a script to allow developers to replicate the changes in their local branch or fork to avoid conflicts. For the time being it maintains support for `rippled.cfg` as config file, if `xrpld.cfg` does not exist.
2026-01-05 14:55:12 +00:00
Ayaz Salikhov
0b87a26f04 Revert "chore: Pin ruamel.yaml<0.19 in pre-commit-hooks (#6166)" (#6167)
This reverts commit 0f23ad820c.
2026-01-05 14:01:14 +00:00
Ayaz Salikhov
0f23ad820c chore: Pin ruamel.yaml<0.19 in pre-commit-hooks (#6166)
See https://github.com/pre-commit/pre-commit-hooks/issues/1229 for more details.
2026-01-02 11:53:33 -05:00
Michael Legleux
b7139da4d0 fix: Remove cryptographic libs from libxrpl Conan package (#6163)
* fix: rm crypto libs and fix protobuf path

* update/rm comments
2025-12-23 16:38:35 -08:00
Bart
40198d9792 ci: Remove superfluous build directory creation (#6159)
This change modifies the build directory structure from `build/build/xxx` or `.build/build/xxx` to just `build/xxx`. Namely, the `conanfile.py` has the CMake generators build directory hardcoded to `build/generators`. We may as well leverage the top-level build directory without introducing another layer of directory nesting.
2025-12-22 16:30:23 -05:00
Pratik Mankawde
1aebb3f884 include guard and build failure issue
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-19 18:25:52 +00:00
Pratik Mankawde
bc3553d53c include guard and build failure issue
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-19 18:25:34 +00:00
Pratik Mankawde
5e8ec07d31 Merge branch 'pratik/Add-sanitizers-to-CI-builds' into pratik/Fix-ubsan-flagged-issues 2025-12-19 18:10:46 +00:00
Pratik Mankawde
0ab3e11b21 Merge branch 'pratik/Add-sanitizers-to-CI-builds' of github.com:XRPLF/rippled into pratik/Add-sanitizers-to-CI-builds 2025-12-19 18:00:24 +00:00
Pratik Mankawde
5e41e060a8 Code review changes
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-19 17:59:12 +00:00
Pratik Mankawde
04417e18d5 Update cmake/XrplCompiler.cmake
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2025-12-19 17:57:07 +00:00
Pratik Mankawde
8c21c33531 Merge branch 'pratik/Add-sanitizers-to-CI-builds' into pratik/Fix-ubsan-flagged-issues 2025-12-19 17:44:05 +00:00
Pratik Mankawde
738aa9482e code review changes
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-19 17:31:14 +00:00
Pratik Mankawde
6c1ad00e28 fixed SANITIZERS bug
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-19 16:21:47 +00:00
Pratik Mankawde
5862ba952d Update cmake/XrplSanitizers.cmake
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2025-12-19 16:19:12 +00:00
Pratik Mankawde
fa97bf1ef6 Merge branch 'pratik/Add-sanitizers-to-CI-builds' into pratik/Fix-ubsan-flagged-issues
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-19 16:06:16 +00:00
Pratik Mankawde
46d9937ffa code review changes
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-18 16:58:49 +00:00
Pratik Mankawde
1c10f730a1 moved env. detection to compilationenv.cmake
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-18 16:07:32 +00:00
Pratik Mankawde
453297442f Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-12-18 15:47:19 +00:00
Pratik Mankawde
6479ab29c6 only build sanitizers with clang-20
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-18 15:46:32 +00:00
Pratik Mankawde
09f75f3026 removed pic and pie setup.
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-18 15:43:51 +00:00
Bart
f059f0beda Set version to 3.2.0-b0 (#6153) 2025-12-17 18:21:01 -05:00
Pratik Mankawde
ba795fb741 Merge branch 'pratik/Add-sanitizers-to-CI-builds' into pratik/Fix-ubsan-flagged-issues 2025-12-17 14:55:24 +00:00
Pratik Mankawde
fded7cfb9b fix 2025-12-17 14:30:53 +00:00
Pratik Mankawde
e25e609624 minor fix 2025-12-17 14:27:48 +00:00
Pratik Mankawde
817169a85f remove default pic 2025-12-17 14:25:28 +00:00
Pratik Mankawde
247723980f cleaned up ubsan.supp
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-17 14:02:52 +00:00
Pratik Mankawde
45348e7eb5 fix ubsan issues
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-17 14:01:23 +00:00
Pratik Mankawde
aacf78ba1e removed prefix
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-17 12:42:03 +00:00
Pratik Mankawde
a17ed48007 fixes to PREFIX
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-17 12:15:59 +00:00
Pratik Mankawde
4e0e78362c fixed test run command
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-17 11:54:44 +00:00
Pratik Mankawde
9c1fc32c19 trying asan fixes
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-16 16:10:48 +00:00
Pratik Mankawde
e8609fc83c build with no-pie
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-16 15:46:29 +00:00
Pratik Mankawde
f75d880f40 added one more entry to supps
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-16 15:13:57 +00:00
Pratik Mankawde
15f37aa132 added no-pic for gcc asan, added suppressions
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-16 14:35:22 +00:00
Pratik Mankawde
89a135649b don't use mold when building with sanitizers
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-16 13:02:24 +00:00
Pratik Mankawde
755833508c minor comments update
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-16 12:45:11 +00:00
Pratik Mankawde
e4e3900876 suppress issue in invariants_test
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-16 12:36:41 +00:00
Pratik Mankawde
870e079a8e Merge remote-tracking branch 'origin/develop' into pratik/Add-sanitizers-to-CI-builds 2025-12-16 12:00:58 +00:00
Pratik Mankawde
32f7baca44 code review changes
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-16 11:57:04 +00:00
Pratik Mankawde
93b0554a36 Apply suggestions from code review
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2025-12-16 11:14:39 +00:00
Pratik Mankawde
e0f9de0ea0 Update .github/actions/build-deps/action.yml
update description

Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2025-12-16 11:12:08 +00:00
Mayukha Vadari
41c1be2bac refactor: remove Json::Object and related files/classes (#5894)
`Json::Object` and related objects are not used at all, so this change removes `include/xrpl/json/Object.h` and all downstream files. There are a number of minor downstream changes as well.

Full list of deleted classes and functions:
* `Json::Collections`
* `Json::Object`
* `Json::Array`
* `Json::WriterObject`
* `Json::setArray`
* `Json::addObject`
* `Json::appendArray`
* `Json::appendObject`

The last helper function, `copyFrom`, seemed a bit more complex and was actually used in a few places, so it was moved to `LedgerToJson.h` instead of deleting it.
2025-12-15 13:40:08 -05:00
Pratik Mankawde
3ea3e41b18 updated lockfile
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-15 17:56:07 +00:00
Pratik Mankawde
531b0d051a Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-12-15 17:35:47 +00:00
Pratik Mankawde
3cd4e5cb5a code review comments
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-15 17:34:17 +00:00
Bart
f816ffa55f ci: Update shared actions (#6147)
The latest update to `cleanup-workspace`, `get-nproc`, and `prepare-runner` moved the action to the repository root directory, and also includes some ccache changes. In response, this change updates the various shared actions to the latest commit hash.
2025-12-12 19:47:34 +00:00
Pratik Mankawde
c8e3ba5d90 updated conan.lock file
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-12 16:32:33 +00:00
liuyueyangxmu
cf748702af chore: Fix some typos in comments (#6082) 2025-12-12 11:06:17 -05:00
Pratik Mankawde
49c037493d updated docs
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-12 15:23:58 +00:00
Pratik Mankawde
a4f112d479 Moved to entirely cmake workflow
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-12 15:23:35 +00:00
Pratik Mankawde
8d7398419a reverted abseil to original version 20250127
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-12 14:22:16 +00:00
Pratik Mankawde
06e31f417c reverting to abseil/20240722.0
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-12 12:40:35 +00:00
Bart
1eb0fdac65 refactor: Rename ripple namespace to xrpl (#5982)
This change renames all occurrences of `namespace ripple` and `ripple::` to `namespace xrpl` and `xrpl::`, respectively, as well as the names of test suites. It also provides a script to allow developers to replicate the changes in their local branch or fork to avoid conflicts.
2025-12-11 16:51:49 +00:00
Pratik Mankawde
4d64e83992 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-11 14:45:24 +00:00
Pratik Mankawde
3d6dd17325 Merge remote-tracking branch 'origin/develop' into pratik/Add-sanitizers-to-CI-builds 2025-12-10 19:06:08 +00:00
Pratik Mankawde
405a0f4309 updating abseil version 2025-12-10 14:05:46 +00:00
Pratik Mankawde
5e89e2dfe7 removed no-pic
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-09 17:50:01 +00:00
Pratik Mankawde
63ba065440 cflags
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-09 17:40:24 +00:00
Pratik Mankawde
b1f924bfeb testing with profile_dir
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-09 17:32:25 +00:00
Pratik Mankawde
033986728c removed cmake prefix
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-09 17:21:44 +00:00
Pratik Mankawde
2b1479fa99 trying ABSL_ENABLE_CONSTANT_INIT_V2 flag
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-09 17:11:55 +00:00
Pratik Mankawde
9ec5ef96f8 trying ABSL_ENABLE_CONSTANT_INIT_V2 2025-12-09 16:11:30 +00:00
Pratik Mankawde
b28489934d using DABSL_ENABLE_CONSTANT_INIT_V2 flag
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-09 14:24:37 +00:00
Pratik Mankawde
3aeb9b3b86 try to silent gcc error on Abseil
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-09 14:02:19 +00:00
Pratik Mankawde
f827e1b2a7 Merge remote-tracking branch 'origin/develop' into pratik/Add-sanitizers-to-CI-builds 2025-12-09 13:49:25 +00:00
Pratik Mankawde
ca9fd5e319 removed -g 2025-12-05 15:32:12 +00:00
Pratik Mankawde
5bb30cff15 Merge remote-tracking branch 'origin/develop' into pratik/Add-sanitizers-to-CI-builds 2025-12-05 13:23:02 +00:00
Pratik Mankawde
8b761b9ce6 minor change 2025-12-04 18:38:29 +00:00
Pratik Mankawde
1f8fbaedca asan errors, may not be related but testing.
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2025-12-04 15:36:39 +00:00
Pratik Mankawde
1cdd43f259 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-12-04 14:57:54 +00:00
Pratik Mankawde
982d26610d Merge remote-tracking branch 'origin/develop' into pratik/Add-sanitizers-to-CI-builds 2025-12-04 14:25:39 +00:00
Pratik Mankawde
1f2f05d320 code review changes 2025-12-03 17:40:42 +00:00
Pratik Mankawde
7f09fbe807 removed extra signed-integer-overflow
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-28 17:34:39 +00:00
Pratik Mankawde
734f8a9810 minor cleanup
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-28 16:51:39 +00:00
Pratik Mankawde
935e45bcca Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-28 16:36:25 +00:00
Pratik Mankawde
0b612b5c13 changed job name
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-28 16:20:19 +00:00
Pratik Mankawde
7617072ebc sanitizer variable now has separate address,undefined and thread values
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-28 16:01:01 +00:00
Pratik Mankawde
4a61ff3bef minor change
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-28 14:45:56 +00:00
Pratik Mankawde
7097566d9d code review comments
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-28 13:15:34 +00:00
Pratik Mankawde
afedb276db quote issue again
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-27 15:59:04 +00:00
Pratik Mankawde
941775fec4 fix path issue
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-27 15:28:10 +00:00
Pratik Mankawde
4058ca01ac minor cleanup
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-27 13:47:50 +00:00
Pratik Mankawde
9c5df200b8 cleanup
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-27 13:46:11 +00:00
Pratik Mankawde
96e8ee4bdd added an extra line
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-27 13:33:28 +00:00
Pratik Mankawde
c182d13ab5 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-27 13:21:51 +00:00
Pratik Mankawde
d942fd9f9c updated docs
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-26 15:19:13 +00:00
Pratik Mankawde
064d51b79c more code changes
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-26 15:13:12 +00:00
Pratik Mankawde
6202148623 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-26 14:07:07 +00:00
Pratik Mankawde
954fe68e91 added more info to package id configs
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-26 14:03:58 +00:00
Pratik Mankawde
1d38504d85 code review fixes 1
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-26 13:57:44 +00:00
Pratik Mankawde
9cdabe98e2 link to sanitizer_readme.md
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-21 18:10:18 +00:00
Pratik Mankawde
49f8daf82f updated link
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-21 18:09:14 +00:00
Pratik Mankawde
dd9e554d4a added readme.
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-21 18:06:01 +00:00
Pratik Mankawde
facb6c63e3 cleanup and additions to asan, ubsan suppressions
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-21 16:24:38 +00:00
Pratik Mankawde
32d129ee5e Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-21 12:18:31 +00:00
Pratik Mankawde
6e32392f93 added no-PIC
Signed-off-by: Pratik Mankawde <pratikmankawde@gmail.com>
2025-11-21 12:17:53 +00:00
Pratik Mankawde
39ace64833 updated blacklist file
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 18:40:11 +00:00
Pratik Mankawde
4430cb64b8 trying a diff. sanitizer-blacklist syntax
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 18:27:26 +00:00
Pratik Mankawde
d4b033958e removed static linking.
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 18:05:39 +00:00
Pratik Mankawde
1a08b97fb6 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-19 17:51:07 +00:00
Pratik Mankawde
6407788b0f added halt on error=0 and -fno-pie
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 17:44:39 +00:00
Pratik Mankawde
702d94134e minor correction
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 17:22:06 +00:00
Pratik Mankawde
7d3fc5c396 added static linking flags
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 17:13:31 +00:00
Pratik Mankawde
810f5e94db statically link sanitizers
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 17:08:33 +00:00
Pratik Mankawde
d026d0640f build conan deps with sanitizers to fix tsan crashes
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 15:34:24 +00:00
Pratik Mankawde
5befd5d249 added tsan option second_deadlock_stack=1 and more tsan supps
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 13:23:48 +00:00
Pratik Mankawde
4f496db291 few more additions
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 12:20:48 +00:00
Pratik Mankawde
10553fc437 added few more suppressions in tsan.supp
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 11:48:24 +00:00
Pratik Mankawde
087e52ea36 suppress crashes in tsan intrumentation code
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 11:02:55 +00:00
Pratik Mankawde
cb982e7a8a added pie flag and signal suppressions
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-19 10:42:23 +00:00
Pratik Mankawde
2610e653d6 only for clang
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 17:58:59 +00:00
Pratik Mankawde
b6c313bb94 only use ignorelist in gcc
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 17:41:21 +00:00
Pratik Mankawde
a3e42a0d11 alternate approach
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 17:19:14 +00:00
Pratik Mankawde
92a6c986b3 try blacklist file
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 17:10:29 +00:00
Pratik Mankawde
dd0408ac53 added blacklist file
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 17:00:38 +00:00
Pratik Mankawde
0fcfcd059e more aggressive suppresions
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 16:37:10 +00:00
Pratik Mankawde
4c0f7a337a few more additions
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 15:59:44 +00:00
Pratik Mankawde
640f9ff5e2 Added more files to ubsan.supp
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 15:18:08 +00:00
Pratik Mankawde
42cab6c826 updated ubsan file
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 15:02:21 +00:00
Pratik Mankawde
9267756944 fixed generate.py file " issue
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 14:14:49 +00:00
Pratik Mankawde
3b1e82b412 revert back to clang-20
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 13:45:18 +00:00
Pratik Mankawde
7d7c659822 target clang-21
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 13:42:59 +00:00
Pratik Mankawde
a58df41a4d Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 13:42:12 +00:00
Pratik Mankawde
d01b1da80e cleaned up linker flags
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-18 11:55:24 +00:00
Pratik Mankawde
216ecf67e1 updated tsan and ubsan
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-17 19:18:15 +00:00
Pratik Mankawde
d8c8900fbb updated supp files
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-17 18:43:39 +00:00
Pratik Mankawde
e2c75f5d60 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-17 17:59:34 +00:00
Pratik Mankawde
2428c5c196 added more suppressions
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-17 17:58:08 +00:00
Pratik Mankawde
d8ff72b342 updated asan and lsan
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-17 17:11:36 +00:00
Pratik Mankawde
4fc5c00c24 added lsan and updated tsan
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-17 16:53:51 +00:00
Pratik Mankawde
5a9014912c trying without begin-regex
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-17 12:12:27 +00:00
Pratik Mankawde
8006a1e967 removed leak type
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-16 12:30:23 +00:00
Pratik Mankawde
6610f469df trying diff. asan supp options
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-16 11:23:38 +00:00
Pratik Mankawde
9f026929cf adding asio to tsan.supp
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 19:43:19 +00:00
Pratik Mankawde
a9d134af85 more chnages
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 19:13:26 +00:00
Pratik Mankawde
18b9b9da19 updated supp files
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 18:50:08 +00:00
Pratik Mankawde
6a89a544fe tsan race suppression
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 18:10:18 +00:00
Pratik Mankawde
427771775e added afew suppressors
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 17:43:15 +00:00
Pratik Mankawde
67946f4993 more cleanup
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 16:51:54 +00:00
Pratik Mankawde
8d8a0cb970 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-14 16:25:11 +00:00
Pratik Mankawde
89f9ede1f5 cleanup
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 16:24:04 +00:00
Pratik Mankawde
aac1076d83 minor cleanup
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 13:01:30 +00:00
Pratik Mankawde
c0da02814b Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-14 12:53:30 +00:00
Pratik Mankawde
013ff18fce cleanup
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 12:51:47 +00:00
Pratik Mankawde
e1403d56ef skip mold, gold, lld
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 12:20:07 +00:00
Pratik Mankawde
58b248d9a4 pass lld flag to cmake
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 11:23:59 +00:00
Pratik Mankawde
f1561c5b48 use lld
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 10:57:11 +00:00
Pratik Mankawde
73ab466029 use gold+large
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-14 10:25:39 +00:00
Pratik Mankawde
4cf4802971 for tsan only use medium
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-13 16:54:41 +00:00
Pratik Mankawde
8d6d2ec455 trying with bfd
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-13 16:31:41 +00:00
Pratik Mankawde
4248a1fbb6 only set mcmodel=large for gcc
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-13 16:18:34 +00:00
Pratik Mankawde
7edba0a856 trying with mcmodel=large
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-13 16:01:36 +00:00
Pratik Mankawde
b38ef53c44 trying lld.
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-13 15:03:23 +00:00
Pratik Mankawde
baee65bd28 fixing minor spacing issue
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-13 13:01:32 +00:00
Pratik Mankawde
2e53c5ab80 changed linker for gcc
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-13 12:28:48 +00:00
Pratik Mankawde
09a6e46c39 pass sanitizer flags to linker as well
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 17:32:39 +00:00
Pratik Mankawde
a93052e765 added -fPIC flag
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 16:58:01 +00:00
Pratik Mankawde
1cc00cddd8 trying with " and dyn linking
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 16:19:34 +00:00
Pratik Mankawde
5f2a351e3f reverted mcmodel to medium
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 16:08:36 +00:00
Pratik Mankawde
5e89bce8d9 use mcmodel=large
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 14:48:10 +00:00
Pratik Mankawde
9b793cd429 linker flag correction
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 14:16:58 +00:00
Pratik Mankawde
b650852fa7 static liking for gcc
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 14:09:12 +00:00
Pratik Mankawde
1d76de83f6 minor correction
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 13:12:01 +00:00
Pratik Mankawde
ea4d062e68 added ubsan file
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 12:15:45 +00:00
Pratik Mankawde
dcd0553050 sanitizer builds only for gcc15 and clang20. no linking check for sanitizer builds
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 11:46:20 +00:00
Pratik Mankawde
6355eba88e Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-12 10:37:48 +00:00
Pratik Mankawde
2e5afa7556 updated asan suppressions file
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-12 10:36:02 +00:00
Pratik Mankawde
7d05090d68 setting variables in run
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 19:21:33 +00:00
Pratik Mankawde
916f00039c try 8
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 19:15:50 +00:00
Pratik Mankawde
e687ab8653 try 7
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 19:07:22 +00:00
Pratik Mankawde
b182b6abf7 try 6
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 19:02:08 +00:00
Pratik Mankawde
509d388f97 try 6
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:58:21 +00:00
Pratik Mankawde
fd712770e1 try 5
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:53:42 +00:00
Pratik Mankawde
695f4a2cc9 try 4
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:50:04 +00:00
Pratik Mankawde
5ea3b4327d try 3
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:46:13 +00:00
Pratik Mankawde
a9444d3a42 try 2
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:42:14 +00:00
Pratik Mankawde
20326a785b putting commented code back
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:39:00 +00:00
Pratik Mankawde
5ef2ced584 testing by printing asan_options
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:38:21 +00:00
Pratik Mankawde
a011d29fcb trying again with minor change
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:36:51 +00:00
Pratik Mankawde
9abec17536 commenting out windows and mac for now.
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:32:58 +00:00
Pratik Mankawde
2bc089a962 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:30:47 +00:00
Pratik Mankawde
14f605b2f9 minor
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:29:52 +00:00
Pratik Mankawde
f2365543fb added variable in an early action
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:19:04 +00:00
Pratik Mankawde
d9c26bd7a9 another comb.
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 18:17:37 +00:00
Pratik Mankawde
937dc8740e another combi
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 17:53:16 +00:00
Pratik Mankawde
9b92aafe6d fixed path to atsan
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 17:42:23 +00:00
Pratik Mankawde
124b6ca4bd using GITHUB_WORKSPACE now
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 17:27:51 +00:00
Pratik Mankawde
28885a4638 path revert
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 17:13:45 +00:00
Pratik Mankawde
5478e4fee6 move working_dir up
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 16:57:32 +00:00
Pratik Mankawde
72b3a03538 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-11 16:51:12 +00:00
Pratik Mankawde
18b65fd129 linked model flags specific to amd64
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 16:42:57 +00:00
Pratik Mankawde
ebf917ab15 no-var-tracking is gcc specific
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 15:33:17 +00:00
Pratik Mankawde
2178fb919f Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 15:08:00 +00:00
Pratik Mankawde
e156ed40ba minor formatting
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 15:06:47 +00:00
Pratik Mankawde
db5aa2d277 added no-var-tracking
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 15:03:20 +00:00
Pratik Mankawde
e347da9fac added mcmodel flags for linker
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 14:56:07 +00:00
Pratik Mankawde
6b8d5b57e1 updated suppression file paths
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 14:36:27 +00:00
Pratik Mankawde
0029210926 minor fix
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 14:16:39 +00:00
Pratik Mankawde
832c32d15c formatting changes
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 13:59:08 +00:00
Pratik Mankawde
39adc5a82b fixes forgcc compilation errors.
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 13:57:31 +00:00
Pratik Mankawde
1f88697f54 trying suppression files
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 12:42:36 +00:00
Pratik Mankawde
4a0fc0f686 formatting changes
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 11:22:51 +00:00
Pratik Mankawde
f5b473ccd1 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 11:21:25 +00:00
Pratik Mankawde
71212677c0 don't build deps with sanitizers
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-11 11:02:16 +00:00
Pratik Mankawde
abfaac5c64 trying direct input placement
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-10 17:16:55 +00:00
Pratik Mankawde
cb5a76589e tryring escaped " in config file
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-10 17:02:50 +00:00
Pratik Mankawde
d077141d75 name to small case
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-10 16:46:41 +00:00
Pratik Mankawde
1eb3cc4ec7 fixed pre-commit check
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-10 16:44:37 +00:00
Pratik Mankawde
34b10b87e6 merged develop
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-10 16:13:08 +00:00
Pratik Mankawde
c0ecb9a0cd Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-10 16:02:33 +00:00
Pratik Mankawde
c15d6399fb minor revert in clang-format
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-10 15:58:17 +00:00
Pratik Mankawde
0b1bd42cc0 Add sanitizers to CI builds
- Added Address and Thread sanitizers for Debian Bookworm builds
- Updated build-deps action to support sanitizer flags
- Modified strategy matrix generation to include sanitizer configurations
- Updated Conan profiles for sanitizer support
- Added InsertNewlineAtEOF setting to clang-format
2025-11-10 15:54:44 +00:00
Pratik Mankawde
30f7ef7676 Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-06 10:11:55 +00:00
Pratik Mankawde
e7da05e44c added setting EOF-ExtraLine in clang-format
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-06 10:10:18 +00:00
Pratik Mankawde
1cdd0bf63e end of line
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-06 10:03:17 +00:00
Pratik Mankawde
48a3e5ea31 special case only for gcc
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-06 10:00:46 +00:00
Pratik Mankawde
10a422dd69 seperate clang and gcc
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 15:31:09 +00:00
Pratik Mankawde
b150feaab6 fixes sanitizer arg not available in build-test
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 15:14:29 +00:00
Pratik Mankawde
ada523071f passing sanitizers to on-pr and on-trigger
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 14:30:14 +00:00
Pratik Mankawde
ff0284e984 removed sanitizers from script
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 13:33:40 +00:00
Pratik Mankawde
0be98ac610 made sanitizers optional
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 13:29:58 +00:00
Pratik Mankawde
83eb93f5d7 added back type
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 13:22:31 +00:00
Pratik Mankawde
db74cebc8b added build with sanitizers ins.
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 12:49:08 +00:00
Pratik Mankawde
3b32210ef4 formatting changes
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 12:26:33 +00:00
Pratik Mankawde
21b9f6d1af Merge branch 'develop' into pratik/Add-sanitizers-to-CI-builds 2025-11-05 12:25:47 +00:00
Pratik Mankawde
977a087bb3 code review changes
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 12:25:29 +00:00
Pratik Mankawde
e95299dac5 code review changes
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-05 09:46:56 +00:00
Pratik Mankawde
7ae3a85f21 formatting correction
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-04 16:12:22 +00:00
Pratik Mankawde
c38b5aa2d4 Added flow for the sanitizers build
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
2025-11-04 15:59:15 +00:00
1302 changed files with 6451 additions and 5755 deletions

View File

@@ -4,9 +4,6 @@ description: "Install Conan dependencies, optionally forcing a rebuild of all de
# 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_type:
description: 'The build type to use ("Debug", "Release").'
required: true
@@ -21,6 +18,10 @@ inputs:
description: "The logging verbosity."
required: false
default: "verbose"
sanitizers:
description: "The sanitizers to enable."
required: false
default: ""
runs:
using: composite
@@ -28,17 +29,15 @@ runs:
- 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 }}
SANITIZERS: ${{ inputs.sanitizers }}
run: |
echo 'Installing dependencies.'
mkdir -p "${BUILD_DIR}"
cd "${BUILD_DIR}"
conan install \
--output-folder . \
--profile ci \
--build="${BUILD_OPTION}" \
--options:host='&:tests=True' \
--options:host='&:xrpld=True' \
@@ -46,4 +45,4 @@ runs:
--conf:all tools.build:jobs=${BUILD_NPROC} \
--conf:all tools.build:verbosity="${LOG_VERBOSITY}" \
--conf:all tools.compilation:verbosity="${LOG_VERBOSITY}" \
..
.

View File

@@ -11,12 +11,6 @@ runs:
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
@@ -27,17 +21,23 @@ runs:
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
- name: Check configuration (all)
shell: bash
run: |
echo 'Checking Ccache version.'
ccache --version
echo 'Checking CMake version.'
cmake --version
echo 'Checking Conan version.'
conan --version

View File

@@ -28,7 +28,7 @@ runs:
shell: bash
run: |
echo 'Installing profile.'
conan config install conan/profiles/default -tf $(conan config home)/profiles/
conan config install conan/profiles/ -tf $(conan config home)/profiles/
echo 'Conan profile:'
conan profile show

View File

@@ -29,6 +29,11 @@ run from the repository root.
4. `.github/scripts/rename/binary.sh`: This script will rename the binary from
`rippled` to `xrpld`, and reverses the symlink so that `rippled` points to
the `xrpld` binary.
5. `.github/scripts/rename/namespace.sh`: This script will rename the C++
namespaces from `ripple` to `xrpl`.
6. `.github/scripts/rename/config.sh`: This script will rename the config from
`rippled.cfg` to `xrpld.cfg`, and updating the code accordingly. The old
filename will still be accepted.
You can run all these scripts from the repository root as follows:
@@ -37,4 +42,6 @@ You can run all these scripts from the repository root as follows:
./.github/scripts/rename/copyright.sh .
./.github/scripts/rename/cmake.sh .
./.github/scripts/rename/binary.sh .
./.github/scripts/rename/namespace.sh .
./.github/scripts/rename/config.sh .
```

72
.github/scripts/rename/config.sh vendored Executable file
View File

@@ -0,0 +1,72 @@
#!/bin/bash
# Exit the script as soon as an error occurs.
set -e
# On MacOS, ensure that GNU sed is installed and available as `gsed`.
SED_COMMAND=sed
if [[ "${OSTYPE}" == 'darwin'* ]]; then
if ! command -v gsed &> /dev/null; then
echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'."
exit 1
fi
SED_COMMAND=gsed
fi
# This script renames the config from `rippled.cfg` to `xrpld.cfg`, and updates
# the code accordingly. The old filename will still be accepted.
# Usage: .github/scripts/rename/config.sh <repository directory>
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <repository directory>"
exit 1
fi
DIRECTORY=$1
echo "Processing directory: ${DIRECTORY}"
if [ ! -d "${DIRECTORY}" ]; then
echo "Error: Directory '${DIRECTORY}' does not exist."
exit 1
fi
pushd ${DIRECTORY}
# Add the xrpld.cfg to the .gitignore.
if ! grep -q 'xrpld.cfg' .gitignore; then
${SED_COMMAND} -i '/rippled.cfg/a\
/xrpld.cfg' .gitignore
fi
# Rename the files.
if [ -e rippled.cfg ]; then
mv rippled.cfg xrpld.cfg
fi
if [ -e cfg/rippled-example.cfg ]; then
mv cfg/rippled-example.cfg cfg/xrpld-example.cfg
fi
# Rename inside the files.
DIRECTORIES=("cfg" "cmake" "include" "src")
for DIRECTORY in "${DIRECTORIES[@]}"; do
echo "Processing directory: ${DIRECTORY}"
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" -o -name "*.cmake" -o -name "*.txt" -o -name "*.cfg" -o -name "*.md" \) | while read -r FILE; do
echo "Processing file: ${FILE}"
${SED_COMMAND} -i -E 's/rippled(-example)?[ .]cfg/xrpld\1.cfg/g' "${FILE}"
done
done
${SED_COMMAND} -i 's/rippled/xrpld/g' cfg/xrpld-example.cfg
${SED_COMMAND} -i 's/rippled/xrpld/g' src/test/core/Config_test.cpp
${SED_COMMAND} -i 's/ripplevalidators/xrplvalidators/g' src/test/core/Config_test.cpp
${SED_COMMAND} -i 's/rippleConfig/xrpldConfig/g' src/test/core/Config_test.cpp
${SED_COMMAND} -i 's@ripple/@xrpld/@g' src/test/core/Config_test.cpp
${SED_COMMAND} -i 's/Rippled/File/g' src/test/core/Config_test.cpp
# Restore the old config file name in the code that maintains support for now.
${SED_COMMAND} -i 's/configLegacyName = "xrpld.cfg"/configLegacyName = "rippled.cfg"/g' src/xrpld/core/detail/Config.cpp
# Restore an URL.
${SED_COMMAND} -i 's/connect-your-xrpld-to-the-xrp-test-net.html/connect-your-rippled-to-the-xrp-test-net.html/g' cfg/xrpld-example.cfg
popd
echo "Renaming complete."

58
.github/scripts/rename/namespace.sh vendored Executable file
View File

@@ -0,0 +1,58 @@
#!/bin/bash
# Exit the script as soon as an error occurs.
set -e
# On MacOS, ensure that GNU sed is installed and available as `gsed`.
SED_COMMAND=sed
if [[ "${OSTYPE}" == 'darwin'* ]]; then
if ! command -v gsed &> /dev/null; then
echo "Error: gsed is not installed. Please install it using 'brew install gnu-sed'."
exit 1
fi
SED_COMMAND=gsed
fi
# This script renames the `ripple` namespace to `xrpl` in this project.
# Specifically, it renames all occurrences of `namespace ripple` and `ripple::`
# to `namespace xrpl` and `xrpl::`, respectively, by scanning all header and
# source files in the specified directory and its subdirectories, as well as any
# occurrences in the documentation. It also renames them in the test suites.
# Usage: .github/scripts/rename/namespace.sh <repository directory>
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <repository directory>"
exit 1
fi
DIRECTORY=$1
echo "Processing directory: ${DIRECTORY}"
if [ ! -d "${DIRECTORY}" ]; then
echo "Error: Directory '${DIRECTORY}' does not exist."
exit 1
fi
pushd ${DIRECTORY}
DIRECTORIES=("include" "src" "tests")
for DIRECTORY in "${DIRECTORIES[@]}"; do
echo "Processing directory: ${DIRECTORY}"
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.cpp" \) | while read -r FILE; do
echo "Processing file: ${FILE}"
${SED_COMMAND} -i 's/namespace ripple/namespace xrpl/g' "${FILE}"
${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}"
${SED_COMMAND} -i -E 's/(BEAST_DEFINE_TESTSUITE.+)ripple(.+)/\1xrpl\2/g' "${FILE}"
done
done
# Special case for NuDBFactory that has ripple twice in the test suite name.
${SED_COMMAND} -i -E 's/(BEAST_DEFINE_TESTSUITE.+)ripple(.+)/\1xrpl\2/g' src/test/nodestore/NuDBFactory_test.cpp
DIRECTORY=$1
find "${DIRECTORY}" -type f -name "*.md" | while read -r FILE; do
echo "Processing file: ${FILE}"
${SED_COMMAND} -i 's/ripple::/xrpl::/g' "${FILE}"
done
popd
echo "Renaming complete."

View File

@@ -229,26 +229,64 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
if (n := os["compiler_version"]) != "":
config_name += f"-{n}"
config_name += (
f"-{architecture['platform'][architecture['platform'].find('/') + 1 :]}"
f"-{architecture['platform'][architecture['platform'].find('/')+1:]}"
)
config_name += f"-{build_type.lower()}"
if "-Dcoverage=ON" in cmake_args:
config_name += "-coverage"
if "-Dunity=ON" in cmake_args:
config_name += "-unity"
# Add the configuration to the list, with the most unique fields first,
# so that they are easier to identify in the GitHub Actions UI, as long
# names get truncated.
configurations.append(
{
"config_name": config_name,
"cmake_args": cmake_args,
"cmake_target": cmake_target,
"build_only": build_only,
"build_type": build_type,
"os": os,
"architecture": architecture,
}
)
# Add Address and Thread (both coupled with UB) sanitizers for specific bookworm distros.
# GCC-Asan rippled-embedded tests are failing because of https://github.com/google/sanitizers/issues/856
if (
os["distro_version"] == "bookworm"
and f"{os['compiler_name']}-{os['compiler_version']}" == "clang-20"
):
# Add ASAN + UBSAN configuration.
configurations.append(
{
"config_name": config_name + "-asan-ubsan",
"cmake_args": cmake_args,
"cmake_target": cmake_target,
"build_only": build_only,
"build_type": build_type,
"os": os,
"architecture": architecture,
"sanitizers": "address,undefinedbehavior",
}
)
# TSAN is deactivated due to seg faults with latest compilers.
activateTSAN = False
if activateTSAN:
configurations.append(
{
"config_name": config_name + "-tsan-ubsan",
"cmake_args": cmake_args,
"cmake_target": cmake_target,
"build_only": build_only,
"build_type": build_type,
"os": os,
"architecture": architecture,
"sanitizers": "thread,undefinedbehavior",
}
)
else:
configurations.append(
{
"config_name": config_name,
"cmake_args": cmake_args,
"cmake_target": cmake_target,
"build_only": build_only,
"build_type": build_type,
"os": os,
"architecture": architecture,
"sanitizers": "",
}
)
return configurations

View File

@@ -15,196 +15,196 @@
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "12",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "13",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "15",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "16",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "17",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "18",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "19",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "20",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "trixie",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "trixie",
"compiler_name": "gcc",
"compiler_version": "15",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "trixie",
"compiler_name": "clang",
"compiler_version": "20",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "debian",
"distro_version": "trixie",
"compiler_name": "clang",
"compiler_version": "21",
"image_sha": "0525eae"
"image_sha": "cc09fd3"
},
{
"distro_name": "rhel",
"distro_version": "8",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "rhel",
"distro_version": "8",
"compiler_name": "clang",
"compiler_version": "any",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "gcc",
"compiler_version": "12",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "gcc",
"compiler_version": "13",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "clang",
"compiler_version": "any",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "rhel",
"distro_version": "10",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "rhel",
"distro_version": "10",
"compiler_name": "clang",
"compiler_version": "any",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "ubuntu",
"distro_version": "jammy",
"compiler_name": "gcc",
"compiler_version": "12",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "gcc",
"compiler_version": "13",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "16",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "17",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "18",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "19",
"image_sha": "e1782cd"
"image_sha": "cc09fd3"
}
],
"build_type": ["Debug", "Release"],

View File

@@ -114,6 +114,9 @@ jobs:
matrix:
os: [linux, macos, windows]
with:
# Enable ccache only for events targeting the XRPLF repository, since
# other accounts will not have access to our remote cache storage.
ccache_enabled: ${{ github.repository_owner == 'XRPLF' }}
os: ${{ matrix.os }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -68,6 +68,12 @@ jobs:
matrix:
os: [linux, macos, windows]
with:
# Enable ccache only for events targeting the XRPLF repository, since
# other accounts will not have access to our remote cache storage.
# However, we do not enable ccache for events targeting the master or a
# release branch, to protect against the rare case that the output
# produced by ccache is not identical to a regular compilation.
ccache_enabled: ${{ github.repository_owner == 'XRPLF' && !(github.base_ref == 'master' || startsWith(github.base_ref, 'release')) }}
os: ${{ matrix.os }}
strategy_matrix: ${{ github.event_name == 'schedule' && 'all' || 'minimal' }}
secrets:

View File

@@ -22,7 +22,7 @@ defaults:
shell: bash
env:
BUILD_DIR: .build
BUILD_DIR: build
NPROC_SUBTRACT: 2
jobs:
@@ -36,7 +36,7 @@ jobs:
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Get number of processors
uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
uses: XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6
id: nproc
with:
subtract: ${{ env.NPROC_SUBTRACT }}

View File

@@ -3,11 +3,6 @@ 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
@@ -15,8 +10,14 @@ on:
build_type:
description: 'The build type to use ("Debug", "Release").'
type: string
required: true
type: string
ccache_enabled:
description: "Whether to enable ccache."
required: false
type: boolean
default: false
cmake_args:
description: "Additional arguments to pass to CMake."
@@ -26,8 +27,8 @@ on:
cmake_target:
description: "The CMake target to build."
type: string
required: true
type: string
runs_on:
description: Runner to run the job on as a JSON string
@@ -50,6 +51,12 @@ on:
type: number
default: 2
sanitizers:
description: "The sanitizers to enable."
required: false
type: string
default: ""
secrets:
CODECOV_TOKEN:
description: "The Codecov token to use for uploading coverage reports."
@@ -59,6 +66,11 @@ defaults:
run:
shell: bash
env:
# Conan installs the generators in the build/generators directory, see the
# layout() method in conanfile.py. We then run CMake from the build directory.
BUILD_DIR: build
jobs:
build-and-test:
name: ${{ inputs.config_name }}
@@ -66,26 +78,48 @@ jobs:
container: ${{ inputs.image != '' && inputs.image || null }}
timeout-minutes: 60
env:
ENABLED_VOIDSTAR: ${{ contains(inputs.cmake_args, '-Dvoidstar=ON') }}
ENABLED_COVERAGE: ${{ contains(inputs.cmake_args, '-Dcoverage=ON') }}
# Use a namespace to keep the objects separate for each configuration.
CCACHE_NAMESPACE: ${{ inputs.config_name }}
# Ccache supports both Redis and HTTP endpoints.
# * For Redis, use the following format: redis://ip:port, see
# https://github.com/ccache/ccache/wiki/Redis-storage. Note that TLS is
# not directly supported by ccache, and requires use of a proxy.
# * For HTTP use the following format: http://ip:port/cache when using
# nginx as backend or http://ip:port|layout=bazel when using Bazel
# Remote Cache, see https://github.com/ccache/ccache/wiki/HTTP-storage.
# Note that HTTPS is not directly supported by ccache.
CCACHE_REMOTE_ONLY: true
CCACHE_REMOTE_STORAGE: http://cache.dev.ripplex.io:8080|layout=bazel
# Ignore the creation and modification timestamps on files, since the
# header files are copied into separate directories by CMake, which will
# otherwise result in cache misses.
CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime
# Determine if coverage and voidstar should be enabled.
COVERAGE_ENABLED: ${{ contains(inputs.cmake_args, '-Dcoverage=ON') }}
VOIDSTAR_ENABLED: ${{ contains(inputs.cmake_args, '-Dvoidstar=ON') }}
SANITIZERS_ENABLED: ${{ inputs.sanitizers != '' }}
steps:
- name: Cleanup workspace (macOS and Windows)
if: ${{ runner.os == 'macOS' || runner.os == 'Windows' }}
uses: XRPLF/actions/.github/actions/cleanup-workspace@01b244d2718865d427b499822fbd3f15e7197fcc
uses: XRPLF/actions/cleanup-workspace@2ece4ec6ab7de266859a6f053571425b2bd684b6
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Prepare runner
uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a
uses: XRPLF/actions/prepare-runner@2ece4ec6ab7de266859a6f053571425b2bd684b6
with:
disable_ccache: false
disable_ccache: ${{ !inputs.ccache_enabled }}
- name: Set ccache log file
if: ${{ inputs.ccache_enabled && runner.debug == '1' }}
run: echo "CCACHE_LOGFILE=${{ runner.temp }}/ccache.log" >> "${GITHUB_ENV}"
- name: Print build environment
uses: ./.github/actions/print-env
- name: Get number of processors
uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
uses: XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6
id: nproc
with:
subtract: ${{ inputs.nproc_subtract }}
@@ -96,17 +130,18 @@ jobs:
- 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' }}
sanitizers: ${{ inputs.sanitizers }}
- name: Configure CMake
working-directory: ${{ inputs.build_dir }}
working-directory: ${{ env.BUILD_DIR }}
env:
BUILD_TYPE: ${{ inputs.build_type }}
SANITIZERS: ${{ inputs.sanitizers }}
CMAKE_ARGS: ${{ inputs.cmake_args }}
run: |
cmake \
@@ -117,7 +152,7 @@ jobs:
..
- name: Build the binary
working-directory: ${{ inputs.build_dir }}
working-directory: ${{ env.BUILD_DIR }}
env:
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
BUILD_TYPE: ${{ inputs.build_type }}
@@ -129,11 +164,18 @@ jobs:
--parallel "${BUILD_NPROC}" \
--target "${CMAKE_TARGET}"
- name: Show ccache statistics
if: ${{ inputs.ccache_enabled }}
run: |
ccache --show-stats -vv
if [ '${{ runner.debug }}' = '1' ]; then
cat "${CCACHE_LOGFILE}"
curl ${CCACHE_REMOTE_STORAGE%|*}/status || true
fi
- name: Upload the binary (Linux)
if: ${{ github.repository_owner == 'XRPLF' && runner.os == 'Linux' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
env:
BUILD_DIR: ${{ inputs.build_dir }}
with:
name: xrpld-${{ inputs.config_name }}
path: ${{ env.BUILD_DIR }}/xrpld
@@ -141,8 +183,8 @@ jobs:
if-no-files-found: error
- name: Check linking (Linux)
if: ${{ runner.os == 'Linux' }}
working-directory: ${{ inputs.build_dir }}
if: ${{ runner.os == 'Linux' && env.SANITIZERS_ENABLED == 'false' }}
working-directory: ${{ env.BUILD_DIR }}
run: |
ldd ./xrpld
if [ "$(ldd ./xrpld | grep -E '(libstdc\+\+|libgcc)' | wc -l)" -eq 0 ]; then
@@ -153,14 +195,22 @@ jobs:
fi
- name: Verify presence of instrumentation (Linux)
if: ${{ runner.os == 'Linux' && env.ENABLED_VOIDSTAR == 'true' }}
working-directory: ${{ inputs.build_dir }}
if: ${{ runner.os == 'Linux' && env.VOIDSTAR_ENABLED == 'true' }}
working-directory: ${{ env.BUILD_DIR }}
run: |
./xrpld --version | grep libvoidstar
- name: Set sanitizer options
if: ${{ !inputs.build_only && env.SANITIZERS_ENABLED == 'true' }}
run: |
echo "ASAN_OPTIONS=detect_container_overflow=0:suppressions=${GITHUB_WORKSPACE}/sanitizers/suppressions/asan.supp" >> ${GITHUB_ENV}
echo "TSAN_OPTIONS=second_deadlock_stack=1:halt_on_error=0:suppressions=${GITHUB_WORKSPACE}/sanitizers/suppressions/tsan.supp" >> ${GITHUB_ENV}
echo "UBSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/sanitizers/suppressions/ubsan.supp" >> ${GITHUB_ENV}
echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/sanitizers/suppressions/lsan.supp" >> ${GITHUB_ENV}
- name: Run the separate tests
if: ${{ !inputs.build_only }}
working-directory: ${{ inputs.build_dir }}
working-directory: ${{ env.BUILD_DIR }}
# Windows locks some of the build files while running tests, and parallel jobs can collide
env:
BUILD_TYPE: ${{ inputs.build_type }}
@@ -173,9 +223,10 @@ jobs:
- name: Run the embedded tests
if: ${{ !inputs.build_only }}
working-directory: ${{ runner.os == 'Windows' && format('{0}/{1}', inputs.build_dir, inputs.build_type) || inputs.build_dir }}
working-directory: ${{ runner.os == 'Windows' && format('{0}/{1}', env.BUILD_DIR, inputs.build_type) || env.BUILD_DIR }}
env:
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
PREFIX: ${{ (runner.arch == 'X64' && env.ENABLED_SANITIZERS == 'true') && 'setarch x86_64 -R' || '' }}
run: |
./xrpld --unittest --unittest-jobs "${BUILD_NPROC}"
@@ -188,8 +239,8 @@ jobs:
netstat -an
- name: Prepare coverage report
if: ${{ !inputs.build_only && env.ENABLED_COVERAGE == 'true' }}
working-directory: ${{ inputs.build_dir }}
if: ${{ !inputs.build_only && env.COVERAGE_ENABLED == 'true' }}
working-directory: ${{ env.BUILD_DIR }}
env:
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
BUILD_TYPE: ${{ inputs.build_type }}
@@ -201,13 +252,13 @@ jobs:
--target coverage
- name: Upload coverage report
if: ${{ github.repository_owner == 'XRPLF' && !inputs.build_only && env.ENABLED_COVERAGE == 'true' }}
if: ${{ github.repository_owner == 'XRPLF' && !inputs.build_only && env.COVERAGE_ENABLED == 'true' }}
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
files: ${{ env.BUILD_DIR }}/coverage.xml
plugins: noop
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

View File

@@ -8,21 +8,24 @@ name: Build and test
on:
workflow_call:
inputs:
build_dir:
description: "The directory where to build."
ccache_enabled:
description: "Whether to enable ccache."
required: false
type: string
default: ".build"
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."
@@ -46,13 +49,14 @@ jobs:
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 }}
ccache_enabled: ${{ inputs.ccache_enabled }}
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 }}
sanitizers: ${{ matrix.sanitizers }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -27,6 +27,10 @@ jobs:
run: .github/scripts/rename/cmake.sh .
- name: Check binary name
run: .github/scripts/rename/binary.sh .
- name: Check namespaces
run: .github/scripts/rename/namespace.sh .
- name: Check config name
run: .github/scripts/rename/config.sh .
- name: Check for differences
env:
MESSAGE: |

View File

@@ -64,21 +64,21 @@ jobs:
steps:
- name: Cleanup workspace (macOS and Windows)
if: ${{ runner.os == 'macOS' || runner.os == 'Windows' }}
uses: XRPLF/actions/.github/actions/cleanup-workspace@01b244d2718865d427b499822fbd3f15e7197fcc
uses: XRPLF/actions/cleanup-workspace@2ece4ec6ab7de266859a6f053571425b2bd684b6
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Prepare runner
uses: XRPLF/actions/.github/actions/prepare-runner@99685816bb60a95a66852f212f382580e180df3a
uses: XRPLF/actions/prepare-runner@2ece4ec6ab7de266859a6f053571425b2bd684b6
with:
disable_ccache: false
disable_ccache: true
- name: Print build environment
uses: ./.github/actions/print-env
- name: Get number of processors
uses: XRPLF/actions/.github/actions/get-nproc@046b1620f6bfd6cd0985dc82c3df02786801fe0a
uses: XRPLF/actions/get-nproc@2ece4ec6ab7de266859a6f053571425b2bd684b6
id: nproc
with:
subtract: ${{ env.NPROC_SUBTRACT }}
@@ -92,7 +92,6 @@ jobs:
- name: Build dependencies
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' }}

1
.gitignore vendored
View File

@@ -35,6 +35,7 @@ gmon.out
# Customized configs.
/rippled.cfg
/xrpld.cfg
/validators.txt
# Locally patched Conan recipes

View File

@@ -1,5 +1,5 @@
| :warning: **WARNING** :warning:
|---|
| :warning: **WARNING** :warning: |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| These instructions assume you have a C++ development environment ready with Git, Python, Conan, CMake, and a C++ compiler. For help setting one up on Linux, macOS, or Windows, [see this guide](./docs/build/environment.md). |
> These instructions also assume a basic familiarity with Conan and CMake.
@@ -518,18 +518,32 @@ stored inside the build directory, as either of:
- file named `coverage.`_extension_, with a suitable extension for the report format, or
- directory named `coverage`, with the `index.html` and other files inside, for the `html-details` or `html-nested` report formats.
## Sanitizers
To build dependencies and xprld with sanitizer instrumentation, set the
`SANITIZERS` environment variable(only once before running conan and cmake) and use the `sanitizers` profile in conan:
```bash
export SANITIZERS=address,undefinedbehavior
conan install .. --output-folder . --profile:all sanitizers --build missing --settings build_type=Debug
cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -Dxrpld=ON -Dtests=ON ..
```
See [Sanitizers docs](./docs/build/sanitizers.md) for more details.
## Options
| Option | Default Value | Description |
| ---------- | ------------- | ------------------------------------------------------------------ |
| `assert` | OFF | Enable assertions. |
| `coverage` | OFF | Prepare the coverage report. |
| `san` | N/A | Enable a sanitizer with Clang. Choices are `thread` and `address`. |
| `tests` | OFF | Build tests. |
| `unity` | OFF | Configure a unity build. |
| `xrpld` | OFF | Build the xrpld application, and not just the libxrpl library. |
| `werr` | OFF | Treat compilation warnings as errors |
| `wextra` | OFF | Enable additional compilation warnings |
| Option | Default Value | Description |
| ---------- | ------------- | -------------------------------------------------------------- |
| `assert` | OFF | Enable assertions. |
| `coverage` | OFF | Prepare the coverage report. |
| `tests` | OFF | Build tests. |
| `unity` | OFF | Configure a unity build. |
| `xrpld` | OFF | Build the xrpld application, and not just the libxrpl library. |
| `werr` | OFF | Treat compilation warnings as errors |
| `wextra` | OFF | Enable additional compilation warnings |
[Unity builds][5] may be faster for the first build
(at the cost of much more memory) since they concatenate sources into fewer

View File

@@ -16,18 +16,23 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
include(CompilationEnv)
if(is_gcc)
# GCC-specific fixes
add_compile_options(-Wno-unknown-pragmas -Wno-subobject-linkage)
# -Wno-subobject-linkage can be removed when we upgrade GCC version to at least 13.3
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
elseif(is_clang)
# Clang-specific fixes
add_compile_options(-Wno-unknown-warning-option) # Ignore unknown warning options
elseif(MSVC)
elseif(is_msvc)
# MSVC-specific fixes
add_compile_options(/wd4068) # Ignore unknown pragmas
endif()
# Enable ccache to speed up builds.
include(Ccache)
# make GIT_COMMIT_HASH define available to all sources
find_package(Git)
if(Git_FOUND)
@@ -74,6 +79,7 @@ if (packages_only)
return ()
endif ()
include(XrplCompiler)
include(XrplSanitizers)
include(XrplInterface)
option(only_docs "Include only the docs target?" FALSE)

View File

@@ -304,7 +304,7 @@ For this reason:
- Example **bad** name
`"RFC1751::insert(char* s, int x, int start, int length) : length is greater than or equal zero"`
(missing namespace, unnecessary full function signature, description too verbose).
Good name: `"ripple::RFC1751::insert : minimum length"`.
Good name: `"xrpl::RFC1751::insert : minimum length"`.
- In **few** well-justified cases a non-standard name can be used, in which case a
comment should be placed to explain the rationale (example in `contract.cpp`)
- Do **not** rename a contract without a good reason (e.g. the name no longer

View File

@@ -1,7 +1,7 @@
#
# Default validators.txt
#
# This file is located in the same folder as your rippled.cfg file
# This file is located in the same folder as your xrpld.cfg file
# and defines which validators your server trusts not to collude.
#
# This file is UTF-8 with DOS, UNIX, or Mac style line endings.

View File

@@ -29,18 +29,18 @@
#
# Purpose
#
# This file documents and provides examples of all rippled server process
# configuration options. When the rippled server instance is launched, it
# This file documents and provides examples of all xrpld server process
# configuration options. When the xrpld server instance is launched, it
# looks for a file with the following name:
#
# rippled.cfg
# xrpld.cfg
#
# For more information on where the rippled server instance searches for the
# For more information on where the xrpld server instance searches for the
# file, visit:
#
# https://xrpl.org/commandline-usage.html#generic-options
#
# This file should be named rippled.cfg. This file is UTF-8 with DOS, UNIX,
# This file should be named xrpld.cfg. This file is UTF-8 with DOS, UNIX,
# or Mac style end of lines. Blank lines and lines beginning with '#' are
# ignored. Undefined sections are reserved. No escapes are currently defined.
#
@@ -89,8 +89,8 @@
#
#
#
# rippled offers various server protocols to clients making inbound
# connections. The listening ports rippled uses are "universal" ports
# xrpld offers various server protocols to clients making inbound
# connections. The listening ports xrpld uses are "universal" ports
# which may be configured to handshake in one or more of the available
# supported protocols. These universal ports simplify administration:
# A single open port can be used for multiple protocols.
@@ -103,7 +103,7 @@
#
# A list of port names and key/value pairs. A port name must start with a
# letter and contain only letters and numbers. The name is not case-sensitive.
# For each name in this list, rippled will look for a configuration file
# For each name in this list, xrpld will look for a configuration file
# section with the same name and use it to create a listening port. The
# name is informational only; the choice of name does not affect the function
# of the listening port.
@@ -134,7 +134,7 @@
# ip = 127.0.0.1
# protocol = http
#
# When rippled is used as a command line client (for example, issuing a
# When xrpld is used as a command line client (for example, issuing a
# server stop command), the first port advertising the http or https
# protocol will be used to make the connection.
#
@@ -175,7 +175,7 @@
# same time. It is possible have both Websockets and Secure Websockets
# together in one port.
#
# NOTE If no ports support the peer protocol, rippled cannot
# NOTE If no ports support the peer protocol, xrpld cannot
# receive incoming peer connections or become a superpeer.
#
# limit = <number>
@@ -194,7 +194,7 @@
# required. IP address restrictions, if any, will be checked in addition
# to the credentials specified here.
#
# When acting in the client role, rippled will supply these credentials
# When acting in the client role, xrpld will supply these credentials
# using HTTP's Basic Authentication headers when making outbound HTTP/S
# requests.
#
@@ -237,7 +237,7 @@
# WS, or WSS protocol interfaces. If administrative commands are
# disabled for a port, these credentials have no effect.
#
# When acting in the client role, rippled will supply these credentials
# When acting in the client role, xrpld will supply these credentials
# in the submitted JSON for any administrative command requests when
# invoking JSON-RPC commands on remote servers.
#
@@ -258,7 +258,7 @@
# resource controls will default to those for non-administrative users.
#
# The secure_gateway IP addresses are intended to represent
# proxies. Since rippled trusts these hosts, they must be
# proxies. Since xrpld trusts these hosts, they must be
# responsible for properly authenticating the remote user.
#
# If some IP addresses are included for both "admin" and
@@ -272,7 +272,7 @@
# Use the specified files when configuring SSL on the port.
#
# NOTE If no files are specified and secure protocols are selected,
# rippled will generate an internal self-signed certificate.
# xrpld will generate an internal self-signed certificate.
#
# The files have these meanings:
#
@@ -297,12 +297,12 @@
# Control the ciphers which the server will support over SSL on the port,
# specified using the OpenSSL "cipher list format".
#
# NOTE If unspecified, rippled will automatically configure a modern
# NOTE If unspecified, xrpld will automatically configure a modern
# cipher suite. This default suite should be widely supported.
#
# You should not modify this string unless you have a specific
# reason and cryptographic expertise. Incorrect modification may
# keep rippled from connecting to other instances of rippled or
# keep xrpld from connecting to other instances of xrpld or
# prevent RPC and WebSocket clients from connecting.
#
# send_queue_limit = [1..65535]
@@ -382,7 +382,7 @@
#-----------------
#
# These settings control security and access attributes of the Peer to Peer
# server section of the rippled process. Peer Protocol implements the
# server section of the xrpld process. Peer Protocol implements the
# Ripple Payment protocol. It is over peer connections that transactions
# and validations are passed from to machine to machine, to determine the
# contents of validated ledgers.
@@ -396,7 +396,7 @@
# true - enables compression
# false - disables compression [default].
#
# The rippled server can save bandwidth by compressing its peer-to-peer communications,
# The xrpld server can save bandwidth by compressing its peer-to-peer communications,
# at a cost of greater CPU usage. If you enable link compression,
# the server automatically compresses communications with peer servers
# that also have link compression enabled.
@@ -432,7 +432,7 @@
#
# [ips_fixed]
#
# List of IP addresses or hostnames to which rippled should always attempt to
# List of IP addresses or hostnames to which xrpld should always attempt to
# maintain peer connections with. This is useful for manually forming private
# networks, for example to configure a validation server that connects to the
# Ripple network through a public-facing server, or for building a set
@@ -573,7 +573,7 @@
#
# minimum_txn_in_ledger_standalone = <number>
#
# Like minimum_txn_in_ledger when rippled is running in standalone
# Like minimum_txn_in_ledger when xrpld is running in standalone
# mode. Default: 1000.
#
# target_txn_in_ledger = <number>
@@ -710,7 +710,7 @@
#
# [validator_token]
#
# This is an alternative to [validation_seed] that allows rippled to perform
# This is an alternative to [validation_seed] that allows xrpld to perform
# validation without having to store the validator keys on the network
# connected server. The field should contain a single token in the form of a
# base64-encoded blob.
@@ -745,7 +745,7 @@
#
# Specify the file by its name or path.
# Unless an absolute path is specified, it will be considered relative to
# the folder in which the rippled.cfg file is located.
# the folder in which the xrpld.cfg file is located.
#
# Examples:
# /home/ripple/validators.txt
@@ -840,7 +840,7 @@
#
# 0: Disable the ledger replay feature [default]
# 1: Enable the ledger replay feature. With this feature enabled, when
# acquiring a ledger from the network, a rippled node only downloads
# acquiring a ledger from the network, a xrpld node only downloads
# the ledger header and the transactions instead of the whole ledger.
# And the ledger is built by applying the transactions to the parent
# ledger.
@@ -851,7 +851,7 @@
#
#----------------
#
# The rippled server instance uses HTTPS GET requests in a variety of
# The xrpld server instance uses HTTPS GET requests in a variety of
# circumstances, including but not limited to contacting trusted domains to
# fetch information such as mapping an email address to a Ripple Payment
# Network address.
@@ -891,7 +891,7 @@
#
#------------
#
# rippled creates 4 SQLite database to hold bookkeeping information
# xrpld creates 4 SQLite database to hold bookkeeping information
# about transactions, local credentials, and various other things.
# It also creates the NodeDB, which holds all the objects that
# make up the current and historical ledgers.
@@ -902,7 +902,7 @@
# the performance of the server.
#
# Partial pathnames will be considered relative to the location of
# the rippled.cfg file.
# the xrpld.cfg file.
#
# [node_db] Settings for the Node Database (required)
#
@@ -920,11 +920,11 @@
# type = NuDB
#
# NuDB is a high-performance database written by Ripple Labs and optimized
# for rippled and solid-state drives.
# for xrpld and solid-state drives.
#
# NuDB maintains its high speed regardless of the amount of history
# stored. Online delete may be selected, but is not required. NuDB is
# available on all platforms that rippled runs on.
# available on all platforms that xrpld runs on.
#
# type = RocksDB
#
@@ -1049,7 +1049,7 @@
#
# recovery_wait_seconds
# The online delete process checks periodically
# that rippled is still in sync with the network,
# that xrpld is still in sync with the network,
# and that the validated ledger is less than
# 'age_threshold_seconds' old. If not, then continue
# sleeping for this number of seconds and
@@ -1069,8 +1069,8 @@
# The server creates and maintains 4 to 5 bookkeeping SQLite databases in
# the 'database_path' location. If you omit this configuration setting,
# the server creates a directory called "db" located in the same place as
# your rippled.cfg file.
# Partial pathnames are relative to the location of the rippled executable.
# your xrpld.cfg file.
# Partial pathnames are relative to the location of the xrpld executable.
#
# [sqlite] Tuning settings for the SQLite databases (optional)
#
@@ -1120,7 +1120,7 @@
# The default is "wal", which uses a write-ahead
# log to implement database transactions.
# Alternately, "memory" saves disk I/O, but if
# rippled crashes during a transaction, the
# xrpld crashes during a transaction, the
# database is likely to be corrupted.
# See https://www.sqlite.org/pragma.html#pragma_journal_mode
# for more details about the available options.
@@ -1130,7 +1130,7 @@
# synchronous Valid values: off, normal, full, extra
# The default is "normal", which works well with
# the "wal" journal mode. Alternatively, "off"
# allows rippled to continue as soon as data is
# allows xrpld to continue as soon as data is
# passed to the OS, which can significantly
# increase speed, but risks data corruption if
# the host computer crashes before writing that
@@ -1144,7 +1144,7 @@
# The default is "file", which will use files
# for temporary database tables and indices.
# Alternatively, "memory" may save I/O, but
# rippled does not currently use many, if any,
# xrpld does not currently use many, if any,
# of these temporary objects.
# See https://www.sqlite.org/pragma.html#pragma_temp_store
# for more details about the available options.
@@ -1173,7 +1173,7 @@
#
# These settings are designed to help server administrators diagnose
# problems, and obtain detailed information about the activities being
# performed by the rippled process.
# performed by the xrpld process.
#
#
#
@@ -1190,7 +1190,7 @@
#
# Configuration parameters for the Beast. Insight stats collection module.
#
# Insight is a module that collects information from the areas of rippled
# Insight is a module that collects information from the areas of xrpld
# that have instrumentation. The configuration parameters control where the
# collection metrics are sent. The parameters are expressed as key = value
# pairs with no white space. The main parameter is the choice of server:
@@ -1199,7 +1199,7 @@
#
# Choice of server to send metrics to. Currently the only choice is
# "statsd" which sends UDP packets to a StatsD daemon, which must be
# running while rippled is running. More information on StatsD is
# running while xrpld is running. More information on StatsD is
# available here:
# https://github.com/b/statsd_spec
#
@@ -1209,7 +1209,7 @@
# in the format, n.n.n.n:port.
#
# "prefix" A string prepended to each collected metric. This is used
# to distinguish between different running instances of rippled.
# to distinguish between different running instances of xrpld.
#
# If this section is missing, or the server type is unspecified or unknown,
# statistics are not collected or reported.
@@ -1236,7 +1236,7 @@
#
# Example:
# [perf]
# perf_log=/var/log/rippled/perf.log
# perf_log=/var/log/xrpld/perf.log
# log_interval=2
#
#-------------------------------------------------------------------------------
@@ -1246,7 +1246,7 @@
#----------
#
# The vote settings configure settings for the entire Ripple network.
# While a single instance of rippled cannot unilaterally enforce network-wide
# While a single instance of xrpld cannot unilaterally enforce network-wide
# settings, these choices become part of the instance's vote during the
# consensus process for each voting ledger.
#
@@ -1260,7 +1260,7 @@
# The reference transaction is the simplest form of transaction.
# It represents an XRP payment between two parties.
#
# If this parameter is unspecified, rippled will use an internal
# If this parameter is unspecified, xrpld will use an internal
# default. Don't change this without understanding the consequences.
#
# Example:
@@ -1272,7 +1272,7 @@
# account's XRP balance that is at or below the reserve may only be
# spent on transaction fees, and not transferred out of the account.
#
# If this parameter is unspecified, rippled will use an internal
# If this parameter is unspecified, xrpld will use an internal
# default. Don't change this without understanding the consequences.
#
# Example:
@@ -1284,7 +1284,7 @@
# each ledger item owned by the account. Ledger items an account may
# own include trust lines, open orders, and tickets.
#
# If this parameter is unspecified, rippled will use an internal
# If this parameter is unspecified, xrpld will use an internal
# default. Don't change this without understanding the consequences.
#
# Example:
@@ -1326,7 +1326,7 @@
# tool instead.
#
# This flag has no effect on the "sign" and "sign_for" command line options
# that rippled makes available.
# that xrpld makes available.
#
# The default value of this field is "false"
#
@@ -1405,7 +1405,7 @@
#--------------------
#
# Administrators can use these values as a starting point for configuring
# their instance of rippled, but each value should be checked to make sure
# their instance of xrpld, but each value should be checked to make sure
# it meets the business requirements for the organization.
#
# Server
@@ -1415,7 +1415,7 @@
# "peer"
#
# Peer protocol open to everyone. This is required to accept
# incoming rippled connections. This does not affect automatic
# incoming xrpld connections. This does not affect automatic
# or manual outgoing Peer protocol connections.
#
# "rpc"
@@ -1432,7 +1432,7 @@
#
# ETL commands for Clio. We recommend setting secure_gateway
# in this section to a comma-separated list of the addresses
# of your Clio servers, in order to bypass rippled's rate limiting.
# of your Clio servers, in order to bypass xrpld's rate limiting.
#
# This port is commented out but can be enabled by removing
# the '#' from each corresponding line including the entry under [server]
@@ -1449,8 +1449,8 @@
# NOTE
#
# To accept connections on well known ports such as 80 (HTTP) or
# 443 (HTTPS), most operating systems will require rippled to
# run with administrator privileges, or else rippled will not start.
# 443 (HTTPS), most operating systems will require xrpld to
# run with administrator privileges, or else xrpld will not start.
[server]
port_rpc_admin_local
@@ -1496,7 +1496,7 @@ secure_gateway = 127.0.0.1
#-------------------------------------------------------------------------------
# This is primary persistent datastore for rippled. This includes transaction
# This is primary persistent datastore for xrpld. This includes transaction
# metadata, account states, and ledger headers. Helpful information can be
# found at https://xrpl.org/capacity-planning.html#node-db-type
# type=NuDB is recommended for non-validators with fast SSDs. Validators or
@@ -1511,19 +1511,19 @@ secure_gateway = 127.0.0.1
# deletion.
[node_db]
type=NuDB
path=/var/lib/rippled/db/nudb
path=/var/lib/xrpld/db/nudb
nudb_block_size=4096
online_delete=512
advisory_delete=0
[database_path]
/var/lib/rippled/db
/var/lib/xrpld/db
# This needs to be an absolute directory reference, not a relative one.
# Modify this value as required.
[debug_logfile]
/var/log/rippled/debug.log
/var/log/xrpld/debug.log
# To use the XRP test network
# (see https://xrpl.org/connect-your-rippled-to-the-xrp-test-net.html),
@@ -1533,7 +1533,7 @@ advisory_delete=0
# File containing trusted validator keys or validator list publishers.
# Unless an absolute path is specified, it will be considered relative to the
# folder in which the rippled.cfg file is located.
# folder in which the xrpld.cfg file is located.
[validators_file]
validators.txt

51
cmake/Ccache.cmake Normal file
View File

@@ -0,0 +1,51 @@
find_program(CCACHE_PATH "ccache")
if (NOT CCACHE_PATH)
return()
endif ()
# For Linux and macOS we can use the ccache binary directly.
if (NOT MSVC)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PATH}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PATH}")
message(STATUS "Found ccache: ${CCACHE_PATH}")
return()
endif ()
# For Windows more effort is required. The code below is a modified version of
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio#usage-with-cmake.
if ("${CCACHE_PATH}" MATCHES "chocolatey")
message(DEBUG "Ccache path: ${CCACHE_PATH}")
# Chocolatey uses a shim executable that we cannot use directly, in which
# case we have to find the executable it points to. If we cannot find the
# target executable then we cannot use ccache.
find_program(BASH_PATH "bash")
if (NOT BASH_PATH)
message(WARNING "Could not find bash.")
return()
endif ()
execute_process(
COMMAND bash -c "export LC_ALL='en_US.UTF-8'; ${CCACHE_PATH} --shimgen-noop | grep -oP 'path to executable: \\K.+' | head -c -1"
OUTPUT_VARIABLE CCACHE_PATH)
if (NOT CCACHE_PATH)
message(WARNING "Could not find ccache target.")
return()
endif ()
file(TO_CMAKE_PATH "${CCACHE_PATH}" CCACHE_PATH)
endif ()
message(STATUS "Found ccache: ${CCACHE_PATH}")
# Tell cmake to use ccache for compiling with Visual Studio.
file(COPY_FILE
${CCACHE_PATH} ${CMAKE_BINARY_DIR}/cl.exe
ONLY_IF_DIFFERENT)
set(CMAKE_VS_GLOBALS
"CLToolExe=cl.exe"
"CLToolPath=${CMAKE_BINARY_DIR}"
"TrackFileAccess=false"
"UseMultiToolTask=true")
# By default Visual Studio generators will use /Zi, which is not compatible with
# ccache, so tell it to use /Z7 instead.
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")

View File

@@ -0,0 +1,75 @@
# Shared detection of compiler, operating system, and architecture.
#
# This module centralizes environment detection so that other
# CMake modules can use the same variables instead of repeating
# checks on CMAKE_* and built-in platform variables.
# Only run once per configure step.
include_guard(GLOBAL)
# --------------------------------------------------------------------
# Compiler detection (C++)
# --------------------------------------------------------------------
set(is_clang FALSE)
set(is_gcc FALSE)
set(is_msvc FALSE)
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") # Clang or AppleClang
set(is_clang TRUE)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(is_gcc TRUE)
elseif(MSVC)
set(is_msvc TRUE)
else()
message(FATAL_ERROR "Unsupported C++ compiler: ${CMAKE_CXX_COMPILER_ID}")
endif()
# Backwards-compat aliases used in some modules
set(IS_CLANG ${is_clang})
set(IS_GCC ${is_gcc})
# --------------------------------------------------------------------
# Operating system detection
# --------------------------------------------------------------------
set(is_linux FALSE)
set(is_windows FALSE)
set(is_macos FALSE)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(is_linux TRUE)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(is_windows TRUE)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(is_macos TRUE)
endif()
# --------------------------------------------------------------------
# Architecture / pointer size
# --------------------------------------------------------------------
set(is_64bit FALSE)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(is_64bit TRUE)
else()
message(FATAL_ERROR "This project should only be built on 64bit architectures.")
endif()
set(pointer_size "${CMAKE_SIZEOF_VOID_P}")
set(is_amd64 FALSE)
set(is_arm64 FALSE)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
set(is_amd64 TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64")
set(is_arm64 TRUE)
else()
message(FATAL_ERROR "Unknown architecture: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
# Keep legacy uppercase alias for existing code
set(IS_AMD64 ${is_amd64})
# Sanitizer configuration read from environment. We then set appropriate flags in XrplSanitizers.cmake
if($ENV{SANITIZERS} AND $ENV{SANITIZERS} MATCHES "address|thread|undefinedbehavior")
set(SANITIZERS_ENABLED TRUE)
else()
set(SANITIZERS_ENABLED FALSE)
endif()

View File

@@ -2,6 +2,8 @@
setup project-wide compiler settings
#]===================================================================]
include(CompilationEnv)
#[=========================================================[
TODO some/most of these common settings belong in a
toolchain file, especially the ABI-impacting ones
@@ -10,8 +12,12 @@ add_library (common INTERFACE)
add_library (Xrpl::common ALIAS common)
# add a single global dependency on this interface lib
link_libraries (Xrpl::common)
# Respect CMAKE_POSITION_INDEPENDENT_CODE setting (may be set by Conan toolchain)
if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
set_target_properties (common
PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
set(CMAKE_CXX_EXTENSIONS OFF)
target_compile_definitions (common
INTERFACE
@@ -115,8 +121,8 @@ else ()
# link to static libc/c++ iff:
# * static option set and
# * NOT APPLE (AppleClang does not support static libc/c++) and
# * NOT san (sanitizers typically don't work with static libc/c++)
$<$<AND:$<BOOL:${static}>,$<NOT:$<BOOL:${APPLE}>>,$<NOT:$<BOOL:${san}>>>:
# * NOT SANITIZERS (sanitizers typically don't work with static libc/c++)
$<$<AND:$<BOOL:${static}>,$<NOT:$<BOOL:${APPLE}>>,$<NOT:$<BOOL:${SANITIZERS_ENABLED}>>>:
-static-libstdc++
-static-libgcc
>)

View File

@@ -62,7 +62,7 @@ if (is_root_project AND TARGET xrpld)
message (\"-- Skipping : \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DEST}/\${NEWNAME}\")
endif ()
endmacro()
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/rippled-example.cfg\" etc rippled.cfg)
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/xrpld-example.cfg\" etc xrpld.cfg)
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/validators-example.txt\" etc validators.txt)
")
install(CODE "

View File

@@ -2,6 +2,8 @@
xrpld compile options/settings via an interface library
#]===================================================================]
include(CompilationEnv)
add_library (opts INTERFACE)
add_library (Xrpl::opts ALIAS opts)
target_compile_definitions (opts
@@ -42,22 +44,6 @@ if(jemalloc)
target_link_libraries(opts INTERFACE jemalloc::jemalloc)
endif ()
if (san)
target_compile_options (opts
INTERFACE
# sanitizers recommend minimum of -O1 for reasonable performance
$<$<CONFIG:Debug>:-O1>
${SAN_FLAG}
-fno-omit-frame-pointer)
target_compile_definitions (opts
INTERFACE
$<$<STREQUAL:${san},address>:SANITIZER=ASAN>
$<$<STREQUAL:${san},thread>:SANITIZER=TSAN>
$<$<STREQUAL:${san},memory>:SANITIZER=MSAN>
$<$<STREQUAL:${san},undefined>:SANITIZER=UBSAN>)
target_link_libraries (opts INTERFACE ${SAN_FLAG} ${SAN_LIB})
endif ()
#[===================================================================[
xrpld transitive library deps via an interface library
#]===================================================================]

156
cmake/XrplSanitizers.cmake Normal file
View File

@@ -0,0 +1,156 @@
#[===================================================================[
Configure sanitizers based on environment variables.
This module reads the following environment variables:
- SANITIZERS: The sanitizers to enable. Possible values:
- "address"
- "address,undefinedbehavior"
- "thread"
- "thread,undefinedbehavior"
- "undefinedbehavior"
The compiler type and platform are detected in CompilationEnv.cmake.
The sanitizer compile options are applied to the 'common' interface library
which is linked to all targets in the project.
#]===================================================================]
include(CompilationEnv)
# Read environment variable
set(SANITIZERS $ENV{SANITIZERS})
if(NOT SANITIZERS)
return()
endif()
message(STATUS "Configuring sanitizers: ${SANITIZERS}")
# Parse SANITIZERS value to determine which sanitizers to enable
set(enable_asan FALSE)
set(enable_tsan FALSE)
set(enable_ubsan FALSE)
# Normalize SANITIZERS into a list
set(san_list "${SANITIZERS}")
string(REPLACE "," ";" san_list "${san_list}")
separate_arguments(san_list)
foreach(san IN LISTS san_list)
if(san STREQUAL "address")
set(enable_asan TRUE)
elseif(san STREQUAL "thread")
set(enable_tsan TRUE)
elseif(san STREQUAL "undefinedbehavior")
set(enable_ubsan TRUE)
else()
message(FATAL_ERROR "Unsupported sanitizer type: ${san}"
"Supported: address, thread, undefinedbehavior and their combinations.")
endif()
endforeach()
# Frame pointer is required for meaningful stack traces. Sanitizers recommend minimum of -O1 for reasonable performance
set(SANITIZERS_COMPILE_FLAGS "-fno-omit-frame-pointer" "-O1")
# Build the sanitizer flags list
set(SANITIZERS_FLAGS)
if(enable_asan)
list(APPEND SANITIZERS_FLAGS "address")
elseif(enable_tsan)
list(APPEND SANITIZERS_FLAGS "thread")
endif()
if(enable_ubsan)
# UB sanitizer flags
if(is_clang)
# Clang supports additional UB checks. More info here https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
list(APPEND SANITIZERS_FLAGS "undefined" "float-divide-by-zero" "unsigned-integer-overflow")
else()
list(APPEND SANITIZERS_FLAGS "undefined" "float-divide-by-zero")
endif()
endif()
# Configure code model for GCC on amd64
# Use large code model for ASAN to avoid relocation errors
# Use medium code model for TSAN (large is not compatible with TSAN)
set(SANITIZERS_RELOCATION_FLAGS)
# Compiler-specific configuration
if(is_gcc)
# Disable mold, gold and lld linkers for GCC with sanitizers
# Use default linker (bfd/ld) which is more lenient with mixed code models
set(use_mold OFF CACHE BOOL "Use mold linker" FORCE)
set(use_gold OFF CACHE BOOL "Use gold linker" FORCE)
set(use_lld OFF CACHE BOOL "Use lld linker" FORCE)
message(STATUS " Disabled mold, gold, and lld linkers for GCC with sanitizers")
# Suppress false positive warnings in GCC with stringop-overflow
list(APPEND SANITIZERS_COMPILE_FLAGS "-Wno-stringop-overflow")
if(is_amd64 AND enable_asan)
message(STATUS " Using large code model (-mcmodel=large)")
list(APPEND SANITIZERS_COMPILE_FLAGS "-mcmodel=large")
list(APPEND SANITIZERS_RELOCATION_FLAGS "-mcmodel=large")
elseif(enable_tsan)
# GCC doesn't support atomic_thread_fence with tsan. Suppress warnings.
list(APPEND SANITIZERS_COMPILE_FLAGS "-Wno-tsan")
message(STATUS " Using medium code model (-mcmodel=medium)")
list(APPEND SANITIZERS_COMPILE_FLAGS "-mcmodel=medium")
list(APPEND SANITIZERS_RELOCATION_FLAGS "-mcmodel=medium")
endif()
# Join sanitizer flags with commas for -fsanitize option
list(JOIN SANITIZERS_FLAGS "," SANITIZERS_FLAGS_STR)
# Add sanitizer to compile and link flags
list(APPEND SANITIZERS_COMPILE_FLAGS "-fsanitize=${SANITIZERS_FLAGS_STR}")
set(SANITIZERS_LINK_FLAGS "${SANITIZERS_RELOCATION_FLAGS}" "-fsanitize=${SANITIZERS_FLAGS_STR}")
elseif(is_clang)
# Add ignorelist for Clang (GCC doesn't support this)
# Use CMAKE_SOURCE_DIR to get the path to the ignorelist
set(IGNORELIST_PATH "${CMAKE_SOURCE_DIR}/sanitizers/suppressions/sanitizer-ignorelist.txt")
if(NOT EXISTS "${IGNORELIST_PATH}")
message(FATAL_ERROR "Sanitizer ignorelist not found: ${IGNORELIST_PATH}")
endif()
list(APPEND SANITIZERS_COMPILE_FLAGS "-fsanitize-ignorelist=${IGNORELIST_PATH}")
message(STATUS " Using sanitizer ignorelist: ${IGNORELIST_PATH}")
# Join sanitizer flags with commas for -fsanitize option
list(JOIN SANITIZERS_FLAGS "," SANITIZERS_FLAGS_STR)
# Add sanitizer to compile and link flags
list(APPEND SANITIZERS_COMPILE_FLAGS "-fsanitize=${SANITIZERS_FLAGS_STR}")
set(SANITIZERS_LINK_FLAGS "-fsanitize=${SANITIZERS_FLAGS_STR}")
endif()
message(STATUS " Compile flags: ${SANITIZERS_COMPILE_FLAGS}")
message(STATUS " Link flags: ${SANITIZERS_LINK_FLAGS}")
# Apply the sanitizer flags to the 'common' interface library
# This is the same library used by XrplCompiler.cmake
target_compile_options(common INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:${SANITIZERS_COMPILE_FLAGS}>
$<$<COMPILE_LANGUAGE:C>:${SANITIZERS_COMPILE_FLAGS}>
)
# Apply linker flags
target_link_options(common INTERFACE ${SANITIZERS_LINK_FLAGS})
# Define SANITIZERS macro for BuildInfo.cpp
set(sanitizers_list)
if(enable_asan)
list(APPEND sanitizers_list "ASAN")
endif()
if(enable_tsan)
list(APPEND sanitizers_list "TSAN")
endif()
if(enable_ubsan)
list(APPEND sanitizers_list "UBSAN")
endif()
if(sanitizers_list)
list(JOIN sanitizers_list "." sanitizers_str)
target_compile_definitions(common INTERFACE SANITIZERS=${sanitizers_str})
endif()

View File

@@ -2,6 +2,8 @@
sanity checks
#]===================================================================]
include(CompilationEnv)
get_property(is_multiconfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
@@ -16,14 +18,12 @@ if (NOT is_multiconfig)
endif ()
endif ()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang") # both Clang and AppleClang
set (is_clang TRUE)
if (is_clang) # both Clang and AppleClang
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
message (FATAL_ERROR "This project requires clang 16 or later")
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set (is_gcc TRUE)
elseif (is_gcc)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
message (FATAL_ERROR "This project requires GCC 12 or later")
endif ()
@@ -40,7 +40,7 @@ if (MSVC AND CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
message (FATAL_ERROR "Visual Studio 32-bit build is not supported.")
endif ()
if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
if (NOT is_64bit)
message (FATAL_ERROR "Xrpld requires a 64 bit target architecture.\n"
"The most likely cause of this warning is trying to build xrpld with a 32-bit OS.")
endif ()

View File

@@ -2,11 +2,7 @@
declare options and variables
#]===================================================================]
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set (is_linux TRUE)
else()
set(is_linux FALSE)
endif()
include(CompilationEnv)
if("$ENV{CI}" STREQUAL "true" OR "$ENV{CONTINUOUS_INTEGRATION}" STREQUAL "true")
set(is_ci TRUE)
@@ -62,7 +58,7 @@ else()
set(wextra OFF CACHE BOOL "gcc/clang only" FORCE)
endif()
if(is_linux)
if(is_linux AND NOT SANITIZER)
option(BUILD_SHARED_LIBS "build shared xrpl libraries" OFF)
option(static "link protobuf, openssl, libc++, and boost statically" ON)
option(perf "Enables flags that assist with perf recording" OFF)
@@ -92,33 +88,6 @@ option(local_protobuf
option(local_grpc
"Force a local build of gRPC instead of looking for an installed version." OFF)
# this one is a string and therefore can't be an option
set(san "" CACHE STRING "On gcc & clang, add sanitizer instrumentation")
set_property(CACHE san PROPERTY STRINGS ";undefined;memory;address;thread")
if(san)
string(TOLOWER ${san} san)
set(SAN_FLAG "-fsanitize=${san}")
set(SAN_LIB "")
if(is_gcc)
if(san STREQUAL "address")
set(SAN_LIB "asan")
elseif(san STREQUAL "thread")
set(SAN_LIB "tsan")
elseif(san STREQUAL "memory")
set(SAN_LIB "msan")
elseif(san STREQUAL "undefined")
set(SAN_LIB "ubsan")
endif()
endif()
set(_saved_CRL ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES "${SAN_FLAG};${SAN_LIB}")
check_cxx_compiler_flag(${SAN_FLAG} COMPILER_SUPPORTS_SAN)
set(CMAKE_REQUIRED_LIBRARIES ${_saved_CRL})
if(NOT COMPILER_SUPPORTS_SAN)
message(FATAL_ERROR "${san} sanitizer does not seem to be supported by your compiler")
endif()
endif()
# the remaining options are obscure and rarely used
option(beast_no_unit_test_inline
"Prevents unit test definitions from being inserted into global table"

View File

@@ -1,3 +1,5 @@
include(CompilationEnv)
find_package(Boost 1.82 REQUIRED
COMPONENTS
chrono
@@ -32,7 +34,7 @@ target_link_libraries(xrpl_boost
if(Boost_COMPILER)
target_link_libraries(xrpl_boost INTERFACE Boost::disable_autolinking)
endif()
if(san AND is_clang)
if(SANITIZERS_ENABLED AND is_clang)
# TODO: gcc does not support -fsanitize-blacklist...can we do something else
# for gcc ?
if(NOT Boost_INCLUDE_DIRS AND TARGET Boost::headers)

View File

@@ -24,7 +24,7 @@
"c-ares/1.34.5#5581c2b62a608b40bb85d965ab3ec7c8%1764175359.429",
"bzip2/1.0.8#c470882369c2d95c5c77e970c0c7e321%1764175359.429",
"boost/1.88.0#8852c0b72ce8271fb8ff7c53456d4983%1756223752.326",
"abseil/20250127.0#9e8e8cfc89a1324139fc0ee3bd4d8c8c%1753819045.301"
"abseil/20250127.0#a0d8dd431284426b64c9f9a384d53dfc%1765817471.75"
],
"build_requires": [
"zlib/1.3.1#b8bc2603263cf7eccbd6e17e66b0ed76%1756234269.497",
@@ -38,7 +38,7 @@
"b2/5.3.3#107c15377719889654eb9a162a673975%1756234226.28",
"automake/1.16.5#b91b7c384c3deaa9d535be02da14d04f%1755524470.56",
"autoconf/2.71#51077f068e61700d65bb05541ea1e4b0%1731054366.86",
"abseil/20250127.0#9e8e8cfc89a1324139fc0ee3bd4d8c8c%1753819045.301"
"abseil/20250127.0#a0d8dd431284426b64c9f9a384d53dfc%1765817471.75"
],
"python_requires": [],
"overrides": {

1
conan/profiles/ci Normal file
View File

@@ -0,0 +1 @@
include(sanitizers)

59
conan/profiles/sanitizers Normal file
View File

@@ -0,0 +1,59 @@
include(default)
{% set compiler, version, compiler_exe = detect_api.detect_default_compiler() %}
{% set sanitizers = os.getenv("SANITIZERS") %}
[conf]
{% if sanitizers %}
{% if compiler == "gcc" %}
{% if "address" in sanitizers or "thread" in sanitizers or "undefinedbehavior" in sanitizers %}
{% set sanitizer_list = [] %}
{% set model_code = "" %}
{% set extra_cxxflags = ["-fno-omit-frame-pointer", "-O1", "-Wno-stringop-overflow"] %}
{% if "address" in sanitizers %}
{% set _ = sanitizer_list.append("address") %}
{% set model_code = "-mcmodel=large" %}
{% elif "thread" in sanitizers %}
{% set _ = sanitizer_list.append("thread") %}
{% set model_code = "-mcmodel=medium" %}
{% set _ = extra_cxxflags.append("-Wno-tsan") %}
{% endif %}
{% if "undefinedbehavior" in sanitizers %}
{% set _ = sanitizer_list.append("undefined") %}
{% set _ = sanitizer_list.append("float-divide-by-zero") %}
{% endif %}
{% set sanitizer_flags = "-fsanitize=" ~ ",".join(sanitizer_list) ~ " " ~ model_code %}
tools.build:cxxflags+=['{{sanitizer_flags}} {{" ".join(extra_cxxflags)}}']
tools.build:sharedlinkflags+=['{{sanitizer_flags}}']
tools.build:exelinkflags+=['{{sanitizer_flags}}']
{% endif %}
{% elif compiler == "apple-clang" or compiler == "clang" %}
{% if "address" in sanitizers or "thread" in sanitizers or "undefinedbehavior" in sanitizers %}
{% set sanitizer_list = [] %}
{% set extra_cxxflags = ["-fno-omit-frame-pointer", "-O1"] %}
{% if "address" in sanitizers %}
{% set _ = sanitizer_list.append("address") %}
{% elif "thread" in sanitizers %}
{% set _ = sanitizer_list.append("thread") %}
{% endif %}
{% if "undefinedbehavior" in sanitizers %}
{% set _ = sanitizer_list.append("undefined") %}
{% set _ = sanitizer_list.append("float-divide-by-zero") %}
{% set _ = sanitizer_list.append("unsigned-integer-overflow") %}
{% endif %}
{% set sanitizer_flags = "-fsanitize=" ~ ",".join(sanitizer_list) %}
tools.build:cxxflags+=['{{sanitizer_flags}} {{" ".join(extra_cxxflags)}}']
tools.build:sharedlinkflags+=['{{sanitizer_flags}}']
tools.build:exelinkflags+=['{{sanitizer_flags}}']
{% endif %}
{% endif %}
{% endif %}
tools.info.package_id:confs+=["tools.build:cxxflags", "tools.build:exelinkflags", "tools.build:sharedlinkflags"]

View File

@@ -1,4 +1,5 @@
import re
import os
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
@@ -120,6 +121,12 @@ class Xrpl(ConanFile):
if self.settings.compiler in ["clang", "gcc"]:
self.options["boost"].without_cobalt = True
# Check if environment variable exists
if "SANITIZERS" in os.environ:
sanitizers = os.environ["SANITIZERS"]
if "Address" in sanitizers:
self.default_options["fPIC"] = False
def requirements(self):
# Conan 2 requires transitive headers to be specified
transitive_headers_opt = (
@@ -182,12 +189,10 @@ class Xrpl(ConanFile):
libxrpl.libs = [
"xrpl",
"xrpl.libpb",
"ed25519",
"secp256k1",
]
# TODO: Fix the protobufs to include each other relative to
# `include/`, not `include/ripple/proto/`.
libxrpl.includedirs = ["include", "include/ripple/proto"]
# `include/`, not `include/xrpl/proto/`.
libxrpl.includedirs = ["include", "include/xrpl/proto"]
libxrpl.requires = [
"boost::headers",
"boost::chrono",

206
docs/build/sanitizers.md vendored Normal file
View File

@@ -0,0 +1,206 @@
# Sanitizer Configuration for Rippled
This document explains how to properly configure and run sanitizers (AddressSanitizer, undefinedbehaviorSanitizer, ThreadSanitizer) with the xrpld project.
Corresponding suppression files are located in the `sanitizers/suppressions` directory.
- [Sanitizer Configuration for Rippled](#sanitizer-configuration-for-rippled)
- [Building with Sanitizers](#building-with-sanitizers)
- [Summary](#summary)
- [Build steps:](#build-steps)
- [Install dependencies](#install-dependencies)
- [Call CMake](#call-cmake)
- [Build](#build)
- [Running Tests with Sanitizers](#running-tests-with-sanitizers)
- [AddressSanitizer (ASAN)](#addresssanitizer-asan)
- [ThreadSanitizer (TSan)](#threadsanitizer-tsan)
- [LeakSanitizer (LSan)](#leaksanitizer-lsan)
- [undefinedbehaviorSanitizer (UBSan)](#undefinedbehaviorsanitizer-ubsan)
- [Suppression Files](#suppression-files)
- [`asan.supp`](#asansupp)
- [`lsan.supp`](#lsansupp)
- [`ubsan.supp`](#ubsansupp)
- [`tsan.supp`](#tsansupp)
- [`sanitizer-ignorelist.txt`](#sanitizer-ignorelisttxt)
- [Troubleshooting](#troubleshooting)
- ["ASAN is ignoring requested \_\_asan_handle_no_return" warnings](#asan-is-ignoring-requested-__asan_handle_no_return-warnings)
- [Sanitizer Mismatch Errors](#sanitizer-mismatch-errors)
- [References](#references)
## Building with Sanitizers
### Summary
Follow the same instructions as mentioned in [BUILD.md](../../BUILD.md) but with the following changes:
1. Make sure you have a clean build directory.
2. Set the `SANITIZERS` environment variable before calling conan install and cmake. Only set it once. Make sure both conan and cmake read the same values.
Example: `export SANITIZERS=address,undefinedbehavior`
3. Optionally use `--profile:all sanitizers` with Conan to build dependencies with sanitizer instrumentation. [!NOTE]Building with sanitizer-instrumented dependencies is slower but produces fewer false positives.
4. Set `ASAN_OPTIONS`, `LSAN_OPTIONS`, `UBSAN_OPTIONS` and `TSAN_OPTIONS` environment variables to configure sanitizer behavior when running executables. [More details below](#running-tests-with-sanitizers).
---
### Build steps:
```bash
cd /path/to/rippled
rm -rf .build
mkdir .build
cd .build
```
#### Install dependencies
The `SANITIZERS` environment variable is used by both Conan and CMake.
```bash
export SANITIZERS=address,undefinedbehavior
# Standard build (without instrumenting dependencies)
conan install .. --output-folder . --build missing --settings build_type=Debug
# Or with sanitizer-instrumented dependencies (takes longer but fewer false positives)
conan install .. --output-folder . --profile:all sanitizers --build missing --settings build_type=Debug
```
[!CAUTION]
Do not mix Address and Thread sanitizers - they are incompatible.
Since you already set the `SANITIZERS` environment variable when running Conan, same values will be read for the next part.
#### Call CMake
```bash
cmake .. -G Ninja \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE=Debug \
-Dtests=ON -Dxrpld=ON
```
#### Build
```bash
cmake --build . --parallel 4
```
## Running Tests with Sanitizers
### AddressSanitizer (ASAN)
**IMPORTANT**: ASAN with Boost produces many false positives. Use these options:
```bash
export ASAN_OPTIONS="detect_container_overflow=0:suppressions=path/to/asan.supp:halt_on_error=0:log_path=asan.log"
export LSAN_OPTIONS="suppressions=path/to/lsan.supp:halt_on_error=0:log_path=lsan.log"
# Run tests
./xrpld --unittest --unittest-jobs=5
```
**Why `detect_container_overflow=0`?**
- Boost intrusive containers (used in `aged_unordered_container`) trigger false positives
- Boost context switching (used in `Workers.cpp`) confuses ASAN's stack tracking
- Since we usually don't build Boost(because we don't want to instrument Boost and detect issues in Boost code) with ASAN but use Boost containers in ASAN instrumented rippled code, it generates false positives. Building dependencies with ASAN instrumentation reduces false positives.
- See: https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow
- More such flags are detailed [here](https://github.com/google/sanitizers/wiki/AddressSanitizerFlags)
### ThreadSanitizer (TSan)
```bash
export TSAN_OPTIONS="suppressions=path/to/tsan.supp halt_on_error=0 log_path=tsan.log"
# Run tests
./xrpld --unittest --unittest-jobs=5
```
More details [here](https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual).
### LeakSanitizer (LSan)
LSan is automatically enabled with ASAN. To disable it:
```bash
export ASAN_OPTIONS="detect_leaks=0"
```
More details [here](https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer).
### undefinedbehaviorSanitizer (UBSan)
```bash
export UBSAN_OPTIONS="suppressions=path/to/ubsan.supp:print_stacktrace=1:halt_on_error=0:log_path=ubsan.log"
# Run tests
./xrpld --unittest --unittest-jobs=5
```
More details [here](https://clang.llvm.org/docs/undefinedbehaviorSanitizer.html).
## Suppression Files
[!NOTE] Attached files contain more details.
### [`asan.supp`](../../sanitizers/suppressions/asan.supp)
- **Purpose**: Suppress AddressSanitizer (ASAN) errors only
- **Format**: `interceptor_name:<pattern>` where pattern matches file names. Supported suppression types are:
- interceptor_name
- interceptor_via_fun
- interceptor_via_lib
- odr_violation
- **More info**: [AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer)
- **Note**: Cannot suppress stack-buffer-overflow, container-overflow, etc.
### [`lsan.supp`](../../sanitizers/suppressions/lsan.supp)
- **Purpose**: Suppress LeakSanitizer (LSan) errors only
- **Format**: `leak:<pattern>` where pattern matches function/file names
- **More info**: [LeakSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer)
### [`ubsan.supp`](../../sanitizers/suppressions/ubsan.supp)
- **Purpose**: Suppress undefinedbehaviorSanitizer errors
- **Format**: `<error_type>:<pattern>` (e.g., `unsigned-integer-overflow:protobuf`)
- **Covers**: Intentional overflows in sanitizers/suppressions libraries (protobuf, gRPC, stdlib)
- More info [UBSan suppressions](https://clang.llvm.org/docs/SanitizerSpecialCaseList.html).
### [`tsan.supp`](../../sanitizers/suppressions/tsan.supp)
- **Purpose**: Suppress ThreadSanitizer data race warnings
- **Format**: `race:<pattern>` where pattern matches function/file names
- **More info**: [ThreadSanitizer suppressions](https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions)
### [`sanitizer-ignorelist.txt`](../../sanitizers/suppressions/sanitizer-ignorelist.txt)
- **Purpose**: Compile-time ignorelist for all sanitizers
- **Usage**: Passed via `-fsanitize-ignorelist=absolute/path/to/sanitizer-ignorelist.txt`
- **Format**: `<level>:<pattern>` (e.g., `src:Workers.cpp`)
## Troubleshooting
### "ASAN is ignoring requested \_\_asan_handle_no_return" warnings
These warnings appear when using Boost context switching and are harmless. They indicate potential false positives.
### Sanitizer Mismatch Errors
If you see undefined symbols like `___tsan_atomic_load` when building with ASAN:
**Problem**: Dependencies were built with a different sanitizer than the main project.
**Solution**: Rebuild everything with the same sanitizer:
```bash
rm -rf .build
# Then follow the build instructions above
```
Then review the log files: `asan.log.*`, `ubsan.log.*`, `tsan.log.*`
## References
- [AddressSanitizer Wiki](https://github.com/google/sanitizers/wiki/AddressSanitizer)
- [AddressSanitizer Flags](https://github.com/google/sanitizers/wiki/AddressSanitizerFlags)
- [Container Overflow Detection](https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow)
- [UndefinedBehavior Sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html)
- [ThreadSanitizer](https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual)

View File

@@ -3,7 +3,7 @@
#include <boost/filesystem.hpp>
namespace ripple {
namespace xrpl {
/** Extract a tar archive compressed with lz4
@@ -17,6 +17,6 @@ extractTarLz4(
boost::filesystem::path const& src,
boost::filesystem::path const& dst);
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -12,7 +12,7 @@
#include <unordered_map>
#include <vector>
namespace ripple {
namespace xrpl {
using IniFileSections =
std::unordered_map<std::string, std::vector<std::string>>;
@@ -380,6 +380,6 @@ get_if_exists<bool>(Section const& section, std::string const& name, bool& v)
return stat;
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -3,13 +3,13 @@
#include <vector>
namespace ripple {
namespace xrpl {
/** Storage for linear binary data.
Blocks of binary data appear often in various idioms and structures.
*/
using Blob = std::vector<unsigned char>;
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -8,7 +8,7 @@
#include <cstring>
#include <memory>
namespace ripple {
namespace xrpl {
/** Like std::vector<char> but better.
Meets the requirements of BufferFactory.
@@ -96,7 +96,7 @@ public:
XRPL_ASSERT(
s.size() == 0 || size_ == 0 || s.data() < p_.get() ||
s.data() >= p_.get() + size_,
"ripple::Buffer::operator=(Slice) : input not a subset");
"xrpl::Buffer::operator=(Slice) : input not a subset");
if (auto p = alloc(s.size()))
std::memcpy(p, s.data(), s.size());
@@ -215,6 +215,6 @@ operator!=(Buffer const& lhs, Buffer const& rhs) noexcept
return !(lhs == rhs);
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -1,7 +1,7 @@
#ifndef XRPL_BASICS_BYTEUTILITIES_H_INCLUDED
#define XRPL_BASICS_BYTEUTILITIES_H_INCLUDED
namespace ripple {
namespace xrpl {
template <class T>
constexpr auto
@@ -19,6 +19,6 @@ megabytes(T value) noexcept
static_assert(kilobytes(2) == 2048, "kilobytes(2) == 2048");
static_assert(megabytes(3) == 3145728, "megabytes(3) == 3145728");
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -10,7 +10,7 @@
#include <stdexcept>
#include <vector>
namespace ripple {
namespace xrpl {
namespace compression_algorithms {
@@ -144,6 +144,6 @@ lz4Decompress(
} // namespace compression_algorithms
} // namespace ripple
} // namespace xrpl
#endif // XRPL_COMPRESSIONALGORITHMS_H_INCLUDED

View File

@@ -8,7 +8,7 @@
#include <utility>
#include <vector>
namespace ripple {
namespace xrpl {
/** Manages all counted object types. */
class CountedObjects
@@ -133,6 +133,6 @@ public:
}
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -4,7 +4,7 @@
#include <chrono>
#include <cmath>
namespace ripple {
namespace xrpl {
/** Sampling function using exponential decay to provide a continuous value.
@tparam The number of seconds in the decay window.
@@ -69,8 +69,11 @@ private:
}
else
{
while (elapsed--)
while (elapsed > 0)
{
--elapsed;
m_value -= (m_value + Window - 1) / Window;
}
}
}
@@ -131,6 +134,6 @@ private:
time_point when_;
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -7,7 +7,7 @@
#include <stdexcept>
namespace ripple {
namespace xrpl {
/** Expected is an approximation of std::expected (hoped for in C++23)
@@ -232,6 +232,6 @@ public:
}
};
} // namespace ripple
} // namespace xrpl
#endif // XRPL_BASICS_EXPECTED_H_INCLUDED

View File

@@ -6,7 +6,7 @@
#include <optional>
namespace ripple {
namespace xrpl {
std::string
getFileContents(
@@ -20,6 +20,6 @@ writeFileContents(
boost::filesystem::path const& destPath,
std::string const& contents);
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -6,7 +6,7 @@
#include <type_traits>
#include <utility>
namespace ripple {
namespace xrpl {
//------------------------------------------------------------------------------
@@ -492,5 +492,5 @@ dynamic_pointer_cast(TT const& v)
return SharedPtr<T>(DynamicCastTagSharedIntrusive{}, v);
}
} // namespace intr_ptr
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -6,7 +6,7 @@
#include <utility>
namespace ripple {
namespace xrpl {
template <class T>
template <CAdoptTag TAdoptTag>
@@ -608,7 +608,7 @@ SharedWeakUnion<T>::convertToStrong()
[[maybe_unused]] auto action = p->releaseWeakRef();
XRPL_ASSERT(
(action == ReleaseWeakRefAction::noop),
"ripple::SharedWeakUnion::convertToStrong : "
"xrpl::SharedWeakUnion::convertToStrong : "
"action is noop");
unsafeSetRawPtr(p, RefStrength::strong);
return true;
@@ -637,7 +637,7 @@ SharedWeakUnion<T>::convertToWeak()
// We just added a weak ref. How could we destroy?
// LCOV_EXCL_START
UNREACHABLE(
"ripple::SharedWeakUnion::convertToWeak : destroying freshly "
"xrpl::SharedWeakUnion::convertToWeak : destroying freshly "
"added ref");
delete p;
unsafeSetRawPtr(nullptr);
@@ -719,5 +719,5 @@ SharedWeakUnion<T>::unsafeReleaseNoStore()
}
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -6,7 +6,7 @@
#include <atomic>
#include <cstdint>
namespace ripple {
namespace xrpl {
/** Action to perform when releasing a strong pointer.
@@ -34,7 +34,7 @@ enum class ReleaseWeakRefAction { noop, destroy };
/** Implement the strong count, weak count, and bit flags for an intrusive
pointer.
A class can satisfy the requirements of a ripple::IntrusivePointer by
A class can satisfy the requirements of a xrpl::IntrusivePointer by
inheriting from this class.
*/
struct IntrusiveRefCounts
@@ -257,7 +257,7 @@ IntrusiveRefCounts::releaseStrongRef() const
RefCountPair const prevVal{prevIntVal};
XRPL_ASSERT(
(prevVal.strong >= strongDelta),
"ripple::IntrusiveRefCounts::releaseStrongRef : previous ref "
"xrpl::IntrusiveRefCounts::releaseStrongRef : previous ref "
"higher than new");
auto nextIntVal = prevIntVal - strongDelta;
ReleaseStrongRefAction action = noop;
@@ -282,7 +282,7 @@ IntrusiveRefCounts::releaseStrongRef() const
// twice.
XRPL_ASSERT(
(action == noop) || !(prevIntVal & partialDestroyStartedMask),
"ripple::IntrusiveRefCounts::releaseStrongRef : not in partial "
"xrpl::IntrusiveRefCounts::releaseStrongRef : not in partial "
"destroy");
return action;
}
@@ -314,7 +314,7 @@ IntrusiveRefCounts::addWeakReleaseStrongRef() const
// can't happen twice.
XRPL_ASSERT(
(!prevVal.partialDestroyStartedBit),
"ripple::IntrusiveRefCounts::addWeakReleaseStrongRef : not in "
"xrpl::IntrusiveRefCounts::addWeakReleaseStrongRef : not in "
"partial destroy");
auto nextIntVal = prevIntVal + delta;
@@ -336,7 +336,7 @@ IntrusiveRefCounts::addWeakReleaseStrongRef() const
{
XRPL_ASSERT(
(!(prevIntVal & partialDestroyStartedMask)),
"ripple::IntrusiveRefCounts::addWeakReleaseStrongRef : not "
"xrpl::IntrusiveRefCounts::addWeakReleaseStrongRef : not "
"started partial destroy");
return action;
}
@@ -408,11 +408,11 @@ inline IntrusiveRefCounts::~IntrusiveRefCounts() noexcept
auto v = refCounts.load(std::memory_order_acquire);
XRPL_ASSERT(
(!(v & valueMask)),
"ripple::IntrusiveRefCounts::~IntrusiveRefCounts : count must be zero");
"xrpl::IntrusiveRefCounts::~IntrusiveRefCounts : count must be zero");
auto t = v & tagMask;
XRPL_ASSERT(
(!t || t == tagMask),
"ripple::IntrusiveRefCounts::~IntrusiveRefCounts : valid tag");
"xrpl::IntrusiveRefCounts::~IntrusiveRefCounts : valid tag");
#endif
}
@@ -427,7 +427,7 @@ inline IntrusiveRefCounts::RefCountPair::RefCountPair(
{
XRPL_ASSERT(
(strong < checkStrongMaxValue && weak < checkWeakMaxValue),
"ripple::IntrusiveRefCounts::RefCountPair(FieldType) : inputs inside "
"xrpl::IntrusiveRefCounts::RefCountPair(FieldType) : inputs inside "
"range");
}
@@ -438,7 +438,7 @@ inline IntrusiveRefCounts::RefCountPair::RefCountPair(
{
XRPL_ASSERT(
(strong < checkStrongMaxValue && weak < checkWeakMaxValue),
"ripple::IntrusiveRefCounts::RefCountPair(CountType, CountType) : "
"xrpl::IntrusiveRefCounts::RefCountPair(CountType, CountType) : "
"inputs inside range");
}
@@ -447,7 +447,7 @@ IntrusiveRefCounts::RefCountPair::combinedValue() const noexcept
{
XRPL_ASSERT(
(strong < checkStrongMaxValue && weak < checkWeakMaxValue),
"ripple::IntrusiveRefCounts::RefCountPair::combinedValue : inputs "
"xrpl::IntrusiveRefCounts::RefCountPair::combinedValue : inputs "
"inside range");
return (static_cast<IntrusiveRefCounts::FieldType>(weak)
<< IntrusiveRefCounts::StrongCountNumBits) |
@@ -465,7 +465,7 @@ partialDestructorFinished(T** o)
XRPL_ASSERT(
(!p.partialDestroyFinishedBit && p.partialDestroyStartedBit &&
!p.strong),
"ripple::partialDestructorFinished : not a weak ref");
"xrpl::partialDestructorFinished : not a weak ref");
if (!p.weak)
{
// There was a weak count before the partial destructor ran (or we would
@@ -479,5 +479,5 @@ partialDestructorFinished(T** o)
}
//------------------------------------------------------------------------------
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -4,10 +4,10 @@
#include <xrpl/basics/TaggedCache.h>
#include <xrpl/basics/base_uint.h>
namespace ripple {
namespace xrpl {
using KeyCache = TaggedCache<uint256, int, true>;
} // namespace ripple
} // namespace xrpl
#endif // XRPL_BASICS_KEYCACHE_H

View File

@@ -6,7 +6,7 @@
#include <memory>
#include <unordered_map>
namespace ripple {
namespace xrpl {
namespace detail {
@@ -109,6 +109,6 @@ LocalValue<T>::operator*()
.emplace(this, std::make_unique<detail::LocalValues::Value<T>>(t_))
.first->second->get());
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -13,7 +13,7 @@
#include <mutex>
#include <utility>
namespace ripple {
namespace xrpl {
// DEPRECATED use beast::severities::Severity instead
enum LogSeverity {
@@ -271,6 +271,6 @@ setDebugLogSink(std::unique_ptr<beast::Journal::Sink> sink);
beast::Journal
debugLog();
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -5,7 +5,7 @@
#include <cassert>
#include <cstddef>
namespace ripple {
namespace xrpl {
/** Calculate one number divided by another number in percentage.
* The result is rounded up to the next integer, and capped in the range [0,100]
@@ -44,6 +44,6 @@ static_assert(calculatePercent(50'000'000, 100'000'000) == 50);
static_assert(calculatePercent(50'000'001, 100'000'000) == 51);
static_assert(calculatePercent(99'999'999, 100'000'000) == 100);
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -6,7 +6,7 @@
#include <ostream>
#include <string>
namespace ripple {
namespace xrpl {
class Number;
@@ -402,6 +402,6 @@ public:
operator=(NumberRoundModeGuard const&) = delete;
};
} // namespace ripple
} // namespace xrpl
#endif // XRPL_BASICS_NUMBER_H_INCLUDED

View File

@@ -21,11 +21,11 @@ ripple/basic should contain no dependencies on other modules.
- `std::set`
- For sorted containers.
- `ripple::hash_set`
- `xrpl::hash_set`
- Where inserts and contains need to be O(1).
- For "small" sets, `std::set` might be faster and smaller.
- `ripple::hardened_hash_set`
- `xrpl::hardened_hash_set`
- For data sets where the key could be manipulated by an attacker
in an attempt to mount an algorithmic complexity attack: see
http://en.wikipedia.org/wiki/Algorithmic_complexity_attack
@@ -33,5 +33,5 @@ ripple/basic should contain no dependencies on other modules.
The following container is deprecated
- `std::unordered_set`
- Use `ripple::hash_set` instead, which uses a better hashing algorithm.
- Or use `ripple::hardened_hash_set` to prevent algorithmic complexity attacks.
- Use `xrpl::hash_set` instead, which uses a better hashing algorithm.
- Or use `xrpl::hardened_hash_set` to prevent algorithmic complexity attacks.

View File

@@ -11,7 +11,7 @@
#include <string>
#include <vector>
namespace ripple {
namespace xrpl {
/** A closed interval over the domain T.
@@ -85,7 +85,7 @@ to_string(RangeSet<T> const& rs)
std::string s;
for (auto const& interval : rs)
s += ripple::to_string(interval) + ",";
s += xrpl::to_string(interval) + ",";
s.pop_back();
return s;
@@ -172,6 +172,6 @@ prevMissing(RangeSet<T> const& rs, T t, T minVal = 0)
return boost::icl::last(tgt);
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -6,7 +6,7 @@
#include <functional>
#include <vector>
namespace ripple {
namespace xrpl {
class Resolver
{
@@ -47,6 +47,6 @@ public:
/** @} */
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -6,7 +6,7 @@
#include <boost/asio/io_context.hpp>
namespace ripple {
namespace xrpl {
class ResolverAsio : public Resolver
{
@@ -17,6 +17,6 @@ public:
New(boost::asio::io_context&, beast::Journal);
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -6,7 +6,7 @@
#include <ostream>
namespace ripple {
namespace xrpl {
// A SHAMapHash is the hash of a node in a SHAMap, and also the
// type of the hash of the entire SHAMap.
@@ -97,6 +97,6 @@ extract(SHAMapHash const& key)
return *reinterpret_cast<std::size_t const*>(key.as_uint256().data());
}
} // namespace ripple
} // namespace xrpl
#endif // XRPL_BASICS_SHAMAP_HASH_H_INCLUDED

View File

@@ -4,7 +4,7 @@
#include <memory>
#include <variant>
namespace ripple {
namespace xrpl {
/** A combination of a std::shared_ptr and a std::weak_pointer.
@@ -112,5 +112,5 @@ public:
private:
std::variant<std::shared_ptr<T>, std::weak_ptr<T>> combo_;
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -3,7 +3,7 @@
#include <xrpl/basics/SharedWeakCachePointer.h>
namespace ripple {
namespace xrpl {
template <class T>
SharedWeakCachePointer<T>::SharedWeakCachePointer(
SharedWeakCachePointer const& rhs) = default;
@@ -169,5 +169,5 @@ SharedWeakCachePointer<T>::convertToWeak()
return false;
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -22,7 +22,7 @@
#include <sys/mman.h>
#endif
namespace ripple {
namespace xrpl {
template <typename Type>
class SlabAllocator
@@ -128,7 +128,7 @@ class SlabAllocator
{
XRPL_ASSERT(
own(ptr),
"ripple::SlabAllocator::SlabBlock::deallocate : own input");
"xrpl::SlabAllocator::SlabBlock::deallocate : own input");
std::lock_guard l(m_);
@@ -173,7 +173,7 @@ public:
{
XRPL_ASSERT(
(itemAlignment_ & (itemAlignment_ - 1)) == 0,
"ripple::SlabAllocator::SlabAllocator : valid alignment");
"xrpl::SlabAllocator::SlabAllocator : valid alignment");
}
SlabAllocator(SlabAllocator const& other) = delete;
@@ -285,7 +285,7 @@ public:
{
XRPL_ASSERT(
ptr,
"ripple::SlabAllocator::SlabAllocator::deallocate : non-null "
"xrpl::SlabAllocator::SlabAllocator::deallocate : non-null "
"input");
for (auto slab = slabs_.load(); slab != nullptr; slab = slab->next_)
@@ -419,6 +419,6 @@ public:
}
};
} // namespace ripple
} // namespace xrpl
#endif // XRPL_BASICS_SLABALLOCATOR_H_INCLUDED

View File

@@ -15,7 +15,7 @@
#include <type_traits>
#include <vector>
namespace ripple {
namespace xrpl {
/** An immutable linear range of bytes.
@@ -87,7 +87,7 @@ public:
{
XRPL_ASSERT(
i < size_,
"ripple::Slice::operator[](std::size_t) const : valid input");
"xrpl::Slice::operator[](std::size_t) const : valid input");
return data_[i];
}
@@ -243,6 +243,6 @@ makeSlice(std::basic_string<char, Traits, Alloc> const& s)
return Slice(s.data(), s.size());
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -12,7 +12,7 @@
#include <optional>
#include <string>
namespace ripple {
namespace xrpl {
/** Format arbitrary binary data as an SQLite "blob literal".
@@ -132,6 +132,6 @@ to_uint64(std::string const& s);
bool
isProperlyFormedTomlDomain(std::string_view domain);
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -16,7 +16,7 @@
#include <type_traits>
#include <vector>
namespace ripple {
namespace xrpl {
/** Map/cache combination.
This class implements a cache and a map. The cache keeps objects alive
@@ -315,6 +315,6 @@ private:
std::uint64_t m_misses;
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -4,7 +4,7 @@
#include <xrpl/basics/IntrusivePointer.ipp>
#include <xrpl/basics/TaggedCache.h>
namespace ripple {
namespace xrpl {
template <
class Key,
@@ -1005,6 +1005,6 @@ TaggedCache<
});
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -4,7 +4,7 @@
#include <string>
#include <type_traits>
namespace ripple {
namespace xrpl {
/** to_string() generalizes std::to_string to handle bools, chars, and strings.
@@ -43,6 +43,6 @@ to_string(char const* s)
return s;
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -22,7 +22,7 @@
* what container it is.
*/
namespace ripple {
namespace xrpl {
// hash containers
@@ -102,6 +102,6 @@ template <
using hardened_hash_multiset =
std::unordered_multiset<Value, Hash, Pred, Allocator>;
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -6,7 +6,7 @@
#include <ratio>
#include <thread>
namespace ripple {
namespace xrpl {
/** Tracks program uptime to seconds precision.
@@ -45,6 +45,6 @@ private:
start_clock();
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -3,7 +3,7 @@
#include <utility>
namespace ripple {
namespace xrpl {
// Requires: [first1, last1) and [first2, last2) are ordered ranges according to
// comp.
@@ -95,6 +95,6 @@ remove_if_intersect_or_match(
return first1;
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -38,7 +38,7 @@
#include <cstdint>
#include <string>
namespace ripple {
namespace xrpl {
std::string
base64_encode(std::uint8_t const* data, std::size_t len);
@@ -53,6 +53,6 @@ base64_encode(std::string const& s)
std::string
base64_decode(std::string_view data);
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -23,7 +23,7 @@
#include <cstring>
#include <type_traits>
namespace ripple {
namespace xrpl {
namespace detail {
@@ -275,7 +275,7 @@ public:
{
XRPL_ASSERT(
c.size() * sizeof(typename Container::value_type) == size(),
"ripple::base_uint::base_uint(Container auto) : input size match");
"xrpl::base_uint::base_uint(Container auto) : input size match");
std::memcpy(data_.data(), c.data(), size());
}
@@ -288,7 +288,7 @@ public:
{
XRPL_ASSERT(
c.size() * sizeof(typename Container::value_type) == size(),
"ripple::base_uint::operator=(Container auto) : input size match");
"xrpl::base_uint::operator=(Container auto) : input size match");
std::memcpy(data_.data(), c.data(), size());
return *this;
}
@@ -648,12 +648,12 @@ static_assert(sizeof(uint192) == 192 / 8, "There should be no padding bytes");
static_assert(sizeof(uint256) == 256 / 8, "There should be no padding bytes");
#endif
} // namespace ripple
} // namespace xrpl
namespace beast {
template <std::size_t Bits, class Tag>
struct is_uniquely_represented<ripple::base_uint<Bits, Tag>>
struct is_uniquely_represented<xrpl::base_uint<Bits, Tag>>
: public std::true_type
{
explicit is_uniquely_represented() = default;

View File

@@ -12,7 +12,7 @@
#include <ratio>
#include <string>
namespace ripple {
namespace xrpl {
// A few handy aliases
@@ -104,6 +104,6 @@ stopwatch()
return beast::get_abstract_clock<Facade, Clock>();
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -3,7 +3,7 @@
#include <functional>
namespace ripple {
namespace xrpl {
#ifdef _MSC_VER
@@ -52,6 +52,6 @@ using equal_to = std::equal_to<T>;
#endif
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -7,7 +7,7 @@
#include <string>
#include <utility>
namespace ripple {
namespace xrpl {
/* Programming By Contract
@@ -52,6 +52,6 @@ Throw(Args&&... args)
[[noreturn]] void
LogicError(std::string const& how) noexcept;
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -9,7 +9,7 @@
#include <random>
#include <utility>
namespace ripple {
namespace xrpl {
namespace detail {
@@ -92,6 +92,6 @@ public:
}
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -3,7 +3,7 @@
#include <string>
namespace ripple {
namespace xrpl {
template <class Stream, class Iter>
Stream&
@@ -85,6 +85,6 @@ public:
}
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -5,7 +5,7 @@
#include <string>
namespace ripple {
namespace xrpl {
/** Create a self-signed SSL context that allows anonymous Diffie Hellman. */
std::shared_ptr<boost::asio::ssl::context>
@@ -19,6 +19,6 @@ make_SSLContextAuthed(
std::string const& chainFile,
std::string const& cipherList);
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -5,7 +5,7 @@
#include <limits>
#include <optional>
namespace ripple {
namespace xrpl {
auto constexpr muldiv_max = std::numeric_limits<std::uint64_t>::max();
/** Return value*mul/div accurately.
@@ -21,6 +21,6 @@ auto constexpr muldiv_max = std::numeric_limits<std::uint64_t>::max();
std::optional<std::uint64_t>
mulDiv(std::uint64_t value, std::uint64_t mul, std::uint64_t div);
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -12,7 +12,7 @@
#include <utility>
#include <vector>
namespace ripple {
namespace xrpl {
template <typename Key>
static std::size_t
@@ -242,7 +242,7 @@ public:
map_.resize(partitions_);
XRPL_ASSERT(
partitions_,
"ripple::partitioned_unordered_map::partitioned_unordered_map : "
"xrpl::partitioned_unordered_map::partitioned_unordered_map : "
"nonzero partitions");
}
@@ -401,6 +401,6 @@ private:
mutable partition_map_type map_{};
};
} // namespace ripple
} // namespace xrpl
#endif // XRPL_BASICS_PARTITIONED_UNORDERED_MAP_H

View File

@@ -11,7 +11,7 @@
#include <random>
#include <type_traits>
namespace ripple {
namespace xrpl {
#ifndef __INTELLISENSE__
static_assert(
@@ -95,7 +95,7 @@ std::enable_if_t<
Integral>
rand_int(Engine& engine, Integral min, Integral max)
{
XRPL_ASSERT(max > min, "ripple::rand_int : max over min inputs");
XRPL_ASSERT(max > min, "xrpl::rand_int : max over min inputs");
// This should have no state and constructing it should
// be very cheap. If that turns out not to be the case
@@ -186,6 +186,6 @@ rand_bool()
}
/** @} */
} // namespace ripple
} // namespace xrpl
#endif // XRPL_BASICS_RANDOM_H_INCLUDED

View File

@@ -3,7 +3,7 @@
#include <type_traits>
namespace ripple {
namespace xrpl {
// safe_cast adds compile-time checks to a static_cast to ensure that
// the destination can hold all values of the source. This is particularly
@@ -80,6 +80,6 @@ inline constexpr std::
return unsafe_cast<Dest>(static_cast<std::underlying_type_t<Src>>(s));
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -8,7 +8,7 @@
#include <type_traits>
#include <utility>
namespace ripple {
namespace xrpl {
// RAII scope helpers. As specified in Library Fundamental, Version 3
// Basic design of idea: https://www.youtube.com/watch?v=WjTrfoiB0MQ
@@ -218,7 +218,7 @@ public:
{
XRPL_ASSERT(
plock->owns_lock(),
"ripple::scope_unlock::scope_unlock : mutex must be locked");
"xrpl::scope_unlock::scope_unlock : mutex must be locked");
plock->unlock();
}
@@ -236,6 +236,6 @@ public:
template <class Mutex>
scope_unlock(std::unique_lock<Mutex>&) -> scope_unlock<Mutex>;
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -13,7 +13,7 @@
#include <immintrin.h>
#endif
namespace ripple {
namespace xrpl {
namespace detail {
/** Inform the processor that we are in a tight spin-wait loop.
@@ -105,7 +105,7 @@ public:
{
XRPL_ASSERT(
index >= 0 && (mask_ != 0),
"ripple::packed_spinlock::packed_spinlock : valid index and mask");
"xrpl::packed_spinlock::packed_spinlock : valid index and mask");
}
[[nodiscard]] bool
@@ -206,6 +206,6 @@ public:
};
/** @} */
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -4,7 +4,7 @@
#include <boost/algorithm/hex.hpp>
#include <boost/endian/conversion.hpp>
namespace ripple {
namespace xrpl {
template <class FwdIt>
std::string
@@ -28,6 +28,6 @@ strHex(T const& from)
return strHex(from.begin(), from.end());
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -10,7 +10,7 @@
#include <iostream>
#include <type_traits>
namespace ripple {
namespace xrpl {
/** A type-safe wrap around standard integral types
@@ -197,11 +197,11 @@ public:
}
};
} // namespace ripple
} // namespace xrpl
namespace beast {
template <class Int, class Tag, class HashAlgorithm>
struct is_contiguously_hashable<ripple::tagged_integer<Int, Tag>, HashAlgorithm>
struct is_contiguously_hashable<xrpl::tagged_integer<Int, Tag>, HashAlgorithm>
: public is_contiguously_hashable<Int, HashAlgorithm>
{
explicit is_contiguously_hashable() = default;

View File

@@ -47,7 +47,7 @@ public:
: work_(boost::asio::make_work_guard(ios_))
{
threads_.reserve(concurrency);
while (concurrency--)
for (std::size_t i = 0; i < concurrency; ++i)
threads_.emplace_back([&] { ios_.run(); });
}

View File

@@ -8,7 +8,7 @@
#include <mutex>
#include <optional>
namespace ripple {
namespace xrpl {
/**
* The role of a `ClosureCounter` is to assist in shutdown by letting callers
@@ -202,6 +202,6 @@ public:
}
};
} // namespace ripple
} // namespace xrpl
#endif // XRPL_CORE_CLOSURE_COUNTER_H_INCLUDED

View File

@@ -3,7 +3,7 @@
#include <xrpl/basics/ByteUtilities.h>
namespace ripple {
namespace xrpl {
template <class F>
JobQueue::Coro::Coro(
@@ -34,7 +34,7 @@ JobQueue::Coro::Coro(
inline JobQueue::Coro::~Coro()
{
#ifndef NDEBUG
XRPL_ASSERT(finished_, "ripple::JobQueue::Coro::~Coro : is finished");
XRPL_ASSERT(finished_, "xrpl::JobQueue::Coro::~Coro : is finished");
#endif
}
@@ -85,8 +85,7 @@ JobQueue::Coro::resume()
detail::getLocalValues().reset(&lvs_);
std::lock_guard lock(mutex_);
XRPL_ASSERT(
static_cast<bool>(coro_),
"ripple::JobQueue::Coro::resume : is runnable");
static_cast<bool>(coro_), "xrpl::JobQueue::Coro::resume : is runnable");
coro_();
detail::getLocalValues().release();
detail::getLocalValues().reset(saved);
@@ -129,6 +128,6 @@ JobQueue::Coro::join()
cv_.wait(lk, [this]() { return running_ == false; });
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -7,7 +7,7 @@
#include <functional>
namespace ripple {
namespace xrpl {
// Note that this queue should only be used for CPU-bound jobs
// It is primarily intended for signature checking
@@ -131,6 +131,6 @@ private:
using JobCounter = ClosureCounter<void>;
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -12,7 +12,7 @@
#include <set>
namespace ripple {
namespace xrpl {
namespace perf {
class PerfLog;
@@ -382,11 +382,11 @@ private:
lock is released which only happens after the coroutine completes.
*/
} // namespace ripple
} // namespace xrpl
#include <xrpl/core/Coro.ipp>
namespace ripple {
namespace xrpl {
template <class F>
std::shared_ptr<JobQueue::Coro>
@@ -408,6 +408,6 @@ JobQueue::postCoro(JobType t, std::string const& name, F&& f)
return coro;
}
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -5,7 +5,7 @@
#include <xrpl/beast/insight/Collector.h>
#include <xrpl/core/JobTypeInfo.h>
namespace ripple {
namespace xrpl {
struct JobTypeData
{
@@ -83,6 +83,6 @@ public:
}
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -3,7 +3,7 @@
#include <xrpl/core/Job.h>
namespace ripple {
namespace xrpl {
/** Holds all the 'static' information about a job, which does not change */
class JobTypeInfo
@@ -78,6 +78,6 @@ public:
}
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -7,7 +7,7 @@
#include <map>
#include <string>
namespace ripple {
namespace xrpl {
class JobTypes
{
@@ -35,7 +35,7 @@ private:
std::chrono::milliseconds peakLatency) {
XRPL_ASSERT(
m_map.find(jt) == m_map.end(),
"ripple::JobTypes::JobTypes::add : unique job type input");
"xrpl::JobTypes::JobTypes::add : unique job type input");
[[maybe_unused]] auto const inserted =
m_map
@@ -48,7 +48,7 @@ private:
XRPL_ASSERT(
inserted == true,
"ripple::JobTypes::JobTypes::add : input is inserted");
"xrpl::JobTypes::JobTypes::add : input is inserted");
};
// clang-format off
@@ -122,7 +122,7 @@ public:
get(JobType jt) const
{
Map::const_iterator const iter(m_map.find(jt));
XRPL_ASSERT(iter != m_map.end(), "ripple::JobTypes::get : valid input");
XRPL_ASSERT(iter != m_map.end(), "xrpl::JobTypes::get : valid input");
if (iter != m_map.end())
return iter->second;
@@ -170,6 +170,6 @@ public:
Map m_map;
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -4,7 +4,7 @@
#include <chrono>
#include <string>
namespace ripple {
namespace xrpl {
class LoadMonitor;
@@ -65,6 +65,6 @@ private:
std::chrono::steady_clock::duration timeRunning_;
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -8,7 +8,7 @@
#include <chrono>
#include <mutex>
namespace ripple {
namespace xrpl {
// Monitors load levels and response times
@@ -67,6 +67,6 @@ private:
beast::Journal const j_;
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -17,7 +17,7 @@ namespace beast {
class Journal;
}
namespace ripple {
namespace xrpl {
class Application;
namespace perf {
@@ -40,7 +40,7 @@ public:
using microseconds = std::chrono::microseconds;
/**
* Configuration from [perf] section of rippled.cfg.
* Configuration from [perf] section of xrpld.cfg.
*/
struct Setup
{
@@ -187,6 +187,6 @@ measureDurationAndLog(
}
} // namespace perf
} // namespace ripple
} // namespace xrpl
#endif // XRPL_CORE_PERFLOG_H

View File

@@ -10,7 +10,7 @@
#include <string>
#include <thread>
namespace ripple {
namespace xrpl {
namespace perf {
class PerfLog;
@@ -214,6 +214,6 @@ private:
m_paused; // holds just paused workers
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -1,6 +1,6 @@
/**
*
* TODO: Remove ripple::basic_semaphore (and this file) and use
* TODO: Remove xrpl::basic_semaphore (and this file) and use
* std::counting_semaphore.
*
* Background:
@@ -32,7 +32,7 @@
#include <condition_variable>
#include <mutex>
namespace ripple {
namespace xrpl {
template <class Mutex, class CondVar>
class basic_semaphore
@@ -87,6 +87,6 @@ public:
using semaphore = basic_semaphore<std::mutex, std::condition_variable>;
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -4,7 +4,7 @@
#include <string>
#include <vector>
namespace ripple {
namespace xrpl {
class RFC1751
{
@@ -42,6 +42,6 @@ private:
static char const* s_dictionary[];
};
} // namespace ripple
} // namespace xrpl
#endif

View File

@@ -3,7 +3,7 @@
#include <mutex>
namespace ripple {
namespace xrpl {
/** A cryptographically secure random number engine
@@ -70,6 +70,6 @@ public:
csprng_engine&
crypto_prng();
} // namespace ripple
} // namespace xrpl
#endif

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