-
Notifications
You must be signed in to change notification settings - Fork 51
[M-03] - Checked Fixed-Point Helpers Revert on Intermediate I256 Overflow #530
Copy link
Copy link
Open
Labels
Description
checked_mul_div_floorandchecked_mul_div_ceilare not returningNonefor overflows, only forDivisionByZerocase. This is because of the internal API we use fori256provided bysoroban_sdklacks thecheckedversions ofmul,div,rem_euclid, etc.soroban_sdkusesi256_mul,i256_rem_euclid, etc. in their code, which returns aResult. We could use these, and map the typeResultintoOption, but that was also impossible, because these functions, and their arguments (which requirei256Valtype) are private, making it impossible us to use them.- Even if we could use these internal functions, the DevX of our code will be hindered, since their API is not suited for external use.
- Best option is, to submit an issue to
soroban_sdkrepository for this, and wait for them (and help if we can) to expose thecheckedvariants of these above-mentioned functions. - When
soroban_sdkcan expose thecheckedversions of themul,div, etc. we can just replace them, and the fix should be complete.
Here is the issue created at soroban_sdk repo: stellar/rs-soroban-sdk#1659
Reactions are currently unavailable