diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index c2c1d5e6f49..340ed75f1f6 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -18,6 +18,7 @@ import ( "github.com/filecoin-project/go-state-types/big" builtintypes "github.com/filecoin-project/go-state-types/builtin" power11 "github.com/filecoin-project/go-state-types/builtin/v11/power" + miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner" minertypes "github.com/filecoin-project/go-state-types/builtin/v8/miner" markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" miner9 "github.com/filecoin-project/go-state-types/builtin/v9/miner" @@ -41,6 +42,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/actors/builtin/power" "github.com/filecoin-project/lotus/chain/actors/builtin/reward" + "github.com/filecoin-project/lotus/chain/actors/builtin/system" "github.com/filecoin-project/lotus/chain/actors/policy" "github.com/filecoin-project/lotus/chain/consensus" lrand "github.com/filecoin-project/lotus/chain/rand" @@ -495,7 +497,12 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal // Commit one-by-one, otherwise pledge math tends to explode var paramBytes []byte - if av >= actorstypes.Version6 { + if av >= actorstypes.Version14 { + confirmParams := &miner14.InternalSectorSetupForPresealParams{ + Sectors: []abi.SectorNumber{preseal.SectorID}, + } + paramBytes = mustEnc(confirmParams) + } else if av >= actorstypes.Version6 { // TODO: fixup confirmParams := &builtin6.ConfirmSectorProofsParams{ Sectors: []abi.SectorNumber{preseal.SectorID}, @@ -510,9 +517,17 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal paramBytes = mustEnc(confirmParams) } - _, err = doExecValue(ctx, genesisVm, minerInfos[i].maddr, power.Address, big.Zero(), builtintypes.MethodsMiner.ConfirmSectorProofsValid, paramBytes) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to confirm presealed sectors: %w", err) + var csErr error + if nv >= network.Version23 { + _, csErr = doExecValue(ctx, genesisVm, minerInfos[i].maddr, system.Address, big.Zero(), builtintypes.MethodsMiner.InternalSectorSetupForPreseal, + paramBytes) + } else { + _, csErr = doExecValue(ctx, genesisVm, minerInfos[i].maddr, power.Address, big.Zero(), builtintypes.MethodsMiner.InternalSectorSetupForPreseal, + paramBytes) + } + + if csErr != nil { + return cid.Undef, xerrors.Errorf("failed to confirm presealed sectors: %w", csErr) } if av >= actorstypes.Version2 {