Skip to content

Conversation

@ximinez
Copy link
Collaborator

@ximinez ximinez commented Nov 12, 2025

Still in progress....

This work is on hold in favor of the solution in #6000.
If successful, this will supersede #6000.

  • Update the conversion points between Number and *Amount & STNumber.
  • Tests probably don't pass.

High Level Overview of Change

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@ximinez ximinez force-pushed the ximinez/lending-number-simple branch from 5cd623f to 4abb6d9 Compare November 13, 2025 05:52
@ximinez ximinez added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Nov 13, 2025
- Field will be absent in RPC results instead of returning 0.
…number-simple

* upstream/develop:
  chore: Clean up incorrect comments (6031)
  refactor: Retire MultiSignReserve and ExpandedSignerList amendments (5981)
@ximinez ximinez force-pushed the ximinez/lending-number-simple branch from b1079c5 to 9310991 Compare November 14, 2025 23:51
- Nothing really needed to be changed in the tests, but I added a couple
  of test cases for the min and max int64.
@ximinez ximinez force-pushed the ximinez/lending-number-simple branch from b17225c to c9ad49f Compare November 15, 2025 00:41
- Added test cases min int64.
- Updated numberFromJson range checking to use the larger range
  available from Number.
- Default Number outside of transaction processing to be "large" so RPC
  will work.
@ximinez ximinez mentioned this pull request Nov 16, 2025
13 tasks
@ximinez ximinez force-pushed the ximinez/lending-number-simple branch from 470c9c3 to 248d267 Compare November 16, 2025 18:10
@ximinez ximinez force-pushed the ximinez/lending-number-simple branch from 248d267 to 470c9c3 Compare November 16, 2025 22:22
Copy link
Collaborator

@Bronek Bronek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls fix compilation errors because several functions are no longer constexpr

Number::lowest() noexcept
{
return -Number{maxMantissa, maxExponent, unchecked{}};
return -Number{range_.get().max, maxExponent, unchecked{}};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is no longer constexpr because it reads from static thread_local range_

Number::max() noexcept
{
return Number{maxMantissa, maxExponent, unchecked{}};
return Number{range_.get().max, maxExponent, unchecked{}};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is no longer constexpr because it reads from static thread_local range_

Number::min() noexcept
{
return Number{minMantissa, minExponent, unchecked{}};
return Number{range_.get().min, minExponent, unchecked{}};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is no longer constexpr because it reads from static thread_local range_

inline constexpr bool
Number::isnormal() const noexcept
{
MantissaRange const& range = range_;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is no longer constexpr because it reads from static thread_local range_

*this = y;
return *this;
}
XRPL_ASSERT(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assert fails in AMM unit tests

ripple.app.AMM Basic Payment
rippled: ../src/libxrpl/basics/Number.cpp:451: ripple::Number& ripple::Number::operator*=(const ripple::Number&): Assertion `("ripple::Number::operator*=(Number) : is normal") && (isnormal() && y.isnormal())' failed.
[1]    364083 IOT instruction (core dumped)  ./rippled -u AMM

@kennyzlei kennyzlei removed the request for review from shawnxie999 November 17, 2025 19:12
@ximinez ximinez removed the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants