rationalise annoying logs.

This commit is contained in:
Anton Evangelatov 2020-08-07 15:53:55 +02:00
parent 5a50d293b9
commit 9fa42680fe
2 changed files with 12 additions and 5 deletions

View File

@ -138,6 +138,12 @@ func NewSyncer(sm *stmgr.StateManager, bsync *blocksync.BlockSync, connmgr connm
incoming: pubsub.New(50),
}
if build.InsecurePoStValidation {
log.Warn("*********************************************************************************************")
log.Warn(" [INSECURE-POST-VALIDATION] Insecure test validation is enabled. If you see this outside of a test, it is a severe bug! ")
log.Warn("*********************************************************************************************")
}
s.syncmgr = NewSyncManager(s.Sync)
return s, nil
}
@ -641,10 +647,6 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) (er
ctx, span := trace.StartSpan(ctx, "validateBlock")
defer span.End()
if build.InsecurePoStValidation {
log.Warn("[INSECURE-POST-VALIDATION] if you see this outside of a test, it is a severe bug!")
}
if err := blockSanityChecks(b.Header); err != nil {
return xerrors.Errorf("incoming header failed basic sanity checks: %w", err)
}

View File

@ -164,6 +164,12 @@ func NewWinningPoStProver(api api.FullNode, prover storage.Prover, verifier ffiw
return nil, err
}
if build.InsecurePoStValidation {
log.Warn("*****************************************************************************")
log.Warn(" Generating fake PoSt proof! You should only see this while running tests! ")
log.Warn("*****************************************************************************")
}
return &StorageWpp{prover, verifier, abi.ActorID(miner), wpt}, nil
}
@ -182,7 +188,6 @@ func (wpp *StorageWpp) GenerateCandidates(ctx context.Context, randomness abi.Po
func (wpp *StorageWpp) ComputeProof(ctx context.Context, ssi []abi.SectorInfo, rand abi.PoStRandomness) ([]abi.PoStProof, error) {
if build.InsecurePoStValidation {
log.Warn("[INSECURE-POST-VALIDATION] Generating fake PoSt proof! You should only see this while running tests!")
return []abi.PoStProof{{ProofBytes: []byte("valid proof")}}, nil
}