Skip to content

bugfix: compare non-adjusted chunk weight against block weight limit (PR #35580) - Follow-up 2 of 2 #537

Description

@kevkevinpal

mentioned in: bitcoin#35580

bitcoin#35580 (review)

"Approach ACK

A chunk whose sigop-adjusted weight exceeds the actual weight can be wrongly skipped even though the block sigop limit is enforced independently on the next line, and that could pass. Those chunks pay higher fees, so this could potentially cause miners to needlessly forfeit some fees revenue.

It seems that the sigop-adjusted weight was designed purely for ordering (fee-rate priority), not for limit checking. Block validity depends on real weight and real sigops
— two separate physical constraints. The fix checks each with the right metric:

  • Weight limit → real weight ✓
  • Sigops limit → real sigop count ✓

These were already independent checks, the bug was just feeding the wrong number into the first one.


Tested indirectly through CreateNewBlock, building a transaction that demonstrates the bug (excluded before fix, included after).

Issue 1 from bitcoin#35596 (>=> in TestChunkBlockLimits) seems like a natural follow-up — same function, similar pattern for the test." - pablomartin4btc

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    followupThis is a possible follow-up someone can work onneed to confirmNeed to confirm if this is still needed or already done

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions