-
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
FIP0031 refinements #8429
FIP0031 refinements #8429
Conversation
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.
First limited pass.
You probably want to run full make gen
to fix codegen issues.
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 add instructions to https://github.com/filecoin-project/lotus/blob/d9100981ada8b3186d906a4f4140b83a819d2299/documentation/misc/actors_version_checklist.md for when we need the next version of actors (v9).
sure! |
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.
Few comments
|
||
for _, a := range acts { | ||
err = st.MutateActor(a, func(act *types.Actor) error { | ||
name := actors.CanonicalName(builtin.ActorNameByCode(act.Code)) |
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.
Why aren't we just putting those actors with correct CIDs right away?
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 correct cids... thays a big conversation, but it is not workable to expect specs-actors to have baked in the correct CIDs.
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 manifest should allow us to remove the baked-in code cids from v8 specs-actors, no?
// nv, err := m.FullNode.FullNode.StateNetworkVersion(ctx, types.EmptyTSK) | ||
// require.NoError(n.t, err) | ||
|
||
// TODO this doesn't currently work with the FVM -- we need to specify policy somehow | ||
// proofType, err := miner.WindowPoStProofTypeFromSectorSize(m.options.sectorSize) | ||
// require.NoError(n.t, err) | ||
// so do this instead, which works: | ||
proofType := abi.RegisteredPoStProof_StackedDrgWindow64GiBV1 |
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.
todo
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.
will be fixed once we have test bundles to load.
So the merge overwrote the specs-actors dep and results in a broken manifest loader; see filecoin-project/specs-actors#1587 |
fixed, updated filecoin-project/specs-actors#1587 |
Also, the forks_test ended broken; fixed. |
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.
Feels close to being landable
ac := a.Code() | ||
ar.actors[ac] = ai | ||
|
||
// necessary to make stuff 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.
As far as I understand in v8 actors we only really need ActorRegistry to map actor method->param type. Ideally we'd move that logic to chain/actors/
, and only use the ActorRegistry in LegacyVM (so this would have no method type mappings, and wouldn't need to worry about FVM).
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 can be a followup PR)
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.
agreed.
// required for genesis/testing | ||
if nv := rt.NetworkVersion(); nv >= network.Version16 { | ||
name, av, ok := actors.GetActorMetaByCode(act.Code) | ||
|
||
if ok { | ||
// lies, lies, lies | ||
builder := cid.V1Builder{Codec: cid.Raw, MhType: mh.IDENTITY} | ||
synthetic := fmt.Sprintf("fil/%d/%s", av, name) | ||
syntheticCid, err := builder.Sum([]byte(synthetic)) | ||
if err != nil { | ||
panic(aerrors.Fatalf("failed to generate synthetic CID: %s", err)) | ||
} | ||
|
||
return syntheticCid, true | ||
} | ||
} |
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.
Really I think we should be trying to get rid of the id(fil/8/y)
code cids from the codebase, otherwise we'll have to translate them back and forth everywhere, which will be really painful, especially with more network upgrades
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.
yes, I totally agree, but it's not as simple -- we'll have to do some surgery in specs-actors.
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.
Won't we remove most Go specs-actors logic, and mostly just keep the data-accessing bits? That should remove almost all dependencies on old code CIDs. (I'm assuming that builtin-actors don't use them - didn't look at them much yet)
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.
if we remove all specs-actors logic we will be fine; really, we should become fvm only, except for state.
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.
- For whatever reason make-gen complains about stuff in
build/builtin-actors
- Something about itests / ensemble is very broken - I'm ok with fixing those in feat/nv16 to not block this any more
// required for genesis/testing | ||
if nv := rt.NetworkVersion(); nv >= network.Version16 { | ||
name, av, ok := actors.GetActorMetaByCode(act.Code) | ||
|
||
if ok { | ||
// lies, lies, lies | ||
builder := cid.V1Builder{Codec: cid.Raw, MhType: mh.IDENTITY} | ||
synthetic := fmt.Sprintf("fil/%d/%s", av, name) | ||
syntheticCid, err := builder.Sum([]byte(synthetic)) | ||
if err != nil { | ||
panic(aerrors.Fatalf("failed to generate synthetic CID: %s", err)) | ||
} | ||
|
||
return syntheticCid, true | ||
} | ||
} |
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.
Won't we remove most Go specs-actors logic, and mostly just keep the data-accessing bits? That should remove almost all dependencies on old code CIDs. (I'm assuming that builtin-actors don't use them - didn't look at them much yet)
@@ -580,6 +580,23 @@ func MakeGenesisBlock(ctx context.Context, j journal.Journal, bs bstore.Blocksto | |||
return nil, xerrors.Errorf("setup miners failed: %w", err) | |||
} | |||
|
|||
if template.NetworkVersion >= network.Version16 { |
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.
Might not be easy, but we should make the genesis logic use the FVM. Definitely not needed now, but this is the only thing which depends on a big chunk of Go specs-actors logic
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.
(definitely not something we want to do in this PR / not needed for M1)
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.
yeah, agreed. The sooner specs-actors retires, the better.
yeah, i have no idea whats wrong with make gen. Itests need a policy adjusted bundle before they can be fixed, i have listed it as TODO follow up in the nv16 tracking pr -- basically improving our bundle situation and fixing itests is next on my pile. |
This embeds the bundle for v8; long run we want to autofetch from IPFS, but we discussed this with @raulk and decided it is fine for now, avoiding scope creep.
As it is it will load and embed the bundle from
build/builtin-actors/builtin-actors-v8.car
.TBD:
Note: made it upload to estuary and fetch from ipfs instead.