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

fix(miner): ignore lastWork when selecting the best mining candidate #12690

Merged
merged 3 commits into from
Nov 12, 2024

Commits on Nov 12, 2024

  1. 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]>
    Stebalien authored and Kubuxu committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    123daab View commit details
    Browse the repository at this point in the history
  2. fix(miner): continue mining if we fail to submit a block

    Signed-off-by: Jakub Sztandera <[email protected]>
    Stebalien authored and Kubuxu committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    d2e66a2 View commit details
    Browse the repository at this point in the history
  3. 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]>
    Stebalien authored and Kubuxu committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    f4fb84b View commit details
    Browse the repository at this point in the history