From 4bc032430b8e03e4001edc33872856d3e99778ff Mon Sep 17 00:00:00 2001 From: Aayush Date: Sat, 8 Jul 2023 13:17:05 -0400 Subject: [PATCH] feat: slasher: improve UX --- cmd/lotus/daemon.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index 9fa1d42ae..9af07b896 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -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)