Commit Graph

24156 Commits

Author SHA1 Message Date
Kittywhiskers Van Gogh
41a6613fba
refactor: subsume CoinJoin objects under CJContext, deglobalize coinJoin{ClientQueueManager,Server} (#5337)
## Motivation

CoinJoin's subsystems are initialized by variables and managers that
occupy the global context. The _extent_ to which these subsystems
entrench themselves into the codebase is difficult to assess and moving
them out of the global context forces us to enumerate the subsystems in
the codebase that rely on CoinJoin logic and enumerate the order in
which components are initialized and destroyed.

Keeping this in mind, the scope of this pull request aims to:

* Reduce the amount of CoinJoin-specific entities present in the global
scope
* Make the remaining usage of these entities in the global scope
explicit and easily searchable

## Additional Information

* The initialization of `CCoinJoinClientQueueManager` is dependent on
blocks-only mode being disabled (which can be alternatively interpreted
as enabling the relay of transactions). The same applies to
`CBlockPolicyEstimator`, which `CCoinJoinClientQueueManager` depends.

Therefore, `CCoinJoinClientQueueManager` is only initialized if
transaction relaying is enabled and so is its scheduled maintenance
task. This can be found by looking at `init.cpp`
[here](93f8df1c31/src/init.cpp (L1681-L1683)),
[here](93f8df1c31/src/init.cpp (L2253-L2255))
and
[here](93f8df1c31/src/init.cpp (L2326-L2327)).
  
For this reason, `CBlockPolicyEstimator` is not a member of `CJContext`
and its usage is fulfilled by passing it as a reference when
initializing the scheduling task.

* `CJClientManager` has not used `CConnman` or `CTxMemPool` as `const`
as existing code that is outside the scope of this PR would cast away
constness, which would be unacceptable. Furthermore, some logical paths
are taken that will grind to a halt if they are stored as `const`.

  Examples of such a call chains would be:

* `CJClientManager::DoMaintenance >
CCoinJoinClientManager::DoMaintenance > DoAutomaticDenominating >
CCoinJoinClientSession::DoAutomaticDenominating >
CCoinJoinClientSession::StartNewQueue > CConnman::AddPendingMasternode`
which modifies `CConnman::vPendingMasternodes`, which is non-const
behaviour

* `CJClientManager::DoMaintenance >
CCoinJoinClientManager::DoMaintenance > DoAutomaticDenominating >
CCoinJoin::IsCollateralValid > AcceptToMemoryPool` which adds a
transaction to the memory pool, which is non-const behaviour

* There were cppcheck [linter
failures](https://github.com/dashpay/dash/pull/5337#issuecomment-1685084688)
that seemed to be caused by the usage of `Assert` in
`coinjoin/client.h`. This seems to be resolved by backporting
[bitcoin#24714](https://github.com/bitcoin/bitcoin/pull/24714). (Thanks
@knst!)
    * Depends on #5546

---------

Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2023-09-13 12:52:38 -05:00
PastaPastaPasta
38e70430b9
refactor: governance constification and deglobalization (#5572)
## Issue being fixed or feature implemented
Some relatively simple refactoring; inspired by reviewing #5569; adds
some constification and some deglobalization

## What was done?
Partial deglobalization and constification

## How Has This Been Tested?
Building

## Breaking Changes
None

## Checklist:
_Go over all the following points, and put an `x` in all the boxes that
apply._
- [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-09-10 14:05:49 -05:00
UdjinM6
13c12406ae
fix: actually erase old evodb data on db migration (#5570)
## Issue being fixed or feature implemented
The old evodb data wasn't dropped on db migration really.
`Erase(<db_key_prefix>)` does nothing.

## What was done?
Loop through the old data and drop it in batches per db key. Do this
both for nodes that are doing migration for the first time and for nodes
that did migration in the past already.

## How Has This Been Tested?
Running different versions on testnet
```
# reindex with 18.2.2 till block 850000 (pre-v19 block)
$ du -hd1 ~/.dashcore/testnet3/evodb/
276M	.dashcore/testnet3/evodb

# continue with develop, migration just finished, keep syncing till current tip, block 901000+
$ du -hd1 ~/.dashcore/testnet3/evodb/
469M	.dashcore/testnet3/evodb

# continue with this PR, start at current tip, "migration already done. cleaned old data."
$ du -hd1 ~/.dashcore/testnet3/evodb/
302M	.dashcore/testnet3/evodb
```

## Breaking Changes
Should be none.

## 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-09-09 12:28:12 -05:00
Konstantin Akimov
fa64c64973
fix: improve gfd script to make it works for more cases. (#5561)
## Issue being fixed or feature implemented
Seems as old command `git merge-base --fork-point` doesn't work for some
cases of tree structure

Particularly it didn't worked for PR #5546:
>  @kwvg kwvg force-pushed the utilbps branch from 82d8a61 to f1bc1c3

Basically, one of the step `gfb` script -- `git merge-base --fork-point
develop 82d8a61d227fb66e2c6d4402ebb88e5740271eb9` returned me wrong
commit. After pulling origin/develop it returns just an empty string.

But `git show-branch --merge-base develop
82d8a61d227fb66e2c6d4402ebb88e5740271eb9` worked and returned correct
commit:
"3e1c6dd731 fix: reorder initializations (#5545)" which is the last
common commit with develop branch


## What was done?
Updated recommended function `function gfd()` in doc

## How Has This Been Tested?
Tested on PR #5546 that failed before and returned wrong diff for me


## 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-09-09 12:27:10 -05:00
Konstantin Akimov
deb1e16274
docs: add release notes for 5342 (#5568)
## Issue being fixed or feature implemented
docs: add release notes for 5342



## How Has This Been Tested?
N/A

## 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

---------

Co-authored-by: Odysseas Gabrielides <odysseas.gabrielides@gmail.com>
Co-authored-by: thephez <thephez@users.noreply.github.com>
2023-09-09 12:26:36 -05:00
Odysseas Gabrielides
b20ff5406c
docs: Added release notes for #5121 (#5559)
## Issue being fixed or feature implemented


## What was done?
Added release notes for #5121.

## 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
- [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>
2023-09-07 12:09:45 -05:00
Odysseas Gabrielides
9d56e23893
docs: Added release notes for #5493 (#5556)
## Issue being fixed or feature implemented


## What was done?
Added release notes for #5493 

## 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
- [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: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2023-09-07 12:06:28 -05:00
UdjinM6
45a1dfd3cc
fix: add/tweak thread safety annotations around governance objects map, add missing lock (#5569)
## Issue being fixed or feature implemented
Tidy up things a bit, address concerns expressed in
https://github.com/dashpay/dash/pull/5565#discussion_r1315258917

## What was done?
Implemented changes to make sure `mapObjects` is protected

## How Has This Been Tested?
Run tests, run local node

## 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-09-07 10:36:41 -05:00
Konstantin Akimov
f8befc811c
fix: add missing includes and remove obsolete includes (#5562)
## Issue being fixed or feature implemented
Some headers or modules are used objects from STL without including it
directly, it cause compilation failures on some platforms for some
specific compilers such as #5554

## What was done?
Added missing includes and removed obsolete includes for `optional`,
`deque`, `tuple`, `unordered_set`, `unordered_map`, `set` and `atomic`.

Please, note, that this PR doesn't cover all cases, only cases when it
is obviously missing or obviously obsolete.

Also most of changes belongs to to dash specific code; but for cases of
original bitcoin code I keep it untouched, such as missing <map> in
`src/psbt.h`

I used this script to get a list of files/headers which looks suspicious
`./headers-scanner.sh std::optional optional`:
```bash
#!/bin/bash

set -e

function check_includes() {
    obj=$1
    header=$2
    file=$3

    used=0
    included=0

    grep "$obj" "$file" >/dev/null 2>/dev/null && used=1
    grep "include <$header>" $file >/dev/null 2>/dev/null && included=1
    if [ $used == 1 ] && [ $included == 0 ]
        then echo "missing <$header> in $file"
    fi
    if [ $used == 0 ] && [ $included == 1 ]
        then echo "obsolete <$header> in $file"
    fi
}
export -f check_includes

obj=$1
header=$2

find src \( -name '*.h' -or -name '*.cpp' -or -name '*.hpp' \) -exec bash -c 'check_includes "$0" "$1" "$2"'  "$obj" "$header"  {} \;
```

## How Has This Been Tested?
Built code locally

## 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-09-07 09:07:02 -05:00
pasta
bc6360f6aa
Merge pull request #5342 from knst/reward-reallocation 2023-09-05 11:39:48 -05:00
pasta
759a69ec08 fix: only use V20 hardfork for testnet before EHF is mergable 2023-09-05 11:25:28 -05:00
Konstantin Akimov
732ce241cc cleanup: tidy-up masternode/payments.cpp comments and [[nodiscard]] 2023-09-05 11:25:28 -05:00
UdjinM6
be7dcd4281 get rid of magic 2299859813 in feature_asset_locks.py 2023-09-05 11:25:28 -05:00
Konstantin Akimov
c5d11a241b feat: use getblockcount() instead of over-complex node.getblock(node.getbestblockhash())["height"] 2023-09-05 11:25:28 -05:00
Konstantin Akimov
580350dcc7 refactor: fix bad naming in CreditPool: replaced masternodeReward to platformReward 2023-09-05 11:25:28 -05:00
Konstantin Akimov
5df02c10af cleanup: removed unused header from payments.cpp 2023-09-05 11:25:28 -05:00
Konstantin Akimov
8345721bbd refactor: missing usage of MasternodePayments::PlatformShare 2023-09-05 11:25:28 -05:00
Konstantin Akimov
35b23940c7 refactor: rid-of magic constant by introducing MasternodePayments::PlatformShare 2023-09-05 11:25:28 -05:00
Konstantin Akimov
bdd38adc3f fix: change reward: 37.5% reward of masternodes are on platform now 2023-09-05 11:25:28 -05:00
Konstantin Akimov
5583890689 feat: masternode payment reallocation from coin base to platform
Move funds from the coinbase, into the Asset Lock Pool. This is to incentivize MNs to upgrade to platform, because only MNs running platform will get these migrated rewards
2023-09-05 11:25:28 -05:00
Konstantin Akimov
a77dc95b78 refactor: fix bad naming of namespace CMasternodePayments -> MasternodePayments 2023-09-05 11:25:28 -05:00
Odysseas Gabrielides
15ba7885cf
chore: v20 Testnet signaling starttime (#5567)
## Issue being fixed or feature implemented

## What was done?
Set start time of signaling for v29 and mn_rr for Testnet at Friday,
September 1, 2023 0:00:00

## How Has This Been Tested?

## Breaking Changes
 

## Checklist:
_Go over all the following points, and put an `x` in all the boxes that
apply._
- [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-09-05 11:20:41 -05:00
UdjinM6
baa28b9854
fix: Only approve triggers that match our expectations (#5565)
## Issue being fixed or feature implemented
#5564 is a bit too optimistic about incoming triggers

## What was done?
Rework governance logic to only approve triggers that match our
expectations i.e. have the same data hash as our own trigger would have
if we would have to submit it.

## How Has This Been Tested?
Run tests

## Breaking Changes
Voting is done in `CreateGovernanceTrigger` only now meaning that it
only happens on next block for incoming triggers. Tweaked tests
accordingly.

## 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 _(for repository
code-owners and collaborators only)_
2023-09-05 10:04:21 -05:00
Odysseas Gabrielides
0566ed7e95
docs: Added release notes for #5262 (#5558)
## Issue being fixed or feature implemented


## What was done?
Added release notes for #5262.

## 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
- [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: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: thephez <thephez@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-09-04 21:39:42 -05:00
Odysseas Gabrielides
252f71dbf2
docs: Added release notes for #5525 (#5557)
## Issue being fixed or feature implemented


## What was done?
Added release notes for #5525.

## 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
- [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: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-09-04 21:38:16 -05:00
PastaPastaPasta
0d6281cd95
Merge pull request #5546 from kwvg/utilbps
backport: merge bitcoin#23842, #24714, #21059, #23994, #19866, #19935, #23756, #19064, #23411, #20080 (util backports)
2023-09-04 20:51:38 -05:00
Kittywhiskers Van Gogh
72396d59f8 merge bitcoin#20080: Strip any trailing / in -datadir and -blocksdir paths 2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
18514d3469 args: replace leftover boolean GetArg calls with GetBoolArg 2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
9964cbe772 merge bitcoin#23411: Avoid integer overflow in ApplyStats when activating snapshot 2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
a2dcf74cf4 merge bitcoin#19064: Cleanup thread ctor calls
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
8c742e9d15 merge bitcoin#23756: Fix implicit integer sign changes in strencodings 2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
fa1a5d2100 merge bitcoin#19935: Move SaltedHashers to separate file and add some new ones 2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
e5445e5444 merge bitcoin#19866: eBPF Linux tracepoints 2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
772a3affce merge bitcoin#23994: Consolidate all uses of the fast range mapping technique in util/fastrange.h 2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
1cf996ac8c merge bitcoin#21059: Drop boost/preprocessor dependencies 2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
0761496ce4 merge bitcoin#24714: Don't use a lambda for Assert/Assume
Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
2023-09-04 20:50:27 -05:00
Kittywhiskers Van Gogh
c2014e447b merge bitcoin#23842: Rename interfaces::WalletClient to interfaces::WalletLoader 2023-09-04 20:50:27 -05:00
UdjinM6
05b942470f
feat(qt): Expose -coinjoinsessions, -coinjoindenomsgoal and -coinjoindenomshardcap in CoinJoin Options (#5549)
## Issue being fixed or feature implemented
Let GUI users control all CJ params (on the fly) without the need to
edit `dash.conf`.

<img width="643" alt="Screenshot 2023-08-27 at 12 29 07"
src="https://github.com/dashpay/dash/assets/1935069/2d90db0d-c7b2-43a9-9f7f-1c4ad9517408">

## What was done?
Add 3 corresponding spin boxes in Options (with a simple sanity check).
I tried my best to come up with the least confusing labels/tooltips for
these, not sure if I'm 100% happy with the result though.

## How Has This Been Tested?
Run qt wallet, play with values and make sure they are saved/loaded/used
in mixing correctly.

## 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)_

---------

Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
Co-authored-by: thephez <thephez@users.noreply.github.com>
2023-09-04 20:34:35 -05:00
Odysseas Gabrielides
d080b4cc38
fix: vote funding yes when receiving triggers if hasn't created own trigger (#5564)
## Issue being fixed or feature implemented
In case MNs didn't submit their own trigger, should vote for funding yes
when receiving triggers from other nodes.

## What was done?
Check if already submitted theirs and vote accordingly. 

## 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)_
2023-09-04 13:29:44 -05:00
Konstantin Akimov
ba68ea50f9
feat: various Asset Locks improvement (#5527)
## What was done?
 - remove dependency of Asset Lock txes on CCreditPool
- new case for functional tests of Asset Locks - more than one output
for Asset Lock tx.


## How Has This Been Tested?
Run unit/functional tests

## Breaking Changes
Slightly changes behaviour of TxMempool. Tx can be accepted in mempool
even if Asset Unlock transaction with same index is already mined. But
final consensus rules are same.


## 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
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
2023-08-31 12:28:17 -05:00
Odysseas Gabrielides
d9f815d86e
fix: adjusted nSuperblockMaturityWindow to new logic for devnet/testnet (#5560)
## Issue being fixed or feature implemented
Since #5525, MNs during the maturity window, will propose new triggers. 

In `CGovernanceManager::CreateSuperblockCandidate`, SuperBlock creation
is skipped when the bellow check is true:

`if (nHeight % Params().GetConsensus().nSuperblockCycle <
Params().GetConsensus().nSuperblockCycle -
Params().GetConsensus().nSuperblockMaturityWindow) return std::nullopt;
    `
    
Hence, the value of `nSuperblockMaturityWindow` must be less than
`nSuperblockCycle` and greater than 0.

## What was done?
Changed `nSuperblockMaturityWindow` for devnet and Testnet chain
parameters to the following values:

`nSuperblockCycle` = 24
`nSuperblockMaturityWindow` = 8

## 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)_
2023-08-31 12:24:40 -05:00
Odysseas Gabrielides
811f6177ba
feat(rpc): Disable submission of triggers and gobject vote-conf RPC (#5552)
## Issue being fixed or feature implemented
With #5525 , MNs shouldn't use Sentinel anymore. 

## What was done?
In order to force them to remove Sentinel:
-  `gobject submit` RPC won't accept triggers anymore.
-  `gobject vote-conf` RPC isn't available anymore.


## How Has This Been Tested?
`feature_governance.py` and `feature_governance_object.py`

## Breaking Changes
Normally, only Sentinel should be broken.

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] 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: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-08-31 12:09:05 -05:00
thephez
efa8974ba0
fix: add missing "optional" include (#5554)
undefined
2023-08-30 12:34:59 -05:00
PastaPastaPasta
3507b4a721
Merge pull request #5539 from knst/bp-v21-p1
backport: bitcoin#17509, #17579, #18451, #18504, #18581, #18645, #18646, #18667, #18673, #18682
2023-08-29 22:03:10 -05:00
Samuel Dobson
0d4198c519 Merge #17509: gui: save and load PSBT
764bfe4cba35c24f7627cc425d9e7eba56e98964 [psbt] add file size limit (Sjors Provoost)
1cd8dc2556b847e11a238b9e69493cd8fbeecc6c [gui] load PSBT (Sjors Provoost)
f6895301f768220f3ea70231d5cc5b45ecbf4488 [gui] save PSBT to file (Sjors Provoost)
1d05a9d80b1211b47af465ba6958b0ec5a8c33ab Move DEFAULT_MAX_RAW_TX_FEE_RATE to node/transaction.h (Sjors Provoost)
86e22d23bb90383971a68ead0666f225ddd632fb [util] GetFileSize (Sjors Provoost)
6ab3aad9a51cc5e97a8e2ae7dbd5082272163c30 [gui] send dialog: split on_sendButton_clicked (Sjors Provoost)

Pull request description:

  This adds:
  * a dialog after Create Unsigned, which lets you save a PSBT file in binary format, e.g. to an SD card
  * a "Load PSBT" menu entry lets you pick a PSBT file. We broadcast the transaction if complete

  ## Save flow
  <img width="482" alt="Schermafbeelding 2020-01-04 om 20 39 34" src="https://user-images.githubusercontent.com/10217/71765684-ba60d580-2f32-11ea-8dea-0c4398eb6e15.png">

  <img width="287" alt="Schermafbeelding 2020-01-04 om 20 40 35" src="https://user-images.githubusercontent.com/10217/71765677-a0bf8e00-2f32-11ea-8172-12dfd34a89f3.png">

  <img width="594" alt="Schermafbeelding 2020-01-04 om 20 41 12" src="https://user-images.githubusercontent.com/10217/71765681-aa48f600-2f32-11ea-8e2c-c4f6bf9f5309.png">

  <img width="632" alt="Schermafbeelding 2020-01-04 om 20 41 28" src="https://user-images.githubusercontent.com/10217/71765691-d19fc300-2f32-11ea-97ff-70f5dd59987a.png">

  By default the file name contains the destination address(es) and amount(s).

  We only use the binary format for files, in order to avoid compatibility hell. If we do want to add base64 file format support, we should use a different extension for that (`.psbt64`?).

  ## Load flow

  Select a file:
  <img width="649" alt="Schermafbeelding 2020-01-04 om 21 08 57" src="https://user-images.githubusercontent.com/10217/71766089-2ba28780-2f37-11ea-875d-074794b5707d.png">

  Offer to send if complete:

  <img width="308" alt="Schermafbeelding 2020-01-04 om 21 09 06" src="https://user-images.githubusercontent.com/10217/71766088-2a715a80-2f37-11ea-807d-394c8b840c59.png">

  Tell user if signatures are missing, offer to copy to clipboard:
  <img width="308" alt="Schermafbeelding 2020-01-04 om 21 15 57" src="https://user-images.githubusercontent.com/10217/71766115-702e2300-2f37-11ea-9f62-a6ede499c0fa.png">

  Incomplete for another reason:

  <img width="309" alt="Schermafbeelding 2020-01-04 om 21 07 51" src="https://user-images.githubusercontent.com/10217/71766090-2c3b1e00-2f37-11ea-8a22-6188377b67a1.png">

ACKs for top commit:
  instagibbs:
    re-ACK  764bfe4cba
  achow101:
    ACK 764bfe4cba35c24f7627cc425d9e7eba56e98964
  jb55:
    Tested ACK 764bfe4cba35c24f7627cc425d9e7eba56e98964
  jonatack:
    ACK 764bfe4c
  promag:
    Code review ACK 764bfe4cba35c24f7627cc425d9e7eba56e98964.

Tree-SHA512: d284ed6895f3a271fb8ff879aac388ad217ddc13f72074725608e1c3d6d90650f6dc9e9e254479544dd71fc111516b02c8ff92158153208dc40fb2726b37d063
2023-08-29 22:00:59 -05:00
MarcoFalke
b12b323e60 Merge #17579: [refactor] Merge getreceivedby tally into GetReceived function
a1d5b12ec07d2f7aa9fa955a6dd99e8a2be5cb25 Merge getreceivedby tally into GetReceived function (Andrew Toth)

Pull request description:

  This PR merges the tally code of `getreceivedbyaddress` and `getreceivedbylabel` into a single function `GetReceived`. This reduces repeated code and makes it similar to `listreceivedbyaddress` and `listreceivedbylabel`, which use the function `ListReceived`. It will also make the change in #14707 simpler and easier to review.

ACKs for top commit:
  theStack:
    re-ACK a1d5b12ec0
  meshcollider:
    utACK a1d5b12ec07d2f7aa9fa955a6dd99e8a2be5cb25

Tree-SHA512: 43d9cd92f7c2c6a8b9c7509aa85a9b9233a6cfec1c43a9062e3bdfb83515413d1feafa8938c828351278ba22bd31c47e62ab5341e4bddc2493103b094d73b047
2023-08-29 22:00:59 -05:00
MarcoFalke
f9e0773a9d Merge #18682: fuzz: http_request workaround for libevent < 2.1.1
6f8b498d186df5aa08dbb9ca8fdeab6652f1db5e fuzz: http_request workaround for libevent < 2.1.1 (Sebastian Falbesoner)

Pull request description:

  The fuzz test `http_request` calls the following two internal libevent functions:
  * `evhttp_parse_firstline_`
  * `evhttp_parse_headers_`

  Before libevent 2.1.1 however, internal functions names didn't end with an underscore (see libevent commit 8ac3c4c25b and [Changelog for 2.1.1.-alpha](https://github.com/libevent/libevent/blob/master/ChangeLog#L1830) when the change was first mentioned) hence the build fails with a linking error.
  This PR adds a preprocessor workaround to the test that checks for the libevent version (via ~`_EVENT_NUMERIC_VERSION`~ `LIBEVENT_VERSION_NUMBER`) and creates wrapper functions mapping to naming scheme without underscore in case the version is older than 2.1.1.

  Tested with Ubuntu Xenial 16.04.6 LTS and clang-8.

ACKs for top commit:
  hebasto:
    ACK 6f8b498d186df5aa08dbb9ca8fdeab6652f1db5e, tested on xenial:

Tree-SHA512: 3b9e0147b8aea22e417d418e3b6d4905f5be131c2b0ae4b0f8b9411c5606d2e22f1b23e1ecc6980ecab907c61404de09e588aae1ac43cf70cf9e8d006bbdee73
2023-08-29 22:00:59 -05:00
MarcoFalke
30e75239e8 Merge #18667: ci: Limit cache size regardless of NO_DEPENDS
0c6318788beaf1a31aeba5a21f3f8bb5c07cea6c ci: Limit cache size regardless of NO_DEPENDS (Hennadii Stepanov)

Pull request description:

  Close #18666.

ACKs for top commit:
  MarcoFalke:
    ACK 0c6318788beaf1a31aeba5a21f3f8bb5c07cea6c . Depends has ccache disabled anyway and is cached regardless of whether ccache is there or not, see #17248

Tree-SHA512: b1bf98be0f844b4704abd177841b014f3900be8160496f0d12596310db607b4f544547e8c3cbfcf17c086a78afd251653363f3dd467b769ac0062bc19adc8144
2023-08-29 22:00:59 -05:00
Konstantin Akimov
d9e766a7c5 Merge #18645: [doc] Update thread information in developer docs
808ef36b89ea9ce72116bbd7ee479b984367dc60 [doc] Update thread information in developer docs (John Newbery)

Pull request description:

  - DumpAddresses thread was removed in #5964
  - Shutdown thread was removed in #5679
  - Add new threads (scheduler, RPC worker, indexer, tor control)
  - Small changes to documentation of other threads

ACKs for top commit:
  MarcoFalke:
    ACK 808ef36b89
  hebasto:
    ACK 808ef36b89ea9ce72116bbd7ee479b984367dc60.

Tree-SHA512: 85b6ace7bcc4dee030c63461bef1ded1a9581d4fa249c59f6fcd5d33d89c4357a6b8b35888ce0960f276d397b5e38a21e6c5d4b7b79544827a28c950e097b36d
2023-08-29 22:00:59 -05:00
MarcoFalke
c4234a5e78 Merge #18451: test: shift coverage from getunconfirmedbalance to getbalances
0306d78cb49d1684cc96ba3512b582a1fdaf78cc Use getbalances in wallet_address_types tests (Jon Atack)
7eacdc5167c8db94df84e206db85817bc64e4921 Shift coverage from getunconfirmedbalance to getbalances in wallet_abandonconflict tests (Jon Atack)
3e6f7377f600e47e5e3d439fc5d6ccf3db210038 Improve getbalances coverage in wallet_balance tests (Jon Atack)

Pull request description:

  <strike>This PR updates several tests and then removes the `getunconfirmedbalance` RPC which was deprecated in facfb4111d14a3b06c46690a2cca7ca91cea8a96 a year ago.

  Next steps: remove the deprecated `getwalletinfo` fields and the `getbalance` RPC in follow-ups, if there seems to be consensus on those removals.</strike>

  Update:

  `getunconfirmedbalance` RPC was deprecated in facfb4111d14a3b06c46690a2cca7ca91cea8a96 a year ago, but following the review comments below, this PR now only updates the test coverage to use `getbalances` while still leaving basic coverage for `getunconfirmedbalance` in wallet_balance.py.

  That said, I've seen 3 regular contributors confused in the past 10 days by "DEPRECATED" warnings in the code that are not following the deprecation policy in [JSON-RPC-interface.md#versioning](https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#versioning).

  ISTM these warnings should either be removed, or the calls deprecated (`-deprecatedrpc`), or the policy updated to describe these warnings as a pre-deprecation practice.

ACKs for top commit:
  jnewbery:
    utACK 0306d78cb

Tree-SHA512: 692e43e9bed5afa97d905740666e365f0b64e559e1c75a6a398236d9e943894e3477947fc11324f420a6feaffa0c0c1532aa983c50090ca39d06551399e6ddd1
2023-08-29 22:00:59 -05:00