Commit Graph

16343 Commits

Author SHA1 Message Date
UdjinM6
24a4ed3f8b
fix: Update conditions and unify calculations for the number of "winners" to skip when mixing (#5532)
## Issue being fixed or feature implemented
`JoinExistingQueue` was tweaked for regtest/devnets in #4394 but we have
"skipping winners" logic in `StartNewQueue` too. We should also use
weighted count when checking "skip winners" conditions.

## What was done?
Add a helper to calculate the number and use it in both methods. Adjust
logic.

## How Has This Been Tested?
Running a local mixing node on devnet ~- no "skipping winners" in logs
anymore.~ and 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
2023-08-16 23:39:38 -05:00
UdjinM6
9f7322b34a
feat: Add -chainlocknotify cmd-line option, update -instantsendnotify (#5522)
## Issue being fixed or feature implemented
Execute command when the best chainlock changes (`%s` in cmd is replaced
by chainlocked block hash). Same as `-blocknotify` but for chainlocks.
Let `-instantsendnotify` replace `%w` with wallet name like
`-walletnotify` does.

## What was done?

## How Has This Been Tested?
run tests

## 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-08-15 11:10:21 -05:00
MarcoFalke
085f4dfa76 Merge #20761: fuzz: Check that NULL_DATA is unspendable
fa2630328687645fbc7dd1ea46aac32514025715 fuzz: Check that NULL_DATA is unspendable (MarcoFalke)

Pull request description:

  * Every script of type NULL_DATA must be unspendable
  * The only know types of unspendable scripts are NULL_DATA and certain NONSTANDARD scripts

ACKs for top commit:
  sipa:
    utACK fa2630328687645fbc7dd1ea46aac32514025715

Tree-SHA512: 8297fbacf32b4868b12accc1c052d352d02d96540a1fc883de9d04a3df8734116deecc33046495c9a3af6d79fec7f8d63afbfa5e401a2ca8d7c70f0f13735c0d
2023-08-08 06:33:29 -05:00
fanquake
c32857c05b Merge #20747: net processing: Remove dropmessagestest
176325a5a47befe32d480b3dc206dd0e64e04b21 [net processing] Remove dropmessagestest (John Newbery)

Pull request description:

  -dropmessagestest is a command line option that causes 1 in n received
  messages to be dropped. The Bitcoin P2P protocol is stateful and in
  general cannot handle messages being dropped. Dropped
  version/verack/ping/pong messages will cause the connection to time out
  and be torn down. Other dropped messages may also cause the peer to
  believe that the peer has stalled and tear down the connection.

  It seems difficult to uncover any actual issues with -dropmessagestest,
  and any coverage that could be generated would probably be easier to
  trigger with fuzz testing.

ACKs for top commit:
  MarcoFalke:
    cr ACK 176325a5a47befe32d480b3dc206dd0e64e04b21
  practicalswift:
    cr ACK 176325a5a47befe32d480b3dc206dd0e64e04b21
  dhruv:
    cr ACK 176325a
  amitiuttarwar:
    ACK 176325a5a47befe32d480b3dc206dd0e64e04b21

Tree-SHA512: bd582e5e8c9eb272a5d8ec01ff07c36c0033fbb84c30d1c72c87a7a6c7290021dcaf7bf549179a8b95aeb4f7243158d5593bc7fcf1ec16213782e470fe36bb89
2023-08-08 06:33:29 -05:00
MarcoFalke
04a0baad8d Merge #20731: rpc: Add missing description of vout in getrawtransaction help text
b23349b8804fb60c6b3d7d0e2a95927a0d1b49b9 rpc: Add missing description of vout in getrawtransaction help text (Ben Carman)

Pull request description:

  In `getrawtransaction` the vout did not have a description. I gave it the same description as the one used in `decoderawtransaction`.

ACKs for top commit:
  MarcoFalke:
    ACK b23349b8804fb60c6b3d7d0e2a95927a0d1b49b9 🏯

Tree-SHA512: 3833b97c82a46dfeb7ac825d4b2514b4b05ce54ac41f2144a8e2f2093b3411fe1d090c1e5b0c3d09200a2ea164c8d17ece12cdb43bbaeaeccc51a9da6dd7b7a3
2023-08-08 06:33:29 -05:00
MarcoFalke
2e8800cdc1 Merge #20686: fuzz, refactor: replace CNode code with fuzz/util.h::ConsumeNode()
23d8f346896c806581189c9eb870c7833c09f5be fuzz: replace CNode code with fuzz/util.h::ConsumeNode() (Jon Atack)

Pull request description:

  Noticed this while updating the CNode fuzzing in #20210.

  - cc26fab48d76a813d798657b18ae1af08a301150 created `test/fuzz/net.cpp` in May 2020

  - 79ef8324d4c85ed16a304e98805724b8a created a CNode factory utility `test/fuzz/util.h::ConsumeNode()` in October 2020

  This PR updates `fuzz/net.cpp` from the first commit to use `ConsumeNode()` from the second commit.

ACKs for top commit:
  MarcoFalke:
    ACK 23d8f346896c806581189c9eb870c7833c09f5be

Tree-SHA512: 26f7685395b3d48fcf40dde0d479d5c2fb4e953ec9371940b19eee16bb30aee4840b081e1a918b924a9704c1bef484302ea3e8fe63819a3bba73e7eb805164f1
2023-08-08 06:26:09 -05:00
Wladimir J. van der Laan
b1e0b6c1f5 Merge #20668: doc: warn that incoming conns are unlikely when not using default ports
010eed3ce03cf4fc622a48f40fc4d589383f7a44 doc: warn that incoming conns are unlikely when not using default ports (Adam Jonas)

Pull request description:

  Closes #5150.

  This was mostly copied from #5285 by sulks, who has since quit GitHub.

  The issue has remained open for 6 years, but the extra explanation still seems useful.

ACKs for top commit:
  laanwj:
    re-ACK 010eed3ce03cf4fc622a48f40fc4d589383f7a44

Tree-SHA512: d240fb06bba41ad8898ced59356c10adefc09f3abb33e277f8e2c5980b40678f2d237f286b476451bb29d2b94032a7dee2ada3b2efe004ed1c2509e70b48e40f
2023-08-08 06:26:09 -05:00
fanquake
2111c7727b Merge #20617: p2p: Remove m_is_manual_connection from CNodeState
a33442fdc73eabd1c5596ab92954344edc9517e6 Remove m_is_manual_connection from CNodeState (Antoine Riard)

Pull request description:

  Currently, this member is only used to exclude MANUAL peers from discouragement
  in MaybePunishNodeForBlock(). Manual connections are already protected in
  MaybeDiscourageAndDisconnect(), independently from their network
  processing behaviors.

ACKs for top commit:
  MarcoFalke:
    cr ACK a33442fdc73eabd1c5596ab92954344edc9517e6
  promag:
    Code review ACK a33442fdc73eabd1c5596ab92954344edc9517e6.
  jnewbery:
    utACK a33442fdc73eabd1c5596ab92954344edc9517e6
  amitiuttarwar:
    code review ACK a33442fdc73eabd1c5596ab92954344edc9517e6

Tree-SHA512: cfe3f3dfa131373e3299002d34ae9e22ca6e1a966831bab32fcf06ff1d08f06095b4ab020cc4d267f3ec05ae23fbdc22373382ab828b999c0db11b8c842a4f0c
2023-08-08 06:26:09 -05:00
Kittywhiskers Van Gogh
b92539f437 merge bitcoin#24132: Bump minimum Qt version to 5.11.3 2023-08-08 06:05:02 -05:00
Kittywhiskers Van Gogh
545387128c merge bitcoin#21286: Bump minimum Qt version to 5.9.5 2023-08-08 06:05:02 -05:00
Konstantin Akimov
93bd0c70a2
refactor: rename assetLockedAmount in CbTx to creditPoolBalance (#5526)
## Issue being fixed or feature implemented
Bad naming is noticed in https://github.com/dashpay/dash/pull/5026 by
thephez

## What was done?
Renamed `assetLockedAmount` in CbTx to `creditPoolBalance`
Renamed also some local variables and functions to make it matched also.

## How Has This Been Tested?
Run functional/unit tests - succeed
Called python's rpc binding `node.getblock(block_hash)['cbTx']`:
Got this result:
```
{'version': 3, 'height': 1556, 'merkleRootMNList': '978b2b4d1b884de62799b9eaee75c7812fea59f98f80d5ff9c963b0f0f195e14', 'merkleRootQuorums': 'bc7a34eb114f4e4bf38a11080b5d8ac41bdb36dd41e17467bae23c94ba06b013', 'bestCLHeightDiff': 0, 'bestCLSignature': '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'creditPoolBalance': Decimal('7.00141421')}
```

## Breaking Changes
Renamed `assetLockedAmount` in CbTx to `creditPoolBalance`. @shumkov be
informed


## 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
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
2023-08-08 05:49:31 -05:00
MarcoFalke
2c9d41d073 Merge #18454: net: Make addr relay mockable, add test
NOTE: There is slight difference with original backport due to future changes
in bitcoin#19272, bitcoin#19763 - otherwise functional test p2p_addr_relay.py fails

fa1da3d4bfc0511a89f5b19d5a4d89e55ff7ccde test: Add basic addr relay test (MarcoFalke)
fa1793c1c44a3f75a09f9c636467b8274c541bdd net: Pass connman const when relaying address (MarcoFalke)
fa47a0b003f53708b6d5df1ed4e7f8a7c68aa3ac net: Make addr relay mockable (MarcoFalke)

Pull request description:

  As usual:

  * Switch to std::chrono time to be type-safe and mockable
  * Add basic test that relies on mocktime to add code coverage

ACKs for top commit:
  naumenkogs:
    utACK  fa1da3d
  promag:
    ACK fa1da3d4bfc0511a89f5b19d5a4d89e55ff7ccde (fabe56e44b6f683e24e37246a7a8851190947cb3 before https://github.com/bitcoin/bitcoin/pull/18454#issuecomment-607866453), fa5bf23d527a450e72c2bf13d013e5393b664ca3 was dropped since last review.

Tree-SHA512: 0552bf8fcbe375baa3cab62acd8c23b2994efa47daff818ad1116d0ffaa0b9e520dc1bca2bbc68369b25584e85e54861fe6fd0968de4f503b95439c099df9bd7

fixup - see #19272, #19763
2023-08-03 11:16:41 -05:00
MarcoFalke
7c5f9af0dc Merge #18563: test: Fix unregister_all_during_call cleanup
13d2a33537a403ac47a989be92109d3214375b6a Fix unregister_all_during_call cleanup (Russell Yanofsky)

Pull request description:

  Use `TestingSetup` fixture to fix `unregister_all_during_call` test not calling `UnregisterBackgroundSignalScheduler`, which could trigger an assert in `RegisterBackgroundSignalScheduler` when called in later tests

  Failure reported by fanquake https://github.com/bitcoin/bitcoin/pull/18551#issuecomment-610974251

ACKs for top commit:
  MarcoFalke:
    ACK 13d2a33537a403ac47a989be92109d3214375b6a if appveyor unit tests pass

Tree-SHA512: d2ec8ff14c54d97903af50031abfac1f38ec1c3aabc90371cfd5b79481fa69d3d77f339bfdf7d2178fd85e83402f72eda7cf4d339e5bbfa7e6e1a68836643b93
2023-08-03 11:16:41 -05:00
MarcoFalke
560e5589cb Merge #18532: rpc: Avoid initialization-order-fiasco on static CRPCCommand tables
fa1a92224dd78de817d15bcda35a8310254e1a54 rpc: Avoid initialization-order-fiasco on static CRPCCommand tables (MarcoFalke)

Pull request description:

  Currently the fiasco is only theoretical because all content of the table are compile-time constants. However, the fiasco materializes should they ever become run-time constants (e.g. #18531).

ACKs for top commit:
  promag:
    ACK fa1a92224dd78de817d15bcda35a8310254e1a54.
  practicalswift:
    ACK fa1a92224dd78de817d15bcda35a8310254e1a54 -- fiasco bad :)

Tree-SHA512: cccadb0ad56194599b74f04264d74c34fa865958580a850efc6474bbdc56f30cadce6b2e9a6ad5472ff46c3f4c793366acd8090fad409a45b25d961f2d89da19
2023-08-03 11:16:41 -05:00
MarcoFalke
2046ae1bc0 Merge #18546: Bugfix: Wallet: Safely deal with change in the address book [part 2]
7a2ecf16df938dd95d3130a46082def7a02338eb Wallet: Change IsMine check in CWallet::DelAddressBook from assert to failure (Luke Dashjr)
2952c46b923042f2de801f319e03ed5c4c4eb735 Wallet: Replace CAddressBookData.name with GetLabel() method (Luke Dashjr)
d7092c392e10889cd7a080b3d22ed6446a59b87a QA: Test that change doesn't turn into non-change when spent in an avoid-reuse wallet (Luke Dashjr)

Pull request description:

  Follow-up to #18192, not strictly necessary for 0.20

ACKs for top commit:
  MarcoFalke:
    re-ACK 7a2ecf16df, only change is adding an assert_equal in the test 🔰
  jnewbery:
    utACK 7a2ecf16df938dd95d3130a46082def7a02338eb

Tree-SHA512: e0933ee40f705b751697dc27249e1868ed4874254b174ebdd0a7150125d8c818402e66df2371718c7eeb90e67ee2317215fb260aa9b9d7b9b45ee436de2988ff
2023-08-03 11:16:41 -05:00
Wladimir J. van der Laan
363b37dfbd Merge #18487: rpc: Fix rpcRunLater race in walletpassphrase
7b8e15728d1ad058a4b7d7569fd5d5ba6806ca28 rpc: Fix rpcRunLater race in walletpassphrase (João Barbosa)

Pull request description:

  Release locks before calling `rpcRunLater`.

  Quick explanation: `rpcRunLater` leads to `event_free` which calls `event_del` which can wait for the event callback to finish if it's already running and that callback will try to lock wallet mutex - which is already locked in http thread.

  Fixes #14995 , fixes #18482. Best reviewed with whitespace changes hidden.

ACKs for top commit:
  MarcoFalke:
    ACK 7b8e15728d, only tested that this avoids the node freezing. Did not look at how libevent works or how the deadlock happens or if this breaks other stuff. 📞
  ryanofsky:
    Code review ACK 7b8e15728d1ad058a4b7d7569fd5d5ba6806ca28. Just updated comment since last review

Tree-SHA512: 17874a2fa7b0e164fb0d7ee4cb7d59650275b8c03476fb291d60af8b758495457660d3912623fb26259fefe84aeba21c0a9e0c6467982ba511f19344ed5413ab
2023-08-03 11:16:41 -05:00
MarcoFalke
76242f9d8d Merge #18551: Do not clear validationinterface entries being executed
2276339a176f83ffe8ceefb3e41ecca8601aa13b Add test for UnregisterAllValidationInterfaces bug (Russell Yanofsky)
3c61abbbc847d725f30d169278d84655571407c1 Do not clear validationinterface entries being executed (Pieter Wuille)

Pull request description:

  The previous code for MainSignalsInstance::Clear would decrement the reference
  count of every interface, including ones that were already Unregister()ed but
  still being executed.

  This fixes the issue pointed out here: https://github.com/bitcoin/bitcoin/pull/18524/files#r404395685 . It's not currently observable.

ACKs for top commit:
  jonasschnelli:
    utACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b - reviewed code and test (thanks @ryanofsky for adding the test).
  MarcoFalke:
    ACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b 🎎
  ryanofsky:
    Code review ACK 2276339a176f83ffe8ceefb3e41ecca8601aa13b. No change to bugfix, just rebased and new test commit added since last review

Tree-SHA512: c1d68e7c681a45c6cadc84e407c2266bcb4b12d34264e1232a61c4eadb74b551231c5a3b1d041de39f507aef4dfa7d4589b8bfe1833f069c739c6270d2a05dbe
2023-08-03 11:16:41 -05:00
Wladimir J. van der Laan
d2bbf03c32 Merge #18524: refactor: drop boost::signals2 in validationinterface
d6815a2313158862d448733954a73520f223deb6 refactor: drop boost::signals2 in validationinterface (Russell Yanofsky)

Pull request description:

  Stop using boost::signals2 internally in validationinterface. Replace with std::list and Add/Remove/Clear/Iterate helper functions.

  Motivation for change is to reduce dependencies and avoid issues happening with boost versions before 1.59: https://github.com/bitcoin/bitcoin/issues/18517, https://github.com/bitcoin/bitcoin/pull/18471

ACKs for top commit:
  MarcoFalke:
    ACK d6815a2313158862d448733954a73520f223deb6
  laanwj:
    ACK d6815a2313158862d448733954a73520f223deb6
  hebasto:
    re-ACK d6815a2313158862d448733954a73520f223deb6
  promag:
    ACK d6815a2313158862d448733954a73520f223deb6.

Tree-SHA512: 4fc0f14a8446e8616cc142af6c3d36815f3254525d30348ba8e4d4bc74c249a5a8c9bc119bdd1be7ebd7abe0b784bc0c5551a3e156a766890cb2fdd891a95919
2023-08-03 11:16:41 -05:00
Konstantin Akimov
4f00d45e53 Merge #18587: gui: Avoid wallet tryGetBalances calls in WalletModel::pollBalanceChanged
d3a56be77a9d112cde4baef4314882170b9f228f Revert "gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged" (Russell Yanofsky)
bf0a510981ddc28c754881ca21c50ab18e5f2b59 gui: Avoid wallet tryGetBalances calls before TransactionChanged or BlockTip notifications (Russell Yanofsky)
2bc9b92ed8b7736ad67876398a0bb8287f57e9b3 Cancel wallet balance timer when shutdown requested (Russell Yanofsky)
83f69fab3a1ae97c5cff8ba1e6fd191b0fa264bb Switch transaction table to use wallet height not node height (Russell Yanofsky)

Pull request description:

  Main commit `gui: Avoid wallet tryGetBalances calls` is one-line change to `WalletModel::pollBalanceChanged` that returns early if there hasn't been a new `TransactionChanged` or `BlockTip` notification since the previous poll call. This is the same behavior that was implemented in #18160, now implemented in a simpler way.

  The other commits are a straight revert of #18160, and two tweaks to avoid relying on `WalletModel::m_client_model` lifetime which were causing travis failures with earlier versions of this PR.

  Motivation for this change is to be able to revert #18160 and cut down on unnecessary cross-process calls that happen when #18160 is combined with #10102

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10).# This is a combination of 2 commits.
2023-08-03 11:16:41 -05:00
Wladimir J. van der Laan
9a84f7ef76 Merge #18160: gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged
0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37 gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged (João Barbosa)

Pull request description:

  Each 250ms the slot `WalletModel::pollBalanceChanged` is called which, at worst case, calls `Wallet::GetBalance`. This is a waste of resources since most of the time there aren't new transactions or new blocks. Fix this by early checking if cache is dirty or not.

  The actual balance computation can still hang the GUI thread but that is tracked in #16874 and should be fixed with a solution similar to #17135.

ACKs for top commit:
  hebasto:
    ACK 0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37, I have not tested the code, but I have reviewed it and it looks OK, I agree it can be merged.
  jonasschnelli:
    utACK 0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37
  instagibbs:
    ACK 0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37
  ryanofsky:
    Code review ACK 0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37, but I would prefer (not strongly) for #17905 to be merged first. This PR can be simpler if it is based on #17905, so tryGetBalances can just be left alone instead of changing into to a more complicated tryGetBalancesIfNeeded function, and then getting changed back later when we want to optimize it out.
  jonatack:
    ACK 0933a37078e based primarily on code review, despite a lot of manual testing with a large 177MB wallet.

Tree-SHA512: 18db35bf33a7577666658c8cb0b57308c8474baa5ea95bf1468cd8531a69857d8915584f6ac505874717aa6aabeb1b506ac77630f8acdb6651afab89275e38a1
2023-08-03 11:16:41 -05:00
Kittywhiskers Van Gogh
cc9dcdd0e0 test: migrate TestChainSetup's g_txindex guardrails 2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
d7b7bbd425 merge bitcoin#27988: Use same timeout for all index sync 2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
a9e3b9f2db partial bitcoin#27405: Use steady clock instead of system clock to measure durations
includes:
- fa1d8044abc2cd0f149a2d526b3b03441443cdb0
2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
1e609cff61 util: add SteadyClock type alias to std::chrono::steady_clock
courtesy of c84390b from bitcoin#25487
2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
5b338c33da merge bitcoin#24921: Add time helpers for std::chrono::steady_clock and FastRandomContext::rand_uniform_delay 2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
c21f23db1b partial bitcoin#24138: Commit MuHash and best block together for coinstatsindex
excludes:
- 691d45fdc83ec14f87a400f548553168ac70263f (portions)
2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
6f270bbf9b merge bitcoin#24133: Improve robustness of coinstatsindex at restart 2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
123cf8d2c7 partial bitcoin#24117: make indices robust against init aborts
excludes:
- bfcd60f5d505334230013de4115483b22a7898ee
2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
4e9d9a69e8 merge bitcoin#21767: Prune g_chainman usage in auxiliary modules 2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
d577d8bc57 merge bitcoin#21796: Avoid async shutdown on init error 2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
d97dcb22e1 merge bitcoin#22047: Coinstatsindex follow-ups 2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
2235388bf8 index: send zero-value arguments if calculating subsidy of genesis block
Dash uses the height and difficulty of the previous block to calculate
the subsidy for the current block... which in the case of the genesis
block is block -1, which doesn't exist.

Attempting in reading `pprev` which is will evaluate to a `nullptr`, so
for any blocks <=0, we fetch the subsidy expected from block 0 from
CChainParams.
2023-08-02 10:19:02 -05:00
Kittywhiskers Van Gogh
040cd922f6 merge bitcoin#19521: Coinstats Index 2023-08-02 10:19:02 -05:00
Konstantin Akimov
d914bf2b6e
feat: add bloom filter for Asset Lock transactions (#5521)
## Issue being fixed or feature implemented
There's one type of output that potentially can be useful for bloom
filter.
It's follow-up for TODO for dashpay/dash#4857.

Asset  Lock transactions have:
 - standard inputs (covered by regular bloom filter implementation)
 - standard outputs (covered by regular bloom filter implementation)
- special outputs that have public key to proof owing this credits on
platform and claiming it.

Asset Unlock transactions have:
 - no inputs (no need bloom)
 - standard outputs (covered by regular bloom filter implementation)

So far as there's only one special case, let's have this data in the
bloom filter because it can potentially help to show information such as
"Deposit to platform" on mobile clients.

## What was done?
 - added special case for Asset Lock transactions for bloom filter

## How Has This Been Tested?
Run unit/functional tests. Doesn't actually tested how bloom filter
works.


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

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-08-02 10:08:39 -05:00
MarcoFalke
5b0e3b9f30 Merge #19832: p2p: Put disconnecting logs into BCLog::NET category
1816327e533d359c237c53eb6440b2f3a7cbf4fa p2p: Put disconnecting logs into BCLog::NET category (Hennadii Stepanov)

Pull request description:

  It's too noisy:
  ```
  $ cat debug.log | wc -l
  28529
  $ cat debug.log | grep "Disconnecting and discouraging peer" | wc -l
  10177
  ```

ACKs for top commit:
  MarcoFalke:
     noban, addnode and local peers are still unconditionally logged (as they should), but this one can go into a category, so cr-ACK 1816327e533d359c237c53eb6440b2f3a7cbf4fa
  practicalswift:
    ACK 1816327e533d359c237c53eb6440b2f3a7cbf4fa for the reasons MarcoFalke gave above.
  ajtowns:
    ACK 1816327e533d359c237c53eb6440b2f3a7cbf4fa

Tree-SHA512: c312c1009090840659b2cb1364d8ad9b6ab8e742fc462aef169996d93c76c248507639a00257ed9d73a6916c01176b1793491b2305e92fdded5f9de0935b6ba6
2023-08-01 12:24:36 -05:00
MarcoFalke
dbf605e1f9 (Partial) Merge #20566: refactor: Use C++17 std::array where possible
fac7ab1d5b58fb9cfd80d5cf74ac4d2e5cb8eff2 refactor: Use C++17 std::array where possible (MarcoFalke)

Pull request description:

  Using the C++11 std::array with explicit template parameters is problematic because overshooting the size will fill the memory with default constructed types.

  For example,

  ```cpp
  #include <array>
  #include <iostream>

  int main()
  {
      std::array<int, 3> a{1, 2};
      for (const auto& i : a) {
          std::cout << i << std::endl;  // prints "1 2 0"
      }
  }
  ```

ACKs for top commit:
  jonasschnelli:
    Code Review ACK fac7ab1d5b58fb9cfd80d5cf74ac4d2e5cb8eff2
  practicalswift:
    cr ACK fac7ab1d5b58fb9cfd80d5cf74ac4d2e5cb8eff2
  vasild:
    ACK fac7ab1d
  promag:
    Code review ACK fac7ab1d5b58fb9cfd80d5cf74ac4d2e5cb8eff2.

Tree-SHA512: ef7e872340226e0d6160e6fd66c6ca78b2ef9c245fa0ab27fe4777aac9fba8d5aaa154da3d27b65dec39a6a63d07f1063c3a8ffb667a98ab137756a1a0af2656
2023-08-01 12:24:36 -05:00
Wladimir J. van der Laan
84b8d62d34 Merge #20221: net: compat.h related cleanup
cadb77a6ab8a3e6f56062cfaec4dd8168c71b39d net: Add compat.h header for htonl function (Hennadii Stepanov)
f796f0057bc7dad8e7065831b07f432fc0fb9f08 net: Drop unneeded headers when compat.h included (Hennadii Stepanov)
467c34644861a5267601255650e27c7aadab31dc net: Drop unneeded Windows headers in compat.h (Hennadii Stepanov)

Pull request description:

  It is the `compat.h` header's job to provide platform-agnostic interfaces for internet operations.
  No need in `#include <arpa/inet.h>` scattered around.

ACKs for top commit:
  practicalswift:
    re-ACK cadb77a6ab8a3e6f56062cfaec4dd8168c71b39d: patch looks even better
  laanwj:
    Code review ACK cadb77a6ab8a3e6f56062cfaec4dd8168c71b39d

Tree-SHA512: 625ff90b2806310ab856a6ca1ddb6d9a85aa70f342b323e8525a711dd12219a1ecec8373ec1dca5a0653ffb11f9b421753887b25615d991ba3132c1cca6a3c6e
2023-08-01 12:24:36 -05:00
fanquake
de28a0e10c Merge #20530: lint, refactor: Update cppcheck linter to c++17 and improve explicit usage
1e62350ca20898189904a88dfef9ea11ddcd8626 refactor: Improve use of explicit keyword (Fabian Jahr)
c502a6dbfb854ca827a5a3925394f9e09d29b898 lint: Use c++17 std in cppcheck linter (Fabian Jahr)

Pull request description:

  I found the `extended-lint-cppcheck` linter still uses `std=c++11` when reviewing #20471. The only difference in the output after this change is one line is missing:

  ```
  src/script/descriptor.cpp:159:5: warning: Struct 'PubkeyProvider' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
  ```

  After some digging, I am still not sure why this one is ignored with c++17 when 40 other`noExplicitConstructor` warnings were still appearing.

  In the second commit, I fix these warnings, adding `explicit` where appropriate and adding fixes to ignore otherwise.

ACKs for top commit:
  practicalswift:
    cr ACK 1e62350ca20898189904a88dfef9ea11ddcd8626: patch looks correct!
  MarcoFalke:
    review ACK 1e62350ca20898189904a88dfef9ea11ddcd8626

Tree-SHA512: dff7b324429a57160e217cf38d9ddbb6e70c6cb3d3e3e0bd4013d88e07afc2292c3df94d0acf7122e9d486322821682ecf15c8f2724a78667764c05d47f89a12
2023-08-01 12:24:36 -05:00
Wladimir J. van der Laan
361d1e18d1 Merge #20606: Remove unused bits from service flags enum
fa40168ab3102b9ad850f967a0e7fa22dbfbd0c6 Remove unused bits from service flags enum (MarcoFalke)

Pull request description:

  Remove service bits that haven't been observed on the active network for years and won't ever be observed on the network with this meaning. Keeping this dead assignment in our source code forever doesn't add any value.

  I somehow forgot to do this in commit fa0d0ff6e1bee60fde63724ae28a51aac5a94d4a.

ACKs for top commit:
  laanwj:
    Code review ACK fa40168ab3102b9ad850f967a0e7fa22dbfbd0c6
  practicalswift:
    cr ACK fa40168ab3102b9ad850f967a0e7fa22dbfbd0c6
  fanquake:
    ACK fa40168ab3102b9ad850f967a0e7fa22dbfbd0c6

Tree-SHA512: 376e5ac05940493cf2209fea60515c843e978c4b476f2524f6bf7a37a646d237c3ddcf6c0fa23641f9ba550f625609703d9b51b4be631a7f2a90e1092b557232
2023-08-01 12:21:16 -05:00
Wladimir J. van der Laan
b25fa7dcb9 Merge #20568: doc: Use FeeModes doc helper in estimatesmartfee
fa8abdc9953e381715493b259908e246914793b0 rpc: Use FeeModes doc helper in estimatesmartfee (MarcoFalke)

Pull request description:

  Not sure why this doesn't use the doc helper, probably an oversight?

ACKs for top commit:
  laanwj:
    Code review ACK fa8abdc9953e381715493b259908e246914793b0

Tree-SHA512: 1f2dc8356e3476ddcf9cafafa7f9865ad95bed1e3067c0edab8e3c483e374bdbdbecc066167554b4a1b479e28f6a52c4ae6a75a70c67ee4e1ff4f3ba36b04001
2023-08-01 12:21:16 -05:00
Wladimir J. van der Laan
5f5550933f Merge #20468: build: warn when generating man pages for binaries built from a dirty branch
6690adba08006739da0060eb4937126bdfa1181a Warn when binaries are built from a dirty branch. (Tyler Chambers)

Pull request description:

  - Adjusted `--version` flag behavior in bitcoind and bitcoin-wallet to have the same behavior.
  - Added `--version` flag to bitcoin-tx to match.
  - Added functionality in gen-manpages.sh to error when attempting to generate man pages for binaries built from a dirty branch.

  mitigates problem with  issue #20412

ACKs for top commit:
  laanwj:
    Tested ACK 6690adba08006739da0060eb4937126bdfa1181a

Tree-SHA512: b5ca509f1a57f66808c2bebc4b710ca00c6fec7b5ebd7eef58018e28e716f5f2358e36551b8a4df571bf3204baed565a297aeefb93990e7a99add502b97ee1b8
2023-08-01 12:21:16 -05:00
Kittywhiskers Van Gogh
5cb5a6edb0 merge bitcoin#22930: remove glibc back compat 2023-08-01 12:07:31 -05:00
Odysseas Gabrielides
6bacf5423b
feat: v20 evonodes payment adjustment (#5493)
## Issue being fixed or feature implemented
Since v19, Evo nodes are paid 4x blocks in a row.
This needs to be reverted when MN Reward Reallocation activates.

## What was done?
Starting from MN Reward Reallocation activation, Evo nodes are paid one
block in a row (like regular masternodes).
In addition, `nConsecutivePayments` isn't incremented anymore for Evo
nodes.

## How Has This Been Tested?
`feature_llmq_hpmn.py` with MN Reward Reallocation activation.

## Breaking Changes
no

## 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
- [ ] 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>
2023-07-31 23:52:48 -05:00
Konstantin Akimov
359de5a696
feat: improve unit test "IsTriviallyValid" (#5516)
## Issue being fixed or feature implemented
It partially resolves issue https://github.com/dashpay/dash/issues/5471

Better unit tests are needed to validate changes in ProTx implementation
such as this PR: https://github.com/dashpay/dash/pull/5463

## What was done?
- Invalid ProTx transactions are checked more strictly. The flag "tx is
failed" is not enough now for test to succeed, but error code should
matched with expected error.
- Duplicated implementations of tests for "valid" and "invalid
transaction" are changed to more general code.
- Added extra log output with tx ID for easier debug - to see which
exactly tx is failed in test
 - Supported more by 256 txes in one json file

## How Has This Been Tested?
Run unit tests

## 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
- [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
2023-07-31 12:15:03 -05:00
Konstantin Akimov
9bb1b10871
refactor: improved initialization of members of LLMQContext and related changes (#5150)
LLMQContext uses RAII to initialize all members. Ensured that all
members always initialized correctly in proper order if LLMQContext
exists.

BlockAssembler, CChainState use too many agruments and they are making
wrong assumption that members of LLMQContext can be constructed and used
independently, but that's not true. Instead, let's pass LLMQContext
whenever possible.

## Issue being fixed or feature implemented
https://github.com/dashpay/dash-issues/issues/52

## How Has This Been Tested?
Run unit/functional test and introduce no breaking changes.


## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
2023-07-29 20:23:02 -05:00
Kittywhiskers Van Gogh
d40f28edb4 merge bitcoin#19762: Allow named and positional arguments to be used together 2023-07-28 00:18:27 -05:00
Kittywhiskers Van Gogh
4e82a960b6 merge bitcoin#22309: Add missing atomic include 2023-07-28 00:18:27 -05:00
Kittywhiskers Van Gogh
b1643e7c86 merge bitcoin#21575: Create blockstorage module 2023-07-28 00:18:27 -05:00
Kittywhiskers Van Gogh
94b706e402 merge bitcoin#20605: Signal-safe instant shutdown 2023-07-28 00:18:27 -05:00
Kittywhiskers Van Gogh
6c09b33479 merge bitcoin#15946: Allow maintaining the blockfilterindex when using prune 2023-07-28 00:18:27 -05:00