refactor and improve log (#92)

* refactor and improve log

* fix conflict and test
This commit is contained in:
Liam 2022-05-22 20:34:32 -05:00 committed by GitHub
parent 882add50f5
commit ca6a645fca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 61 additions and 57 deletions

View file

@ -446,7 +446,7 @@ func (x *XDPoS_v2) IsAuthorisedAddress(chain consensus.ChainReader, header *type
} }
} }
log.Warn("Not authorised address", "Address", address.Hex(), "Hash", header.Hash().Hex()) log.Warn("Not authorised address", "Address", address.Hex(), "Hash", header.Hash().Hex(), "round", round)
for index, mn := range masterNodes { for index, mn := range masterNodes {
log.Warn("Master node list item", "mn", mn.Hex(), "index", index) log.Warn("Master node list item", "mn", mn.Hex(), "index", index)
} }
@ -466,7 +466,7 @@ func (x *XDPoS_v2) GetSnapshot(chain consensus.ChainReader, header *types.Header
func (x *XDPoS_v2) UpdateMasternodes(chain consensus.ChainReader, header *types.Header, ms []utils.Masternode) error { func (x *XDPoS_v2) UpdateMasternodes(chain consensus.ChainReader, header *types.Header, ms []utils.Masternode) error {
number := header.Number.Uint64() number := header.Number.Uint64()
log.Trace("take snapshot", "number", number, "hash", header.Hash()) log.Trace("[UpdateMasternodes]")
masterNodes := []common.Address{} masterNodes := []common.Address{}
for _, m := range ms { for _, m := range ms {
@ -475,6 +475,7 @@ func (x *XDPoS_v2) UpdateMasternodes(chain consensus.ChainReader, header *types.
x.lock.RLock() x.lock.RLock()
snap := newSnapshot(number, header.Hash(), masterNodes) snap := newSnapshot(number, header.Hash(), masterNodes)
log.Trace("[UpdateMasternodes] take snapshot", "number", number, "hash", header.Hash())
x.lock.RUnlock() x.lock.RUnlock()
err := storeSnapshot(snap, x.db) err := storeSnapshot(snap, x.db)
@ -484,11 +485,10 @@ func (x *XDPoS_v2) UpdateMasternodes(chain consensus.ChainReader, header *types.
} }
x.snapshots.Add(snap.Hash, snap) x.snapshots.Add(snap.Hash, snap)
nm := []string{} log.Info("[UpdateMasternodes] New set of masternodes has been updated to snapshot", "number", snap.Number, "hash", snap.Hash)
for _, n := range ms { for i, n := range ms {
nm = append(nm, n.Address.String()) log.Info("masternode", "index", i, "address", n.Address.String())
} }
log.Info("New set of masternodes has been updated to snapshot", "number", snap.Number, "hash", snap.Hash, "new masternodes", nm)
return nil return nil
} }
@ -506,7 +506,9 @@ func (x *XDPoS_v2) VerifyHeaders(chain consensus.ChainReader, headers []*types.H
go func() { go func() {
for i, header := range headers { for i, header := range headers {
err := x.verifyHeader(chain, header, headers[:i], fullVerifies[i]) err := x.verifyHeader(chain, header, headers[:i], fullVerifies[i])
log.Warn("[VerifyHeaders] Fail to verify header", "fullVerify", fullVerifies[i], "blockNum", header.Number, "blockHash", header.Hash(), "error", err) if err != nil {
log.Warn("[VerifyHeaders] Fail to verify header", "fullVerify", fullVerifies[i], "blockNum", header.Number, "blockHash", header.Hash(), "error", err)
}
select { select {
case <-abort: case <-abort:
return return
@ -530,18 +532,18 @@ func (x *XDPoS_v2) VerifySyncInfoMessage(chain consensus.ChainReader, syncInfo *
*/ */
if (x.highestQuorumCert.ProposedBlockInfo.Round >= syncInfo.HighestQuorumCert.ProposedBlockInfo.Round) && (x.highestTimeoutCert.Round >= syncInfo.HighestTimeoutCert.Round) { if (x.highestQuorumCert.ProposedBlockInfo.Round >= syncInfo.HighestQuorumCert.ProposedBlockInfo.Round) && (x.highestTimeoutCert.Round >= syncInfo.HighestTimeoutCert.Round) {
log.Warn("[VerifySyncInfoMessage] Round from incoming syncInfo message is no longer qualified", "Highest QC Round", x.highestQuorumCert.ProposedBlockInfo.Round, "Incoming SyncInfo QC Round", syncInfo.HighestQuorumCert.ProposedBlockInfo.Round, "highestTimeoutCert Round", x.highestTimeoutCert.Round, "Incoming syncInfo TC Round", syncInfo.HighestTimeoutCert.Round) log.Debug("[VerifySyncInfoMessage] Round from incoming syncInfo message is no longer qualified", "Highest QC Round", x.highestQuorumCert.ProposedBlockInfo.Round, "Incoming SyncInfo QC Round", syncInfo.HighestQuorumCert.ProposedBlockInfo.Round, "highestTimeoutCert Round", x.highestTimeoutCert.Round, "Incoming syncInfo TC Round", syncInfo.HighestTimeoutCert.Round)
return false, nil return false, nil
} }
err := x.verifyQC(chain, syncInfo.HighestQuorumCert, nil) err := x.verifyQC(chain, syncInfo.HighestQuorumCert, nil)
if err != nil { if err != nil {
log.Warn("SyncInfo message verification failed due to QC", "error", err) log.Warn("[VerifySyncInfoMessage] SyncInfo message verification failed due to QC", "error", err)
return false, err return false, err
} }
err = x.verifyTC(chain, syncInfo.HighestTimeoutCert) err = x.verifyTC(chain, syncInfo.HighestTimeoutCert)
if err != nil { if err != nil {
log.Warn("SyncInfo message verification failed due to TC", "error", err) log.Warn("[VerifySyncInfoMessage] SyncInfo message verification failed due to TC", "error", err)
return false, err return false, err
} }
return true, nil return true, nil
@ -849,11 +851,7 @@ func (x *XDPoS_v2) processQC(blockChainReader consensus.ChainReader, incomingQuo
} }
// 4. Set new round // 4. Set new round
if incomingQuorumCert.ProposedBlockInfo.Round >= x.currentRound { if incomingQuorumCert.ProposedBlockInfo.Round >= x.currentRound {
err := x.setNewRound(blockChainReader, incomingQuorumCert.ProposedBlockInfo.Round+1) x.setNewRound(blockChainReader, incomingQuorumCert.ProposedBlockInfo.Round+1)
if err != nil {
log.Error("[processQC] Fail to setNewRound", "new round to set", incomingQuorumCert.ProposedBlockInfo.Round+1)
return err
}
} }
log.Trace("[ProcessQC][After]", "HighQC", x.highestQuorumCert) log.Trace("[ProcessQC][After]", "HighQC", x.highestQuorumCert)
return nil return nil
@ -864,14 +862,13 @@ func (x *XDPoS_v2) processQC(blockChainReader consensus.ChainReader, incomingQuo
2. Reset timer 2. Reset timer
3. Reset vote and timeout Pools 3. Reset vote and timeout Pools
*/ */
func (x *XDPoS_v2) setNewRound(blockChainReader consensus.ChainReader, round types.Round) error { func (x *XDPoS_v2) setNewRound(blockChainReader consensus.ChainReader, round types.Round) {
log.Info("[setNewRound] new round and reset pools and workers", "round", round)
x.currentRound = round x.currentRound = round
x.timeoutCount = 0 x.timeoutCount = 0
//TODO: tell miner now it's a new round and start mine if it's leader
x.timeoutWorker.Reset(blockChainReader) x.timeoutWorker.Reset(blockChainReader)
//TODO: vote pools //TODO: vote pools
x.timeoutPool.Clear() x.timeoutPool.Clear()
return nil
} }
func (x *XDPoS_v2) broadcastToBftChannel(msg interface{}) { func (x *XDPoS_v2) broadcastToBftChannel(msg interface{}) {

View file

@ -32,13 +32,13 @@ func (x *XDPoS_v2) getPreviousEpochSwitchInfoByHash(chain consensus.ChainReader,
func (x *XDPoS_v2) getEpochSwitchInfo(chain consensus.ChainReader, header *types.Header, hash common.Hash) (*types.EpochSwitchInfo, error) { func (x *XDPoS_v2) getEpochSwitchInfo(chain consensus.ChainReader, header *types.Header, hash common.Hash) (*types.EpochSwitchInfo, error) {
e, ok := x.epochSwitches.Get(hash) e, ok := x.epochSwitches.Get(hash)
if ok { if ok {
log.Debug("[getEpochSwitchInfo] cache hit", "hash", hash.Hex())
epochSwitchInfo := e.(*types.EpochSwitchInfo) epochSwitchInfo := e.(*types.EpochSwitchInfo)
log.Debug("[getEpochSwitchInfo] cache hit", "number", epochSwitchInfo.EpochSwitchBlockInfo.Number, "hash", hash.Hex())
return epochSwitchInfo, nil return epochSwitchInfo, nil
} }
h := header h := header
if h == nil { if h == nil {
log.Debug("[getEpochSwitchInfo] header missing, get header", "hash", hash.Hex()) log.Debug("[getEpochSwitchInfo] header doesn't provide, get header by hash", "hash", hash.Hex())
h = chain.GetHeaderByHash(hash) h = chain.GetHeaderByHash(hash)
if h == nil { if h == nil {
log.Warn("[getEpochSwitchInfo] can not find header from db", "hash", hash.Hex()) log.Warn("[getEpochSwitchInfo] can not find header from db", "hash", hash.Hex())
@ -135,6 +135,6 @@ func (x *XDPoS_v2) IsEpochSwitch(header *types.Header) (bool, uint64, error) {
log.Info("[IsEpochSwitch] true, parent equals V2.SwitchBlock", "round", round, "number", header.Number.Uint64(), "hash", header.Hash()) log.Info("[IsEpochSwitch] true, parent equals V2.SwitchBlock", "round", round, "number", header.Number.Uint64(), "hash", header.Hash())
return true, epochNum, nil return true, epochNum, nil
} }
log.Info("[IsEpochSwitch]", "parent round", parentRound, "round", round, "number", header.Number.Uint64(), "hash", header.Hash()) log.Info("[IsEpochSwitch]", "is", parentRound < epochStartRound, "parentRound", parentRound, "round", round, "number", header.Number.Uint64(), "epochNum", epochNum, "hash", header.Hash())
return parentRound < epochStartRound, epochNum, nil return parentRound < epochStartRound, epochNum, nil
} }

View file

@ -25,7 +25,7 @@ func (x *XDPoS_v2) timeoutHandler(blockChainReader consensus.ChainReader, timeou
} }
// Collect timeout, generate TC // Collect timeout, generate TC
isThresholdReached, numberOfTimeoutsInPool, pooledTimeouts := x.timeoutPool.Add(timeout) isThresholdReached, numberOfTimeoutsInPool, pooledTimeouts := x.timeoutPool.Add(timeout)
log.Info("[timeoutHandler] collect timeout", "number", numberOfTimeoutsInPool) log.Debug("[timeoutHandler] collect timeout", "number", numberOfTimeoutsInPool)
// Threshold reached // Threshold reached
if isThresholdReached { if isThresholdReached {
@ -140,10 +140,8 @@ func (x *XDPoS_v2) processTC(blockChainReader consensus.ChainReader, timeoutCert
x.highestTimeoutCert = timeoutCert x.highestTimeoutCert = timeoutCert
} }
if timeoutCert.Round >= x.currentRound { if timeoutCert.Round >= x.currentRound {
err := x.setNewRound(blockChainReader, timeoutCert.Round+1) x.setNewRound(blockChainReader, timeoutCert.Round+1)
if err != nil {
return err
}
} }
return nil return nil
} }

View file

@ -164,6 +164,12 @@ func (x *XDPoS_v2) verifyHeader(chain consensus.ChainReader, header *types.Heade
// Verify the header validators address is legit by checking against its snapshot masternode list minutes the penalty list, we also ensure the order matches // Verify the header validators address is legit by checking against its snapshot masternode list minutes the penalty list, we also ensure the order matches
func (x *XDPoS_v2) isValidatorsLegit(chain consensus.ChainReader, header *types.Header, penalties []common.Address) (bool, error) { func (x *XDPoS_v2) isValidatorsLegit(chain consensus.ChainReader, header *types.Header, penalties []common.Address) (bool, error) {
if header.Number.Cmp(x.config.V2.SwitchBlock) == 0 {
log.Info("[isValidatorsLegit] examing last v1 block")
return true, nil
}
snap, err := x.getSnapshot(chain, header.Number.Uint64(), false) snap, err := x.getSnapshot(chain, header.Number.Uint64(), false)
if err != nil { if err != nil {
log.Error("[isValidatorsLegit] Error while trying to get snapshot", "BlockNumber", header.Number.Int64(), "Hash", header.Hash().Hex(), "error", err) log.Error("[isValidatorsLegit] Error while trying to get snapshot", "BlockNumber", header.Number.Int64(), "Hash", header.Hash().Hex(), "error", err)

View file

@ -66,7 +66,7 @@ func (x *XDPoS_v2) voteHandler(chain consensus.ChainReader, voteMsg *types.Vote)
// Collect vote // Collect vote
thresholdReached, numberOfVotesInPool, pooledVotes := x.votePool.Add(voteMsg) thresholdReached, numberOfVotesInPool, pooledVotes := x.votePool.Add(voteMsg)
log.Info("[voteHandler] collect votes", "number", numberOfVotesInPool) log.Debug("[voteHandler] collect votes", "number", numberOfVotesInPool)
if thresholdReached { if thresholdReached {
log.Info(fmt.Sprintf("[voteHandler] Vote pool threashold reached: %v, number of items in the pool: %v", thresholdReached, numberOfVotesInPool)) log.Info(fmt.Sprintf("[voteHandler] Vote pool threashold reached: %v, number of items in the pool: %v", thresholdReached, numberOfVotesInPool))

View file

@ -514,23 +514,23 @@ func TestVoteMsgMissingSnapshot(t *testing.T) {
blockchain, _, currentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, 915, params.TestXDPoSMockChainConfig, nil) blockchain, _, currentBlock, signer, signFn, _ := PrepareXDCTestBlockChainForV2Engine(t, 915, params.TestXDPoSMockChainConfig, nil)
engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2 engineV2 := blockchain.Engine().(*XDPoS.XDPoS).EngineV2
blockInfo := &utils.BlockInfo{ blockInfo := &types.BlockInfo{
Hash: currentBlock.Hash(), Hash: currentBlock.Hash(),
Round: utils.Round(14), Round: types.Round(14),
Number: big.NewInt(915), Number: big.NewInt(915),
} }
voteForSign := &utils.VoteForSign{ voteForSign := &types.VoteForSign{
ProposedBlockInfo: blockInfo, ProposedBlockInfo: blockInfo,
GapNumber: 450, GapNumber: 450,
} }
signHash, _ := signFn(accounts.Account{Address: signer}, utils.VoteSigHash(voteForSign).Bytes()) signHash, _ := signFn(accounts.Account{Address: signer}, types.VoteSigHash(voteForSign).Bytes())
voteMsg := &utils.Vote{ voteMsg := &types.Vote{
ProposedBlockInfo: blockInfo, ProposedBlockInfo: blockInfo,
Signature: signHash, Signature: signHash,
GapNumber: 1350, // missing 1350 snapshot GapNumber: 1350, // missing 1350 snapshot
} }
engineV2.SetNewRoundFaker(blockchain, utils.Round(14), false) engineV2.SetNewRoundFaker(blockchain, types.Round(14), false)
verified, err := engineV2.VerifyVoteMessage(blockchain, voteMsg) verified, err := engineV2.VerifyVoteMessage(blockchain, voteMsg)
assert.False(t, verified) assert.False(t, verified)
assert.NotNil(t, err) assert.NotNil(t, err)

View file

@ -79,7 +79,7 @@ func (b *Bfter) Vote(vote *types.Vote) error {
err = b.consensus.voteHandler(b.blockChainReader, vote) err = b.consensus.voteHandler(b.blockChainReader, vote)
if err != nil { if err != nil {
if _, ok := err.(*utils.ErrIncomingMessageRoundTooFarFromCurrentRound); ok { if _, ok := err.(*utils.ErrIncomingMessageRoundTooFarFromCurrentRound); ok {
log.Warn("vote round not equal", "error", err, "vote", vote.Hash()) log.Debug("vote round not equal", "error", err, "vote", vote.Hash())
return err return err
} }
log.Error("handle BFT Vote", "error", err) log.Error("handle BFT Vote", "error", err)
@ -103,7 +103,7 @@ func (b *Bfter) Timeout(timeout *types.Timeout) error {
err = b.consensus.timeoutHandler(b.blockChainReader, timeout) err = b.consensus.timeoutHandler(b.blockChainReader, timeout)
if err != nil { if err != nil {
if _, ok := err.(*utils.ErrIncomingMessageRoundNotEqualCurrentRound); ok { if _, ok := err.(*utils.ErrIncomingMessageRoundNotEqualCurrentRound); ok {
log.Warn("timeout round not equal", "error", err) log.Debug("timeout round not equal", "error", err)
return err return err
} }
log.Error("handle BFT Timeout", "error", err) log.Error("handle BFT Timeout", "error", err)

View file

@ -729,9 +729,8 @@ func (f *Fetcher) insert(peer string, block *types.Block) {
} }
err = f.handleProposedBlock(block.Header()) err = f.handleProposedBlock(block.Header())
if err != nil { if err != nil {
log.Error("[insert] Unable to handle new proposed block", "err", err, "number", block.Number(), "hash", block.Hash()) log.Warn("[insert] Unable to handle new proposed block", "err", err, "number", block.Number(), "hash", block.Hash())
} }
// TODO: (XIN-101) Add propose block handler
// If import succeeded, broadcast the block // If import succeeded, broadcast the block
propAnnounceOutTimer.UpdateSince(block.ReceivedAt) propAnnounceOutTimer.UpdateSince(block.ReceivedAt)
if !fastBroadCast { if !fastBroadCast {

View file

@ -19,50 +19,49 @@ import (
func AttachConsensusV2Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConfig *params.ChainConfig) { func AttachConsensusV2Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConfig *params.ChainConfig) {
// Hook scans for bad masternodes and decide to penalty them // Hook scans for bad masternodes and decide to penalty them
adaptor.EngineV2.HookPenalty = func(chain consensus.ChainReader, number *big.Int, parentHash common.Hash, candidates []common.Address) ([]common.Address, error) { adaptor.EngineV2.HookPenalty = func(chain consensus.ChainReader, number *big.Int, currentHash common.Hash, candidates []common.Address) ([]common.Address, error) {
start := time.Now() start := time.Now()
listBlockHash := make([]common.Hash, chain.Config().XDPoS.Epoch) listBlockHash := make([]common.Hash, chain.Config().XDPoS.Epoch)
// get list block hash & stats total created block // get list block hash & stats total created block
statMiners := make(map[common.Address]int) statMiners := make(map[common.Address]int)
listBlockHash[0] = parentHash listBlockHash[0] = currentHash
parentNumber := number.Uint64() - 1 parentNumber := number.Uint64() - 1
pHash := parentHash parentHash := currentHash
for i := uint64(1); ; i++ { for i := uint64(1); ; i++ {
parentHeader := chain.GetHeader(pHash, parentNumber) parentHeader := chain.GetHeader(parentHash, parentNumber)
b, _, err := adaptor.EngineV2.IsEpochSwitch(parentHeader) isEpochSwitch, _, err := adaptor.EngineV2.IsEpochSwitch(parentHeader)
if err != nil { if err != nil {
log.Error("[HookPenalty]", "err", err) log.Error("[HookPenalty] isEpochSwitch", "err", err)
return []common.Address{}, err return []common.Address{}, err
} }
if b { if isEpochSwitch {
break break
} }
miner := parentHeader.Coinbase // we can directly use coinbase, since it's verified (Verification is a TODO) miner := parentHeader.Coinbase // we can directly use coinbase, since it's verified (Verification is a TODO)
value, exist := statMiners[miner] _, exist := statMiners[miner]
if exist { if exist {
value = value + 1 statMiners[miner]++
} else { } else {
value = 1 statMiners[miner] = 1
} }
statMiners[miner] = value parentHash = parentHeader.ParentHash
pHash = parentHeader.ParentHash listBlockHash[i] = parentHash
parentNumber-- parentNumber--
listBlockHash[i] = pHash
} }
// add list not miner to penalties // add list not miner to penalties
preMasternodes := adaptor.EngineV2.GetMasternodesByHash(chain, parentHash) preMasternodes := adaptor.EngineV2.GetMasternodesByHash(chain, currentHash)
penalties := []common.Address{} penalties := []common.Address{}
for miner, total := range statMiners { for miner, total := range statMiners {
if total < common.MinimunMinerBlockPerEpoch { if total < common.MinimunMinerBlockPerEpoch {
log.Debug("Find a node not enough requirement create block", "addr", miner.Hex(), "total", total) log.Info("[HookPenalty] Find a node does not create enough block", "addr", miner.Hex(), "total", total, "require", common.MinimunMinerBlockPerEpoch)
penalties = append(penalties, miner) penalties = append(penalties, miner)
} }
} }
for _, addr := range preMasternodes { for _, addr := range preMasternodes {
if _, exist := statMiners[addr]; !exist { if _, exist := statMiners[addr]; !exist {
log.Debug("Find a node don't create block", "addr", addr.Hex()) log.Info("[HookPenalty] Find a node do not create any block", "addr", addr.Hex())
penalties = append(penalties, addr) penalties = append(penalties, addr)
} }
} }
@ -72,10 +71,11 @@ func AttachConsensusV2Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConf
comebackHeight := (common.LimitPenaltyEpochV2+1)*chain.Config().XDPoS.Epoch + chain.Config().XDPoS.V2.SwitchBlock.Uint64() comebackHeight := (common.LimitPenaltyEpochV2+1)*chain.Config().XDPoS.Epoch + chain.Config().XDPoS.V2.SwitchBlock.Uint64()
penComebacks := []common.Address{} penComebacks := []common.Address{}
if number.Uint64() > comebackHeight { if number.Uint64() > comebackHeight {
pens := adaptor.EngineV2.GetPreviousPenaltyByHash(chain, parentHash, common.LimitPenaltyEpochV2) pens := adaptor.EngineV2.GetPreviousPenaltyByHash(chain, currentHash, common.LimitPenaltyEpochV2)
for _, p := range pens { for _, p := range pens {
for _, addr := range candidates { for _, addr := range candidates {
if p == addr { if p == addr {
log.Info("[HookPenalty] get previous penalty node and add into comeback list", "addr", addr)
penComebacks = append(penComebacks, p) penComebacks = append(penComebacks, p)
break break
} }
@ -123,7 +123,6 @@ func AttachConsensusV2Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConf
} }
} }
log.Debug("Time Calculated HookPenaltyV2 ", "block", number, "pen comeback nodes", len(penComebacks), "not enough miner", len(penalties), "time", common.PrettyDuration(time.Since(start)))
for _, comeback := range penComebacks { for _, comeback := range penComebacks {
ok := true ok := true
for _, p := range penalties { for _, p := range penalties {
@ -136,6 +135,11 @@ func AttachConsensusV2Hooks(adaptor *XDPoS.XDPoS, bc *core.BlockChain, chainConf
penalties = append(penalties, comeback) penalties = append(penalties, comeback)
} }
} }
for i, p := range penalties {
log.Info("[HookPenalty] Final penalty list", "index", i, "addr", p)
}
log.Info("[HookPenalty] Time Calculated HookPenaltyV2 ", "block", number, "time", common.PrettyDuration(time.Since(start)))
return penalties, nil return penalties, nil
} }

View file

@ -414,7 +414,7 @@ func (self *worker) wait() {
c := self.engine.(*XDPoS.XDPoS) c := self.engine.(*XDPoS.XDPoS)
err = c.HandleProposedBlock(self.chain, block.Header()) err = c.HandleProposedBlock(self.chain, block.Header())
if err != nil { if err != nil {
log.Error("[wait] Unable to handle new proposed block", "err", err, "number", block.Number(), "hash", block.Hash()) log.Warn("[wait] Unable to handle new proposed block", "err", err, "number", block.Number(), "hash", block.Hash())
} }
authorized := c.IsAuthorisedAddress(self.chain, block.Header(), self.coinbase) authorized := c.IsAuthorisedAddress(self.chain, block.Header(), self.coinbase)
@ -435,7 +435,7 @@ func (self *worker) wait() {
// Send tx sign to smart contract blockSigners. // Send tx sign to smart contract blockSigners.
if block.NumberU64()%common.MergeSignRange == 0 || !self.config.IsTIP2019(block.Number()) { if block.NumberU64()%common.MergeSignRange == 0 || !self.config.IsTIP2019(block.Number()) {
if err := contracts.CreateTransactionSign(self.config, self.eth.TxPool(), self.eth.AccountManager(), block, self.chainDb, self.coinbase); err != nil { if err := contracts.CreateTransactionSign(self.config, self.eth.TxPool(), self.eth.AccountManager(), block, self.chainDb, self.coinbase); err != nil {
log.Error("Fail to create tx sign for signer", "error", "err") log.Error("Fail to create tx sign for signer", "error", err)
} }
} }
} }