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

fix: cli: lotus-miner sectors extend command #11928

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

beck-8
Copy link
Contributor

@beck-8 beck-8 commented Apr 25, 2024

Related Issues

#11927

Proposed Changes

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

Copy link
Contributor Author

@beck-8 beck-8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still incorrect.

@beck-8 beck-8 force-pushed the fix/sectors_extend branch 2 times, most recently from 3c171e7 to 12e188c Compare April 25, 2024 08:04
@rjan90
Copy link
Contributor

rjan90 commented Apr 27, 2024

Thank you so much for the PR. I think this PR just needs a make gen (run the command while in your /lotus folder), to pass the final check.

@rjan90 rjan90 changed the title fix sectors extend fix: cli: lotus-miner sectors extend command Apr 27, 2024
@jennijuju jennijuju requested a review from magik6k May 28, 2024 08:47
Copy link
Contributor

@LexLuthr LexLuthr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good with some questions


sectorsInDecl := int(sectorsWithoutClaimsCount) + len(sectorsWithClaims)
scount += sectorsInDecl
if scount > addrSectors || len(p.Extensions) >= declMax {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a point for this check. If we are already batching and checking that batch size is smaller than policy max then what's the point of this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what you mean, this part is the original logic, so I didn’t change it.
The first half of this judgment is redundant, and the second half of the inspection may still be useful. I had no one to communicate with at the time, so I chose not to adjust it in a conservative strategy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I delete the redundant first half?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I realized, there is nothing wrong here, it is completely wrong to remove the first half.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function here is to determine whether a new parameter should be opened. The function of the previous batching is to reduce the input batch size.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's raining, 2300ml at a time
My barrel only has 500ml, and every time it rains 2300ml. My barrel is full, and there is still 1800ml (2300-500) left, and my other barrel cannot hold it.
So I divided the 2300ml each time into 500ml each time, so that my barrel can work normally (at this time, I also need to check whether the barrel is full)

@beck-8 beck-8 force-pushed the fix/sectors_extend branch from 932765e to 7245483 Compare June 3, 2024 11:23
Comment on lines 956 to 960
if len(p.Extensions) >= declMax {
params = append(params, p)
p = miner.ExtendSectorExpiration2Params{}
scount = sectorsInDecl
}
Copy link
Contributor

@LexLuthr LexLuthr Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest a complete refactor to get rid of this. If we are batching then we simply should determine the batch size correctly and apply the policies beforehand.

Suggested change
if len(p.Extensions) >= declMax {
params = append(params, p)
p = miner.ExtendSectorExpiration2Params{}
scount = sectorsInDecl
}
if len(p.Extensions) >= declMax {
params = append(params, p)
p = miner.ExtendSectorExpiration2Params{}
scount = sectorsInDecl
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can only help him get back on the right path, but I can't reconstruct it.

@beck-8 beck-8 force-pushed the fix/sectors_extend branch from 7245483 to 5349448 Compare June 3, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants