Skip to content

Commit

Permalink
feat: Skeleton for nv23 (#11964)
Browse files Browse the repository at this point in the history
* Use local GST

Use local GST

* Import actors and define upgrade heights

Creatin a mock actor-bundle and define upgrade heights

* Generate adapters

Updates gen/inlinegen-data.json, and runs make actors-gen

* Add schedule and migration

Add schedule and migration

* Add upgrade and network version fields/params

Add upgrade and network version fields/params

* Run make gen / make docsgen-cli

Run make gen / make docsgen-cli

* Update filecoin-ffi

Update filecoin-ffi to the v1.28.0-dev tag, which supports the nv23 skeleton.

* Update GST to v0.14.0-dev

Update GST to v0.14.0-dev, which includes the nv23 skeleton

* Add support for actor version 14 in actor registry

Add support for actor version 14 in actor registry
  • Loading branch information
rjan90 authored May 7, 2024
1 parent d6d4fee commit 2d57bfe
Show file tree
Hide file tree
Showing 62 changed files with 3,138 additions and 104 deletions.
1 change: 1 addition & 0 deletions api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ type ForkUpgradeParams struct {
UpgradeWatermelonHeight abi.ChainEpoch
UpgradeDragonHeight abi.ChainEpoch
UpgradePhoenixHeight abi.ChainEpoch
UpgradeAussieHeight abi.ChainEpoch
}

// ChainExportConfig holds configuration for chain ranged exports.
Expand Down
Binary file added build/actors/v14.tar.zst
Binary file not shown.
175 changes: 168 additions & 7 deletions build/builtin_actors_gen.go

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions build/openrpc/full.json
Original file line number Diff line number Diff line change
Expand Up @@ -17746,7 +17746,7 @@
"title": "number",
"description": "Number is a number",
"examples": [
22
23
],
"type": [
"number"
Expand Down Expand Up @@ -17798,7 +17798,7 @@
"title": "number",
"description": "Number is a number",
"examples": [
22
23
],
"type": [
"number"
Expand Down Expand Up @@ -20569,7 +20569,8 @@
"UpgradeThunderHeight": 10101,
"UpgradeWatermelonHeight": 10101,
"UpgradeDragonHeight": 10101,
"UpgradePhoenixHeight": 10101
"UpgradePhoenixHeight": 10101,
"UpgradeAussieHeight": 10101
},
"Eip155ChainID": 123
}
Expand Down Expand Up @@ -20599,6 +20600,10 @@
"title": "number",
"type": "number"
},
"UpgradeAussieHeight": {
"title": "number",
"type": "number"
},
"UpgradeBreezeHeight": {
"title": "number",
"type": "number"
Expand Down Expand Up @@ -23732,7 +23737,7 @@
"title": "number",
"description": "Number is a number",
"examples": [
22
23
],
"type": [
"number"
Expand Down
2 changes: 1 addition & 1 deletion build/openrpc/gateway.json
Original file line number Diff line number Diff line change
Expand Up @@ -8845,7 +8845,7 @@
"title": "number",
"description": "Number is a number",
"examples": [
22
23
],
"type": [
"number"
Expand Down
2 changes: 1 addition & 1 deletion build/openrpc/miner.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@
"title": "number",
"description": "Number is a number",
"examples": [
22
23
],
"type": [
"number"
Expand Down
9 changes: 6 additions & 3 deletions build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var NetworkBundle = "devnet"
var BundleOverrides map[actorstypes.Version]string
var ActorDebugging = true

var GenesisNetworkVersion = network.Version21
var GenesisNetworkVersion = network.Version22

var UpgradeBreezeHeight = abi.ChainEpoch(-1)

Expand Down Expand Up @@ -67,9 +67,11 @@ var UpgradeThunderHeight = abi.ChainEpoch(-23)

var UpgradeWatermelonHeight = abi.ChainEpoch(-24)

var UpgradeDragonHeight = abi.ChainEpoch(20)
var UpgradeDragonHeight = abi.ChainEpoch(-24)

var UpgradePhoenixHeight = UpgradeDragonHeight + 120
var UpgradePhoenixHeight = abi.ChainEpoch(-25)

var UpgradeAussieHeight = abi.ChainEpoch(200)

// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight = -100
Expand Down Expand Up @@ -154,6 +156,7 @@ func init() {
UpgradeThunderHeight = getUpgradeHeight("LOTUS_THUNDER_HEIGHT", UpgradeThunderHeight)
UpgradeWatermelonHeight = getUpgradeHeight("LOTUS_WATERMELON_HEIGHT", UpgradeWatermelonHeight)
UpgradeDragonHeight = getUpgradeHeight("LOTUS_DRAGON_HEIGHT", UpgradeDragonHeight)
UpgradeAussieHeight = getUpgradeHeight("LOTUS_AUSSIE_HEIGHT", UpgradeAussieHeight)

UpgradePhoenixHeight = getUpgradeHeight("LOTUS_PHOENIX_HEIGHT", UpgradePhoenixHeight)
DrandSchedule = map[abi.ChainEpoch]DrandEnum{
Expand Down
6 changes: 3 additions & 3 deletions build/params_butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ const UpgradeHyggeHeight = -21
const UpgradeLightningHeight = -22
const UpgradeThunderHeight = -23
const UpgradeWatermelonHeight = -24
const UpgradeDragonHeight = -25
const UpgradePhoenixHeight = -26

const UpgradeDragonHeight = 5760

const UpgradePhoenixHeight = UpgradeDragonHeight + 120
const UpgradeAussieHeight = 400

// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight = -100
Expand Down
3 changes: 3 additions & 0 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ const UpgradePhoenixHeight = UpgradeDragonHeight + 120
// 2024-04-03T11:00:00Z
const UpgradeCalibrationDragonFixHeight = 1493854

// ?????
const UpgradeAussieHeight = 999999999999999

var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
Expand Down
3 changes: 2 additions & 1 deletion build/params_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ var UpgradeHyggeHeight = abi.ChainEpoch(-21)
var UpgradeLightningHeight = abi.ChainEpoch(-22)
var UpgradeThunderHeight = abi.ChainEpoch(-23)
var UpgradeWatermelonHeight = abi.ChainEpoch(-24)
var UpgradeDragonHeight = abi.ChainEpoch(-25)

const UpgradeDragonHeight = 50
const UpgradeAussieHeight = 50

const UpgradePhoenixHeight = UpgradeDragonHeight + 100

Expand Down
13 changes: 7 additions & 6 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,14 @@ const UpgradeThunderHeight = UpgradeLightningHeight + 2880*21
const UpgradeWatermelonHeight = 3469380

// 2024-04-24T14:00:00Z
var UpgradeDragonHeight = abi.ChainEpoch(3855360)
const UpgradeDragonHeight = 3855360

// This epoch, 120 epochs after the "rest" of the nv22 upgrade, is when we switch to Drand quicknet
// 2024-04-11T15:00:00Z
var UpgradePhoenixHeight = UpgradeDragonHeight + 120
const UpgradePhoenixHeight = UpgradeDragonHeight + 120

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

// This fix upgrade only ran on calibrationnet
const UpgradeWatermelonFixHeight = -1
Expand All @@ -130,10 +133,8 @@ func init() {
SetAddressNetwork(address.Mainnet)
}

if os.Getenv("LOTUS_DISABLE_DRAGON") == "1" {
UpgradeDragonHeight = math.MaxInt64 - 1
delete(DrandSchedule, UpgradePhoenixHeight)
UpgradePhoenixHeight = math.MaxInt64
if os.Getenv("LOTUS_DISABLE_AUSSIE") == "1" {
UpgradeAussieHeight = math.MaxInt64 - 1
}

// NOTE: DO NOT change this unless you REALLY know what you're doing. This is not consensus critical, however,
Expand Down
2 changes: 1 addition & 1 deletion build/params_shared_vals.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AllowableClockDriftSecs = uint64(1)
/* inline-gen template
const TestNetworkVersion = network.Version{{.latestNetworkVersion}}
/* inline-gen start */
const TestNetworkVersion = network.Version22
const TestNetworkVersion = network.Version23

/* inline-gen end */

Expand Down
1 change: 1 addition & 0 deletions build/params_testground.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ var (
UpgradeDragonHeight abi.ChainEpoch = -26
UpgradePhoenixHeight abi.ChainEpoch = -27
UpgradeCalibrationDragonFixHeight abi.ChainEpoch = -28
UpgradeAussieHeight abi.ChainEpoch = -29

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"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "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 = builtin13.MethodsAccount
var Methods = builtin14.MethodsAccount

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

case actorstypes.Version14:
return load14(store, act.Head)

}
}

Expand Down Expand Up @@ -123,6 +126,9 @@ func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (S
case actorstypes.Version13:
return make13(store, addr)

case actorstypes.Version14:
return make14(store, addr)

}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
Expand Down Expand Up @@ -153,5 +159,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}
62 changes: 62 additions & 0 deletions chain/actors/builtin/account/v14.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"
builtin13 "github.com/filecoin-project/go-state-types/builtin"
builtin14 "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 @@ -46,6 +46,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version13:
return load13(store, act.Head)

case actorstypes.Version14:
return load14(store, act.Head)

}
}

Expand Down Expand Up @@ -119,13 +122,16 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
case actorstypes.Version13:
return make13(store)

case actorstypes.Version14:
return make14(store)

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

var (
Address = builtin13.CronActorAddr
Methods = builtin13.MethodsCron
Address = builtin14.CronActorAddr
Methods = builtin14.MethodsCron
)

type State interface {
Expand All @@ -151,5 +157,6 @@ func AllCodes() []cid.Cid {
(&state11{}).Code(),
(&state12{}).Code(),
(&state13{}).Code(),
(&state14{}).Code(),
}
}
57 changes: 57 additions & 0 deletions chain/actors/builtin/cron/v14.go

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

Loading

0 comments on commit 2d57bfe

Please sign in to comment.