Skip to content

feat: add DIG_MESSAGE opcode const (220) for directed dig-message envelopes#3

Merged
MichaelTaylor3d merged 1 commit into
mainfrom
feat/dig-message-opcode-const
Jul 19, 2026
Merged

feat: add DIG_MESSAGE opcode const (220) for directed dig-message envelopes#3
MichaelTaylor3d merged 1 commit into
mainfrom
feat/dig-message-opcode-const

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

Task

Additive canonical opcode const pub const DIG_MESSAGE: u8 = 220 for the directed dig-message envelope. Part of WU6 (epic #796) — the release-first sub-step exposing the canonical opcode to the dig-message adoption consumers.

What changed

  • DIG_MESSAGE = 220 — first opcode of the free 220..=255 band (the 200..=219 consensus band, DigMessageType, is untouched — §5.1 additive, no renumber).
  • Doc: the envelope rides as OPAQUE bytes in DigMessage.data; the transport never seals/opens it (end-to-end sealing is dig-message's job, §5.4).
  • 2 tests: opcode frames a real DigMessage + round-trips with msg_type intact; 220 is not a consensus DigMessageType.

Blast radius

Purely additive public API — no existing symbol touched. Consumers reference dig_protocol::DIG_MESSAGE (dig-gossip mirrors it as ProtocolMessageTypes::DigMessage + dig_gossip::DIG_MESSAGE; dig-relay-protocol #874, dig-ipc-protocol #1074, ...).

Version

MINOR bump 0.1.2 → 0.2.0 (new public API).

Refs #1164 #796

🤖 Generated with Claude Code

…elopes

Additive public const `DIG_MESSAGE: u8 = 220` — the canonical wire opcode for a
directed dig-message envelope (first of the free 220-255 band; 200-219 stay the
consensus band, DigMessageType). The envelope rides as OPAQUE bytes in
DigMessage.data; the transport never seals/opens it (WU6 of epic #796, Wave A).

Release-first: this exposes the canonical const to the Wave-A/B dig-message
consumers (dig-gossip mirrors it as ProtocolMessageTypes::DigMessage +
dig_gossip::DIG_MESSAGE; dig-relay-protocol #874, dig-ipc-protocol #1074, ...).

MINOR bump 0.1.2 -> 0.2.0.

Refs #1164 #796
Co-Authored-By: Claude <noreply@anthropic.com>

@MichaelTaylor3d MichaelTaylor3d left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PASS (loop-reviewer, fresh context).

Verified against the WU6/#1164 acceptance criteria:

  • Additive-onlypub const DIG_MESSAGE: u8 = 220 is the first opcode of the free 220..=255 band; the 200..=219 consensus band (DigMessageType, RegisterPeer=218/RegisterAck=219) is untouched. No renumber/repurpose of any existing type (§5.1 satisfied). Doc-comment is intent-revealing and states the OPAQUE-envelope + e2e-sealing-is-dig-message's-job contract (§5.4).
  • Testsdig_message_opcode_frames_and_round_trips exercises 220 through the real encoder with msg_type intact; dig_message_opcode_is_not_a_consensus_type proves 220 is not a DigMessageType discriminant (bands can't collide). Coverage gate green.
  • Version — 0.1.2 → 0.2.0 MINOR is correct for a new public API (§2.4).
  • Gates — fmt/clippy/test/docs/coverage/commitlint/version-increment all green; CodeQL clean.
  • dig-constants check — protocol opcodes are canonically homed in dig-protocol (not dig-constants, which holds asset-ids/addresses/ports); this crate IS the canonical home #874/#1074 consumers reference. Correct placement.

Trivial + correct. No findings. Merge-order note: land this then publish, or land dig-gossip#7 first (it is self-contained) — either is safe.

(Recorded as --comment, not --approve: self-authored PR, 422 on self-approval; branch protection gates on green checks + zero unresolved threads, both satisfied.)

@MichaelTaylor3d
MichaelTaylor3d merged commit d57fdcc into main Jul 19, 2026
8 checks passed
@MichaelTaylor3d
MichaelTaylor3d deleted the feat/dig-message-opcode-const branch July 19, 2026 06:44
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.

1 participant