Commit Graph

18853 Commits

Author SHA1 Message Date
UdjinM6
8e9c159e81
refactor: Add spork helpers in corresponding modules (#3859)
* Introduce AreChainLocksEnabled()

Also rename isSporkActive to isEnabled

* Introduce AreSuperblocksEnabled()

* Introduce RejectConflictingBlocks()

* Introduce IsQuorumDKGEnabled()
2020-12-09 20:33:09 +00:00
dustinface
3e4a2be018
wallet|init: Fix forcing -disablewallet if -masternodeblsprivkey is set (#3858)
Prior to this `-disablewallet` is getting forced after the UI has been initialised if a `-masternodeblsprivkey` is set. This leads to the application running with a "Wallet UI" with undefined behaviour and not with the the expected "Node only UI".
2020-12-09 20:29:31 +00:00
UdjinM6
517c0a5f31
interfaces: Add isSpendable wallet interface method that accepts CScript-s (#3857)
This fixes masternode list tab which would not show "my masternodes" correctly otherwise.
2020-12-09 20:28:20 +00:00
UdjinM6
0e94899789
scripted-diff: Rename bls benchmarks (#3855)
-BEGIN VERIFY SCRIPT-
sed -i."" 's/BLSVerify/BLS_Verify/g' src/bench/bls.cpp
sed -i."" 's/BLSPubKey/BLS_PubKey/g' src/bench/bls.cpp
sed -i."" 's/BLSSecKey/BLS_SecKey/g' src/bench/bls.cpp
sed -i."" 's/BLSSign_Normal/BLS_Sign_Normal/g' src/bench/bls.cpp
-END VERIFY SCRIPT-
2020-12-09 20:24:52 +00:00
UdjinM6
55818dcd01
Use std::bind and std::ref for Dash-specific scheduler tasks too (#3854)
More of 9605 from #2682
2020-12-09 20:23:36 +00:00
UdjinM6
f13852e662
PrivateSend: Harden SPORK_22_PS_MORE_PARTICIPANTS (#3860) 2020-12-09 20:00:08 +00:00
UdjinM6
88d54054f9
zmq: Send islock notifications for txes received after their islocks were received (#3852)
* Send islock notifications for txes received after their islocks were received

Also drop UpdateWalletTransaction - its name makes no sense and it's only used once.

* tests: early islocks should trigger notifications once a corresponding tx is received

* Tweak tests

- fail if an unexpected islock is received
- drop unused variable

* llmq: Drop `c_str()` in two log statements

* test: Move create_islock to DashTestFramework in test_framework.py

Just because it's used the same way in two files

* test: Simplify send tx in zmq test

* format

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-12-09 19:52:11 +00:00
dustinface
606299a773
qt: Fix the direction of some arrows in light theme (#3851) 2020-12-09 19:48:10 +00:00
UdjinM6
adee9504a6
tests: Fix a couple of rare mnsync issues (#3847)
* tests: Bump mocktime in smaller intervals while (not) signaling

This is needed to avoid triggering `CMasternodeSync::Reset()`.

* tests: force faucet node to finish mnsync in prepare_datadirs

* test: Drop redundant force_finish_mnsync in interface_zmq_dash.py

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-12-05 23:39:38 +00:00
UdjinM6
ba2f64a79e
IsTxSafeForMining should not fail if ChainLocks are enabled but not enforced (#3846) 2020-12-05 23:36:21 +00:00
UdjinM6
1339d7588d
bench: Fix Dash-specific benchmark logs in ConnectBlock (#3843) 2020-12-05 21:06:34 +00:00
UdjinM6
b8ad25e82e
qt: Lower the number of data samples in TrafficGraphData to make it move much smoother (#3841) 2020-12-05 21:01:22 +00:00
UdjinM6
18c4ad1468
tests: Tweak sporks.py to work with any defaults (#3842) 2020-12-01 17:48:35 +00:00
UdjinM6
548cdac180
Bring --enable-stacktraces configure option back (#3826)
Make it possible to disable stacktraces completely again. This is needed for OSes with no backtrace support e.g. Alpine Linux.
2020-12-01 04:18:46 +00:00
dustinface
3a02c6d74c
rpc|governance|test: Store prepared governance objects and implement "gobject list-prepared" (#3811)
* governance: Add CGovernanceObject::ToJson()

* rpc: Save governance objects before tx commit in gobject_prepare

* rpc: Add "gobject list-prepared"

* test: Implement tests for "gobject list-prepared"

* test: Add "feature_governance_objects.py" to BASE_SCRIPTS in test_runner

* rpc: Rename parameter: limit => count

* rpc: Rephrase "Maximal" => "Maximum"

* rpc|test: Set default count of "gobject list-prepared" to 10

* rpc: Align behaviour/message or count parameter with existing commands

* rpc|test: Reverse order of "gobject list-prepared" output
2020-12-01 03:55:29 +00:00
PastaPastaPasta
a70ea0cafd
tests: adjust some comments in interface_zmq_dash.py (#3839)
Signed-off-by: pasta <pasta@dashboost.org>
2020-11-30 17:01:31 +00:00
UdjinM6
dc3ea69f49
Fix Node::getLogCategories() to work with Dash-specific log categories (#3837)
We use top 32 bits of uint64_t for Dash-specific log categories, see logging.h
2020-11-29 17:28:14 +00:00
UdjinM6
13c1ffb345
qt: Use system default fixed pitch font for Console (#3831)
* Use system default fixed pitch font for Console

* qt: RPCConsole::messagesWidget - Directly apply the fixed pitch font

Instead of setting the font family in the stylesheet.

* qt: Introduce vecIgnoreObjects and add messagesWidget to it

Exclude messagesWidget from font updates because it should have a fixed pitch font.

* qt: Set the default consoleFontSize based on the used font

* Clamp consoleFontSize instead of ignoring invalid values

Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-11-28 19:26:40 +00:00
UdjinM6
46eddc8e03
tests: Make sure txes are actually included in blocks we mine in feature_llmq_is_retroactive.py (#3833) 2020-11-28 19:19:59 +00:00
UdjinM6
02d083616d
tests: Few trivial tweaks/cleanups (#3834)
* Convert comments into log output in feature_llmq_dkgerrors.py

* Remove llmq folder in wallet_backup.py

* There is no `-blockmaxweight` option in Dash
2020-11-28 19:18:01 +00:00
UdjinM6
071ec6c4fc
tests: Let mine_quorum handle expected connections count based on spork21 state (#3832) 2020-11-28 19:16:31 +00:00
UdjinM6
b2cc7a8c96
rpc: Add submit option to protx register(_fund) RPC commands (#3830)
Setting `submit` to `false` will force these RPCs to return raw tx hex instead of sending it to the network.
2020-11-28 19:14:29 +00:00
UdjinM6
251a9622f5
ci: Fix build matrix (#3825)
Should enable crash hooks, not stacktraces.
2020-11-28 19:08:30 +00:00
UdjinM6
757c99eb20
evo/llmq/spork: Fix various (potential) locking issues (#3829)
* Fix potential deadlock in `CSporkManager::UpdateSpork()`

* Protect `inputRequestIds` with cs lock

* Protect `curDBTransaction` in `CEvoDB::CommitRootTransaction()`

* Check for `AssertLockNotHeld` in `EnforceBestChainLock()` instead of just having a comment in code

* Protect spork maps on (de)serialization
2020-11-28 19:06:51 +00:00
UdjinM6
ff1ecb67f1
rpc: Fix "help" rpc (#3835)
Fix "subcommand" param name and description, add "subcommand" to named args list
2020-11-28 19:03:48 +00:00
UdjinM6
3b48c96784
Fix a couple of issues with -rescan (#3828)
* Update key metadata when we find a key which appears to be used earlier than we expected

* Introduce second mode for `-rescan` to be able to rescan from genesis block

* Add `-rescan=2` option to Repair tab

* Expose `nTimeFirstKey` in `CreateWalletFromFile` logs and in `getwalletinfo` rpc

* fix: check `pIndex != nullptr`

* Ignore incorrect -rescan values
2020-11-27 17:59:07 +03:00
dustinface
b43f8da53e
qt: MasternodeList - Introduce column enum and fix column sorting (#3822)
* qt: Introduce columns enum in masternode list

* qt: Add CMasternodeListWidgetItem to fix sorting in some columns

* Sort Service column properly too

* qt: Make CMasternodeListWidgetItem a template class

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-11-27 17:56:57 +03:00
dustinface
6bf130951f
wallet: Add methods to store governance objects (#3810)
* wallet: Add methods to store governance objects in the walletdb

* wallet: Cache all governance objects in m_gobjects + load them on start

* wallet: Assert cs_wallet is locked in LoadGovernanceObject

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* wallet: Extend a comment

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2020-11-27 17:56:27 +03:00
dustinface
90f7d7ff2a
test: Implement tests for all dash related ZMQ notifications (#3804)
* test: Add more C++ representing classes in message.py

* test: Add interface_zmq_dash.py

* test: Add interface_zmq_dash.py to BASE_SCRIPTS in test_runner.py

* test: Adjust hashrecoveredsig parsing

* Force node0 to finish syncing

* Avoid `uint256_to_string(uint256_from_str())`

* Be more specific in imports

* Plural for "publisher" when makes sense

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-11-27 17:55:28 +03:00
PastaPastaPasta
e72164e719
rpc: implement whitelist for commands needed by Dash Platform (#3738)
* implement whitelist for commands needed by Dash Platform

Signed-off-by: pasta <pasta@dashboost.org>

* Add test for platform command filtering

Signed-off-by: pasta <pasta@dashboost.org>

* Use less if statements

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* make defaultPlatformUser const

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* test: Make rpc_platform_filter.py executable

* test: Refactor tests in rpc_platform_filter.py

* minor modifications to rpc_platform_filter.py

Signed-off-by: pasta <pasta@dashboost.org>

* test: Expand test cases in rpc_platform_filter.py

* rpc: Use std::map instead of std::vector for platformAllowedCommands

* rpc: Improve readability and be more specific about the reject reason

* rpc: Fix comment

* rpc|httprpc: Rename RPC_PROTECTED_COMMAND to RPC_PLATFORM_RESTRICTION

* minor modifications to server.cpp

Signed-off-by: pasta <pasta@dashboost.org>

* add help text

Signed-off-by: pasta <pasta@dashboost.org>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: xdustinface <xdustinfacex@gmail.com>
2020-11-24 02:39:50 +01:00
UdjinM6
70788f385c
Fix a crash when a new devnet is started/joined (#3823) 2020-11-20 03:12:39 +01:00
UdjinM6
72104c96ba
rpc: Show devnet name in getblockchaininfo (#3821) 2020-11-19 19:44:33 +00:00
PastaPastaPasta
ba9f31a261
Merge pull request #3820 from UdjinM6/merge_master_0.16.1.1
Merge master 0.16.1.1 back into develop
2020-11-19 16:30:46 +00:00
UdjinM6
b28d6d5e87
Merge branch 'master' into merge_master_0.16.1.1 2020-11-19 14:57:57 +03:00
UdjinM6
ac6878ffa2
tests: Fix feature_llmq_simplepose.py and feature_llmq_signing.py (#3781)
* tests: Use lower mocktime bump value to reset masternode probes in feature_llmq_simplepose.py

Bumping `50 * 60 + 1` should be enough, see https://github.com/dashpay/dash/blob/master/src/llmq/quorums_utils.cpp#L218-L222. Bumping `60 * 60 + 1` interferes with mnsync reset, see https://github.com/dashpay/dash/blob/master/src/masternode/masternode-sync.cpp#L112-L119.

* Fix expected connection count in llmq-signing.py and llmq-simplepose.py

* Sleep a couple of seconds to let mn sync tick to happen

* Move helper functions out of run_test

* Let helper functions return expect_contribution_to_fail

* No need to check for "punished" state in test_banning

* Split mninfos in test_banning and mine_quorum into "online" and "valid" sets

Needed for wait_for_masternode_probes in mine_quorum. Also, refactor and fix test_banning while at it.
2020-11-19 14:42:35 +03:00
UdjinM6
b42f2d3c9c
Merge pull request #3774 from UdjinM6/merge_master_0.16.0.1
Merge master 0.16.0.1 back into develop
2020-11-19 14:41:44 +03:00
dustinface
ecd8d44028
validation: Drop obsolete RewindBlockIndex declaration (#3813) 2020-11-17 20:15:00 +00:00
dustinface
e2d4276c32
rpc: Fix inconsistencies in gobject_prepare and gobject_submit (#3794)
* rpc: Fix parameter parsing in gobject_prepare() and gobject_submit()

The parameter description for those parameter declare them as "numeric". However, providing numbers there throws an rpc error prior to this commit because `get_str()` has a typecheck. Using `ParseInt32V`, `ParseInt64V` and `getValStr` fixes this issue with backwards compatibility i.e. it accepts integer strings and plain integers.

* rpc: Fix some parameter names in gobject_prepare() and gobject_submit()
2020-11-17 20:04:02 +00:00
UdjinM6
fa4d993a71
Backport #17249: rpc: Add missing deque include to fix build (#3815)
a5929130223973636f3fd25fbfaf2953f2ec96a9 http: add missing header bootlegged by boost < 1.72 (Jan Beich)

Pull request description:

  Regressed by boostorg/filesystem@9a14c37d6f. See [error log](https://github.com/bitcoin/bitcoin/files/3772177/bitcoin-0.18.1.log).

  ```c++
  httpserver.cpp:74:10: error: no template named 'deque' in namespace 'std'
      std::deque<std::unique_ptr<WorkItem>> queue;
      ~~~~~^
  ```

ACKs for top commit:
  laanwj:
    ACK a5929130223973636f3fd25fbfaf2953f2ec96a9

Tree-SHA512: fb0aee6a698c7aaa6a73baad7adc4f891be573af0d3cf6f4f59bc825afe5c0bc439c668077ff1990a6135522a0533a1a867430eebad28f0ade93fd79a95e179b

Co-authored-by: Wladimir J. van der Laan <laanwj@protonmail.com>
2020-11-17 22:46:07 +03:00
UdjinM6
ddf7355c3e
qt: add shortcuts for tabs in more dialogs (#3764)
* Turn class members of QButtonGroup type into pointers, fix includes

* Move `BitcoinGUI::updateToolBarShortcuts()` into `GUIUtil::updateButtonGroupShortcuts()`

* Use `GUIUtil::updateButtonGroupShortcuts()` for tab buttons in options, rpcconsole and sign/verify dialog
2020-11-17 22:45:22 +03:00
dustinface
7884b62f28
zmq|validationinterface|llmq: Implement recovered signature notifications (#3803)
* zmq: Add notifier for recovered signatures

* validationinterface: Add and connect NotifyRecoveredSig signal

* llmq: Notify about recovered signatures

* zmq: Reverse byte order of msgHash in NotifyRecoveredSig

* doc: Add hashrecoveredsig and rawrecoveredsig in zmq.md

* init: Add recovered sig options in "ZeroMQ notification" section

* init: LLMQ's -> LLMQs

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>

Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2020-11-17 20:41:30 +01:00
dustinface
e7c91558d3
test: Add and use uint256_to_string + improve some hash/string conversions (#3800)
* test: Introduce uint256_to_string

* test: Use uint256_to_string in some places

* Avoid converting back and forth, reuse known string represntations of hashes for blocks and txes instead of converting sha256

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-11-17 20:40:15 +01:00
UdjinM6
f720e46d2c
Merge pull request #3806 from PastaPastaPasta/backports-0.17-pr22
Backports 0.17 pr22
2020-11-17 22:38:25 +03:00
MarcoFalke
16a4608347
Merge #13082: Tests: don't test against min relay fee information in mining_prioritisetransaction.py
bd9d67b752 Don't test against min relay fee information in mining_prioritisetransaction.py (Kristaps Kaupe)

Pull request description:

  Follow-up on #13032.

  As advised by @MarcoFalke.

Tree-SHA512: a690ff2e6499b0b4ee6a952c849e363738b9a5ae553266e1780fc7910a6b01e240d71b434fe87da53dc43f6e26cec23a900ec16aab64bb8f6765c26d7aa37c56
2020-11-17 14:34:34 -05:00
Wladimir J. van der Laan
1f9bf1c7cc
Merge #13032: Output values for "min relay fee not met" error
1accfbc Output values for "min relay fee not met" error (Kristaps Kaupe)

Pull request description:

  It is already done this way for "mempool min fee not met" error.

Tree-SHA512: 829db78ecc066cf93b8e93ff1aeb4e7b98883cf45f341d5be6e6b4dff4135f3f54fa49b3a6f12eb43f676a9ba54f981143c9887f786881e584370434a9566cfd
2020-11-17 14:34:34 -05:00
Wladimir J. van der Laan
90038da3d9
Merge #13022: [qa] Attach node index to test_node AssertionError and print messages
80a5e59 [qa] Attach node index to test_node AssertionError and print messages (James O'Beirne)

Pull request description:

  In the midst of fighting with https://github.com/bitcoin/bitcoin/pull/12873 it became apparent that there're a number of assertions and print statements which are emitted by test nodes but don't identify the node in question. This change makes debugging a bit easier by adding identifying information to non-logger test_node-related error messages.

Tree-SHA512: 7cc86f2c81f4b3fdba15ec9a2d21a84c4b083629e845e82288087c3affbbdc5c68e74067621856cc97fe84fbc8cb4f5ca4977a51ef381e5d74515df8eb001239

fix 13022

Signed-off-by: pasta <pasta@dashboost.org>
2020-11-17 14:34:34 -05:00
MarcoFalke
4d10091cc8
Merge #13055: qt: Don't log to console by default
aee80b0ef9 qt: Don't log to console by default (Wladimir J. van der Laan)

Pull request description:

  Default `-printtoconsole` to false for the GUI. GUI programs should not print to the console unnecessarily. For example, when launched by the window manager, the output might end up in the X session log file,
  resulting in duplicate logging. On Windows, it is pointless as well because bitcoin-qt isn't a console application.

  This same mechanism is used to set `-server` to true by default for bitcoind: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L116

  (fixes #13004)

Tree-SHA512: 24ae460d9d97130a063f7bf7fa6da1e6cc46643a94ea0827aa64d0f4a80647e5e7394695b24ea0f49a147a1fa07329659d224f04511fc24b97a9869d1c29b890
2020-11-17 14:34:34 -05:00
Wladimir J. van der Laan
032dca5983
Merge #12885: Reduce implementation code inside CScript
54a5a21 [MOVEONLY] Turn CScript::GetOp2 into a function and move to cpp (Pieter Wuille)
6a7456a [MOVEONLY] Move CSCript::FindAndDelete to interpreter (Pieter Wuille)
33a8ecf Delete unused non-const-iterator CSCript::GetOp overloads (Pieter Wuille)
2fb168b Make iterators in CScript::FindAndDelete const (Pieter Wuille)

Pull request description:

  This PR moves `FindAndDelete` and `GetOp2` out of CScript (the first is only used inside the interpreter and moved there, the second does not actually depend on any script specifics and works on any vector). Furthermore, all non-const-iterator versions of GetOp are replaced by const ones, removing a number of methods in the process.

  The longer term goal here is making the script interpreter independent from the CScript representation.

  Note for reviewers: both `FindAndDelete` and `GetScriptOp` are consensus critical.

Tree-SHA512: c4ccf91c0b33c37cff0d474aa8dd2dab25b5b7655e2ed69a9b15e29daf0a67b21d51c23e1defb3a72ec762bd6138de96f69c6db1fb9c1fe1e976e421261aedb7

Ensure change is move only

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

fix assign_to

Signed-off-by: pasta <pasta@dashboost.org>
2020-11-17 14:34:32 -05:00
Wladimir J. van der Laan
ca0cdbfbe8
Merge #13030: [bugfix] [wallet] Fix zapwallettxes/multiwallet interaction.
1f83839 [wallet] [tests] Test disallowed multiwallet params (John Newbery)
3476e3c [wallet] Fix zapwallettxes/multiwallet interaction. (John Newbery)

Pull request description:

  `-zapwallettxes` should be disallowed when starting bitcoin in multiwallet mode.

  There's code in `WalletInit::ParameterInteraction()` to disallow `-zapwallettxes` when running in multiwallet mode. This code functioned as expected when passing the parameter `-zapwallettxes=1`, but not when passing the parameter `-zapwallettxes` (ie without the value specified). Fix that and add a test.

  The new test in the
  _[wallet] [tests] Test disallowed multiwallet params_ commit reproduces the bug and should fail against master.

  Fixes #12505

Tree-SHA512: 6cd921717e9c7d2773ca84c946c310c2adec8430e37cbecdb33a620f510db3058a72bd328411812ba415111bc52a3367b332c9d15a37a92ccfd7ae785d2f32ab
2020-11-17 14:32:37 -05:00
Wladimir J. van der Laan
b784f869f9
Merge #12448: Interrupt block generation on shutdown request
0851a75 rpc: Interrupt block generation on shutdown request (João Barbosa)

Pull request description:

  With this simple change, after running `bitcoin-cli -regtest generate 100000`, it is possible to interrupt `bitcoind` cleanly without waiting for the generation to complete.

Tree-SHA512: f0f7cdde242e595cfdaea31ae8bddbc25933621b63f639e813d272c2b00ce2ef52f0c14ae44954ba8c49f0fc846bcc3bfd5419e52b3347a68bb0341ce6b02d26
2020-11-17 14:32:37 -05:00