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 ask Max and Min piece size being reset on reboot #4334

Closed
wants to merge 1 commit into from
Closed
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
15 changes: 10 additions & 5 deletions node/modules/storageminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,16 @@ func NewStorageAsk(ctx helpers.MetricsCtx, fapi lapi.FullNode, ds dtypes.Metadat
if err != nil {
return nil, err
}
// Hacky way to set max piece size to the sector size
a := storedAsk.GetAsk().Ask
err = storedAsk.SetAsk(a.Price, a.VerifiedPrice, a.Expiry-a.Timestamp, storagemarket.MaxPieceSize(abi.PaddedPieceSize(mi.SectorSize)))
if err != nil {
return storedAsk, err

// Set miner's sector size as MaxPieceSize of the "storage ask" when
// not set before (or was default - seq == 0)
signedAsk := storedAsk.GetAsk()
if signedAsk == nil || signedAsk.Ask == nil || signedAsk.Ask.SeqNo == 0 {
a := signedAsk.Ask
err = storedAsk.SetAsk(a.Price, a.VerifiedPrice, a.Expiry-a.Timestamp, storagemarket.MaxPieceSize(abi.PaddedPieceSize(mi.SectorSize)))
if err != nil {
return storedAsk, err
}
}
return storedAsk, nil
}
Expand Down