-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perform fee padding in a larger bit width of integers #70
Conversation
Would be great to add a test to catch the overflow too. |
4fa28eb
to
9102902
Compare
@dmkozh @leighmcculloch please have another look! The logic is still the same but it should be easier to read:
And the tests should reflect checks to these three steps. |
876596d
to
459c42f
Compare
Hey guys, could you please explain some details why fee should fit 32 bits? Why: with soroban 20.3.1 I tried to call |
Hi @mn13 ! Thanks for reporting your problem. However, could you please create a separate ticket for it? Thanks! |
The 32-bit size is limited by the protocol, so any change to the size is a protocol change for the Stellar network itself, and not just a change to the rpc, or another tool. @mn13 The best place to discuss possible protocol changes is currently over on the stellar-protocol repo's discussion form, if you'd like to open an issue there: https://github.com/stellar/stellar-protocol/discussions |
What
Modify fee calculation to use 64-bit integers + tests for overflow.
Why
In situations where the resource fee padding causes the transaction fee to exceed its maximum value, it will overflow and create an invalid transaction, instead (i.e. one where the transaction fee is lower than the resource fee).
This code ensures that the padding is done in a higher bit width (i.e. with a
u64
) and then cast down to au32
.Known limitations
soroban-spec-tools
dependency and remove all Soroban CLI references #68.