I want to know who will help us execute when we call the functions in the smart contract. Is it the miner who put this transaction in the block?
Hope you can give me some help, Thanks!
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 community
In Ethereum 1.0, yes, it is a miner who includes the transaction in the blockchain. Read about Proof-of-work (Pow).
In Ethereum 2.0, it is a "validator" who includes the transaction in a block of a shard. Read about Proof-of-stake (PoS).
At the time of writing this answer, Ethereum 1.0 is still the "main" network. Ethereum 2.0 kicked off its Phase 0 on December 1, 2020, but it's going to take a while until it reaches the further stages.
When you submit a transaction to the network, it is distributed to all/most nodes of the network. Some of them are miners. Some of the miners pick your transaction to include it into the next block they intend to propose. In this process, they execute the transaction, including the smart contracts that are called. Then the miners try to find a suitable hash for their block. If they succeed, they broadcast the block to the network. Now all nodes in the network process the transactions in the block. If the block is accepted and becomes part of the chain, one may say that the transaction has been processed and the smart contracts have been executed.
If a new node joins the network, then it will process all transactions on the chain, in order to verify the chain and to compute the current state. In this course, also your transaction will be executed again.