Refuse a node that advertises an unknown protocol_version
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 74/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 39
- Forks
- 16
- Avg merge
- 6h
- Merged PRs (30d)
- 50
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MostroP2P/mostro-cli
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 25/100
MostroP2P/mostro-cli#272 ·
Maintainers usually reply within 1 day
-
Add a JSON node status command that reads a node's health eventMay be free again @victrvondoom claimed this 14 days ago, and no pull request is open. Openenhancement status: accepted
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MostroP2P/mostro-cli#271 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
MostroP2P/mostro-cli#242 ·
Maintainers usually reply within 1 day
-
Stablecoins as order currencies: check market price against the node's rates, not YadioPossibly taken @grunch claimed this 41 days ago. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 56/100
MostroP2P/mostro-cli#213 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MostroP2P/mostro-cli#188 ·
Maintainers usually reply within 1 day
All issues in MostroP2P/mostro-cli
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
storytold/photocraft#20056 ·
Maintainers usually reply within 1 day
-
accessibility agent-ready area:android bug fleet needs-qa
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
-
A-Packaging C-Bug D-Straightforward S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:doc bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
bherbruck/solvecraft#26051 ·