miner: fix off-by-ones in BlockAssembler::TestPackage #18940

pull theStack wants to merge 1 commits into bitcoin:master from theStack:20200511-miner-fix-off-by-one-in-test-package changing 1 files +2 −2
  1. theStack commented at 0:36 am on May 11, 2020: member
    For both the block weight and the block sigops the test function considered reaching the exact maximum values already to be too high, i.e. the test was too conservative by one unit each.
  2. miner: fix off-by-ones in BlockAssembler::TestPackage
    For both the block weight and the block sigops the test function considered
    reaching the exact maximum values already to be too high, i.e. the test was too
    conservative by one unit each.
    e4b689c4a8
  3. fanquake added the label Mining on May 11, 2020
  4. MarcoFalke commented at 1:01 am on May 11, 2020: member
    Haven’t looked at the code, but 4000 weight units are left out either way, so 1 more or less shouldn’t matter that much.
  5. theStack commented at 3:01 am on May 11, 2020: member

    Haven’t looked at the code, but 4000 weight units are left out either way, so 1 more or less shouldn’t matter that much.

    Oh, I thought the maximum reduced by 4000 WU was just the default block weight maximum setting (DEFAULT_BLOCK_MAX_WEIGHT) and could still be maxed out to the allowed 4000000 manually via -blockmaxweight, but it seems you are right, the reduced limit is always enforced: https://github.com/bitcoin/bitcoin/blob/88d8b4e182bfc75e8496f7046af7aab93307b9d0/src/miner.cpp#L63-L64

    Is this really a good idea to effectively decrease profit of miners using Bitcoin Core? (Even if its just a tiny amount and right now basically never happens?)

    As for this PR: Yes, I agree that 1 WU (and 1 SigOp cost) is totally neglectible, I more opened it for idealistic reasons, as I think the behaviour was not intended by the author and could readers lead to the conclusion that the maximum values are meant to be exclusive.

  6. theStack commented at 9:20 pm on August 11, 2020: member
    Closing, as the PR didn’t catch any interest and the change admittedly has more theoretical/academical than practical reasons.
  7. theStack closed this on Aug 11, 2020

  8. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me