Skip to content

qkc/types: add root and minor blocks - #36

Merged
ping-ke merged 17 commits into
goshard/basefrom
qkc-3-types-05-blocks
Aug 31, 2026
Merged

qkc/types: add root and minor blocks#36
ping-ke merged 17 commits into
goshard/basefrom
qkc-3-types-05-blocks

Conversation

@blockchaindevsh

@blockchaindevsh blockchaindevsh commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Add QuarkChain-compatible root block and minor block types for the shard-side implementation.

Changes

  • Add QuarkChain minor block, minor block header, and minor block metadata types and related functions.
  • Add tests covering minor block serialization, hashing, metadata, and round trips.
  • Add QuarkChain root block and root block header types and related functions.
  • Add tests covering root block serialization, hashing, minor-header commitments, and round trips.
  • Update genesis, shard, and raw database code to use the new block types.

Notes

Root blocks are represented for wire compatibility, hashing, ancestry, total-difficulty lookup, and minor-header processing. Root-chain construction and mining remain outside the shard implementation.

Testing

go test ./qkc/...
git diff --check

Comment thread qkc/types/rootblock.go Outdated
Comment thread qkc/types/rootblock.go Outdated
Comment thread qkc/types/minorblock_test.go Outdated
Comment thread qkc/types/interface.go Outdated
Comment thread qkc/types/minorblock.go Outdated
@ping-ke
ping-ke changed the base branch from qkc-3-types-04-transactions to goshard/base August 4, 2026 03:27
@ping-ke
ping-ke changed the base branch from goshard/base to qkc-transactions-core-types August 4, 2026 06:23
@ping-ke
ping-ke changed the base branch from qkc-transactions-core-types to goshard/base August 4, 2026 06:24
@ping-ke
ping-ke force-pushed the qkc-3-types-05-blocks branch from 4254c83 to 8902ca5 Compare August 4, 2026 06:35
@ping-ke
ping-ke requested review from iteyelmp and ping-ke August 4, 2026 08:23
@ping-ke
ping-ke requested a review from qzhodl August 19, 2026 07:43
@qzhodl

qzhodl commented Aug 19, 2026

Copy link
Copy Markdown

The PR description does not change yet

@ping-ke

ping-ke commented Aug 19, 2026

Copy link
Copy Markdown

The PR description does not change yet

Updated

Comment thread qkc/types/minorblock.go Outdated
Comment thread qkc/types/interface.go
Comment thread qkc/types/minorblock.go Outdated
Comment thread qkc/types/minorblock.go Outdated
Comment thread qkc/types/rootblock.go
Comment thread qkc/types/minorblock.go Outdated
@ping-ke
ping-ke requested review from qzhodl and syntrust August 27, 2026 10:04
Comment thread qkc/types/rootblock.go Outdated
Comment thread qkc/types/minorblock.go Outdated
Comment thread qkc/types/minorblock.go
Comment thread qkc/types/minorblock.go
Comment thread qkc/types/rootblock.go Outdated
Comment thread qkc/types/minorblock.go Outdated
@qzhodl

qzhodl commented Aug 28, 2026

Copy link
Copy Markdown

I re-checked the latest revision. Most of the previous review findings have been addressed, but these two issues are still outstanding:

  1. NewMinorBlock still accepts fewer receipts than transactions, for example one transaction with zero receipts, allowing a non-empty transaction root to be paired with the empty receipt root. The original discussion is here:
    qkc/types: add root and minor blocks #36 (comment)

  2. The default minor-block meta still leaves XShardTxCursorInfo nil and sets the x-shard gas limit to 12,000,000 instead of pyquarkchain's 6,000,000 default. The nil cursor serializes as a zero-valued cursor, so this is primarily an in-memory/default-value consistency issue rather than a wire-format incompatibility. The original discussion is here:
    qkc/types: add root and minor blocks #36 (comment)

Could we resolve these two remaining points before merging?

Comment thread qkc/types/minorblock.go Outdated
@ping-ke
ping-ke requested a review from syntrust August 29, 2026 04:31
@ping-ke
ping-ke merged commit 14df4cd into goshard/base Aug 31, 2026
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.

5 participants