mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-28 09:30:34 +00:00
* XRPLF/develop: (99 commits) refactor: Clean up tec object deletion logic (6588) fix: Move AMMInvariant weakInvariantCheck logic into the transaction (7032) fix: Improve ValidAMM invariant (7295) feat: Remove clear mutable flags for DynamicMPT XLS-94 (7439) ci: Build and push docker images in forks too (7588) ci: [DEPENDABOT] bump actions/checkout from 6.0.3 to 7.0.0 (7585) fix: Ensure xrpld service directories exist at startup (7565) fix: Use template for granular delegation permissions (6613) docs: Fix some comments to improve readability (7405) ci: Disable assertions on Release builds (7443) build: Add graphviz to Nix images (7566) refactor: Rerevert "Explicitly trim the heap after cache sweeps (6022)" release: Bump version to 3.3.0-b0 ci: Make clang-tidy workflow adjustments to stay in sync with Clio (7563) build: Add git-lfs to Nix images (7561) build: Add zip to Nix images (7551) docs: Rewrite build environment docs (7533) release: Bump version to 3.2.0 ci: [DEPENDABOT] bump codecov/codecov-action from 6.0.1 to 7.0.0 (7426) release: Bump version to 3.2.0-rc6 ...
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.