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

MinPieceSize for SetAsk is lost on restart #4220

Closed
hannahhoward opened this issue Oct 7, 2020 · 0 comments · Fixed by #4384
Closed

MinPieceSize for SetAsk is lost on restart #4220

hannahhoward opened this issue Oct 7, 2020 · 0 comments · Fixed by #4384

Comments

@hannahhoward
Copy link
Contributor

hannahhoward commented Oct 7, 2020

Describe the bug
If you set a MinPieceSize via lotus-miner storage-deals set-ask and then restart the miner, it resets to the default value

To Reproduce
Steps to reproduce the behavior:

  1. Run lotus-miner storage-deals set-ask --price 100000000000 --verified-price 100000000000 --min-piece-size 250MiB --max-piece-size 32GiB
  2. Restart lotus-miner
  3. Run lotus-miner storage-deals get-ask
  4. See MinPieceSize is back to default value

Expected behavior
The value set should persist

Version (run lotus version):
master

Additional context

The line that causes this is here:
https://github.com/filecoin-project/lotus/blob/master/node/modules/storageminer.go#L399

But more importantly, when you call SetAsk on StoredAsk in the markets code, unless you pass a value for MinPieceSize, it's not copied over.

Proposed solution

SetAsk should retain any existing MinPieceSize/MaxPieceSize when called (i.e. in the if s.ask != nil clause)
Also the the code referenced above is problematic cause it will overwrite any MaxPieceSize. The proper solution I think should be to let NewStoredAsk take a var args StorageAskOption list -- if there is a value already on disk, this list is unused, but if the code here is run:
https://github.com/filecoin-project/go-fil-markets/blob/master/storagemarket/impl/storedask/storedask.go#L90,
Then pass the var args list to it.

Then go back and add the sector size to the call to NewStoredAsk.

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 a pull request may close this issue.

1 participant