The transaction and smart contract code is re-run by every validating node upon receipt of the block. Wouldn't this occur a contract to run multiple times?
How does this execution work without duplicating the transactions in a contract?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityYou're right that each transaction is executed by every validating node. However, they don't do this sequentially like you suggest, but rather in parallel and independently from each other. All (honest) nodes start at the same pre-state and consequently arrive at the same post-state. That's why it's called validating--they validate that the result they get from their peers is correct.