FuelLabs / fuels-rs

Fuel Network Rust SDK
https://fuellabs.github.io/fuels-rs
Apache License 2.0
44.27k stars 1.34k forks source link

max fee tolerance is not reflected when covering with base asset #1463

Closed segfault-magnet closed 1 month ago

segfault-magnet commented 1 month ago

original issue introducing max fee tolerance

When the above issue's PR got merged it didn't adapt the adjust for fee that also relied on the max fee of the transaction.

This can cause edge case issues where we set the max fee to X while we only cover 95%X. This doesn't happen often since inputs are often bigger than 5% of the requested funds.

We should fix this since the specs state that setting the max fee to more than what is available to the tx (outputs - inputs) is an error.