Skip to content

Commit

Permalink
Merge pull request #6416 from filecoin-project/fix/StateMinerPreCommi…
Browse files Browse the repository at this point in the history
…tDepositForPower

fix: calculation miner deposit
  • Loading branch information
simlecode authored Oct 15, 2024
2 parents 8f3035f + 967f3a5 commit 814862a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/submodule/chain/miner_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,9 +792,17 @@ func (msa *minerStateAPI) StateMinerPreCommitDepositForPower(ctx context.Context
return types.EmptyInt, fmt.Errorf("loading reward actor state: %w", err)
}

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

_, powerSmoothed, err := msa.pledgeCalculationInputs(ctx, sTree)
Expand Down

0 comments on commit 814862a

Please sign in to comment.