Skip to content

Conversation

naumenkogs
Copy link
Member

@naumenkogs naumenkogs commented Sep 4, 2020

Draft pending on #19958

  1. If an attempt to connect to a feeler wasn't actually made (an entry from AddrMan we considered was invalid, or we made too many tries, or it didn't have the right flag) — wait less until we try the next feeler.
  2. Make those intervals mockable
  3. Remove unnecessary extra random noise between feelers

(1) would make transitioning from "new" to "tried" better in the presence of those events. An adversary here fills our "new" table with garbage to prevent us from trying honest peers from "new". This probably won't help much against a very powerful adversary but will help against a moderate adversary. It also may help in natural non-malicious cases.

Moving from "new" to "tried" table is important for p2p security.

@fanquake fanquake added the P2P label Sep 4, 2020
@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 4, 2020

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.

We should distinguish the case when we selected a feeler
and attempted connecting to it from the case when we didn't
even try: maybe the record was invalid, or too many attempts
were made. In the latter case, make next feeler attempt sooner.
Feeler intervals are already poisson-randomized, no need
to add extra random noise.
@DrahtBot
Copy link
Contributor

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

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@sdaftuar
Copy link
Member

Concept ACK improvements along these lines. However, I'm not sure about the more complicated interval logic around the feeler connections -- it seems to me like that logic is already a bit hard to follow, so I wonder if a better approach might be to just check for invalidity in the while (!interruptNet) loop, and be willing to iterate in that loop many more times if fFeeler is set?

@naumenkogs
Copy link
Member Author

@sdaftuar I agree with the high-level idea. Even though I don't think I'm making it significantly harder to follow, simplifying is a good idea.

But let me check, are you suggesting just to carefully use continue instead of break inside the loop?

@naumenkogs
Copy link
Member Author

Closing this:

  1. Mockable time is already done.
  2. Smarter intervals probably better be done after a refactoring (gonna do that in another PR first)
  3. Dropping extra noise probably ain't worth it on its own

@naumenkogs naumenkogs closed this Sep 15, 2021
@bitcoin bitcoin locked and limited conversation to collaborators Oct 30, 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.

4 participants