Merge pull request #11060 from filecoin-project/asr/slasher-improvements

feat: slasher: improve UX
This commit is contained in:
Aayush Rajasekaran 2023-07-10 10:30:18 -04:00 committed by GitHub
commit 7a93a70e6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -401,7 +401,12 @@ var DaemonCmd = &cli.Command{
if err != nil {
return fmt.Errorf("failed to start json-rpc endpoint: %s", err)
}
if cctx.IsSet("slash-consensus") && cctx.IsSet("slashdb-dir") {
if cctx.Bool("slash-consensus") {
if !cctx.IsSet("slashdb-dir") {
return fmt.Errorf("must supply path for slasher database with --slashdb-dir")
}
go func() {
err := slashConsensus(api, cctx.String("slashdb-dir"), cctx.String("slasher-sender"))
if err != nil {
@ -637,7 +642,6 @@ func slashConsensus(a lapi.FullNode, p string, from string) error {
return xerrors.Errorf("sync incoming blocks failed: %w", err)
}
for block := range blocks {
log.Infof("deal with block: %d, %v, %s", block.Height, block.Miner, block.Cid())
otherBlock, extraBlock, fault, err := slashFilterMinedBlock(ctx, sf, a, block)
if err != nil {
log.Errorf("slash detector errored: %s", err)