1

I was thinking to set up an Ethereum full node, but have some questions I can’t find the answers to.

Does my node have to execute every smart contract that was put in the blockchain over the past years to verify if the outcome was the same? If so, doesn’t that make the electricity cost add up a lot over time, also for the nodes in the future? From what I understand only the miner gets paid for a smart contract, but my node would have to do work too.

If I don't have to execute all those smart contracts, how does my node know what happened in the past and what the blockchain looks like now?

What happens if the data input of a smart contract was changed or isn’t available anymore? How does my node still get in sync with the rest of the network?

Thanks in advance

  • for the two questions about electricity and full node reward, you can have some answers here : https://ethereum.stackexchange.com/questions/4108/what-are-the-valuable-benefits-of-having-a-node/4111#4111 – Nicolas Massart Jul 27 '18 at 07:15

1 Answers1

1

Smart contracts follow the same validation pattern as normal transactions. But there is no balance to check necessarily. The validation insteaed is based on deterministic in & output. Meaning every miner executes the code with the input as set in the transaction, each node must then reach the same output.

Nico Vergauwen
  • 1,004
  • 7
  • 11
  • An article I read states that there can be dynamic, undeterministic calls. That leads back to my last question.

    If I have a smart contract that calls upon an external service, all nodes in the network run the smart contract. Then the external service is gone, how do new nodes handle this situation?

    – OneOfManyNodes Jul 25 '18 at 09:45
  • 1
    The article is wrong. Illustration: https://medium.com/@promentol/lottery-smart-contract-can-we-generate-random-numbers-in-solidity-4f586a152b27 – Nico Vergauwen Jul 25 '18 at 09:50
  • 1
    You can't call external services, you can only call for things on the blockchain. – Nico Vergauwen Jul 25 '18 at 09:54
  • What about smart contracts where people bet on the weather, sports games? They make use of oracles, what happens when the oracles are gone? – OneOfManyNodes Jul 25 '18 at 12:50
  • 1
    Using an oracle doesn't make it not deterministic. An oracle is an outside data source. Like i said it puts data on chain same way like you and I, by transactions. What happens when you lose your keys and your account is lost? Exactly you won't be able to put data on chain with that keypair anymore. – Nico Vergauwen Jul 25 '18 at 13:41
  • 1
    So the oracle simply publishes metadata on the blockchain through a transaction, according to a pre-agreed format, and then this transaction triggers the smart contract? No article I've seen has been clear on this part, thanks. – OneOfManyNodes Jul 25 '18 at 13:51
  • 1
    That transaction can trigger the contract or it can be triggered by one of the other parties after the variable by the oracle has been set indeed. It's simply a third party putting data on the blockchain. You still have to trust that party (human or IoT) to put the correct data on chain. Check out chainlink or Oraclize.It for example. – Nico Vergauwen Jul 25 '18 at 13:55