diff --git a/cmd/lotus-seed/genesis.go b/cmd/lotus-seed/genesis.go index 87493c58a..66de93888 100644 --- a/cmd/lotus-seed/genesis.go +++ b/cmd/lotus-seed/genesis.go @@ -59,7 +59,7 @@ var genesisNewCmd = &cli.Command{ return xerrors.New("seed genesis new [genesis.json]") } out := genesis.Template{ - NetworkVersion: network.Version0, + NetworkVersion: build.NewestNetworkVersion, Accounts: []genesis.Actor{}, Miners: []genesis.Miner{}, VerifregRootKey: gen.DefaultVerifregRootkeyActor, diff --git a/cmd/lotus-seed/main.go b/cmd/lotus-seed/main.go index c92397125..42f4b74e4 100644 --- a/cmd/lotus-seed/main.go +++ b/cmd/lotus-seed/main.go @@ -96,7 +96,6 @@ var preSealCmd = &cli.Command{ }, &cli.IntFlag{ Name: "network-version", - Value: 0, Usage: "specify network version", }, }, @@ -134,7 +133,12 @@ var preSealCmd = &cli.Command{ } sectorSize := abi.SectorSize(sectorSizeInt) - spt, err := miner.SealProofTypeFromSectorSize(sectorSize, network.Version(c.Uint64("network-version"))) + nv := build.NewestNetworkVersion + if c.IsSet("network-version") { + nv = network.Version(c.Uint64("network-version")) + } + + spt, err := miner.SealProofTypeFromSectorSize(sectorSize, nv) if err != nil { return err } diff --git a/lotuspond/spawn.go b/lotuspond/spawn.go index 9085bc24a..900c372b1 100644 --- a/lotuspond/spawn.go +++ b/lotuspond/spawn.go @@ -11,6 +11,9 @@ import ( "sync/atomic" "time" + "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/chain/actors/builtin/miner" + "github.com/google/uuid" "golang.org/x/xerrors" @@ -48,7 +51,12 @@ func (api *api) Spawn() (nodeInfo, error) { } sbroot := filepath.Join(dir, "preseal") - genm, ki, err := seed.PreSeal(genMiner, abi.RegisteredSealProof_StackedDrg2KiBV1, 0, 2, sbroot, []byte("8"), nil, false) + spt, err := miner.SealProofTypeFromSectorSize(2<<10, build.NewestNetworkVersion) + if err != nil { + return nodeInfo{}, err + } + + genm, ki, err := seed.PreSeal(genMiner, spt, 0, 2, sbroot, []byte("8"), nil, false) if err != nil { return nodeInfo{}, xerrors.Errorf("preseal failed: %w", err) } @@ -71,6 +79,7 @@ func (api *api) Spawn() (nodeInfo, error) { template.VerifregRootKey = gen.DefaultVerifregRootkeyActor template.RemainderAccount = gen.DefaultRemainderAccountActor template.NetworkName = "pond-" + uuid.New().String() + template.NetworkVersion = build.NewestNetworkVersion tb, err := json.Marshal(&template) if err != nil {