-
Notifications
You must be signed in to change notification settings - Fork 31
Experiment with simple swarms #1205
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
base: master
Are you sure you want to change the base?
Conversation
…ii)_ new blocks are received.
except CancelledError: | ||
trace "Advertisement loop cancelled. Exiting." | ||
|
||
proc loadBlockKnowledge*(self: Swarm): Future[void] {.async: (raises: []).} = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is needed, why duplicate this if it is already in the blockstore? If you're worried about hitting the repostore too oftne, then we can always put a cache of some sort in front?
trace "Error updating pending block knowledge request state (peer dropped)", | ||
peer = peer | ||
|
||
proc handleBlockRequest( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is an experiment, but we should be lazy with handling requests, so I would still put this behind some throttling mechanism, such as the asyncqueue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I'm liking this direction very much. I think this might be close to being ussable. One thing we need to keep in mind, is that we still want the ability to stream requests, as this is a really imoprtant use case. I don't think anything specifically prevents it in this implementation, but just making sure it's know :)
Not a real PR, just to keep the thing visible if someone's interested.