Commit Graph

17501 Commits

Author SHA1 Message Date
Alexander Block
a09e36106e Fix onlyOutbound handling 2020-03-27 15:12:20 +01:00
Alexander Block
f82204db95 Move intra-quorum connection calculation into local func 2020-03-27 15:12:20 +01:00
Alexander Block
fdec67a55b Wait for ping/pong after re-connecting all nodes 2020-03-27 15:12:20 +01:00
Alexander Block
882b58c990 Use <> instead of "" for #include 2020-03-27 15:12:20 +01:00
Alexander Block
dbaf13848d Include inbound connections in output of "quorum dkgstatus" 2020-03-27 15:12:20 +01:00
Alexander Block
7df624d380 Implement tests for LLMQ connection handling 2020-03-27 15:12:20 +01:00
Alexander Block
e8bbbec259 Don't try to open masternode connections when network is disabled 2020-03-27 15:12:20 +01:00
Alexander Block
c9608bf930 Only add wallet info to protx list/info when wallet is enabled 2020-03-27 15:12:20 +01:00
Alexander Block
9ef2b05884 Add masternode meta info to protx list/info 2020-03-27 15:12:20 +01:00
Alexander Block
8f644d18d7 Implement probing of public ip/port of LLMQ members 2020-03-27 15:12:20 +01:00
Alexander Block
14bb62ac8e Connect all LLMQ members to all other members 2020-03-27 15:12:20 +01:00
Alexander Block
486463d622 Add SPORK_21_QUORUM_ALL_CONNECTED 2020-03-27 15:12:20 +01:00
Alexander Block
6c95518807 Bump proto version 2020-03-27 15:12:20 +01:00
Alexander Block
8ab1a3734a
Bump mocktime each time waiting for phase1 fails (#3383)
This causes re-tries of LLMQ connections, which is required in cases
where 2 MNs tried to connect to each other and due to bad timing then
disconnected each other.
2020-03-27 15:12:03 +01:00
Alexander Block
c68b5f68aa
Hold CEvoDB lock while iterating mined commitments (#3379) 2020-03-27 15:11:42 +01:00
Alexander Block
deba865b17
Also verify quorumHash when waiting for DKG phases (#3382)
This is especially important when waiting for phase 1 (initialization),
as we might have skipped a whole DKG session before while the async DKG
session handler is still in the init phase (but for the old/skipped LLMQ).
2020-03-26 13:25:24 +01:00
Alexander Block
17ece14f40
Better/more logging for DKGs (#3381)
* Better/more logging for DKGs

* Use type name instead of type number in CDKGLogger
2020-03-26 13:25:01 +01:00
Alexander Block
80be2520a2
Call FlushBackgroundCallbacks before resetting CConnman (#3378) 2020-03-26 13:24:31 +01:00
Alexander Block
b6bdb8be9e
Faster opening of masternode connections (#3375)
Only sleep 100ms when we previously tried to connect a MN. The back-off
logic in ThreadOpenMasternodeConnections will prevent too many unsuccessful
connects to offline/bad nodes.
2020-03-26 13:24:06 +01:00
Alexander Block
fa9b91b50f
Merge pull request #3376 from UdjinM6/merge_11824
Merge remaining bits of #11824: Block ActivateBestChain to empty validationinterface queue
2020-03-26 13:23:44 +01:00
UdjinM6
b1dff227cb Apply some review suggestions 2020-03-25 17:51:42 +03:00
Alexander Block
8211ff0a8a
Merge pull request #3368 from codablock/pr_fmasternode
Don't relay anything to inbound/outbound fMasternode connections
2020-03-24 17:40:51 +01:00
Pieter Wuille
871b8585ca Merge #11824: Block ActivateBestChain to empty validationinterface queue
97d2b09c12 Add helper to wait for validation interface queue to catch up (Matt Corallo)
36137497f1 Block ActivateBestChain to empty validationinterface queue (Matt Corallo)
5a933cefcc Add an interface to get the queue depth out of CValidationInterface (Matt Corallo)
a99b76f269 Require no cs_main lock for ProcessNewBlock/ActivateBestChain (Matt Corallo)
a734896038 Avoid cs_main in net_processing ActivateBestChain calls (Matt Corallo)
66aa1d58a1 Refactor ProcessGetData in anticipation of avoiding cs_main for ABC (Matt Corallo)
818075adac Create new mutex for orphans, no cs_main in PLV::BlockConnected (Matt Corallo)

Pull request description:

  This should fix #11822.

  It ended up bigger than I hoped for, but its not too gnarly. Note that "
  Require no cs_main lock for ProcessNewBlock/ActivateBestChain" is mostly pure code-movement.

Tree-SHA512: 1127688545926f6099449dca6a4e6609eefc3abbd72f1c66e03d32bd8c7b31e82097d8307822cfd1dec0321703579cfdd82069cab6e17b1024e75eac694122cb
2020-03-24 17:21:59 +03:00
Alexander Block
94bcf85347
Merge pull request #3367 from codablock/pr_refactor_llmq_conns
Refactor and unify quorum connection handling
2020-03-24 11:20:45 +01:00
Alexander Block
4e8f4ea202
Merge pull request #3374 from codablock/pr_fix_scheduler_shutdown
Backport bitcoin#12266 and bitcoin#13894 to fix shutdown issues
2020-03-24 11:20:12 +01:00
Alexander Block
d8121bba29
Apply suggestions from code review
Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-03-24 11:07:26 +01:00
Alexander Block
7f1f1d12f5 Make EnsureQuorumConnections re-set connections in every iteration
Instead of only doing it the first time. This is a preparation for
the new intra-quorum connection system (which connects all members to all
other members)
2020-03-24 10:58:29 +01:00
Alexander Block
9ef1e7cb51 Only log new quorum connections when it's actually new 2020-03-24 10:58:16 +01:00
Alexander Block
364d6c37f7 Move and unify logic for quorum connection establishment into CLLMQUtils 2020-03-24 10:58:16 +01:00
Alexander Block
c0bb06e766
Merge pull request #3366 from codablock/pr_fix_mnconns
Multiple fixes for masternode connection handling
2020-03-24 10:57:42 +01:00
Alexander Block
f2ece1031f
Remove logging for waking of select() (#3370)
This was always quite spammy and so far never useful in debugging.
2020-03-24 10:55:24 +01:00
Wladimir J. van der Laan
35b041ed14 Merge #13894: shutdown: Stop threads before resetting ptrs
faab63111d8f27335aa1f09c1a48da3be45135de shutdown: Stop threads before resetting ptrs (MarcoFalke)

Pull request description:

  On shutdown some threads would continue to run after or during a pointer reset. This leads to occasional segfaults on shutdown.

  Fix this by resetting the smart pointers after all threads that might read from them have been stopped.

  This should fix:
  * A segfault in the txindex thread, that occurs when the txindex destructor is done, but the thread was not yet stopped (as this is done in the base index destructor)
  * A segfault in the scheduler thread, which dereferences conman. (e.g. CheckForStaleTipAndEvictPeers)

Tree-SHA512: abbcf67fadd088e10fe8c384fadfb90bb115d5317145ccb5363603583b320efc18131e46384f55a9bc574969013dfcbd08c49e0d42c004ed7212eca193858ab2
2020-03-23 12:42:58 +01:00
Wladimir J. van der Laan
c01e39d610 Merge #12266: Move scheduler/threadGroup into common-init instead of per-app
082a61c Move scheduler/threadGroup into common-init instead of per-app (Matt Corallo)

Pull request description:

  This resolves #12229 which pointed out a shutdown deadlock due to
  scheduler/checkqueue having been shut down while network message
  processing is still running.

Tree-SHA512: 0c0a76113996b164b0610d3b8c40b396f3e384d165bf098768e31fe3701b00763d0d810ef24702387e2e936fefb9fb900a6225f7417bb0175b585f365d542660
2020-03-23 12:42:14 +01:00
Alexander Block
cf1f8c3825
Support devnets in mininode (#3364) 2020-03-23 10:58:17 +01:00
Alexander Block
f7ddee13a1
Fix possible segfault (#3365)
When CheckActiveState is called very early, there might be no chain yet.
2020-03-21 13:31:09 +01:00
Alexander Block
0635659288 Connect all nodes to node1 in llmq-chainlocks.py 2020-03-21 13:30:35 +01:00
Alexander Block
51dda92a12 Bump mocktime after reconnecting nodes 2020-03-21 12:21:25 +01:00
Alexander Block
2a6465a6fb Move LLMQ connection retry timeout into chainparams 2020-03-21 12:21:09 +01:00
Alexander Block
40cdfe8662
Add peer id to "socket send error" logs (#3363) 2020-03-21 11:33:37 +01:00
Alexander Block
71e57a25fa Add masternode flag to result of getpeerinfo 2020-03-20 17:16:49 +01:00
Alexander Block
31825146a3 Don't relay anything to fMasternode connections
This reduces traffic on these connections to PS and DKG/LLMQ traffic only.
2020-03-20 17:16:49 +01:00
Alexander Block
f4f57fbb63 Pass fMasternode variable in VERSION so that the other end knows about it 2020-03-20 17:16:49 +01:00
Alexander Block
458a63736d Track last outbound connection attempts in CMasternodeMetaMan
Instead of relying on CAddrMan, which only works well for addresses
announced in P2P networking (and not with MNs).
2020-03-20 17:16:24 +01:00
Alexander Block
93ed22b239 Logging for outgoing masternode connections 2020-03-20 17:16:24 +01:00
Alexander Block
35d75b19e6 Make pending masternode queue proTxHash based
Instead of CService
2020-03-20 17:16:24 +01:00
Alexander Block
0adef2cf7a Fix ThreadOpenMasternodeConnections to not drop pending MN connections
The way it was implemented caused vPendingMasternodes entries to be popped
but not necessarily connected to when at the same time quorum connections
were pending.
2020-03-20 17:16:24 +01:00
Alexander Block
0fa2e14065
Fix issues introduced with asynchronous signal handling (#3369)
* Introduce SynchronousUpdatedBlockTip signal

This version of UpdatedBlockTip mirrors the asynchronous behavior that we
had before the introduction of asynchronous signal handling.

* Fix tab spacing in validationinterface.cpp

* Invoke CDeterministicMNManager::UpdatedBlockTip from validation thread

It must be invoked synchronously as otherwise things become inconsistent.

* Call CActiveMasternodeManager::Init with block index

pindexNew in UpdatedBlockTip is not necessarily the current tip, so we
shouldn't rely on it in Init(). This is due to the async nature of the
UpdatedBlockTip invocation.
2020-03-20 19:11:54 +03:00
UdjinM6
b188c5c25e
Refactor some PrivateSend related code to use WalletModel instead of accessing the wallet directly from qt (#3345)
* Use item data to figure out PS rounds for the input selected in CoinControl dialog

* Access GetRealOutpointPrivateSendRounds through WalletModel in CoinControl dialog

Instead of accessing the walet directly

* Make OverviewPage::privateSendStatus() mockable

GetTimeMillis() -> GetTime()

* Refactor PS related code in overviewpage to access wallet via wallet model
2020-03-20 01:48:24 +03:00
UdjinM6
9efa0e3d82
Merge pull request #3361 from PastaPastaPasta/backports-0.16-pr11
Backports 0.16 pr11
2020-03-20 01:47:53 +03:00
UdjinM6
7334888122
Merge pull request #3360 from PastaPastaPasta/backport-upstream
Backport upstream
2020-03-20 01:47:23 +03:00