-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add the py-dht repo as a submodule #52
base: develop
Are you sure you want to change the base?
Conversation
Do we really need a bash script to install dependencies? |
097f27b
to
9939089
Compare
It is not 100% necessary, but I thought it was clearer to aggregate the submodule init and the dependencies into a single command. I can remove it if you want |
I just
|
35ecfdb
to
108c7f9
Compare
108c7f9
to
5543d41
Compare
Signed-off-by: Csaba Kiraly <[email protected]>
@cortze example run is failing for me with the following error: Any ideas how a 'list' gets there? (myenv) cskiraly@Csabas-MBP das-research % python3 study.py smallConf.py
INFO : Study : Starting simulations:
INFO : Simulator : Shape: {'run': 0, 'numberNodes': 128, 'blockSize': 64, 'failureModel': 'random', 'failureRate': 40, 'netDegree': 8, 'class1ratio': 0.8, 'chi': 2, 'vpn1': 1, 'vpn2': 500, 'bwUplinkProd': 200, 'bwUplink1': 10, 'bwUplink2': 200, 'randomSeed': 'DAS-bs-64-nn-128-fm-random-fr-40-c1r-0.8-chi-2-vpn1-1-vpn2-500-bwupprod-200-bwup1-10-bwup2-200-nd-8dht-seed-builder-seeding-segments-k-20-alpha-1-r-0', 'dhtSeeding': 'builder-seeding-segments', 'k': 20, 'alpha': 1} ... Block Available: 1 in 9 steps
INFO : Simulator : Shape: {'run': 0, 'numberNodes': 128, 'blockSize': 64, 'failureModel': 'random', 'failureRate': 40, 'netDegree': 8, 'class1ratio': 0.8, 'chi': 2, 'vpn1': 1, 'vpn2': 500, 'bwUplinkProd': 200, 'bwUplink1': 10, 'bwUplink2': 200, 'randomSeed': 'DAS-bs-64-nn-128-fm-random-fr-40-c1r-0.8-chi-2-vpn1-1-vpn2-500-bwupprod-200-bwup1-10-bwup2-200-nd-8dht-seed-builder-seeding-segments-k-20-alpha-1-r-0', 'dhtSeeding': 'builder-seeding-segments', 'k': 20, 'alpha': 1} ... Setting up DHT Network
INFO : Simulator : Initializing DHTNetwork... with 128 nodes
INFO : Simulator : DHT fast-init (-1 jobs) done in 1.39 secs
INFO : Simulator : Seeding DHT with 'builder-seeding-segments' strategy
INFO : Simulator : Node 0 will start providing the block to the DHT!
joblib.externals.loky.process_executor._RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/cskiraly/dagger/DAS/das-research/myenv/lib/python3.11/site-packages/joblib/externals/loky/process_executor.py", line 428, in _process_worker
r = call_item()
^^^^^^^^^^^
File "/Users/cskiraly/dagger/DAS/das-research/myenv/lib/python3.11/site-packages/joblib/externals/loky/process_executor.py", line 275, in __call__
return self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cskiraly/dagger/DAS/das-research/myenv/lib/python3.11/site-packages/joblib/_parallel_backends.py", line 620, in __call__
return self.func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cskiraly/dagger/DAS/das-research/myenv/lib/python3.11/site-packages/joblib/parallel.py", line 288, in __call__
return [func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cskiraly/dagger/DAS/das-research/myenv/lib/python3.11/site-packages/joblib/parallel.py", line 288, in <listcomp>
return [func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/cskiraly/dagger/DAS/das-research/study.py", line 41, in runOnce
sim.runBlockPublicationToDHT(shape.dhtSeeding)
File "/Users/cskiraly/dagger/DAS/das-research/DAS/simulator.py", line 336, in runBlockPublicationToDHT
self.dhtBlockProposerSeedingDHTwithSegments()
File "/Users/cskiraly/dagger/DAS/das-research/DAS/simulator.py", line 370, in dhtBlockProposerSeedingDHTwithSegments
nodes, _, summary, aggrDelay = blockProposer.lookup_for_hash(segmentHash)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cskiraly/dagger/DAS/das-research/py-dht/dht/dht.py", line 89, in lookup_for_hash
connection, conndelay = self.network.connect_to_node(self.ID, node, origin_overhead, remote_overhead)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cskiraly/dagger/DAS/das-research/py-dht/dht/dht.py", line 465, in connect_to_node
if random.randint(0, 99) < self.slowerrorrate:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'int' and 'list'
""" |
That seems to be my bad. There is a mismatch between the I generally used the DHT module as a standalone DHT simulation, as it doesn't require to be executed right after the DAS simulation. I can fix the interface and the |
Motivation
Following up with the roadmap of the
das-research
repo, the next step is to simulate the propagation and retrieval ofBlockParts
orBlockSegments
into a public DHT performed by Ethereum's BeaconNodes.Description
This PR aims to integrate the previously created
py-dht
module into thedas-research
simulator. This module has the main components needed to simulate a DHT, such as:Network
interface that allows nodes to find each other and establish aConnection
(delays and error rates are configurable)DHTClient
that keeps a localRoutingTable
and can look for theXOR
closest nodes to any givenHash
, provide aBlockSegment
or Retrieve any givenBlockSegment
Hash
implementation that allows homogenizing the hash space for bothNodeIDs
andBlockSegments
(currently based on pythons 64bitshash()
function)Tasks
py-dht
as a new submoduleDAS
module