Commit Graph

15952 Commits

Author SHA1 Message Date
MarcoFalke
914bd78770 Merge #9972: Fix extended rpc tests broken by #9768
d055bd6 Fix extended rpc tests broken by 8910b4717e (John Newbery)

Tree-SHA512: 30e019bd7e17013143e419777491ac0efd9760dddac7232d320c9afe80bc2fb383acd331e20cd5b3e21df1177c0e4a5221c99f831e90cf869d3affca206b9728
2019-02-26 16:41:00 -06:00
MarcoFalke
dad8c67d38 Merge #9768: [qa] Add logging to test_framework.py
64c0800 Use logging in individual tests (John Newbery)
38ad281 Use logging in test_framework/comptool.py (John Newbery)
ff19073 Use logging in test_framework/blockstore.py (John Newbery)
2a9c7c7 Use logging in test_framework/util.py (John Newbery)
b0dec4a Remove manual debug settings in qa tests. (John Newbery)
af1363c Always enable debug log and microsecond logging for test nodes. (John Newbery)
6d0e325 Use logging in mininode.py (John Newbery)
553a976 Add logging to p2p-segwit.py (John Newbery)
0e6d23d Add logging to test_framework.py (John Newbery)

Tree-SHA512: 42ee2acbf444ec32d796f930f9f6e272da03c75e93d974a126d4ea9b2dbaa77cc57ab5e63ce3fd33d609049d884eb8d9f65272c08922d10f8db69d4a60ad05a3
2019-02-26 15:54:32 -06:00
MarcoFalke
c75d7dc832 Merge #9962: [trivial] Fix typo in rpc/protocol.h
9ea2490 [trival] Fix typo introduced into rpc/protocol.h in commit 338bf06 (practicalswift)

Tree-SHA512: bfa60dc9f40db867b09e60dbe803db79c86ff939048c91e551c0794a91428bde3aa42c4aabf915c640cd15565005608da10dae051942e806fdf5d28e9704d765
2019-02-26 15:26:01 -06:00
Wladimir J. van der Laan
49b743e39a Merge #9538: [util] Remove redundant call to get() on smart pointer (thread_specific_ptr)
53a2ba3 [util] Remove redundant call to get() on smart pointer (thread_specific_ptr) (practicalswift)

Tree-SHA512: ec8ace4218ae0657d1aaf8ba7682b0cdd140fe0844173058d3cbf4575dee8d9ad5f241e5bacf1e9e4ad3f7dd282f56a8cb0f306de2093f2c0f6333daedd58261
2019-02-26 15:25:32 -06:00
Wladimir J. van der Laan
e5c4a67a20 Merge #9916: Fix msvc compiler error C4146 (minus operator applied to unsigned type)
8e0720b Fix msvc compiler error C4146 (unary minus operator applied to unsigned type) (kobake)
292112f Fix msvc compiler error C4146 (minus operator applied to unsigned type) (kobake)

Tree-SHA512: 25f408daf7bf9ffe4b8b4bd62f6f6d326219189a9faf8f8c0a135c5a0cb0511af765aa2b6087a091c8863c701289bda49a2379b00cd9b10854d316a5c3fc3f8e
2019-02-26 15:24:31 -06:00
Nathan Marley
fcd3b4fd49 Disallow new proposals using legacy serialization (#2722)
*  add flag to allow legacy proposal format

* add proposal validator ctor flag for legacy format

* add test for legacy proposal format disabled
2019-02-26 13:44:43 +03:00
UdjinM6
668b84b1e4 Fix stacktraces compilation issues (#2721)
* Drop linux/limits.h, we don't use it anyway

* Do not require backtrace lib when enable_stacktraces=no
2019-02-26 07:01:56 +01:00
UdjinM6
0fd1fb7d57
Don't build docker image when running Travis job on some another repo (#2718) 2019-02-21 21:44:47 +03:00
Alexander Block
48d92f116e Implement optional pretty printed stacktraces (#2420)
* Add libbacktrace to depends

This is currently only useful to extract symbols. It fails to gather
stacktraces when compiled with MinGW, so we can only use it to get symbol
information from a stack trace which we gathered outside of libbacktrace.

* Add -mbig-obj to CXXFLAGS for MinGW builds

* Implement stacktraces for C++ exceptions

This is a hack and should only be used for debugging. It works by wrapping
the C++ ABI __wrap___cxa_allocate_exception. The wrapper records a backtrace
and stores it in a global map. Later the stacktrace can be retrieved with
GetExceptionStacktraceStr.

This commit also adds handlers to pretty print uncaught exceptions and
signals.

* Use GetPrettyExceptionStr for all unhandled exceptions

* Use --enable-stacktraces in CI for linux32/linux64

* Register exception translators to pretty print exceptions in unit tests

* Catch and print python exceptions when stopping nodes

Otherwise the code at the bottom is never executed when nodes crash,
leading to no output of debug.log files on Travis.

* Remove now unneeded/unused TestCrash methods
2019-02-21 21:37:15 +03:00
UdjinM6
0b552be20b
Fix file permissions broken in 2682 (#2717) 2019-02-20 12:03:48 +03:00
Duke Leto
74bb23cacf Add link to bugcrowd in issue template (#2716) 2019-02-19 13:05:59 +03:00
UdjinM6
252ee89c34
Implement new algo for quorum connections (#2710)
Instead of trying to manually figure out params for different quorum/ring sizes, connect to nodes at indexes (i+2^k)%n where k: 0..floor(log2(n-1))-1, n: size of the quorum/ring
2019-02-19 13:05:39 +03:00
UdjinM6
a79b928532
Merge pull request #2682 from PastaPastaPasta/backports-0.15-pr6
Backports 0.15 pr6
2019-02-19 13:04:49 +03:00
Alexander Block
104c6e7767 Cleanup successful sessions before doing timeout check (#2712)
Otherwise we get some false-positive timeout messages in logs.
2019-02-18 14:07:57 +03:00
Felix Yan
18f087b273 Fix some typos in doc/guide-startmany.md (#2711) 2019-02-17 14:40:24 +03:00
UdjinM6
26db020d17
Separate init/destroy and start/stop steps in LLMQ flow (#2709) 2019-02-17 14:39:43 +03:00
Alexander Block
9f58690322 Avoid using ordered maps in LLMQ signing code (#2708)
* Implement and use SigShareMap instead of ordered map with helper methods

The old implementation was relying on the maps being ordered, which allowed
us to grab all sig shares for the same signHash by doing range queries on
the map. This has the disadvantage of being unnecessarily slow when the
maps get larger. Using an unordered map would be the naive solution, but
then it's not possible to query by range anymore.

The solution now is to have a specialized map "SigShareMap" which is
indexed by "SigShareKey". It's internally just an unordered map, indexed by
the sign hash and another unordered map for the value, indexed by the
quorum member index.

* Only use unordered maps/sets in CSigSharesManager

These are faster when maps/sets get larger.

* Use unorderes sets/maps in CSigningManager
2019-02-17 14:38:56 +03:00
Pasta
bb90eb4bf0 backports-0.15-pr6 code review 2019-02-16 15:09:51 -06:00
Alexander Block
7a192e2e4c Optimize sleeping behavior in CSigSharesManager::WorkThreadMain (#2707)
* Don't sleep in WorkThreadMain when CPU intensive work was done

When the current iteration resulted in CPU intensive work, it's likely that
the next iteration will result in work as well. Do not sleep in that case,
as we're otherwise wasting (unused) CPU resources.

* No matter how fast we process sig shares, always force 100ms between sending

* Apply review suggestions
2019-02-16 19:59:48 +03:00
Alexander Block
feb4e0ac74
Merge pull request #2706 from codablock/pr_llmq_optimizations3
Implement caching in CRecoveredSigsDb
2019-02-16 15:51:24 +01:00
Alexander Block
dae1542a0e
Merge pull request #2705 from codablock/pr_llmq_optimizations2
Optimize LLMQs initialization and (de)serialization of BLS signatures
2019-02-16 15:50:23 +01:00
Alexander Block
01940616f0
Merge pull request #2704 from codablock/pr_llmq_optimizations1
Optimize LLMQs sending of sig shares
2019-02-16 15:49:19 +01:00
Alexander Block
d7bd0954f3 Use pipe() together with fcntl instead of pipe2()
pipe2 is not supported on MacOS
2019-02-15 16:30:42 +01:00
Alexander Block
742a258987 Implement caching in CRecoveredSigsDb
To avoid repeated calls into LevelDB
2019-02-15 15:52:51 +01:00
Alexander Block
500b9c89a7 Use CBLSLazySignature in CBatchedSigShares
This removes the burden on the message handler thread when many sig batches
arrive. The expensive part of deserialization is now performed in the sig
shares worker thread.

This also removes the need for the specialized deserialization of the sig
shares which tried to avoid the malleability check, as CBLSLazySignature does
not perform malleability checks at all.
2019-02-15 15:44:19 +01:00
Alexander Block
02b68885a0 Implement CBLSLazySignature for lazy serialization/deserialization
In some cases it takes too much time to perform full deserialization of
BLS signatures in the message handler thread. Better to just read the
buffer and do the actual deserialization when the signature is needed for
the first time (which is can be in another thread).
2019-02-15 15:44:02 +01:00
Alexander Block
6e8f50aa55 Faster default-initialization of BLS primitives by re-using the null-hash 2019-02-15 15:43:51 +01:00
Alexander Block
c03480d20f Disable optimistic sending when pushing sig share related messages
And instead let the network thread do the actual sending.
2019-02-15 15:20:15 +01:00
Alexander Block
acb87895f8 Implement WakeupSelect() to allow preliminary wakeup after message push
This adds the reading side of a pipe to the read-set when calling select().
Writing to the writing side of the pipe then causes select() to wake up
immediately. Otherwise it would wait for the timeout of 50ms, even if there
is data that could possibly be sent.

This is useful when many messages need are pushed with optimistic send being
disabled. After all messages have been pushed, WakeSelect() can then wakeup
the select() thread and force a re-check for pending data to send.

This is currently only implemented for POSIX compliant systems as we assume
that heavy-load daemons (like masternodes) are usually run on Linux.
2019-02-15 15:19:59 +01:00
Alexander Block
cf29320988 Allow to disable optimistic send in PushMessage()
Profiling has shown that optimistic send causes measurable slowdowns when
many messages are pushed, even if the sockets are non-blocking. Better to
allow disabling of optimistic sending in such cases and let the network
thread do the actual socket calls.
2019-02-15 15:19:36 +01:00
UdjinM6
bedfc262e2 Rework handling of CSigSharesManager worker thread (#2703) 2019-02-15 15:11:50 +01:00
UdjinM6
3e4286a584 Less cs_main locks in quorums (#2702)
* Drop cs_main from CQuorumManager::UpdatedBlockTip()

* CLLMQUtils::IsQuorumActive() shouldn't require cs_main to be held

* Revert comment deletion
2019-02-15 15:11:35 +01:00
Alexander Block
3bbc75fc48 Reintroduce spork15 so that it's relayed by 0.14 nodes (#2701) 2019-02-14 21:24:06 +03:00
Alexander Block
b71a3f48da Remove not used and not implemented methods from net.h (#2700) 2019-02-12 22:52:18 +03:00
Alexander Block
c0cb274659 Fix incorrect usage of begin() when genesis block is requested in "protx diff" (#2699)
* Fix incorrect usage of begin() when genesis block is requested in "protx diff"

.begin() on mapBlockIndex does NOT return the genesis block, but just the
block with lowest hash.

The fix is to use chainActive[0] to get the genesis block.

* Update src/evo/simplifiedmns.cpp

Co-Authored-By: codablock <ablock84@gmail.com>
2019-02-12 22:52:06 +03:00
UdjinM6
b239bb24a0
Do not process blocks in CDeterministicMNManager before dip3 activation (#2698)
* Do not process blocks in CDeterministicMNManager before dip3 activation

This should save us some cpu/disk on initial sync/reindex

* Write initial snapshot on dip3 activation
2019-02-12 22:51:50 +03:00
UdjinM6
86fc050495
Drop no longer used code and bump min protos (#2697)
* Drop registry deletion of the old key

* Drop no longer used CGovernanceObjectVoteFile::RemoveOldVotes()

* Drop temporary disconnect code and bump min protos to 70213

* drop comment

* fix
2019-02-12 22:51:21 +03:00
UdjinM6
fef8e5d45f
A small overhaul of the way MN list/stats UI and data are tied together (#2696)
* Do not access wallet directly from masternodelist ui, use wallet model instead

* Don't access deterministicMNManager from UI directly, use client model instead

* Send just a general signal to UI elements when mn list has changed and let them handle it in their specific ways

* Drop mn list update timers and use signals instead

* some cleanup

* Move initial UI update to init.cpp

* Refactor getMasternodeList()

* Rename setMasternodeCount to updateMasternodeCount

* Drop legacy code in comments

* Drop NotifyMasternodeListChanged from uiInterface and use NotifyBlockTip instead
2019-02-12 22:51:03 +03:00
UdjinM6
709ab6d3e0
Minimal fix for litemode vs bad-protx-key-not-same issue (#2694) 2019-02-12 22:50:22 +03:00
PastaPastaPasta
90bb3ca2f6 Backport #14701: build: Add CLIENT_VERSION_BUILD to CFBundleGetInfoString (#2687)
8e209340c85fc2493d7d1d7affe7e316bb613cbd build: Add CLIENT_VERSION_BUILD to CFBundleGetInfoString (fanquake)

Pull request description:

  As mentioned in #14697, if you download the `0.17.0.1` dmg, and inspect the `.app` bundle, the version in the GetInfo string reads `0.17.0`, which is confusing given you're expecting `0.17.0.1`:
  <img width="391" alt="0 17 0 1" src="https://user-images.githubusercontent.com/863730/48300032-fbb54b00-e510-11e8-9bcd-77e1fffffc63.png">

  This PR adds `CLIENT_VERSION_BUILD` to the string, so that the full version number is displayed, i.e:
  <img width="327" alt="this pr" src="https://user-images.githubusercontent.com/863730/48300015-7893f500-e510-11e8-98b9-80424719a082.png">

Tree-SHA512: f553253d03283639cc4dda00c8004b5c63ae2b489762e5e8c666166e71b14e672792c1df678f87484d51d153b5781c5ec1b145774096600f504833024ae8baea
2019-02-12 22:50:07 +03:00
UdjinM6
bac6661553 Release notes v0.13.1.0 (#2689)
* Release notes v0.13.1.0

* Add a note about no proto bump

* update

* Add a note about downgrading to 0.13.0.0

* 0.13.0.0->0.13.1.0

Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>
2019-02-07 14:48:50 +01:00
Alexander Block
68a2d8a8d2
Merge pull request #2688 from codablock/pr_v13_backports
[0.13.x] Backport multiple PRs from develop
2019-02-07 14:30:43 +01:00
UdjinM6
da5a861c0f Change the way invalid ProTxes are handled in addUnchecked and existsProviderTxConflict (#2691)
* Invalid ProTxes should never reach addUnchecked

* Invalid ProTxes should not cause existsProviderTxConflict to crash
2019-02-06 17:58:20 +01:00
Alexander Block
6ada90c11c Call existsProviderTxConflict after CheckSpecialTx (#2690)
Otherwise we might end up passing and invalid proTx into it, causing
assertions to fail and thus crash the process.
2019-02-06 17:58:18 +01:00
UdjinM6
00f904ec77 Change the way invalid ProTxes are handled in addUnchecked and existsProviderTxConflict (#2691)
* Invalid ProTxes should never reach addUnchecked

* Invalid ProTxes should not cause existsProviderTxConflict to crash
2019-02-06 17:57:27 +01:00
Alexander Block
5478183e7e
Call existsProviderTxConflict after CheckSpecialTx (#2690)
Otherwise we might end up passing and invalid proTx into it, causing
assertions to fail and thus crash the process.
2019-02-06 17:54:10 +01:00
UdjinM6
23eb70cb77 Add getspecialtxes rpc (#2668)
* Add getspecialtxes rpc

Returns an array of special transactions found in the specified block

* small help text tweak

* add comments
2019-02-06 11:27:48 +01:00
Alexander Block
34dee23386
Merge pull request #2685 from codablock/pr_v13_backports
[0.13.x] Backport multiple PRs from develop
2019-02-06 06:11:43 +01:00
UdjinM6
bd0de48762 Bump version to 0.13.1 (#2686) 2019-02-06 06:11:16 +01:00
UdjinM6
023f8a01ae Fix bench log for payee and special txes (#2678) 2019-02-05 20:57:35 +01:00