ethereum / ddht

Python implementation of Discovery V5 Protocol
MIT License
18 stars 16 forks source link

Inbound nodes not added #104

Closed fjl closed 3 years ago

fjl commented 3 years ago

What was wrong?

Nodes which connect to ddht (i.e. via PING) appear to not be added the routing table. This makes it very hard to test FINDNODE handling.

Expected Result

In my test, I'm trying to get some bystander nodes added to ddht's table, so that it can verify whether these nodes are returned by FINDNODE later. To get them in, the test sends PING from the bystander node every 10s and waits for a PING or FINDNODE from ddht. Even after waiting 120s, ddht never sends any such request. I therefore assume that the nodes are not present in the table.

I would expect that a PING is eventually sent.

Environment

Python version:
3.8.2 (default, Jul 16 2020, 14:00:26) 
[GCC 9.3.0]

Operating System: Linux-5.4.0-47-generic-x86_64-with-glibc2.29

pip freeze result:
alabaster==0.7.12
apipkg==1.5
appdirs==1.4.3
asn1crypto==1.4.0
async-generator==1.10
async-service==0.1.0a11
attrs==20.2.0
Babel==2.8.0
backcall==0.2.0
black==19.10b0
blake2b-py==0.1.3
bleach==3.2.1
bump2version==1.0.0
bumpversion==0.6.0
CacheControl==0.12.6
cached-property==1.5.2
certifi==2019.11.28
cffi==1.14.3
chardet==3.0.4
click==7.1.2
coincurve==10.0.0
colorama==0.4.3
contextlib2==0.6.0
cryptography==3.1.1
cytoolz==0.11.0
-e git+https://github.com/ethereum/ddht@e52fa5e170ae1698ed47f5bc3bd04140e880f2d1#egg=ddht
decorator==4.4.2
distlib==0.3.1
distro==1.4.0
docopt==0.6.2
docutils==0.16
entrypoints==0.3
eth-bloom==1.0.3
eth-enr==0.3.0
eth-hash==0.2.0
eth-keys==0.3.3
eth-typing==2.2.2
eth-utils==1.9.5
execnet==1.7.1
factory-boy==2.12.0
Faker==4.5.0
filelock==3.0.12
flake8==3.8.3
hexbytes==0.2.1
html5lib==1.0.1
hypothesis==4.57.1
idna==2.8
ifaddr==0.1.7
imagesize==1.2.0
incremental==17.5.0
iniconfig==1.0.1
ipaddr==2.2.0
ipython==7.18.1
ipython-genutils==0.2.0
isort==5.5.4
jedi==0.17.2
jeepney==0.4.3
Jinja2==2.11.2
keyring==21.4.0
lockfile==0.12.2
lru-dict==1.1.6
lxml==4.5.2
MarkupSafe==1.1.1
mccabe==0.6.1
more-itertools==8.5.0
msgpack==0.6.2
mypy==0.782
mypy-extensions==0.4.3
netdisco==2.8.2
netifaces==0.10.9
outcome==1.0.1
packaging==20.3
parso==0.7.1
pathspec==0.8.0
pathtools==0.1.2
pep517==0.8.2
pexpect==4.8.0
pickleshare==0.7.5
pkg-resources==0.0.0
pkginfo==1.5.0.1
pluggy==0.13.1
plyvel==1.2.0
progress==1.5
prompt-toolkit==3.0.7
psutil==5.7.2
ptyprocess==0.6.0
py==1.9.0
py-ecc==4.1.0
py-evm==0.3.0a19
pycodestyle==2.6.0
pycparser==2.20
pycryptodome==3.9.8
pydocstyle==3.0.0
pyethash==0.1.27
pyflakes==2.2.0
Pygments==2.7.1
pyparsing==2.4.6
pytest==6.0.1
pytest-forked==1.3.0
pytest-randomly==3.1.0
pytest-trio==0.6.0
pytest-watch==4.2.0
pytest-xdist==2.0.0
python-dateutil==2.8.1
pytoml==0.1.21
pytz==2020.1
readme-renderer==26.0
regex==2020.9.27
requests==2.22.0
requests-toolbelt==0.9.1
retrying==1.3.3
rfc3986==1.4.0
rlp==2.0.0a1
rusty-rlp==0.1.15
SecretStorage==3.1.2
six==1.14.0
sniffio==1.1.0
snowballstemmer==2.0.0
sortedcontainers==2.2.2
Sphinx==1.8.5
sphinx-rtd-theme==0.5.0
sphinxcontrib-serializinghtml==1.1.4
sphinxcontrib-websupport==1.2.4
text-unidecode==1.3
toml==0.10.1
toolz==0.11.1
towncrier==19.2.0
tox==3.19.0
tqdm==4.50.0
traitlets==5.0.4
trie==2.0.0a4
trio==0.16.0
trio-typing==0.5.0
twine==3.2.0
typed-ast==1.4.1
typing-extensions==3.7.4.3
upnp-port-forward==0.1.1
uPnPClient==0.0.8
urllib3==1.25.8
virtualenv==20.0.33
watchdog==0.10.3
wcwidth==0.2.5
webencodings==0.5.1
zeroconf==0.28.5
pipermerriam commented 3 years ago

@fjl is it easy for you to verify this now behaves as expected using my branch from #105 ?

fjl commented 3 years ago

I'll check it tomorrow.