Parallel execution

Learn how to speed up your transaction in EVM / WASM

Intro

Klyntar was created to implement best practices. That is why parallel transaction execution is one of the steps of multilevel sharding.

Currently, parallel transaction execution is supported for:

Transaction typeDescriptionImplementation status

TX

Default address to address coins transfer

WVM_DEPLOY

Contract deployment to WASM vm

WVM_CALL

Call smart-contract in WASM vm

EVM_CALL

Interaction with EVM(default transfer, contract interaction)

How

After you have studied the process of sending transactions - you might have noticed that the transaction contains a payload.

So - in order to make your transaction run in parallel, you need to add the touchedAccounts field to the transaction payload. This is an array that contains the IDs of the accounts that will be changed within the transactions.

const payload = {

    to: "recipient",

    amount: 13.37,

    touchedAccounts:["sender account", "recipient account"]

};

For example - here is what you need to add to the array for different types of transactions

Transaction typeWhat to add to array

TX

[creator, payload.to]

WVM_DEPLOY

[creator]

WVM_CALL

[creator, contractID, ....(all contracts addresses in case of internal calls)]

EVM_CALL

[from, to, ....(all contracts addresses in case of internal calls)]

This is example of parallel transaction:

And this transaction is not parallel - it was executed in a sync way

Parallel execution for native transactions and WASM vm

Parallel execution for EVM

Last updated