Skip to content

Commit

Permalink
Merge pull request #11241 from filecoin-project/asr/fix-miner-logs
Browse files Browse the repository at this point in the history
fix: miner: correct duration logs in mineOne
  • Loading branch information
arajasek authored Sep 6, 2023
2 parents 5e5a81b + 82b13af commit 4ea712c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
return nil, err
}

tEquivocateWait := build.Clock.Now()
tPending := build.Clock.Now()

// This next block exists to "catch" equivocating miners,
// who submit 2 blocks at the same height at different times in order to split the network.
Expand All @@ -576,6 +576,8 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
return nil, err
}

tEquivocateWait := build.Clock.Now()

// If the base has changed, we take the _intersection_ of our old base and new base,
// thus ejecting blocks from any equivocating miners, without taking any new blocks.
if newBase.TipSet.Height() == base.TipSet.Height() && !newBase.TipSet.Equals(base.TipSet) {
Expand Down Expand Up @@ -621,7 +623,7 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
}
}

tPending := build.Clock.Now()
tIntersectAndRefresh := build.Clock.Now()

// TODO: winning post proof
minedBlock, err = m.createBlock(base, m.address, ticket, winner, bvals, postProof, msgs)
Expand All @@ -643,9 +645,10 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (minedBlock *type
"tTicket ", tTicket.Sub(tPowercheck),
"tSeed ", tSeed.Sub(tTicket),
"tProof ", tProof.Sub(tSeed),
"tEquivocateWait ", tEquivocateWait.Sub(tProof),
"tPending ", tPending.Sub(tEquivocateWait),
"tCreateBlock ", tCreateBlock.Sub(tPending))
"tPending ", tPending.Sub(tProof),
"tEquivocateWait ", tEquivocateWait.Sub(tPending),
"tIntersectAndRefresh ", tIntersectAndRefresh.Sub(tEquivocateWait),
"tCreateBlock ", tCreateBlock.Sub(tIntersectAndRefresh))
}

return minedBlock, nil
Expand Down

0 comments on commit 4ea712c

Please sign in to comment.