Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract Mining Beneficiary from BlockHeader.getExtraData() #1202

Closed
DavePearce opened this issue Sep 16, 2024 · 2 comments
Closed

Extract Mining Beneficiary from BlockHeader.getExtraData() #1202

DavePearce opened this issue Sep 16, 2024 · 2 comments

Comments

@DavePearce
Copy link
Collaborator

DavePearce commented Sep 16, 2024

Linea uses the clique consensus protocol (see EIP-225). The upshot of this is that the mining beneficiary address is embedded in the data field of the block, whilst coinbase is set to 0x0. Therefore, this part of ReplayExecutionEnvironment is incorrect:

final TransactionProcessingResult outcome =
            transactionProcessor.processTransaction(
                updater,
                (ProcessableBlockHeader) header,
                tx,
                header.getCoinbase(),
               ...);

Specifically, header.getCoinbase() does not return the correct beneficiary address. Instead, we need to extract it from header.getExtraData().

This explains why various transactions fail with an incorrect balance for the address (see here for more).

@DavePearce DavePearce changed the title Extract Mining Beneficiary from Transaction Data Extract Mining Beneficiary from BlockHeader.getExtraData() Sep 16, 2024
@OlivierBBB
Copy link
Collaborator

Thanks @DavePearce. I discussed this point with @julien-marchand, too, and the conclusion was that blocks contain miner=0x000000 which is where we got the coinbase at 0x0 from in our tests. We have to use the address (deduced from the public key) that signed the block instead for both

  • the output of the COINBASE opcode
  • the recipient address of fees

@DavePearce
Copy link
Collaborator Author

Completed by #1222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants