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

Đang mở
#752 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend, security

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
148
Fork
49
Merge trung bình
4 ngày 5 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Blockstream/greenlight

Tất cả issue của Blockstream/greenlight

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.