'who runs the smart contract in ethereum?

I am new to Smart Contracts. I want to know who runs the smart contact.

  1. I thought the full node that serves http rpc endpoint runs the smart contracts that node received.

    However solidity supports block attributes like block.coinbase, block.timestamp, block.difficulty. If just full node not miner runs contracts, I think it's impossible. Then the block creator runs the all smart contract execution transactions that in the mined block?

  2. If miner runs smart contracts, can miner pollute timestamp of block?



Solution 1:[1]

The smart contract is deployed and then available on the blockchain at its address.

The one who "runs" the smart contract is the caller of a function of a contract. The one who sends the message, interacts with the contract and sends ETH. It is in a contract referred as "msg.sender" It could be an address account or a contract acount (contracts can call others' contracts function).

block.coinbase, block.timestamp, block.difficulty are just referring to the informations of the current block at time of call.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Torof