So all full nodes execute every smart contract invocation. block.coinbase is supposed to return the miners address but what does it return when the transaction is not yet in the miners hands but is being executed by a full node in the intermediate chain?


There is no such thing as "intermediate chain".

When you issue a transaction it gets propagated to all nodes. If the transaction's gas price is high enough a miner will include the transaction in its block. Before that basically nothing happens to the transaction - it just gets passed around for any miner to take.

When a miner includes the transaction in a block he's mining (and succeeds in solving the PoW puzzle) he broadcasts the block and other nodes (including non-mining nodes) validate it when they get it.

Multiple nodes may include the same transaction in their block but, due to consensus rules, eventually it will only belong to one block (other successful blocks become uncle blocks).

So a transaction is always in one and only one block (from the point of view of the canonical chain). Therefore block.coinbase points to the miner node which included the transaction in its block.

  • Interesting, is this true for different types of chains like tron? I was under the impression that nodes in that system executed the contract all the way up to the super nodes – Arian Karbasi Jan 10 at 19:47
  • Sorry, no idea about Tron. – Lauri Peltonen Jan 11 at 6:32

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.