Commit Graph

15797 Commits

Author SHA1 Message Date
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
Wladimir J. van der Laan
1be5a72a97
Merge #9853: Fix error codes from various RPCs
adaa281 Update release notes to include RPC error code changes. (John Newbery)
338bf06 Add commenting around JSON error codes (John Newbery)
dab804c Return correct error codes in fundrawtransaction(). (John Newbery)
a012087 Return correct error codes in setban(). (John Newbery)
960bc7f Return correct error codes in removeprunedfunds(). (John Newbery)
c119096 Return correct error codes in blockchain.cpp. (John Newbery)
6d07c62 Return correct error codes in bumpfee(). (John Newbery)

Tree-SHA512: 4bb39ad221cd8c83d98ac5d7ad642f3a8c265522720dc86b2eebc70e74439a85b06d6ddcd6a874e879d986511de3ab0878bb7fe58b50cb0546b78913632ea809
2019-02-05 13:40:40 -06:00
Wladimir J. van der Laan
1bfc069e34
Merge #9575: Remove unused, non-working RPC PostCommand signal
54fae05 Remove unreachable code (g_rpcSignals.PostCommand) (practicalswift)

Tree-SHA512: b416d63ffa1c35fa0434b6bc0a930ae1b04919a12114ef65154ce4621aa43d744eb4fc515f48eac2e96c0f528cedb4cdbe2349952d215c2c74e900a63e155e0a
2019-02-05 13:40:37 -06:00
MarcoFalke
e53da66b2b
Merge #9936: [trivial] Fix three typos introduced into walletdb.h in commit 7184e25
fdab309 [trivial] Fix typos introduced in 7184e25c80 (practicalswift)

Tree-SHA512: 091666f996267fc5d9f911e6ff25051df5c198851a9c2a6cae73692ffacc64f4275932260487aa48a224ca7f80c58f79933065c72d42aeccae540293c67bcee9
2019-02-05 13:40:35 -06:00
MarcoFalke
2121ba7764
Merge #9945: Improve logging in bctest.py if there is a formatting mismatch
6c1fb73 Improve logging in bctest.py if there is a formatting mismatch (John Newbery)

Tree-SHA512: ef33f4766df92a987cd714d73b98277616ff947ad0e43811013dda668e31464062816480bd654865231d56d37fb4d6e4ccdccbcb2f0e2f01f49572b843a232ae
2019-02-05 13:40:33 -06:00
Wladimir J. van der Laan
b1d64f3a14
Merge #9548: Remove min reasonable fee
ad82cb0 Remove unnecessary min fee argument in CTxMemPool constructor (Alex Morcos)
2a7b56c CBlockPolicyEstimator now uses hard coded minimum bucket feerate (Alex Morcos)
ac9d3d2 Change fee estimation bucket limit variable names (Alex Morcos)

Tree-SHA512: 6e3bc7df3497ed60c7620845d222063e33a0238020f5c3316e61e0eff758078588ea8dd51196ceb59aa561ba106f8cdae62cebe521adb3247108bb49f15252d6
2019-02-05 13:40:31 -06:00