Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat: Add nv21 skeleton #11030

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ type ForkUpgradeParams struct {
UpgradeHyggeHeight abi.ChainEpoch
UpgradeLightningHeight abi.ChainEpoch
UpgradeThunderHeight abi.ChainEpoch
UpgradeSummerHeight abi.ChainEpoch
}

type NonceMapType map[address.Address]uint64
Expand Down
7 changes: 5 additions & 2 deletions build/params_2k.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ var UpgradeSharkHeight = abi.ChainEpoch(-20)

var UpgradeHyggeHeight = abi.ChainEpoch(-21)

var UpgradeLightningHeight = abi.ChainEpoch(30)
var UpgradeLightningHeight = abi.ChainEpoch(-22)

var UpgradeThunderHeight = abi.ChainEpoch(1000)
var UpgradeThunderHeight = abi.ChainEpoch(-23)

var UpgradeSummerHeight = abi.ChainEpoch(1000)

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
Expand Down Expand Up @@ -120,6 +122,7 @@ func init() {
UpgradeHyggeHeight = getUpgradeHeight("LOTUS_HYGGE_HEIGHT", UpgradeHyggeHeight)
UpgradeLightningHeight = getUpgradeHeight("LOTUS_LIGHTNING_HEIGHT", UpgradeLightningHeight)
UpgradeThunderHeight = getUpgradeHeight("LOTUS_THUNDER_HEIGHT", UpgradeThunderHeight)
UpgradeSummerHeight = getUpgradeHeight("LOTUS_SUMMER_HEIGHT", UpgradeSummerHeight)

BuildType |= Build2k

Expand Down
3 changes: 3 additions & 0 deletions build/params_butterfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const UpgradeLightningHeight = 50

const UpgradeThunderHeight = UpgradeLightningHeight + 360

// ???????
const UpgradeSummerHeight = 999999999999999

var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg512MiBV1,
abi.RegisteredSealProof_StackedDrg32GiBV1,
Expand Down
3 changes: 3 additions & 0 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ const UpgradeLightningHeight = 489094
// 2023-04-21T16:00:00Z
const UpgradeThunderHeight = UpgradeLightningHeight + 3120

// ???????
const UpgradeSummerHeight = 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 @@ -52,8 +52,9 @@ var UpgradeSkyrHeight = abi.ChainEpoch(-19)
var UpgradeSharkHeight = abi.ChainEpoch(-20)
var UpgradeHyggeHeight = abi.ChainEpoch(-21)
var UpgradeLightningHeight = abi.ChainEpoch(-22)
var UpgradeThunderHeight = abi.ChainEpoch(-23)

const UpgradeThunderHeight = 50
const UpgradeSummerHeight = 50

var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
Expand Down
11 changes: 5 additions & 6 deletions build/params_mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ var UpgradeLightningHeight = abi.ChainEpoch(2809800)
// 2023-05-18T13:00:00Z
var UpgradeThunderHeight = UpgradeLightningHeight + 2880*21

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

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

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

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

// 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.Version20
const TestNetworkVersion = network.Version21

/* 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 @@ -109,6 +109,7 @@ var (
UpgradeHyggeHeight abi.ChainEpoch = -20
UpgradeLightningHeight abi.ChainEpoch = -21
UpgradeThunderHeight abi.ChainEpoch = -22
UpgradeSummerHeight abi.ChainEpoch = -23

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

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

case actorstypes.Version12:
return load12(store, act.Head)

}
}

Expand Down Expand Up @@ -111,6 +114,9 @@ func MakeState(store adt.Store, av actorstypes.Version, addr address.Address) (S
case actorstypes.Version11:
return make11(store, addr)

case actorstypes.Version12:
return make12(store, addr)

}
return nil, xerrors.Errorf("unknown actor version %d", av)
}
Expand Down Expand Up @@ -139,5 +145,6 @@ func AllCodes() []cid.Cid {
(&state9{}).Code(),
(&state10{}).Code(),
(&state11{}).Code(),
(&state12{}).Code(),
}
}
62 changes: 62 additions & 0 deletions chain/actors/builtin/account/v12.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"
builtin11 "github.com/filecoin-project/go-state-types/builtin"
builtin12 "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 @@ -40,6 +40,9 @@ func Load(store adt.Store, act *types.Actor) (State, error) {
case actorstypes.Version11:
return load11(store, act.Head)

case actorstypes.Version12:
return load12(store, act.Head)

}
}

Expand Down Expand Up @@ -107,13 +110,16 @@ func MakeState(store adt.Store, av actorstypes.Version) (State, error) {
case actorstypes.Version11:
return make11(store)

case actorstypes.Version12:
return make12(store)

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

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

type State interface {
Expand All @@ -137,5 +143,6 @@ func AllCodes() []cid.Cid {
(&state9{}).Code(),
(&state10{}).Code(),
(&state11{}).Code(),
(&state12{}).Code(),
}
}
57 changes: 57 additions & 0 deletions chain/actors/builtin/cron/v12.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"
builtin11 "github.com/filecoin-project/go-state-types/builtin"
builtin12 "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 = builtin11.DatacapActorAddr
Methods = builtin11.MethodsDatacap
Address = builtin12.DatacapActorAddr
Methods = builtin12.MethodsDatacap
)

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

case actorstypes.Version12:
return load12(store, act.Head)

}
}

Expand All @@ -56,6 +59,9 @@ func MakeState(store adt.Store, av actorstypes.Version, governor address.Address
case actorstypes.Version11:
return make11(store, governor, bitwidth)

case actorstypes.Version12:
return make12(store, governor, bitwidth)

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