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

refactor: cli: Avoid disputing WindowedPoSt messages when the target miner has no balance to pay rewards #11800

Merged
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
9 changes: 9 additions & 0 deletions cli/disputer.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,15 @@ var disputerStartCmd = &cli.Command{
// for a given miner, index, and maxPostIndex, tries to dispute posts from 0...postsSnapshotted-1
// returns a list of DisputeWindowedPoSt msgs that are expected to succeed if sent
func makeDisputeWindowedPosts(ctx context.Context, api v0api.FullNode, dl minerDeadline, postsSnapshotted uint64, sender address.Address) ([]*types.Message, error) {
// CHECK: if miner waller balance is zero then skip sending dispute message
walletBalance, err := api.WalletBalance(ctx, dl.miner)
if err != nil {
return nil, xerrors.Errorf("failed to get wallet balance while checking to send dispute messages to miner %w: %w", dl.miner, err)
}
if walletBalance.IsZero() {
disputeLog.Warnw("wallet balance is zero, skipping dispute message", "wallet", dl.miner)
return nil, nil
}
disputes := make([]*types.Message, 0)

for i := uint64(0); i < postsSnapshotted; i++ {
Expand Down