Skip to content

Commit

Permalink
Merge pull request #6055 from filecoin-project/feat/skip-slash-error
Browse files Browse the repository at this point in the history
feat: Increase the environment variable to skip checking whether mine…
  • Loading branch information
hunjixin authored Jul 10, 2023
2 parents d52f784 + 3323fbc commit 2f1d284
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/submodule/syncer/syncer_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/filecoin-project/go-state-types/big"
syncTypes "github.com/filecoin-project/venus/pkg/chainsync/types"
"github.com/filecoin-project/venus/pkg/constants"
"github.com/filecoin-project/venus/pkg/fvm"
v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
"github.com/filecoin-project/venus/venus-shared/types"
Expand Down Expand Up @@ -101,9 +102,11 @@ func (sa *syncerAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) e
return fmt.Errorf("loading parent block: %v", err)
}

if err := sa.syncer.SlashFilter.MinedBlock(ctx, blk.Header, parent.Height); err != nil {
log.Errorf("<!!> SLASH FILTER ERROR: %s", err)
return fmt.Errorf("<!!> SLASH FILTER ERROR: %v", err)
if !constants.NoSlashFilter {
if err := sa.syncer.SlashFilter.MinedBlock(ctx, blk.Header, parent.Height); err != nil {
log.Errorf("<!!> SLASH FILTER ERROR: %s", err)
return fmt.Errorf("<!!> SLASH FILTER ERROR: %v", err)
}
}

// TODO: should we have some sort of fast path to adding a local block?
Expand Down
3 changes: 3 additions & 0 deletions pkg/constants/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ var FevmEnableEthRPC = os.Getenv("VENUS_FEVM_ENABLEETHRPC") == "1"

// InsecurePoStValidation use to attach debug
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"

0 comments on commit 2f1d284

Please sign in to comment.