Limit bootstrap peers #1106
Comments
Hey, I think I can take this up. About the trust counter, what I would do is change this hash set to a |
Great!
Sounds good to me, although personally I try to avoid generic code if I can, because it makes code more complex and verbose. |
Yes let's design in smaller steps and introduce stuff when needed pls |
@1uka are you still looking at working on this issue? :) |
Yes yes, I've just been busy and have very little time these days. I will start working probably tonight or tomorrow. |
Btw, some people from the office just told me that earlier the default for bootstrap cache limit was 1500. So go with that. Seems like Skype used the same constant back in the day when it still had peer-to-peer architecture :) |
@povilasb Before I start, I have some questions. Would you prefer if we saved the And should I use PS: Considering my questions, I would not save the map if we use |
I don't see the use of a HashMap there. Peers are stored in HashSet. Or am I missing something? ::) I'd say keep the counter as a trust metric:
Mmm, I guess you meant to use HashMap to associate trust metric with PeerInfo. I'd say don't do it. Keep a list of |
At first I thought associating the trust metric with PeerInfo is what you wanted. So now I am thinking about another solution (which would make keeping a trust metric unnecessary):
But this way, once we reach the cache limit, the cache will always oscillate around full capacity. Is this closer to what you would prefer? Or should I just change the Now I have one more question: say we use a counter as a trust metric, the cache is full and all the peers in it have been bootstrapped off at least 2 times; we want to insert a new peer in the cache which we haven't seen already.
if we adhere to this, we would not insert the new peer, is that correct? |
Running some QA checks on this, keeping notes here https://gist.github.com/S-Coyle/91aeba06ea13bdbd386118d1e44fe1af |
Currently Crust does 2 things we don't like:
Service::bootstrap()
will attempt all peers in parallel, even if there are thousands of cached peers. The problem with this is that many systems won't allow you to use more than ~1000 sockets in parallel.So
The text was updated successfully, but these errors were encountered: