Let's try this again#712
Open
a-noni-mousse wants to merge 25 commits intoXahau:devfrom
Open
Conversation
- Fix unlikely edge case in setCurrentThreadName
setCurrentThreadName accepts a std::string_view parameter, which is
not guaranteed to include a null terminator, which it then forwards
to OS-specific APIs that expect null-terminated C strings.
- Fix several compilation warnings
- Fix header includes
- Fix unnecessarily verbose logging
- Simplify code using inline lambdas instead of std::bind
- Modernize the Beast "lexical cast" framework
- Use boost::asio types instead of legacy Beast type wrappers
- Clean up LogicError, custom exception throwing and termination handling
- Clean up and modernize PublicKey, SecretKey and Seed
Simplify construction, buffer iteration and comparisons by leveraging
modern C++ features.
- Clean up and modernize RFC1751 code
Turn static-member-only class into namespace, thin out the public API
and make code noexcept and constexpr. Verify internal data at compile
time.
- Clean up CSPRNG engine
- Clean up rngfill function, eliminating GCC false-positive warning.
- Improve Slice comparison using C++ operator<=> and operator synthesis.
- Add function-based spinlock API - Properly use compare_exchange_strong for try_lock - Improve comments Co-authored-by: Nikolaos D. Bougalis <nikb@bougalis.net>
- Improve the slab allocator public interfaces - Support construction of slab allocators at compile time - Improve declaration of slab allocators - Reduce impact of thrashing around slab boundaries - Reduce overhead of locking and increase parallelization Co-authored-by: Nikolaos D. Bougalis <nikb@bougalis.net>
Remove unused dynamic thread count adjustment and reduce indirection layers. Retains lock-free design while improving code clarity and reducing internal latency. Co-authored-by: Nikolaos D. Bougalis <nikb@bougalis.net> Co-authored-by: Chenna Keshava B S <ckbs.keshava56@gmail.com>
This commit cleans up and modernizes the JobQueue but does not change the queueing logic. It focuses on simplifying the code by eliminating awkward code constructs, like "invalid jobs" and the need for default constructors. It leverages modern C++ to initialize tables and data structures at compile time and replaces `std:map` instances with directly indexed arrays. Lastly, it restructures the load tracking infrastructure and reduces the need for dynamic memory allocations by supporting move semantics and value types. Co-authored-by: Nikolaos D. Bougalis <nikb@bougalis.net>
This commit makes several changes to the base_uint class, which was originally taken from Bitcoin and has already been heavily modified by Ripple engineers. It introduces conditional widening of the internal limb type, going from 32 to 64 bits if the requested number of bits is a multiple of 64. This change alone halves iteration counts for common operations and, combined with use of add-with-carry compiler intrinsics, helps leverage modern processor resources more effectively. Other changes include: - Extracting the arithmetic operations into free helper functions which operate on the limb array directly. - Replacing the SFINAE-based is_contiguous_container trait with a byte_copy_source concept. - Rewriting the hex parsing around a consteval lookup table and a simple left-to-right loop, replacing the old shift-based nibble accumulator. - Using memmove instead of memcpy when copying to avoid UB in the unlikely case where the source and destination buffers overlap. - Eliminating a workaround in operator<=> to handle MacOS quirks. - Removing redundant parseHex overloads and introducing from_hex as a factory function. - Introducing a tagless_compare() for cross-tag comparison. - Adding noexcept, [[nodiscard]], and constexpr throughout.
Sync: Ripple(d) 2.4.0
* Add AMM bid/create/deposit/swap/withdraw/vote invariants:
- Deposit, Withdrawal invariants: `sqrt(asset1Balance * asset2Balance) >= LPTokens`.
- Bid: `sqrt(asset1Balance * asset2Balance) > LPTokens` and the pool balances don't change.
- Create: `sqrt(asset1Balance * assetBalance2) == LPTokens`.
- Swap: `asset1BalanceAfter * asset2BalanceAfter >= asset1BalanceBefore * asset2BalanceBefore`
and `LPTokens` don't change.
- Vote: `LPTokens` and pool balances don't change.
- All AMM and swap transactions: amounts and tokens are greater than zero, except on withdrawal if all tokens
are withdrawn.
* Add AMM deposit and withdraw rounding to ensure AMM invariant:
- On deposit, tokens out are rounded downward and deposit amount is rounded upward.
- On withdrawal, tokens in are rounded upward and withdrawal amount is rounded downward.
* Add Order Book Offer invariant to verify consumed amounts. Consumed amounts are less than the offer.
* Fix Bid validation. `AuthAccount` can't have duplicate accounts or the submitter account.
Due to rounding, the LPTokenBalance of the last LP might not match the LP's trustline balance. This was fixed for `AMMWithdraw` in `fixAMMv1_1` by adjusting the LPTokenBalance to be the same as the trustline balance. Since `AMMClawback` is also performing a withdrawal, we need to adjust LPTokenBalance as well in `AMMClawback.` This change includes: 1. Refactored `verifyAndAdjustLPTokenBalance` function in `AMMUtils`, which both`AMMWithdraw` and `AMMClawback` call to adjust LPTokenBalance. 2. Added the unit test `testLastHolderLPTokenBalance` to test the scenario. 3. Modify the existing unit tests for `fixAMMClawbackRounding`.
Collaborator
|
Do you know where these commits stand vis a vis 2.5 ? |
Contributor
Author
I'd expect some conflicts. The repos have diverged enough that I think upstream pulls don't make sense anymore. The gains (DID, cross-chain) aren't worth the integration cost. |
Backport of XRPLF/rippled#6325. The python version runs ~80x faster.
…gparse" This reverts commit 5c1d7d9.
Contributor
Author
|
I must admit that I am a bit confused about the merge commits and the state of this branch as well as the process by which a PR gets merged. Can someone explain? Also, I think it's best for me to resbumit these as more limited pull requests which are tighter in scope for better review, so I will close this, unless @RichardAH things its ok. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This brings back some of the proposed changes from #665:
The most significant new change included here involves
base_uintwhich now uses 64-bit unsigned integers as the limb type when the requested number of bits is a multiple of 64, which improves performance on modern processors.The changes to the Json code from 665 aren't included here and will come in a separate commit, after these changes are merged.