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(miner): fix new bug in StateMinerPreCommitDepositForPower calculation #12595

Merged
merged 1 commit into from
Oct 14, 2024
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
14 changes: 11 additions & 3 deletions node/impl/full/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1504,9 +1504,17 @@ func (a *StateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr
return types.EmptyInt, xerrors.Errorf("loading reward actor state: %w", err)
}

sectorWeight, err := a.calculateSectorWeight(ctx, maddr, pci, ts.Height(), state)
if err != nil {
return types.EmptyInt, err
var sectorWeight abi.StoragePower
if a.StateManager.GetNetworkVersion(ctx, ts.Height()) <= network.Version16 {
if sectorWeight, err = a.calculateSectorWeight(ctx, maddr, pci, ts.Height(), state); err != nil {
return types.EmptyInt, err
}
} else {
ssize, err := pci.SealProof.SectorSize()
if err != nil {
return types.EmptyInt, xerrors.Errorf("failed to resolve sector size for seal proof: %w", err)
}
sectorWeight = miner.QAPowerMax(ssize)
}

_, powerSmoothed, err := a.pledgeCalculationInputs(ctx, state)
Expand Down
Loading