Are fuel transactions sequentially executed if they share same contract ID as input?

So, from my understanding, a transaction when wanting to use a contract, takes its Contract ID as input.

Now, let’s imagine a contract with ID A.

The state of contract A looks like:

{
  "x": 1,
  "y": 2
}

And two transactions tx_A0, tx_A1, where both of them are going to use contract ID A as their input.

tx_A0 mutates x from A’s state, and tx_A1 mutates y from A’s state.

Now, technically both of them can be processed in parallel as they touch non overlapping state of A, but in the fuel’s model, will they be executed sequentially.

I guess the question can be summarized to:

“If two transactions use the same contract ID as input, will they always be executed sequentially, which means that parallelization in fuel happens only between non-overlapping contract IDs as inputs?”

This has been answered over telegram.

"We parallelize between native assets and per smart contract, not per storage slot. There is only so much parallelism 2-4 cores can give you from the SSD.

So if two transactions touch the same contract they are put on the same thread.

But if two transactions touch different UTXOs, they can be done on separate threads"

1 Like