handshake-org / handshake-org/hsd
Persistent Banlist
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
### Motivation
I think the main motivations in implementing a persistent banlist are threefold:
A. Prevent unnecessary steps for users who want to ban consistently problematic peers: e.g. https://gist.github.com/tynes/4123a82d2e01e8abb3377e8d54b12091
B. In the instance of node restarts, don't delay the time it takes for a node to get all "good" peers, since currently they'll have to re-ban any misbehaving peers, which could take time.
C. Keep parity w/ practices in Core.
### Implementation details
1. Store the currently maintained list of banned peers in a file (See question 1.).
2. Add the option to include absolute ban time to the set ban RPC - Note: This is shown in the error for set ban, but not actually implemented yet.
3. Possibly add the config option of --bantime (from core), that will allow the default ban time to change. - Optional
4. Possibly add the ban comments to the http endpoints. - Optional
### Remaining Questions
1. Should we store the banned peers in the same hosts.json?
Although this does not follow Core's solution of having banlist occupy it's own file, it seems that it would be the simplest implementation as banned peers are already managed and stored in the hostlist code. This change would just require a few additions in terms of data stored - absolute time of ban - and then would require changing the toJSON function to include banned peers.
Contributor guide
Assessment
This issue has not been assessed yet.