Closed djrtwo closed 6 years ago
@naterush I wrote a bunch of in-line notes that might have been marked as "out dated" be sure to check those out.
@naterush realizing send
and send_all
should include who is the sender. Right now, assumes message.sender
is the sender
for the delay function, but this is limiting if we want to model a more complex network and propagation (like gossiping)
obviously validators could trick the network, but that access control maybe should exist in the simulation layer
@djrtwo had this realization as well w/ the last network PR. For now, I think there are two options that make sense:
I think 1 is fine for now - but let me know what you think.
@naterush @SeanAvery I suppose a threaded simulator that is controlling the network might override time
with a clock... eh?
Generally ready to go. Still have StepNetwork
...
Making a few issues around things to do related to this PR
@djrtwo last change, let's add back in either generated a gif or displaying by default. I'm fine with whatever for now, but something should happen by default (or we should change the make commands) to display or save.
Then LGTM!
Re-implement network is a collection of PriorityQueues one related to each validator.
send
: sendmessage
tovalidator
. message added tovalidator
s priority queue withdelay
send_to_all
: sendmessage
to each other validator.receive
: remove and return next available message fromvalidator
s PQ. Return None if none currently availablereceive_all_available
: remove and return all available messages fromvalidator
s PQ. Return[]
if none--network
option for casper.pyQUESTION realizing
send
andsend_all
should probably include who is the sender. Right now, assumesmessage.sender
is thesender
for the delay function, but this is limiting if we want to model a more complex network and propagation (like gossiping). Thoughts?(obviously validators could trick the network with this function exposed, but that access control maybe should exist in the simulation layer)