-
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
feat: refactor: actor bundling system #8838
Conversation
01e4341
to
e2a28d3
Compare
@@ -580,12 +578,7 @@ var genesisCarCmd = &cli.Command{ | |||
bstor := blockstore.WrapIDStore(blockstore.NewMemorySync()) | |||
sbldr := vm.Syscalls(ffiwrapper.ProofVerifier) | |||
|
|||
// load appropriate bundles | |||
if err := bundle.FetchAndLoadBundles(c.Context, bstor, build.BuiltinActorReleases); err != nil { |
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.
MakeInitialStateTree
now loads the actors bundle, if necessary, for us.
3b18d2c
to
e9d419f
Compare
This comment was marked as resolved.
This comment was marked as resolved.
1. Include the builtin-actors in the lotus source tree. 2. Embed the bundle on build instead of downloading at runtime. 3. Avoid reading the bundle whenever possible by including bundle metadata (the bundle CID, the actor CIDs, etc.). 4. Remove everything related to dependency injection. 1. We're no longer downloading the bundle, so doing anything ahead of time doesn't really help. 2. We register the manifests on init because, unfortunately, they're global. 3. We explicitly load the current actors bundle in the genesis state-tree method. 4. For testing, we just change the in-use bundle with a bit of a hack. It's not great, but using dependency injection doesn't make any sense either because, again, the manifest information is global. fixes #8701
e9d419f
to
eff32b7
Compare
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.
Direction generally LGTM.
8d927ed
to
a0f907f
Compare
Instead, we override bundles using environment variables and overrides in the build parameter files.
a0f907f
to
54a4097
Compare
67710eb
to
089446d
Compare
1. Use mockProofs to determine the correct test bundle. 2. Don't even bother setting InsecurePoStValidation for itests, it's already set.
089446d
to
ea07648
Compare
This gets tested: 1. When we load dynamically (by path) specified bundles. 2. When we decode the embedded bundles to generate the metadata. Effectively, this lets us test that the embedded bundles are actually correct.
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.
One question, but this seems like a major improvement!
@@ -295,6 +295,12 @@ actors-gen: | |||
$(GOCC) run ./chain/actors/agen | |||
$(GOCC) fmt ./... | |||
|
|||
bundle-gen: |
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.
bundle-jen?
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 a must-have.
build/actors/README.md
Outdated
This will: | ||
|
||
1. Download the actors bundles and pack them into the appropriate tarfile. | ||
2. Run `make bundle-gen` in the top-level directory to regenerate the bundle metadata file. |
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 one specify two versions at one 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.
No, you'd have to run the command for each version/release you want to download.
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. make bundle-gen
will generate the metadata for all versions.
1. Include the builtin-actors in the lotus source tree. 2. Embed the bundle on build instead of downloading at runtime. 3. Avoid reading the bundle whenever possible by including bundle metadata (the bundle CID, the actor CIDs, etc.). 4. Remove everything related to dependency injection. 1. We're no longer downloading the bundle, so doing anything ahead of time doesn't really help. 2. We register the manifests on init because, unfortunately, they're global. 3. We explicitly load the current actors bundle in the genesis state-tree method. 4. For testing, we just change the in-use bundle with a bit of a hack. It's not great, but using dependency injection doesn't make any sense either because, again, the manifest information is global. 5. Remove the bundle.toml file. Bundles may be overridden by specifying an override path in the parameters file, or an environment variable. fixes #8701
Related Issues
fixes #8701
Proposed Changes
bundle.toml
file. Bundles may be overridden by specifying an override path in the parameters file, or an environment variable.Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, testarea
: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, depsTODO
Maybes:
Merge some of the methods inchain/actors/builtin/builtin.go
withchain/actors/bundle.go
, because they're basically the same.