bifrost/p2p: move TSS round constants to a leaf package so x/thorchain/memo builds without tss-lib-private

🔎 Visual review of 823c3434: explainer, review flags and prompts to ask an AI about the change

Why

x/thorchain/types imports bifrost/p2p/messages only for the TSS round-name constants in tss_round_normalizer.go. messages also imports tss-lib-private (for WireMessage.Routing), so every package above types, including x/thorchain/memo, transitively depends on a module that is not public.

That blocks outside fuzzing and verification tools from building the memo parser. The trigger is enrolling THORNode in OSS Verify (Theorem's formal verification of fuzz targets, as described in Anthropic's formal verification post). OSS Verify clones the repo and fetches modules anonymously, and tss-lib-private returns 404 to anonymous requests. FuzzParseMemo is the most valuable target and can't be built today.

What

  • Move bifrost/p2p/messages/TssPhaseMessages.go unchanged into a new leaf package, bifrost/p2p/tssrounds, which imports nothing. The const block is kept as it is, so the iota values of Algo don't move.
  • messages keeps type and const aliases and the same ValidTssKeysignRounds map, so no Bifrost call site changes.
  • x/thorchain/types (normalizer and two tests) imports tssrounds instead of messages.
  • The FROST-evidence test stays in messages, because FrostBlameRound* lives there.
  • New x/thorchain/memo/memo_deps_test.go fails if tss-lib comes back into the memo parser's imports.

Risk: low

There's no behavior change: the constant values and the map contents are identical. x/thorchain/types is consensus code, but only the import path changes. There are no state, proto, gas or event changes, so no migration or regression fixtures are involved.

Verification

  • go list -deps ./x/thorchain/memo ./x/thorchain/types | grep tss-lib-private returns nothing (it found 2 on develop).
  • memo_deps_test.go passes on this branch and fails on develop.
  • make lint is clean. go vet -tags=mocknet ./... reports no compile errors.
  • go test -tags=mocknet passes for ./bifrost/p2p/..., ./bifrost/tss/..., ./x/thorchain/types/..., ./x/thorchain/memo/... and ./x/thorchain.
  • The memo parser fuzz target, built from this commit inside OSS Verify's Go toolchain image (Go 1.27.1, static riscv64, -trimpath, empty module cache, no credentials), builds and exits 0 on all 40 seed memos under qemu-riscv64.

🤖 Generated with Claude Code

Edited by Huginn Ai

Merge request reports

Loading
Loading