Skip to content

qkc/slave 05: add MasterConn protocol layer - #37

Open
iteyelmp wants to merge 100 commits into
goshard/basefrom
slave-05
Open

qkc/slave 05: add MasterConn protocol layer#37
iteyelmp wants to merge 100 commits into
goshard/basefrom
slave-05

Conversation

@iteyelmp

@iteyelmp iteyelmp commented Jul 13, 2026

Copy link
Copy Markdown

Add MasterConn: the slave-side master↔slave connection layer

Introduces MasterConn, the slave-side TCP connection to the cluster master, built on the existing BaseConn.

This PR establishes protocol compatibility, opcode registration, request dispatch, and handler delegation. Cluster business logic remains out of scope.

Scope

  • 12-byte ClusterMetadata framing over TCP.
  • Master↔Slave opcode / serializer / handler registration, including DESTROY_CLUSTER_PEER_CONNECTION_COMMAND.
  • Outbound RPC helpers:
    • SendAddMinorBlockHeader
    • SendAddMinorBlockHeaderList
  • Handler delegation through:
    • CommHandler (communication and topology orchestration);
    • MasterHandler (business RPC handling).

Not in Scope

  • Cluster business logic (shards, miner, chain state).
  • PeerConn and peer-to-peer communication infrastructure.
  • Dispatcher and routing components.

Reviewer Notes

Handler boundary

ADD_ROOT_BLOCK intentionally goes through CommHandler rather than MasterHandler because applying the root block may activate new shards. This keeps the complete operation behind the same orchestration boundary as shard activation.

The two shard-activation triggers are PING(root_tip) and ADD_ROOT_BLOCK(root_block).

CREATE / DESTROY semantics

CREATE is a normal request/response RPC.

DESTROY is the sole non-RPC opcode.

Its serializer carries a placeholder ResponseOpCode = 0 only because the generic serializer registration requires one. The value is ignored for non-RPC opcodes and never appears on the wire.

Full Codex 5.6 review completed.

@iteyelmp
iteyelmp changed the base branch from goshard/base to slave-04 July 16, 2026 09:47
@iteyelmp
iteyelmp changed the base branch from slave-04 to slave-04-1 August 28, 2026 03:55
@iteyelmp
iteyelmp changed the base branch from slave-04-1 to goshard/base September 4, 2026 02:31
Comment thread qkc/cluster/slave/master_conn.go Outdated
Comment thread qkc/cluster/slave/master_conn.go Outdated
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