diff --git a/chain/actors/actor_cids.go b/chain/actors/actor_cids.go index 56a6e487d26..ddcd360d534 100644 --- a/chain/actors/actor_cids.go +++ b/chain/actors/actor_cids.go @@ -16,9 +16,10 @@ import ( func GetActorCodeID(av Version, name string) (cid.Cid, bool) { // Actors V8 and above - if cids, ok := GetActorCodeIDsFromManifest(av); ok { - if c, ok := cids[name]; ok { - return c, true + if av >= Version8 { + if cids, ok := GetActorCodeIDsFromManifest(av); ok { + c, ok := cids[name] + return c, ok } } @@ -304,7 +305,7 @@ func GetActorCodeID(av Version, name string) (cid.Cid, bool) { return cid.Undef, false } -// GetActorCodeIDs looks up a builtin actor's code CID by actor version. +// GetActorCodeIDs looks up all builtin actor's code CIDs by actor version. func GetActorCodeIDs(av Version) (map[string]cid.Cid, error) { cids, ok := GetActorCodeIDsFromManifest(av) if ok { diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 25f654042ca..d9d4f86443b 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -1526,7 +1526,7 @@ func (m *StateModule) StateNetworkVersion(ctx context.Context, tsk types.TipSetK func (a *StateAPI) StateActorCodeCIDs(ctx context.Context, nv network.Version) (map[string]cid.Cid, error) { actorVersion, err := actors.VersionForNetwork(nv) if err != nil { - return nil, xerrors.Errorf("invalid network version") + return nil, xerrors.Errorf("invalid network version %d: %w", nv, err) } cids, err := actors.GetActorCodeIDs(actorVersion)