diff --git a/miner/miner.go b/miner/miner.go index f15b8e013..ef5ef0b7c 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -283,6 +283,9 @@ func (m *Miner) mineOne(ctx context.Context, addr address.Address, base *MiningB dur := time.Now().Sub(start) log.Infof("Creating block took %s", dur) + if dur > time.Second*build.BlockDelay { + log.Warn("CAUTION: block production took longer than the block delay. Your computer may not be fast enough to keep up") + } return b, nil } diff --git a/storage/miner.go b/storage/miner.go index 3f78e7ca7..524319033 100644 --- a/storage/miner.go +++ b/storage/miner.go @@ -4,6 +4,7 @@ import ( "context" "errors" "sync" + "time" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" @@ -154,11 +155,17 @@ func NewElectionPoStProver(sb *sectorbuilder.SectorBuilder) *SectorBuilderEpp { var _ gen.ElectionPoStProver = (*SectorBuilderEpp)(nil) func (epp *SectorBuilderEpp) GenerateCandidates(ctx context.Context, ssi sectorbuilder.SortedPublicSectorInfo, rand []byte) ([]sectorbuilder.EPostCandidate, error) { + start := time.Now() var faults []uint64 // TODO var randbuf [32]byte copy(randbuf[:], rand) - return epp.sb.GenerateEPostCandidates(ssi, randbuf, faults) + cds, err := epp.sb.GenerateEPostCandidates(ssi, randbuf, faults) + if err != nil { + return nil, err + } + log.Infof("Generate candidates took %s", time.Since(start)) + return cds, nil } func (epp *SectorBuilderEpp) ComputeProof(ctx context.Context, ssi sectorbuilder.SortedPublicSectorInfo, rand []byte, winners []sectorbuilder.EPostCandidate) ([]byte, error) { @@ -166,5 +173,11 @@ func (epp *SectorBuilderEpp) ComputeProof(ctx context.Context, ssi sectorbuilder log.Warn("Generating fake EPost proof! You should only see this while running tests!") return []byte("valid proof"), nil } - return epp.sb.ComputeElectionPoSt(ssi, rand, winners) + start := time.Now() + proof, err := epp.sb.ComputeElectionPoSt(ssi, rand, winners) + if err != nil { + return nil, err + } + log.Infof("ComputeElectionPost took %s", time.Since(start)) + return proof, nil }