Skip to content

Commit 37096c3

Browse files
authored
fix(slashsvc): reduce block not found error logs (#12907)
* fix(slashsvc): reduce `block not found` error logs fix(slashsvc): reduce `block not found` error logs * fix: replace string check with ipld.IsNotFound fix: replace string check with ipld.IsNotFound * chore: make gen chore: make gen
1 parent 4cf4ca2 commit 37096c3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

chain/gen/slashfilter/slashsvc/slashservice.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/ipfs/go-cid"
88
levelds "github.com/ipfs/go-ds-leveldb"
9+
format "github.com/ipfs/go-ipld-format"
910
logging "github.com/ipfs/go-log/v2"
1011
ldbopts "github.com/syndtr/goleveldb/leveldb/opt"
1112
"golang.org/x/xerrors"
@@ -69,7 +70,11 @@ func SlashConsensus(ctx context.Context, a ConsensusSlasherApi, p string, from s
6970
for block := range blocks {
7071
otherBlock, extraBlock, fault, err := slashFilterMinedBlock(ctx, sf, a, block)
7172
if err != nil {
72-
log.Errorf("slash detector errored: %s", err)
73+
if format.IsNotFound(err) {
74+
log.Debugf("block not found in chain: %s", err)
75+
} else {
76+
log.Errorf("slash detector errored: %s", err)
77+
}
7378
continue
7479
}
7580
if fault {

0 commit comments

Comments
 (0)