Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

How does the decision engine currently work? #10

Open
kbala444 opened this issue Aug 6, 2015 · 1 comment
Open

How does the decision engine currently work? #10

kbala444 opened this issue Aug 6, 2015 · 1 comment

Comments

@kbala444
Copy link
Contributor

kbala444 commented Aug 6, 2015

If the engine decides that a peer isn't worth sending to, would it remove that peer's requests from the peer request queue? Or would I make a new task comparator in peer_request_queue.go that pushes requests from bad peers to the end of the queue?

And is there currently some mechanism in place for peers to control which providers to connect to/download blocks from? If not, could bitswap filter the list of all possible providers in connectToProviders() using the decision engine?

Also @jbenet mentioned that there was some existing code that made decisions based on ledger information, if it isn't too much trouble, could you guys point me to where it is? I can't seem to find it.

Thanks!

@whyrusleeping
Copy link

if you want to decide that a certain peer isnt worth sending to, you would have to change the logic in peer_request_queue.go in the Pop() method. We currently dont actually have a way to say 'i'm not going to send to this peer', we can say 'prioritize this peer as the last in line' by using a custom comparitor in the peer_request_queue.

There isnt any existing code for making decisions based on ledger information, we used to have it, but it got dropped during a refactor for one reason or another.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants