-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow starting networks from arbitrary actor versions #6305
Conversation
739a810
to
632a989
Compare
@@ -24,20 +24,20 @@ var UpgradeIgnitionHeight = abi.ChainEpoch(-2) | |||
var UpgradeRefuelHeight = abi.ChainEpoch(-3) | |||
var UpgradeTapeHeight = abi.ChainEpoch(-4) | |||
|
|||
var UpgradeActorsV2Height = abi.ChainEpoch(10) | |||
var UpgradeLiftoffHeight = abi.ChainEpoch(-5) | |||
var UpgradeActorsV2Height = abi.ChainEpoch(-5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed these thinking we could make devnets start from latest nv by default, but can undo that.
@@ -366,6 +376,45 @@ func (s *state{{.v}}) decodeSectorPreCommitOnChainInfo(val *cbg.Deferred) (Secto | |||
return fromV{{.v}}SectorPreCommitOnChainInfo(sp), nil | |||
} | |||
|
|||
func (s *state{{.v}}) EraseAllUnproven() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only objectively horrible hack I had to add to make this work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least the only one that isn't super easy to remove later.
@@ -662,37 +662,6 @@ func (vm *VM) Flush(ctx context.Context) (cid.Cid, error) { | |||
return root, nil | |||
} | |||
|
|||
// MutateState usage: MutateState(ctx, idAddr, func(cst cbor.IpldStore, st *ActorStateType) error {...}) | |||
func (vm *VM) MutateState(ctx context.Context, addr address.Address, fn interface{}) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite happy that this is dead.
|
||
// TODO: Get from build | ||
// TODO: make a list/schedule of these. | ||
var GenesisNetworkVersion = func() network.Version { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy this is gone
This is against |
chain/actors/agen/main.go
Outdated
var versionImports = map[int]string{ | ||
0: "/", | ||
2: "/v2/", | ||
3: "/v3/", | ||
latestVersion: "/v4/", | ||
0: "/", | ||
2: "/v2/", | ||
3: "/v3/", | ||
lotusactors.LatestVersion: "/v4/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just generate this from lotusactors.Versions? (1 less thing to do manually every time)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
func MakeState(store adt.Store, av actors.Version, addr address.Address) (State, error) { | ||
switch av { | ||
{{range .versions}} | ||
case actors.Version{{.}}: | ||
return make{{.}}(store, addr) | ||
{{end}} | ||
} | ||
return nil, xerrors.Errorf("unknown actor version %d", av) | ||
} | ||
|
||
func GetActorCodeID(av actors.Version) (cid.Cid, error) { | ||
switch av { | ||
{{range .versions}} | ||
case actors.Version{{.}}: | ||
return builtin{{.}}.AccountActorCodeID, nil | ||
{{end}} | ||
} | ||
|
||
return cid.Undef, xerrors.Errorf("unknown actor version %d", av) | ||
} | ||
|
||
type State interface { | ||
cbor.Marshaler | ||
|
||
PubkeyAddress() (address.Address, error) | ||
GetState() interface{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed tabs with spaces (use tabs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh spaces...
632a989
to
cf574ca
Compare
Fixes #5817
Allowed me to get to height 1500 on a devnet starting from v4 actors, so I'm gonna call this a win.