Commit Graph

14068 Commits

Author SHA1 Message Date
Pratik Mankawde
2fef71f235 Merge branch 'develop' into pratik/test-tsan-and-gcc14-asan 2026-03-19 15:22:43 +00:00
Pratik Mankawde
f13d17165a fix: Switch GCC ASAN to -mcmodel=medium and reduce TSAN build parallelism
- Change -mcmodel=large to -mcmodel=medium for GCC ASAN builds. The large
  model inflates code size with 64-bit absolute addresses, pushing the
  binary past the 2GB limit where GCC's pre-compiled CRT startup code
  (crtstuff.c) can't reach data sections with 32-bit relocations.
  Medium model keeps code compact (CRT-compatible) while allowing data
  beyond 2GB.

- Add nproc_subtract=20 for TSAN builds to reduce build parallelism.
  TSAN instrumentation significantly increases per-compilation-unit memory
  usage, causing OOM on CI runners with high parallelism.

- Plumb nproc_subtract from the CI matrix through to the build workflow
  so individual configurations can control their parallelism.

- Temporarily restrict CI matrix to only the two previously-failing
  configs (gcc-13 asan-ubsan, clang-20 tsan-ubsan) to validate fixes
  without burning CI resources on passing configs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 15:22:23 +00:00
Pratik Mankawde
f2cc697cb4 fix: Suppress Ledger::setValidated data race in TSAN
Add suppression for pre-existing data race on LedgerHeader::validated
(plain bool mutable) between LedgerMaster worker thread and test code.
The flag is monotonic (false→true only), so the race is benign but
technically UB. Proper fix (atomic<bool>) deferred to a follow-up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 14:03:07 +00:00
Pratik Mankawde
7d975cae2f fix: Add LedgerReplay deadlock suppression and fix GCC ASAN linker error
- Suppress lock-order-inversion in LedgerReplayTask/LedgerDeltaAcquire
  (28 TSAN warnings from pre-existing lock ordering issue).
- Add tools.build:cflags to Conan sanitizer profiles so that C
  dependencies (ed25519) are compiled with -mcmodel=large and sanitizer
  flags, fixing the GOTPCREL relocation overflow on GCC ASAN builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 14:00:42 +00:00
Pratik Mankawde
2117959900 fix: Resolve CI levelization and rename check failures
- Revert yield_to.h to use inline preprocessor blocks instead of
  including sanitizers.h, avoiding a levelization loop between
  xrpl.basics and xrpl.beast.
- Restructure XRPL_SANITIZER_ACTIVE fallback in sanitizers.h to avoid
  the #ifndef/#define pattern that the rename check misdetects as an
  include guard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 12:59:54 +00:00
Pratik Mankawde
9dd2ca1e4a fix: Address code review findings for TSAN/ASAN PR
- Fix BasicApp::startIOThreads() member corruption: replace
  while(numberOfThreads_--) with a for loop to preserve the member value.
- Fix Coro.ipp non-sanitizer stack size: increase default from 1MB to 2MB
  to match yield_to.h and prevent stack overflows in deep call chains.
- Remove stale "TSAN deactivated" comment and dead activate_tsan variable
  from CI matrix generator.
- Clarify Application.cpp setup() comment to distinguish io_context threads
  from subsystem-specific threads.
- Use explicit load(std::memory_order_relaxed) at all SHAMap::ledgerSeq_
  read sites for consistency with the atomic store.
- Extract sanitizer detection into XRPL_SANITIZER_ACTIVE macro in
  sanitizers.h, replacing duplicated preprocessor blocks in Coro.ipp
  and yield_to.h.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 12:51:51 +00:00
Pratik Mankawde
9ec3f091f2 fix: Resolve TSAN-detected data races and suppress lock-order-inversion
- Make Journal::Sink::thresh_ atomic to fix data race between
  concurrent log threshold reads (hot path) and writes (RPC/startup)
- Make SHAMap::ledgerSeq_ atomic to fix data race between concurrent
  node fetch reads and ledger acquisition writes
- Suppress known lock-order-inversion between getMasterMutex() and
  RCLConsensus::mutex_ (requires larger lock-ordering redesign)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 12:29:08 +00:00
Pratik Mankawde
d2079574c7 fix: Build Boost.Context with ucontext backend for TSAN builds
TSAN cannot instrument fcontext (assembly) context switches, causing
undefined symbol errors for fiber_activation_record::current(). Add
Conan build options and CMake defines to use the ucontext backend
for TSAN, matching the existing ASAN configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 11:18:14 +00:00
Michael Legleux
6efd31229a fix: Use correct format and event for workflows for release tags (#6554) 2026-03-19 10:23:51 +00:00
Alex Kremer
12954d5392 fix: Address remaining issue after clang-tidy merge (#6582) 2026-03-18 22:41:09 +00:00
Jingchen
b1e5ba0518 feat: Add code generator for transactions and ledger entries (#6443)
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
2026-03-18 21:11:51 +00:00
Mayukha Vadari
d360e7c5b6 refactor: Rename transactor files/classes to match the tx name (#6580) 2026-03-18 19:52:07 +00:00
Ayaz Salikhov
804a351773 ci: Use external action implementation of check-pr-title (#6578) 2026-03-18 18:31:42 +00:00
Ayaz Salikhov
697fb64e8c ci: Don't check PR title for drafts (#6573) 2026-03-18 17:46:27 +00:00
Pratik Mankawde
018fe98696 fix: Add missing ByteUtilities.h include and use coroStackSize constant
- Include ByteUtilities.h in Coro.ipp so megabytes() is declared
- Use coroStackSize constant in coroutine constructor instead of
  hardcoded 1536*1024, enabling sanitizer-aware stack sizing
- Initialize local variable in PropertyStream destructor to satisfy
  clang-tidy cppcoreguidelines-init-variables

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 16:46:18 +00:00
Alex Kremer
57e4cbbcd9 refactor: Add simple clang-tidy readability checks (#6556)
This change enables the following clang-tidy checks:
-  readability-avoid-nested-conditional-operator,
-  readability-avoid-return-with-void-value,
-  readability-braces-around-statements,
-  readability-const-return-type,
-  readability-container-contains,
-  readability-container-size-empty,
-  readability-else-after-return,
-  readability-make-member-function-const,
-  readability-redundant-casting,
-  readability-redundant-inline-specifier,
-  readability-redundant-member-init,
-  readability-redundant-string-init,
-  readability-reference-to-constructed-temporary,
-  readability-static-definition
2026-03-18 16:41:49 +00:00
Pratik Mankawde
cc51d5430b Merge branch 'develop' into pratik/test-tsan-and-gcc14-asan
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-03-18 15:51:58 +00:00
Mayukha Vadari
b92a9a3053 fix: Make assorted NFT fixes (#6566)
This change:
* Removes a set of unnecessary brackets in the initialization of an `std::uint32_t`.
* Fixes a couple of incorrect flags (same value, just wrong variables - so no amendment needed).
2026-03-18 14:47:59 +00:00
Mayukha Vadari
dcaef828b4 refactor: Replace !=/== tesSuccess with using isTesSuccess (#6409)
This change replaces all instances of `<variable> != tesSUCCESS` with `!isTesSuccess(<variable>)` and `<variable> == tesSUCCESS` with `isTesSuccess(<variable>)`.
2026-03-18 14:15:10 +00:00
yinyiqian1
6fbeb04d9e fix: Disallow empty permission list when Delegate object is absent (#6542)
This change fixes delegation:
* If the Delegate object is not present, we should disallow empty permission list in DelegateSet preclaim.
* Empty permission list is only allowed to delete the existing Delegate object.
* In `doApply`, permission list being empty returns `tecINTERNAL`, which should not happen.
2026-03-18 13:39:31 +00:00
Alex Kremer
2a325e7e2c chore: Enable clang-tidy bugprone-use-after-move check (#6476) 2026-03-18 00:12:06 +00:00
Bart
808e814489 ci: Update check-pr-title action hash (#6572) 2026-03-17 23:26:01 +00:00
Copilot
9e14707e77 fix: Peer crawler port field type inconsistency (#6318)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mvadari <8029314+mvadari@users.noreply.github.com>
Co-authored-by: Mayukha Vadari <mvadari@gmail.com>
Co-authored-by: Mayukha Vadari <mvadari@ripple.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
2026-03-17 22:03:56 +00:00
Mayukha Vadari
95a45d7442 chore: Add comment explaining why ammLPHolds is called twice (#6546) 2026-03-17 20:11:36 +00:00
Bart
5fc4ab3e37 ci: Let required runs be triggered by merge group events (#6563)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-03-17 20:03:48 +00:00
tequ
b129b71c33 refactor: Use ReadView instead of ApplyView in authorizedDepositPreauth() (#6560) 2026-03-17 15:56:51 -04:00
tequ
013c2d6a56 refactor: Add const qualifier to SLE in verifyDepositPreauth parameter (#6555) 2026-03-17 19:33:18 +00:00
Alex Kremer
72f4cb097f refactor: Enable remaining clang-tidy cppcoreguidelines checks (#6538) 2026-03-17 19:09:05 +00:00
Michael Legleux
b523770486 fix: Remove nonexistent boost::coroutine2 library (#6561) 2026-03-17 18:46:46 +00:00
Mayukha Vadari
a5185890ff refactor: Remove dead code in escrow helper logic (#6553) 2026-03-17 18:13:08 +00:00
Jingchen
0a9513e7f3 ci: Fix build errors on Windows (#6562) 2026-03-17 13:50:44 -04:00
Mayukha Vadari
78b2d70a11 refactor: Assorted small DID fixes (#6552)
This change:
* Makes `addSLE` in `DIDSet` a static function, instead of a free function.
* Renames `Attestation` to `Data` everywhere (an artifact of a previous name for the field).
* Actually runs a set of tests that were not included in the `run` function of `DID_test`.
2026-03-17 14:44:07 +00:00
Mayukha Vadari
252c6768df refactor: Clean up getFeePayer, mSourceBalance, and mPriorBalance (#6478)
This change:
* Introduces a new helper function on `STTx`, `getFeePayer`.
* Removes the usage of `mSourceBalance` and replaces it with SLE balance lookups.
* Renames `mPriorBalance` to `preFeeBalance_`

This simplifies some of the code in the transactors and makes it a lot more readable.
2026-03-17 14:12:16 +00:00
Pratik Mankawde
5ae97fa8ae refactor: Add no-ASAN macro for Throw statements (#6373)
Throwing exceptions from code sometime confuses ASAN, as it cannot keep track of stack frames. This change therefore adds a macro to skip instrumentation around the `Throw` function.
2026-03-17 13:10:32 +00:00
Pratik Mankawde
eff344faf9 chore: Move sanitizer runtime options out to files (#6371)
This change moves the sanitizer runtime options out to dedicated files, such that they can be used in multiple places (CI, local runs) without any need to rewrite them.
2026-03-17 11:22:49 +00:00
Alex Kremer
7e7b71d84c chore: Fix tests for clang-tidy bugprone-unchecked-optional-access check (#6502) 2026-03-16 19:47:40 -04:00
Bart
ffea3977f0 refactor: Rename system name from 'ripple' to 'xrpld' (#6347)
Per [XLS-0095](https://xls.xrpl.org/xls/XLS-0095-rename-rippled-to-xrpld.html), we are taking steps to rename ripple(d) to xrpl(d). This change modifies the system name from `rippled` to `xrpld`.

The system name is used in limited places:
* When no explicit config file is passed via the `--config` flag, then the system name is used to construct the path where the config file and database may be stored, via the `$XDG_CONFIG_HOME` and `$XDG_DATA_HOME` directories, respectively.
* It is used in the metadata and user-agent as part of RPC calls.
* It is newly used in the full version string.
2026-03-16 21:51:31 +00:00
Alex Kremer
47a235b7be chore: Enable clang-tidy switch-missing-default-case check (#6461) 2026-03-16 17:19:37 -04:00
Alex Kremer
f5e2415c98 chore: Enable clang-tidy check for CRTP constructor accessibility (#6452)
This change enables the `bugprone-crtp-constructor-accessibility` check and fixes the few compilation issues resulting from enabling it.
2026-03-16 20:18:15 +00:00
Mayukha Vadari
1a4c359351 refactor: use hasExpired in CancelCheck (#6533) 2026-03-16 18:14:59 +00:00
Mayukha Vadari
e4dbaf5efc test: Remove testline JTX helper class (#6539)
This change removes the JTX helper class `testline`, which adds the line that made the `env` call, as it is no longer necessary.
2026-03-16 16:28:49 +00:00
Pratik Mankawde
983816248a fix: Switch to boost::coroutine2 (#6372)
ASAN wasn't able to keep track of `boost::coroutine` context switches, and would lead to many false positives being detected. By switching to `boost::coroutine2` and `ucontext`, ASAN is able to know about the context switches advertised by the `boost::fiber` class, which in turn leads to more cleaner ASAN analysis.
2026-03-16 15:34:15 +00:00
Pratik Mankawde
b585dc78bb fix: Fix memory leaks in HTTPClient (#6370)
The `HTTPClient` class initializes a global SSL context via `initializeSSLContext()`. However, it had no way to release it, which caused memory leaks flagged by the LeakSanitizer. Multiple LSAN suppressions in the sanitizers' suppressions file were masking these leaks. Our test code also manually called `initializeSSLContext()` in each test without guaranteed cleanup on failure paths.

This change fixes these memory leaks by adding a `cleanupSSLContext()` method to properly release the global SSL context, and removes the corresponding LSAN suppressions. The change further refactors the `HTTPClient` tests to use a Google Test fixture (`HTTPClientTest`) that manages the SSL context lifecycle via RAII (SetUp/TearDown), making it impossible for tests to leak the context.
2026-03-16 14:12:48 +00:00
Alex Kremer
918185e18f chore: Enable clang-tidy bugprone-unused-return-value check (#6475) 2026-03-16 13:55:22 +00:00
Pratik Mankawde
1738a69619 refactor: Delete SecretKey compare op from library and move it to tests module (#6503)
This change deletes the `SecretKey` equality/inequality operators from the public library header and moves the comparison logic into test-only code.

Specifically, the `operator==` and `operator!=` free functions on `SecretKey` have been removed from `include/xrpl/protocol/SecretKey.h` and have been replaced with explicitly deleted member functions to prevent accidental use in production code. A named `test::equal()` helper has also been added in `src/test/unit_test/utils.h` for test assertions that need to compare secret keys.
2026-03-16 10:55:12 +00:00
Mayukha Vadari
1bf9e6e7da fix: Remove a newline from logging statement in changeSpotPrice calculation (#6547)
This change removes an unnecessary newline in a logging statement. Namely, `std::endl` is unneeded in `JLOG`, since it automatically places a newline at the end of the string.
2026-03-13 18:12:25 +00:00
Bronek Kozicki
0446bef7e5 feat: Enforce feature name lengths and character set (#5555)
This change enforces a maximum length of 63 characters on feature names, as well as not permitting an exactly 32 character long feature name to avoid confusion with those that use a `uint256` hex representation, as that is an alternative way to specify a feature. This change further prevents the use of Unicode characters in feature names, because some can be confused with regular ASCII characters despite being valid in identifiers.
2026-03-13 13:41:50 -04:00
Mayukha Vadari
7a3bf1692d refactor: Simplify set/get field call to use existing variable (#6534)
The `setFieldU32` call is currently used to set the credential's expiry using a `getFieldU32` call to obtain the expiration time. However, that value was already obtained previously and can thus be reused.
2026-03-13 13:53:44 +00:00
Vito Tumas
c1d108e565 docs: Improve documentation for InvariantCheck (#6518) 2026-03-12 21:50:35 +00:00
Mayukha Vadari
1ba1bf9ade chore: Fix typo in freezeHandling parameter name (#6543) 2026-03-12 21:24:38 +00:00