skip migration cache correctly
This commit is contained in:
		
							parent
							
								
									fb3c16207f
								
							
						
					
					
						commit
						ae75aa1d0d
					
				| @ -2064,7 +2064,7 @@ func upgradeActorsV12Fix(ctx context.Context, sm *stmgr.StateManager, cache stmg | ||||
| 	} | ||||
| 
 | ||||
| 	systemState.BuiltinActors = newManifest.Data | ||||
| 	newSystemHead, err := adtStore.Put(ctx, systemState) | ||||
| 	newSystemHead, err := adtStore.Put(ctx, &systemState) | ||||
| 	if err != nil { | ||||
| 		return cid.Undef, xerrors.Errorf("failed to put new system state: %w", err) | ||||
| 	} | ||||
| @ -2094,7 +2094,7 @@ func upgradeActorsV12Fix(ctx context.Context, sm *stmgr.StateManager, cache stmg | ||||
| 			return xerrors.Errorf("mismatched address for actor %s: %s != %s", a, inActor.Address, outActor.Address) | ||||
| 		} | ||||
| 
 | ||||
| 		if inActor.Head != outActor.Head { | ||||
| 		if inActor.Head != outActor.Head && a != builtin.SystemActorAddr { | ||||
| 			return xerrors.Errorf("mismatched head for actor %s", a) | ||||
| 		} | ||||
| 
 | ||||
|  | ||||
| @ -177,7 +177,8 @@ func (us UpgradeSchedule) GetNtwkVersion(e abi.ChainEpoch) (network.Version, err | ||||
| func (sm *StateManager) HandleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, cb ExecMonitor, ts *types.TipSet) (cid.Cid, error) { | ||||
| 	retCid := root | ||||
| 	u := sm.stateMigrations[height] | ||||
| 	if u != nil && u.upgrade != nil && height != build.UpgradeWatermelonFixHeight { | ||||
| 	if u != nil && u.upgrade != nil { | ||||
| 		if height != build.UpgradeWatermelonFixHeight { | ||||
| 			migCid, ok, err := u.migrationResultCache.Get(ctx, root) | ||||
| 			if err == nil { | ||||
| 				if ok { | ||||
| @ -189,12 +190,14 @@ func (sm *StateManager) HandleStateForks(ctx context.Context, root cid.Cid, heig | ||||
| 			} else { | ||||
| 				log.Debug("no cached migration found, migrating from scratch") | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		startTime := time.Now() | ||||
| 		log.Warnw("STARTING migration", "height", height, "from", root) | ||||
| 		// Yes, we clone the cache, even for the final upgrade epoch. Why? Reverts. We may
 | ||||
| 		// have to migrate multiple times.
 | ||||
| 		tmpCache := u.cache.Clone() | ||||
| 		var err error | ||||
| 		retCid, err = u.upgrade(ctx, sm, tmpCache, cb, root, height, ts) | ||||
| 		if err != nil { | ||||
| 			log.Errorw("FAILED migration", "height", height, "from", root, "error", err) | ||||
|  | ||||
| @ -57,7 +57,7 @@ func (a *SyncAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) erro | ||||
| 		return xerrors.Errorf("loading parent block: %w", err) | ||||
| 	} | ||||
| 
 | ||||
| 	if a.SlashFilter != nil && os.Getenv("LOTUS_NO_SLASHFILTER") != "_yes_i_know_i_can_and_probably_will_lose_all_my_fil_and_power_" { | ||||
| 	if a.SlashFilter != nil && os.Getenv("LOTUS_NO_SLASHFILTER") != "_yes_i_know_i_can_and_probably_will_lose_all_my_fil_and_power_" && !build.IsNearUpgrade(blk.Header.Height, build.UpgradeWatermelonFixHeight) { | ||||
| 		witness, fault, err := a.SlashFilter.MinedBlock(ctx, blk.Header, parent.Height) | ||||
| 		if err != nil { | ||||
| 			log.Errorf("<!!> SLASH FILTER ERRORED: %s", err) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user