Make devnets work again

This commit is contained in:
Aayush Rajasekaran 2021-05-26 12:40:13 -04:00
parent 7714537239
commit 1ad2c4dab0
3 changed files with 17 additions and 4 deletions

View File

@ -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,

View File

@ -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
}

View File

@ -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 {