ethereum / ethereum/ddht

Web3 tooling has broken type-checking

Open
#227 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
19
Forks
15
PR merge metrics
No merged PRs in 30d

Description

## What was wrong?
The `Discovery5Module` in the web3 tooling is not being type-checked correctly. The mypy check passes successfully when the attached `Method`s are missing a type and when the declared type is incorrect.

### Code that produced the error
https://github.com/ethereum/ddht/blob/master/ddht/tools/web3.py#L286-L355

### Expected Result
Mypy runs should fail when attached methods are missing a type and if the declared type is incorrect.

## How can it be fixed?
From https://github.com/ethereum/ddht/pull/224#discussion_r528919231

> My guess is that web3.py might be leaking Any which is typically where this type of deficiency shows up.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with ddht/tools/web3.py, especially lines 286-355, and inspect how Discovery5Module exposes its attached Methods to mypy. Run the existing mypy checks with a missing type and an incorrect declared type to reproduce the gap. Done means both cases make mypy fail instead of passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.