2021-08-27 19:25:43 +00:00
|
|
|
//go:build interopnet
|
2021-06-02 18:49:10 +00:00
|
|
|
// +build interopnet
|
|
|
|
|
|
|
|
package build
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"strconv"
|
|
|
|
|
|
|
|
"github.com/filecoin-project/go-address"
|
|
|
|
"github.com/filecoin-project/go-state-types/abi"
|
2021-10-02 16:20:09 +00:00
|
|
|
"github.com/filecoin-project/go-state-types/network"
|
2021-06-02 18:49:10 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/actors/policy"
|
2022-03-26 02:21:36 +00:00
|
|
|
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
|
2022-05-18 03:48:06 +00:00
|
|
|
"github.com/ipfs/go-cid"
|
2021-06-02 18:49:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const BootstrappersFile = "interopnet.pi"
|
|
|
|
const GenesisFile = "interopnet.car"
|
|
|
|
|
2022-04-21 21:00:44 +00:00
|
|
|
const GenesisNetworkVersion = network.Version15
|
2021-10-02 16:20:09 +00:00
|
|
|
|
2021-06-02 18:49:10 +00:00
|
|
|
var UpgradeBreezeHeight = abi.ChainEpoch(-1)
|
|
|
|
|
|
|
|
const BreezeGasTampingDuration = 0
|
|
|
|
|
|
|
|
var UpgradeSmokeHeight = abi.ChainEpoch(-1)
|
|
|
|
var UpgradeIgnitionHeight = abi.ChainEpoch(-2)
|
|
|
|
var UpgradeRefuelHeight = abi.ChainEpoch(-3)
|
|
|
|
var UpgradeTapeHeight = abi.ChainEpoch(-4)
|
|
|
|
|
|
|
|
var UpgradeAssemblyHeight = abi.ChainEpoch(-5)
|
|
|
|
var UpgradeLiftoffHeight = abi.ChainEpoch(-6)
|
|
|
|
|
|
|
|
var UpgradeKumquatHeight = abi.ChainEpoch(-7)
|
2021-07-15 15:04:24 +00:00
|
|
|
var UpgradeCalicoHeight = abi.ChainEpoch(-9)
|
|
|
|
var UpgradePersianHeight = abi.ChainEpoch(-10)
|
|
|
|
var UpgradeOrangeHeight = abi.ChainEpoch(-11)
|
|
|
|
var UpgradeClausHeight = abi.ChainEpoch(-12)
|
2021-06-02 18:49:10 +00:00
|
|
|
|
2021-07-15 15:04:24 +00:00
|
|
|
var UpgradeTrustHeight = abi.ChainEpoch(-13)
|
2021-06-02 18:49:10 +00:00
|
|
|
|
2021-07-15 15:04:24 +00:00
|
|
|
var UpgradeNorwegianHeight = abi.ChainEpoch(-14)
|
2021-06-02 18:49:10 +00:00
|
|
|
|
2021-07-15 15:04:24 +00:00
|
|
|
var UpgradeTurboHeight = abi.ChainEpoch(-15)
|
2021-06-02 18:49:10 +00:00
|
|
|
|
2021-07-15 15:04:24 +00:00
|
|
|
var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
|
2021-09-15 15:22:25 +00:00
|
|
|
var UpgradeChocolateHeight = abi.ChainEpoch(-17)
|
2022-01-11 22:41:20 +00:00
|
|
|
var UpgradeOhSnapHeight = abi.ChainEpoch(-18)
|
2022-05-18 03:48:06 +00:00
|
|
|
var UpgradeFVM1Height = abi.ChainEpoch(100)
|
2021-06-02 18:49:10 +00:00
|
|
|
|
|
|
|
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
|
|
|
|
0: DrandMainnet,
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
policy.SetSupportedProofTypes(
|
2022-03-26 02:21:36 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg2KiBV1,
|
|
|
|
abi.RegisteredSealProof_StackedDrg8MiBV1,
|
2021-06-02 18:49:10 +00:00
|
|
|
abi.RegisteredSealProof_StackedDrg512MiBV1,
|
|
|
|
)
|
2022-03-26 02:21:36 +00:00
|
|
|
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048))
|
|
|
|
policy.SetMinVerifiedDealSize(abi.NewStoragePower(256))
|
|
|
|
policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10))
|
2021-06-02 18:49:10 +00:00
|
|
|
|
|
|
|
getUpgradeHeight := func(ev string, def abi.ChainEpoch) abi.ChainEpoch {
|
|
|
|
hs, found := os.LookupEnv(ev)
|
|
|
|
if found {
|
|
|
|
h, err := strconv.Atoi(hs)
|
|
|
|
if err != nil {
|
|
|
|
log.Panicf("failed to parse %s env var", ev)
|
|
|
|
}
|
|
|
|
|
|
|
|
return abi.ChainEpoch(h)
|
|
|
|
}
|
|
|
|
|
|
|
|
return def
|
|
|
|
}
|
|
|
|
|
|
|
|
UpgradeBreezeHeight = getUpgradeHeight("LOTUS_BREEZE_HEIGHT", UpgradeBreezeHeight)
|
|
|
|
UpgradeSmokeHeight = getUpgradeHeight("LOTUS_SMOKE_HEIGHT", UpgradeSmokeHeight)
|
|
|
|
UpgradeIgnitionHeight = getUpgradeHeight("LOTUS_IGNITION_HEIGHT", UpgradeIgnitionHeight)
|
|
|
|
UpgradeRefuelHeight = getUpgradeHeight("LOTUS_REFUEL_HEIGHT", UpgradeRefuelHeight)
|
|
|
|
UpgradeTapeHeight = getUpgradeHeight("LOTUS_TAPE_HEIGHT", UpgradeTapeHeight)
|
|
|
|
UpgradeAssemblyHeight = getUpgradeHeight("LOTUS_ACTORSV2_HEIGHT", UpgradeAssemblyHeight)
|
|
|
|
UpgradeLiftoffHeight = getUpgradeHeight("LOTUS_LIFTOFF_HEIGHT", UpgradeLiftoffHeight)
|
|
|
|
UpgradeKumquatHeight = getUpgradeHeight("LOTUS_KUMQUAT_HEIGHT", UpgradeKumquatHeight)
|
|
|
|
UpgradeCalicoHeight = getUpgradeHeight("LOTUS_CALICO_HEIGHT", UpgradeCalicoHeight)
|
|
|
|
UpgradePersianHeight = getUpgradeHeight("LOTUS_PERSIAN_HEIGHT", UpgradePersianHeight)
|
|
|
|
UpgradeOrangeHeight = getUpgradeHeight("LOTUS_ORANGE_HEIGHT", UpgradeOrangeHeight)
|
|
|
|
UpgradeClausHeight = getUpgradeHeight("LOTUS_CLAUS_HEIGHT", UpgradeClausHeight)
|
|
|
|
UpgradeTrustHeight = getUpgradeHeight("LOTUS_ACTORSV3_HEIGHT", UpgradeTrustHeight)
|
|
|
|
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
|
|
|
|
UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
|
|
|
|
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
|
2022-03-01 03:57:40 +00:00
|
|
|
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)
|
|
|
|
UpgradeOhSnapHeight = getUpgradeHeight("LOTUS_OHSNAP_HEIGHT", UpgradeOhSnapHeight)
|
|
|
|
UpgradeFVM1Height = getUpgradeHeight("LOTUS_FVM1_HEIGHT", UpgradeFVM1Height)
|
2021-06-02 18:49:10 +00:00
|
|
|
|
|
|
|
BuildType |= BuildInteropnet
|
|
|
|
SetAddressNetwork(address.Testnet)
|
|
|
|
Devnet = true
|
2021-10-01 19:39:45 +00:00
|
|
|
|
2021-06-02 18:49:10 +00:00
|
|
|
}
|
|
|
|
|
2022-03-26 02:21:36 +00:00
|
|
|
const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
|
2021-06-02 18:49:10 +00:00
|
|
|
|
2022-03-26 02:21:36 +00:00
|
|
|
const PropagationDelaySecs = uint64(6)
|
2021-06-02 18:49:10 +00:00
|
|
|
|
|
|
|
// BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start
|
|
|
|
const BootstrapPeerThreshold = 2
|
|
|
|
|
|
|
|
var WhitelistedBlock = cid.Undef
|