Commit Graph

24710 Commits

Author SHA1 Message Date
MarcoFalke
9e5ee6ac52
Merge #20316: test: Fix wallet_multiwallet test issue on Windows
fa00ff0399fe54f42d80daa04140d19bcfe0e2d8 test: Fix wallet_multiwallet test issue on Windows (MarcoFalke)

Pull request description:

  Fixes:

  ```
  Traceback (most recent call last):
    File "test\functional\test_framework\test_framework.py", line 126, in main
      self.run_test()
    File "test/functional/wallet_multiwallet.py", line 120, in run_test
      assert_equal(sorted(map(lambda w: w['name'], self.nodes[0].listwalletdir()['wallets'])), sorted(in_wallet_dir))
    File "test\functional\test_framework\util.py", line 49, in assert_equal
      raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
  AssertionError: not(['', 'sub\\w5', 'w', 'w1', 'w2', 'w3', 'w7', 'w7_symlink', 'w8'] == ['', 'sub/w5', 'w', 'w1', 'w2', 'w3', 'w7', 'w7_symlink', 'w8'])

ACKs for top commit:
  promag:
    ACK fa00ff0399fe54f42d80daa04140d19bcfe0e2d8.

Tree-SHA512: 7a809a352677a216465cef59e866e4881272e302e897cebf7d9645bf87aebeaf54435bb0692bb5c1381c2dd680e8a34e640ea18ca6e2a4087e3233cd9c24ed04
2023-12-24 11:59:43 -06:00
Odysseas Gabrielides
25cef45858
feat(rpc): gettxchainlocks should return mempool=false when tx not in mempool (#5742)
## Issue being fixed or feature implemented
Platform (in the scope of Withdrawals) need to be aware if a tx isn't in
mempool when requesting status of a tx using RPC `gettxchainlocks`.
cc @markin-io

## What was done?

- mempool is passed to `GetTransaction` and saving the result for
checking latter.
- If the returned tx_ref is nullptr, then the RPC returns null for the
corresponding tx in the array.

Example: 
`tx1` is mined and chainlocked, `tx2` is in mempool and `tx3` doesn't
exist.
The result now is:
`[
  {
    "height": 830,
    "chainlock": false,
    "mempool": true
  },
  {
    "height": -1,
    "chainlock": false,
    "mempool": true
  },
  {
    "height": -1,
    "chainlock": false,
    "mempool": false
  }
]`

## How Has This Been Tested?


## Breaking Changes


## 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 _(for repository
code-owners and collaborators only)_

---------

Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-12-24 11:58:14 -06:00
Odysseas Gabrielides
563cc34b4e
feat(rpc): Asset Unlock status by index (#5776)
## Issue being fixed or feature implemented
Platform in the scope of credit withdrawals, need a way to get the
status of an Asset Unlock by index.

## What was done?
A new RPC was created `getassetunlockchainlocks` that accepts Asset
Unlock indexes array as parameter and return corresponding status for
each index.

The possible outcomes per each index are:
- `chainlocked`: If the Asset Unlock index is mined on a Chainlocked
block.
- `mined`: If no Chainlock information is available, and the Asset
Unlock index is mined.
- `mempooled`: If the Asset Unlock index is in the mempool.
- `unknown`: If none of the above are valid.

Note: This RPC is whitelisted for the Platform RPC user.

## How Has This Been Tested?
Inserted on `feature_asset_locks.py` covering cases where Asset Unlock
txs are in mempool, mined and not present.

## Breaking Changes
no

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

---------

Co-authored-by: thephez <thephez@users.noreply.github.com>
Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: pasta <pasta@dashboost.org>
2023-12-22 14:27:00 -06:00
Konstantin Akimov
b5dc598525
chore: add builder key for knst (#5786)
## What was done?
Add builder key for @knst 

## How Has This Been Tested?
It is the same file with:
https://github.com/dashpay/guix.sigs/blob/master/builder-keys/knst.pgp
Checked a signature of guix.sigs for 20.0.2: `gpg --status-fd 1 --verify
20.0.2/knst/codesigned.SHA256SUMS.asc` - matched.


## 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
2023-12-22 14:16:45 -06:00
UdjinM6
7724eb4f03
fix: ScanQuorums should not start cache population for outdated quorums (#5784)
## Issue being fixed or feature implemented
Cache population for old quorums is a cpu heavy operation and should be
avoided for inactive quorums _at least_ oin `ScanQuorums`. This issue is
critical for testnet and other small network because every mn
participate in almost every platform quorum and cache population for 2
months of quorums can easily block everything for 15+ minutes on a 4 cpu
node. On mainnet quorum distribution is much better but it's still a
small waste of cpu (or not so small for unlucky nodes).

#5761 follow-up

## What was done?
Do not start cache population for outdated quorums, improve logs in
`StartCachePopulatorThread` to make it easier to see what's going on.

## How Has This Been Tested?
run a mn on testnet

## 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 _(for repository
code-owners and collaborators only)_
2023-12-22 13:56:43 -06:00
PastaPastaPasta
9bdb7464a1
Merge pull request #5762 from knst/bitcoinserver-15639-p2
refactor: pull libbitcoin_server (governance) code out of wallet code 4/N
2023-12-21 23:05:12 -06:00
Konstantin Akimov
b2ad5302ce
refactor: simplify comparator in rpc/governance 2023-12-21 23:04:44 -06:00
Konstantin Akimov
4083fff0b2
refactor: drop circular dependency governance/object <-> governance/validators 2023-12-21 23:04:43 -06:00
Konstantin Akimov
2bb6361dc0
cleanup: removed unused definitions from governance/object.h 2023-12-21 23:04:43 -06:00
Konstantin Akimov
7e13727738
refactor: drop circular dependency validationinterface <-> governance/object 2023-12-21 23:04:43 -06:00
Konstantin Akimov
4de30f4b61
refactor: a default constructor for Governance::Object 2023-12-21 23:04:42 -06:00
Konstantin Akimov
64a153d634
refactor: untie governance/object and wallet implementation 2023-12-21 23:04:40 -06:00
PastaPastaPasta
78a69043c6
Merge pull request #5753 from knst/refactor-llmq_vbc
refactor: drop usages of llmq/utils to check if hard-fork is active
2023-12-21 23:03:12 -06:00
Konstantin Akimov
42e65f4541 chore: remaining TODO goes to other PRs 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c3c9ccf261 refactor: drop global variable fDIP0001ActiveAtTip - partial implementation
Impossible to drop it completelly right now because:
 - net doesn't know any details about chain - can't check status of fork
 - the functional test feature_maxuploadtarget.py assume block size 1Mb
 - DIP0001 can't be activated from regtest early block2 because big txes are
 not allowed after DIP0001

refactor: drop global variable fDIP0001ActiveAtTip - attempt 2
2023-12-21 23:02:31 -06:00
Konstantin Akimov
1b3237d147 fix: remove unused cs_main lock from src/miner.cpp - it's not used by EHF logic anymore 2023-12-21 23:02:31 -06:00
Konstantin Akimov
f57859f777 refactor: drop llmq_versionbitscache in favor of g_versionbitscache
Note: g_versionbitscache is reset in UnloadBlockIndex()
2023-12-21 23:02:31 -06:00
Konstantin Akimov
917089d542 refactor: drop public llmq::utils::IsV20Active method 2023-12-21 23:02:31 -06:00
Konstantin Akimov
bc0f0bf852 chore: removed TODO for TESTNET_LLMQ_25_67_ACTIVATION_HEIGHT so far as have no idea why it is not matching with v19 activation 2023-12-21 23:02:31 -06:00
Konstantin Akimov
70fa626381 refactor: drop dependency validation on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
db4379348c refactor: drop dependency miner on llmq::utils::IsV20Active 2023-12-21 23:02:31 -06:00
Konstantin Akimov
5d4b16a783 refactor: drop public method llmq::utils::IsV19Active 2023-12-21 23:02:31 -06:00
Konstantin Akimov
55abf7fa8d refactor: drop dependency test/evo_deterministicmns_tests on llmq::utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
ad4d753bd7 refactor: use DeploymentActiveAfter in llmq/blockprocessor 2023-12-21 23:02:31 -06:00
Konstantin Akimov
1ed7f0cca4 refactor: use DeploymentActiveAfter instead llmq::utils in rpc/ 2023-12-21 23:02:31 -06:00
Konstantin Akimov
39dc612eee refactor: drop dependency test/util/setup_common on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c4d634c051 refactor: use DeploymentActiveAfter in init.cpp 2023-12-21 23:02:31 -06:00
Konstantin Akimov
7bce9d8209 refactor: use CFinalCommitment::GetVersion in llmq/{commitment,dkgsession} 2023-12-21 23:02:31 -06:00
Konstantin Akimov
9aa437115a refactor: use DeploymentActiveAfter in evo/mnauth 2023-12-21 23:02:31 -06:00
Konstantin Akimov
2128d58b4f refactor: use DeploymentActiveAfter in cbtx 2023-12-21 23:02:31 -06:00
Konstantin Akimov
488c895a65 refactor: use DeploymentActiveAfter in ehf_signals 2023-12-21 23:02:31 -06:00
Konstantin Akimov
377d929edc refactor: drop dependency evo/simplifiedmns on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c742b9acf5 refactor: drop unused llmq::utils::IsMNRewardReallocationActive 2023-12-21 23:02:31 -06:00
Konstantin Akimov
a79aa56d9b refactor: move out helper IsDIP3Enforced from deterministicmns 2023-12-21 23:02:31 -06:00
Konstantin Akimov
5a84eb0f0a refactor: drop default value from IsDIP3Enforced() 2023-12-21 23:02:31 -06:00
Konstantin Akimov
f7274c450b refactor: use deployment status in deterministicmns instead llmq's helpers 2023-12-21 23:02:31 -06:00
Konstantin Akimov
13adedb423 refactor: move common code in deterministicmns to the helper 2023-12-21 23:02:31 -06:00
Konstantin Akimov
251a89736d refactor: rename argument pindex to pindexPrev in GetMNPayee and GetProjectedMNPayees 2023-12-21 23:02:31 -06:00
Konstantin Akimov
82c01ea664 refactor: drop dependency creditpool on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
e94f5753c9 refactor: drop dependency of specialtxman on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
bacaa805ea fix: use proper pindex/pindex->pprev in credit pool code during v20/mn_rr activations 2023-12-21 23:02:31 -06:00
Konstantin Akimov
f3d2f2da26 refactor: drop dependency unit test block_reward_reallocation_tests on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c25d336e95 refactor: drop dependency masternode/payments on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
8f3d3db9a4 refactor: drop dependency governance/classes on llmq/utils 2023-12-21 23:02:31 -06:00
Konstantin Akimov
c329615584 refactor: use value_or in std::optional 2023-12-21 23:02:31 -06:00
Konstantin Akimov
a7ad399824 refactor: drop IsDIP0024Active and its usage of llmq_vbc 2023-12-21 23:02:31 -06:00
Konstantin Akimov
68442e8dfe chore: add TODO for llmq/utils.h refactoring 2023-12-21 23:02:31 -06:00
PastaPastaPasta
3855f9775e
chore: do not include dash-qt in the docker images (#5775)
## Issue being fixed or feature implemented
Remove dash-qt from docker images; save ~41MB

## What was done?


## How Has This Been Tested?
Hasn't

## Breaking Changes
I guess in theory someone could've been relying on dash-qt from docker 🤷

## Checklist:
_Go over all the following points, and put an `x` in all the boxes that
apply._
- [ ] 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 _(for repository
code-owners and collaborators only)_
2023-12-21 21:59:01 -06:00
PastaPastaPasta
acd2acd592
refactor: pass large structure by const reference on every RPC call (#5780) 2023-12-21 12:01:39 -06:00
UdjinM6
6fe36cc1cb
fix: Improve quorum caching (again) (#5761)
## Issue being fixed or feature implemented
1. `scanQuorumsCache` is a special one and we use it incorrectly.
2. Platform doesn't really use anything that calls `ScanQuorums()`
directly, they specify the exact quorum hash in RPCs so it's
`GetQuorum()` that is used instead. The only place `ScanQuorums()` is
used for Platform related stuff is `StartCleanupOldQuorumDataThread()`
because we want to preserve quorum data used by `GetQuorum()`. But this
can be optimised with its own (much more compact) cache.
3. RPCs that use `ScanQuorums()` should in most cases be ok with smaller
cache, for other use cases there is a note in help text now.

## What was done?
pls see individual commits

## How Has This Been Tested?
run tests, run a node (~in progress~ looks stable)

## Breaking Changes
n/a

## Checklist:
- [x] I have performed a self-review of my own code
- [x] 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
2023-12-20 09:54:00 -06:00