Refuse a node that advertises an unknown protocol_version
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 74/100
Línea de trabajo
Start in resolve_transport in src/cli.rs, at the match arm that logs the unknown protocol_version and falls back to gift wrap. Then read fetch_protocol_version_with to see where a missing tag and an unparseable tag both become None. Done when an unknown version returns a clear error unless --transport was passed, a "1" maps to gift wrap, a "2" maps to NIP-44 direct, and an unparseable tag is treated as unknown rather than v1, with tests for each case.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
resolve_transport (src/cli.rs) falls back to gift wrap when the node advertises a protocol_version the CLI does not know:
Some(other) => {
log::warn!("Node advertised unknown protocol_version={other}; defaulting to gift-wrap")
}
Protocols v1 and v2 are incompatible, and a node gives no error for a message in the wrong format. A node that advertises a future "3" would receive gift wraps it never reads, and the command would just time out.
Expected
The client rule is now in the protocol docs (MostroP2P/protocol#70, "Future protocol versions") and the daemon spec (MostroP2P/mostro#1003, §8):
- Unknown
protocol_version→ fail with a clear error ("this node speaks protocol vN, which this mostro-cli version does not support"), unless the user passed--transportexplicitly. 1→ gift wrap, while the CLI still supports v1.2→ NIP-44 direct.- No tag, or no info event → a daemon older than v0.18.0 speaking v1 (current behavior, correct).
fetch_protocol_version_with currently folds "tag present but unparseable" into None together with "no tag". An unparseable value should count as unknown, not as v1.
Why now
mostrod v0.19.0 removes protocol v1 (MostroP2P/mostro#786) and keeps the versioning mechanism for a future v3. The CLI needs this rule before it drops its v1 code.
- Lenguaje dominante
- Rust
- Estrellas
- 39
- Forks
- 16
- Merge medio
- 4 h 6 min
- PR fusionados (30 d)
- 3
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MostroP2P/mostro-cli
-
Stablecoins as order currencies: check market price against the node's rates, not YadioPosiblemente ocupada @grunch la tomó hace 9 días. Abiertoenhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
MostroP2P/mostro-cli#213 ·
-
enhancement status: accepted
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
MostroP2P/mostro-cli#212 · 1 comentario ·
-
enhancement status: accepted
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
MostroP2P/mostro-cli#211 ·
-
enhancement status: accepted
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
MostroP2P/mostro-cli#210 ·
-
enhancement status: accepted
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
MostroP2P/mostro-cli#209 ·
Todos los issues de MostroP2P/mostro-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
longbridge/nsh#804 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
devex good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
calcit-lang/calcit#2538 ·
Los mantenedores suelen responder en 1 día