-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(miner): ignore lastWork when selecting the best mining candidate (#…
…12690) * fix(miner): ignore lastWork when selecting the best mining candidate Previously, we only took the new head if it's heavier than the last head. Unfortunately, this meant that F3 finalization wasn't properly propagated to the miner. In terms of impact: 1. It seems likely that this check was simply defensive as, prior to F3, the new head should never have a lower weight (unless you're talking to multiple lotus nodes, I guess...). 2. The `lastWork` field is mostly used to track null blocks. Worst-case scenario, if we switch heads, we'll attempt to re-mine previous heights. However, that should be relatively fast and, due to the slash filter, we won't attempt to re-broadcast any of those blocks. Signed-off-by: Jakub Sztandera <[email protected]> * fix(miner): continue mining if we fail to submit a block Signed-off-by: Jakub Sztandera <[email protected]> * fix(miner): check the slash filter with the correct parent height We also perform this check inside `SyncSubmitBlock` so we did have an effective filter, but this was still wrong. Signed-off-by: Jakub Sztandera <[email protected]> --------- Signed-off-by: Jakub Sztandera <[email protected]> Co-authored-by: Steven Allen <[email protected]>
- Loading branch information
Showing
2 changed files
with
33 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters