diff --git a/Makefile b/Makefile index f6e88d94b5..ccaa3cb643 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ test-venus-shared: cd venus-shared && go test -covermode=set ./... bundle-gen: - cd venus-devtool && go run ./bundle-gen/*.go --dst ./../venus-shared/builtin-actors/builtin_actors_gen.go + cd venus-devtool && go run ./bundle-gen/*.go --dst ./../venus-shared/actors/builtin_actors_gen.go api-gen: cd ./venus-devtool/ && go run ./api-gen/ proxy diff --git a/cmd/daemon.go b/cmd/daemon.go index 7c2894b971..8b470aae3d 100644 --- a/cmd/daemon.go +++ b/cmd/daemon.go @@ -6,7 +6,7 @@ import ( "github.com/filecoin-project/venus/fixtures/assets" "github.com/filecoin-project/venus/fixtures/networks" - builtinactors "github.com/filecoin-project/venus/venus-shared/builtin-actors" + "github.com/filecoin-project/venus/venus-shared/actors" "github.com/filecoin-project/venus/venus-shared/utils" "github.com/filecoin-project/venus/pkg/constants" @@ -141,7 +141,7 @@ func initRun(req *cmds.Request) error { } node.SetNetParams(cfg.NetworkParams) - if err := builtinactors.SetNetworkBundle(cfg.NetworkParams.NetworkType); err != nil { + if err := actors.SetNetworkBundle(int(cfg.NetworkParams.NetworkType)); err != nil { return err } utils.ReloadMethodsMap() @@ -180,7 +180,7 @@ func daemonRun(req *cmds.Request, re cmds.ResponseEmitter) error { config := rep.Config() - if err := builtinactors.SetNetworkBundle(config.NetworkParams.NetworkType); err != nil { + if err := actors.SetNetworkBundle(int(config.NetworkParams.NetworkType)); err != nil { return err } utils.ReloadMethodsMap() diff --git a/pkg/fork/fork.go b/pkg/fork/fork.go index 9d4cd0144e..602e1405e3 100644 --- a/pkg/fork/fork.go +++ b/pkg/fork/fork.go @@ -57,7 +57,6 @@ import ( init_ "github.com/filecoin-project/venus/venus-shared/actors/builtin/init" "github.com/filecoin-project/venus/venus-shared/actors/builtin/multisig" "github.com/filecoin-project/venus/venus-shared/actors/builtin/system" - builtinactors "github.com/filecoin-project/venus/venus-shared/builtin-actors" "github.com/filecoin-project/venus/venus-shared/types" ) @@ -2082,7 +2081,7 @@ func (c *ChainFork) upgradeActorsV8Common( store := chain.ActorStore(ctx, buf) // ensure that the manifest is loaded in the blockstore - if err := builtinactors.LoadBundles(ctx, buf, actors.Version8); err != nil { + if err := actors.LoadBundles(ctx, buf, actors.Version8); err != nil { return cid.Undef, fmt.Errorf("failed to load manifest bundle: %w", err) } @@ -2153,7 +2152,7 @@ func (c *ChainFork) GetForkUpgrade() *config.ForkUpgradeConfig { // newStateTreeVersion := vmstate.StateTreeVersion4 // // ensure that the manifest is loaded in the blockstore -// if err := builtinactors.LoadBundles(ctx, buf, actors.Version9); err != nil { +// if err := actors.LoadBundles(ctx, buf, actors.Version9); err != nil { // return cid.Undef, fmt.Errorf("failed to load manifest bundle: %w", err) // } diff --git a/pkg/gen/genesis/genesis.go b/pkg/gen/genesis/genesis.go index 485f2be4ec..25db06d010 100644 --- a/pkg/gen/genesis/genesis.go +++ b/pkg/gen/genesis/genesis.go @@ -12,7 +12,6 @@ import ( "github.com/filecoin-project/venus/pkg/fvm" "github.com/filecoin-project/venus/pkg/util/ffiwrapper/impl" "github.com/filecoin-project/venus/pkg/vmsupport" - builtinactors "github.com/filecoin-project/venus/venus-shared/builtin-actors" "github.com/filecoin-project/venus/venus-shared/types" "github.com/filecoin-project/venus/pkg/config" @@ -161,7 +160,7 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template Te return nil, nil, fmt.Errorf("get actor version: %w", err) } - if err := builtinactors.LoadBundles(ctx, bs, av); err != nil { + if err := actors.LoadBundles(ctx, bs, av); err != nil { return nil, nil, fmt.Errorf("loading actors for genesis block: %w", err) } // Create system actor diff --git a/venus-devtool/bundle-gen/main.go b/venus-devtool/bundle-gen/main.go index 02d618ee48..82bbbe3d4f 100644 --- a/venus-devtool/bundle-gen/main.go +++ b/venus-devtool/bundle-gen/main.go @@ -10,7 +10,7 @@ import ( "github.com/urfave/cli/v2" "github.com/filecoin-project/venus/venus-devtool/util" - builtinactors "github.com/filecoin-project/venus/venus-shared/builtin-actors" + "github.com/filecoin-project/venus/venus-shared/actors" ) func main() { @@ -22,7 +22,7 @@ func main() { }, Action: func(ctx *cli.Context) error { - metadata, err := builtinactors.ReadEmbeddedBuiltinActorsMetadata() + metadata, err := actors.ReadEmbeddedBuiltinActorsMetadata() if err != nil { return err } @@ -50,22 +50,30 @@ func main() { var tmpl *template.Template = template.Must(template.New("actor-metadata").Parse(` // WARNING: This file has automatically been generated -package builtinactors +package actors import ( - "github.com/filecoin-project/venus/venus-shared/types" "github.com/ipfs/go-cid" ) var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMetadata{ {{- range . }} { Network: {{printf "%q" .Network}}, Version: {{.Version}}, - ManifestCid: types.MustParseCid({{printf "%q" .ManifestCid}}), + ManifestCid: mustParseCid({{printf "%q" .ManifestCid}}), Actors: map[string]cid.Cid { {{- range $name, $cid := .Actors }} - {{printf "%q" $name}}: types.MustParseCid({{printf "%q" $cid}}), + {{printf "%q" $name}}: mustParseCid({{printf "%q" $cid}}), {{- end }} }, }, {{- end -}} } + +func mustParseCid(c string) cid.Cid { + ret, err := cid.Decode(c) + if err != nil { + panic(err) + } + + return ret +} `)) diff --git a/venus-shared/builtin-actors/actors/README.md b/venus-shared/actors/builtin-actors-code/README.md similarity index 100% rename from venus-shared/builtin-actors/actors/README.md rename to venus-shared/actors/builtin-actors-code/README.md diff --git a/venus-shared/builtin-actors/actors/pack.sh b/venus-shared/actors/builtin-actors-code/pack.sh similarity index 100% rename from venus-shared/builtin-actors/actors/pack.sh rename to venus-shared/actors/builtin-actors-code/pack.sh diff --git a/venus-shared/builtin-actors/actors/v8.tar.zst b/venus-shared/actors/builtin-actors-code/v8.tar.zst similarity index 100% rename from venus-shared/builtin-actors/actors/v8.tar.zst rename to venus-shared/actors/builtin-actors-code/v8.tar.zst diff --git a/venus-shared/builtin-actors/builtin_actors.go b/venus-shared/actors/builtin_actors.go similarity index 82% rename from venus-shared/builtin-actors/builtin_actors.go rename to venus-shared/actors/builtin_actors.go index e96fd2e6e9..948ae842de 100644 --- a/venus-shared/builtin-actors/builtin_actors.go +++ b/venus-shared/actors/builtin_actors.go @@ -1,4 +1,4 @@ -package builtinactors +package actors import ( "archive/tar" @@ -18,46 +18,55 @@ import ( "github.com/ipld/go-car" "github.com/filecoin-project/venus/pkg/util/blockstoreutil" - "github.com/filecoin-project/venus/venus-shared/actors" "github.com/filecoin-project/venus/venus-shared/actors/adt" - "github.com/filecoin-project/venus/venus-shared/types" ) -//go:embed actors/*.tar.zst +//go:embed builtin-actors-code/*.tar.zst var embeddedBuiltinActorReleases embed.FS // NOTE: DO NOT change this unless you REALLY know what you're doing. This is consensus critical. -var BundleOverrides map[actors.Version]string +var BundleOverrides map[Version]string var NetworkBundle = "mainnet" func init() { if BundleOverrides == nil { - BundleOverrides = make(map[actors.Version]string) + BundleOverrides = make(map[Version]string) } - for _, av := range actors.Versions { + for _, av := range Versions { path := os.Getenv(fmt.Sprintf("VENUS_BUILTIN_ACTORS_V%d_BUNDLE", av)) if path == "" { continue } - BundleOverrides[actors.Version(av)] = path + BundleOverrides[Version(av)] = path } if err := loadManifests(NetworkBundle); err != nil { panic(err) } } -func SetNetworkBundle(networkType types.NetworkType) error { +// NetworkMainnet NetworkType = 0x1 +// Network2k NetworkType = 0x2 +// NetworkCalibnet NetworkType = 0x4 +// NetworkInterop NetworkType = 0x6 +// NetworkForce NetworkType = 0x7 +// NetworkButterfly NetworkType = 0x8 +// Avoid import cycle, we use concrete values +func SetNetworkBundle(networkType int) error { networkBundle := "" switch networkType { - case types.Network2k, types.NetworkForce: + // case types.Network2k, types.NetworkForce: + case 0x2, 0x7: networkBundle = "devnet" - case types.NetworkButterfly: + // case types.NetworkButterfly: + case 0x8: networkBundle = "butterflynet" - case types.NetworkInterop: + // case types.NetworkInterop: + case 0x6: networkBundle = "caterpillarnet" - case types.NetworkCalibnet: + // case types.NetworkCalibnet: + case 0x4: networkBundle = "calibrationnet" default: networkBundle = "mainnet" @@ -79,7 +88,7 @@ func UseNetworkBundle(netw string) error { } func loadManifests(netw string) error { - overridden := make(map[actors.Version]struct{}) + overridden := make(map[Version]struct{}) var newMetadata []*BuiltinActorsMetadata // First, prefer overrides. for av, path := range BundleOverrides { @@ -107,10 +116,10 @@ func loadManifests(netw string) error { newMetadata = append(newMetadata, meta) } - actors.ClearManifests() + ClearManifests() for _, meta := range newMetadata { - actors.RegisterManifest(meta.Version, meta.ManifestCid, meta.Actors) + RegisterManifest(meta.Version, meta.ManifestCid, meta.Actors) } return nil @@ -118,7 +127,7 @@ func loadManifests(netw string) error { type BuiltinActorsMetadata struct { // nolint Network string - Version actors.Version + Version Version ManifestCid cid.Cid Actors map[string]cid.Cid } @@ -127,7 +136,7 @@ type BuiltinActorsMetadata struct { // nolint // There should be no need to call this method as the result is cached in the // `EmbeddedBuiltinActorsMetadata` variable on `make gen`. func ReadEmbeddedBuiltinActorsMetadata() ([]*BuiltinActorsMetadata, error) { - files, err := embeddedBuiltinActorReleases.ReadDir("actors") + files, err := embeddedBuiltinActorReleases.ReadDir("builtin-actors-code") if err != nil { return nil, fmt.Errorf("failed to read embedded bundle directory: %s", err) } @@ -167,7 +176,7 @@ func readEmbeddedBuiltinActorsMetadata(bundle string) ([]*BuiltinActorsMetadata, if err != nil { return nil, fmt.Errorf("failed to parse actors version from bundle '%q': %s", bundle, err) } - fi, err := embeddedBuiltinActorReleases.Open(fmt.Sprintf("actors/%s", bundle)) + fi, err := embeddedBuiltinActorReleases.Open(fmt.Sprintf("builtin-actors-code/%s", bundle)) if err != nil { return nil, err } @@ -206,7 +215,7 @@ func readEmbeddedBuiltinActorsMetadata(bundle string) ([]*BuiltinActorsMetadata, } bundles = append(bundles, &BuiltinActorsMetadata{ Network: name, - Version: actors.Version(version), + Version: Version(version), ManifestCid: root, Actors: actorCids, }) @@ -235,12 +244,12 @@ func readBundleManifest(r io.Reader) (cid.Cid, map[string]cid.Cid, error) { return cid.Undef, nil, fmt.Errorf("expected one root when loading actors bundle, got %d", len(hdr.Roots)) } root := hdr.Roots[0] - actorCids, err := actors.ReadManifest(context.Background(), adt.WrapStore(context.Background(), cbor.NewCborStore(bs)), root) + actorCids, err := ReadManifest(context.Background(), adt.WrapStore(context.Background(), cbor.NewCborStore(bs)), root) if err != nil { return cid.Undef, nil, err } - // Make sure we have all the actors. + // Make sure we have all the for name, c := range actorCids { if has, err := bs.Has(context.Background(), c); err != nil { return cid.Undef, nil, fmt.Errorf("got an error when checking that the bundle has the actor %q: %w", name, err) @@ -253,8 +262,8 @@ func readBundleManifest(r io.Reader) (cid.Cid, map[string]cid.Cid, error) { } // GetEmbeddedBuiltinActorsBundle returns the builtin-actors bundle for the given actors version. -func GetEmbeddedBuiltinActorsBundle(version actors.Version) ([]byte, bool) { - fi, err := embeddedBuiltinActorReleases.Open(fmt.Sprintf("actors/v%d.tar.zst", version)) +func GetEmbeddedBuiltinActorsBundle(version Version) ([]byte, bool) { + fi, err := embeddedBuiltinActorReleases.Open(fmt.Sprintf("builtin-actors-code/v%d.tar.zst", version)) if err != nil { return nil, false } diff --git a/venus-shared/builtin-actors/bundle.go b/venus-shared/actors/builtin_actors_bundle.go similarity index 92% rename from venus-shared/builtin-actors/bundle.go rename to venus-shared/actors/builtin_actors_bundle.go index 3f28e7a067..e4311f4914 100644 --- a/venus-shared/builtin-actors/bundle.go +++ b/venus-shared/actors/builtin_actors_bundle.go @@ -1,4 +1,4 @@ -package builtinactors +package actors import ( "bytes" @@ -8,7 +8,6 @@ import ( "os" blockstore "github.com/filecoin-project/venus/pkg/util/blockstoreutil" - "github.com/filecoin-project/venus/venus-shared/actors" cid "github.com/ipfs/go-cid" "github.com/ipld/go-car" ) @@ -37,14 +36,14 @@ func LoadBundle(ctx context.Context, bs blockstore.Blockstore, r io.Reader) (cid // LoadBundles loads the bundles for the specified actor versions into the passed blockstore, if and // only if the bundle's manifest is not already present in the blockstore. -func LoadBundles(ctx context.Context, bs blockstore.Blockstore, versions ...actors.Version) error { +func LoadBundles(ctx context.Context, bs blockstore.Blockstore, versions ...Version) error { for _, av := range versions { // No bundles before version 8. - if av < actors.Version8 { + if av < Version8 { continue } - manifestCid, ok := actors.GetManifest(av) + manifestCid, ok := GetManifest(av) if !ok { // All manifests are registered on start, so this must succeed. return fmt.Errorf("unknown actor version v%d", av) diff --git a/venus-shared/actors/builtin_actors_gen.go b/venus-shared/actors/builtin_actors_gen.go new file mode 100644 index 0000000000..f07c37616c --- /dev/null +++ b/venus-shared/actors/builtin_actors_gen.go @@ -0,0 +1,136 @@ +// WARNING: This file has automatically been generated +package actors + +import ( + "github.com/ipfs/go-cid" +) + +var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMetadata{{ + Network: "butterflynet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacedvaarfyh6q3bk4dyzux46ednlace2ckxp5nbyn6mb3da2apqn6sk"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzaceavzeu4gqte7o33vr4htiaapiwpfq6p26tgdkqla2baqhmiqswfso"), + "cron": mustParseCid("bafk2bzacech35onpqxep4yox36k7sr4mj4bch54s3i4b3yyaustrbo5xwfbfs"), + "init": mustParseCid("bafk2bzaceahxin3sf5f6ude5j6we4yeqlg66s5qe4tu7lwp26jcg7yp2ns6hi"), + "multisig": mustParseCid("bafk2bzacectfmzjtniypgl4whm42sws5aupihqgfikwsr7p5yoq3bmqaogldi"), + "paymentchannel": mustParseCid("bafk2bzacecbwu54ce5mjgp2pqxyj6kpn2vlgiu5wv2lj2byjiegxnn3infd5i"), + "reward": mustParseCid("bafk2bzacecskkbhe6c4ud5jt62wg4w7j7shj6xdwoyic74s5y6pgywxxvnw72"), + "storagemarket": mustParseCid("bafk2bzacebycxcwwm7hwhuhpasaskil2kxaqb7tins7azdvvm72rorlciuysi"), + "storageminer": mustParseCid("bafk2bzacecgx3etor5m6lahpmjdwqnryutqe6naiurfhgsju72rd4nqssutbg"), + "storagepower": mustParseCid("bafk2bzaceayvy6xyp5cwtngm457c5hssvihidppgq3o7gy3dlmhgor3yzujoc"), + "system": mustParseCid("bafk2bzacec6xctjxybp7r3kkhase56o6jsaiua7ure5ttu2xfuojt4jhlsoa6"), + "verifiedregistry": mustParseCid("bafk2bzacec2hcqlqcfacylfcrhhliwkisvh4y3adwt47xkf2gdvodwu6ccepc"), + }, +}, { + Network: "calibrationnet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacedrdn6z3z7xz7lx4wll3tlgktirhllzqxb766dxpaqp3ukxsjfsba"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzacecruossn66xqbeutqx5r4k2kjzgd43frmwd4qkw6haez44ubvvpxo"), + "cron": mustParseCid("bafk2bzaceaxlezmclw5ugldhhtfgvn7yztux45scqik3ez4yhwiqhg5ssib44"), + "init": mustParseCid("bafk2bzaceadyfilb22bcvzvnpzbg2lyg6npmperyq6es2brvzjdh5rmywc4ry"), + "multisig": mustParseCid("bafk2bzacec66wmb4kohuzvuxsulhcgiwju7sqkldwfpmmgw7dbbwgm5l2574q"), + "paymentchannel": mustParseCid("bafk2bzaceblot4pemhfgwb3lceellwrpgxaqkpselzbpqu32maffpopdunlha"), + "reward": mustParseCid("bafk2bzaceayah37uvj7brl5no4gmvmqbmtndh5raywuts7h6tqbgbq2ge7dhu"), + "storagemarket": mustParseCid("bafk2bzacebotg5coqnglzsdrqxtkqk2eq4krxt6zvds3i3vb2yejgxhexl2n6"), + "storageminer": mustParseCid("bafk2bzacea6rabflc7kpwr6y4lzcqsnuahr4zblyq3rhzrrsfceeiw2lufrb4"), + "storagepower": mustParseCid("bafk2bzacecpwr4mynn55bg5hrlns3osvg7sty3rca6zlai3vl52vbbjk7ulfa"), + "system": mustParseCid("bafk2bzaceaqrkllksxv2jsfgjvmuewx5vbzrammw5mdscod6gkdr3ijih2q64"), + "verifiedregistry": mustParseCid("bafk2bzaceaihibfu625lbtzdp3tcftscshrmbgghgrc7kzqhxn4455pycpdkm"), + }, +}, { + Network: "caterpillarnet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacecsmunz6fzhg53276cixadn6ybhcnzkgbw3la5hf342tfxsdoet26"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzaced6yatl4y2nmqmx2h3btk3np6oelyw2yt57elsb2nfmm33fadzt2g"), + "cron": mustParseCid("bafk2bzacebrujytq4u7g62jbz52gio5k2s6rhruty7nt4eqq7ygitzxuee5zi"), + "init": mustParseCid("bafk2bzacedajw5ptnwfdidv6m4rvd4c2m7dve4lhfbawygl5idkalcxbiiudu"), + "multisig": mustParseCid("bafk2bzaceb3kh5hjh6eebb5236xp7crn2owyyo7irap6sy4ns76uc7om6pxuy"), + "paymentchannel": mustParseCid("bafk2bzacedl5am53e4mtxpzligcycxvmkolfkhfiuavww2dq3ukgaqwowj7vw"), + "reward": mustParseCid("bafk2bzacecbswf242j43cymj3wh7nszawwlofv6z6z4qipb5d32hpxdhxywng"), + "storagemarket": mustParseCid("bafk2bzaceca5ersmg3zxf2cztgktq33bmfjuiqjcjlktwj52xyrpujbdsqvek"), + "storageminer": mustParseCid("bafk2bzacedg2fqaq5udfp3h6cxhywm27dgagxtselfgkyyyunqq362eaxpdm4"), + "storagepower": mustParseCid("bafk2bzaceb3dm2i2q323e6iozo3r6pyded645vvlpf537kga2a3hu5x7abgl4"), + "system": mustParseCid("bafk2bzacebu47th3xerlngqavlipb6cfu2utljkxxzgadc3totogto2tmx2jc"), + "verifiedregistry": mustParseCid("bafk2bzaceci3niq3rmbcmepgn27zvlgci6d5t4dvthx3pbmmx3wcu5elova6i"), + }, +}, { + Network: "devnet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacedq7tuibavyqxzkq4uybjj7ly22eu42mjkoehwn5d47xfunmtjm4k"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzacea4tlgnp7m6tlldpz3termlwxlnyq24nwd4zdzv4r6nsjuaktuuzc"), + "cron": mustParseCid("bafk2bzacecgrlf3vg3mufwovddlbgclhpnpp3jftr46stssh3crd3pyljc37w"), + "init": mustParseCid("bafk2bzacedarbnovmucppbjkcwsxopludrj5ttmtm7mzfqsugmxdnqevqso7o"), + "multisig": mustParseCid("bafk2bzaced4gcxjwy6garxwfw6y5a2k4jewj4t5nzopjy4qwnimhjtnsgo3ss"), + "paymentchannel": mustParseCid("bafk2bzaceb3isfguytt6cs4xecyoonbhhekmngfbap2msggbwyde7zch3a6w4"), + "reward": mustParseCid("bafk2bzacedn3fkp27ys5dxn4pwqdq2atj2x6cyezxuekdorvjwi7zazirgvgy"), + "storagemarket": mustParseCid("bafk2bzacecw57fpkqesfhi5g3nr4csy4oy7oc42wmwjuis6l7ijniolo4rt2k"), + "storageminer": mustParseCid("bafk2bzacebze3elvppssc6v5457ukszzy6ndrg6xgaojfsqfbbtg3xfwo4rbs"), + "storagepower": mustParseCid("bafk2bzaceb45l6zhgc34n6clz7xnvd7ek55bhw46q25umuje34t6kroix6hh6"), + "system": mustParseCid("bafk2bzacecf7eta2stfd3cnuxzervd33imbvlaqq6b5tsho7pxmhifrybreru"), + "verifiedregistry": mustParseCid("bafk2bzaceaajgtglewgitshgdi2nzrvq7eihjtyqj5yiamesqun2hujl3xev2"), + }, +}, { + Network: "mainnet", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacebogjbpiemi7npzxchgcjjki3tfxon4ims55obfyfleqntteljsea"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzacedudbf7fc5va57t3tmo63snmt3en4iaidv4vo3qlyacbxaa6hlx6y"), + "cron": mustParseCid("bafk2bzacecqb3eolfurehny6yp7tgmapib4ocazo5ilkopjce2c7wc2bcec62"), + "init": mustParseCid("bafk2bzaceaipvjhoxmtofsnv3aj6gj5ida4afdrxa4ewku2hfipdlxpaektlw"), + "multisig": mustParseCid("bafk2bzacebhldfjuy4o5v7amrhp5p2gzv2qo5275jut4adnbyp56fxkwy5fag"), + "paymentchannel": mustParseCid("bafk2bzacebalad3f72wyk7qyilvfjijcwubdspytnyzlrhvn73254gqis44rq"), + "reward": mustParseCid("bafk2bzacecwzzxlgjiavnc3545cqqil3cmq4hgpvfp2crguxy2pl5ybusfsbe"), + "storagemarket": mustParseCid("bafk2bzacediohrxkp2fbsl4yj4jlupjdkgsiwqb4zuezvinhdo2j5hrxco62q"), + "storageminer": mustParseCid("bafk2bzacecgnynvd3tene3bvqoknuspit56canij5bpra6wl4mrq2mxxwriyu"), + "storagepower": mustParseCid("bafk2bzacebjvqva6ppvysn5xpmiqcdfelwbbcxmghx5ww6hr37cgred6dyrpm"), + "system": mustParseCid("bafk2bzacedwq5uppsw7vp55zpj7jdieizirmldceehu6wvombw3ixq2tcq57w"), + "verifiedregistry": mustParseCid("bafk2bzaceb3zbkjz3auizmoln2unmxep7dyfcmsre64vnqfhdyh7rkqfoxlw4"), + }, +}, { + Network: "testing", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacedkjpqx27wgsvfxzuxfvixuxtbpt2y6yo6igcasez6gqiowron776"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzacebmfbtdj5vruje5auacrhhprcjdd6uclhukb7je7t2f6ozfcgqlu2"), + "cron": mustParseCid("bafk2bzacea4gwsbeux7z4yxvpkxpco77iyxijoyqaoikofrxdewunwh3unjem"), + "init": mustParseCid("bafk2bzacecqk6zlwein7tzy7yrrhtj4pzavrkofgpyxvvw5ktr3w4x4ml4lis"), + "multisig": mustParseCid("bafk2bzacea5zp2g6ag5qfuro7zw6kyku2swxs57wjxncaaxbih5iqflqy4ghm"), + "paymentchannel": mustParseCid("bafk2bzaced47dbtbygmfwnyfsp5iihzhhdmnkpuyc5nlnfgc4mkkvlsgvj2do"), + "reward": mustParseCid("bafk2bzacecmcagk32pzdzfg7piobzqhlgla37x3g7jjzyndlz7mqdno2zulfi"), + "storagemarket": mustParseCid("bafk2bzaceballmgd7puoixfwm65f5shi3kzreqdisowtsoufbvduwytydqotw"), + "storageminer": mustParseCid("bafk2bzacebucngwdhxtod2gvv52adtdssafyg43znsoy4omtfkkqe2hbhvxeu"), + "storagepower": mustParseCid("bafk2bzaceakxw5wx3rtqoarrdbzhmxkufg2kx7n34xotzxzacvvbe5iqggmsa"), + "system": mustParseCid("bafk2bzaced6kjkbv7lrb2qwq5we2hqaxc6ztch5p52g27qtjy45zdemsk4b7m"), + "verifiedregistry": mustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"), + }, +}, { + Network: "testing-fake-proofs", + Version: 8, + ManifestCid: mustParseCid("bafy2bzacecd3lb5v6tzjylnhnrhexslssyaozy6hogzgpkhztoe76exbrgrug"), + Actors: map[string]cid.Cid{ + "account": mustParseCid("bafk2bzacebmfbtdj5vruje5auacrhhprcjdd6uclhukb7je7t2f6ozfcgqlu2"), + "cron": mustParseCid("bafk2bzacea4gwsbeux7z4yxvpkxpco77iyxijoyqaoikofrxdewunwh3unjem"), + "init": mustParseCid("bafk2bzacebwkqd6e7gdphfzw2kdmbokdh2bly6fvzgfopxzy7quq4l67gmkks"), + "multisig": mustParseCid("bafk2bzacea5zp2g6ag5qfuro7zw6kyku2swxs57wjxncaaxbih5iqflqy4ghm"), + "paymentchannel": mustParseCid("bafk2bzaced47dbtbygmfwnyfsp5iihzhhdmnkpuyc5nlnfgc4mkkvlsgvj2do"), + "reward": mustParseCid("bafk2bzacecmcagk32pzdzfg7piobzqhlgla37x3g7jjzyndlz7mqdno2zulfi"), + "storagemarket": mustParseCid("bafk2bzacecxqgajcaednamgolc6wc3lzbjc6tz5alfrbwqez2y3c372vts6dg"), + "storageminer": mustParseCid("bafk2bzaceaqwxllfycpq6decpsnkqjdeycpysh5acubonjae7u3wciydlkvki"), + "storagepower": mustParseCid("bafk2bzaceddmeolsokbxgcr25cuf2skrobtmmoof3dmqfpcfp33lmw63oikvm"), + "system": mustParseCid("bafk2bzaced6kjkbv7lrb2qwq5we2hqaxc6ztch5p52g27qtjy45zdemsk4b7m"), + "verifiedregistry": mustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"), + }, +}} + +func mustParseCid(c string) cid.Cid { + ret, err := cid.Decode(c) + if err != nil { + panic(err) + } + + return ret +} diff --git a/venus-shared/builtin-actors/builtin_actors_test.go b/venus-shared/actors/builtin_actors_test.go similarity index 59% rename from venus-shared/builtin-actors/builtin_actors_test.go rename to venus-shared/actors/builtin_actors_test.go index a278629924..89d666258c 100644 --- a/venus-shared/builtin-actors/builtin_actors_test.go +++ b/venus-shared/actors/builtin_actors_test.go @@ -1,9 +1,8 @@ -package builtinactors +package actors import ( "testing" - "github.com/filecoin-project/venus/venus-shared/actors" "github.com/stretchr/testify/require" ) @@ -17,16 +16,16 @@ func TestEmbeddedMetadata(t *testing.T) { // Test that we're registering the manifest correctly. func TestRegistration(t *testing.T) { - manifestCid, found := actors.GetManifest(actors.Version8) + manifestCid, found := GetManifest(Version8) require.True(t, found) require.True(t, manifestCid.Defined()) - for _, key := range actors.GetBuiltinActorsKeys() { - actorCid, found := actors.GetActorCodeID(actors.Version8, key) + for _, key := range GetBuiltinActorsKeys() { + actorCid, found := GetActorCodeID(Version8, key) require.True(t, found) - name, version, found := actors.GetActorMetaByCode(actorCid) + name, version, found := GetActorMetaByCode(actorCid) require.True(t, found) - require.Equal(t, actors.Version8, version) + require.Equal(t, Version8, version) require.Equal(t, key, name) } } diff --git a/venus-shared/builtin-actors/builtin_actors_gen.go b/venus-shared/builtin-actors/builtin_actors_gen.go deleted file mode 100644 index ce46905b7d..0000000000 --- a/venus-shared/builtin-actors/builtin_actors_gen.go +++ /dev/null @@ -1,128 +0,0 @@ -// WARNING: This file has automatically been generated -package builtinactors - -import ( - "github.com/filecoin-project/venus/venus-shared/types" - "github.com/ipfs/go-cid" -) - -var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMetadata{{ - Network: "butterflynet", - Version: 8, - ManifestCid: types.MustParseCid("bafy2bzacedvaarfyh6q3bk4dyzux46ednlace2ckxp5nbyn6mb3da2apqn6sk"), - Actors: map[string]cid.Cid{ - "account": types.MustParseCid("bafk2bzaceavzeu4gqte7o33vr4htiaapiwpfq6p26tgdkqla2baqhmiqswfso"), - "cron": types.MustParseCid("bafk2bzacech35onpqxep4yox36k7sr4mj4bch54s3i4b3yyaustrbo5xwfbfs"), - "init": types.MustParseCid("bafk2bzaceahxin3sf5f6ude5j6we4yeqlg66s5qe4tu7lwp26jcg7yp2ns6hi"), - "multisig": types.MustParseCid("bafk2bzacectfmzjtniypgl4whm42sws5aupihqgfikwsr7p5yoq3bmqaogldi"), - "paymentchannel": types.MustParseCid("bafk2bzacecbwu54ce5mjgp2pqxyj6kpn2vlgiu5wv2lj2byjiegxnn3infd5i"), - "reward": types.MustParseCid("bafk2bzacecskkbhe6c4ud5jt62wg4w7j7shj6xdwoyic74s5y6pgywxxvnw72"), - "storagemarket": types.MustParseCid("bafk2bzacebycxcwwm7hwhuhpasaskil2kxaqb7tins7azdvvm72rorlciuysi"), - "storageminer": types.MustParseCid("bafk2bzacecgx3etor5m6lahpmjdwqnryutqe6naiurfhgsju72rd4nqssutbg"), - "storagepower": types.MustParseCid("bafk2bzaceayvy6xyp5cwtngm457c5hssvihidppgq3o7gy3dlmhgor3yzujoc"), - "system": types.MustParseCid("bafk2bzacec6xctjxybp7r3kkhase56o6jsaiua7ure5ttu2xfuojt4jhlsoa6"), - "verifiedregistry": types.MustParseCid("bafk2bzacec2hcqlqcfacylfcrhhliwkisvh4y3adwt47xkf2gdvodwu6ccepc"), - }, -}, { - Network: "calibrationnet", - Version: 8, - ManifestCid: types.MustParseCid("bafy2bzacedrdn6z3z7xz7lx4wll3tlgktirhllzqxb766dxpaqp3ukxsjfsba"), - Actors: map[string]cid.Cid{ - "account": types.MustParseCid("bafk2bzacecruossn66xqbeutqx5r4k2kjzgd43frmwd4qkw6haez44ubvvpxo"), - "cron": types.MustParseCid("bafk2bzaceaxlezmclw5ugldhhtfgvn7yztux45scqik3ez4yhwiqhg5ssib44"), - "init": types.MustParseCid("bafk2bzaceadyfilb22bcvzvnpzbg2lyg6npmperyq6es2brvzjdh5rmywc4ry"), - "multisig": types.MustParseCid("bafk2bzacec66wmb4kohuzvuxsulhcgiwju7sqkldwfpmmgw7dbbwgm5l2574q"), - "paymentchannel": types.MustParseCid("bafk2bzaceblot4pemhfgwb3lceellwrpgxaqkpselzbpqu32maffpopdunlha"), - "reward": types.MustParseCid("bafk2bzaceayah37uvj7brl5no4gmvmqbmtndh5raywuts7h6tqbgbq2ge7dhu"), - "storagemarket": types.MustParseCid("bafk2bzacebotg5coqnglzsdrqxtkqk2eq4krxt6zvds3i3vb2yejgxhexl2n6"), - "storageminer": types.MustParseCid("bafk2bzacea6rabflc7kpwr6y4lzcqsnuahr4zblyq3rhzrrsfceeiw2lufrb4"), - "storagepower": types.MustParseCid("bafk2bzacecpwr4mynn55bg5hrlns3osvg7sty3rca6zlai3vl52vbbjk7ulfa"), - "system": types.MustParseCid("bafk2bzaceaqrkllksxv2jsfgjvmuewx5vbzrammw5mdscod6gkdr3ijih2q64"), - "verifiedregistry": types.MustParseCid("bafk2bzaceaihibfu625lbtzdp3tcftscshrmbgghgrc7kzqhxn4455pycpdkm"), - }, -}, { - Network: "caterpillarnet", - Version: 8, - ManifestCid: types.MustParseCid("bafy2bzacecsmunz6fzhg53276cixadn6ybhcnzkgbw3la5hf342tfxsdoet26"), - Actors: map[string]cid.Cid{ - "account": types.MustParseCid("bafk2bzaced6yatl4y2nmqmx2h3btk3np6oelyw2yt57elsb2nfmm33fadzt2g"), - "cron": types.MustParseCid("bafk2bzacebrujytq4u7g62jbz52gio5k2s6rhruty7nt4eqq7ygitzxuee5zi"), - "init": types.MustParseCid("bafk2bzacedajw5ptnwfdidv6m4rvd4c2m7dve4lhfbawygl5idkalcxbiiudu"), - "multisig": types.MustParseCid("bafk2bzaceb3kh5hjh6eebb5236xp7crn2owyyo7irap6sy4ns76uc7om6pxuy"), - "paymentchannel": types.MustParseCid("bafk2bzacedl5am53e4mtxpzligcycxvmkolfkhfiuavww2dq3ukgaqwowj7vw"), - "reward": types.MustParseCid("bafk2bzacecbswf242j43cymj3wh7nszawwlofv6z6z4qipb5d32hpxdhxywng"), - "storagemarket": types.MustParseCid("bafk2bzaceca5ersmg3zxf2cztgktq33bmfjuiqjcjlktwj52xyrpujbdsqvek"), - "storageminer": types.MustParseCid("bafk2bzacedg2fqaq5udfp3h6cxhywm27dgagxtselfgkyyyunqq362eaxpdm4"), - "storagepower": types.MustParseCid("bafk2bzaceb3dm2i2q323e6iozo3r6pyded645vvlpf537kga2a3hu5x7abgl4"), - "system": types.MustParseCid("bafk2bzacebu47th3xerlngqavlipb6cfu2utljkxxzgadc3totogto2tmx2jc"), - "verifiedregistry": types.MustParseCid("bafk2bzaceci3niq3rmbcmepgn27zvlgci6d5t4dvthx3pbmmx3wcu5elova6i"), - }, -}, { - Network: "devnet", - Version: 8, - ManifestCid: types.MustParseCid("bafy2bzacedq7tuibavyqxzkq4uybjj7ly22eu42mjkoehwn5d47xfunmtjm4k"), - Actors: map[string]cid.Cid{ - "account": types.MustParseCid("bafk2bzacea4tlgnp7m6tlldpz3termlwxlnyq24nwd4zdzv4r6nsjuaktuuzc"), - "cron": types.MustParseCid("bafk2bzacecgrlf3vg3mufwovddlbgclhpnpp3jftr46stssh3crd3pyljc37w"), - "init": types.MustParseCid("bafk2bzacedarbnovmucppbjkcwsxopludrj5ttmtm7mzfqsugmxdnqevqso7o"), - "multisig": types.MustParseCid("bafk2bzaced4gcxjwy6garxwfw6y5a2k4jewj4t5nzopjy4qwnimhjtnsgo3ss"), - "paymentchannel": types.MustParseCid("bafk2bzaceb3isfguytt6cs4xecyoonbhhekmngfbap2msggbwyde7zch3a6w4"), - "reward": types.MustParseCid("bafk2bzacedn3fkp27ys5dxn4pwqdq2atj2x6cyezxuekdorvjwi7zazirgvgy"), - "storagemarket": types.MustParseCid("bafk2bzacecw57fpkqesfhi5g3nr4csy4oy7oc42wmwjuis6l7ijniolo4rt2k"), - "storageminer": types.MustParseCid("bafk2bzacebze3elvppssc6v5457ukszzy6ndrg6xgaojfsqfbbtg3xfwo4rbs"), - "storagepower": types.MustParseCid("bafk2bzaceb45l6zhgc34n6clz7xnvd7ek55bhw46q25umuje34t6kroix6hh6"), - "system": types.MustParseCid("bafk2bzacecf7eta2stfd3cnuxzervd33imbvlaqq6b5tsho7pxmhifrybreru"), - "verifiedregistry": types.MustParseCid("bafk2bzaceaajgtglewgitshgdi2nzrvq7eihjtyqj5yiamesqun2hujl3xev2"), - }, -}, { - Network: "mainnet", - Version: 8, - ManifestCid: types.MustParseCid("bafy2bzacebogjbpiemi7npzxchgcjjki3tfxon4ims55obfyfleqntteljsea"), - Actors: map[string]cid.Cid{ - "account": types.MustParseCid("bafk2bzacedudbf7fc5va57t3tmo63snmt3en4iaidv4vo3qlyacbxaa6hlx6y"), - "cron": types.MustParseCid("bafk2bzacecqb3eolfurehny6yp7tgmapib4ocazo5ilkopjce2c7wc2bcec62"), - "init": types.MustParseCid("bafk2bzaceaipvjhoxmtofsnv3aj6gj5ida4afdrxa4ewku2hfipdlxpaektlw"), - "multisig": types.MustParseCid("bafk2bzacebhldfjuy4o5v7amrhp5p2gzv2qo5275jut4adnbyp56fxkwy5fag"), - "paymentchannel": types.MustParseCid("bafk2bzacebalad3f72wyk7qyilvfjijcwubdspytnyzlrhvn73254gqis44rq"), - "reward": types.MustParseCid("bafk2bzacecwzzxlgjiavnc3545cqqil3cmq4hgpvfp2crguxy2pl5ybusfsbe"), - "storagemarket": types.MustParseCid("bafk2bzacediohrxkp2fbsl4yj4jlupjdkgsiwqb4zuezvinhdo2j5hrxco62q"), - "storageminer": types.MustParseCid("bafk2bzacecgnynvd3tene3bvqoknuspit56canij5bpra6wl4mrq2mxxwriyu"), - "storagepower": types.MustParseCid("bafk2bzacebjvqva6ppvysn5xpmiqcdfelwbbcxmghx5ww6hr37cgred6dyrpm"), - "system": types.MustParseCid("bafk2bzacedwq5uppsw7vp55zpj7jdieizirmldceehu6wvombw3ixq2tcq57w"), - "verifiedregistry": types.MustParseCid("bafk2bzaceb3zbkjz3auizmoln2unmxep7dyfcmsre64vnqfhdyh7rkqfoxlw4"), - }, -}, { - Network: "testing", - Version: 8, - ManifestCid: types.MustParseCid("bafy2bzacedkjpqx27wgsvfxzuxfvixuxtbpt2y6yo6igcasez6gqiowron776"), - Actors: map[string]cid.Cid{ - "account": types.MustParseCid("bafk2bzacebmfbtdj5vruje5auacrhhprcjdd6uclhukb7je7t2f6ozfcgqlu2"), - "cron": types.MustParseCid("bafk2bzacea4gwsbeux7z4yxvpkxpco77iyxijoyqaoikofrxdewunwh3unjem"), - "init": types.MustParseCid("bafk2bzacecqk6zlwein7tzy7yrrhtj4pzavrkofgpyxvvw5ktr3w4x4ml4lis"), - "multisig": types.MustParseCid("bafk2bzacea5zp2g6ag5qfuro7zw6kyku2swxs57wjxncaaxbih5iqflqy4ghm"), - "paymentchannel": types.MustParseCid("bafk2bzaced47dbtbygmfwnyfsp5iihzhhdmnkpuyc5nlnfgc4mkkvlsgvj2do"), - "reward": types.MustParseCid("bafk2bzacecmcagk32pzdzfg7piobzqhlgla37x3g7jjzyndlz7mqdno2zulfi"), - "storagemarket": types.MustParseCid("bafk2bzaceballmgd7puoixfwm65f5shi3kzreqdisowtsoufbvduwytydqotw"), - "storageminer": types.MustParseCid("bafk2bzacebucngwdhxtod2gvv52adtdssafyg43znsoy4omtfkkqe2hbhvxeu"), - "storagepower": types.MustParseCid("bafk2bzaceakxw5wx3rtqoarrdbzhmxkufg2kx7n34xotzxzacvvbe5iqggmsa"), - "system": types.MustParseCid("bafk2bzaced6kjkbv7lrb2qwq5we2hqaxc6ztch5p52g27qtjy45zdemsk4b7m"), - "verifiedregistry": types.MustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"), - }, -}, { - Network: "testing-fake-proofs", - Version: 8, - ManifestCid: types.MustParseCid("bafy2bzacecd3lb5v6tzjylnhnrhexslssyaozy6hogzgpkhztoe76exbrgrug"), - Actors: map[string]cid.Cid{ - "account": types.MustParseCid("bafk2bzacebmfbtdj5vruje5auacrhhprcjdd6uclhukb7je7t2f6ozfcgqlu2"), - "cron": types.MustParseCid("bafk2bzacea4gwsbeux7z4yxvpkxpco77iyxijoyqaoikofrxdewunwh3unjem"), - "init": types.MustParseCid("bafk2bzacebwkqd6e7gdphfzw2kdmbokdh2bly6fvzgfopxzy7quq4l67gmkks"), - "multisig": types.MustParseCid("bafk2bzacea5zp2g6ag5qfuro7zw6kyku2swxs57wjxncaaxbih5iqflqy4ghm"), - "paymentchannel": types.MustParseCid("bafk2bzaced47dbtbygmfwnyfsp5iihzhhdmnkpuyc5nlnfgc4mkkvlsgvj2do"), - "reward": types.MustParseCid("bafk2bzacecmcagk32pzdzfg7piobzqhlgla37x3g7jjzyndlz7mqdno2zulfi"), - "storagemarket": types.MustParseCid("bafk2bzacecxqgajcaednamgolc6wc3lzbjc6tz5alfrbwqez2y3c372vts6dg"), - "storageminer": types.MustParseCid("bafk2bzaceaqwxllfycpq6decpsnkqjdeycpysh5acubonjae7u3wciydlkvki"), - "storagepower": types.MustParseCid("bafk2bzaceddmeolsokbxgcr25cuf2skrobtmmoof3dmqfpcfp33lmw63oikvm"), - "system": types.MustParseCid("bafk2bzaced6kjkbv7lrb2qwq5we2hqaxc6ztch5p52g27qtjy45zdemsk4b7m"), - "verifiedregistry": types.MustParseCid("bafk2bzacectzxvtoselhnzsair5nv6k5vokvegnht6z2lfee4p3xexo4kg4m6"), - }, -}} diff --git a/venus-shared/utils/method_map_test.go b/venus-shared/utils/method_map_test.go index 1c98a18171..68f2c602de 100644 --- a/venus-shared/utils/method_map_test.go +++ b/venus-shared/utils/method_map_test.go @@ -4,7 +4,7 @@ import ( "testing" tf "github.com/filecoin-project/venus/pkg/testhelpers/testflags" - builtinactors "github.com/filecoin-project/venus/venus-shared/builtin-actors" + "github.com/filecoin-project/venus/venus-shared/actors" "github.com/filecoin-project/venus/venus-shared/types" "github.com/stretchr/testify/assert" ) @@ -13,7 +13,7 @@ func TestMethodMap(t *testing.T) { tf.UnitTest(t) t.Run("Default to load mainnet v8 actors", func(t *testing.T) { - for _, actorsMetadata := range builtinactors.EmbeddedBuiltinActorsMetadata { + for _, actorsMetadata := range actors.EmbeddedBuiltinActorsMetadata { if actorsMetadata.Network == string(types.NetworkNameMain) { for _, actor := range actorsMetadata.Actors { _, ok := MethodsMap[actor] @@ -24,7 +24,7 @@ func TestMethodMap(t *testing.T) { }) t.Run("ReLoad butterflynet v8 actors", func(t *testing.T) { - for _, actorsMetadata := range builtinactors.EmbeddedBuiltinActorsMetadata { + for _, actorsMetadata := range actors.EmbeddedBuiltinActorsMetadata { if actorsMetadata.Network == string(types.NetworkNameButterfly) { for _, actor := range actorsMetadata.Actors { _, ok := MethodsMap[actor] @@ -33,9 +33,9 @@ func TestMethodMap(t *testing.T) { } } - assert.Nil(t, builtinactors.SetNetworkBundle(types.NetworkButterfly)) + assert.Nil(t, actors.SetNetworkBundle(int(types.NetworkButterfly))) ReloadMethodsMap() - for _, actorsMetadata := range builtinactors.EmbeddedBuiltinActorsMetadata { + for _, actorsMetadata := range actors.EmbeddedBuiltinActorsMetadata { if actorsMetadata.Network == string(types.NetworkNameButterfly) { for _, actor := range actorsMetadata.Actors { _, ok := MethodsMap[actor] diff --git a/venus-shared/utils/utils.go b/venus-shared/utils/utils.go index 0fa7116fe4..22dd36dfee 100644 --- a/venus-shared/utils/utils.go +++ b/venus-shared/utils/utils.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - builtinactors "github.com/filecoin-project/venus/venus-shared/builtin-actors" + "github.com/filecoin-project/venus/venus-shared/actors" "github.com/filecoin-project/venus/venus-shared/types" ) @@ -60,7 +60,7 @@ func LoadBuiltinActors(ctx context.Context, getter networkNameGetter) error { if err != nil { return err } - if err := builtinactors.SetNetworkBundle(nt); err != nil { + if err := actors.SetNetworkBundle(int(nt)); err != nil { return err } ReloadMethodsMap() diff --git a/venus-shared/utils/utils_test.go b/venus-shared/utils/utils_test.go index 0ad0171de7..526aec6c66 100644 --- a/venus-shared/utils/utils_test.go +++ b/venus-shared/utils/utils_test.go @@ -7,7 +7,6 @@ import ( tf "github.com/filecoin-project/venus/pkg/testhelpers/testflags" "github.com/filecoin-project/venus/venus-shared/actors" "github.com/filecoin-project/venus/venus-shared/api/chain/v1/mock" - builtinactors "github.com/filecoin-project/venus/venus-shared/builtin-actors" "github.com/filecoin-project/venus/venus-shared/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" @@ -48,7 +47,7 @@ func TestLoadBuiltinActors(t *testing.T) { assert.Nil(t, LoadBuiltinActors(ctx, full)) - for _, actorsMetadata := range builtinactors.EmbeddedBuiltinActorsMetadata { + for _, actorsMetadata := range actors.EmbeddedBuiltinActorsMetadata { if actorsMetadata.Network == string(nn) { for name, actor := range actorsMetadata.Actors { res, ok := actors.GetActorCodeID(actorsMetadata.Version, name)