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

未关闭
#752 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 小时
30 天内合并 PR
9

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Blockstream/greenlight 的其他 Issue

查看 Blockstream/greenlight 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。