Skip to content

fix: get_block_template can assemble over-weight blocks (M6 suffix not weight-budgeted)#64

Closed
giaki3003 wants to merge 1 commit into
LayerTwo-Labs:masterfrom
giaki3003:fix/s3-r10-get-block-template-can-assemble-over-weight-bloc
Closed

fix: get_block_template can assemble over-weight blocks (M6 suffix not weight-budgeted)#64
giaki3003 wants to merge 1 commit into
LayerTwo-Labs:masterfrom
giaki3003:fix/s3-r10-get-block-template-can-assemble-over-weight-bloc

Conversation

@giaki3003

Copy link
Copy Markdown

Summary

Reserve the block-template suffix (M6) weight in the mempool tx weight budget so get_block_template cannot assemble over-weight blocks

The bug

get_block_template can assemble over-weight blocks (M6 suffix not weight-budgeted)

Severity: Medium. Full technical write-up (access-controlled):

Notes

First of a short series of fixes for this repo from a security review; the remaining fixes stack on this branch and will follow as separate PRs. Happy to adjust scope or split further on request.

@giaki3003
giaki3003 force-pushed the fix/s3-r10-get-block-template-can-assemble-over-weight-bloc branch from 9a89895 to 319188a Compare July 4, 2026 17:03
…t weight-budgeted)

Bug: s3-r10 (primary)
Finding:
Severity: Medium

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 319188a)
@giaki3003
giaki3003 force-pushed the fix/s3-r10-get-block-template-can-assemble-over-weight-bloc branch from 319188a to 24389cf Compare July 7, 2026 12:23

@Ash-L2L Ash-L2L left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to modify cusf_block_producer::InitialBlockTemplate / cusf_block_producer::BlockTemplateSuffix / cusf_block_producer::CusfBlockProducer
such that CusfBlockProducer::initial_block_template can add some suffix txs to a block template, or reserve space for them to be added in CusfBlockProducer::block_template_suffix.

I will open a separate PR for this.

For bip300301_enforcer, the M6 suffix txs are available before filling the block template with mempool txs, so they could be included in CusfBlockProducer::initial_block_template.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants