Skip to content

Commit

Permalink
fix: add env
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Sep 25, 2023
1 parent ed1aa2e commit ae99a46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/constants/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ var InsecurePoStValidation = os.Getenv("INSECURE_POST_VALIDATION") == "1"

// NoSlashFilter will not check whether the miner's block violates the consensus
var NoSlashFilter = os.Getenv("VENUS_NO_SLASHFILTER") == "_yes_i_know_and_i_accept_that_may_loss_my_fil"

// NoMigrationResultCache will not use cached migration results
var NoMigrationResultCache = os.Getenv("VENUS_NOs_MIGRATION_RESULT_CACHE") == "1"
2 changes: 1 addition & 1 deletion pkg/fork/fork.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ func (c *ChainFork) HandleStateForks(ctx context.Context, root cid.Cid, height a
u := c.stateMigrations[height]
if u != nil && u.upgrade != nil {
migCid, ok, err := u.migrationResultCache.Get(ctx, root)
if err == nil && ok {
if err == nil && ok && !constants.NoMigrationResultCache {
log.Infow("CACHED migration", "height", height, "from", root, "to", migCid)
return migCid, nil
} else if err != nil {
Expand Down

0 comments on commit ae99a46

Please sign in to comment.