introduce a new serialization for the generator in UnfinishedBlock - #1470
Merged
Conversation
Coverage Report for CI Build 28535161482Coverage increased (+0.1%) to 81.664%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
arvidn
force-pushed
the
unfinished-block-format
branch
2 times, most recently
from
June 30, 2026 09:22
391c428 to
d07310a
Compare
arvidn
marked this pull request as ready for review
July 1, 2026 14:23
Contributor
Author
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d07310a. Configure here.
…ust like FullBlock) where the generator is serialized as a byte blob. To parse an UnfinishedBlock, with the new format, we no longer need to deserialize CLVM
arvidn
force-pushed
the
unfinished-block-format
branch
from
July 1, 2026 17:17
d07310a to
2798fa8
Compare
AmineKhaldi
approved these changes
Jul 2, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
just like FullBlock, where the generator is serialized as a byte blob. To parse an UnfinishedBlock, with the new format, we no longer need to deserialize CLVM.
This mirrors the changes in #1456 and #1345 .
Note
Medium Risk
Changes consensus-relevant block serialization and parsing for unfinished blocks on the network; backward compatibility for version 0 is preserved, but any mismatch with FullBlock or peers on v1 encoding would be high impact.
Overview
UnfinishedBlock now mirrors FullBlock’s dual generator wire format: version 0 keeps CLVM
Programplustransactions_generator_ref_list; version 1 stores length-prefixed raw bytes intransactions_generator_bufferand omits the ref list, so peers can parse the block without deserializing CLVM. A customStreamableimplementation packs version and presence into thetransactions_generatorOption prefix byte (bit 0 = present, bit 1 = v1).FullBlock parsing now derives
versionwithprefix >> 1instead of a single-bit check, and adds tests that prefix bytes with bits 2–7 set are rejected asInvalidFullBlock. UnfinishedBlock gets the same strict prefix rules viaInvalidUnfinishedBlock(new error inchia-traits). Python stubs exposetransactions_generator_bufferandversiononUnfinishedBlock.Comment-only renames from “Optional” to “Option” appear in a few protocol files.
Reviewed by Cursor Bugbot for commit 2798fa8. Bugbot is set up for automated code reviews on this repo. Configure here.