Skip to content

Hostdb Rewrite

David Vorick requested to merge hostdb into master

It's not a complete rewrite because a good amount of the old code still remains. But everything got moved around and almost the entire test suite got scrapped.

The new testing framework is in place, and is going to be much nicer to use and read and reason about. I've also done some cleanup stuff along the way, as I notice things which could be improved I've tried to make a habit of improving them on the spot, so they don't get lost in limbo and then never completed.

I removed the sybil attack defenses from the hostdb because I think they were hurting more than helping. We're basically resigned to acknowledging that we can't stop sybil attacks from hosts until we start demanding that they burn coins. I'd rather be vulnerable to sybil attacks than force hosts to burn coins until we've got a bigger network.

I didn't implement any of the other host improvements that I was planning on adding (continuously checking if hosts are active or not, and changing the RandomHost call to avoid returning hosts that the caller already has). These will be put in soon (after testing is brought back) and hopefully that will make the hostdb a lot better. I also haven't added an api call to query the hosts, though I changed the interface so making such an api call would be easy.

Merge request reports