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

consensus, core/rawdb, miner: downgrade logs #1662

Merged
merged 1 commit into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ var (
errBlockHashInconsistent = errors.New("the block hash is inconsistent")

// errUnauthorizedValidator is returned if a header is signed by a non-authorized entity.
errUnauthorizedValidator = errors.New("unauthorized validator")
errUnauthorizedValidator = func(val string) error {
return errors.New("unauthorized validator: " + val)
}

// errCoinBaseMisMatch is returned if a header's coinbase do not match with signature
errCoinBaseMisMatch = errors.New("coinbase do not match with signature")
Expand Down Expand Up @@ -752,7 +754,7 @@ func (p *Parlia) verifySeal(chain consensus.ChainHeaderReader, header *types.Hea
}

if _, ok := snap.Validators[signer]; !ok {
return errUnauthorizedValidator
return errUnauthorizedValidator(signer.String())
}

if snap.SignRecently(signer) {
Expand Down Expand Up @@ -1298,7 +1300,7 @@ func (p *Parlia) Seal(chain consensus.ChainHeaderReader, block *types.Block, res

// Bail out if we're unauthorized to sign a block
if _, authorized := snap.Validators[val]; !authorized {
return errUnauthorizedValidator
return errUnauthorizedValidator(val.String())
}

// If we're amongst the recent signers, wait for the next block
Expand Down Expand Up @@ -1408,7 +1410,7 @@ func (p *Parlia) SignRecently(chain consensus.ChainReader, parent *types.Block)

// Bail out if we're unauthorized to sign a block
if _, authorized := snap.Validators[p.val]; !authorized {
return true, errUnauthorizedValidator
return true, errUnauthorizedValidator(p.val.String())
}

return snap.SignRecently(p.val), nil
Expand Down Expand Up @@ -1864,7 +1866,7 @@ func (p *Parlia) backOffTime(snap *Snapshot, header *types.Header, val common.Ad
}
}
if idx < 0 {
log.Info("The validator is not authorized", "addr", val)
log.Debug("The validator is not authorized", "addr", val)
brilliant-lx marked this conversation as resolved.
Show resolved Hide resolved
return 0
}

Expand Down
2 changes: 1 addition & 1 deletion consensus/parlia/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (s *Snapshot) apply(headers []*types.Header, chain consensus.ChainHeaderRea
return nil, err
}
if _, ok := snap.Validators[validator]; !ok {
return nil, errUnauthorizedValidator
return nil, errUnauthorizedValidator(validator.String())
}
for _, recent := range snap.Recents {
if recent == validator {
Expand Down
2 changes: 1 addition & 1 deletion core/rawdb/chain_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func unindexTransactions(db ethdb.Database, from uint64, to uint64, interrupt ch
case <-interrupt:
log.Debug("Transaction unindexing interrupted", "blocks", blocks, "txs", txs, "tail", to, "elapsed", common.PrettyDuration(time.Since(start)))
default:
log.Info("Unindexed transactions", "blocks", blocks, "txs", txs, "tail", to, "elapsed", common.PrettyDuration(time.Since(start)))
log.Debug("Unindexed transactions", "blocks", blocks, "txs", txs, "tail", to, "elapsed", common.PrettyDuration(time.Since(start)))
}
}

Expand Down
2 changes: 1 addition & 1 deletion miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
if p, ok := w.engine.(*parlia.Parlia); ok {
signedRecent, err := p.SignRecently(w.chain, head.Block)
if err != nil {
log.Info("Not allowed to propose block", "err", err)
log.Debug("Not allowed to propose block", "err", err)
continue
}
if signedRecent {
Expand Down