mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 00:36:48 +00:00
* XRPLF/develop: (30 commits) chore: Pin Python packages for codegen using uv (7329) style: Use shfmt instead of bashate (7326) fix: Fix edge-case where vault-depositor may get stuck (7139) fix: Fix `VaultInvariant` and `VaultDeposit` precision bugs at IOU scale boundaries (7272) ci: Add clang to nix images (7308) fix: Include management-fee delta in doOverpayment assertion (7039) fix: Fix clang-tidy pre-commit hook to locate compile_commands.json from repo root (7325) fix: Use consistent scale for `debtTotal` (7093) fix: Skip deleted book directories and non-root modifications in `ValidBookDirectory` invariant (7312) fix: Address review feedback on FD/handle guarding (5823 follow-up) (7310) fix: Fix non-canonical MPT amount (7117) release: Bump version to 3.2.0-b7 (7316) fix: Check if the MPT first loss cover can be sent to the broker before deleting the broker (7125) fix: Fix RPM prerelease ordering and start xrpld on DEB install (7313) ci: Re-enable full nproc for Linux (7315) fix: Add assorted MPT/DEX fixes (7040) refactor: Remove dead `fetchBatch` code (7309) release: Bump version to 3.2.0-b6 (7311) chore: Revert graceful peer disconnection and follow-up fix (7296) fix: Fix IOU precision issues in LoanBrokerCover transactions (7274) ...
Basics
Utility functions and classes.
The module xrpl/basics should contain no dependencies on other modules.
Choosing an xrpld container.
-
std::vector- For ordered containers with most insertions or erases at the end.
-
std::deque- For ordered containers with most insertions or erases at the start or end.
-
std::list- For ordered containers with inserts and erases to the middle.
- For containers with iterators stable over insert and erase.
- Generally slower and bigger than
std::vectororstd::dequeexcept for those cases.
-
std::set- For sorted containers.
-
xrpl::hash_set- Where inserts and contains need to be O(1).
- For "small" sets,
std::setmight be faster and smaller.
-
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
The following container is deprecated
std::unordered_set- Use
xrpl::hash_setinstead, which uses a better hashing algorithm. - Or use
xrpl::hardened_hash_setto prevent algorithmic complexity attacks.