Search code examples
ethereumsmartcontracts

When was the ETH contract called?


I have learned about Solidity development for several days. But for now, I have one confusing thing, and I don't know whether I am right or wrong. I searched Google, but I couldn't find anything. Maybe I search with the wrong keys. If you know that, please help me. Thank you, guys. My question is, "When was the ETH contract called" I think the contract was called or said it was run code when the miner packed it. Am I right? When we make a transaction, it will be located in the pending poll. When the miner packed the block, it will run the contract.


Solution

  • The contract is "executed" when it gets accepted into a block, and when that block is accepted. The process of submitting a transaction is as follows:

    1. The transaction is generated and signed by the wallet
    2. The signed transaction is sent to an Ethereum node
    3. The signed transaction is added to the mempool. The mempool is where signed transactions are stored until they are included in a block.
    4. The transaction is included in a block. Transactions in a block are executed in the order that miners decide.
    5. The block is mined, and then the changes that are made by that transaction take effect.