feat(build): reproducible garbled release builds with ASLR enforcement

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

What and why

Brings public develop to parity with the garbled-release-build hardening shipped in 3.21.1.

  • GARBLE=1 builds rename the thornode and tss-lib-private identifiers so release images don't leak internal names. A check-garble gate fails install if a binary still exposes them; check-garble-keyshares verifies a garbled bifrost still decodes keyshares written by an ungarbled one.
  • A position-independent / ASLR startup check (cmd/thornode/aslr.go) refuses to start on Linux without kernel.randomize_va_space=2 (bypass with THORNODE_SKIP_ASLR_CHECK=1).
  • Name-keep guards (reflect.TypeOf) for the viper config and the TSS LocalPartySaveData, whose untagged JSON field names garble would otherwise rename; keyshare decoding is factored into LoadLocalData so the gate and keysign share one path.

Files: garble Makefile machinery + $(GARBLE_BIN)/$(GARBLE_MODFILE) rules, build/garble/sonic encoding/json shim (garble cannot build bytedance/sonic), Dockerfile + .gitlab-ci.yml + regtest wiring, tools/check-garble + tools/check-garble-keyshares, constants.WasmvmVersion, and the wasmvm-version check for builds without module build info.

Self-verification

go build -tags mainnet ./cmd/thornode ./cmd/bifrost ./tools/check-garble ./tools/check-garble-keyshares ./bifrost/tss/go-tss/keysign/ecdsa ./bifrost/tss/go-tss/keysign/eddsa   # rc=0
gofmt -l <changed .go>   # clean
make -n build   # parses for GARBLE= and GARBLE=1

go.mod/go.sum untouched.

Risk

  • Changes consensus, state or funds handling
  • Changes Bifrost observation or signing — behaviour-preserving only: keyshare decode extracted into LoadLocalData (same unmarshal + validate); no signing-logic change.
  • Docs, tests or tooling only — build/release-image hardening + a startup check.

Rollout

Build/release-image hardening. No version gate, mimir, or migration. GARBLE=1 is set by the release Dockerfile; local/dev builds default to ungarbled.

Public CI note (2026-11-07)

Restored the test-regression-garble job. The garbled thornode not booting (port 1317 never came up) was not a public-vs-private runner difference: the port dropped the private WASMVM_VERSION ldflag, so a garbled binary (no module build info) ran wasm.CheckLibwasmVersion("") and failed with wasmvm module not exist. The ldflag is now embedded, so the garbled node boots, and test-regression-garble runs the regression suites against the garbled binaries the release images ship. The garble build stays gated by check-garble and check-garble-keyshares.

@son-of-odin — tagging you as the garble author for awareness; the earlier public garble-boot failure was the missing wasmvm ldflag, now fixed and covered by test-regression-garble.

Edited by Huginn Ai

Merge request reports

Loading
Loading