Skip to content

Commit

Permalink
vm -> clique: use signer address for the COINBASE opcode for transact…
Browse files Browse the repository at this point in the history
…ion execution on PoA clique networks
  • Loading branch information
holgerd77 committed Jan 12, 2021
1 parent 71557a5 commit f72c975
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/vm/lib/evm/eei.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,14 @@ export default class EEI {
* Returns the block's beneficiary address.
*/
getBlockCoinbase(): BN {
return new BN(this._env.block.header.coinbase.buf)
let coinbase: BN
if (this._common.consensusAlgorithm() === 'clique') {
coinbase = new BN(this._env.block.header.cliqueSignatureToAddress().toBuffer())
} else {
coinbase = new BN(this._env.block.header.coinbase.buf)
}

return coinbase
}

/**
Expand Down

0 comments on commit f72c975

Please sign in to comment.