0

Assume we have two transactions A and B which are put into a block by a miner (first A then B). Will both transactions be executed with the state of the previous block or will transaction B be executed with the state resulting from the execution of A?

2 Answers 2

0

Ethereum is single-threaded. Any opcode in any contract is executed sequentially. The answer to your question is that transaction B is executed with the state as per the changes applied by transaction A.

The reason the EVM (v1) has been architected this way is that otherwise concurrent state-updates would result in non-deterministic behavior. You need sharding to fix that, and that is coming in Ethereum 2.0.

1

Transaction B be executed with the state resulting from the execution of A.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.