# Transactions that touch the same contract are never parallelized, are they?

**URL:** https://forum.fuel.network/t/transactions-that-touch-the-same-contract-are-never-parallelized-are-they/3073
**Category:** Fuel Network
**Created:** [September 12, 2023, 12:10pm UTC](https://forum.fuel.network/t/transactions-that-touch-the-same-contract-are-never-parallelized-are-they/3073 "2023-09-12T12:10:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![prberg](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/prberg/32/1612_2.png) [@prberg](https://forum.fuel.network/u/prberg)
#### Post date: [September 12, 2023, 12:10pm UTC](https://forum.fuel.network/t/transactions-that-touch-the-same-contract-are-never-parallelized-are-they/3073/1 "2023-09-12T12:10:39Z")

</div>

I’m trying to wrap my head around how parallelization works in Fuel.

I understand that the [contract id](https://specs.fuel.network/master/identifiers/contract-id.html) is permanent, and that this is the [only property](https://specs.fuel.network/master/tx-format/input.html#inputcontract) over which users sign transactions ( `txID` , `outputIndex` , `balanceRoot` , `stateRoot` , and `txPointer` are initialized to zero).

But how does parallelization work in this case? Suppose you have a contract Foo, two users Alice and Bob, and two transactions like this:

1. Alice sends a tx to Foo
2. Bob sends ax to Foo

These transactions will necessarily have to run on the same thread, won’t they?

---

<div class="post-metadata">

### Author: ![sandusky](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sandusky/32/1313_2.png) [@sandusky](https://forum.fuel.network/u/sandusky)
#### Post date: [September 12, 2023, 3:00pm UTC](https://forum.fuel.network/t/transactions-that-touch-the-same-contract-are-never-parallelized-are-they/3073/2 "2023-09-12T15:00:43Z")

</div>

Hi there!  
I think [this section](https://specs.fuel.network/master/protocol/tx-validity.html#access-lists) of the spec might help you to grasp around it.

As seen in the spec, values such as _txID, outputIndex_ are set after the _base sanity checks_  
.

Let me know if you need further explanation! 🌴

---

<div class="post-metadata">

### Author: ![david](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/david/32/32_2.png) [@david](https://forum.fuel.network/u/david)
#### Post date: [September 12, 2023, 4:21pm UTC](https://forum.fuel.network/t/transactions-that-touch-the-same-contract-are-never-parallelized-are-they/3073/3 "2023-09-12T16:21:12Z")

</div>

Key part of the link @sandusky shared is this:

> The validity rules below assume sequential transaction validation for side effects (i.e. state changes). However, by construction, transactions with disjoint write access lists can be validated in parallel, including with overlapping read-only access lists. Transactions with overlapping write access lists must be validated and placed in blocks in topological order.

So in the example you sent, you’re correct that the two transactions would have to be executed in serial.

This is one reason Fuel uses native assets: so that asset transfers can be processed in parallel, and don’t require access to the contract that minted them.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/5/57d5a345cc15a64b636e0d56e042857f8a0e80b1.png) [@system](https://forum.fuel.network/u/system)
#### Post date: [October 3, 2023, 12:21pm UTC](https://forum.fuel.network/t/transactions-that-touch-the-same-contract-are-never-parallelized-are-they/3073/4 "2023-10-03T12:21:31Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
