Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Move tier two managers initialization from init.cpp to tiertwo/init.cpp #2684

Merged
merged 5 commits into from Dec 29, 2021

Conversation

furszy
Copy link

@furszy furszy commented Dec 14, 2021

It's primarily a move-only refactoring, breaking up a bit more the long monolithic init.cpp. Placing the tier two components initialization in a separate tiertwo/init.cpp file.

This will make future inclusions easier, like #2647 introducing the new tier two MN metadata manager and the network sync requests manager.

And, as an extra cleanup, removed the broken litemode flag. Because, as is now, it simply makes no sense.. it's a "turn this on to fork your node".

@furszy furszy self-assigned this Dec 14, 2021
@furszy furszy added this to the 6.0.0 milestone Dec 14, 2021
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.

Needs rebase. Otherwise concept/code ACK.

src/tiertwo/init.cpp Outdated Show resolved Hide resolved
@furszy furszy force-pushed the 2021_decouple_tiertwo_init branch 2 times, most recently from c0105db to bacd38b Compare December 17, 2021 13:10
@furszy
Copy link
Author

furszy commented Dec 17, 2021

rebased, conflicts solved.

random-zebra
random-zebra previously approved these changes Dec 17, 2021
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 bacd38b

@Fuzzbawls
Copy link
Collaborator

Concept ACK, just a couple minor things; -litemode is still in the help output and the new tiertwo subdir needs to be added to CLEANFILES (could also take this opportunity to add the bls subdir too, as that was missed previously):

Index: src/init.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/init.cpp b/src/init.cpp
--- a/src/init.cpp	(revision 2518feb15e0cbd58673fc9d8d8a8d125e9b9cfd6)
+++ b/src/init.cpp	(date 1639885892832)
@@ -513,7 +513,6 @@
     }
     strUsage += HelpMessageOpt("-shrinkdebugfile", "Shrink debug.log file on client startup (default: 1 when no -debug)");
     AppendParamsHelpMessages(strUsage, showDebug);
-    strUsage += HelpMessageOpt("-litemode=<n>", strprintf("Disable all PIVX specific functionality (Masternodes, Budgeting) (0-1, default: %u)", 0));
 
     strUsage += HelpMessageGroup("Masternode options:");
     strUsage += HelpMessageOpt("-masternode=<n>", strprintf("Enable the client to act as a masternode (0-1, default: %u)", DEFAULT_MASTERNODE));
Index: src/Makefile.am
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am	(revision 2518feb15e0cbd58673fc9d8d8a8d125e9b9cfd6)
+++ b/src/Makefile.am	(date 1639887276581)
@@ -746,6 +746,7 @@
 CLEANFILES += script/*.gcda script/*.gcno
 CLEANFILES += support/*.gcda support/*.gcno
 CLEANFILES += test/librust/*.gcda test/librust/*.gcno
+CLEANFILES += tiertwo/*.gcda tiertwo/*.gcno
 CLEANFILES += univalue/*.gcda univalue/*.gcno
 CLEANFILES += util/*.gcda util/*.gcno
 CLEANFILES += wallet/*.gcda wallet/*.gcno

@furszy
Copy link
Author

furszy commented Dec 19, 2021

done, removed the litemode help message and added the tiertwo and bls dirs paths to the build system clean function.

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.

diff utACK d1fffb5

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

ACK d1fffb5

@furszy furszy merged commit ab30cd2 into PIVX-Project:master Dec 29, 2021
furszy added a commit that referenced this pull request Jan 25, 2022
… to tiertwo/init.cpp and add disabledkg init flag

c445333 init: add flag to disable the DKG processes. (furszy)
6035112 init: move tier two objects initializers and the Masternodes collateral transactions' output lock in wallet to the tiertwo/init.cpp file. (furszy)
38b92b9 init: improve dmn collateral locking. (furszy)
918db4e init: move Masternode arguments inside tiertwo/init GetTierTwoHelpString (furszy)

Pull request description:

  Follow-up to #2684, built on top of #2647. Starting in 296e6fa.

  Focused on the following points:

  1) Move init arguments help messages to a new `GetTierTwoHelpString()`, the tier two objects initializers and the Masternodes collateral output locking process to the tiertwo/init files.
  2) Improve DMN collateral locking process:
     * Walking through the DMN list only once instead of one-time per wallet.
     * Removing the wallet dependency on `evo/deterministicmns.h`.
  3) Add `-disabledkg` init argument so the `p2p_quorum_connect.py` functional test does not get affected by the automatic DKG sessions processes (coming in #2722). The same flag will be used in other future tests that perform manual operations as well.

ACKs for top commit:
  random-zebra:
    utACK c445333
  Fuzzbawls:
    ACK c445333

Tree-SHA512: ed879a1b2ce840777bc9144297bfe76aa3184d6b3aede925c6bb2a8f6854a4b87b5acfa734d8f5da128cf5880a8927999f9c5798e17174f97b26f3a392e1b8cb
furszy added a commit that referenced this pull request Feb 15, 2022
be1c0fc test: coverage for netfulfilledman requests existence and expiration. (furszy)
42f76c9 Connect net requests manager load, dump and maintenance job. (furszy)
ad60ad7 Create fulfilled requests manager. (furszy)

Pull request description:

  Built on top of #2684

  An object in charge of cache and store tier two network requests information, preventing possible bans for asking the same data too often.

ACKs for top commit:
  random-zebra:
    ACK be1c0fc
  Fuzzbawls:
    ACK be1c0fc

Tree-SHA512: 9abb5f01372cf85af7d7e21c581394008d8e1cc941a3bf2b388c34b7fd2cff391f953fdf6ace8afed717c0ed3879e04bb102d6c1b9db884d895445639229c12b
@Fuzzbawls Fuzzbawls modified the milestones: 6.0.0, 5.5.0 Sep 11, 2022
@furszy furszy deleted the 2021_decouple_tiertwo_init branch November 29, 2022 14:38
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.

None yet

3 participants