Skip to content

Commit 467c6ff

Browse files
committed
chore(deps): adapt to QAP API changes
Ref: filecoin-project/go-state-types#308
1 parent 4f92348 commit 467c6ff

24 files changed

+65
-61
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# UNRELEASED
44
- Improve eth filter performance for nodes serving many clients. ([filecoin-project/lotus#12603](https://github.com/filecoin-project/lotus/pull/12603))
55

6+
## Improvements
7+
8+
- The miner actor builtin `QAPowerForWeight` no longer accepts the unused "dealWeight" parameter, the function signature now only takes 3 arguments: sectorSize, sectorDuration, verifiedWeight. ([filecoin-project/lotus#12445](https://github.com/filecoin-project/lotus/pull/12445))
9+
610
## Bug Fixes
711

812
- Make `EthTraceFilter` / `trace_filter` skip null rounds instead of erroring. ([filecoin-project/lotus#12702](https://github.com/filecoin-project/lotus/pull/12702))

chain/actors/builtin/builtin.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/filecoin-project/go-address"
99
"github.com/filecoin-project/go-state-types/abi"
1010
"github.com/filecoin-project/go-state-types/builtin"
11+
minertypes "github.com/filecoin-project/go-state-types/builtin/v15/miner"
1112
smoothingtypes "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing"
12-
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
1313
"github.com/filecoin-project/go-state-types/manifest"
1414
"github.com/filecoin-project/go-state-types/proof"
1515
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
@@ -56,8 +56,8 @@ type ExtendedSectorInfo = proof.ExtendedSectorInfo
5656
type PoStProof = proof.PoStProof
5757
type FilterEstimate = smoothingtypes.FilterEstimate
5858

59-
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
60-
return minertypes.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
59+
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, verifiedWeight abi.DealWeight) abi.StoragePower {
60+
return minertypes.QAPowerForWeight(size, duration, verifiedWeight)
6161
}
6262

6363
func ActorNameByCode(c cid.Cid) string {

chain/actors/builtin/builtin.go.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
"github.com/filecoin-project/lotus/chain/actors"
2121

22-
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
22+
minertypes "github.com/filecoin-project/go-state-types/builtin/v15/miner"
2323
smoothingtypes "github.com/filecoin-project/go-state-types/builtin/v8/util/smoothing"
2424
)
2525

@@ -56,8 +56,8 @@ type ExtendedSectorInfo = proof.ExtendedSectorInfo
5656
type PoStProof = proof.PoStProof
5757
type FilterEstimate = smoothingtypes.FilterEstimate
5858

59-
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower {
60-
return minertypes.QAPowerForWeight(size, duration, dealWeight, verifiedWeight)
59+
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, verifiedWeight abi.DealWeight) abi.StoragePower {
60+
return minertypes.QAPowerForWeight(size, duration, verifiedWeight)
6161
}
6262

6363
func ActorNameByCode(c cid.Cid) string {

chain/actors/builtin/market/actor.go.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ type State interface {
9090
Proposals() (DealProposals, error)
9191
VerifyDealsForActivation(
9292
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
93-
) (weight, verifiedWeight abi.DealWeight, err error)
93+
) (verifiedWeight abi.DealWeight, err error)
9494
NextID() (abi.DealID, error)
9595
GetState() interface{}
9696
GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error)

chain/actors/builtin/market/market.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ type State interface {
167167
Proposals() (DealProposals, error)
168168
VerifyDealsForActivation(
169169
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
170-
) (weight, verifiedWeight abi.DealWeight, err error)
170+
) (verifiedWeight abi.DealWeight, err error)
171171
NextID() (abi.DealID, error)
172172
GetState() interface{}
173173
GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error)

chain/actors/builtin/market/state.go.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ func (s *state{{.v}}) LockedTable() (BalanceTable, error) {
146146

147147
func (s *state{{.v}}) VerifyDealsForActivation(
148148
minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
149-
) (weight, verifiedWeight abi.DealWeight, err error) {
150-
w, vw{{if (ge .v 2)}}, _{{end}}, err := market{{.v}}.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch)
151-
return w, vw, err
149+
) (verifiedWeight abi.DealWeight, err error) {
150+
_, vw{{if (ge .v 2)}}, _{{end}}, err := market{{.v}}.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch)
151+
return vw, err
152152
}
153153

154154
func (s *state{{.v}}) NextID() (abi.DealID, error) {

chain/actors/builtin/market/v0.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v10.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v11.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v12.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v13.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v14.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v15.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v2.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v3.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v4.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v5.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v6.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v7.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v8.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/actors/builtin/market/v9.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chain/gen/genesis/miners.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal
293293
}
294294

295295
rawPow = big.Add(rawPow, big.NewInt(int64(m.SectorSize)))
296-
sectorWeight := builtin.QAPowerForWeight(m.SectorSize, minerInfos[i].presealExp, big.Zero(), markettypes.DealWeight(&preseal.Deal))
296+
sectorWeight := builtin.QAPowerForWeight(m.SectorSize, minerInfos[i].presealExp, markettypes.DealWeight(&preseal.Deal))
297297
minerInfos[i].sectorWeight = append(minerInfos[i].sectorWeight, sectorWeight)
298298
qaPow = big.Add(qaPow, sectorWeight)
299299
}

itests/migration_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ func preFip0081StateMinerInitialPledgeForSector(ctx context.Context, t *testing.
11201120
req.NoError(err)
11211121

11221122
verifiedWeight := big.Mul(big.NewIntUnsigned(verifiedSize), big.NewInt(int64(sectorDuration)))
1123-
sectorWeight := builtin2.QAPowerForWeight(sectorSize, sectorDuration, big.Zero(), verifiedWeight)
1123+
sectorWeight := builtin2.QAPowerForWeight(sectorSize, sectorDuration, verifiedWeight)
11241124

11251125
thisEpochBaselinePower, err := rewardState.(interface {
11261126
ThisEpochBaselinePower() (abi.StoragePower, error)

node/impl/full/state.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1449,12 +1449,12 @@ func (a *StateAPI) calculateSectorWeight(ctx context.Context, maddr address.Addr
14491449
return types.EmptyInt, xerrors.Errorf("loading market actor: %w", err)
14501450
} else if s, err := market.Load(store, act); err != nil {
14511451
return types.EmptyInt, xerrors.Errorf("loading market actor state: %w", err)
1452-
} else if w, vw, err := s.VerifyDealsForActivation(maddr, pci.DealIDs, height, pci.Expiration); err != nil {
1452+
} else if vw, err := s.VerifyDealsForActivation(maddr, pci.DealIDs, height, pci.Expiration); err != nil {
14531453
return types.EmptyInt, xerrors.Errorf("verifying deals for activation: %w", err)
14541454
} else {
14551455
// NB: not exactly accurate, but should always lead us to *over* estimate, not under
14561456
duration := pci.Expiration - height
1457-
sectorWeight = builtin.QAPowerForWeight(ssize, duration, w, vw)
1457+
sectorWeight = builtin.QAPowerForWeight(ssize, duration, vw)
14581458
}
14591459

14601460
return sectorWeight, nil
@@ -1640,7 +1640,7 @@ func (a *StateAPI) StateMinerInitialPledgeForSector(ctx context.Context, sectorD
16401640
}
16411641

16421642
verifiedWeight := big.Mul(big.NewIntUnsigned(verifiedSize), big.NewInt(int64(sectorDuration)))
1643-
sectorWeight := builtin.QAPowerForWeight(sectorSize, sectorDuration, big.Zero(), verifiedWeight)
1643+
sectorWeight := builtin.QAPowerForWeight(sectorSize, sectorDuration, verifiedWeight)
16441644

16451645
epochsSinceRampStart, rampDurationEpochs, err := a.getPledgeRampParams(ctx, ts.Height(), state)
16461646
if err != nil {

0 commit comments

Comments
 (0)