sui_devInspectMoveCall vs execution_mode DevInspect on sui_moveCall?

As per the subject, I get the sui_devInspectMoveCall but what is the effect of setting execution_mode to “DevInspect” in sui_moveCall?

24 Likes

So in discord back and forth:
So, a bit confused:

  1. sui_devInspectTransaction → so this can do some evaluation on non-entry functions
  2. sui_devInspectMoveCall → is only really good for entry functions, but sui_devInspectTransaction works there as well.
  3. sui_moveCall with execution_mode is questionable as to it’s usefulness? But…What was the intent?

The last point is being looked into :slight_smile:

16 Likes

Can share a bit of an update on this that I heard back from the team. The way these are intended to be used is as follows:

  • If you want to dev inspect any transaction, you need to use one of the pre-existing calls to create the transaction bytes, for MoveCall that is sui_moveCall, and you should set the execution mode to DevInspect at this stage if that’s your intention – this is what opens up the ability to evaluate non-entry functions, etc.
  • Then these transaction bytes get sent to sui_devInspectTransaction, to get the DevInspectResult.
  • sui_devInspectMoveCall is similar to running those two operations (sui_moveCall + sui_devInspectTransaction), but (a) its fused together into one RPC call, and (b) it allows running the transaction without supplying a gas object or budget.

So to estimate gas fees sui_devInspectMoveCall is the most appropriate, but a follow-up I have with the team is essentially why move calls are special when it comes to supporting dev-inspect without supplying gas.

8 Likes

Thanks, this certainly makes sense to me now. I appreciate the run-down, as always!

7 Likes

One more update, based on this thread we decided to get rid of sui_devInspectMoveCall and transfer its special powers over to sui_devInspectTransaction.

We expect the change to land in v0.24.0, and it means that any transaction that you run with sui_devInspectTransaction can be run without supplying a gas object or setting a budget, making it much more feasible to use this endpoint for gas estimation.

Relevant PR:

6 Likes