Skip to content

types: nest the block header and body in JSON - #21

Merged
mplatt8 merged 2 commits into
LayerTwo-Labs:masterfrom
octobocto:sep-19-truthcoin-nested-block-up
Sep 21, 2026
Merged

mplatt8 merged 2 commits into
LayerTwo-Labs:masterfrom
octobocto:sep-19-truthcoin-nested-block-up

Conversation

@octobocto

Copy link
Copy Markdown

The BMM engine in BitWindow reads block.header.prev_main_hash from get_block_template. Truthcoin sends a flat block, so the engine reads an empty hash and refuses every bid with "sidechain builds on , not the current tip". Thunder, bitnames, bitassets and coinshift nest the header and the body, so only truthcoin fails, on every network.

Block carries #[serde(flatten)] on header and body, so the JSON of get_block_template, get_block and connect_block has no header or body key. P2P sends the header and the body apart, and the archive keeps them in separate tables, so the serde attributes reach only the JSON RPCs.

This PR removes the two flatten attributes, and sets the version to 0.18.0, because #17 and #18 changed the network magic and the signatures after v0.17.0. It does not change consensus or the P2P messages.

@mplatt8
mplatt8 merged commit 63ea2c9 into LayerTwo-Labs:master Sep 21, 2026
8 checks passed
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