scroll-tech / go-ethereum

Scroll's fork of the official Go implementation of the Ethereum protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The "real" coinbase address do not being included in block for clique (PoA) mining

noel2004 opened this issue · comments

commented

It is noticed that when geth is mining a block under clique mode, it has applied a coinbase address (i.e. one of the authorized address) so the gas bouns for miner would be added into this address. However, this address would not being put in the coinbase field of a block (it is always zero).

Lacking of the information of this address, it means the block and trace we have obtained is in fact not complete. For example, the world state could not be correctly rebuilt for we have just missed the balance change of the coinbase address.

PR #126 would fix part of this issue (among the storage traces) but it may not enough since we have not considered the gas bonus in evm/state circuit with the unspecified coinbase address. Maybe we should:

  • Change the coinbase field in block to the "real" coinbase used in clique mode, OR
  • Add another field to specify the address

should we revert #126 and use #139 (comment)?

commented

The code in #139 is not convenient be applied in mining process (worker.go), because the signature on block is in the last step while we have collected all affected addresses before that.

So maybe we just left the code there and clean all dead code in mining sometime later (when the generation of blockResult has been seperated from mining process completely)