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

Avoid disputing WindowedPoSt messages when the target Miner has no balance to pay rewards #11715

Closed
3 of 9 tasks
Stebalien opened this issue Mar 13, 2024 · 0 comments · Fixed by #11800
Closed
3 of 9 tasks
Labels
effort/hours Effort: Hours good first issue Good for newcomers help wanted Extra attention is needed kind/feature Kind: Feature

Comments

@Stebalien
Copy link
Member

Stebalien commented Mar 13, 2024

Checklist

  • This is not brainstorming ideas. If you have an idea you'd like to discuss, please open a new discussion on the lotus forum and select the category as Ideas.
  • I have a specific, actionable, and well motivated feature request to propose.

Lotus component

  • lotus daemon - chain sync
  • lotus fvm/fevm - Lotus FVM and FEVM interactions
  • lotus miner/worker - sealing
  • lotus miner - proving(WindowPoSt/WinningPoSt)
  • lotus JSON-RPC API
  • lotus message management (mpool)
  • Other

What is the motivation behind this feature request? Is your feature request related to a problem? Please describe.

In #11703, a user came across an edge case where an SP:

  1. Submitted a bad PoSt.
  2. Terminated their sectors.
  3. Withdrew all funds (after paying all fees).

This left the SP's miner actor with a bad proof but without any funds to pay for disputes. On the other hand, given that the sectors have been terminated and termination fees were already paid we don't really care about fining the SP for the bad proofs anyways.

But... we still don't want to submit dispute messages in this case because doing so isn't free and doesn't really serve a purpose.

Describe the solution you'd like

Before sending a dispute to a miner actor, validate that the miner actor has a non-zero balance. If it has a zero balance, skip it.

We'll likely want to skip/check at the top of this loop by calling api.WalletBalance on the target miner actor's address:

for _, dl := range dls {

Describe alternatives you've considered

It would be better to determine if sending the dispute is likely to be profitable, but that's significantly more challenging (we'd need to look at gas costs, calculate expected fines/rewards, etc.). Simply checking if the balance is 0 should be sufficient in most cases.

Additional context

No response

@Stebalien Stebalien added the good first issue Good for newcomers label Mar 13, 2024
@rjan90 rjan90 added help wanted Extra attention is needed effort/hours Effort: Hours labels Mar 19, 2024
Stebalien pushed a commit that referenced this issue Apr 10, 2024
…miner has no balance to pay rewards (#11800)

In #11703, a user came across an edge case where an SP:

1. Submitted a bad PoSt.
2. Terminated their sectors.
3. Withdrew all funds (after paying all fees).

This left the SP's miner actor with a bad proof but without any funds to pay for disputes. On the other hand, given that the sectors have been terminated and termination fees were already paid we don't really care about fining the SP for the bad proofs anyways.

But... we still don't want to submit dispute messages in this case because doing so isn't free and doesn't really serve a purpose.

So add a check to fetch miner wallet balance and only send disputing messages if balance is non zero.

fixes #11715
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Effort: Hours good first issue Good for newcomers help wanted Extra attention is needed kind/feature Kind: Feature
Projects
Status: ☑️ Done (Archive)
3 participants