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
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.