mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
* XRPLF/develop: ci: Rewrite clang-tidy workflow(s) in a reusable manner (7062) chore: Ignore identifier-naming update in git blame (7066) refactor: Enable clang-tidy `readability-identifier-naming` check (6571) refactor: Revert certain `Throw`s by `LogicError`s (7036) ci: Rename print-env -> print-build-env (7061) fix: Gate -mcmodel flags to x86_64 in sanitizer builds (7049) fix: Prevents overwriting a bool value in an invariant (6609) fix: Address code review comments regarding `boost::coroutine2` (6977) refactor: Apply various minor improvements and corrections (7045) fix: Store `Delegate` object in delegating and authorized account directories for proper deletion (6681) ci: Use print-env from XRPLF/actions (7052) fix: Make assorted RPC fixes (6529) chore: Enable clang-tidy v21 new checks (7031) feat: Create new transaction testing framework `TxTest` (6537) feat: Add cleanup amendment for 3.2.0 (7037) fix: Fix ubsan flagged issues (6151)
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.