Skip to content

Conversation

@arajasek
Copy link
Contributor

@arajasek arajasek commented Apr 22, 2022

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:

  • the v15-v16 migration (I think we're comfortable leaving this there for now)
  • the builtin registry uses the exported methods for info about method params / returns. I think this should definitely move to the go-state-types repo as well, but want to descope it from this PR (consider it a future improvement).

Needs

@arajasek arajasek force-pushed the asr/refactor branch 8 times, most recently from c50a8c0 to 84af8da Compare May 13, 2022 19:15
@arajasek arajasek marked this pull request as ready for review May 13, 2022 19:17
@arajasek arajasek requested a review from a team as a code owner May 13, 2022 19:17
@arajasek arajasek force-pushed the asr/refactor branch 3 times, most recently from a1761d2 to cc454aa Compare May 13, 2022 19:54
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"
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lminer

@arajasek arajasek force-pushed the asr/refactor branch 8 times, most recently from d482aa0 to e555d89 Compare May 15, 2022 23:18
Copy link
Contributor

@vyzo vyzo left a 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 {
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.


case builtin8.IsBuiltinActor(c):
return builtin8.ActorNameByCode(c)
case builtin8sa.IsBuiltinActor(c):
Copy link
Contributor

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"
Copy link
Contributor

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}}
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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 {
Copy link
Member

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.

Comment on lines -77 to -97
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)

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@arajasek
Copy link
Contributor Author

Also, shouldn't we do something about genesis (for tests)?

@vyzo This PR makes all genesis happen through the FVM (for actors v8 onwards). Anything else you wanted to see happen for it?

@vyzo
Copy link
Contributor

vyzo commented May 17, 2022

no, thats what we want!

Copy link
Contributor

@vyzo vyzo left a 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.

@arajasek arajasek force-pushed the asr/refactor branch 2 times, most recently from d924c8a to f0b3d21 Compare May 17, 2022 19:37
@arajasek arajasek merged commit f6805f2 into feat/nv16 May 17, 2022
@arajasek arajasek deleted the asr/refactor branch May 17, 2022 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants