FuelLabs / fuels-rs

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

Revert OutOfGas error when using the produce_blocks function in the provider to go forward in time #1437

Open calldelegation opened 3 weeks ago

calldelegation commented 3 weeks ago

The bug happens when trying to go forward in time using the provider.produce_blocks function After doing that, the calls performed to the same contract fail with a Revert OutOfGas error

This issue was found by the protofire team

Repository to reproduce the bug https://github.com/0xLucca/fuels-bug

Rcontre360 commented 6 days ago

Hi! is there any progress with this?

Br1ght0ne commented 4 days ago

Reproduced on both fuels 0.62 and fuels 0.64, looking into it.

Br1ght0ne commented 1 day ago

Seems like adding an explicit gas limit with TxPolicies allows the test to pass:

@@ -85,7 +85,7 @@ async fn bug_occurs_when_time_is_incremented() {
     // Now that the time has passed, we should be able to execute the action
     let result = contract_caller
         .contract
-        .methods().execute_some_action().call_params(params).unwrap().call().await;
+        .methods().execute_some_action().with_tx_policies(TxPolicies::default().with_script_gas_limit(2_000)).call_params(params).unwrap().call().await;

     // But it reverts with OutOfGas error
     println!("{:?}", result);