Skip to content

refactor(privval)!: remove the socket and gRPC remote signer - #1647

Merged
lklimek merged 3 commits into
devfrom
refactor/remove-remote-signer
Nov 28, 2026
Merged

lklimek merged 3 commits into
devfrom
refactor/remove-remote-signer

Conversation

@Claudius-Maginificent

@Claudius-Maginificent Claudius-Maginificent commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR: Tenderdash now signs only with a local key file or through Dash Core. The generic remote signer (socket and gRPC) is removed, and a config that still selects it stops the node with a clear message.

User story

As a Dash node operator, I want Tenderdash to offer only the signing options Dash uses, so its configuration has no unused paths to misconfigure.

Scenario

Base flow

  1. An operator configures how the validator signs: a key file, Dash Core (what dashmate sets up), or a separate remote signer process.
  2. The node starts and signs blocks.

Actual behavior

Tenderdash still carries a third, generic remote-signer option with its own network protocols, settings, a separate server program and certificates. No Dash deployment uses it: dashmate always leaves it empty and signs through Dash Core.

Expected behavior

The remote-signer option is gone. A node configured with a key file or Dash Core works exactly as before. A node whose configuration still names a remote signer address does not start, and tells the operator to use Dash Core or the key file.

Detailed discussion

What was done

  • Removed:
    • the privval socket protocol: signer client/server, dialer and listener endpoints, socket dialers/listeners, the privval copy of the secret connection, the retry client and the protocol messages;
    • privval/grpc, cmd/priv_val_server and the proto/tendermint/privval package (PrivValidatorAPI);
    • the unused Dash Core mock signer stub.
  • Config: PrivValidatorConfig loses laddr, the TLS file keys and their helpers; the toml template block and the --priv-validator-laddr flag are dropped.
    • A non-empty [priv-validator] laddr now fails ValidateBasic. The same check runs in node.New and newDefaultNode, and TM_PRIV_VALIDATOR_LADDR is bound explicitly so an environment override is rejected too.
    • The error reads: "the socket and gRPC remote signer has been removed; use core-rpc-host or the file PV".
    • The old TLS keys are ignored.
  • CLI: show-validator loses its gRPC branch.
  • e2e: only the file and dashcore privval protocols remain. networks/ci.toml moves its tcp/grpc nodes to dashcore, and the entrypoints stop cleaning a privval socket. CI's e2e networks (dashcore.toml, rotate.toml) already used dashcore.
  • Docs/spec: docs/nodes/remote-signer.md is removed and references are updated (configuration, validators, node docs, proposer-liveness and alternative-flows spec).
  • Unchanged: the file PV, the Dash Core signer client and internal/p2p/conn (P2P's own secret connection).
  • Dependencies: go-grpc-middleware and go-grpc-prometheus become unused and are dropped.

Out of scope: any change to the Dash Core signer or the file PV.

Known limitations: none.

Testing

  • New: TestParseConfigRemovedRemoteSigner (empty, tcp, unix and grpc addresses in config.toml) and TestParseConfigRemovedRemoteSignerFromEnv (TM_PRIV_VALIDATOR_LADDR; it failed before the explicit env binding). Config and node tests cover the template and the startup rejection.
  • go test -race -count=1 passes for ./privval/... ./config/ ./node/ ./cmd/tenderdash/... ./test/e2e/pkg/... ./test/e2e/generator/....
  • go build passes for all packages. cmd/abcidump was excluded locally because it needs libpcap.
  • go vet passes on the changed packages, and make lint (base origin/dev) reports only the local libpcap typecheck.
  • make proto-lint passes. make proto-check-breaking reports the intended removal of tendermint.privval.
  • An independent review found only low-severity items, all fixed here.

Breaking changes

  • [priv-validator] laddr (and TM_PRIV_VALIDATOR_LADDR) must be empty. A non-empty value fails config validation and node startup. Use core-rpc-host (Dash Core) or the file PV.
  • The --priv-validator-laddr flag, cmd/priv_val_server, the privval/grpc Go package, the socket signer types in privval and the tendermint.privval protobuf package with its PrivValidatorAPI gRPC service are removed.

Prior work

None found.

Attribution

🤖 Co-authored by Claudius the Magnificent AI Agent

🤖 Generated with Claude Code

PR Hygiene · a19cce0

  • Bots — thepastaclaw ✓
  • Self-review — not asked of a bot author
  • Build green
  • Approvals
    • files with no dedicated owner (Makefile, book/SUMMARY.md, cmd/priv_val_server/main.go and 66 more) — approved by lklimek

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

lklimek and others added 3 commits November 26, 2026 10:32
Tenderdash now supports two private-validator backends: the file PV and
the Dash Core signer. No Dash deployment uses the generic remote signer:
dashmate renders an empty priv-validator.laddr and signs through
core-rpc-host.

Removed: the privval socket protocol (signer client/server, dialer and
listener endpoints, socket dialers/listeners, the privval copy of the
secret connection, the retry client, protocol messages), privval/grpc,
cmd/priv_val_server, the proto/tendermint/privval package, the
priv-validator laddr/TLS configuration and the --priv-validator-laddr
flag, the gRPC branch of show-validator, the tcp/unix/grpc e2e privval
modes and the remote signer documentation. P2P keeps its own secret
connection in internal/p2p/conn.

BREAKING CHANGE: a non-empty [priv-validator] laddr now fails
configuration validation and node startup with an error pointing to
core-rpc-host or the file PV. The client-certificate-file, client-key-file
and root-ca-file keys are ignored. The tendermint.privval protobuf
package and its PrivValidatorAPI gRPC service are removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… environment

TM_PRIV_VALIDATOR_LADDR was silently ignored once laddr left the config
template, because viper only reads environment overrides for known keys.
Bind it explicitly so ValidateBasic rejects it like a config.toml value.

Also drop the unused Dash Core mock signer stub tied to the removed dialer
endpoint, the stale privval.sock cleanup in the e2e entrypoints, and the
signerEndpoint wording in RemoteSignerError.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
It has no callers and was built on the removed dialer endpoint; the e2e
Dash Core mock lives in test/e2e/pkg/mockcoreserver.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@lklimek lklimek added this to the v3.0 milestone Nov 26, 2026
@thepastaclaw

thepastaclaw commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Final review complete — no blockers (commit a19cce0) · triage: critical

@lklimek
lklimek marked this pull request as ready for review November 28, 2026 08:09
@github-actions

Copy link
Copy Markdown

Ready for review — files with no dedicated owner: lklimek or shumkov.
Full checklist in the description.

@github-actions github-actions Bot added ready-for-human PR Hygiene: bots done, author self-reviewed, awaiting human review bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. labels Nov 28, 2026
@github-actions
github-actions Bot requested review from lklimek and shumkov November 28, 2026 08:10

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Final validation — Phase 1 + Phase 2

The PR removes the socket and gRPC remote signer, updates configuration and runtime selection, and adjusts the related e2e and documentation paths. All build, test, lint, proto, and vulnerability checks are successful; the review and PR Hygiene checks remain pending.

🟡 3 suggestion(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

2 finding(s) not shown inline (the lines are not part of this PR's diff)

🟡 Suggestion: Generated full nodes using the file protocol fail startup without Dash Core RPC
Impact: A randomly generated full node that selects the file protocol receives no core-rpc-host and exits during startup before it can participate in the e2e network.
test/e2e/runner/setup.go:256-258

The generator assigns PrivvalProtocol to every node, including full nodes, and can choose file at test/e2e/generator/generate.go:313. MakeConfig sets CoreRPCHost only for dashcore, while node.makeNode rejects every full node whose host is empty because full-node light-client verification requires Dash Core. Set the host for full nodes independently of their signing protocol, or constrain generated full nodes to dashcore.

if node.Mode == e2e.ModeFull || node.PrivvalProtocol == e2e.ProtocolDashCore {
	cfg.PrivValidator.CoreRPCHost = "127.0.0.1:19998"
}

source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: general)

🟡 Suggestion: The service-lifecycle audit still lists deleted signer services
Impact: Developers consulting the lifecycle audit are told that SignerServer and signer listener/dialer endpoints still exist, despite those components being removed by this PR.
docs/architecture/service-lifecycle.md:68

The cancellation compatibility table retains a row for SignerServer and signer listener/dialer endpoints, but the corresponding implementations and generic signer protocol were deleted. Remove this row or replace it with the lifecycle behavior of the remaining file-PV and Dash Core signer components.

source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: general)

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.2-sol (effort low) — This is a large, cross-cutting removal that directly changes validator signing and key-handling behavior across privval, node startup, configuration, CLI, and wire/protocol definitions.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `cmd/tenderdash/commands/show_validator.go`:
- [SUGGESTION] cmd/tenderdash/commands/show_validator.go:41-46: `show-validator` always prints `null` instead of the validator key
  Impact: Any operator running `show-validator` with a valid file-based validator gets `null` with exit status 0 instead of the BLS public key.
  The command validates the ProTxHash but never assigns `pubKey`; `jsontypes.Marshal` explicitly returns JSON `null` for a nil value without an error. After obtaining the first quorum hash, retrieve the corresponding public key and fail when no quorum key is available.

In `test/e2e/runner/setup.go`:
- [SUGGESTION] test/e2e/runner/setup.go:256-258: Generated full nodes using the file protocol fail startup without Dash Core RPC
  Impact: A randomly generated full node that selects the file protocol receives no `core-rpc-host` and exits during startup before it can participate in the e2e network.
  The generator assigns `PrivvalProtocol` to every node, including full nodes, and can choose `file` at `test/e2e/generator/generate.go:313`. `MakeConfig` sets `CoreRPCHost` only for `dashcore`, while `node.makeNode` rejects every full node whose host is empty because full-node light-client verification requires Dash Core. Set the host for full nodes independently of their signing protocol, or constrain generated full nodes to `dashcore`.

In `docs/architecture/service-lifecycle.md`:
- [SUGGESTION] docs/architecture/service-lifecycle.md:68: The service-lifecycle audit still lists deleted signer services
  Impact: Developers consulting the lifecycle audit are told that `SignerServer` and signer listener/dialer endpoints still exist, despite those components being removed by this PR.
  The cancellation compatibility table retains a row for `SignerServer` and signer listener/dialer endpoints, but the corresponding implementations and generic signer protocol were deleted. Remove this row or replace it with the lifecycle behavior of the remaining file-PV and Dash Core signer components.

Comment on lines +41 to 46
_, err = pv.GetProTxHash(ctx)
if err != nil {
return fmt.Errorf("can't get proTxHash: %w", err)
}

bz, err := jsontypes.Marshal(pubKey)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Suggestion: show-validator always prints null instead of the validator key
Impact: Any operator running show-validator with a valid file-based validator gets null with exit status 0 instead of the BLS public key.

The command validates the ProTxHash but never assigns pubKey; jsontypes.Marshal explicitly returns JSON null for a nil value without an error. After obtaining the first quorum hash, retrieve the corresponding public key and fail when no quorum key is available.

Suggested change
_, err = pv.GetProTxHash(ctx)
if err != nil {
return fmt.Errorf("can't get proTxHash: %w", err)
}
bz, err := jsontypes.Marshal(pubKey)
quorumHash, err := pv.GetFirstQuorumHash(ctx)
if err != nil {
return fmt.Errorf("can't get quorum hash: %w", err)
}
if quorumHash == nil {
return fmt.Errorf("can't get pubkey: no quorum hash available")
}
pubKey, err = pv.GetPubKey(ctx, quorumHash)
if err != nil {
return fmt.Errorf("can't get pubkey: %w", err)
}

source: muse-spark-1.3-contributor (phase1-reviewer: general)

@github-actions github-actions Bot removed the bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. label Nov 28, 2026
@lklimek
lklimek enabled auto-merge (squash) November 28, 2026 11:45
@github-actions

Copy link
Copy Markdown

Policy satisfied — this can merge.
Full checklist in the description.

@github-actions github-actions Bot removed the ready-for-human PR Hygiene: bots done, author self-reviewed, awaiting human review label Nov 28, 2026
@lklimek
lklimek merged commit d6b9e66 into dev Nov 28, 2026
33 checks passed
@lklimek
lklimek deleted the refactor/remove-remote-signer branch November 28, 2026 11:49
@github-actions github-actions Bot modified the milestones: v3.0, v2.1 Nov 28, 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.

3 participants