Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] updates to DHT internals #276

Open
3 of 9 tasks
justheuristic opened this issue Jun 15, 2021 · 1 comment
Open
3 of 9 tasks

[REFACTOR] updates to DHT internals #276

justheuristic opened this issue Jun 15, 2021 · 1 comment
Labels
dht enhancement New feature or request refactor Resolving technical debt

Comments

@justheuristic
Copy link
Member

justheuristic commented Jun 15, 2021

extracted from #98

  • Can we get rid of return_futures=True option in node.get/store/run_coro ?
    • replace return_future -> wait=True
    • or 2nd method get_async / store_async
  • rewrite test_dht_protocol, test_empty_table and test_dht_node to use await instead of loop.run_until_complete
  • make DHT resistant to KeyboardInterrupt when they are running interactively?
    • problem symptom: you're running in jupyter, you press ctrl+C and it kills all dht daemons
    • applies to DecentralizedAverager (fix or create an issue)
  • TimedStorage: add .pop() method
  • MPFuture: make sure await asyncio.create_task(mpfuture) works without extra wrappers
  • make alias DHTID.from(x) = DHTID.generate(source=x)? (@justheuristic )
  • Use PeerID (that supports XOR distance itself) instead of DHTID
  • Move test_dht_protocol() and test_empty_table() from test_dht_node.py to a new file test_dht_protocol.py (these tests use only DHTProtocol, not DHTNode)
  • rename PeerID -> Endpoint, use bytes for PeerIDs in protobufs (instead of string)
@justheuristic justheuristic added enhancement New feature or request dht labels Jun 15, 2021
@justheuristic justheuristic added the refactor Resolving technical debt label Jun 15, 2021
@justheuristic
Copy link
Member Author

Note: we decided not to implement TimedStorage.pop: neither of its 5 use cases would actually benefit from this method: all of them make deletion conditional, i.e. if item = s.pop(); if time_is_right: del s[key].
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dht enhancement New feature or request refactor Resolving technical debt
Projects
None yet
Development

No branches or pull requests

1 participant