fix clique_sealer: reset block header coinbase

if we are not voting, coinbase should be filled with zero
because other subsystem e.g txpool can produce block header
with non zero coinbase. if that coinbase is one of the signer
and the nonce is zero, that signer will be vote out from
signer list
This commit is contained in:
jangko 2022-05-29 10:26:11 +07:00
parent af10e8f179
commit 3f0994f80b
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 7 additions and 0 deletions

View File

@ -180,6 +180,13 @@ proc prepare*(c: Clique; parent: BlockHeader, header: var BlockHeader): CliqueOk
if rc.isErr:
return err(rc.error)
# if we are not voting, coinbase should be filled with zero
# because other subsystem e.g txpool can produce block header
# with non zero coinbase. if that coinbase is one of the signer
# and the nonce is zero, that signer will be vote out from
# signer list
header.coinbase.reset
if (header.blockNumber mod c.cfg.epoch) != 0:
c.doExclusively:
# Gather all the proposals that make sense voting on