Skip to content

Commit

Permalink
fix md lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhaiwat10 committed Dec 24, 2024
1 parent 76b97dd commit 85f738f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/docs/src/guide/contracts/optimising-contract-calls.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ When you call a contract function via the SDK, it makes two essential network re

The below flowchart shows this entire process:

![Transaction Lifecycle in the SDK without prefetching](/public/txdep1.png)
![Transaction Lifecycle in the SDK without prefetching](../../public/txdep1.png)

The SDK will prepare the contract call _after_ the user has submitted the transaction at the application level. This is so the transaction is funded in it's finalised state. However this makes the chain feel slower than it actually is as we are making two network requests.

This can be mitigated by preparing the contract call _before_ the user submits the transaction. If the transaction is prepared beforehand, the SDK only has to send the transaction to the network and wait for it to be confirmed. This reflects the actual speed of the chain to the user.

You can experience this yourself by trying out this [demo](https://fuel-wallet-prefetch-experiment-75ug.vercel.app/).

![Transaction Lifecycle in the SDK with prefetching](/public/txdep2.png)
![Transaction Lifecycle in the SDK with prefetching](../../public/txdep2.png)

Because of the massive performance gains, we recommend this strategy for all contract calls.

Expand Down

0 comments on commit 85f738f

Please sign in to comment.