diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 000000000..23c7640b7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,33 @@ +--- +name: Bug Report +about: Create a report to help us improve +title: "[BUG] " +labels: hint/needs-triaging, kind/bug +assignees: '' + +--- + +> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy). + +**Describe the bug** +A clear and concise description of what the bug is. +(If you are not sure what the bug is, try to figure it out via a [discussion](https://github.com/filecoin-project/lotus/discussions/new) first! + +**Version (run `lotus version`):** + +**To Reproduce** +Steps to reproduce the behavior: +1. Run '...' +2. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Logs** +Provide daemon/miner/worker logs, and goroutines(if available) for troubleshooting. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 1ded8c36b..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Run '...' -2. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Version (run `lotus version`):** - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/deal-making-issues.md b/.github/ISSUE_TEMPLATE/deal-making-issues.md new file mode 100644 index 000000000..bec800cb7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/deal-making-issues.md @@ -0,0 +1,49 @@ +--- +name: Deal Making Issues +about: Create a report for help with deal making failures. +title: "[Deal Making Issue]" +labels: hint/needs-triaging, area/markets +assignees: '' + +--- + +> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy). + +Please provide all the information requested here to help us troubleshoot "deal making failed" issues. +If the information requested is missing, we will probably have to just ask you to provide it anyway, +before we can help debug. + +**Basic Information** +Including information like, Are you the client or the miner? Is this a storage deal or a retrieval deal? Is it an offline deal? + +**Describe the problem** + +A brief description of the problem you encountered while trying to make a deal. + +**Version** + +The output of `lotus --version`. + +**Setup** + +You miner(if applicable) and daemon setup, i.e: What hardware do you use, how much ram and etc. + +**To Reproduce** + Steps to reproduce the behavior: + 1. Run '...' + 2. See error + +**Deal status** + +The output of `lotus client list-deals -v` and/or `lotus-miner storage-deals|retrieval-deals|data-transfers list [-v]` commands for the deal(s) in question. + +**Lotus daemon and miner logs** + +Please go through the logs of your daemon and miner(if applicable), and include screenshots of any error/warning-like messages you find. + +Alternatively please upload full log files and share a link here + +** Code modifications ** + +If you have modified parts of lotus, please describe which areas were modified, +and the scope of those modifications diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000..0803a6db8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[Feature Request]" +labels: hint/needs-triaging +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/mining-issues.md b/.github/ISSUE_TEMPLATE/mining-issues.md new file mode 100644 index 000000000..434e160d4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/mining-issues.md @@ -0,0 +1,35 @@ +--- +name: Mining Issues +about: Create a report for help with mining failures. +title: "[Mining Issue]" +labels: hint/needs-triaging, area/mining +assignees: '' + +--- + +> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy). + +Please provide all the information requested here to help us troubleshoot "mining/WinningPoSt failed" issues. +If the information requested is missing, you may be asked you to provide it. + +**Describe the problem** +A brief description of the problem you encountered while mining new blocks. + +**Version** + +The output of `lotus --version`. + +**Setup** + +You miner and daemon setup, including what hardware do you use, your environment variable settings, how do you run your miner and worker, do you use GPU and etc. + +**Lotus daemon and miner logs** + +Please go through the logs of your daemon and miner, and include screenshots of any error/warning-like messages you find, highlighting the one has "winning post" in it. + +Alternatively please upload full log files and share a link here + +** Code modifications ** + +If you have modified parts of lotus, please describe which areas were modified, +and the scope of those modifications diff --git a/.github/ISSUE_TEMPLATE/proving-issues.md b/.github/ISSUE_TEMPLATE/proving-issues.md new file mode 100644 index 000000000..6187d546e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/proving-issues.md @@ -0,0 +1,46 @@ +--- +name: Proving Issues +about: Create a report for help with proving failures. +title: "[Proving Issue]" +labels: area/proving, hint/needs-triaging +assignees: '' + +--- + +> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy). + +Please provide all the information requested here to help us troubleshoot "proving/window PoSt failed" issues. +If the information requested is missing, we will probably have to just ask you to provide it anyway, +before we can help debug. + +**Describe the problem** +A brief description of the problem you encountered while proving the storage. + +**Version** + +The output of `lotus --version`. + +**Setup** + +You miner and daemon setup, including what hardware do you use, your environment variable settings, how do you run your miner and worker, do you use GPU and etc. + +**Proving status** + +The output of `lotus-miner proving` info. + +**Lotus miner logs** + +Please go through the logs of your miner, and include screenshots of any error-like messages you find, highlighting the one has "window post" in it. + +Alternatively please upload full log files and share a link here + +**Lotus miner diagnostic info** + +Please collect the following diagnostic information, and share a link here + +* lotus-miner diagnostic info `lotus-miner info all > allinfo.txt` + +** Code modifications ** + +If you have modified parts of lotus, please describe which areas were modified, +and the scope of those modifications diff --git a/.github/ISSUE_TEMPLATE/sealingfailed.md b/.github/ISSUE_TEMPLATE/sealing-issues.md similarity index 67% rename from .github/ISSUE_TEMPLATE/sealingfailed.md rename to .github/ISSUE_TEMPLATE/sealing-issues.md index ae14c3262..7511849d3 100644 --- a/.github/ISSUE_TEMPLATE/sealingfailed.md +++ b/.github/ISSUE_TEMPLATE/sealing-issues.md @@ -1,21 +1,32 @@ --- name: Sealing Issues about: Create a report for help with sealing (commit) failures. -title: '' -labels: 'sealing' +title: "[Sealing Issue]" +labels: hint/needs-triaging, area/sealing assignees: '' --- +> Note: For security-related bugs/issues, please follow the [security policy](https://github.com/filecoin-project/lotus/security/policy). + Please provide all the information requested here to help us troubleshoot "commit failed" issues. If the information requested is missing, we will probably have to just ask you to provide it anyway, before we can help debug. **Describe the problem** +A brief description of the problem you encountered while sealing a sector. -A brief description of the problem you encountered while proving (sealing) a sector. +**Version** -Including what commands you ran, and a description of your setup, is very helpful. +The output of `lotus --version`. + +**Setup** + +You miner and daemon setup, including what hardware do you use, your environment variable settings, how do you run your miner and worker, do you use GPU and etc. + +**Commands** + +Commands you ran. **Sectors status** @@ -37,7 +48,3 @@ Please collect the following diagnostic information, and share a link here If you have modified parts of lotus, please describe which areas were modified, and the scope of those modifications - -**Version** - -The output of `lotus --version`. diff --git a/storage/wdpost_changehandler.go b/storage/wdpost_changehandler.go index 285995757..188d7e93a 100644 --- a/storage/wdpost_changehandler.go +++ b/storage/wdpost_changehandler.go @@ -13,7 +13,10 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -const SubmitConfidence = 4 +const ( + SubmitConfidence = 4 + ChallengeConfidence = 10 +) type CompleteGeneratePoSTCb func(posts []miner.SubmitWindowedPoStParams, err error) type CompleteSubmitPoSTCb func(err error) @@ -230,7 +233,7 @@ func (p *proveHandler) processHeadChange(ctx context.Context, newTS *types.TipSe } // Check if the chain is above the Challenge height for the post window - if newTS.Height() < di.Challenge { + if newTS.Height() < di.Challenge+ChallengeConfidence { return } diff --git a/storage/wdpost_changehandler_test.go b/storage/wdpost_changehandler_test.go index 6479c0d7e..bae4f40fd 100644 --- a/storage/wdpost_changehandler_test.go +++ b/storage/wdpost_changehandler_test.go @@ -395,7 +395,7 @@ func TestChangeHandlerStartProvingNextDeadline(t *testing.T) { // Trigger a head change currentEpoch := abi.ChainEpoch(1) - go triggerHeadAdvance(t, s, currentEpoch) + go triggerHeadAdvance(t, s, currentEpoch+ChallengeConfidence) // Should start proving <-s.ch.proveHdlr.processedHeadChanges @@ -405,7 +405,7 @@ func TestChangeHandlerStartProvingNextDeadline(t *testing.T) { // Trigger a head change that advances the chain beyond the submit // confidence currentEpoch = 1 + SubmitConfidence - go triggerHeadAdvance(t, s, currentEpoch) + go triggerHeadAdvance(t, s, currentEpoch+ChallengeConfidence) // Should be no change to state yet <-s.ch.proveHdlr.processedHeadChanges @@ -424,7 +424,7 @@ func TestChangeHandlerStartProvingNextDeadline(t *testing.T) { // the next deadline go func() { di = nextDeadline(di) - currentEpoch = di.Challenge + currentEpoch = di.Challenge + ChallengeConfidence triggerHeadAdvance(t, s, currentEpoch) }() @@ -446,7 +446,7 @@ func TestChangeHandlerProvingRounds(t *testing.T) { for currentEpoch := abi.ChainEpoch(1); currentEpoch < miner.WPoStChallengeWindow*5; currentEpoch++ { // Trigger a head change di := mock.getDeadline(currentEpoch) - go triggerHeadAdvance(t, s, currentEpoch) + go triggerHeadAdvance(t, s, currentEpoch+ChallengeConfidence) // Wait for prover to process head change <-s.ch.proveHdlr.processedHeadChanges @@ -913,7 +913,7 @@ func TestChangeHandlerSubmitRevertTwoEpochs(t *testing.T) { // Move to the challenge epoch for the next deadline diE2 := nextDeadline(diE1) - currentEpoch = diE2.Challenge + currentEpoch = diE2.Challenge + ChallengeConfidence go triggerHeadAdvance(t, s, currentEpoch) // Should move to submitting state for epoch 1 @@ -1014,7 +1014,7 @@ func TestChangeHandlerSubmitRevertAdvanceLess(t *testing.T) { // Move to the challenge epoch for the next deadline diE2 := nextDeadline(diE1) - currentEpoch = diE2.Challenge + currentEpoch = diE2.Challenge + ChallengeConfidence go triggerHeadAdvance(t, s, currentEpoch) // Should move to submitting state for epoch 1 diff --git a/storage/wdpost_run.go b/storage/wdpost_run.go index 2690069d4..ea4d110de 100644 --- a/storage/wdpost_run.go +++ b/storage/wdpost_run.go @@ -600,9 +600,23 @@ func (s *WindowPoStScheduler) runPost(ctx context.Context, di dline.Info, ts *ty return nil, xerrors.Errorf("received no proofs back from generate window post") } + headTs, err := s.api.ChainHead(ctx) + if err != nil { + return nil, xerrors.Errorf("getting current head: %w", err) + } + + checkRand, err := s.api.ChainGetRandomnessFromBeacon(ctx, headTs.Key(), crypto.DomainSeparationTag_WindowedPoStChallengeSeed, di.Challenge, buf.Bytes()) + if err != nil { + return nil, xerrors.Errorf("failed to get chain randomness from beacon for window post (ts=%d; deadline=%d): %w", ts.Height(), di, err) + } + + if !bytes.Equal(checkRand, rand) { + log.Warnw("windowpost randomness changed", "old", rand, "new", checkRand, "ts-height", ts.Height(), "challenge-height", di.Challenge, "tsk", ts.Key()) + } + // If we generated an incorrect proof, try again. if correct, err := s.verifier.VerifyWindowPoSt(ctx, proof.WindowPoStVerifyInfo{ - Randomness: abi.PoStRandomness(rand), + Randomness: abi.PoStRandomness(checkRand), Proofs: postOut, ChallengedSectors: sinfos, Prover: abi.ActorID(mid), diff --git a/storage/wdpost_run_test.go b/storage/wdpost_run_test.go index 80bd8d3fb..4bf30e3e9 100644 --- a/storage/wdpost_run_test.go +++ b/storage/wdpost_run_test.go @@ -350,7 +350,7 @@ func (m *mockStorageMinerAPI) GasEstimateMessageGas(ctx context.Context, message } func (m *mockStorageMinerAPI) ChainHead(ctx context.Context) (*types.TipSet, error) { - panic("implement me") + return nil, nil } func (m *mockStorageMinerAPI) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, error) {