Only delete the zero BLS actor on mainnet

This commit is contained in:
Aayush Rajasekaran 2021-02-18 15:43:20 -05:00
parent 2ca70e600d
commit a0fedf8bdb

View File

@ -967,14 +967,16 @@ func UpgradeActorsV3(ctx context.Context, sm *StateManager, cache MigrationCache
return cid.Undef, xerrors.Errorf("getting state tree: %w", err) return cid.Undef, xerrors.Errorf("getting state tree: %w", err)
} }
err = terminateActor(tree, build.ZeroAddress, cb, epoch) if build.BuildType == build.BuildMainnet {
if err != nil && !xerrors.Is(err, types.ErrActorNotFound) { err := terminateActor(tree, build.ZeroAddress, cb, epoch)
return cid.Undef, xerrors.Errorf("deleting zero bls actor: %w", err) if err != nil && !xerrors.Is(err, types.ErrActorNotFound) {
} return cid.Undef, xerrors.Errorf("deleting zero bls actor: %w", err)
}
newRoot, err = tree.Flush(ctx) newRoot, err = tree.Flush(ctx)
if err != nil { if err != nil {
return cid.Undef, xerrors.Errorf("flushing state tree: %w", err) return cid.Undef, xerrors.Errorf("flushing state tree: %w", err)
}
} }
return newRoot, nil return newRoot, nil