This one failed to explain how contract calls are executed - is it by a single node, by multiple nodes, do nodes compete with each other for the execution, what's their incentive, etc.
This one failed to explain how contract calls are executed - is it by a single node, by multiple nodes, do nodes compete with each other for the execution, what's their incentive, etc.
Contract call can be broken down into 2 categories: state changing vs read-only.
If its a state changing contract call, it will be executed by every node on the network. In this case its considered a transaction. This transaction has to be mined in a block and cost ether. The new state will be stored on the blockchain only after the transaction has been succesfully mined.
The other kind of method call is read-only. Its free, ,is executed only by a single node, and does not alter the blockchain state.
Contract calls are executed by every node on the network -- if you've heard of "embarrassingly parallel", Ethereum is "embarrassingly serial". That is, every function call, on every contract, is run by every (full) node on the network.
The calls are deterministic which means that the nodes can verify that their peers calculated the outcome correctly and didn't try to cheat.
It sounds expensive (and it is) but that's the (current) cost of decentralized, trustless computation.
When you view it like that it's obviously very costly to execute code & store outputs, so alternative solutions are needed for lower value code. Breakthroughs in these areas could make Ethereum a viable platform for computing, and it honestly feels like we could be entering a new computing paradigm with it.
Ethereum contracts are executed everywhere that the blockchain is downloaded and verified. They are deterministic, so every execution should return the same result.
And they will all update the contract state onto their own blockchain then broadcast the result and compete via proof of work.