Skip to content

Commit

Permalink
feat: Introduce nv19 skeleton
Browse files Browse the repository at this point in the history
Update to go-state-types v0.11.0-alpha-1

Introduce dummy v11 actor bundles

Make new actors adapters

Add upgrade to Upgrade Schedules

make jen

Update to go-state-types v0.11.0-alpha-2
  • Loading branch information
arajasek committed Mar 29, 2023
1 parent 5f91072 commit 3636af4
Show file tree
Hide file tree
Showing 55 changed files with 2,970 additions and 94 deletions.
2 changes: 2 additions & 0 deletions api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ type ForkUpgradeParams struct {
UpgradeSkyrHeight abi.ChainEpoch
UpgradeSharkHeight abi.ChainEpoch
UpgradeHyggeHeight abi.ChainEpoch
UpgradeLightningHeight abi.ChainEpoch
UpgradeThunderHeight abi.ChainEpoch
}

type NonceMapType map[address.Address]uint64
Expand Down
Binary file added build/actors/v11.tar.zst
Binary file not shown.
181 changes: 171 additions & 10 deletions build/builtin_actors_gen.go

Large diffs are not rendered by default.

Binary file modified build/openrpc/full.json.gz
Binary file not shown.
8 changes: 7 additions & 1 deletion build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ var UpgradeSkyrHeight = abi.ChainEpoch(-19)

var UpgradeSharkHeight = abi.ChainEpoch(-20)

var UpgradeHyggeHeight = abi.ChainEpoch(30)
var UpgradeHyggeHeight = abi.ChainEpoch(-21)

var UpgradeLightningHeight = 30

var UpgradeThunderHeight = 1000

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
Expand Down Expand Up @@ -114,6 +118,8 @@ func init() {
UpgradeSkyrHeight = getUpgradeHeight("LOTUS_SKYR_HEIGHT", UpgradeSkyrHeight)
UpgradeSharkHeight = getUpgradeHeight("LOTUS_SHARK_HEIGHT", UpgradeSharkHeight)
UpgradeHyggeHeight = getUpgradeHeight("LOTUS_HYGGE_HEIGHT", UpgradeHyggeHeight)
UpgradeLightningHeight = getUpgradeHeight("LOTUS_LIGHTNING_HEIGHT", UpgradeLightningHeight)
UpgradeThunderHeight = getUpgradeHeight("LOTUS_THUNDER_HEIGHT", UpgradeThunderHeight)

BuildType |= Build2k

Expand Down
6 changes: 6 additions & 0 deletions build/params_butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ const UpgradeSkyrHeight = -19
const UpgradeSharkHeight = abi.ChainEpoch(-20)
const UpgradeHyggeHeight = abi.ChainEpoch(600)

// ??????????
const UpgradeLightningHeight = 999999999999999

// ??????????????????
const UpgradeThunderHeight = UpgradeLightningHeight + 1

var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg512MiBV1,
abi.RegisteredSealProof_StackedDrg32GiBV1,
Expand Down
6 changes: 6 additions & 0 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ const UpgradeSharkHeight = 16800 // 6 days after genesis
// 2023-02-21T16:30:00Z
const UpgradeHyggeHeight = 322354

// ??????????
const UpgradeLightningHeight = 999999999999999

// ??????????????????
const UpgradeThunderHeight = UpgradeLightningHeight + 1

var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
Expand Down
8 changes: 7 additions & 1 deletion build/params_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ var UpgradeSkyrHeight = abi.ChainEpoch(-19)

const UpgradeSharkHeight = abi.ChainEpoch(-20)

const UpgradeHyggeHeight = abi.ChainEpoch(99999999999999)
const UpgradeHyggeHeight = abi.ChainEpoch(100)

// ??????????
const UpgradeLightningHeight = 200

// ??????????????????
const UpgradeThunderHeight = 300

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
Expand Down
16 changes: 13 additions & 3 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ const UpgradeSkyrHeight = 1960320
const UpgradeSharkHeight = 2383680

// 2023-03-14T15:14:00Z
var UpgradeHyggeHeight = abi.ChainEpoch(2683348)
const UpgradeHyggeHeight = 2683348

// ??????????
var UpgradeLightningHeight = abi.ChainEpoch(9999999999)

// ??????????
var UpgradeThunderHeight = UpgradeLightningHeight + 1

var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
Expand All @@ -102,8 +108,12 @@ func init() {
SetAddressNetwork(address.Mainnet)
}

if os.Getenv("LOTUS_DISABLE_HYGGE") == "1" {
UpgradeHyggeHeight = math.MaxInt64
if os.Getenv("LOTUS_DISABLE_LIGHTNING") == "1" {
UpgradeLightningHeight = math.MaxInt64
}

if os.Getenv("LOTUS_DISABLE_THUNDER") == "1" {
UpgradeThunderHeight = math.MaxInt64
}

// NOTE: DO NOT change this unless you REALLY know what you're doing. This is not consensus critical, however,
Expand Down
15 changes: 8 additions & 7 deletions build/params_shared_vals.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ const UnixfsLinksPerLevel = 1024

const AllowableClockDriftSecs = uint64(1)

// Used by tests and some obscure tooling
/* inline-gen template
const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
/* inline-gen start */
// TODO: nv19: Re-enable when migration is setup
//// Used by tests and some obscure tooling
///* inline-gen template
//
//const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
//
///* inline-gen start */

const TestNetworkVersion = network.Version18

/* inline-gen end */
///* inline-gen end */

// Epochs
const ForkLengthThreshold = Finality
Expand Down
2 changes: 2 additions & 0 deletions build/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ var (
UpgradeSkyrHeight abi.ChainEpoch = -18
UpgradeSharkHeight abi.ChainEpoch = -19
UpgradeHyggeHeight abi.ChainEpoch = -20
UpgradeLightningHeight abi.ChainEpoch = -21
UpgradeThunderHeight abi.ChainEpoch = -22

DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
Expand Down
11 changes: 9 additions & 2 deletions chain/actors/builtin/account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/filecoin-project/go-address"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin10 "github.com/filecoin-project/go-state-types/builtin"
builtin11 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/manifest"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
Expand All @@ -22,7 +22,7 @@ import (
"github.com/filecoin-project/lotus/chain/types"
)

var Methods = builtin10.MethodsAccount
var Methods = builtin11.MethodsAccount

func Load(store adt.Store, act *types.Actor) (State, error) {
if name, av, ok := actors.GetActorMetaByCode(act.Code); ok {
Expand All @@ -41,6 +41,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version10:
return load10(store, act.Head)

case actorstypes.Version11:
return load11(store, act.Head)

}
}

Expand Down Expand Up @@ -105,6 +108,9 @@ func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (S
case actorstypes.Version10:
return make10(store, addr)

case actorstypes.Version11:
return make11(store, addr)

}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
Expand Down Expand Up @@ -132,5 +138,6 @@ func AllCodes() []cid.Cid {
(&state8{}).Code(),
(&state9{}).Code(),
(&state10{}).Code(),
(&state11{}).Code(),
}
}
62 changes: 62 additions & 0 deletions chain/actors/builtin/account/v11.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions chain/actors/builtin/cron/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"golang.org/x/xerrors"

actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin10 "github.com/filecoin-project/go-state-types/builtin"
builtin11 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/manifest"
builtin0 "github.com/filecoin-project/specs-actors/actors/builtin"
builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin"
Expand Down Expand Up @@ -37,6 +37,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version10:
return load10(store, act.Head)

case actorstypes.Version11:
return load11(store, act.Head)

}
}

Expand Down Expand Up @@ -101,13 +104,16 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
case actorstypes.Version10:
return make10(store)

case actorstypes.Version11:
return make11(store)

}
return nil, xerrors.Errorf("unknown actor version %d", av)
}

var (
Address = builtin10.CronActorAddr
Methods = builtin10.MethodsCron
Address = builtin11.CronActorAddr
Methods = builtin11.MethodsCron
)

type State interface {
Expand All @@ -130,5 +136,6 @@ func AllCodes() []cid.Cid {
(&state8{}).Code(),
(&state9{}).Code(),
(&state10{}).Code(),
(&state11{}).Code(),
}
}
57 changes: 57 additions & 0 deletions chain/actors/builtin/cron/v11.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions chain/actors/builtin/datacap/datacap.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtin10 "github.com/filecoin-project/go-state-types/builtin"
builtin11 "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/manifest"

Expand All @@ -17,8 +17,8 @@ import (
)

var (
Address = builtin10.DatacapActorAddr
Methods = builtin10.MethodsDatacap
Address = builtin11.DatacapActorAddr
Methods = builtin11.MethodsDatacap
)

func Load(store adt.Store, act *types.Actor) (State, error) {
Expand All @@ -35,6 +35,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version10:
return load10(store, act.Head)

case actorstypes.Version11:
return load11(store, act.Head)

}
}

Expand All @@ -50,6 +53,9 @@ func MakeState(store adt.Store, av actorstypes.Version, governor address.Address
case actorstypes.Version10:
return make10(store, governor, bitwidth)

case actorstypes.Version11:
return make11(store, governor, bitwidth)

default:
return nil, xerrors.Errorf("datacap actor only valid for actors v9 and above, got %d", av)
}
Expand All @@ -72,5 +78,6 @@ func AllCodes() []cid.Cid {
return []cid.Cid{
(&state9{}).Code(),
(&state10{}).Code(),
(&state11{}).Code(),
}
}
Loading

0 comments on commit 3636af4

Please sign in to comment.