@@ -28,11 +28,13 @@ import (
28
28
"github.com/filecoin-project/go-state-types/network"
29
29
30
30
builtintypes "github.com/filecoin-project/go-state-types/builtin"
31
+ miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner"
31
32
minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner"
32
33
miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner"
33
34
34
35
"github.com/filecoin-project/venus/venus-shared/actors/builtin/power"
35
36
"github.com/filecoin-project/venus/venus-shared/actors/builtin/reward"
37
+ "github.com/filecoin-project/venus/venus-shared/actors/builtin/system"
36
38
37
39
"github.com/filecoin-project/venus/venus-shared/actors/builtin/market"
38
40
"github.com/filecoin-project/venus/venus-shared/actors/builtin/miner"
@@ -159,7 +161,11 @@ func SetupStorageMiners(ctx context.Context,
159
161
i := i
160
162
m := m
161
163
162
- spt , err := miner .SealProofTypeFromSectorSize (m .SectorSize , nv , synthetic )
164
+ variant := miner .SealProofVariant_Standard
165
+ if synthetic {
166
+ variant = miner .SealProofVariant_Synthetic
167
+ }
168
+ spt , err := miner .SealProofTypeFromSectorSize (m .SectorSize , nv , variant )
163
169
if err != nil {
164
170
return cid .Undef , err
165
171
}
@@ -332,9 +338,6 @@ func SetupStorageMiners(ctx context.Context,
332
338
if err != nil {
333
339
return cid .Undef , fmt .Errorf ("flushing vm: %w" , err )
334
340
}
335
- if err != nil {
336
- return cid .Undef , fmt .Errorf ("flushing vm: %w" , err )
337
- }
338
341
339
342
nst , err := tree .LoadState (ctx , cst , nh )
340
343
if err != nil {
@@ -533,8 +536,12 @@ func SetupStorageMiners(ctx context.Context,
533
536
534
537
// Commit one-by-one, otherwise pledge math tends to explode
535
538
var paramBytes []byte
536
-
537
- if av >= actorstypes .Version6 {
539
+ if av >= actorstypes .Version14 {
540
+ confirmParams := & miner14.InternalSectorSetupForPresealParams {
541
+ Sectors : []abi.SectorNumber {preseal .SectorID },
542
+ }
543
+ paramBytes = mustEnc (confirmParams )
544
+ } else if av >= actorstypes .Version6 {
538
545
// TODO: fixup
539
546
confirmParams := & builtin6.ConfirmSectorProofsParams {
540
547
Sectors : []abi.SectorNumber {preseal .SectorID },
@@ -549,9 +556,17 @@ func SetupStorageMiners(ctx context.Context,
549
556
paramBytes = mustEnc (confirmParams )
550
557
}
551
558
552
- _ , err = doExecValue (ctx , genesisVM , minerInfos [i ].maddr , power .Address , big .Zero (), builtintypes .MethodsMiner .ConfirmSectorProofsValid , paramBytes )
553
- if err != nil {
554
- return cid .Undef , fmt .Errorf ("failed to confirm presealed sectors: %w" , err )
559
+ var csErr error
560
+ if nv >= network .Version23 {
561
+ _ , csErr = doExecValue (ctx , genesisVM , minerInfos [i ].maddr , system .Address , big .Zero (), builtintypes .MethodsMiner .InternalSectorSetupForPreseal ,
562
+ paramBytes )
563
+ } else {
564
+ _ , csErr = doExecValue (ctx , genesisVM , minerInfos [i ].maddr , power .Address , big .Zero (), builtintypes .MethodsMiner .InternalSectorSetupForPreseal ,
565
+ paramBytes )
566
+ }
567
+
568
+ if csErr != nil {
569
+ return cid .Undef , fmt .Errorf ("failed to confirm presealed sectors: %w" , csErr )
555
570
}
556
571
557
572
if av > actorstypes .Version2 {
0 commit comments