Open Torres-ssf opened 6 months ago
Related (same?):
Does this still need to be fixed after #1767 ?
@Dhaiwat10 If I am not mistaken, for this one we are waiting for a possible update on fuel-core
that will include on the dryRun
response the amount of OutputVariables
required by a TX when calling dryRun
.
@Torres-ssf Did we communicate this need to someone?
Ideally, we should mark this issue as blocked and add a link here to another issue on the fuel-core
repo.
@arboleya @Dhaiwat10 I reckon this issue is blocked by https://github.com/FuelLabs/fuel-vm/issues/691
It seems the plan to implement this is only after mainnet.
That was the missing issue, then.
Thanks for pointing that out.
Based on the issue's proposed changes (specifically "Discontinue automatic addition of OutputVariable
"), this doesn't seem like blocked. This issue is concerned with not running transaction dependency estimation by default anymore, whereas the linked fuel-vm issue - if I understood it correctly - is concerned with getting all the dependencies in one call instead of requiring multiple calls:
The FuelVM may support dry run mode, in which all validity rules will not abort the execution immediately. Instead, we will keep a record of what rules are failing and provide feedback at the end of the execution with all problems.
We can already make dependency estimation and opt-in thing, it'd just break the apps of our consumers that didn't specify the appropriate outputs.
@nedsalk This is blocked.
The desired behavior, as outlined in this issue, is for the dry-run to indicate the number of variable outputs required for the transaction to be processed.
Implementing this feature will eliminate the need for multiple dry-runs to determine the necessary outputs.
We cannot expect users to always provide the correct number of variable outputs, especially for complex transactions involving multiple parties ( wallet connectors ).
The
estimateTxDependencies
automates the addition of missing OutputVariables, essential for Sway's transfer or mint functions.With this, users don't need to specify the
variableOutputs
parameter:How it works:
Revert
withval
equal toTransferToAddressFailed
. This error indicates a missingOutputVariable
.Revert
receipt is detected, anOutputVariable
is added, and another dry run is executed. This loop continues until no related revert receipt is found.Consider a contract call minting assets to 3 addresses:
Outcome:
OutputVariable
Proposed change:
OutputVariable
OutputVariable
in the SDK documentation.OutputVariable
is missingRelated: