Refuse a node that advertises an unknown protocol_version
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 39
- フォーク
- 16
- 平均マージ
- 4時間 6分
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MostroP2P/mostro-cli のほかの issue
-
Stablecoins as order currencies: check market price against the node's rates, not Yadio対応中かも @grunch が 9 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
MostroP2P/mostro-cli#213 ·
-
enhancement status: accepted
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
MostroP2P/mostro-cli#212 · コメント 1 件 ·
-
enhancement status: accepted
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
MostroP2P/mostro-cli#211 ·
-
enhancement status: accepted
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
MostroP2P/mostro-cli#210 ·
-
enhancement status: accepted
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
MostroP2P/mostro-cli#209 ·
MostroP2P/mostro-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
longbridge/nsh#804 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
devex good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
calcit-lang/calcit#2538 ·
メンテナーはふだん 1 日以内に返信