4 ms·
I noticed they use a Bloom Filter based on ip address to prevent people from voting multiple times. According to the implementation[1] it uses a 256-byte struct
by infogulch 12y ago
I noticed they use a Bloom Filter based on ip address to prevent people from voting multiple times. According to the implementation[1] it uses a 256-byte structure and limits the total number of votes on a post to 142 [2] (more than that and the false-positive rate > 0.001). This is stored as a sqlite BLOB on the same row as the comment.
But if you're limiting votes to ~142 anyways, you can just store the exact ip address of every voter (packed in the BLOB at 4 bytes each) and it would only reach up to double the space (~560). But since the overwhelmingly vast majority of comments won't get nearly that many votes, you'd actually be saving space compared to keeping a bloom filter for each comment.
It seems like an overengineered and unnecessary technical complexity.
[1]: https://github.com/posativ/isso/blob/master/isso/utils/__init__.py#L39 https://github.com/posativ/isso/blob/master/isso/utils/__ini...
[2]: https://github.com/posativ/isso/blob/master/isso/db/comments.py#L186 https://github.com/posativ/isso/blob/master/isso/db/comments...
- trurl42 12y agoI guess the point is to not store ip addresses. Given the focus on allowing anonymous commenting [1] this seems to make sense. [1]: http://posativ.org/isso/docs/#what-s-wrong-with-disqus http://posativ.org/isso/docs/#what-s-wrong-with-disqus
- kevan 12y agoIn that case you could store a hash of the IP instead.
- girvo 12y agoWith a known structure, a hashed IP could be reversed quite easily couldn't it?
- infogulch 12y agoWe're limited to ipv4 so even if you hash it you could still test every possible address within a few minutes. You can even do the same with the bloom filter, since there's at worst only a 1/1000 false positive rate (and likely much smaller). The bloom filter isn't designed to provide security, and trying to make (ipv4) IPs private if you're using them as identities is a lost cause.
- neurotech1 12y agoIs there an XKCD[1] comic about over-engineered solutions? I'd be tempted to go with exponential back off for voting. eg. the more votes, the less effect they have on the total score. [1] http://en.wikipedia.org/wiki/Randall_Munroe http://en.wikipedia.org/wiki/Randall_Munroe
- deleted 12y ago[deleted]