Skip to content

correct transactions_generator_buffer type - #1501

Merged
arvidn merged 1 commit into
mainfrom
generator-buffer-type
Aug 4, 2026
Merged

correct transactions_generator_buffer type#1501
arvidn merged 1 commit into
mainfrom
generator-buffer-type

Conversation

@arvidn

@arvidn arvidn commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

It's a Vec<u8> right now, which technically is correct, but generate_type_stub.py specifies all Vec<> as List[]. The Bytes type is a thin wrapper around Vec<u8> meant to be translated to bytes in the python type stubs.

This corrects the type of transactions_generator_buffer to be bytes rather than List[uint8]. This was the original intention.


Note

Low Risk
Refactor of an existing field’s Rust/Python typing and serialization helpers on block types; no new protocol semantics, with roundtrip tests still in place.

Overview
transactions_generator_buffer on FullBlock and UnfinishedBlock is now Option<Bytes> instead of Option<Vec<u8>>, so Python stubs expose Optional[bytes] rather than list[uint8].

v1 Streamable digest/stream/parse paths delegate to Bytes’s Streamable impl instead of hand-rolling length-prefix + raw bytes; wire encoding should stay the same. Rust and Python tests were adjusted (e.g. .to_vec() in assertions, v1 helpers pass bytes directly).

Reviewed by Cursor Bugbot for commit de58949. Bugbot is set up for automated code reviews on this repo. Configure here.

@arvidn

arvidn commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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 de58949. Configure here.

@arvidn
arvidn requested a review from AmineKhaldi August 4, 2026 14:13
@coveralls-official

Copy link
Copy Markdown

Coverage Report for CI Build 30916605576

Coverage increased (+0.02%) to 81.924%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: 2 uncovered changes across 2 files (22 of 24 lines covered, 91.67%).
  • 3 coverage regressions across 1 file.

Uncovered Changes

File Changed Covered %
crates/chia-protocol/src/fullblock.rs 12 11 91.67%
crates/chia-protocol/src/unfinished_block.rs 12 11 91.67%

Coverage Regressions

3 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
crates/chia-protocol/src/bytes.rs 3 90.99%

Coverage Stats

Coverage Status
Relevant Lines: 20032
Covered Lines: 16411
Line Coverage: 81.92%
Coverage Strength: 11586080.48 hits per line

💛 - Coveralls

@arvidn
arvidn merged commit 0d3166e into main Aug 4, 2026
84 checks passed
@arvidn
arvidn deleted the generator-buffer-type branch August 4, 2026 15:02
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