2

which nodes have ethereum vm? I have read that nodes with evms run the transactions and check if they all got the same result. How do they sync and compare their results?

2

which nodes have ethereum vm?

All clients run the EVM. (So I think that basically means "all nodes", including light nodes.)

I have read that nodes with evms run the transactions and check if they all got the same result.

When a node receives a new block, it will validate the state transitions associated with each transaction. If the transactions can't be applied to the state stored by a given node, the block will be rejected as invalid. So if a mining node created a new block with invalid transactions, the rest of the network would (should) reject it.

How do they sync and compare their results?

They don't compare their results directly, but rely on consensus mechanisms. If everyone is playing by the rules, then all nodes should reject invalid blocks when they receive them. There is an implicit assumption that all nodes do this. In which case, there's an implicit assumption that everyone has the same view of the world.

The complications arise when two or more mining nodes create different but valid blocks, and propagate them to the network. If this happens, part of the network will have one view of the world, and another part of the network will have another view. Both of them valid. This is a chain fork. At this point, the consensus algorithms work their magic1 to reconcile the differences between the two forks of the chain, ultimately leading to one fork being marked invalid.

1 What is the exact "longest chain" rule implemented in the Ethereum "Homestead" protocol?

  • why do mine nodes and light nodes have evms? what do they run? – adi Apr 18 '18 at 21:43
  • 1
    As explained in one of your other questions, when a new block is received it must be verified. To do this, the transactions must be replayed and checked that they equate to valid state transitions, and to do that requires the EVM. – Richard Horrocks Apr 18 '18 at 21:48
  • (I think light nodes only validate certain parts of the block header, and I'm not entirely sure if this requires the EVM or not. Probably not, but it's possible to use the same client as both a full node and light node, so the EVM is definitely in there somewhere, even if it's not being used for each incoming block.) – Richard Horrocks Apr 18 '18 at 21:50

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.