FuelLabs / fuels-rs

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

Gas estimation exits prematurely due to `msg_sender` failure over fake-input #1365

Closed segfault-magnet closed 2 months ago

segfault-magnet commented 2 months ago

@SwayStar123 reported an issue where he kept getting OutOfGas. After some debugging it turned out to be due to the fake input we add when we estimate gas usage. When we add that coin that causes msg_sender (fn in std sway) to fail because it checks whether all inputs belong to the same owner. In our case the fake coin belonged to a different owner causing the issue.

Since we cannot do without the fake input in cases where there is no other base asset in the tx inputs, at least we can fix the code so that we aren't the one to cause msg_sender to fail.