Skip to content

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Jun 11, 2020

Potential alternative to #19219 that keeps the current semantics at the cost of more memory usage.

  1. Single-address bans are moved to a dedicated std::map to avoid iteration.
  2. Misbehaving "ban" entries are limited to 50k using a circular buffer.
  3. Bugfix: Manual bans can override misbehaving discouragement, even for a shorter period of time.

I'm not sure if the tradeoffs justify this approach.

Looking for concept ACK/NACK, as well as code review (will probably use this for at least Knots 0.20.0 temporarily).

@fanquake fanquake added the P2P label Jun 11, 2020
@luke-jr luke-jr force-pushed the misbehaving_limit branch 3 times, most recently from c232afc to 4574554 Compare June 11, 2020 07:45
@luke-jr luke-jr force-pushed the misbehaving_limit branch from 4574554 to 06cd6ff Compare June 11, 2020 07:51
@luke-jr luke-jr force-pushed the misbehaving_limit branch from 06cd6ff to 885fbc7 Compare June 11, 2020 08:10
@jonatack
Copy link
Member

Reviewed #19219 today, so with it fresh in mind will have a look at this version now.

@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept and light code review ACK with builds/tests ran. Good to see a unit test. This maintains the current interface/semantics with a bit more code complexity, more memory (4 MiB or more vs 0.5 MiB for the rolling bloom filter), but can erase from the set with fairly fast O(log(n)) lookups.

@TheBlueMatt
Copy link
Contributor

Concept NACK - #19219 is essentially the current semantics with a node count limit, I don't see any reason to use more memory for a similar thing, and I dont think it makes sense to go back to treating them as an actual ban (though I dont think this does that, either, just noting).

@luke-jr
Copy link
Member Author

luke-jr commented Jun 11, 2020

@TheBlueMatt By "current semantics", in particular I mean being able to list and remove entries, and a reliable 24 hour expiration.

@luke-jr luke-jr force-pushed the misbehaving_limit branch from 61a4854 to 9a58885 Compare June 11, 2020 21:06
@luke-jr
Copy link
Member Author

luke-jr commented Jun 11, 2020

Also added a fix for a bug in the current code: Now manual bans take priority over misbehaving discouragement, regardless of expiry times.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 7, 2020

🐙 This pull request conflicts with the target branch and needs rebase.

@luke-jr
Copy link
Member Author

luke-jr commented Aug 19, 2020

#19219 was merged, so this is no longer applicable

@luke-jr luke-jr closed this Aug 19, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants