Hardening suggestion: answer hsmd requests that the signer rejects every time

オープン
#752 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
backend, security

調査の方向性

Start by reading gl-plugin/src/node/mod.rs around respond_hsm_request, then trace the waiting request in gl-plugin/src/hsm.rs and replay behavior in stager.rs. The issue suggests returning an hsmd error for deterministic signer rejection or adding a bounded wait; determine which behavior fits the existing request flow. Done means rejected requests no longer block the serial hsmd client, with recovery behavior preserved.

索引モデルが issue の本文から書いたものです。

説明

Follow-up to #739 / #740 (by @ScuttoZ). Thanks for the signmessage guard. It already handles the case we hit.

While integrating Greenlight with Alby Hub (https://gist.github.com/welliv/cf1f9b22a3b9047e5a31f6dc4cc2de24) we read the signer path at main @ 15b22cf0. This is a small, non-urgent suggestion.

Observation

  • gl-plugin/src/node/mod.rs respond_hsm_request (~L606-655) returns without stage.respond() in three cases: a signer error, a state-merge error, or a state-store write error.
  • gl-plugin/src/hsm.rs:96 (chan.recv().await) waits with no timeout, and lightningd's hsmd client is serial.
  • Your design already limits the impact. Unanswered requests are replayed to every new signer connection (stager.rs), so transient failures recover.
  • Only a request the signer rejects every time can block that hsmd client until the node restarts. node/wrapper.rs:550-556 describes the same mechanism for signmessage.

Suggestion

  • For a deterministic signer rejection, answer the waiting request with an hsmd error (or fail the originating RPC) instead of leaving it queued.
  • Or add a bounded wait in hsm.rs. stuck_request_types() could drive an alert.

Small extras (happy to split out)

  • glcli prints new mnemonics to stdout (gl-cli/src/node.rs:276, scheduler.rs:100).
  • glcli writes the seed, credentials and convert-backup output with File::create (0644 under a typical umask). Suggest 0600.
  • glcli exits 0 on RPC failures, so wrappers have to parse the output.

Happy to send a PR for any of these if you'd like one.

主要言語
Rust
スター
148
フォーク
49
平均マージ
4日 5時間
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Blockstream/greenlight のほかの issue

Blockstream/greenlight の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。