XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.48k stars 1.45k forks source link

Fix sidechain reward share rounding with new number class #4933

Closed seelabs closed 3 months ago

seelabs commented 4 months ago

High Level Overview of Change

When calculating reward shares, the amount should always be rounded down. If the fixUniversalNumber amendment is not active, this works correctly. If it is not active, then the amount is incorrectly rounded up. This patch introduces an amendment so it will be rounded down.

Type of Change

seelabs commented 4 months ago

Note: only the top commit needs to be reviewed. The other commit fixes a compile issue for gcc 13 that I need to compile locally.

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 75.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.96%. Comparing base (cea4309) to head (043faa1).

Files Patch % Lines
src/ripple/app/tx/impl/XChainBridge.cpp 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #4933 +/- ## =========================================== - Coverage 76.98% 76.96% -0.02% =========================================== Files 1129 1129 Lines 131869 131873 +4 Branches 39616 39713 +97 =========================================== - Hits 101513 101501 -12 - Misses 24463 24524 +61 + Partials 5893 5848 -45 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sgramkumar commented 4 months ago

Integration tests passed with this fix :+1: