Commit Graph

26103 Commits

Author SHA1 Message Date
MarcoFalke
1d87ce4e86
Merge #18531: rpc: remove deprecated CRPCCommand constructor
faaf9c58e4aa809019d4ca12747dd47411988e37 remove CRPCCommand constructor that takes rpcfn_type function pointer (MarcoFalke)
fa19bb2cd8c575593583138a84e6bb3444d6196d remove dead rpc code (MarcoFalke)

Pull request description:

  Remove the CRPCCommand arguments, now that they are asserted to be equal and thus redundant

  ### Future work

  > Here or follow up, makes sense to also assert type of returned UniValue?

  Sure, but let's not get ahead of ourselves. I am going to submit any further works as follow-ups, including:

  * Removing all python regex linters on the args, now that RPCMan can be used to generate any output, including the cli.cpp table
  * Auto-formatting and sanity checking the RPCExamples with RPCMan
  * Checking passed-in json in self-check. Removing redundant checks
  * Checking returned json against documentation to avoid regressions or false documentation
  * Compile the RPC documentation at compile-time to ensure it doesn't change at runtime and is completely static

  ### Bugs found

  * The assert identified issue #18607
  * The changes itself fixed bug #19250

ACKs for top commit:
  fjahr:
    tested ACK faaf9c58e4aa809019d4ca12747dd47411988e37
  promag:
    Tested ACK faaf9c58e4aa809019d4ca12747dd47411988e37.
  ryanofsky:
    Code review ACK faaf9c58e4aa809019d4ca12747dd47411988e37. Two obviously good simplifications.

Tree-SHA512: 5de3b440f7b2ed2c3e86655d4f0e2e5df9c67e8ce3c7817d5ea5311d1a38690f2f3e28fab41aad6936be9fc884326d037e5f19e85d4d2fe281474dada13911ee
2024-07-15 23:51:24 +07:00
Konstantin Akimov
a7e538d7ae
fix: missing changes from bitcoin#19250 2024-07-15 23:51:24 +07:00
Konstantin Akimov
68c5da41dc
feat: fix help message - all subcommands support it now! 2024-07-15 23:51:23 +07:00
Konstantin Akimov
d3e181f516
fix: add missing client's argument parsing for RPC commands 2024-07-15 23:51:23 +07:00
Konstantin Akimov
37bd4009c1
refactor: use monostate instead std::optional in CoreContext 2024-07-15 23:51:23 +07:00
pasta
1394c41c8d
Merge #6106: feat: create new composite quorum-command platformsign
2db69d7b81 chore: add release notes for "quorum platformsign" (Konstantin Akimov)
283c5f89a2 feat: create new composite command "quorum platformsign" (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  It splits from #6100
  With just whitelist it is impossible to limit the RPC `quorum sign` to use only one specific quorum type, this PR aim to provide ability for quorum signing for platform quorum only.

  ## What was done?
  Implemented a new composite command "quorum platformsign"

  This composite command let to limit quorum type for signing for case of whitelist.
  After that old way to limit platform commands can be deprecated - #6105

  ## How Has This Been Tested?
  Updated a functional tests to use platform signing for Asset Unlocks feature.

  ## 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
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    utACK 2db69d7b81
  PastaPastaPasta:
    utACK 2db69d7b81

Tree-SHA512: b0dff9934137c4faa85664058e1e77f85067cc8d931e6d76ee5b9e610164ac8b0609736d5f09475256cb78d65bf92466624d784f0b13d20136df7e75613662cb
2024-07-15 11:48:18 -05:00
pasta
ebd1d05103
Merge #6100: feat: make whitelist works with composite commands for platform needs
85abbb97b4 chore: add release notes for composite command for whitelist (Konstantin Akimov)
78ad778bb0 feat: test composite commands in functional test for whitelist (Konstantin Akimov)
a102a59787 feat: add support of composite commands in RPC'c whitelists (Konstantin Akimov)

Pull request description:

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

  ## What was done?
  Our composite commands such as "quorum list" have been refactored to make them truly compatible with other features, such as whitelist, see https://github.com/dashpay/dash/pull/6052 https://github.com/dashpay/dash/pull/6051 https://github.com/dashpay/dash/pull/6055 and other related PRs

  This PR makes whitelist feature to be compatible with composite commands.

  Instead implementing additional users such "dapi" better to provide universal way which do not require new build for every new API that has been used by platform, let's simplify things.

  Platform at their side can use config such as this one (created based on shumkov's example):
  ```
  rpc: {
            host: '127.0.0.1',
            port: 9998,
            users: [
              {
                user: 'dashmate',
                password: 'rpcpassword',
                whitelist: null,
                lowPriority: false,
              },
              {
                username: 'platform-dapi',
                password: 'rpcpassword',
                whitelist: [],
                lowPriority: true,
              },
              {
                username: 'platform-drive-consensus',
                password: 'rpcpassword',
                whitelist: [getbestchainlock,getblockchaininfo,getrawtransaction,submitchainlock,verifychainlock,protx_listdiff,quorum_listextended,quorum_info,getassetunlockstatuses,sendrawtransaction,mnsync_status]
                lowPriority: false,
              },
              {
                username: 'platform-drive-other',
                password: 'rpcpassword',
                whitelist: [getbestchainlock,getblockchaininfo,getrawtransaction,submitchainlock,verifychainlock,protx_listdiff,quorum_listextended,quorum_info,getassetunlockstatuses,sendrawtransaction,mnsync_status]
  ],
                lowPriority: true,
              },
            ],
            allowIps: ['127.0.0.1', '172.16.0.0/12', '192.168.0.0/16'],
          },
  ```

  ## How Has This Been Tested?
  Updated functional tests, see commits

  ## 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
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    LGTM, utACK 85abbb97b4
  PastaPastaPasta:
    utACK 85abbb97b4

Tree-SHA512: 88608179c347420269880c352cf9f3b46272f3fc62e8e7158042e53ad69dc460d5210a1f89e1e09081d090250c87fcececade88e2ddec09f73f1175836d7867b
2024-07-15 11:44:31 -05:00
pasta
e7ee059316
Merge #6107: refactor: make coinjoin a composite command
89ade3e340 rpc: disallow `coinjoin stop` if there's no CoinJoin session to stop (Kittywhiskers Van Gogh)
51b6b94fc0 rpc: make `coinjoin` a composite command (Kittywhiskers Van Gogh)

Pull request description:

  ## Breaking Changes

  - `coinjoin stop` will now return an error if there is no CoinJoin mixing session to stop

  ## Checklist:

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
  - [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)_

ACKs for top commit:
  knst:
    utACK 89ade3e340
  UdjinM6:
    utACK 89ade3e340
  PastaPastaPasta:
    utACK 89ade3e340

Tree-SHA512: cde350217dd0ad15e5908eaae63773cad79ec6043e4ff902e2a32b57248ae3f3261e3180c7e39d5385eef361b2c14098b308feb648171c689fef5a3e8467381a
2024-07-15 11:02:55 -05:00
pasta
dad9ff1108
Merge #6103: backport: bitcoin#18638
1840c9441a fix: drop extra pings - follow up for #18638 (UdjinM6)
264e7f9e62 Merge #18638: net: Use mockable time for ping/pong, add tests (MarcoFalke)

Pull request description:

  ## Issue being fixed or feature implemented
  Split from https://github.com/dashpay/dash/pull/6102

  ## What was done?
  So far as bitcoin#19499 is backported, bitcoin#18638 can be finished and removed related workarounds.

  ## How Has This Been Tested?
  Run unit/functional 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

ACKs for top commit:
  UdjinM6:
    utACK 1840c9441a
  PastaPastaPasta:
    utACK 1840c9441a

Tree-SHA512: f34657c14514d6ee596175b3faf9ee44e58e8b0339939a0708d58ab2d119786830c183f9b236ed87c08ef8e1dbd031a38fc596b5aa4d38e10521658df4330e79
2024-07-15 10:57:09 -05:00
pasta
67b092255e
Merge #6102: fix: TODO related fixes for post-v21 release
d3e842f605 refactor: remove dead code which has no use since composite commands are refactored (Konstantin Akimov)
58c5d431fe fix: follow-up to #6017 - enable one more assert in wallet_descriptor test (Konstantin Akimov)
dbed4a31af fix: update comment for wallet_keypool_hd due to bitcoin#17681 DNM (Konstantin Akimov)
4741bcc5c3 chore: remove outdated todo - removed by bitcoin#16898 (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Multiple TODO is reviewed and fixes in this PR

  ## What was done?
  See commits

  ## How Has This Been Tested?
  Run unit/functional 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

ACKs for top commit:
  UdjinM6:
    utACK d3e842f605
  PastaPastaPasta:
    utACK d3e842f605

Tree-SHA512: 25080abcce8fa3dbb4e4c71d321b24cb9d23c073e6caf75366be58623023af50d28bc1cdac4098eb78a87b4fe0f3c33d39bb06257f0590b3e42e5fcad161ea2d
2024-07-15 10:52:50 -05:00
Konstantin Akimov
85abbb97b4
chore: add release notes for composite command for whitelist 2024-07-12 00:07:55 +07:00
Konstantin Akimov
78ad778bb0
feat: test composite commands in functional test for whitelist 2024-07-12 00:07:54 +07:00
Konstantin Akimov
a102a59787
feat: add support of composite commands in RPC'c whitelists 2024-07-12 00:07:53 +07:00
pasta
9456d0761d
Merge #6073: feat: add logging for RPC HTTP requests: command, user, http-code, time of running
1a691bd100 feat: add logging for RPC HTTP requests: command, user, http-code, time of running (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Currently there is no way to gather stats for http rpc in dash core. This PR aim to change it.

  ## What was done?
  Implemented some basic stats for each RPC request:
   - rpc command
   - flag "is external"
   - http status
   - time to serve query (rpc time, not http time)

  ## How Has This Been Tested?
  See new logs:
  ```log
  [httpworker.0] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=platform-user command=getbestblockhash is_external=false status=200 elapsed_time_ms=0
  [httpworker.2] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=platform-user command=quorum is_external=false status=500 elapsed_time_ms=0
  [httpworker.3] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=platform-user command= is_external=false status=401 elapsed_time_ms=0
  [httpworker.3] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=platform-user command=getbestblockhash is_external=true status=200 elapsed_time_ms=28
  [httpworker.0] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=operator command=getbestblockhash is_external=false status=200 elapsed_time_ms=0
  ```

  ## Breaking Changes
  N/A
  It doesn't change behavior of rpc server and http server.

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 1a691bd100

Tree-SHA512: b62fceedb9a901e87c23c4aa6e6dfa7226d44da84a081ea245b40e7ff887103302147cebe0f7ff90bf9c8d4fa9ecafbaa6f25f39d2008f62c4f2beeef2877b57
2024-07-11 11:38:27 -05:00
Kittywhiskers Van Gogh
89ade3e340
rpc: disallow coinjoin stop if there's no CoinJoin session to stop 2024-07-11 16:16:41 +00:00
Kittywhiskers Van Gogh
51b6b94fc0
rpc: make coinjoin a composite command 2024-07-11 16:16:41 +00:00
Konstantin Akimov
2db69d7b81
chore: add release notes for "quorum platformsign" 2024-07-11 12:26:52 +07:00
Konstantin Akimov
283c5f89a2
feat: create new composite command "quorum platformsign"
This composite command let to limit quorum type for signing for case of whitelist
After that old way to limit platform commands can be deprecated
2024-07-11 12:25:50 +07:00
UdjinM6
1840c9441a
fix: drop extra pings - follow up for #18638 2024-07-09 21:46:28 +07:00
pasta
1f113587fb
Merge #6101: fix: cppcheck warnings
3d8ff0cd2d fix: cppcheck warning about coinst in rpc/coinjoin (Konstantin Akimov)
63dfdd7d42 fix: workaround for buggy cppcheck in masternode/utils (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented

  `cppcheck 2.11` on my localhost returns 2 failures, that are not caught by our CI, probably due to difference in version:

      ```
      src/rpc/coinjoin.cpp:73:28: warning: Variable 'chainman' can be declared as reference to const [constVariableReference]
       src/masternode/utils.cpp:0:0: warning: Internal Error. MathLib::toLongNumber: input was not completely consumed: 5s [cppcheckError]

      Advice not applicable in this specific case? Add an exception by updating
      IGNORED_WARNINGS in test/lint/lint-cppcheck-dash.sh
      ```

  ## What was done?
  Adds missing const, workaround for probably a crash in cppcheck 2.11.

  ## How Has This Been Tested?
  Run `test/lint/lint-cppcheck-dash.sh`

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

ACKs for top commit:
  UdjinM6:
    utACK 3d8ff0cd2d
  PastaPastaPasta:
    utACK 3d8ff0cd2d

Tree-SHA512: c4c7e839161a6eb8d7a25b48cd05914d94dc4e4a6d53cbd39728a74a39d626d9b533afd98a9803550d2754df5c86445e5157e0e48853af52ea5ea5cb2e15d97b
2024-07-09 09:38:47 -05:00
pasta
4f5991f151
Merge #6092: fix: mixing for partially unlocked descriptor wallets
c944908399 refactor: simplify implementation of function CWallet::IsLocked (Konstantin Akimov)
685cf34cb9 fix: unlock descriptor wallet for mixing-only (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  As [noticed by kwvg](https://github.com/dashpay/dash/pull/6090#pullrequestreview-2153639183), mixing doesn't work with descriptor wallets if do "unlock only for mixing". This PR is aiming to fix this issue.
  https://github.com/dashpay/dash-issues/issues/59

  ## What was done?
  Removed default argument "bool mixing = false" from WalletStorage interface,
  Refactored a logic of CWallet::IsLocked to make it shorter, clearer and unified with bitcoin.

  ## How Has This Been Tested?
  A. Run Dash-Qt with descriptor wallet, run mixing, enter passphrase.
  The wallet is partially unlocked (for mixing only) - possible to see yellow lock in status. Mixing happens.
  B. Open "send transaction dialog", try to send a transaction: the app asks password to unlock wallet as expected.

  Though, I am not sure how exactly to test that **all** rpc are indeed locked when descriptor wallet is unlocked for mixing only.

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

ACKs for top commit:
  UdjinM6:
    LGTM, ~utACK~ light ACK c944908399
  kwvg:
    ACK c944908399
  PastaPastaPasta:
    utACK c944908399

Tree-SHA512: 236c895dd75042449282b051e90781ace1c941a3b2c34bb29ddadb6e62ba9c8d57c2a677ed98847630ff7fb6df4e14d2b59f3473d8f299ec104afeeb8103930c
2024-07-09 09:37:45 -05:00
pasta
38249a525c
Merge #6096: feat: split type of error in submitchainlock - return enum in CL verifying code
0133c9866d feat: add functional test for submitchainlock far ahead in future (Konstantin Akimov)
6004e06769 feat: return enum in RecoveredSig verifying code, apply for RPC submitchainlock (Konstantin Akimov)
130b6d1e96 refactor: replace static private member method to static method (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Currently by result of `submitchainlock` impossible to distinct a situation when a signature is invalid and when a core is far behind and just doesn't know about signing quorum yet.

  This PR aims to fix this issue, as requested by shumkov for needs of platform:

  > mailformed signature and can’t verify signature due to unknown quorum is the same error?
  > possible to distingush ?

  ## What was done?
  Return enum in CL verifying code `chainlock_handler.VerifyChainLock`.
  The RPC `submitchainlock` now returns error with code=-1 and message `no quorum found. Current tip height: {N} hash: {HASH}`

  ## How Has This Been Tested?
  Functional test `feature_llmq_chainlocks.py` is updated

  ## Breaking Changes
  `submitchainlock` return one more error code - not really a breaking change though, because v21 hasn't released yet.

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

ACKs for top commit:
  UdjinM6:
    utACK 0133c9866d
  PastaPastaPasta:
    utACK 0133c9866d

Tree-SHA512: 794ba410efa57aaa66c47a67914deed97c1d060326e5d11a722c9233a8447f5e9215aa4a5ca401cb2199b8fc445144b2b2a692fc35494bf3296a74e9e115bda7
2024-07-09 09:12:40 -05:00
pasta
154bdd43a0
Merge #6104: fix: adjust incorrect parameter description that says there is a default that doesn't exist
60e36b786a fix: adjust incorrect parameter description that says there is a default that doesn't exist (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  This default doesn't actually exist in code.

  ## What was done?
  Remove default from text

  ## How Has This Been Tested?

  ## Breaking Changes
  None

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

ACKs for top commit:
  UdjinM6:
    utACK 60e36b786a

Tree-SHA512: 658eb2cf101d0450619461b7ffe6069de5c04c1fdcca216713f9374cc1e60413ec9b96c3a2931fb69a4c2f8277dd6677100270960a58197da3b92dffb1e9e327
2024-07-08 18:44:00 -05:00
pasta
50a3b7c552
Merge #6095: fix: createwallet to require 'load_on_startup' for descriptor wallets
a42e9df06f fix: createwallet to require 'load_on_startup' for descriptor wallets (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented

  RPC `createwallet` has changed list of arguments: `createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup )` since https://github.com/dashpay/dash/pull/5965
  `load_on_startup` used to be an argument 5 but now it has a number 6. Both arguments 5 and 6 are boolean and it can confuse an user: they may even not notice that something wrong when it meant to be "load on startup" but got "descriptor wallet" which is not expected.

  See also previous attempt to resolve issue: https://github.com/dashpay/dash/pull/6029

  ## What was done?
  To prevent confusion if user is not aware about this breaking changes, the RPC createwallet throws an exception if user trying to create descriptor wallet but has not mentioned load_on_startup. This requirement can be removed when major amount of users updated to v21.

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

  Tested with CLI:
  ```
  $ createwallet "tmp-create" true true "" false true
  RPC createwallet would not accept creating descriptor wallets without specifying 'load_on_startup' flag. It is required explicitly in v21 due to breaking changes in createwallet RPC (code -8)
  $ createwallet "tmp-create" true true "" false true true
  {
    "name": "tmp-create",
    "warning": "Empty string given as passphrase, wallet will not be encrypted.\nWallet is an experimental descriptor wallet"
  }
  ```

  ## Breaking Changes
  You can't more pass 'descriptor=NN' without  https://github.com/dashpay/dash/pull/5965 which has not been released yet.

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

ACKs for top commit:
  UdjinM6:
    utACK a42e9df06f
  PastaPastaPasta:
    utACK a42e9df06f
  thephez:
    utACK a42e9df06f

Tree-SHA512: bf57fed40d04a32e756e4f8bfabbe39c0cbf87275546c92f4efc19523bc3c5dd3ddc5a884d67285971dc301a6c5808bef979db52c35645ca2db0810046fe1bdc
2024-07-08 12:55:50 -05:00
pasta
60e36b786a
fix: adjust incorrect parameter description that says there is a default that doesn't exist 2024-07-08 12:53:26 -05:00
Konstantin Akimov
0133c9866d
feat: add functional test for submitchainlock far ahead in future 2024-07-09 00:10:07 +07:00
Konstantin Akimov
6004e06769
feat: return enum in RecoveredSig verifying code, apply for RPC submitchainlock
It helps to detect case of Tip is way too far behind: the signature can be
still valid but core can't verify it yet but later it may become a valid signature.
2024-07-09 00:09:49 +07:00
MarcoFalke
264e7f9e62
Merge #18638: net: Use mockable time for ping/pong, add tests
fa3365430c5fb57d7c0b5f2bce9fbbe290be93c3 net: Use mockable time for ping/pong, add tests (MarcoFalke)
faab4aaf2fa1153c6d76efc8113fa01b06943ece util: Add count_microseconds helper (MarcoFalke)

Pull request description:

  Switch `CNode::m_ping_start` and `CNetMessage::m_time` to mockable time, so that tests can be added.

  Mockable time is also type-safe, since it uses `std::chrono`

ACKs for top commit:
  jonatack:
    Code review re-ACK fa33654 re-read code, verified rebase per `git range-diff 4b5c919 fa94d6f fa33654`, previous tested ACKs still valid
  troygiorshev:
    ACK fa3365430c5fb57d7c0b5f2bce9fbbe290be93c3

Tree-SHA512: 7d632bd6019ce7c882029e71b667a61517e783af82755a85dd979ef09380934e172dec8b8f91d57b200a30a6e096aeaf01f19fee7f3aed0e0e871c72eb44d70e
2024-07-08 23:57:01 +07:00
Konstantin Akimov
d3e842f605
refactor: remove dead code which has no use since composite commands are refactored 2024-07-08 23:53:00 +07:00
Konstantin Akimov
58c5d431fe
fix: follow-up to #6017 - enable one more assert in wallet_descriptor test 2024-07-08 23:23:45 +07:00
Konstantin Akimov
dbed4a31af
fix: update comment for wallet_keypool_hd due to bitcoin#17681 DNM 2024-07-08 23:23:45 +07:00
Konstantin Akimov
3d8ff0cd2d
fix: cppcheck warning about coinst in rpc/coinjoin
It fixes this failure:
```
src/rpc/coinjoin.cpp:73:28: warning: Variable 'chainman' can be declared as reference to const [constVariableReference]

Advice not applicable in this specific case? Add an exception by updating
IGNORED_WARNINGS in test/lint/lint-cppcheck-dash.sh
```
2024-07-08 20:32:40 +07:00
Konstantin Akimov
63dfdd7d42
fix: workaround for buggy cppcheck in masternode/utils
It shows this error:
```
src/masternode/utils.cpp:0:0: warning: Internal Error. MathLib::toLongNumber: input was not completely consumed: 5s [cppcheckError]

Advice not applicable in this specific case? Add an exception by updating
IGNORED_WARNINGS in test/lint/lint-cppcheck-dash.sh
```

It doesn't seems as error in our code, but I don't like this warning
2024-07-08 20:31:18 +07:00
Konstantin Akimov
4741bcc5c3
chore: remove outdated todo - removed by bitcoin#16898 2024-07-08 18:23:22 +07:00
Konstantin Akimov
a42e9df06f
fix: createwallet to require 'load_on_startup' for descriptor wallets
createwallet has changed list of arguments: createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup )
load_on_startup used to be an argument 5 but now has a number 6.
Both arguments 5 and 6 are boolean and it can confuse an user.

To prevent confusion if user is not aware about this breaking changes,
the RPC createwallet throws an exception if user trying to create descriptor wallet but has not mentioned load_on_startup.
This requirement can be removed when major amount of users updated to v21
2024-07-07 21:56:16 +07:00
Konstantin Akimov
130b6d1e96
refactor: replace static private member method to static method 2024-07-05 16:13:05 +07:00
Konstantin Akimov
c944908399
refactor: simplify implementation of function CWallet::IsLocked 2024-07-03 15:35:29 +07:00
Konstantin Akimov
685cf34cb9
fix: unlock descriptor wallet for mixing-only 2024-07-03 15:35:28 +07:00
pasta
6e5d3f1d1f
Merge #6090: fix: auto backup issue with descriptor wallets for CJ
bebea4b9b6 fix: auto backup issue with descriptor wallets for CJ (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Qt CoinJoin session has problems (https://github.com/dashpay/dash/pull/5579#pullrequestreview-1912946808):
   - Autobackup problems
   - False keypool depletion reporting

  https://github.com/dashpay/dash-issues/issues/59

  ## What was done?
  Disables check for "remaining keys left" and "auto-backups" for non-legacy wallet.

  ## How Has This Been Tested?
  Run unit/functional test
  Try to run CJ mixing for descriptor wallet.

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

ACKs for top commit:
  PastaPastaPasta:
    utACK bebea4b9b6

Tree-SHA512: 610551001d054c447ddca9451ac6d94f3d063ecf3ccfab437d99324efc5f99ff86e59d80a36f4ff4983d3c8107aa19292c021cb3210fcf51e79919387169c414
2024-07-02 08:47:24 -05:00
pasta
85ba35c6f5
Merge #6088: feat: add a marker experimental for descriptor wallets
684503db6b feat: add a marker experimental for descriptor wallets (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Descriptor wallets pass most of functional tests now, but they are not really tested in-the-real-environment by multiple users.

  ## What was done?
  Add a marker "experimental" for 'createwallet' rpc, for create wallet UI form.

  ## How Has This Been Tested?
  Run and check

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 684503db6b

Tree-SHA512: e843e5b8080c7cd4273ea532038f3ec65e0260419b2c2a3db07ee1fadd856a7ce47f367705b4ddb19c5fc91cee5a529a54d580dbf53428c3e5e8b433c96ec0c9
2024-07-02 08:43:56 -05:00
pasta
f33474240e
Merge #6089: fix: crash if try to upgradetohd descriptor wallet
e708a4b047 fix: crash if try to upgradetohd descriptor wallet (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented

  If `upgradetohd` is called for blank descriptor wallet it can cause a crash:
  ```
  Posix Signal: Segmentation fault
     0#: (0x55A0C7658814) stl_vector.h:115        - std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data::_M_copy_data(std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data const&)
     1#: (0x55A0C7658814) stl_vector.h:127        - std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data::_M_swap_data(std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data&)
     2#: (0x55A0C7658814) stl_vector.h:1959       - std::vector<unsigned long, std::allocator<unsigned long> >::_M_move_assign(std::vector<unsigned long, std::allocator<unsigned long> >&&, std::integral_constant<bool, true>)
     3#: (0x55A0C7658814) stl_vector.h:768        - std::vector<unsigned long, std::allocator<unsigned long> >::operator=(std::vector<unsigned long, std::allocator<unsigned long> >&&)
     4#: (0x55A0C7658814) stacktraces.cpp:777     - HandlePosixSignal
     5#: (0x744F89C42990) libc_sigaction.c        - ???
     6#: (0x55A0C7789926) scriptpubkeyman.cpp:418 - LegacyScriptPubKeyMan::GenerateNewHDChain(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&)
     7#: (0x55A0C77BEC2E) wallet.cpp:5033         - CWallet::UpgradeToHD(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, bilingual_str&)
     8#: (0x55A0C775B85F) rpcwallet.cpp:2839      - operator()
     9#: (0x55A0C775BBB4) std_function.h:292      - _M_invoke
    10#: (0x55A0C72D4BC2) univalue.h:17           - UniValue::operator=(UniValue&&)
    11#: (0x55A0C72D4BC2) server.h:110            - CRPCCommand::CRPCCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, RPCHelpMan (*)(), std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)::{lambda(JSONRPCRequest const&, UniValue&, bool)#1}::operator()(JSONRPCRequest const&, UniValue&, bool) const
    12#: (0x55A0C76ED57C) basic_string.h:792      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
    13#: (0x55A0C76ED57C) request.h:29            - JSONRPCRequest::~JSONRPCRequest()
    14#: (0x55A0C76ED57C) interfaces.cpp:576      - operator()
    15#: (0x55A0C723B3D9) std_function.h:292      - _M_invoke
    16#: (0x55A0C73D4FFC) std_function.h:591      - std::function<bool (JSONRPCRequest const&, UniValue&, bool)>::operator()(JSONRPCRequest const&, UniValue&, bool) const
    17#: (0x55A0C73D4FFC) server.cpp:609          - ExecuteCommand
    18#: (0x55A0C73D4FFC) server.cpp:528          - CRPCTable::execute(JSONRPCRequest const&) const
    19#: (0x55A0C72421FB) basic_string.h:223      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const
    20#: (0x55A0C72421FB) basic_string.h:264      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_is_local() const
    21#: (0x55A0C72421FB) basic_string.h:282      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()
    22#: (0x55A0C72421FB) basic_string.h:792      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
    23#: (0x55A0C72421FB) request.h:29            - JSONRPCRequest::~JSONRPCRequest()
    24#: (0x55A0C72421FB) interfaces.cpp:487      - executeRpc
    25#: (0x55A0C6F37700) univalue.h:17           - UniValue::operator=(UniValue&&)
    26#: (0x55A0C6F37700) rpcconsole.cpp:338      - RPCConsole::RPCParseCommandLine(interfaces::Node*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, WalletModel const*)
    27#: (0x55A0C6F38475) rpcconsole.cpp:444      - RPCExecutor::request(QString const&, WalletModel const*)
    28#: (0x55A0C8064490) <unknown-file>          - ???
    29#: (0x55A0C82E95B2) <unknown-file>          - ???
  Aborted (core dumped)
  ```

  ## What was done?
  Added a guard in UpgradeToHD that wallet is not descriptor wallet.

  ## How Has This Been Tested?
  Create wallet "Blank" + "Descriptor".
  Call rpc "upgradetohd" -> no crash

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

ACKs for top commit:
  PastaPastaPasta:
    utACK e708a4b047

Tree-SHA512: 1963606b52e9aed13ba0f4d27f5c2e590351970842333f54c39612d4dc2d47f0ad7ac87cbff2473d2b3544d1f21dded10f9d84c109c2224f4e8070309655b053
2024-07-02 08:38:54 -05:00
Konstantin Akimov
684503db6b
feat: add a marker experimental for descriptor wallets 2024-07-02 01:11:15 +07:00
Konstantin Akimov
bebea4b9b6
fix: auto backup issue with descriptor wallets for CJ 2024-07-02 00:23:19 +07:00
pasta
acc42267d4
Merge #6080: feat: bump protocol version to distinguish v21 from v20.1
375838378a feat: bump protocol version to distinguish v21 from v20.1 (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  See commit

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes
  None really; will require MNs to upgrade in order to not be banned

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

Top commit has no ACKs.

Tree-SHA512: c4a61e3c9a1ccda9b00a8982eaaff6ea7672bf59d9538342b0e45a16977554224b44b34db48d3355d28e2b26a01ab3133a5e0c38bb00a3d7a1410cfd1fcfc4ae
2024-07-01 11:45:29 -05:00
pasta
d2bbff3927
Merge #6087: feat: stricter bestCLHeightDiff checks
6c5246803d test: add tests for both current and future behaviour (UdjinM6)
4e86bda4dc feat: stricter bestCLHeightDiff checks (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  Current `bestCLHeightDiff` checks are too relaxed

  ## What was done?
  Make`bestCLHeightDiff` checks stricter

  ## How Has This Been Tested?
  Run a node on mainnet/testet, run tests

  ## Breaking Changes
  Old nodes aren't aware of this new logic so it's activated via `mn_rr` hardfork

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 6c5246803d

Tree-SHA512: 2028d0ceb00a2270c92831ef38488d009d0bac47be4fc6a23ac93efdcf74847f1b9e99a529863fb4e14c65f120adda4e12c5b9e084d0f667d5f0fbaf80e3701d
2024-07-01 11:41:19 -05:00
UdjinM6
6c5246803d
test: add tests for both current and future behaviour 2024-07-01 11:38:26 -05:00
Konstantin Akimov
e708a4b047
fix: crash if try to upgradetohd descriptor wallet
Posix Signal: Segmentation fault
   0#: (0x55A0C7658814) stl_vector.h:115        - std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data::_M_copy_data(std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data const&)
   1#: (0x55A0C7658814) stl_vector.h:127        - std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data::_M_swap_data(std::_Vector_base<unsigned long, std::allocator<unsigned long> >::_Vector_impl_data&)
   2#: (0x55A0C7658814) stl_vector.h:1959       - std::vector<unsigned long, std::allocator<unsigned long> >::_M_move_assign(std::vector<unsigned long, std::allocator<unsigned long> >&&, std::integral_constant<bool, true>)
   3#: (0x55A0C7658814) stl_vector.h:768        - std::vector<unsigned long, std::allocator<unsigned long> >::operator=(std::vector<unsigned long, std::allocator<unsigned long> >&&)
   4#: (0x55A0C7658814) stacktraces.cpp:777     - HandlePosixSignal
   5#: (0x744F89C42990) libc_sigaction.c        - ???
   6#: (0x55A0C7789926) scriptpubkeyman.cpp:418 - LegacyScriptPubKeyMan::GenerateNewHDChain(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&)
   7#: (0x55A0C77BEC2E) wallet.cpp:5033         - CWallet::UpgradeToHD(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> > const&, bilingual_str&)
   8#: (0x55A0C775B85F) rpcwallet.cpp:2839      - operator()
   9#: (0x55A0C775BBB4) std_function.h:292      - _M_invoke
  10#: (0x55A0C72D4BC2) univalue.h:17           - UniValue::operator=(UniValue&&)
  11#: (0x55A0C72D4BC2) server.h:110            - CRPCCommand::CRPCCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, RPCHelpMan (*)(), std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)::{lambda(JSONRPCRequest const&, UniValue&, bool)#1}::operator()(JSONRPCRequest const&, UniValue&, bool) const
  12#: (0x55A0C76ED57C) basic_string.h:792      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
  13#: (0x55A0C76ED57C) request.h:29            - JSONRPCRequest::~JSONRPCRequest()
  14#: (0x55A0C76ED57C) interfaces.cpp:576      - operator()
  15#: (0x55A0C723B3D9) std_function.h:292      - _M_invoke
  16#: (0x55A0C73D4FFC) std_function.h:591      - std::function<bool (JSONRPCRequest const&, UniValue&, bool)>::operator()(JSONRPCRequest const&, UniValue&, bool) const
  17#: (0x55A0C73D4FFC) server.cpp:609          - ExecuteCommand
  18#: (0x55A0C73D4FFC) server.cpp:528          - CRPCTable::execute(JSONRPCRequest const&) const
  19#: (0x55A0C72421FB) basic_string.h:223      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const
  20#: (0x55A0C72421FB) basic_string.h:264      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_is_local() const
  21#: (0x55A0C72421FB) basic_string.h:282      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()
  22#: (0x55A0C72421FB) basic_string.h:792      - std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
  23#: (0x55A0C72421FB) request.h:29            - JSONRPCRequest::~JSONRPCRequest()
  24#: (0x55A0C72421FB) interfaces.cpp:487      - executeRpc
  25#: (0x55A0C6F37700) univalue.h:17           - UniValue::operator=(UniValue&&)
  26#: (0x55A0C6F37700) rpcconsole.cpp:338      - RPCConsole::RPCParseCommandLine(interfaces::Node*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, WalletModel const*)
  27#: (0x55A0C6F38475) rpcconsole.cpp:444      - RPCExecutor::request(QString const&, WalletModel const*)
  28#: (0x55A0C8064490) <unknown-file>          - ???
  29#: (0x55A0C82E95B2) <unknown-file>          - ???
Aborted (core dumped)
2024-07-01 16:37:47 +07:00
Konstantin Akimov
1a691bd100
feat: add logging for RPC HTTP requests: command, user, http-code, time of running 2024-06-30 13:29:25 +07:00
pasta
c1de83bf8f
Merge #6083: refactor: move Get*Index to rpc/index_util.cpp, const-ify functions and arguments, add lock annotations and some minor housekeeping
8fb863008e refactor: inline sorting and make available through argument (Kittywhiskers Van Gogh)
3e0fcf471f refactor: move accessing CBlockTreeDB global out of Get*Index (Kittywhiskers Van Gogh)
ee9d11214e refactor: move pair value swapping out of CTxMemPool::getAddressIndex() (Kittywhiskers Van Gogh)
808842b1a3 refactor: define all key/value pairings as *Entry and use them instead (Kittywhiskers Van Gogh)
488f0474a8 rpc: extend error-on-failure to GetSpentIndex (Kittywhiskers Van Gogh)
9a6503d9e8 refactor: make CBlockTreeDB::Read*Index arguments const (Kittywhiskers Van Gogh)
625982e8d2 refactor: make CTxMemPool::get*Index functions and arguments const (Kittywhiskers Van Gogh)
5ad49ad668 refactor: move Get{Address*, Timestamp, Spent}Index out of validation (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  This pull request is motivated by [bitcoin#22371](https://github.com/bitcoin/bitcoin/pull/22371), which gets rid of the `pblocktree` global.

  The sole usage of `pblocktree` introduced by Dash is for managing our {address, spent, timestamp} indexes with most of invocations within `BlockManager` or `CChainState`, granting them internal access to `pblocktree` (now `m_block_tree_db`). The sole exception being `Get*Index`, that relies on accessing the global and has no direct internal access.

  This pull request aims to refactor code associated with `Get*Index` with the eventual aim of moving gaining access to the global out of the function. `Get*Index` is called exclusively called through RPC, which makes giving it access to `ChainstateManager` quite easy, which makes switching from the global to accessing it through `ChainstateManager` when backporting  [bitcoin#22371](https://github.com/bitcoin/bitcoin/pull/22371) a drop-in replacement.

  Alongside that, the surrounding code has been given some TLC:

  * Moving code out of `validation.cpp` and into `rpc/index_util.cpp`. The code is exclusively used in RPC logic and doesn't aid in validation.
  * Add lock annotations for accessing `pblocktree` (while already protected by `::cs_main`, said protection is currently not enforced but will be once moved into `BlockManager` in the backport)
  * `const`-ing input arguments and using pass-by-value for input arguments that can be written inline (i.e. types like `CSpentIndexKey` are still pass-by-ref).
    * While `const`ing `CTxMemPool` functions were possible (courtesy of the presence of `const_iterator`s), the same is currently not possible with `CBlockTreeDB` functions as the iterator is non-`const`.
  * Extend error messages to `GetSpentIndex` to bring it line with other `Get*Index`es.
  * Define key-value pairings as a `*Entry` typedef and replacing all explicit type constructions with it.
  * Make `CTxMemPool::getAddressIndex` indifferent to how `CMempoolAddressDeltaKey` is constructed.
    * Current behaviour is to accept a `std::pair<uint160, AddressType>` and construct the `CMempoolAddressDeltaKey` internally, this was presumably done to account for the return type of `getAddressesFromParams` in the sole call for the `CTxMemPool::getAddressIndex`.
    * This has been changed, moving the construction into the RPC call.
   * Moving {height, timestamp} sorting out of RPC and into the applicable `Get*Index` functions.

  ## Breaking Changes

  None expected.

  ## Checklist:

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 8fb863008e
  UdjinM6:
    utACK 8fb863008e

Tree-SHA512: 425a383e8284bbd74a5e9bcda4a9d7988221197055f43faa591e6f0d579625cee28f6a6046dab951e7afa0c3e33af1778fb4bb5f0a2e1e5792fe0d9396897a14
2024-06-29 14:48:46 -05:00
pasta
3e342d797e
Merge #6086: backport: bitcoin/bitcoin#27610: Improve performance of p2p inv to send queues
489b44c647 Merge bitcoin/bitcoin#27610: Improve performance of p2p inv to send queues (fanquake)

Pull request description:

  ## Issue being fixed or feature implemented
  Couple of performance improvements when draining the inventory-to-send queue:

     * drop txs that have already been evicted from the mempool (or included in a block) immediately, rather than at the end of processing
     * marginally increase outgoing trickle rate during spikes in tx volume

  ## What was done?
  Backport bitcoin#27610

  ## How Has This Been Tested?
  Run unit/functional 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

ACKs for top commit:
  UdjinM6:
    utACK 489b44c647
  PastaPastaPasta:
    utACK 489b44c647

Tree-SHA512: 4afca4705b0f9680d147f0bef006fb82a6fd9692fef898dd50aede8570d02b6fece367ec30ab2caa973279df28d90348006a1f78b550dd8b0f7e72dbcb1bba5b
2024-06-29 14:45:33 -05:00