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

Abierto
#752 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
backend, security

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
148
Forks
49
Merge medio
4 d 5 h
PR fusionados (30 d)
9

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Blockstream/greenlight

Todos los issues de Blockstream/greenlight

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.