Skip to content

Conversation

@Fuzzbawls
Copy link
Collaborator

@Fuzzbawls Fuzzbawls commented May 25, 2020

Backport of bitcoin#8128 as part of #1374. Based on top of #1640

Original Description:

CNetAddr/CService/CSubNet lose their string constructors, they must now have lookup operations performed externally. This means that functions/classes that depend on them are no longer dependent on any particular lookup mechanism.

From a high level: New resolvers/parsers may now be used for net operations. libbtcnet will replace what remains of netbase with async versions.

Additional work has been done in the following commits:

  • fcef585 - Removes a useless RPC command
  • 235c33e - Refactors the masternode.conf parsing with regards to valid ports
  • 3ddd35e - Adds additional sanity checks during client init for MN port numbers and listen options.

@Fuzzbawls Fuzzbawls added RPC P2P Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes labels May 25, 2020
@Fuzzbawls Fuzzbawls added this to the 5.0.0 milestone May 25, 2020
@Fuzzbawls Fuzzbawls self-assigned this May 25, 2020
@Fuzzbawls Fuzzbawls force-pushed the 2020_split-resolve branch 2 times, most recently from f4fea01 to 5a67de0 Compare May 26, 2020 20:49
@Fuzzbawls
Copy link
Collaborator Author

rebased now that #1640 has been merged

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

Code first impression ACK, overall is looking nice.

Copy link

Choose a reason for hiding this comment

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

Would be good to pass the service by reference

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

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

Code ACK, looking pretty good. Couple irrelevant styling nits that can be safely ignored (or addressed later, maybe with a script).
Will give it some testing.

@Fuzzbawls Fuzzbawls force-pushed the 2020_split-resolve branch from 43089a9 to a3c6a44 Compare May 29, 2020 05:01
theuni and others added 13 commits June 13, 2020 16:30
This command serves no real purpose, offers no checking that the address
 entered is even a MN (which it shouldn't), and is essentially just a
 stripped down version of the addnode command.
The checking of the port in masternode.conf files was overly complex.
This simplifies it whilst maintaining that the port much match the
default P2P port for the current network and removes the reliance on
"magic numbers".
This also adds some sanity checking to masternode startup arguments:
* -listen can't be 0 when -masternode is 1
* when -masternode is set, require that the client uses the default port
* validate the port supplied (if any) for -masternodeaddr

Lastly, `CMasternodeBroadcast::CheckDefaultPort` now takes a `CService`
as it's first argument instead of a string.
Net functionality is no longer needed for CAddress/CAddrman/etc. now that
CNetAddr/CService/CSubNet are dumb storage classes.
Also fix up a few small issues:
- Lookup with "badip:port" now sets the port to 0
- Don't allow assert to have side-effects
apply clang-format
@Fuzzbawls Fuzzbawls force-pushed the 2020_split-resolve branch from a3c6a44 to b36f743 Compare June 14, 2020 02:08
@Fuzzbawls Fuzzbawls changed the title [Net]: Turn net structures into dumb storage classes [Net] Turn net structures into dumb storage classes Jun 14, 2020
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

tested ACK b36f743

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

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

ACK b36f743 and merging...

@random-zebra random-zebra merged commit 4c829bb into PIVX-Project:master Jun 15, 2020
@Fuzzbawls Fuzzbawls removed the Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes label Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants