Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miner debug where injectNulls != 0 #4058

Merged
merged 1 commit into from
Sep 28, 2020

Conversation

zgfzgf
Copy link
Contributor

@zgfzgf zgfzgf commented Sep 27, 2020

No description provided.

@magik6k
Copy link
Contributor

magik6k commented Sep 28, 2020

Hey! Thanks for this PR

Do you mind explaining the reasoning behind this change? Does it fix any open issue?

@zgfzgf
Copy link
Contributor Author

zgfzgf commented Sep 28, 2020

Now there's no problem because injectNulls == 0

when injectNulls != 0

lotus/miner/miner.go

Lines 214 to 233 in 18dac6d

if base.TipSet.Equals(lastBase.TipSet) && lastBase.NullRounds == base.NullRounds {
log.Warnf("BestMiningCandidate from the previous round: %s (nulls:%d)", lastBase.TipSet.Cids(), lastBase.NullRounds)
if !m.niceSleep(time.Duration(build.BlockDelaySecs) * time.Second) {
continue minerLoop
}
continue
}
base.NullRounds += injectNulls // testing
b, err := m.mineOne(ctx, base)
if err != nil {
log.Errorf("mining block failed: %+v", err)
if !m.niceSleep(time.Second) {
continue minerLoop
}
onDone(false, 0, err)
continue
}
lastBase = *base

lastBase.NullRounds == base.NullRounds // will not be equal

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Seems to make some tests lass falky

@magik6k magik6k merged commit b14afba into filecoin-project:master Sep 28, 2020
@zgfzgf zgfzgf deleted the miner-debug branch September 28, 2020 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants