preflight: --network check fails for RPC setups dincli accepts (credentialed URLs, config.json, dotenv parsing)
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
- 52/100
Hướng nghiên cứu
Start with _check_rpc and _read_env_value in scripts/preflight.py, then compare network resolution with dincli/cli/utils.py and the existing mocked-urlopen tests in tests/test_preflight.py. Run the preflight tests and check getting-started.md if choosing the documentation alternative for config lookup. Done means the specified credential, lookup, dotenv, and IPFS-provider cases are covered, output hides credentials and URL paths, and python3 -I -S scripts/preflight.py --help still works.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
scripts/preflight.py --network <name> can now fail (exit 1) for an RPC setup that dincli itself uses without trouble. PR No. 303 made the RPC and IPFS checks required, and that's correct, but it means every gap between how preflight resolves and calls the RPC and how dincli does is now a false failure, not a harmless [WARN]. Follow-up from the PR No. 303 re-review. Part of BL-32 (issue No. 245).
Part A: RPC URLs with credentials in them fail (bug)
Some RPC providers put basic-auth credentials in the URL (https://user:pass@host/...). _check_rpc sends the URL straight to urllib.request, which doesn't strip the userinfo: it tries to resolve user:pass@host as a hostname. web3's HTTPProvider, which dincli uses in get_w3, handles the same URL fine.
Reproduced on PR No. 303's head (e22e360) against a local anvil --port 18545 --chain-id 1337:
LOCAL_RPC_URL=http://user:[email protected]:18545 python3 scripts/preflight.py --network local
→ [MISSING] RPC not reachable: http://127.0.0.1:18545/*** (exit 1)
urllib.request.urlopen(...) → URLError <urlopen error [Errno -2] Name or service not known>
Web3(HTTPProvider(url)) → is_connected() == True, chain_id == 1337
Proposed fix (in _check_rpc): split the URL with urllib.parse.urlsplit. If username/password are set, rebuild the URL without them and send an Authorization: Basic <base64(user:pass)> header instead. _sanitize_url already keeps credentials out of the output; keep it that way.
Tests: in tests/test_preflight.py, using the existing mocked-urlopen fixtures:
- a credentialed URL reaches
urlopenwith no userinfo in the request URL and with the expectedAuthorizationheader; - neither the username nor the password appears anywhere in stdout or stderr;
- a URL without userinfo sends no
Authorizationheader.
Part B: make the RPC lookup match dincli's
config.jsonfallback. dincli'sresolve_network_value(dincli/cli/utils.py) checksos.environ, then.envin the cwd, thenconfig.json → networks.<network>.rpc_url. Preflight stops after.env, so an RPC URL set only inconfig.jsongets[MISSING] No RPC URL found. No dincli command writes that key today (it's hand-edited only), so either read it in preflight, when dincli is importable, or say in theNo RPC URL foundhint and ingetting-started.mdthat only env and.envare checked..envparsing. dincli reads.envwith python-dotenv'sdotenv_values. Preflight uses its own stdlib parser,_read_env_value, so that it works beforepip install -e .. This is the "full dotenv parity" item the PR 255 merge proposal and issue No. 245's status update left optional. Whendotenvis importable, preflight could usedotenv_valuesand keep_read_env_valueas the stdlib fallback, so the two never disagree once dincli is installed.
Part C (nit): name the unknown IPFS provider
PR No. 303 changed IPFS unknown provider '{provider}' to IPFS unknown provider. The provider name is a config choice, not a credential, and showing it is the quickest way to spot a typo (filebse). Put it back.
Acceptance
- Part A's reproduction prints
[OK] RPC reachableand exits 0 (apart from unrelated checks), and the new tests pass. - Part B: preflight finds the RPC URL wherever dincli would find it, or the docs say exactly where preflight looks.
- No credentials or URL paths appear in any preflight output.
python3 -I -S scripts/preflight.py --helpstill works with only the standard library.
- Ngôn ngữ chính
- Python
- Star
- 4
- Fork
- 7
- Merge trung bình
- 3 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 34
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của InfiniteZeroFoundation/DevNet
-
ROADMAP.md: refresh "What is still open for P3" (several items were fixed in October)Có thể đã có người làm @umermjd11 đã nhận 4 ngày trước. Đang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
InfiniteZeroFoundation/DevNet#285 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update the 25 translated organisation READMEs to match the English versionCó thể đã có người làm @mrCabez đã nhận 1 ngày trước. Đang mởgood first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
InfiniteZeroFoundation/DevNet#277 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update the client-service guide to explain training and uploading separatelyCó thể đã có người làm @Santiagocetran đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
InfiniteZeroFoundation/DevNet#266 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Few questions related to GI2 aggregatorCó thể đã có người làm @Abidoyesimze đã nhận hôm nay. Đang mở
InfiniteZeroFoundation/DevNet#307 · 1 reaction · 4 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
InfiniteZeroFoundation/DevNet#299 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của InfiniteZeroFoundation/DevNet
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Claiming namespace `thejakia1`Đang mởnamespace operations
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
EclipseFdn/open-vsx.org#15057 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
FinanceFlash/unvibecode#349 ·
-
Mission statement: why this is free, in the README, Why This Exists and the wiki HomeCó thể đã có người làm @ChiefGyk3D đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ChiefGyk3D/Clouds-Against-Humanity#348 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Perf] Default --vllm-watermark 0.05 for rollouts (hybrid models re-preempt under KV pressure)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
vllm-project/vime#508 ·
Maintainer thường phản hồi trong vòng 4 ngày