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,7 +967,8 @@ 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 {
err := terminateActor(tree, build.ZeroAddress, cb, epoch)
if err != nil && !xerrors.Is(err, types.ErrActorNotFound) { if err != nil && !xerrors.Is(err, types.ErrActorNotFound) {
return cid.Undef, xerrors.Errorf("deleting zero bls actor: %w", err) return cid.Undef, xerrors.Errorf("deleting zero bls actor: %w", err)
} }
@ -976,6 +977,7 @@ func UpgradeActorsV3(ctx context.Context, sm *StateManager, cache MigrationCache
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
} }