-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use new go-state-types state accessors #8534
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
Conversation
c50a8c0 to
84af8da
Compare
a1761d2 to
cc454aa
Compare
| api "github.com/filecoin-project/lotus/api" | ||
| apitypes "github.com/filecoin-project/lotus/api/types" | ||
| miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner" | ||
| miner0 "github.com/filecoin-project/lotus/chain/actors/builtin/miner" |
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.
lminer please
| apitypes "github.com/filecoin-project/lotus/api/types" | ||
| v0api "github.com/filecoin-project/lotus/api/v0api" | ||
| miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner" | ||
| miner0 "github.com/filecoin-project/lotus/chain/actors/builtin/miner" |
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.
lminer
d482aa0 to
e555d89
Compare
vyzo
left a comment
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.
looks pretty good, just some small nits.
Also, shouldn't we do something about genesis (for tests)?
api/api_full.go
Outdated
| HasMinPower bool | ||
| } | ||
|
|
||
| type MinerInfo struct { |
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.
move this with the other typedefs?
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.
The JSON-RPC API struct is different to state struct, I think. I think it's fine here.
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 meant to api/types.go, that's the logical place where it belongs.
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.
A bunch of the api types are already in api_full.go, but I think i agree with @vyzo -- moving.
chain/actors/builtin/builtin.go
Outdated
|
|
||
| case builtin8.IsBuiltinActor(c): | ||
| return builtin8.ActorNameByCode(c) | ||
| case builtin8sa.IsBuiltinActor(c): |
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.
just builtin8 to be consistent?
| builtin{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/builtin" | ||
| {{else}} | ||
| builtin{{.}} "github.com/filecoin-project/go-state-types/builtin" | ||
| builtin{{.}}sa "github.com/filecoin-project/specs-actors{{import .}}actors/builtin" |
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.
drop the sa i would say.
| {{if (le . 7)}} | ||
| case builtin{{.}}.IsBuiltinActor(c): | ||
| return builtin{{.}}.ActorNameByCode(c) | ||
| {{else}} |
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 dont think we either need or want this branch.
After v8 it should always be in the manifest and gst should have no knowledge of this.
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'm not sure I know exactly what you mean here -- what are you proposing dropping?
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.
the else branch
api/api_full.go
Outdated
| HasMinPower bool | ||
| } | ||
|
|
||
| type MinerInfo struct { |
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.
The JSON-RPC API struct is different to state struct, I think. I think it's fine here.
| case actors.Version0: | ||
| return load0(store, act.Head) | ||
|
|
||
| case actors.Version2: | ||
| return load2(store, act.Head) | ||
|
|
||
| case actors.Version3: | ||
| return load3(store, act.Head) | ||
|
|
||
| case actors.Version4: | ||
| return load4(store, act.Head) | ||
|
|
||
| case actors.Version5: | ||
| return load5(store, act.Head) | ||
|
|
||
| case actors.Version6: | ||
| return load6(store, act.Head) | ||
|
|
||
| case actors.Version7: | ||
| return load7(store, act.Head) | ||
|
|
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.
Is this removing support for loading and managing actor state pre-v8?
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.
No, this is code that was added in this commit , but I feel like this wasn't the right thing to do -- we shouldn't be relying on the ActorMeta to tell us anything about versions 0-7. The former codeCid-based switch (directly after this) works for those cases.
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.
Oh I see. We're good here.
@vyzo This PR makes all genesis happen through the FVM (for actors v8 onwards). Anything else you wanted to see happen for it? |
|
no, thats what we want! |
vyzo
left a comment
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.
modulo resolving that else branch.
d924c8a to
f0b3d21
Compare
Resolves #8063
This PR replaces uses of the specs-actors v8 repo in Lotus and (most of) its deps. The current specs-actors v8 is not the specification of Filecoin actors, and mostly there for prototyping and convenience. This PR integrates actor state types and params from go-state-types.
There are 2 remaining uses of actors v8:
Needs