Skip to content

Conversation

@knst
Copy link
Collaborator

@knst knst commented Apr 30, 2024

Issue being fixed or feature implemented

Many rpc such as protx register uses forcely LegacyScriptPubKeyMan instead using CWallet's interface.
It causes a failures such as

test_framework.authproxy.JSONRPCException: This type of wallet does not support this command (-4)

for all functional tests that uses Masternodes/evo nodes.

See https://github.com/dashpay/dash-issues/issues/59 to track progress

What was done?

Some direct usages of LegacyScriptPubKeyMan refactored to use CWallet's functionality.
There are still 4 functional tests that doesn't work for descriptor wallets:

  • feature_dip3_deterministicmns.py (no rpc protx updateregistar)
  • feature_governance.py: no rpc for governance votemany and governance votealias
  • interface_zmq_dash.py (see governance)

That's part I of changes, other changes are not PR-ready yet, WIP.

How Has This Been Tested?

Firstly, the flag --legacy-wallets are removed for many functional tests.
Secondly, the flag --descriptors is inverted in default value:

diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py
index 585a6a74d6..9ad5fd1daa 100755
--- a/test/functional/test_framework/test_framework.py
+++ b/test/functional/test_framework/test_framework.py
@@ -242,10 +242,10 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
 
         if self.options.descriptors is None:
             # Prefer BDB unless it isn't available
-            if self.is_bdb_compiled():
-                self.options.descriptors = False
-            elif self.is_sqlite_compiled():
+            if self.is_sqlite_compiled():
                 self.options.descriptors = True
+            elif self.is_bdb_compiled():
+                self.options.descriptors = False
             else:
                 # If neither are compiled, tests requiring a wallet will be skipped and the value of self.options.descriptors won't matter
                 # It still needs to exist and be None in order for tests to work however.

Breaking Changes

N/A, descriptor wallets have not been publicly released yet

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

@knst knst added this to the 21 milestone Apr 30, 2024
@knst knst mentioned this pull request May 3, 2024
5 tasks
PastaPastaPasta added a commit that referenced this pull request May 3, 2024
10869ff fix: order of locks cs_wallet and cs_main in rpc/evo (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Changing order of locking `cs_main` and `cs_wallet` to prevent a deadlock.

  There's call `protx_list` -> `BuildDMNListEntry` -> `CheckWalletOwnsScript`:
  ```
  return WITH_LOCK(pwallet->cs_wallet, return pwallet->IsMine(script)) == isminetype::ISMINE_SPENDABLE;
  ```

  It can cause a deadlock due to wrong order of locks (cs_wallet supposed to be blocked in prior of cs_main)

  ## What was done?
  This PR adds and extra lock of cs_wallet and reduce scope of cs_main for a bit

  ## How Has This Been Tested?
  Deadlock warning is reproduced with this PR: #6003

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

Top commit has no ACKs.

Tree-SHA512: 6d166fe7c47067c1c6d889d87e015ff3bc43aa9f66234341840cc8465ce00a79e7140bc09cbdb2fd08feaae5463b320e0b66bbe410422783f86cbc9d616af6b3
@github-actions
Copy link

github-actions bot commented May 3, 2024

This pull request has conflicts, please rebase.

@knst knst force-pushed the bp-descriptors-6-protx branch from 46ac531 to a25b163 Compare May 6, 2024 16:56
@knst knst changed the title feat: support protx rpc for descriptor wallets feat: support rpc protx-register for descriptor wallets May 6, 2024
@knst knst force-pushed the bp-descriptors-6-protx branch from a25b163 to b5897c7 Compare May 6, 2024 17:10
knst added 4 commits May 7, 2024 00:17
Enables for rpc_quorum.py, feature_notifications.py

see dashpay#5981, it partial revert of b20f812
That are:
 - feature_dip3_deterministicmns.py
 - interface_zmq_dash.py
 - feature_governance.py
 - wallet_upgradetohd.py (as expected to be implemented for legacy-only wallets)
 - p2p_timeouts.py (why? can not understand it)

This partially reverts commit b20f812.
@knst knst force-pushed the bp-descriptors-6-protx branch from b5897c7 to a33dcb3 Compare May 6, 2024 17:17
@knst knst marked this pull request as ready for review May 6, 2024 19:33
@knst knst requested review from PastaPastaPasta and UdjinM6 and removed request for PastaPastaPasta May 6, 2024 19:33
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK

@knst knst changed the title feat: support rpc protx-register for descriptor wallets feat: support rpc protx-register for descriptor wallets - part VI May 8, 2024
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK a33dcb3

@PastaPastaPasta PastaPastaPasta merged commit 146be9f into dashpay:develop May 14, 2024
@knst knst deleted the bp-descriptors-6-protx branch June 12, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants