ProofOfThought

Why Solana Transactions Can Conflict When They Use the Same Account.

Why Solana Transactions Can Conflict When They Use the Same Account.

Solana allows executing numerous transactions in parallel. The core of such an architecture is its account structure. Every transaction contains the list of accounts used by it and specifies whether it uses accounts for reading or modification. This approach allows validators to find out which transactions may be executed together. citeturn196507search1

A situation arises where multiple transactions want to update the same account. Let us consider the example of two users who are trading tokens in a pool on a decentralised exchange. Both transactions can require updating of the same shared data from a pool. In case there is no way to control this process, both operations may conflict each other.

Such conflicts are solved by Solana by using account locking and scheduling. The process of modifying an account is possible only with exclusive access. Thus, two transactions, that have conflicting write access to the same account, cannot be executed simultaneously and must be controlled properly.

It does not mean that every transaction that uses the same account fails. Shared writable account only limits the process of parallel transactions processing.

Since there are no conflicts in accessing accounts, Solana is able to process transactions in parallel. The more the transactions have no conflict of reading the data and writing to the separate writable accounts, the more chances there are for parallel transactions.

And that is why proper account design is significant. It is often possible to distribute application data between several accounts instead of using one common account for all updates. An application may have separate market data in separate accounts so that working in one market would not require changing the state of the other market at all. citeturn196507search8

But there are cases when separating accounts is impossible. Sometimes an operation really requires some shared data like shared pool balance or a common counter. In this case, there is still a need for coordination to get correct results.

And the main idea is that the Solana performance depends, in part, not just on the network performance but also on the way how the transactions access data.

So for the developers it is important to detect commonly shared writable accounts.

How do you rate this article?

4


ProofOfThought
ProofOfThought

Just someone curious about crypto and the future of finance. I write about Bitcoin, blockchain, investing, and the lessons I've learned along the way. No hype, just honest opinions and real conversations.


ProofOfThought
ProofOfThought

Honest thoughts on Bitcoin, crypto, and investing. No hype, no unrealistic predictions just simple ideas, market insights, and lessons from the journey.

Publish0x Publish0x

Reward the author with $0.01 in crypto, and earn yourself as you read!

20% to author / 80% to me.
Rewards are FREE. Publish0x pays them, not you.

Page not displaying correctly?