Skip to content

Commit

Permalink
Merge pull request #7440 from filecoin-project/jen/12tomaster
Browse files Browse the repository at this point in the history
Chocolate to master
  • Loading branch information
jennijuju authored Oct 5, 2021
2 parents fc10281 + 8d9f371 commit 1d2f843
Show file tree
Hide file tree
Showing 112 changed files with 3,871 additions and 606 deletions.
4 changes: 2 additions & 2 deletions build/bootstrap/butterflynet.pi
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWBbZd7Su9XfLUQ12RynGQ3ZmGY1nGqFntmqop9pLNJE6g
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWGKRzEY4tJFTmAmrYUpa1CVVohmV9YjJbC9v5XWY2gUji
/dns4/bootstrap-0.butterfly.fildev.network/tcp/1347/p2p/12D3KooWBzv5sf4eTyo8cjJGfGnpxo6QkEPkRShG9GqjE2A5QaW5
/dns4/bootstrap-1.butterfly.fildev.network/tcp/1347/p2p/12D3KooWBo9TSD4XXRFtu6snv6QNYvXgRaSaVb116YiYEsDWgKtq
Binary file modified build/genesis/butterflynet.car
Binary file not shown.
Binary file modified build/openrpc/full.json.gz
Binary file not shown.
Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
Binary file modified build/openrpc/worker.json.gz
Binary file not shown.
10 changes: 10 additions & 0 deletions build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ import (
"github.com/ipfs/go-cid"

"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/chain/actors/policy"
miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
)

const BootstrappersFile = ""
const GenesisFile = ""

const GenesisNetworkVersion = network.Version14

var UpgradeBreezeHeight = abi.ChainEpoch(-1)

const BreezeGasTampingDuration = 0
Expand All @@ -42,6 +46,8 @@ var UpgradeTurboHeight = abi.ChainEpoch(-15)

var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)

var UpgradeChocolateHeight = abi.ChainEpoch(-17)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
Expand Down Expand Up @@ -82,8 +88,12 @@ func init() {
UpgradeNorwegianHeight = getUpgradeHeight("LOTUS_NORWEGIAN_HEIGHT", UpgradeNorwegianHeight)
UpgradeTurboHeight = getUpgradeHeight("LOTUS_ACTORSV4_HEIGHT", UpgradeTurboHeight)
UpgradeHyperdriveHeight = getUpgradeHeight("LOTUS_HYPERDRIVE_HEIGHT", UpgradeHyperdriveHeight)
UpgradeChocolateHeight = getUpgradeHeight("LOTUS_CHOCOLATE_HEIGHT", UpgradeChocolateHeight)

BuildType |= Build2k

// To test out what this proposal would like on devnets / testnets: https://github.com/filecoin-project/FIPs/pull/190
miner6.FaultMaxAge = miner6.WPoStProvingPeriod * 42
}

const BlockDelaySecs = uint64(4)
Expand Down
32 changes: 20 additions & 12 deletions build/params_butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ package build
import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/chain/actors/policy"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
"github.com/ipfs/go-cid"
)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}

const GenesisNetworkVersion = network.Version13

const BootstrappersFile = "butterflynet.pi"
const GenesisFile = "butterflynet.car"

Expand All @@ -24,19 +28,20 @@ const UpgradeSmokeHeight = -2
const UpgradeIgnitionHeight = -3
const UpgradeRefuelHeight = -4

var UpgradeAssemblyHeight = abi.ChainEpoch(30)
var UpgradeAssemblyHeight = abi.ChainEpoch(-5)

const UpgradeTapeHeight = 60
const UpgradeLiftoffHeight = -5
const UpgradeKumquatHeight = 90
const UpgradeCalicoHeight = 120
const UpgradePersianHeight = 150
const UpgradeClausHeight = 180
const UpgradeOrangeHeight = 210
const UpgradeTrustHeight = 240
const UpgradeNorwegianHeight = UpgradeTrustHeight + (builtin2.EpochsInHour * 12)
const UpgradeTurboHeight = 8922
const UpgradeHyperdriveHeight = 9999999
const UpgradeTapeHeight = -6
const UpgradeLiftoffHeight = -7
const UpgradeKumquatHeight = -8
const UpgradeCalicoHeight = -9
const UpgradePersianHeight = -10
const UpgradeClausHeight = -11
const UpgradeOrangeHeight = -12
const UpgradeTrustHeight = -13
const UpgradeNorwegianHeight = -14
const UpgradeTurboHeight = -15
const UpgradeHyperdriveHeight = -16
const UpgradeChocolateHeight = 6360

func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(2 << 30))
Expand All @@ -49,6 +54,9 @@ func init() {
Devnet = true

BuildType = BuildButterflynet

// To test out what this proposal would like on devnets / testnets: https://github.com/filecoin-project/FIPs/pull/190
miner6.FaultMaxAge = miner6.WPoStProvingPeriod * 42
}

const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
Expand Down
9 changes: 9 additions & 0 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ package build
import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/lotus/chain/actors/policy"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"
"github.com/ipfs/go-cid"
)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}

const GenesisNetworkVersion = network.Version0

const BootstrappersFile = "calibnet.pi"
const GenesisFile = "calibnet.car"

Expand Down Expand Up @@ -49,6 +53,8 @@ const UpgradeTurboHeight = 390

const UpgradeHyperdriveHeight = 420

const UpgradeChocolateHeight = 312746

func init() {
policy.SetConsensusMinerMinPower(abi.NewStoragePower(32 << 30))
policy.SetSupportedProofTypes(
Expand All @@ -61,6 +67,9 @@ func init() {
Devnet = true

BuildType = BuildCalibnet

// To test out what this proposal would like on devnets / testnets: https://github.com/filecoin-project/FIPs/pull/190
miner6.FaultMaxAge = miner6.WPoStProvingPeriod * 42
}

const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
Expand Down
8 changes: 8 additions & 0 deletions build/params_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
miner6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/miner"

"github.com/filecoin-project/lotus/chain/actors/policy"
)

const BootstrappersFile = "interopnet.pi"
const GenesisFile = "interopnet.car"

const GenesisNetworkVersion = network.Version13

var UpgradeBreezeHeight = abi.ChainEpoch(-1)

const BreezeGasTampingDuration = 0
Expand All @@ -44,6 +48,7 @@ var UpgradeNorwegianHeight = abi.ChainEpoch(-14)
var UpgradeTurboHeight = abi.ChainEpoch(-15)

var UpgradeHyperdriveHeight = abi.ChainEpoch(-16)
var UpgradeChocolateHeight = abi.ChainEpoch(-17)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
Expand Down Expand Up @@ -93,6 +98,9 @@ func init() {
BuildType |= BuildInteropnet
SetAddressNetwork(address.Testnet)
Devnet = true

// To test out what this proposal would like on devnets / testnets: https://github.com/filecoin-project/FIPs/pull/190
miner6.FaultMaxAge = miner6.WPoStProvingPeriod * 42
}

const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds)
Expand Down
11 changes: 9 additions & 2 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"math"
"os"

"github.com/filecoin-project/go-state-types/network"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
Expand All @@ -17,6 +19,8 @@ var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
UpgradeSmokeHeight: DrandMainnet,
}

const GenesisNetworkVersion = network.Version0

const BootstrappersFile = "mainnet.pi"
const GenesisFile = "mainnet.car"

Expand Down Expand Up @@ -60,13 +64,16 @@ const UpgradeTurboHeight = 712320
// 2021-06-30T22:00:00Z
var UpgradeHyperdriveHeight = abi.ChainEpoch(892800)

// ???
var UpgradeChocolateHeight = abi.ChainEpoch(999999999)

func init() {
if os.Getenv("LOTUS_USE_TEST_ADDRESSES") != "1" {
SetAddressNetwork(address.Mainnet)
}

if os.Getenv("LOTUS_DISABLE_HYPERDRIVE") == "1" {
UpgradeHyperdriveHeight = math.MaxInt64
if os.Getenv("LOTUS_DISABLE_CHOCOLATE") == "1" {
UpgradeChocolateHeight = math.MaxInt64
}

Devnet = false
Expand Down
2 changes: 2 additions & 0 deletions build/params_shared_vals.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const UnixfsLinksPerLevel = 1024
// Consensus / Network

const AllowableClockDriftSecs = uint64(1)

// TODO: This is still terrible...What's the impact of updating this before mainnet actually upgrades
const NewestNetworkVersion = network.Version13

// Epochs
Expand Down
5 changes: 4 additions & 1 deletion build/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,15 @@ var (
UpgradeNorwegianHeight abi.ChainEpoch = -13
UpgradeTurboHeight abi.ChainEpoch = -14
UpgradeHyperdriveHeight abi.ChainEpoch = -15
UpgradeChocolateHeight abi.ChainEpoch = -16

DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}

NewestNetworkVersion = network.Version11
GenesisNetworkVersion = network.Version0

NewestNetworkVersion = network.Version14
ActorUpgradeNetworkVersion = network.Version4

Devnet = true
Expand Down
2 changes: 1 addition & 1 deletion build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func BuildTypeString() string {
}

// BuildVersion is the local build version
const BuildVersion = "1.11.4-dev"
const BuildVersion = "1.13.0-dev"

func UserVersion() string {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
Expand Down
15 changes: 15 additions & 0 deletions chain/actors/builtin/account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
builtin4 "github.com/filecoin-project/specs-actors/v4/actors/builtin"

builtin5 "github.com/filecoin-project/specs-actors/v5/actors/builtin"

builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin"
)

func init() {
Expand All @@ -44,6 +46,10 @@ func init() {
builtin.RegisterActorState(builtin5.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
return load5(store, root)
})

builtin.RegisterActorState(builtin6.AccountActorCodeID, func(store adt.Store, root cid.Cid) (cbor.Marshaler, error) {
return load6(store, root)
})
}

var Methods = builtin4.MethodsAccount
Expand All @@ -66,6 +72,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case builtin5.AccountActorCodeID:
return load5(store, act.Head)

case builtin6.AccountActorCodeID:
return load6(store, act.Head)

}
return nil, xerrors.Errorf("unknown actor code %s", act.Code)
}
Expand All @@ -88,6 +97,9 @@ func MakeState(store adt.Store, av actors.Version, addr address.Address) (State,
case actors.Version5:
return make5(store, addr)

case actors.Version6:
return make6(store, addr)

}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
Expand All @@ -110,6 +122,9 @@ func GetActorCodeID(av actors.Version) (cid.Cid, error) {
case actors.Version5:
return builtin5.AccountActorCodeID, nil

case actors.Version6:
return builtin6.AccountActorCodeID, nil

}

return cid.Undef, xerrors.Errorf("unknown actor version %d", av)
Expand Down
40 changes: 40 additions & 0 deletions chain/actors/builtin/account/v6.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package account

import (
"github.com/filecoin-project/go-address"
"github.com/ipfs/go-cid"

"github.com/filecoin-project/lotus/chain/actors/adt"

account6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/account"
)

var _ State = (*state6)(nil)

func load6(store adt.Store, root cid.Cid) (State, error) {
out := state6{store: store}
err := store.Get(store.Context(), root, &out)
if err != nil {
return nil, err
}
return &out, nil
}

func make6(store adt.Store, addr address.Address) (State, error) {
out := state6{store: store}
out.State = account6.State{Address: addr}
return &out, nil
}

type state6 struct {
account6.State
store adt.Store
}

func (s *state6) PubkeyAddress() (address.Address, error) {
return s.Address, nil
}

func (s *state6) GetState() interface{} {
return &s.State
}
Loading

0 comments on commit 1d2f843

Please sign in to comment.