Compare commits

...

230 Commits

Author SHA1 Message Date
pasta
47972aab8c
feat: serialize on the stack 2024-12-18 07:57:39 -06:00
pasta
dd96032e12
Merge #6494: depends: update 'src/dashbls' to dashpay/bls-signatures@0bb5c5b0 as efd5c56
Some checks failed
Label Merge Conflicts / main (push) Failing after 24s
CI / Build Image (push) Failing after 52s
CI / Build (linux64_ubsan, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build Dependencies (arm-linux, arm-linux-gnueabihf) (push) Has been skipped
CI / Build Dependencies (linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (arm-linux, arm-linux, arm-linux-gnueabihf) (push) Has been skipped
CI / Build (linux64, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_cxx20, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_fuzz, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_nowallet, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_sqlite, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_tsan, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
Check Merge Fast-Forward Only / check_merge (push) Successful in 1m35s
Guix Build / build-image (push) Failing after 3m21s
Guix Build / build (aarch64-linux-gnu) (push) Has been skipped
Guix Build / build (arm-linux-gnueabihf) (push) Has been skipped
Guix Build / build (arm64-apple-darwin) (push) Has been skipped
Guix Build / build (powerpc64-linux-gnu) (push) Has been skipped
Guix Build / build (riscv64-linux-gnu) (push) Has been skipped
Guix Build / build (x86_64-apple-darwin) (push) Has been skipped
Guix Build / build (x86_64-linux-gnu) (push) Has been skipped
Guix Build / build (x86_64-w64-mingw32) (push) Has been skipped
3bbe16c390 build: stop tracking cmake dependency relic_conf.h.in (Kittywhiskers Van Gogh)
efd5c566da Squashed 'src/dashbls/' changes from 7e747e8a07..0bb5c5b032 (Kittywhiskers Van Gogh)
257fd5ef9e revert: stop tracking cmake dependency relic_conf.h.in (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Dependency for https://github.com/dashpay/dash/pull/6493
  * Expected subtree hash `7bec74f04710e6031590283cf405e3f141bc63310cafe5e70aae9b8d4c98cbef` (see [instructions](https://github.com/dashpay/dash/pull/6323#pullrequestreview-2357380766) to calculate)
  * Includes [bls-signatures#75](https://github.com/dashpay/bls-signatures/pull/75) and [bls-signatures#106](https://github.com/dashpay/bls-signatures/pull/106)

  ## Breaking Changes

  None expected.

  ## Checklist:

  - [x] I have performed a self-review of my own code **(note: N/A)**
  - [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 3bbe16c390
  UdjinM6:
    subtree looks good, utACK 3bbe16c390

Tree-SHA512: 3f6853f90dfe5e3040189742858b6728e4ab505513202216f1e2f7213569798d2f2e346d73ece7505f87dc2439fde4c3a51472461163fc7c21734a734cbc0bdb
2024-12-17 11:44:08 -06:00
pasta
a5d54006b3
Merge #6304: backport: merge bitcoin#23280 (coalesce chainstate loading sequence between {,non-}unittest codepaths)
19746513b1 refactor: move remaining `LogPrintf` usage outside (Kittywhiskers Van Gogh)
04dbaa8bd8 style-only: Remove redundant scope in *Chainstate (Kittywhiskers Van Gogh)
872158d248 Remove all #include // for * comments (Kittywhiskers Van Gogh)
09ab62948f test/setup: Use LoadChainstate (Kittywhiskers Van Gogh)
459f33983b node/chainstate: extract Dash post-`InitializeChainstate` logic (Kittywhiskers Van Gogh)
c06e07461e node/chainstate: Add options for in-memory DBs (Kittywhiskers Van Gogh)
52bb35d9c8 node/caches: Remove intermediate variables (Kittywhiskers Van Gogh)
4ab182751e node/caches: Extract cache calculation logic (Kittywhiskers Van Gogh)
d7f1e234c5 validation: VerifyDB only needs Consensus::Params (Kittywhiskers Van Gogh)
c405492874 node/chainstate: Decouple from ShutdownRequested (Kittywhiskers Van Gogh)
fdf803d013 node/chainstate: Decouple from GetTime (Kittywhiskers Van Gogh)
f7aef8d331 init: Delay RPC block notif until warmup finished (Kittywhiskers Van Gogh)
94c0ceb29c Move -checkblocks LogPrintf to AppInitMain (Kittywhiskers Van Gogh)
d3345eeccc node/chainstate: Reduce coupling of LogPrintf (Kittywhiskers Van Gogh)
a141f5d9a7 node/chainstate: Decouple from concept of uiInterface (Kittywhiskers Van Gogh)
913411ed73 Split off VerifyLoadedChainstate (Kittywhiskers Van Gogh)
53231ca29d node/chainstate: Remove do/while loop (Kittywhiskers Van Gogh)
2ea1bbc7aa Move init logistics message for BAD_GENESIS_BLOCK to init.cpp (Kittywhiskers Van Gogh)
29c736280d Move mempool nullptr Assert out of LoadChainstate (Kittywhiskers Van Gogh)
7071282a2d node/chainstate: Decouple from concept of NodeContext (Kittywhiskers Van Gogh)
ee9d3dd5fc node/chainstate: Decouple from ArgsManager (Kittywhiskers Van Gogh)
d7419e42d6 node/chainstate: Decouple from stringy errors (Kittywhiskers Van Gogh)
9ab08c42e4 node/chainstate: Decouple from GetTimeMillis (Kittywhiskers Van Gogh)
2455c06464 node: Extract chainstate loading sequence (Kittywhiskers Van Gogh)
620146bcb8 chore: sync chainstate loading logic with upstream (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Dependent on https://github.com/dashpay/dash/pull/6296

  * Dependent on https://github.com/dashpay/dash/pull/6443

  * As one of the backport's intentions were to unify code between `init.cpp` and `setup_common.cpp`, Dash-specific initialization code (to the extent that it can be moved out non-disruptively) has been spun out into `DashChainstateSetup{,Close}()` so it can also be used in `setup_common.cpp` and `validation_chainstatemanager_tests.cpp`.

    This is also why `DashTestSetup{,Close}()` (now `DashPostChainstateSetup{,Close}()`) was introduced in [dash#5531](https://github.com/dashpay/dash/pull/5531).
    * `DashChainstateSetup{,Close}()` (as defined in `node/chainstate.cpp`) cannot take `NodeContext` in because  `node/chainstate.cpp` is used in `bitcoin-chainstate`, which doesn't include `NodeContext` ([source](https://github.com/bitcoin/bitcoin/pull/24304/files#diff-4cb884d03ebb901069e4ee5de5d02538c40dd9b39919c615d8eaa9d364bbbd77R795-R798)), this is reflected by neither `LoadChainstate` nor `VerifyLoadedChainstate` taking in `NodeContext`.

    * To make it less onerous to use in unit tests, `DashChainstateSetup{,Close}()` has been overloaded with a variant that accepts `NodeContext`.

  * To remove `LogPrintf` usage in `node/chainstate.cpp`, index enablement reporting has been pulled out of chainstate loading and BLS scheme reporting has been abstracted out using `notify_bls_state`.

  ## 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
  - [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:
  UdjinM6:
    utACK 19746513b1
  PastaPastaPasta:
    utACK 19746513b1

Tree-SHA512: 8ebfce48dccc6a867339aff9374a4cb8dc7b02b0c17432db2b97c982523d0d9589a87e6527a103f314bf32be176486311ef6dcde1c4d5cdccc1eeb1f80bbb040
2024-12-17 10:04:34 -06:00
Kittywhiskers Van Gogh
3bbe16c390
build: stop tracking cmake dependency relic_conf.h.in 2024-12-17 04:34:08 +00:00
Kittywhiskers Van Gogh
43043e623f
depends: update 'src/dashbls' to dashpay/bls-signatures@0bb5c5b0 as efd5c566 2024-12-17 04:29:16 +00:00
Kittywhiskers Van Gogh
efd5c566da Squashed 'src/dashbls/' changes from 7e747e8a07..0bb5c5b032
0bb5c5b032 Merge pull request #107 from kwvg/bump_1.3.5
3170e82074 Merge pull request #106 from UdjinM6/bench_chore
6091f5c056 chore: bump version to 1.3.5
90fd986fa5 chore: drop irrelevant PopSchemeMPL benchmark
ba391e681e bench: use BasicSchemeMPL instead of AugSchemeMPL
bcc6cf9cda bench: add benchmars for Serialize/SerializeToArray
cc649f38ee feat: serialize on the stack (#75)

git-subtree-dir: src/dashbls
git-subtree-split: 0bb5c5b03249c463debb5cef5f7e52ee66f3aaab
2024-12-17 04:29:16 +00:00
pasta
7530f3d245
Merge #6490: ci: container improvements
Some checks failed
CI / Build Image (push) Failing after 2m9s
CI / Build Dependencies (arm-linux, arm-linux-gnueabihf) (push) Has been skipped
CI / Build Dependencies (linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (arm-linux, arm-linux, arm-linux-gnueabihf) (push) Has been skipped
CI / Build (linux64, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_cxx20, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_fuzz, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_nowallet, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_sqlite, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_tsan, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
CI / Build (linux64_ubsan, linux64, x86_64-pc-linux-gnu) (push) Has been skipped
Label Merge Conflicts / main (push) Failing after 2m49s
Check Merge Fast-Forward Only / check_merge (push) Successful in 1m51s
Guix Build / build-image (push) Failing after 6m6s
Guix Build / build (aarch64-linux-gnu) (push) Has been skipped
Guix Build / build (arm-linux-gnueabihf) (push) Has been skipped
Guix Build / build (arm64-apple-darwin) (push) Has been skipped
Guix Build / build (x86_64-apple-darwin) (push) Has been skipped
Guix Build / build (powerpc64-linux-gnu) (push) Has been skipped
Guix Build / build (x86_64-linux-gnu) (push) Has been skipped
Guix Build / build (riscv64-linux-gnu) (push) Has been skipped
Guix Build / build (x86_64-w64-mingw32) (push) Has been skipped
04ce1fea52 ci: deduplicate macOS SDK setup logic (Kittywhiskers Van Gogh)
8dd0db7de9 ci: fix "LC_ALL: cannot change locale (en_US.UTF-8)" in Guix container (Kittywhiskers Van Gogh)
187fe17650 ci: don't stage packages in `/tmp`, reduce layers for `cppcheck` build (Kittywhiskers Van Gogh)
eef863554a ci: install `i386` packages only if host is `amd64`, merge layers (Kittywhiskers Van Gogh)
e7702292d1 ci: purge package manager cache after each interaction (Kittywhiskers Van Gogh)
b7099eed47 ci: remove redundant `version` attribute, avoid `lldb` personality error (Kittywhiskers Van Gogh)
64cdc42130 ci: add LLVM library path to `LD_LIBRARY_PATH` and GDB allowlist (Kittywhiskers Van Gogh)
440fd3fe21 ci: drop distro LLVM packages, move Clang install up, set defaults (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * This pull request pulls container-specific changes from [dash#6387](https://github.com/dashpay/dash/pull/6387), [dash#6400](https://github.com/dashpay/dash/pull/6400) and [dash#6421](https://github.com/dashpay/dash/pull/6421)

  * The `HOST` check before running `setup_sdk.sh` isn't a part of the script itself as the script is written to be independent of external variables set. The caller is expected to know the conditions needed to run `setup_sdk.sh` as the script is _relatively_ agnostic to its environment.

  * The `version` attribute in the [`develop`](a8e2316d6f/contrib/containers/develop/docker-compose.yml) and [`guix`](a8e2316d6f/contrib/containers/guix/docker-compose.yml) container's `docker-compose.yml` has been dropped as the attribute has been deprecated in the compose spec ([source](65ef9f4a5d/spec.md (version-top-level-element-obsolete))).

  * Using `LD_LIBRARY_PATH` to point to LLVM's libraries are acceptable and will not interfere with executing binaries built using the distro's packaged compiler as it will eventually search default paths and find the libraries shipped with the distro ([source](https://man7.org/linux/man-pages/man8/ld.so.8.html)).

  * Currently, running LLDB will result in a "personality set failed: Operation not permitted" error ([source](https://discourse.llvm.org/t/running-lldb-in-a-container/76801)). This is caused by its attempt at disabling ASLR for debugging.

    To work around this error, the container will now operate under relaxed restrictions (`seccomp=unconfined`). As disabling ASLR is valuable when debugging and the container is meant for developers (i.e. it isn't used for CI), we have opted to relax restrictions instead of skipping ASLR disablement.

  * As of `develop` (a8e2316d6f), packages built by the container are stored in `/tmp`, which is inadvisable as it is the same directory used to store functional test runs and it's not too difficult to delete `/tmp`'s contents to save space in a long running [`develop`](a8e2316d6f/contrib/containers/develop/docker-compose.yml) container and then realize that both `shellcheck` and `cppcheck` are stored there and now you have to ditch the container you're working in and restart it.
    * To remedy this, packages are now built and stored in `/opt` in accordance with the FHS ([source](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s13.html)). `/usr/local` was a contender but it's pre-populated, meanwhile `ls /opt` would give you a very quick picture of what's built for the container.

    * `/tmp` will not be entirely empty because [pypa/pip#10753](https://github.com/pypa/pip/issues/10753) results in residual `.pem` files leaking into `/tmp` and `pyenv` stores its build log there and keeping it around has some debug value.

  ## 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
  - [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:
  UdjinM6:
    ACK 04ce1fea52
  PastaPastaPasta:
    utACK 04ce1fea52

Tree-SHA512: 5442ae06cb73b9bc4eec908803548195ae8fd9150422789e5f98578ad01a303b5361f9ba42fe8faee27ac91e38328b7771e4ba42b296dfa70ecbbfc7d10436b6
2024-12-16 22:29:09 -06:00
Kittywhiskers Van Gogh
257fd5ef9e
revert: stop tracking cmake dependency relic_conf.h.in
reverts:
- 02260cba57.
2024-12-17 04:28:10 +00:00
pasta
5bf0409eba
Merge #6300: backport: Merge bitcoin#23642, 22794, 23316, 24365, gui#517, 24219, 23253, 24449, 22543
3931608858 Merge bitcoin/bitcoin#22543: test: Use MiniWallet in mempool_limit.py (merge-script)
f147373a32 Merge bitcoin/bitcoin#24449: fuzz: FuzzedFileProvider::write should not return negative value (MarcoFalke)
2a2a2693d0 Merge bitcoin/bitcoin#23253: bitcoin-tx: Reject non-integral and out of range int strings (W. J. van der Laan)
11eeae2ab9 Merge bitcoin/bitcoin#24219: Fix implicit-integer-sign-change in bloom (MarcoFalke)
f16265dd50 Merge bitcoin-core/gui#517: refactor, qt: Use std::chrono for parameters of QTimer methods (Hennadii Stepanov)
b212ca0515 Merge bitcoin/bitcoin#24365: wallet: Don't generate keys for wallets with private keys disabled during upgradewallet (laanwj)
66e77f7879 Merge bitcoin/bitcoin#23316: test: make the node param explicit in init_wallet() (MarcoFalke)
995cae46af Merge bitcoin/bitcoin#22794: test: Verify if wallet is compiled in rpc_invalid_address_message.py test (MarcoFalke)
61a0140362 Merge bitcoin/bitcoin#23642: refactor: Call type-solver earlier in decodescript (MarcoFalke)

Pull request description:

  Bitcoin Backports

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

Tree-SHA512: 38f384776002e8014b2510aeaf1f4655fea0531011eb326eb2ab546d9e7193ad9e5c4b570d9831f88bb696e06ded04259a21ddb750d7ffedfedebdbb9a951379
2024-12-16 21:01:12 -06:00
pasta
a9cfd39390
Merge #6491: ci: merge bitcoin#27314, #28954, fix multiprocess builds
27d9763b1b fix: add `linux64_multiprocess` `BUILD_TARGET` to matrix, mend C(XX) (Kittywhiskers Van Gogh)
26cc5a1c90 ci: use underscore to separate variant name from target triple (Kittywhiskers Van Gogh)
d0131a5259 trivial: sort `BUILD_TARGET` on GitHub and in `matrix.sh` alphabetically (Kittywhiskers Van Gogh)
4f1b5c165b merge bitcoin#28954: Reduce use of bash -c (Kittywhiskers Van Gogh)
a49162ffae merge bitcoin#27314: Fix handling of `CXX=clang++` when building `qt` package (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * [bitcoin#27314](https://github.com/bitcoin/bitcoin/pull/27314) has been backported in this PR as [bitcoin#25838](https://github.com/bitcoin/bitcoin/pull/25838) (backported in [dash#6384](https://github.com/dashpay/dash/pull/6384)) broke Clang depends builds.

  * [bitcoin#28954](https://github.com/bitcoin/bitcoin/pull/28954) has been backported to fix a problem associated with multiprocess runs ([build](https://gitlab.com/dashpay/dash/-/jobs/8396677312#L2921)).

  * Support for multiprocess builds were enabled _proper_ in [dash#6143](https://github.com/dashpay/dash/pull/6143) but unfortunately, the configuration params for multiprocess builds were not processed by CI as the build variant was not added to `matrix.sh` ([source](6a51ab271d/ci/dash/matrix.sh)). This is evident by comparing two variants with Boost::Process enablement (`--with-boost-process`), `linux64_fuzz` ([source](6a51ab271d/ci/test/00_setup_env_native_fuzz.sh (L19))) and `linux64_multiprocess` ([source](6a51ab271d/ci/test/00_setup_env_native_multiprocess.sh (L13))).

    Looking at a `develop` (6a51ab271d) build, the fuzz build has it enabled ([source](https://gitlab.com/dashpay/dash/-/jobs/8394892905#L737)) while the multiprocess build doesn't ([source](https://gitlab.com/dashpay/dash/-/jobs/8394892909#L1524)) despite both scripts having the enablement argument.

  ## 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 27d9763b1b
  UdjinM6:
    utACK 27d9763b1b

Tree-SHA512: 3e2fb72d4211875a162d3aecb994c5bd43b2f6d9fea0804d7e00a38a034672730f9351ceb9256ace38e32f7ef81527c8a034a870e5099a277dfd06f9fa54b480
2024-12-16 20:42:35 -06:00
pasta
0968a0023b
Merge #6492: test: add functional tests for coinjoinsalt RPC
16c2e13fb4 test: add functional tests for `coinjoinsalt` RPC (Kittywhiskers Van Gogh)
a1b256b06f test: extend CoinJoin RPC tests to include more cases, add logging (Kittywhiskers Van Gogh)
c6dd3dd567 test: rename test functions to reflect RPC used, simplify them (Kittywhiskers Van Gogh)
ff29c62103 test: run CoinJoin RPC tests using blank wallet (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Current suite of tests do not check if restoring salt results in restoring CoinJoin balance. This is because functional tests currently do not test CoinJoin mixing (and thus, routines for the same are not currently present).

  ## 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
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [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:
  knst:
    utACK 16c2e13fb4
  UdjinM6:
    utACK 16c2e13fb4

Tree-SHA512: 0ce4e67f2caf0619cae42e8158cd39fba24c0a86050e061511ea23c4c0bf34a0eede72917516b6039d7ac15f85730ab36ba9ec1c42d0eb271f6cb4341389bcec
2024-12-16 20:38:11 -06:00
Kittywhiskers Van Gogh
19746513b1
refactor: move remaining LogPrintf usage outside 2024-12-16 12:21:35 +00:00
Kittywhiskers Van Gogh
04dbaa8bd8
style-only: Remove redundant scope in *Chainstate 2024-12-16 12:21:35 +00:00
Kittywhiskers Van Gogh
872158d248
Remove all #include // for * comments 2024-12-16 12:21:35 +00:00
Kittywhiskers Van Gogh
09ab62948f
test/setup: Use LoadChainstate 2024-12-16 12:19:40 +00:00
Kittywhiskers Van Gogh
459f33983b
node/chainstate: extract Dash post-InitializeChainstate logic 2024-12-16 12:19:40 +00:00
Kittywhiskers Van Gogh
c06e07461e
node/chainstate: Add options for in-memory DBs 2024-12-16 12:19:40 +00:00
Kittywhiskers Van Gogh
52bb35d9c8
node/caches: Remove intermediate variables 2024-12-16 12:19:40 +00:00
Kittywhiskers Van Gogh
4ab182751e
node/caches: Extract cache calculation logic 2024-12-16 12:19:40 +00:00
Kittywhiskers Van Gogh
d7f1e234c5
validation: VerifyDB only needs Consensus::Params 2024-12-16 12:19:40 +00:00
Kittywhiskers Van Gogh
c405492874
node/chainstate: Decouple from ShutdownRequested 2024-12-16 12:19:40 +00:00
Kittywhiskers Van Gogh
fdf803d013
node/chainstate: Decouple from GetTime 2024-12-16 12:19:31 +00:00
Kittywhiskers Van Gogh
f7aef8d331
init: Delay RPC block notif until warmup finished 2024-12-16 12:19:31 +00:00
Kittywhiskers Van Gogh
94c0ceb29c
Move -checkblocks LogPrintf to AppInitMain 2024-12-16 12:19:31 +00:00
Kittywhiskers Van Gogh
d3345eeccc
node/chainstate: Reduce coupling of LogPrintf 2024-12-16 12:19:30 +00:00
Kittywhiskers Van Gogh
a141f5d9a7
node/chainstate: Decouple from concept of uiInterface 2024-12-16 12:19:30 +00:00
Kittywhiskers Van Gogh
913411ed73
Split off VerifyLoadedChainstate 2024-12-16 12:19:16 +00:00
Kittywhiskers Van Gogh
53231ca29d
node/chainstate: Remove do/while loop 2024-12-16 12:19:16 +00:00
Kittywhiskers Van Gogh
2ea1bbc7aa
Move init logistics message for BAD_GENESIS_BLOCK to init.cpp 2024-12-16 12:19:16 +00:00
Kittywhiskers Van Gogh
29c736280d
Move mempool nullptr Assert out of LoadChainstate 2024-12-16 12:19:16 +00:00
Kittywhiskers Van Gogh
7071282a2d
node/chainstate: Decouple from concept of NodeContext 2024-12-16 12:19:12 +00:00
Kittywhiskers Van Gogh
04ce1fea52
ci: deduplicate macOS SDK setup logic
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2024-12-16 12:13:27 +00:00
Kittywhiskers Van Gogh
16c2e13fb4
test: add functional tests for coinjoinsalt RPC 2024-12-16 08:33:23 +00:00
Kittywhiskers Van Gogh
a1b256b06f
test: extend CoinJoin RPC tests to include more cases, add logging 2024-12-16 08:33:22 +00:00
Kittywhiskers Van Gogh
c6dd3dd567
test: rename test functions to reflect RPC used, simplify them 2024-12-16 08:31:27 +00:00
Kittywhiskers Van Gogh
ff29c62103
test: run CoinJoin RPC tests using blank wallet 2024-12-16 08:31:27 +00:00
pasta
3d5dc160d8
Merge #6462: backport: merge bitcoin#23092, #23005, #24704, #24391, #25338, #25422, #25493, #26826, #26814, #26832, #27418, partial bitcoin#27254 (compat backports)
Some checks failed
Guix Build / build-image (push) Failing after 6m2s
Guix Build / build (aarch64-linux-gnu) (push) Has been skipped
Guix Build / build (arm-linux-gnueabihf) (push) Has been skipped
Guix Build / build (arm64-apple-darwin) (push) Has been skipped
Guix Build / build (powerpc64-linux-gnu) (push) Has been skipped
Guix Build / build (riscv64-linux-gnu) (push) Has been skipped
Guix Build / build (x86_64-apple-darwin) (push) Has been skipped
Guix Build / build (x86_64-linux-gnu) (push) Has been skipped
Guix Build / build (x86_64-w64-mingw32) (push) Has been skipped
Check Merge Fast-Forward Only / check_merge (push) Successful in 1m49s
Label Merge Conflicts / main (push) Failing after 40s
CI / Build Image (push) Failing after 15m29s
CI / Build Dependencies (arm-linux, arm-linux-gnueabihf) (push) Has been cancelled
CI / Build Dependencies (linux64, x86_64-pc-linux-gnu) (push) Has been cancelled
CI / Build (arm-linux, arm-linux, arm-linux-gnueabihf) (push) Has been cancelled
CI / Build (linux64, linux64, x86_64-pc-linux-gnu) (push) Has been cancelled
CI / Build (linux64_cxx20, linux64, x86_64-pc-linux-gnu) (push) Has been cancelled
CI / Build (linux64_fuzz, linux64, x86_64-pc-linux-gnu) (push) Has been cancelled
CI / Build (linux64_nowallet, linux64, x86_64-pc-linux-gnu) (push) Has been cancelled
CI / Build (linux64_sqlite, linux64, x86_64-pc-linux-gnu) (push) Has been cancelled
CI / Build (linux64_tsan, linux64, x86_64-pc-linux-gnu) (push) Has been cancelled
CI / Build (linux64_ubsan, linux64, x86_64-pc-linux-gnu) (push) Has been cancelled
2ab561d281 partial bitcoin#27254: Extract util/fs from util/system (Kittywhiskers Van Gogh)
280988bee3 merge bitcoin#27418: Remove windows workaround in authproxy (Kittywhiskers Van Gogh)
a497df0339 merge bitcoin#26832: move (win) S_* defines into bdb (Kittywhiskers Van Gogh)
db676a7e5f merge bitcoin#26814: remove windows-only compat.h usage in random (Kittywhiskers Van Gogh)
94e6637c33 merge bitcoin#26826: remove windows-only compat.h usage in randomenv (Kittywhiskers Van Gogh)
bbb0cceb7a merge bitcoin#25493: document code in compat.h (Kittywhiskers Van Gogh)
3f143096c8 merge bitcoin#25422: globally define NOMINMAX when building with mingw-w64 (Kittywhiskers Van Gogh)
000495df8e merge bitcoin#25338: Avoid incompatibility with CMake AUTOUIC feature (Kittywhiskers Van Gogh)
714ea55dbe build: migrate stacktrace-related flags to `DEBUG_`{`C`,`CXX`}`FLAGS` (Kittywhiskers Van Gogh)
11323c3851 merge bitcoin#24391: stop overriding user autoconf flags (Kittywhiskers Van Gogh)
548121d366 merge bitcoin#24704: remove strnlen back-compat code (Kittywhiskers Van Gogh)
b65038ec94 merge bitcoin#23005: Delay wallet client construction (Kittywhiskers Van Gogh)
f3b065cd9c merge bitcoin#23092: Remove Windows workaround in authproxy (WinError 10053) (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * This PR originally included [bitcoin#27378](https://github.com/bitcoin/bitcoin/pull/27378) but including it caused multiple tests to fail ([build](https://gitlab.com/dashpay/dash/-/jobs/8577987174#L2224)), even after adjusting `timeout`. It has been omitted instead.

    <details>

    <summary>Test failures:</summary>

    ```
    feature_abortnode.py                               |   Failed  | 201 s
    feature_dip3_v19.py                                |   Failed  | 237 s
    feature_llmq_rotation.py                           |   Failed  | 54 s
    p2p_invalid_messages.py                            |   Failed  | 5 s
    rpc_bind.py --nonloopback                          |   Failed  | 63 s
    wallet_multiwallet.py --descriptors                |   Failed  | 79 s
    wallet_multiwallet.py --legacy-wallet              |   Failed  | 89 s

    ALL                                                |   Failed  | 8540 s (accumulated)
    ```

    </details>

    <details>

    <summary>feature_abortnode.py failure:</summary>

    ```
    dash@107cfae2b2b5:/src/dash$ ./test/functional/feature_abortnode.py
    2024-12-09T18:31:01.776000Z TestFramework (INFO): PRNG seed is: 6843309100291447752
    2024-12-09T18:31:01.776000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_fcijb99n
    2024-12-09T18:31:02.802000Z TestFramework (INFO): Waiting for crash
    2024-12-09T18:34:23.026000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        def is_node_stopped(self):
            """Checks whether the node has stopped.

            Returns True if the node has stopped. False otherwise.
            This method is responsible for freeing resources (self.process)."""
            if not self.running:
                return True
            return_code = self.process.poll()
            if return_code is None:
                return False

            # process has stopped. Assert that it didn't return an error code.
            assert return_code == 0, self._node_msg(
                "Node returned non-zero exit code (%d) when stopping" % return_code)
            self.running = False
            self.process = None
            self.rpc_connected = False
            self.rpc = None
            self.log.debug("Node stopped")
            return True
    '''
    2024-12-09T18:34:23.027000Z TestFramework (ERROR): Assertion failed
    Traceback (most recent call last):
      File "/src/dash/test/functional/test_framework/test_framework.py", line 161, in main
        self.run_test()
      File "/src/dash/./test/functional/feature_abortnode.py", line 44, in run_test
        self.nodes[0].wait_until_stopped(timeout=200)
      File "/src/dash/test/functional/test_framework/test_node.py", line 414, in wait_until_stopped
        wait_until_helper(self.is_node_stopped, timeout=timeout, timeout_factor=self.timeout_factor)
      File "/src/dash/test/functional/test_framework/util.py", line 287, in wait_until_helper
        raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
    AssertionError: Predicate ''''
        def is_node_stopped(self):
            """Checks whether the node has stopped.

            Returns True if the node has stopped. False otherwise.
            This method is responsible for freeing resources (self.process)."""
            if not self.running:
                return True
            return_code = self.process.poll()
            if return_code is None:
                return False

            # process has stopped. Assert that it didn't return an error code.
            assert return_code == 0, self._node_msg(
                "Node returned non-zero exit code (%d) when stopping" % return_code)
            self.running = False
            self.process = None
            self.rpc_connected = False
            self.rpc = None
            self.log.debug("Node stopped")
            return True
    ''' not true after 200.0 seconds
    2024-12-09T18:34:23.530000Z TestFramework (INFO): Stopping nodes
    2024-12-09T18:34:23.530000Z TestFramework (ERROR): Unexpected exception caught during shutdown
    Traceback (most recent call last):
      File "/src/dash/test/functional/test_framework/test_framework.py", line 341, in shutdown
        self.stop_nodes()
      File "/src/dash/test/functional/test_framework/test_framework.py", line 673, in stop_nodes
        node.stop_node(expected_stderr=expected_stderr, wait=wait, wait_until_stopped=False)
      File "/src/dash/test/functional/test_framework/test_node.py", line 368, in stop_node
        self.stop(wait=wait)
      File "/src/dash/test/functional/test_framework/coverage.py", line 49, in __call__
        return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
      File "/src/dash/test/functional/test_framework/authproxy.py", line 124, in __call__
        response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
      File "/src/dash/test/functional/test_framework/authproxy.py", line 103, in _request
        return self._get_response()
      File "/src/dash/test/functional/test_framework/authproxy.py", line 162, in _get_response
        raise JSONRPCException(
    test_framework.authproxy.JSONRPCException: non-JSON HTTP response with '503 Service Unavailable' from server (-342)
    2024-12-09T18:34:23.531000Z TestFramework (WARNING): Not cleaning up dir /tmp/dash_func_test_fcijb99n
    2024-12-09T18:34:23.531000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/dash_func_test_fcijb99n/test_framework.log
    2024-12-09T18:34:23.531000Z TestFramework (ERROR):
    2024-12-09T18:34:23.531000Z TestFramework (ERROR): Hint: Call /src/dash/test/functional/combine_logs.py '/tmp/dash_func_test_fcijb99n' to consolidate all logs
    2024-12-09T18:34:23.531000Z TestFramework (ERROR):
    2024-12-09T18:34:23.531000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2024-12-09T18:34:23.531000Z TestFramework (ERROR): https://github.com/dashpay/dash/issues
    2024-12-09T18:34:23.531000Z TestFramework (ERROR):
    [node 1] Cleaning up leftover process
    [node 0] Cleaning up leftover process
    ```

    </details>

  * [bitcoin#27254](https://github.com/bitcoin/bitcoin/pull/27254) has been partially backported to include a missing header to allow it to build.

    <details>

    <summary>Compile error:</summary>

    ```
    In file included from ./util/system.h:19,
                   from util/system.cpp:7:
    ./compat/assumptions.h:49:22: error: 'size_t' was not declared in this scope; did you mean 'std::size_t'?
       49 | static_assert(sizeof(size_t) == 4 || sizeof(size_t) == 8, "size_t assumed to be 32-bit or 64-bit");
          |                      ^~~~~~
          |                      std::size_t
    In file included from /usr/include/c++/11/limits:42,
                   from ./compat/assumptions.h:11,
                   from ./util/system.h:19,
                   from util/system.cpp:7:
    /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:280:33: note: 'std::size_t' declared here
      280 |   typedef __SIZE_TYPE__         size_t;
          |                                 ^~~~~~
    ```

    </details>

  * ~~GitLab job failures as of 2339ae6459cad77d94795c0e92ba3f3fe31c485a, for `linux64-build` ([source](https://gitlab.com/dashpay/dash/-/jobs/8590291130#L4621)), `linux64_cxx20-build` ([source](https://gitlab.com/dashpay/dash/-/jobs/8590291134#L3497)) and `linux64_sqlite-build` ([source](https://gitlab.com/dashpay/dash/-/jobs/8590291137#L3489)) are not related to failures in compilation or unit tests but are to do with reaching the artifact limit.~~ Resolved with [dash#6487](https://github.com/dashpay/dash/pull/6487), thanks Udjin!

  ## 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
  - [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:
  UdjinM6:
    utACK 2ab561d281
  PastaPastaPasta:
    utACK 2ab561d281

Tree-SHA512: 6d05305f17fd607ed93b4a2e00de195a96bde1a34bedf04f6dd84892dc71028ae71590fa5063026ec7ff728d6e411af410c363b4a88947ce6e5999d4431bb29b
2024-12-15 12:30:54 -06:00
pasta
032fc21198
Merge #6479: feat: enable coverage linter for functional tests
2e509b96c4 fix: add a workaround for RPC getmerkleblocks, debug, coinjoinsalt, voteraw (Konstantin Akimov)
f0decc8790 feat: add unit test for ClearDiscouraged (Konstantin Akimov)
865b24ea00 feat: hide cleardiscouraged RPC so far as it no intent to use by regular users (Konstantin Akimov)
1f5fa7e7cf feat: enable linter coverage for functional tests (Konstantin Akimov)
59ddac5656 feat: hide deprecated RPC from help and add TODOes to remove them (Konstantin Akimov)
05732aceaf feat: implement functional tests for RPC getblockheaders (Konstantin Akimov)

Pull request description:

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

  ## What was done?
  Add functional tests for `getblockheaders`
  Hide RPC `cleardiscouraged` (as it is used only for functional tests) and RPC `getpoolinfo` (deprecated long time ago)
  Add a workaround to ignore these RPCs `getmerkleblocks`, `voteraw`, `debug`, `coinjoinsalt` at the moment
  Enables linter for coverage

  ## How Has This Been Tested?
  Run locally with `test/functional/test_runner.py -j20 --previous-releases --coverage --extended`
  Enabled in CI

  ## Breaking Changes
  N/A if hidding `cleardiscouraged` is not a breaking change.

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

ACKs for top commit:
  UdjinM6:
    LGTM, utACK 2e509b96c4
  PastaPastaPasta:
    utACK 2e509b96c4

Tree-SHA512: bb31465d9a71ef824533d9310393d89293c87c7407ec3e37697f6d36dc6c010381a6e0408f9598354e610d51ef662485d8a653cc0e198842e2198ac1c30c90f1
2024-12-15 12:12:40 -06:00
pasta
05ca6cffff
Merge #6489: ci: allow overriding MAKEJOBS
feb6a1ad3f ci: allow overriding MAKEJOBS (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  That's how these variable are ment to behave
  >echo "Fallback to default values in env (if not yet set)"

  https://github.com/dashpay/dash/blame/develop/ci/test/00_setup_env.sh#L26

  That's also how it's done in bitcoin https://github.com/bitcoin/bitcoin/blob/master/ci/test/00_setup_env.sh#L38.

  But we broke it in c52992aaa4 and I'm not sure why 🤷‍♂️

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK feb6a1ad3f
  kwvg:
    utACK feb6a1ad3f

Tree-SHA512: 617e761cf5c52d8e4329bf8aa1680c72a7816ae3248ed415d2c3232e5aa0941f18e21f0d6d363848238f53730097aa22f51a6e1cd62bd0b31d3da853f9f79e28
2024-12-15 11:57:04 -06:00
Kittywhiskers Van Gogh
27d9763b1b
fix: add linux64_multiprocess BUILD_TARGET to matrix, mend C(XX) 2024-12-15 13:12:30 +00:00
Kittywhiskers Van Gogh
26cc5a1c90
ci: use underscore to separate variant name from target triple 2024-12-15 13:12:25 +00:00
Kittywhiskers Van Gogh
d0131a5259
trivial: sort BUILD_TARGET on GitHub and in matrix.sh alphabetically 2024-12-15 13:12:04 +00:00
Kittywhiskers Van Gogh
4f1b5c165b
merge bitcoin#28954: Reduce use of bash -c 2024-12-15 13:08:32 +00:00
Kittywhiskers Van Gogh
a49162ffae
merge bitcoin#27314: Fix handling of CXX=clang++ when building qt package 2024-12-15 13:08:29 +00:00
Kittywhiskers Van Gogh
8dd0db7de9
ci: fix "LC_ALL: cannot change locale (en_US.UTF-8)" in Guix container 2024-12-15 11:02:55 +00:00
Kittywhiskers Van Gogh
187fe17650
ci: don't stage packages in /tmp, reduce layers for cppcheck build 2024-12-15 11:02:55 +00:00
Kittywhiskers Van Gogh
eef863554a
ci: install i386 packages only if host is amd64, merge layers 2024-12-15 11:02:55 +00:00
Kittywhiskers Van Gogh
e7702292d1
ci: purge package manager cache after each interaction 2024-12-15 11:02:55 +00:00
Kittywhiskers Van Gogh
b7099eed47
ci: remove redundant version attribute, avoid lldb personality error 2024-12-15 11:02:54 +00:00
Kittywhiskers Van Gogh
64cdc42130
ci: add LLVM library path to LD_LIBRARY_PATH and GDB allowlist 2024-12-15 10:59:47 +00:00
Kittywhiskers Van Gogh
440fd3fe21
ci: drop distro LLVM packages, move Clang install up, set defaults
Also simplify the download and execution of `llvm.sh`
2024-12-15 10:59:46 +00:00
Kittywhiskers Van Gogh
ee9d3dd5fc
node/chainstate: Decouple from ArgsManager 2024-12-15 09:10:45 +00:00
Kittywhiskers Van Gogh
d7419e42d6
node/chainstate: Decouple from stringy errors 2024-12-15 09:10:45 +00:00
Kittywhiskers Van Gogh
9ab08c42e4
node/chainstate: Decouple from GetTimeMillis 2024-12-15 09:10:45 +00:00
Kittywhiskers Van Gogh
2455c06464
node: Extract chainstate loading sequence 2024-12-15 09:10:45 +00:00
Kittywhiskers Van Gogh
620146bcb8
chore: sync chainstate loading logic with upstream
Match formatting with what upcoming commits expect to limit conflicts
2024-12-15 09:10:45 +00:00
Kittywhiskers Van Gogh
2ab561d281
partial bitcoin#27254: Extract util/fs from util/system
includes:
- b202b3dd6393b415fa68e18dc49c9431dc6b58b2
2024-12-15 09:08:55 +00:00
Kittywhiskers Van Gogh
280988bee3
merge bitcoin#27418: Remove windows workaround in authproxy 2024-12-15 09:08:55 +00:00
Kittywhiskers Van Gogh
a497df0339
merge bitcoin#26832: move (win) S_* defines into bdb 2024-12-15 09:08:55 +00:00
Kittywhiskers Van Gogh
db676a7e5f
merge bitcoin#26814: remove windows-only compat.h usage in random 2024-12-15 09:08:55 +00:00
Kittywhiskers Van Gogh
94e6637c33
merge bitcoin#26826: remove windows-only compat.h usage in randomenv 2024-12-15 09:08:55 +00:00
Kittywhiskers Van Gogh
bbb0cceb7a
merge bitcoin#25493: document code in compat.h 2024-12-15 09:08:55 +00:00
Kittywhiskers Van Gogh
3f143096c8
merge bitcoin#25422: globally define NOMINMAX when building with mingw-w64 2024-12-15 09:08:22 +00:00
Kittywhiskers Van Gogh
000495df8e
merge bitcoin#25338: Avoid incompatibility with CMake AUTOUIC feature 2024-12-15 09:08:22 +00:00
Kittywhiskers Van Gogh
714ea55dbe
build: migrate stacktrace-related flags to DEBUG_{C,CXX}FLAGS
`DEBUG_CFLAGS` doesn't exist so we need to create it
2024-12-15 09:08:22 +00:00
Kittywhiskers Van Gogh
11323c3851
merge bitcoin#24391: stop overriding user autoconf flags 2024-12-15 09:08:22 +00:00
Kittywhiskers Van Gogh
548121d366
merge bitcoin#24704: remove strnlen back-compat code 2024-12-15 09:08:22 +00:00
Kittywhiskers Van Gogh
b65038ec94
merge bitcoin#23005: Delay wallet client construction 2024-12-15 09:08:21 +00:00
Kittywhiskers Van Gogh
f3b065cd9c
merge bitcoin#23092: Remove Windows workaround in authproxy (WinError 10053) 2024-12-15 09:08:21 +00:00
pasta
e2095bd68a
Merge #6488: backport: merge bitcoin#27452, #29347, #29356, #29353, #29452, #29483, #30545, #31383 (BIP324 backports: part 5)
c6f23a718c merge bitcoin#31383: Add missing node.setmocktime(self.mocktime) to p2p_ibd_stalling.py (Kittywhiskers Van Gogh)
9072a10754 merge bitcoin#30545: fix intermittent failures in feature_proxy.py (Kittywhiskers Van Gogh)
7e2d435e35 merge bitcoin#29483: add --v1transport option, add --v2transport to a CI task (Kittywhiskers Van Gogh)
7e59a965f8 merge bitcoin#29452: document that BIP324 on by default (Kittywhiskers Van Gogh)
0f3b5e081e merge bitcoin#29353: adhere to typical VERSION message protocol flow (Kittywhiskers Van Gogh)
dfdddfd2ff rpc: enable `v2transport` for `masternode connect` when capable (Kittywhiskers Van Gogh)
3c1636174b merge bitcoin#29356: make v2transport arg in addconnection mandatory and few cleanups (Kittywhiskers Van Gogh)
c53cd93aee merge bitcoin#29347: enable v2transport by default (Kittywhiskers Van Gogh)
7dcf561306 merge bitcoin#27452: cover addrv2 anchors by adding TorV3 to CAddress in messages.py (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * When backporting [bitcoin#27452](https://github.com/bitcoin/bitcoin/pull/27452) in `feature_anchors.py`, `P2P_SERVICES` (`NODE_NETWORK | NODE_HEADERS_COMPRESSED`) has been replaced with `NODE_NETWORK` as the former evaluates to a value greater than `256` (specifically `2049`), which causes test failure. The replacement value is acceptable as `NODE_NETWORK` is the desired service flag expected by Dash Core ([source](779e4295ad/src/protocol.cpp (L249-L254))).

    <details>

    <summary>Test failure:</summary>

    ```
    dash@89afd55ae77e:/src/dash$ ./test/functional/feature_anchors.py
    2024-12-14T12:31:22.244000Z TestFramework (INFO): PRNG seed is: 8365703189892653614
    2024-12-14T12:31:22.244000Z TestFramework (INFO): Initializing test directory /tmp/dash_func_test_j0ya02yu
    2024-12-14T12:31:22.776000Z TestFramework (INFO): When node starts, check if anchors.dat doesn't exist
    2024-12-14T12:31:22.776000Z TestFramework (INFO): Add 2 block-relay-only connections to node
    2024-12-14T12:31:24.781000Z TestFramework (INFO): Add 5 inbound connections to node
    2024-12-14T12:31:29.843000Z TestFramework (INFO): Check node connections
    2024-12-14T12:31:30.848000Z TestFramework (INFO): Check the addresses in anchors.dat
    2024-12-14T12:31:30.848000Z TestFramework (INFO): Perturb anchors.dat to test it doesn't throw an error during initialization
    2024-12-14T12:31:31.356000Z TestFramework (INFO): When node starts, check if anchors.dat doesn't exist anymore
    2024-12-14T12:31:31.357000Z TestFramework (INFO): Ensure addrv2 support
    2024-12-14T12:31:32.364000Z TestFramework (INFO): Add 256-bit-address block-relay-only connections to node
    2024-12-14T12:31:33.368000Z TestFramework (INFO): Check for addrv2 addresses in anchors.dat
    2024-12-14T12:31:33.369000Z TestFramework (ERROR): Unexpected exception caught during testing
    Traceback (most recent call last):
      File "/src/dash/test/functional/test_framework/test_framework.py", line 161, in main
        self.run_test()
      File "/src/dash/./test/functional/feature_anchors.py", line 135, in run_test
        new_data[services_index] = P2P_SERVICES
    ValueError: byte must be in range(0, 256)
    2024-12-14T12:31:33.870000Z TestFramework (INFO): Stopping nodes
    2024-12-14T12:31:33.871000Z TestFramework (WARNING): Not cleaning up dir /tmp/dash_func_test_j0ya02yu
    2024-12-14T12:31:33.871000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/dash_func_test_j0ya02yu/test_framework.log
    ```

    </details>

  ## 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
  - [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:
  UdjinM6:
    utACK c6f23a718c
  PastaPastaPasta:
    utACK c6f23a718c81b7c574ba3fecbe52f342eda35a46;

Tree-SHA512: ca134432d000d521827a20c75c03913421fe52a31fda1cbf632e0b207c31728406feb090469d592d8e2fd8d64298faa2752ff703de79f737a62c276c6a231097
2024-12-14 19:41:06 -06:00
UdjinM6
feb6a1ad3f
ci: allow overriding MAKEJOBS 2024-12-15 00:16:21 +03:00
pasta
99ca07f607
Merge #6487: ci: exclude more files from artifacts, better names for downloaded files
a191c09cdc ci: better names for artifacts (UdjinM6)
3984a49a43 ci: exclude `*.a` and `*.o` files from artifacts (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  We include too many files in artifacts on `build` ci step, some of which (`*.a` and `*.o`) can be pretty heavy. This was ok-ish for some time but artifacts size is getting closer to the limit and even starts to cause issues, see #6462.

  ## What was done?
  Exclude `*.a` and `*.o` files from artifacts. Also, change artifacts name to make it easier to distinguish them when you get a few of them from the same pipeline - `build-arm-linux.zip`, `build-linux64.zip` etc. instead of `binaries.zip`, `binaries (1).zip` etc., same for `depends`.

  A simpler alternative to #6483

  As a result the size of tsan artifacts for example is down from 508MB in 6462 to 154MB in this PR.

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK a191c09cdc
  kwvg:
    utACK a191c09cdc

Tree-SHA512: eb3029c95a11546958d34ad284f4eb600b6113a2cabb885f7381afd16696f51da7eaf1677a1cdfec53311838c6845bb1c2c7c98f0ae112294b33f6ab6c66c500
2024-12-14 14:13:06 -06:00
pasta
4a63d64340
Merge #6486: ci: do not check --ff-only on master branch
dcc1ff37bc ci: do not check `--ff-only` on master branch (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  https://github.com/dashpay/dash/actions/runs/12303817802/job/34340079798

  It makes no sense to check it anyway.

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK dcc1ff37bc

Tree-SHA512: bcff6ff7bcb70f2d48e9df7db2a76b65b386f0cc7f213e44dc13a44416e1cab9449c1344166ac58e8e577dcfbdc22b0b4ebb93d610b0790623188c1680804b69
2024-12-14 13:08:18 -06:00
pasta
f656c51979
Merge #6481: test: actually use masternode with basic bls pubkey in mnauth test
ec00c372c7 test: fix off-by-one in dynamically_add_masternode (UdjinM6)
6519856344 test: don't add legacy bls mn on start (UdjinM6)
3db20e3ed4 test: actually use masternode with basic bls pubkey in mnauth test (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  `rpc_manuth` is failing in ~50% cases locally because we still use legacy pubkeys (not in 100% cases because sometimes they look like basic ones). In CI it fails too but we retry failed tests a few times so it's less noticeable. Example of "unlucky" tests: https://gitlab.com/dashpay/dash/-/jobs/8613271300#L1867.

  #6467 follow-up

  ## What was done?
  Add another masternode after v19 activaition to actually use basic bls pubkey

  ## How Has This Been Tested?
  run tests

  ## Breaking Changes
  n/a

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

ACKs for top commit:
  knst:
    utACK ec00c372c7
  PastaPastaPasta:
    utACK ec00c372c7

Tree-SHA512: 850a02ea1bd943762cdb0be706f3703742944c294ee9603b1f9ab95a6b10fb827bc9376e03333177d956b2c13df7384cfe0eb2ffef4d05ff3ec239caa8318d24
2024-12-14 12:11:42 -06:00
pasta
c35cf1c278
Merge #6485: revert: Revert "feat: re-bury DIP0024 with new height when quorums actually appeared"
2c296de6dd revert: Revert "feat: re-bury DIP0024 with new height when quorums actually appeared" (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  `-assumevalid=0` sync is broken on develop, v22 and master aren't affected

  mainnet:
  ```
  [   loadblk] [util/system.h:57] [error] ERROR: ConnectBlock(DASH): ProcessSpecialTxsInBlock for block 00000000000000195f69a348a14fddc7c8ff61036348e95b818ca42c6c724bbb failed with bad-qc-dup
  [   loadblk] [validation.cpp:1365] [InvalidChainFound] InvalidChainFound: invalid block=00000000000000195f69a348a14fddc7c8ff61036348e95b818ca42c6c724bbb  height=1737834  log2_work=78.911419  date=2022-09-13T22:36:20Z
  [   loadblk] [validation.cpp:1370] [InvalidChainFound] InvalidChainFound:  current best=0000000000000002e91bac9f95f96885a89de2c46846d197933c8c5f03cb806f  height=1737833  log2_work=78.911418  date=2022-09-13T22:35:44Z
  [   loadblk] [util/system.h:57] [error] ERROR: ConnectTip: ConnectBlock 00000000000000195f69a348a14fddc7c8ff61036348e95b818ca42c6c724bbb failed, bad-qc-dup
  ```

  testnet:
  ```
  [   loadblk] [util/system.h:57] [error] ERROR: ConnectBlock(DASH): ProcessSpecialTxsInBlock for block 00000050ec7aa1b187c3a9df0d80a2ed2821d5836b596b962bcbc4c261b4bcd5 failed with bad-qc-dup
  [   loadblk] [validation.cpp:1357] [InvalidChainFound] InvalidChainFound: invalid block=00000050ec7aa1b187c3a9df0d80a2ed2821d5836b596b962bcbc4c261b4bcd5  height=769866  log2_work=57.312136  date=2022-07-28T03:32:01Z
  [   loadblk] [validation.cpp:1362] [InvalidChainFound] InvalidChainFound:  current best=0000001acc25de06893220ed663f35ef8b8e82ec951963c4092c1e9ee103af6f  height=769865  log2_work=57.312136  date=2022-07-28T03:28:21Z
  [   loadblk] [util/system.h:57] [error] ERROR: ConnectTip: ConnectBlock 00000050ec7aa1b187c3a9df0d80a2ed2821d5836b596b962bcbc4c261b4bcd5 failed, bad-qc-dup
  ```

  ## What was done?
  This reverts commit 632c4c4bcd.

  ## How Has This Been Tested?
  Hint: sync to pre-dip24 block with `--stopatheight=1737790` and no `-assumevalid` to speed things up, then start from that block with `-assumevalid=0`

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 2c296de6dd

Tree-SHA512: 02d62d34b3914af61c3b415cdffcfca8d7e18b192bffadb0ceb06d6aca8b828491a68cc2a23b9e6b369efb6f2e1c8e84bbd6332b3c74f27f3d9469efaed72817
2024-12-14 12:05:55 -06:00
Kittywhiskers Van Gogh
c6f23a718c
merge bitcoin#31383: Add missing node.setmocktime(self.mocktime) to p2p_ibd_stalling.py 2024-12-14 12:00:52 +00:00
Kittywhiskers Van Gogh
9072a10754
merge bitcoin#30545: fix intermittent failures in feature_proxy.py 2024-12-14 12:00:51 +00:00
Kittywhiskers Van Gogh
7e2d435e35
merge bitcoin#29483: add --v1transport option, add --v2transport to a CI task 2024-12-14 12:00:51 +00:00
Kittywhiskers Van Gogh
7e59a965f8
merge bitcoin#29452: document that BIP324 on by default 2024-12-14 12:00:51 +00:00
Kittywhiskers Van Gogh
0f3b5e081e
merge bitcoin#29353: adhere to typical VERSION message protocol flow 2024-12-14 12:00:51 +00:00
Kittywhiskers Van Gogh
dfdddfd2ff
rpc: enable v2transport for masternode connect when capable 2024-12-14 12:00:51 +00:00
Kittywhiskers Van Gogh
3c1636174b
merge bitcoin#29356: make v2transport arg in addconnection mandatory and few cleanups 2024-12-14 12:00:51 +00:00
Kittywhiskers Van Gogh
c53cd93aee
merge bitcoin#29347: enable v2transport by default 2024-12-14 12:00:51 +00:00
Kittywhiskers Van Gogh
7dcf561306
merge bitcoin#27452: cover addrv2 anchors by adding TorV3 to CAddress in messages.py 2024-12-14 12:00:50 +00:00
UdjinM6
2c296de6dd
revert: Revert "feat: re-bury DIP0024 with new height when quorums actually appeared"
This reverts commit 632c4c4bcd.
2024-12-14 12:50:39 +03:00
UdjinM6
dcc1ff37bc
ci: do not check --ff-only on master branch 2024-12-14 12:50:11 +03:00
UdjinM6
a191c09cdc
ci: better names for artifacts 2024-12-14 12:48:50 +03:00
UdjinM6
3984a49a43
ci: exclude *.a and *.o files from artifacts 2024-12-14 12:48:41 +03:00
pasta
779e4295ad
Merge #6484: chore: Merge master 22.0.0 back into develop
1c7bfcbde1 chore: set release true (pasta)
c90339eb61 Merge #6459: docs: add release notes for v22.0.0 (pasta)
a6f1fc590c Merge #6475: chore: bumped chain assumed sizes based on latest usage (pasta)
d7cd9f10fd Merge #6464: chore: update man pages for v22 (pasta)
212f91c35f Merge #6461: docs: update supported versions in SECURITY.md (pasta)
9a8b68515d Merge #6460: chore: Translations 2024-12 (pasta)
2f71f4d7d0 Merge #6458: chore: bump MIN_MASTERNODE_PROTO_VERSION to latest proto (pasta)
fa29ed5b5e Merge #6456: fix(qt): allow refreshing wallet data without crashing (pasta)
758cd646a1 Merge #6452: fix: store ready queues on the mixing masternode (pasta)
395447bf30 Merge #6451: depends: update 'src/dashbls' to dashpay/bls-signatures@7e747e8a as 62fa6652 (pasta)
c7b0d80939 Merge #6441: fix: hold wallet shared pointer in CJ Manager/Sessions to prevent concurrent unload (pasta)
c074e0965b Merge #6444: fix: add platform transfer to "most common" filter (pasta)
cb04114143 Merge #6442: fix: coin selection with `include_unsafe` option should respect `nCoinType` (pasta)
db5b53a9a7 Merge #6434: fix: early EHF and buried EHF are indistinguish (pasta)
8b88ff7ed6 Merge #6414: chore: bump seeds for v22 (pasta)
02ad523a22 Merge #6411: chore: update nMinimumChainWork, defaultAssumeValid, checkpointData, chainTxData for mainnet and testnet (pasta)
3bbcd3d4f8 Merge #6393: docs: mention building for some HOSTs only in `release-process.md` (pasta)
18f636f9a4 Merge #6426: fix: respect SENDDSQUEUE message, move DSQ relay into net processing / peerman (pasta)
9fed4564f4 Merge #6407: fix: dataraces (pasta)
86105daab3 Merge #6408: refactor: removed pre-MN_RR logic of validation of CL (pasta)
a1f7e96025 Merge #6406: ci: use `actions/cache` to manage depends cache (pasta)
90a3807903 Merge #6402: ci: cache built (pasta)
66f67879dc Merge #6401: ci: deduplicate depends building (pasta)
7ca56632cf Merge #6397: ci: add powerpc64 to GH Guix job matrix (pasta)

Pull request description:

  ## Issue being fixed or feature implemented

  ## What was done?
  Suppressed changes from 1c7bfcbde1 and resolved merge conflicts.

  ```
  Auto-merging .github/workflows/build.yml
  Auto-merging configure.ac
  Auto-merging src/chainparams.cpp
  Auto-merging src/coinjoin/client.cpp
  CONFLICT (content): Merge conflict in src/coinjoin/client.cpp
  Auto-merging src/coinjoin/client.h
  CONFLICT (content): Merge conflict in src/coinjoin/client.h
  Auto-merging src/coinjoin/util.cpp
  CONFLICT (content): Merge conflict in src/coinjoin/util.cpp
  Auto-merging src/coinjoin/util.h
  CONFLICT (content): Merge conflict in src/coinjoin/util.h
  Auto-merging src/evo/specialtxman.cpp
  Auto-merging src/init.cpp
  Auto-merging src/net_processing.cpp
  CONFLICT (content): Merge conflict in src/net_processing.cpp
  Auto-merging src/net_processing.h
  Auto-merging src/qt/transactiontablemodel.cpp
  Auto-merging src/wallet/wallet.cpp
  Auto-merging src/wallet/wallet.h
  CONFLICT (content): Merge conflict in src/wallet/wallet.h
  Auto-merging test/functional/feature_llmq_chainlocks.py
  CONFLICT (content): Merge conflict in test/functional/feature_llmq_chainlocks.py
  ```

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK d108579326f65920e67c839c38c6e48b84222bf9; no diff to develop

Tree-SHA512: 3f063011224880fee35edb04ce265dff33a52273c3d45ef1dbcebcecb22c25d8ad7c91b83514f36142716a6fbd0ddd3a8a3f2a9b59ce78ce975bbce69a2a13b5
2024-12-13 23:46:53 -06:00
Konstantin Akimov
2e509b96c4
fix: add a workaround for RPC getmerkleblocks, debug, coinjoinsalt, voteraw
We indeed doesn't have functional tests for them yet, but this linter will help to avoid
adding new RPCs without tests
2024-12-13 21:19:11 +07:00
Konstantin Akimov
f0decc8790
feat: add unit test for ClearDiscouraged 2024-12-13 21:19:11 +07:00
Konstantin Akimov
865b24ea00
feat: hide cleardiscouraged RPC so far as it no intent to use by regular users 2024-12-13 21:19:11 +07:00
Konstantin Akimov
1f5fa7e7cf
feat: enable linter coverage for functional tests 2024-12-13 21:19:11 +07:00
Konstantin Akimov
59ddac5656
feat: hide deprecated RPC from help and add TODOes to remove them 2024-12-13 21:19:11 +07:00
Konstantin Akimov
05732aceaf
feat: implement functional tests for RPC getblockheaders 2024-12-13 21:19:11 +07:00
UdjinM6
d108579326
Merge branch 'master' into merge_master_22.0.0 2024-12-12 23:06:29 +03:00
UdjinM6
ec00c372c7
test: fix off-by-one in dynamically_add_masternode 2024-12-12 13:31:14 +03:00
UdjinM6
6519856344
test: don't add legacy bls mn on start 2024-12-12 13:30:17 +03:00
UdjinM6
3db20e3ed4
test: actually use masternode with basic bls pubkey in mnauth test 2024-12-12 00:28:19 +03:00
pasta
c07073da16
Merge #6445: test: add tests for listunspent with coinType option
f3be9bcb95 test: add tests for `listunspent` with `coinType` option (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  extend tests a bit

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK f3be9bcb95

Tree-SHA512: 3f063011224880fee35edb04ce265dff33a52273c3d45ef1dbcebcecb22c25d8ad7c91b83514f36142716a6fbd0ddd3a8a3f2a9b59ce78ce975bbce69a2a13b5
2024-12-11 15:14:12 -06:00
pasta
5710036af6
Merge #6469: ci: treat all non-protected branches as pull requests
6f88c070d9 ci: treat all non-protected branches as pull requests (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  This branch https://github.com/dashpay/dash/tree/feat/flatpak is 3 commits ahead so CI checks should use d494339b9f as `$CI_COMMIT_BEFORE_SHA`. But that's not the case according to CI logs https://gitlab.com/dashpay/dash/-/jobs/8179463810#L38

  ```
  PULL_REQUEST=false COMMIT_RANGE=4d1b648bad417ef9b1c5a96edfa04b0e382f096f..860f6ee48f61f0b670b21ef142d13ae02d3cc50a HOST_SRC_DIR=/builds/dashpay/dash CACHE_DIR=/builds/dashpay/dash/cache
  ```

  The commit range is just 1 commit instead of 3 and this results in incomplete CI checks. This happens because only branches with special refs like `pr-xxxx/author/dash/branch` are considered as pull requests.

  ## What was done?
  Reverse the check - protected branches are the only non-PRs now, everything else is treated as PRs

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 6f88c070d96009b6a722a72f50caa84bd66b16b6; seems fine

Tree-SHA512: 2fbba9b3cec04093bace838702397253c60d4aa5e670602807aa9f2ba2ff36d7e561f70912b331a554fd1dbaf8eaf30288ce5df19b316feadec2d903b1f4a11c
2024-12-11 15:02:13 -06:00
pasta
69a2c98c3f
Merge #6478: refactor: add const to llmq_ctx, isman, clhandler in rpc code
5b914fe081 refactor: add const to llmq_ctx, isman, clhandler in rpc code (Konstantin Akimov)

Pull request description:

  ## What was done?
  Add missing const for all usages of llmq_ctx, llmq_ctx->isman and llmq_ctx->clhandler in rpc code.

  ## Issue being fixed or feature implemented
  Added `const` helps to read rpc code to see that none of mentioned objects are actually changed.

  ## How Has This Been Tested?
  Run unit and 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 _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 5b914fe081
  PastaPastaPasta:
    utACK 5b914fe081

Tree-SHA512: dfaa99887250638e90f0c87271cf3c70833d4199797050be6a8b84939f78d857419a3e9e3da73035aca10e27782f28f43f156c69380d1c8df892c97c468c76d7
2024-12-11 14:17:14 -06:00
pasta
10bdb871e9
Merge #6450: feat: show human friendly error if missing spentindex, txindex or addressindex
a275bda266 refactor: removed duplicated code with errors messages for txindex, timestampindex, spentindex (Konstantin Akimov)
dd1b36636c feat: show human friendly error if missing spentindex, txindex or addressindex (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented

  Currently user receive error `Unable to get spent info` or even worse `No information available for address` which doesn't say anything about required extra indexes.

  Also, every call of RPC `getrawtransaction` causes this error logs on high level if spent index is disabled, but actually it just means that no couple extra fields are hidden in output which is expected if no index.

      node0 2024-12-03T18:54:33.349605Z [      http] [httpserver.cpp:248] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:40052
      node0 2024-12-03T18:54:33.349634Z [httpworker.3] [rpc/request.cpp:180] [parse] [rpc] ThreadRPCServer method=getrawtransaction user=__cookie__
      node0 2024-12-03T18:54:33.349729Z [httpworker.3] [util/system.h:57] [error] ERROR: Spent index not enabled
      node0 2024-12-03T18:54:33.349735Z [httpworker.3] [util/system.h:57] [error] ERROR: Spent index not enabled
      node0 2024-12-03T18:54:33.349738Z [httpworker.3] [util/system.h:57] [error] ERROR: Spent index not enabled
      node0 2024-12-03T18:54:33.349808Z [httpworker.3] [httprpc.cpp:93] [~RpcHttpRequest] [bench] HTTP RPC request handled: user=__cookie__ command=getrawtransaction external=false status=200 elapsed_time_ms=0
      node0 2024-12-03T18:54:33.349998Z [      http] [httpserver.cpp:248] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:40052
      node0 2024-12-03T18:54:33.350027Z [httpworker.0] [rpc/request.cpp:180] [parse] [rpc] ThreadRPCServer method=getrawtransaction user=__cookie__
      node0 2024-12-03T18:54:33.350128Z [httpworker.0] [util/system.h:57] [error] ERROR: Spent index not enabled
      node0 2024-12-03T18:54:33.350133Z [httpworker.0] [util/system.h:57] [error] ERROR: Spent index not enabled
      node0 2024-12-03T18:54:33.350137Z [httpworker.0] [util/system.h:57] [error] ERROR: Spent index not enabled

  ## What was done?
  Improved all usages of extra indexes `spentindex`, `txindex` and `addressindex` in RPC implementation.

  Affected RPCc:
   - getaddressmempool
   - getaddressutxos
   - getaddressdeltas
   - getaddressbalance
   - getaddresstxids
   - getspentinfo
   - getblockhashes

  ## How Has This Been Tested?
  Run unit&functional tests.
  ```
  $ dash-cli getaddressutxos '["yW4kiSd2pytXC2erbjm6crt1PGBvbwS4YX"]'
  Address index is disabled. You should run Dash Core with -addressindex (requires reindex) (code -32600)
  ```

  Check logs after calling getrawtransaction:
  ```
      node0 2024-12-03T19:10:00.378770Z [httpworker.3] [rpc/request.cpp:180] [parse] [rpc] ThreadRPCServer method=getrawtransaction user=__cookie__
      node0 2024-12-03T19:10:00.378861Z [httpworker.3] [httprpc.cpp:93] [~RpcHttpRequest] [bench] HTTP RPC request handled: user=__cookie__ command=getrawtransaction external=false status=500 elapsed_time_ms=0
      node0 2024-12-03T19:10:00.379017Z [      http] [httpserver.cpp:248] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:44984
      node0 2024-12-03T19:10:00.379036Z [httpworker.0] [rpc/request.cpp:180] [parse] [rpc] ThreadRPCServer method=getrawtransaction user=__cookie__
      node0 2024-12-03T19:10:00.379090Z [httpworker.0] [httprpc.cpp:93] [~RpcHttpRequest] [bench] HTTP RPC request handled: user=__cookie__ command=getrawtransaction external=false status=500 elapsed_time_ms=0
      node0 2024-12-03T19:10:00.379240Z [      http] [httpserver.cpp:248] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:44984
  ```

  ## Breaking Changes
  Error type and message changed. It's no more `RPC_INVALID_ADDRESS_OR_KEY` but `RPC_INVALID_REQUEST`.

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

ACKs for top commit:
  kwvg:
    utACK a275bda266
  UdjinM6:
    utACK a275bda266

Tree-SHA512: d53373aba794035173375811e333e940efb1081bed46e18846b2b54d60036ee52487c65f9b84ac687b2be2a30f3a68fb75afbb2c89e52b0774740892863a04df
2024-12-11 08:19:30 -06:00
Konstantin Akimov
5b914fe081
refactor: add const to llmq_ctx, isman, clhandler in rpc code 2024-12-11 19:13:10 +07:00
pasta
6d97441434
Merge #6470: fix: wrong lock order, observed locally on top of #6467 with custom changes
1b0af99fd5 fix: wrong lock order, observed locally on top of #6467 with custom changes (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented

      Assertion failed: detected inconsistent lock order for 'cs_main' in node/blockstorage.cpp:775 (in thread 'httpworker.2'), details in debug log.
         Previous lock order was:
          (2) 'cs_main' in rpc/net.cpp:666 (in thread 'httpworker.3')
          (1) 'm_nodes_mutex' in net.cpp:4754 (in thread 'httpworker.3')
         Current lock order is:
          (1) 'm_nodes_mutex' in net.cpp:5102 (in thread 'httpworker.2')
          (2) 'cs_main' in node/blockstorage.cpp:775 (in thread 'httpworker.2')
      node0 2024-12-09T07:46:49.907123Z (mocktime: 2014-12-04T18:34:20Z) [httpworker.2] [stacktraces.cpp:528] [PrintCrashInfo] Posix Signal: Aborted

      ...
       15#: (0x5764EB18DE42) sync.cpp:123           - potential_deadlock_detected
       16#: (0x5764EB194A7E) sync.cpp:190           - push_lock<std::recursive_mutex>
       17#: (0x5764EB194A7E) sync.cpp:214           - void EnterCritical<std::recursive_mutex>(char const*, char const*, int, std::recursive_mutex*, bool)
       18#: (0x5764EA928642) unique_lock.h:150      - std::unique_lock<std::recursive_mutex>::try_lock()
       19#: (0x5764EA928642) sync.h:168             - UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::Enter(char const*, char const*, int)
       20#: (0x5764EA928642) sync.h:190             - UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::UniqueLock(AnnotatedMixin<std::recursive_mutex>&, char const*, char const*, int, bool)
       21#: (0x5764EAAD9C3D) chain.h:214            - CBlockIndex::GetBlockPos() const
       22#: (0x5764EAAD9C3D) blockstorage.cpp:775   - operator()
       23#: (0x5764EAAD9C3D) blockstorage.cpp:775   - ReadBlockFromDisk(CBlock&, CBlockIndex const*, Consensus::Params const&)
       24#: (0x5764EADB117A) stl_vector.h:1126      - std::vector<std::shared_ptr<CTransaction const>, std::allocator<std::shared_ptr<CTransaction const> > >::operator[](unsigned long)
       25#: (0x5764EADB117A) cbtx.cpp:467           - GetNonNullCoinbaseChainlock(CBlockIndex const*)
       26#: (0x5764EA9FE4F8) utils.cpp:84           - GetHashModifier
       27#: (0x5764EAA05291) utils.cpp:189          - ComputeQuorumMembers
       28#: (0x5764EAA05291) utils.cpp:167          - llmq::utils::GetAllQuorumMembers(Consensus::LLMQType, CDeterministicMNManager&, gsl::not_null<CBlockIndex const*>, bool)
       29#: (0x5764EA9906FC) stl_vector.h:1258      - std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > >::data()
       30#: (0x5764EA9906FC) span.h:164             - Span<std::shared_ptr<CDeterministicMN const> >::Span<std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > > >(std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > >&, std::enable_if<((!Span<std::shared_ptr<CDeterministicMN const> >::is_Span<std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > > >::value)&&std::is_convertible<std::remove_pointer<decltype ((((declval<std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > >&>)()).data)())>::type (*) [], std::shared_ptr<CDeterministicMN const> (*) []>::value)&&std::is_convertible<decltype ((((declval<std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > >&>)()).size)()), unsigned long>::value, decltype(nullptr)>::type)
       31#: (0x5764EA9906FC) quorums.cpp:412        - llmq::CQuorumManager::BuildQuorumFromCommitment(Consensus::LLMQType, gsl::not_null<CBlockIndex const*>, bool) const
       32#: (0x5764EA99198B) shared_ptr_base.h:1540 - std::__shared_ptr<llmq::CQuorum const, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<llmq::CQuorum, void>(std::__shared_ptr<llmq::CQuorum, (__gnu_cxx::_Lock_policy)2>&&)
       33#: (0x5764EA99198B) shared_ptr.h:369       - std::shared_ptr<llmq::CQuorum const>::shared_ptr<llmq::CQuorum, void>(std::shared_ptr<llmq::CQuorum>&&)
       34#: (0x5764EA99198B) quorums.cpp:672        - llmq::CQuorumManager::GetQuorum(Consensus::LLMQType, gsl::not_null<CBlockIndex const*>, bool) const
       35#: (0x5764EA991BD6) shared_ptr_base.h:1070 - std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count()
       36#: (0x5764EA991BD6) shared_ptr_base.h:1524 - std::__shared_ptr<llmq::CQuorum const, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr()
       37#: (0x5764EA991BD6) shared_ptr.h:175       - std::shared_ptr<llmq::CQuorum const>::~shared_ptr()
       38#: (0x5764EA991BD6) quorums.cpp:494        - llmq::CQuorumManager::RequestQuorumData(CNode*, Consensus::LLMQType, CBlockIndex const*, unsigned short, uint256 const&) const
       ...

  ## What was done?
  Refactored call of GetQuorum out of `llmq::CQuorumManager::RequestQuorumData`. It also optimize `CQuorumManager::StartQuorumDataRecoveryThread` because avoid double call of `GetQuorum`

  ## How Has This Been Tested?
  Run with and without this changes.

  ## Breaking Changes
  You may observe error `RPC_INVALID_PARAMETER, "quorum not found"` while calling RPC `quorum getdata` instead returning `false` with log output only in case of request for non-existing quorum.
  The output is not documented at the moment anyway.

  ## 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 1b0af99fd5
  PastaPastaPasta:
    utACK 1b0af99fd5

Tree-SHA512: b1955c7a2caad81f6c68299df513b4b83ff43f1d829d91769ac7d2a7b88985b5e7a86b765cfe90739ced9bac97da8fea23cd5c87cde1fca039d8b3f1a9c91084
2024-12-10 22:35:56 -06:00
pasta
1140e4358b
Merge #6466: backport: merge bitcoin#18642, #25102, #25100, #25157, #25101, #25245, #25456, #24697, #24662, #25499 (clock backports)
e905ae0f4b merge bitcoin#25499: Use steady clock for all millis bench logging (Kittywhiskers Van Gogh)
492654db49 merge bitcoin#24662: Use system time instead of adjusted network time (Kittywhiskers Van Gogh)
bc3ec30144 merge bitcoin#24697: refactor address relay time (Kittywhiskers Van Gogh)
730cdf241a test: remove leftovers missed in bitcoin#25514 (dash#6097) (Kittywhiskers Van Gogh)
c7cb26ba05 merge bitcoin#25456: Use steady_clock for getrpcinfo durations (Kittywhiskers Van Gogh)
ea3c727e02 merge bitcoin#25245: Remove no-op TIME_INIT on deser (Kittywhiskers Van Gogh)
2d33cfba41 merge bitcoin#25101: Add mockable clock type (Kittywhiskers Van Gogh)
ccde10b914 merge bitcoin#25157: Fix -rpcwait with -netinfo returning negative time durations (Kittywhiskers Van Gogh)
484447cc86 merge bitcoin#25100: Switch scheduler to steady_clock (Kittywhiskers Van Gogh)
cc7d2b8d0a merge bitcoin#25102: Remove unused GetTimeSeconds (Kittywhiskers Van Gogh)
8f8e73242d net: use `GetTime<T>()` in leftover `GetTimeSeconds()` usage (Kittywhiskers Van Gogh)
b114718240 merge bitcoin#18642: Use std::chrono for the time to rotate destination of addr messages + tests (Kittywhiskers Van Gogh)

Pull request description:

  ## 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
  - [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 e905ae0f4b
  UdjinM6:
    utACK e905ae0f4b

Tree-SHA512: 022b8fac41315726e622b887ef5f5f5d011c947048d144f6f54c7c596d9e90286b77ec6f91dfc9bdb60ecc21dfa791afe4aba3d97f962eb1e86cd750831275bd
2024-12-10 22:27:43 -06:00
Konstantin Akimov
a275bda266
refactor: removed duplicated code with errors messages for txindex, timestampindex, spentindex 2024-12-11 02:05:32 +07:00
pasta
7f28292b5e
Merge #6413: [v22.0.x] chore: set release true
1c7bfcbde1 chore: set release true (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Sets release flag to true; to be merged closer to release

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

Tree-SHA512: 2337fb7effcd6545a507a851fb2d4f5f0fe9957f8a04fe0fa006fc327e92aca74b865526dc5c1cd888a92b64a885266c0ce083a7582a9f6e74f82e6a175353b4
2024-12-10 12:40:11 -06:00
pasta
35fa4806eb
Merge #6474: perf: NodesSnapshot, do not hold m_nodes_mutex while shuffling
c005011e84 perf: NodesSnapshot, do not hold m_nodes_mutex while shuffling (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Upstream, as expected, only holds m_nodes_mutex while needed. We hold it a bit too long 36f5effa17/src/net.h (L1628-L1640)

  Not sure how this got introduced. I also don't expect this to be a major contention savior, as there is only one instance in ThreadMessageHandler where we actually do shuffle, but still, might as well fix.

  ## What was done?

  ## How Has This Been Tested?
  builds

  ## 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:
  kwvg:
    utACK c005011e84
  UdjinM6:
    utACK c005011e84

Tree-SHA512: 76a848ace9a746c851e0fc1f66def92d67da92e9f295b7aade5a23f7d76b3eb3c28b7a6ac9d04df6dc252c1f1d9fae364821e9416a1f003a2905a30fc51eb41f
2024-12-10 12:29:47 -06:00
pasta
1c7bfcbde1
chore: set release true 2024-12-10 12:04:50 -06:00
pasta
b60241347a
Merge #6476: [v22.0.x] backport: final backports for v22.0.0
c90339eb61 Merge #6459: docs: add release notes for v22.0.0 (pasta)
a6f1fc590c Merge #6475: chore: bumped chain assumed sizes based on latest usage (pasta)
d7cd9f10fd Merge #6464: chore: update man pages for v22 (pasta)
212f91c35f Merge #6461: docs: update supported versions in SECURITY.md (pasta)
9a8b68515d Merge #6460: chore: Translations 2024-12 (pasta)
2f71f4d7d0 Merge #6458: chore: bump MIN_MASTERNODE_PROTO_VERSION to latest proto (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Batch of backports going into v22.0.x recently merged into develop

  ## What was done?
  See commits

  ## How Has This Been Tested?
  compiles

  ## Breaking Changes
  see release notes

  ## 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:
  kwvg:
    utACK c90339eb61
  UdjinM6:
    utACK c90339eb61

Tree-SHA512: 124643d4b17f126c56225269d291672adf567848f440cd33f53358b3f76f0e5cf801c618493e1e24162e00c525a5d43f1bfa461e8928e04e046b37a94d13ae1c
2024-12-10 12:01:09 -06:00
pasta
e482d18233
Merge #6449: refactor: pass CWallet reference to CTransactionBuilder
43778b07f5 refactor: pass CWallet reference to CTransactionBuilder (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Follow-up for #6441

  ## What was done?
  Pass reference to CWallet instead const reference to smart pointer with CWallet to CTransactionBuilder.

  ## 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 43778b07f5
  PastaPastaPasta:
    utACK 43778b07f5

Tree-SHA512: 81451c714ae3fcf695924da1cd578e832ad48fa678dddd67df12a9f4ffcfdfc4522e34977d3e86efc01eb70cfe5359c752c23db0502f1cd9bae2be59587a1c86
2024-12-10 09:46:31 -06:00
pasta
977048fb09
Merge #6325: feat: start DIP0024 from block 1 - fire up test chains by first block - 7/n
906c2d79ba refactor: add annotation gsl::not_null for ConstructCreditPool (Konstantin Akimov)
f1905ca950 fix: intermittent missing of PoSe ban in feature_llmq_simplepose.py (Konstantin Akimov)
cf84dffc9f fix: bump time for all nodes during mine_quorum in feature_llmq_rotation.py test (Konstantin Akimov)
efd4701d30 fix: intermittent error for feature_llmq_simplepose due to rotating quorums (Konstantin Akimov)
2bafadfc34 feat: put DIP0024 activation to block 1 on RegTest (Konstantin Akimov)
632c4c4bcd feat: re-bury DIP0024 with new height when quorums actually appeared (Konstantin Akimov)
343c74b779 fix: intermittent error in feature_index_prune due to DKG influence (Konstantin Akimov)
de821b9b15 refactor: remove command line argument -bip147height, -dip8params (Konstantin Akimov)
d8ce0a74fa docs: updated comment for DIP0003 activation on RegTest (Konstantin Akimov)
4dafec870c fix: add check that DIP0003 activated before retrieving CbTx for CreditPool (Konstantin Akimov)
26e9813672 fix: assertion in Credit Pool validation during connecting blocks (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  This PR is 7th in the achieving ultimate goal to activate old forks from block 1.
  It helps to run unit and functional tests faster; it helps for platform's dev-environment to start faster.

  ## What was done?
  Prior work: #6187, #6189, #6214, #6225, #6269, #6275

  This PR:
   - simplify DIP0024 activation and activate it from block 1 at RegTest
   - removes command lines arguments: -bip147height, -dip8params
   - fixed intermittent errors in feature_index_prune.py and feature_llmq_simplepose.py
   - fix assertion crash on Regtest if using strange combination of -testactivationheight and -dip3params

  ## How Has This Been Tested?
  Run unit, functional tests.

  ## Breaking Changes
  [regtest only] -dip8params, -bip147height are removed.

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

ACKs for top commit:
  UdjinM6:
    utACK 906c2d79ba
  PastaPastaPasta:
    utACK 906c2d79ba

Tree-SHA512: fab8a9bc03bb7f220c19dd952a03f8fec0b6ef1362d7308eb77c90e0ba814a241bb2bf36beccf78bb285ede1b6d85ec52fa19b3729ac9b643b420d13fbb63b47
2024-12-10 09:43:02 -06:00
pasta
c90339eb61
Merge #6459: docs: add release notes for v22.0.0
3404fa0247 docs: add release notes for v22.0.0 (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Release notes for v22

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

  ## 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
  - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

Top commit has no ACKs.

Tree-SHA512: b1fca9297814ab3497cc87512eb2a66daff22a17802c6cd87ef9af75c48fbecda8963c332191c3e3e7abdf495817da3e505b12baa646e97d388cb1aee74a67a7
2024-12-10 09:32:33 -06:00
pasta
a6f1fc590c
Merge #6475: chore: bumped chain assumed sizes based on latest usage
2712968384 chore: bumped chain assumed sizes based on latest usage (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Release process item to bump assumed size

  ## What was done?
  bump sizes as manually calculated

  ## How Has This Been Tested?
  n/a

  ## 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:
  knst:
    ACK 2712968384
  kwvg:
    utACK 2712968384

Tree-SHA512: d0131d692f4ccc858dcc4fff3c494b44bf9f702e2e7a9172d166c53dc693d6eb90e9c86ff412b31defa4cff13e21099808d9fb2ea2174032e6fe79339b1a57d4
2024-12-10 09:32:26 -06:00
pasta
d7cd9f10fd
Merge #6464: chore: update man pages for v22
2dabd78956 chore: update man pages for v22 (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 2dabd78956
  knst:
    utACK 2dabd78956

Tree-SHA512: fc03af689e9c5be54f150d6727772038c70e1fafad0f450b431203aa0e662873e17095e702c8d970eafdd92e386bb471d7894ba51bb72b166fadefabdfaad116
2024-12-10 09:32:20 -06:00
pasta
212f91c35f
Merge #6461: docs: update supported versions in SECURITY.md
87b3c7f5d1 docs: update supported versions in SECURITY.md (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  Updates the supported versions list in `SECURITY.md`

  ## Checklist:

  - [x] I have performed a self-review of my own code **(note: N/A)**
  - [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 87b3c7f5d1
  UdjinM6:
    utACK 87b3c7f5d1

Tree-SHA512: 2a196b0e07e40a557f87a5137ede7d3984f14f48dedbec742e540c9ff1a9a762eccb317b35d102154745756cb83145ce5577495c2a2e581691edcfb0fa18553c
2024-12-10 09:32:13 -06:00
pasta
9a8b68515d
Merge #6460: chore: Translations 2024-12
1d36a4026c 80%+: it, pl, th, zh_CN (UdjinM6)
adfdb5998c 90%+: fr (UdjinM6)
bfff3c9c76 100%: ru (UdjinM6)
ed5f02db9f en (UdjinM6)
d373f85f6b dashstrings.cpp (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  knst:
    utACK 1d36a4026c

Tree-SHA512: 5d860d2d78e354eeae2157e5d40e8ff659963a258b9eb216d15ec72c1c589e254c2f246173be9e3d1892f9c18acae6cfecc1f18956460be5ff13c5c84d6d0ba6
2024-12-10 09:32:06 -06:00
pasta
2f71f4d7d0
Merge #6458: chore: bump MIN_MASTERNODE_PROTO_VERSION to latest proto
1ecfb891bc chore: bump MIN_MASTERNODE_PROTO_VERSION to latest proto (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Bump minimum master node protocol version to latest protocol.

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes
  Masternodes that don't upgrade will end up getting a PoSe ban

  ## 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 1ecfb891bc
  kwvg:
    utACK 1ecfb891bc

Tree-SHA512: 18e0620370924c4f9b0c72b9f384a7b627b9d395b4a4a942d1eaabd8f4294869fb5831c8d237b825053a0ca5aa143cfbb4726312877670088333faa04ab10ef2
2024-12-10 09:31:58 -06:00
pasta
bf22090c84
Merge #6460: chore: Translations 2024-12
1d36a4026c 80%+: it, pl, th, zh_CN (UdjinM6)
adfdb5998c 90%+: fr (UdjinM6)
bfff3c9c76 100%: ru (UdjinM6)
ed5f02db9f en (UdjinM6)
d373f85f6b dashstrings.cpp (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  knst:
    utACK 1d36a4026c

Tree-SHA512: 5d860d2d78e354eeae2157e5d40e8ff659963a258b9eb216d15ec72c1c589e254c2f246173be9e3d1892f9c18acae6cfecc1f18956460be5ff13c5c84d6d0ba6
2024-12-10 09:30:43 -06:00
pasta
2727e7710c
Merge #6459: docs: add release notes for v22.0.0
3404fa0247 docs: add release notes for v22.0.0 (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Release notes for v22

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

  ## 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
  - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

Top commit has no ACKs.

Tree-SHA512: b1fca9297814ab3497cc87512eb2a66daff22a17802c6cd87ef9af75c48fbecda8963c332191c3e3e7abdf495817da3e505b12baa646e97d388cb1aee74a67a7
2024-12-10 09:29:13 -06:00
pasta
11e020bb12
Merge #6464: chore: update man pages for v22
2dabd78956 chore: update man pages for v22 (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 2dabd78956
  knst:
    utACK 2dabd78956

Tree-SHA512: fc03af689e9c5be54f150d6727772038c70e1fafad0f450b431203aa0e662873e17095e702c8d970eafdd92e386bb471d7894ba51bb72b166fadefabdfaad116
2024-12-10 09:26:52 -06:00
pasta
a643b2ec7c
Merge #6475: chore: bumped chain assumed sizes based on latest usage
2712968384 chore: bumped chain assumed sizes based on latest usage (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Release process item to bump assumed size

  ## What was done?
  bump sizes as manually calculated

  ## How Has This Been Tested?
  n/a

  ## 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:
  knst:
    ACK 2712968384
  kwvg:
    utACK 2712968384

Tree-SHA512: d0131d692f4ccc858dcc4fff3c494b44bf9f702e2e7a9172d166c53dc693d6eb90e9c86ff412b31defa4cff13e21099808d9fb2ea2174032e6fe79339b1a57d4
2024-12-10 09:20:39 -06:00
pasta
3404fa0247
docs: add release notes for v22.0.0 2024-12-10 09:12:37 -06:00
pasta
b1a184e286
Merge #6463: test: small improvements in feature_governance.py
bbcc0169f1 test: small improvements in feature_governance.py (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  Make debugging test failures a bit easier by adding some more logs and ensuring vote propagation before moving any further.

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK bbcc0169f1
  knst:
    utACK bbcc0169f1

Tree-SHA512: d4f7d7b560b1de849c30db598290af26d807a39b39a7532d2fe3d76c74c0d49ee294e4fac533a19a4a02dbf4f46d56f4b5e0116855a392fbbc992068cb17d38e
2024-12-10 09:08:01 -06:00
pasta
2712968384
chore: bumped chain assumed sizes based on latest usage 2024-12-10 09:03:23 -06:00
pasta
b197ffb83f
Merge #6467: feat: mnauth always use basic scheme
09058e0d71 feat: mnauth always use basic scheme (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Currently, mnauth has to check status of v19 hard fork. While this isn't soo terrible, it's not needed anymore. On mainnet or testnet, any mn you possible connect to will have it's TIP past v19 HF, meaning in practice it will only ever send you basic scheme anyhow. Let's just harden it. I initially guarded this behind a new protocol version, but I do not think that is needed.

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes
  This is potentially a breaking change for devnets, which are moving past the v19 hard fork, but on develop v19 activates at block 2 for devnets sooooo, this shouldn't be noticed.

  ## 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 09058e0d71
  knst:
    utACK 09058e0d71

Tree-SHA512: 45483904135c90a507f2a1f61c4b06915eb7c02a29eeda254938624a2593aec86540fa360aea498428285b3c0e954c676510dcb128f4ec7062302293c134d517
2024-12-10 08:06:34 -06:00
pasta
8ec789fe27
Merge #6471: fix: don't shrink window when setting minimum width
e08068687c fix: don't shrink window when setting minimum width (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Closes https://github.com/dashpay/dash/issues/5886
  * We've been setting restrictions on the width of the window since [dash#3734](https://github.com/dashpay/dash/pull/3734) (see d351fca6a6 and c0447b0bc6), meaning, the behavior as described in [dash#5886](https://github.com/dashpay/dash/issues/5886) has been present since v0.16 (v0.15 and earlier used the old UI design).
    * We do not set any restrictions on height and in that respect, Dash Qt will behave similar to Bitcoin Qt in that it can be resized to be arbitrarily small.

  ## How Has This Been Tested?

  Crossed compiled for `x86_64-w64-mingw32` and tested resulting `dash-qt.exe` on Windows 11 22H2 (Build 22621.431). Followed reproduction steps as mentioned in [dash#5886](https://github.com/dashpay/dash/issues/5886), found width to persist even after closing Options modal using buttons and the close button on the top right.

  ## 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
  - [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:
    generally utACK e08068687c
  UdjinM6:
    utACK e08068687c

Tree-SHA512: ed3874c830c0ddf1a9e1166b75e3088969b7dfae8bca25af47045727e14a270ca2bb740e2c30b657b26a4b8e542dff8d898e5d5d2c9482d67da15578e0054632
2024-12-10 07:56:57 -06:00
Konstantin Akimov
1b0af99fd5
fix: wrong lock order, observed locally on top of #6467 with custom changes
Assertion failed: detected inconsistent lock order for 'cs_main' in node/blockstorage.cpp:775 (in thread 'httpworker.2'), details in debug log.
       Previous lock order was:
        (2) 'cs_main' in rpc/net.cpp:666 (in thread 'httpworker.3')
        (1) 'm_nodes_mutex' in net.cpp:4754 (in thread 'httpworker.3')
       Current lock order is:
        (1) 'm_nodes_mutex' in net.cpp:5102 (in thread 'httpworker.2')
        (2) 'cs_main' in node/blockstorage.cpp:775 (in thread 'httpworker.2')
    node0 2024-12-09T07:46:49.907123Z (mocktime: 2014-12-04T18:34:20Z) [httpworker.2] [stacktraces.cpp:528] [PrintCrashInfo] Posix Signal: Aborted

    ...
     15#: (0x5764EB18DE42) sync.cpp:123           - potential_deadlock_detected
     16#: (0x5764EB194A7E) sync.cpp:190           - push_lock<std::recursive_mutex>
     17#: (0x5764EB194A7E) sync.cpp:214           - void EnterCritical<std::recursive_mutex>(char const*, char const*, int, std::recursive_mutex*, bool)
     18#: (0x5764EA928642) unique_lock.h:150      - std::unique_lock<std::recursive_mutex>::try_lock()
     19#: (0x5764EA928642) sync.h:168             - UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::Enter(char const*, char const*, int)
     20#: (0x5764EA928642) sync.h:190             - UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::UniqueLock(AnnotatedMixin<std::recursive_mutex>&, char const*, char const*, int, bool)
     21#: (0x5764EAAD9C3D) chain.h:214            - CBlockIndex::GetBlockPos() const
     22#: (0x5764EAAD9C3D) blockstorage.cpp:775   - operator()
     23#: (0x5764EAAD9C3D) blockstorage.cpp:775   - ReadBlockFromDisk(CBlock&, CBlockIndex const*, Consensus::Params const&)
     24#: (0x5764EADB117A) stl_vector.h:1126      - std::vector<std::shared_ptr<CTransaction const>, std::allocator<std::shared_ptr<CTransaction const> > >::operator[](unsigned long)
     25#: (0x5764EADB117A) cbtx.cpp:467           - GetNonNullCoinbaseChainlock(CBlockIndex const*)
     26#: (0x5764EA9FE4F8) utils.cpp:84           - GetHashModifier
     27#: (0x5764EAA05291) utils.cpp:189          - ComputeQuorumMembers
     28#: (0x5764EAA05291) utils.cpp:167          - llmq::utils::GetAllQuorumMembers(Consensus::LLMQType, CDeterministicMNManager&, gsl::not_null<CBlockIndex const*>, bool)
     29#: (0x5764EA9906FC) stl_vector.h:1258      - std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > >::data()
     30#: (0x5764EA9906FC) span.h:164             - Span<std::shared_ptr<CDeterministicMN const> >::Span<std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > > >(std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > >&, std::enable_if<((!Span<std::shared_ptr<CDeterministicMN const> >::is_Span<std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > > >::value)&&std::is_convertible<std::remove_pointer<decltype ((((declval<std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > >&>)()).data)())>::type (*) [], std::shared_ptr<CDeterministicMN const> (*) []>::value)&&std::is_convertible<decltype ((((declval<std::vector<std::shared_ptr<CDeterministicMN const>, std::allocator<std::shared_ptr<CDeterministicMN const> > >&>)()).size)()), unsigned long>::value, decltype(nullptr)>::type)
     31#: (0x5764EA9906FC) quorums.cpp:412        - llmq::CQuorumManager::BuildQuorumFromCommitment(Consensus::LLMQType, gsl::not_null<CBlockIndex const*>, bool) const
     32#: (0x5764EA99198B) shared_ptr_base.h:1540 - std::__shared_ptr<llmq::CQuorum const, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<llmq::CQuorum, void>(std::__shared_ptr<llmq::CQuorum, (__gnu_cxx::_Lock_policy)2>&&)
     33#: (0x5764EA99198B) shared_ptr.h:369       - std::shared_ptr<llmq::CQuorum const>::shared_ptr<llmq::CQuorum, void>(std::shared_ptr<llmq::CQuorum>&&)
     34#: (0x5764EA99198B) quorums.cpp:672        - llmq::CQuorumManager::GetQuorum(Consensus::LLMQType, gsl::not_null<CBlockIndex const*>, bool) const
     35#: (0x5764EA991BD6) shared_ptr_base.h:1070 - std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count()
     36#: (0x5764EA991BD6) shared_ptr_base.h:1524 - std::__shared_ptr<llmq::CQuorum const, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr()
     37#: (0x5764EA991BD6) shared_ptr.h:175       - std::shared_ptr<llmq::CQuorum const>::~shared_ptr()
     38#: (0x5764EA991BD6) quorums.cpp:494        - llmq::CQuorumManager::RequestQuorumData(CNode*, Consensus::LLMQType, CBlockIndex const*, unsigned short, uint256 const&) const
     ...
2024-12-10 20:51:17 +07:00
Konstantin Akimov
906c2d79ba
refactor: add annotation gsl::not_null for ConstructCreditPool 2024-12-10 15:52:43 +07:00
pasta
5329f04ac4
Merge #6435: backport: bitcoin#24281, 24360, 24347, 24376, 24370, 24305
e738513a2c Merge bitcoin/bitcoin#24305: Docs: [policy] Remove outdated confusing comment (MarcoFalke)
d0e0381dfa Merge bitcoin/bitcoin#24370: rpc, cli: describe quality/recency filtering in getnodeaddresses and -addrinfo (MarcoFalke)
21cea475d8 Merge bitcoin/bitcoin#24376: doc: bitcoin-wallet fixes (help output and code comment) (MarcoFalke)
f1c5ab1fcb Merge bitcoin/bitcoin#24347: rpc: Fix implicit-integer-sign-change in verifychain (MarcoFalke)
19e3ee894e Merge bitcoin/bitcoin#24360: doc: improve -netinfo help based on feedback from users and devs (MarcoFalke)

Pull request description:

  Backports

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

Tree-SHA512: 6a3c0caa11f55e17e52881761b4b3e20edb942daadad5ebb0af711ff23d8ddf7ef9987eb75ec4fc45e7211f7e82e3f00e2f59f3131dba17509d09ae018f8133a
2024-12-09 15:45:55 -06:00
pasta
babafbb1be
Merge #6457: fix(qt): improve GUI responsiveness for huge wallets
a4378fc2ff fix(qt): emit dataChanged for the whole model in TransactionTableModel (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  Somehow a 500k+ txes wallet is MUCH more responsive with this patch. I'm not sure if it's macos only or not though, pls test.

  ## What was done?

  ## How Has This Been Tested?
  Run a wallet with 100k+ txes in it and send a tx or try changing units.

  ## Breaking Changes

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

ACKs for top commit:
  knst:
    ACK a4378fc2ff
  PastaPastaPasta:
    utACK a4378fc2ff

Tree-SHA512: eb0116f99f145ee131bd4a69895c9384dc26fc113ee034a2af74a92b0770b33631455a79e5826dc004f922ac182481eb26c54255274e186a47da3796da9550a6
2024-12-09 15:32:06 -06:00
pasta
ff1ddc952a
Merge #6443: refactor: move CConnman and PeerManager out of CDeterministicMNManager, LLMQContext member ctors, reduce use in CJContext
7d26061170 refactor: move `CConnman`, `PeerManager` out of `CCoinJoinClientQueueManager` ctor (Kittywhiskers Van Gogh)
953ba96ac9 refactor: move `CConnman` out of `CoinJoinWalletManager` ctor (Kittywhiskers Van Gogh)
ac930a84d8 refactor: remove unused `CConnman` from `CDeterministicMNManager` ctor (Kittywhiskers Van Gogh)
a14e604064 refactor: remove `CConnman`, `PeerManager` from `LLMQContext` ctor (Kittywhiskers Van Gogh)
d9e5cc7c9a refactor: move `PeerManager` out of `CInstantSendManager` ctor (Kittywhiskers Van Gogh)
82d1aed1d6 refactor: move `CConnman`, `PeerManager` out of `CSigSharesManager` ctor (Kittywhiskers Van Gogh)
7498a38076 refactor: move `PeerManager` out of `CSigningManager` ctor (Kittywhiskers Van Gogh)
7ebc61e375 refactor: move `CConnman` out of `CQuorumManager` ctor (Kittywhiskers Van Gogh)
c07b522baa refactor: move `CConnman` out of `CDKGSession{,Handler,Manager}` ctor (Kittywhiskers Van Gogh)
01876c7e56 refactor: move `PeerManager` out of `CDKGSession{,Handler,Manager}` ctor (Kittywhiskers Van Gogh)
cc0e771c29 refactor: start BLS thread in `LLMQContext` ctor, move `Start` downwards (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Depends on https://github.com/dashpay/dash/pull/6425
  * Dependency for https://github.com/dashpay/dash/pull/6304
  * In order to reduce the logic used in chainstate initialization (that will be split out of `init.cpp` in [bitcoin#23280](https://github.com/bitcoin/bitcoin/pull/23280)), the spinning up of threads (as done in `LLMQContext::Start()`) needs to be moved down.
    * They were moved up in [dash#5752](https://github.com/dashpay/dash/pull/5752) as `CBLSWorker` is a part of `LLMQContext` and `CBLSWorker` is needed during chainstate verification. As suggested in dash#5752, an alternate fix to the one already merged in was to move `CBLSWorker` `Start()`/`Stop()` to the constructor, which is done here.
      * Another alternate fix is that we move it out of `LLMQContext` entirely and let it remain in `NodeContext` though this approach has not been taken.
    * The reason we cannot retain the status quo is because `bitcoin-chainstate` (the binary introduced in [bitcoin#24304](https://github.com/bitcoin/bitcoin/pull/24304) that's built on the code split off in [bitcoin#23280](https://github.com/bitcoin/bitcoin/pull/23280)) aims to be devoid of P2P logic and this is reflected in the source files used to build it ([source](https://github.com/bitcoin/bitcoin/pull/24304/files#diff-4cb884d03ebb901069e4ee5de5d02538c40dd9b39919c615d8eaa9d364bbbd77R794)). (Also, there's no `NodeContext`, [source](https://github.com/bitcoin/bitcoin/pull/24304/files#diff-4cb884d03ebb901069e4ee5de5d02538c40dd9b39919c615d8eaa9d364bbbd77R795-R798))
      * This means need to separate P2P and validation components from Dash-specific logic in order for the split to work as expected. This PR is a step in that direction by moving P2P elements (`CConnman` and `PeerManager`) out of constructors.
  * As it stands, there are two sources for Dash-specific components to have access to P2P components, initialization (e.g. through `LLMQContext::Start()` or `PeerManagerImpl::ProcessMessage()`).

  ## Breaking Changes

  None expected. While changes are present in initialization order, consensus behaviour should remain unchanged.

  ## 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:
  knst:
    utACK 7d26061170
  UdjinM6:
    utACK 7d26061170

Tree-SHA512: 4f12cbda935cad3a186acb31fed513cea489b0d3a55aa80be8e1336d10cbe1579d6d3db862a78a167134650c9e97816732acaf0c85ab759f6555b1b6be99ec02
2024-12-09 15:00:23 -06:00
pasta
c5889443ed
Merge #6465: fix: avoid potential divide-by-zero in network hashrate stats calculation
40070c0337 stats: don't report `network.*hashesPerSecond` if it's zero (Kittywhiskers Van Gogh)
b39c6b9909 fix: avoid potential divide-by-zero in H/s stats calculation (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  It was reported that on occasion, `network.*hashesPerSecond` would report NaN gauge values, which would be dismissed as malformed reporting by Grafana (see below). Those gauges use a simplified version ([source](1ecfb891bc/src/init.cpp (L851-L864))) of `GetNetworkHashPS` ([source](1ecfb891bc/src/rpc/mining.cpp (L61))), crucially, without a check meant to avoid divide-by-zeros ([source](1ecfb891bc/src/rpc/mining.cpp (L89-L91))).

  <details>

  <summary>Error log (courtesy of PastaPastaPasta):</summary>

  ```
  [...]
  graphite-1             | 7 Dec 21:18:05 - DEBUG: Bad line: -nan,g in msg "network.terahashesPerSecond:-nan|g"
  graphite-1             | 7 Dec 21:18:05 - DEBUG: Bad line: -nan,g in msg "network.petahashesPerSecond:-nan|g"
  graphite-1             | 7 Dec 21:18:05 - DEBUG: Bad line: -nan,g in msg "network.exahashesPerSecond:-nan|g"
  graphite-1             | 7 Dec 21:18:10 - DEBUG: Bad line: -nan,g in msg "network.hashesPerSecond:-nan|g"
  graphite-1             | 7 Dec 21:18:10 - DEBUG: Bad line: -nan,g in msg "network.terahashesPerSecond:-nan|g"
  graphite-1             | 7 Dec 21:18:10 - DEBUG: Bad line: -nan,g in msg "network.petahashesPerSecond:-nan|g"
  graphite-1             | 7 Dec 21:18:10 - DEBUG: Bad line: -nan,g in msg "network.exahashesPerSecond:-nan|g"
  graphite-1             | 7 Dec 21:18:15 - DEBUG: Bad line: -nan,g in msg "network.hashesPerSecond:-nan|g"
  [...]
  ```

  </details>

  This has been resolved by adding that check, alongside encapsulating the logic in a lambda and not reporting the gauge values if the estimated hashes per second reported is zero, due to the unlikelihood of it being correct.

  ## 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:
  UdjinM6:
    utACK 40070c0337
  knst:
    utACK 40070c0337

Tree-SHA512: 64bcca0f51a8bebb090613d3495ddba481ea6464f9f4a6791d830593fd1401c890eba65869f8719c6c6033a3346af11f16855a95fec5f42722b26a12b9f8b3c9
2024-12-09 14:45:37 -06:00
pasta
c005011e84
perf: NodesSnapshot, do not hold m_nodes_mutex while shuffling 2024-12-09 14:40:55 -06:00
pasta
09058e0d71
feat: mnauth always use basic scheme
fixup: drop CChain from mnauth ProcessMessage
feat: let RPC mnauth to generate only BASIC bls messages and fixes for rpc_mnauth.py and p2p_quorum_data.py
refactor: drop unused ConstCBLSPublicKeyVersionWrapper
2024-12-09 14:36:49 -06:00
Kittywhiskers Van Gogh
e905ae0f4b
merge bitcoin#25499: Use steady clock for all millis bench logging 2024-12-09 19:05:47 +00:00
Kittywhiskers Van Gogh
e08068687c
fix: don't shrink window when setting minimum width 2024-12-09 11:49:16 +00:00
UdjinM6
6f88c070d9
ci: treat all non-protected branches as pull requests 2024-12-09 12:31:56 +03:00
Konstantin Akimov
f1905ca950
fix: intermittent missing of PoSe ban in feature_llmq_simplepose.py 2024-12-09 13:44:54 +07:00
Konstantin Akimov
cf84dffc9f
fix: bump time for all nodes during mine_quorum in feature_llmq_rotation.py test 2024-12-09 13:44:54 +07:00
Kittywhiskers Van Gogh
492654db49
merge bitcoin#24662: Use system time instead of adjusted network time 2024-12-08 15:23:29 +00:00
Kittywhiskers Van Gogh
bc3ec30144
merge bitcoin#24697: refactor address relay time 2024-12-08 15:23:29 +00:00
Kittywhiskers Van Gogh
730cdf241a
test: remove leftovers missed in bitcoin#25514 (dash#6097) 2024-12-08 15:23:29 +00:00
Kittywhiskers Van Gogh
c7cb26ba05
merge bitcoin#25456: Use steady_clock for getrpcinfo durations 2024-12-08 15:23:29 +00:00
Kittywhiskers Van Gogh
ea3c727e02
merge bitcoin#25245: Remove no-op TIME_INIT on deser 2024-12-08 15:23:29 +00:00
Kittywhiskers Van Gogh
2d33cfba41
merge bitcoin#25101: Add mockable clock type 2024-12-08 15:23:28 +00:00
Kittywhiskers Van Gogh
ccde10b914
merge bitcoin#25157: Fix -rpcwait with -netinfo returning negative time durations 2024-12-08 15:23:28 +00:00
Kittywhiskers Van Gogh
484447cc86
merge bitcoin#25100: Switch scheduler to steady_clock 2024-12-08 15:23:27 +00:00
Kittywhiskers Van Gogh
cc7d2b8d0a
merge bitcoin#25102: Remove unused GetTimeSeconds 2024-12-08 15:23:27 +00:00
Kittywhiskers Van Gogh
8f8e73242d
net: use GetTime<T>() in leftover GetTimeSeconds() usage 2024-12-08 15:23:26 +00:00
Kittywhiskers Van Gogh
b114718240
merge bitcoin#18642: Use std::chrono for the time to rotate destination of addr messages + tests 2024-12-08 15:23:26 +00:00
Kittywhiskers Van Gogh
40070c0337
stats: don't report network.*hashesPerSecond if it's zero
It's more likely that the stat is broken than the network running with
such low difficulty, the hash rate is reported as zero.
`*hashesPerSecond` are a gauge and we should let the last known good
value linger instead of potentially overwriting it with an improbable
value.
2024-12-08 10:18:13 +00:00
Kittywhiskers Van Gogh
b39c6b9909
fix: avoid potential divide-by-zero in H/s stats calculation 2024-12-08 10:14:46 +00:00
UdjinM6
2dabd78956
chore: update man pages for v22 2024-12-07 23:53:40 +03:00
pasta
7c00c868d8
Merge #6461: docs: update supported versions in SECURITY.md
87b3c7f5d1 docs: update supported versions in SECURITY.md (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  Updates the supported versions list in `SECURITY.md`

  ## Checklist:

  - [x] I have performed a self-review of my own code **(note: N/A)**
  - [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 87b3c7f5d1
  UdjinM6:
    utACK 87b3c7f5d1

Tree-SHA512: 2a196b0e07e40a557f87a5137ede7d3984f14f48dedbec742e540c9ff1a9a762eccb317b35d102154745756cb83145ce5577495c2a2e581691edcfb0fa18553c
2024-12-07 12:27:36 -06:00
pasta
9bede350a0
Merge #6458: chore: bump MIN_MASTERNODE_PROTO_VERSION to latest proto
1ecfb891bc chore: bump MIN_MASTERNODE_PROTO_VERSION to latest proto (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Bump minimum master node protocol version to latest protocol.

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes
  Masternodes that don't upgrade will end up getting a PoSe ban

  ## 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 1ecfb891bc
  kwvg:
    utACK 1ecfb891bc

Tree-SHA512: 18e0620370924c4f9b0c72b9f384a7b627b9d395b4a4a942d1eaabd8f4294869fb5831c8d237b825053a0ca5aa143cfbb4726312877670088333faa04ab10ef2
2024-12-07 12:26:21 -06:00
MarcoFalke
e738513a2c
Merge bitcoin/bitcoin#24305: Docs: [policy] Remove outdated confusing comment
e50a9be1540c769a99fcdc1f7a109a6bf1c7516b Remove outdated comment on CFeeRate (Murch)

Pull request description:

  This comment described how the constructor of CFeeRate was previously indirectly used to parse fee rate arguments from RPCs. The command line input was actually in sat/vB but due to the use of AmountFromValue() it got converted to BTC/vB which then got rectified in the constructor by creating a CFeeRate from that given value and COIN as the transaction size. Since this usage pattern was removed from the codebase some months ago, the comment is now obsolete.

ACKs for top commit:
  michaelfolkson:
    ACK e50a9be1540c769a99fcdc1f7a109a6bf1c7516b
  jonatack:
    ACK e50a9be1540c769a99fcdc1f7a109a6bf1c7516b

Tree-SHA512: f17bf0baeeca85a5c7883edadd407da845f6e3af1c949e93116bd67c02e601682a5f7f1ab2497172472e3acf1c4e3c234b01161a77e7d7f028e3551da34777f0
2024-12-07 23:20:22 +05:30
MarcoFalke
d0e0381dfa
Merge bitcoin/bitcoin#24370: rpc, cli: describe quality/recency filtering in getnodeaddresses and -addrinfo
ce690847b69eb80b0232f818152dbb1db7c4c61a cli: describe quality/recency filtering in -addrinfo (Jon Atack)
7c975614c0fc6ff2084a1708a4c1f0368a4bc98f rpc: describe quality/recency filtering in getnodeaddresses (Jon Atack)

Pull request description:

  Addresses #24278.

  ```
  $ bitcoin-cli help getnodeaddresses
  getnodeaddresses ( count "network" )

  Return known addresses, after filtering for quality and recency.
  These can potentially be used to find new peers in the network.
  The total number of addresses known to the node may be higher.
  ```
  ```
  $ bitcoin-cli -help | grep -A3 addrinfo
    -addrinfo
         Get the number of addresses known to the node, per network and total,
         after filtering for quality and recency. The total number of
         addresses known to the node may be higher.
  ```

ACKs for top commit:
  mzumsande:
    Thanks, Code Review ACK ce690847b69eb80b0232f818152dbb1db7c4c61a
  prayank23:
    reACK ce690847b6

Tree-SHA512: 82d23b15e64a99411eb8e70d7267a1b4f23182fabe072e824277569d9677e392b466be63f00e3d157d7db94bbe032d53f12ad4ab30b55b7b8a629c37d80d1d8c
2024-12-07 23:20:22 +05:30
MarcoFalke
21cea475d8
Merge bitcoin/bitcoin#24376: doc: bitcoin-wallet fixes (help output and code comment)
62cc138ecb9cc7afcbe6fdb42b060a8f149826de Rename wallet-tool to bitcoin-wallet in code comment (Kristaps Kaupe)
0db3ad3ba41a76dff80bcb5f292e587da400ebf1 Mention -signet in bitcoin-wallet help output (Kristaps Kaupe)

Pull request description:

  * Mention `-signet` in sentence where there is already `-testnet/-signet` in help output.
  * Rename `wallet-tool` to `bitcoin-wallet` in single remaining place in code comments (was already done in #17648 at other places).

ACKs for top commit:
  RandyMcMillan:
    tACK 62cc138ecb

Tree-SHA512: c5df7811b8200f61943908dcf3b2b788fe991bf00bef28f069ab8784924556ffd5d86fc0ba2ad0b3c3f9be2ba73a34bc67059d7c057bba646c1801ffa3cb2070
2024-12-07 23:20:22 +05:30
MarcoFalke
f1c5ab1fcb
Merge bitcoin/bitcoin#24347: rpc: Fix implicit-integer-sign-change in verifychain
fa8dad0e078c577d740a9667636733957586c035 rpc: Fix implicit-integer-sign-change in verifychain (MarcoFalke)

Pull request description:

  It doesn't really make sense to treat `DEFAULT_CHECKLEVEL` as unsigned as long as `VerifyDB` accepts a signed integer.

  Making it signed also avoids a cast round trip from signed->unsigned->signed in the RPC.

ACKs for top commit:
  luke-jr:
    utACK fa8dad0e078c577d740a9667636733957586c035
  theStack:
    Code-review ACK fa8dad0e078c577d740a9667636733957586c035

Tree-SHA512: 75499dbe4ace2962792e5fbec7defb10c25fdbbfde951d5e542a91daa880cc50395da0287173e2c84a28e18267c74af7b44b9f38ce364bcb0216c402f65b7641
2024-12-07 23:20:22 +05:30
MarcoFalke
19e3ee894e
Merge bitcoin/bitcoin#24360: doc: improve -netinfo help based on feedback from users and devs
a4da16fbd43ea1fff344f1602f7a5ace3d4a8a95 Improve -netinfo help based on feedback from users and devs (Jon Atack)

Pull request description:

  Clarify which networks are displayed by the peer counts table (*reachable* networks; follow-up to #23324) in response to questions received over the past months, and a few other improvements.

ACKs for top commit:
  laanwj:
    Code review ACK a4da16fbd43ea1fff344f1602f7a5ace3d4a8a95
  w0xlt:
    ACK a4da16f
  kristapsk:
    utACK a4da16fbd43ea1fff344f1602f7a5ace3d4a8a95

Tree-SHA512: e6522c08421aa7f10d50723156d0a8fc5ec82cad2f0bd931bbec603077fcd4921c6505ef743d57386fba81c95dcfc77df75abf3378319886368e4ae33f9a6d73
2024-12-07 23:20:22 +05:30
UdjinM6
bbcc0169f1
test: small improvements in feature_governance.py 2024-12-07 17:14:07 +03:00
Kittywhiskers Van Gogh
87b3c7f5d1
docs: update supported versions in SECURITY.md 2024-12-07 07:58:19 +00:00
UdjinM6
1d36a4026c
80%+: it, pl, th, zh_CN 2024-12-07 10:30:29 +03:00
UdjinM6
adfdb5998c
90%+: fr 2024-12-07 10:29:14 +03:00
UdjinM6
bfff3c9c76
100%: ru 2024-12-07 10:26:08 +03:00
UdjinM6
ed5f02db9f
en 2024-12-07 10:23:05 +03:00
UdjinM6
d373f85f6b
dashstrings.cpp 2024-12-07 10:23:05 +03:00
pasta
1ecfb891bc
chore: bump MIN_MASTERNODE_PROTO_VERSION to latest proto 2024-12-06 17:18:35 -06:00
pasta
9d3f22a4b2
Merge #6454: [v22.0.x] backport: 22.0.0 rc.4 backports
fa29ed5b5e Merge #6456: fix(qt): allow refreshing wallet data without crashing (pasta)
758cd646a1 Merge #6452: fix: store ready queues on the mixing masternode (pasta)
395447bf30 Merge #6451: depends: update 'src/dashbls' to dashpay/bls-signatures@7e747e8a as 62fa6652 (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  batch of backports to go into rc.4

  ## What was done?
  Bls library updated to compile on freebsd, fix for mixing

  ## How Has This Been Tested?

  ## Breaking Changes

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

Tree-SHA512: 6a050bca13ca2e5324a6a8a7966d2d6aa3c0c97ee3c884aa35102f949dfef62e976d053cd05a549908c30e8bb6a81d996a82181852841809d8959ca78c96e823
2024-12-06 17:01:03 -06:00
pasta
fa29ed5b5e
Merge #6456: fix(qt): allow refreshing wallet data without crashing
d296005194 fix(qt): allow refreshing wallet data without crashing (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  We re-use `refreshWallet` method to optimise loading for huge wallets https://github.com/dashpay/dash/pull/5453.
  However gui121 backport (via 25f87b9434) added a condition that prevents this logic. Fix it by allowing explicit wallet refresh (force=true).

  ## What was done?

  ## How Has This Been Tested?
  Open a wallet with 10k+ txes, do `rescanblockchain` via rpc console

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK d296005194c7bd8c65006ddf1b25052b2655c923;

Tree-SHA512: d308b3fe9c4fbbfbf2e2339aa14c825aa6f69c72d1f04dab7a14dc1c8721138beca47c7b3801db9782d6cecf2c54023a19a6d22e04b84615f9bddb0b8ec1696c
2024-12-06 16:54:31 -06:00
pasta
96c97bb169
Merge #6456: fix(qt): allow refreshing wallet data without crashing
d296005194 fix(qt): allow refreshing wallet data without crashing (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  We re-use `refreshWallet` method to optimise loading for huge wallets https://github.com/dashpay/dash/pull/5453.
  However gui121 backport (via 25f87b9434) added a condition that prevents this logic. Fix it by allowing explicit wallet refresh (force=true).

  ## What was done?

  ## How Has This Been Tested?
  Open a wallet with 10k+ txes, do `rescanblockchain` via rpc console

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK d296005194c7bd8c65006ddf1b25052b2655c923;

Tree-SHA512: d308b3fe9c4fbbfbf2e2339aa14c825aa6f69c72d1f04dab7a14dc1c8721138beca47c7b3801db9782d6cecf2c54023a19a6d22e04b84615f9bddb0b8ec1696c
2024-12-06 16:53:01 -06:00
UdjinM6
d296005194
fix(qt): allow refreshing wallet data without crashing 2024-12-07 01:19:28 +03:00
UdjinM6
a4378fc2ff
fix(qt): emit dataChanged for the whole model in TransactionTableModel 2024-12-07 00:39:21 +03:00
merge-script
3931608858
Merge bitcoin/bitcoin#22543: test: Use MiniWallet in mempool_limit.py
08634e82c68ea1be79e1395f4f551082f497023f fix typos in logging messages (ShubhamPalriwala)
d447ded6babebe7c7948e585c9e78bf34dbef226 replace: self.nodes[0] with node (ShubhamPalriwala)
dddca3899c4738e512313a85aeb006310e34e31f test: use MiniWallet in mempool_limit.py (ShubhamPalriwala)

Pull request description:

  This is a PR proposed in #20078

  This PR enables running another non-wallet functional test even when the wallet is disabled thanks to the MiniWallet, i.e. it can be run even when bitcoin-core is compiled with --disable-wallet.

  It also includes changes in wallet.py in the form of a new method, `create_large_transactions()` for the MiniWallet to create large transactions.

  Efforts for this feature started in #20874 but were not continued and that PR was closed hence I picked this up.

  To test this PR locally, compile and build bitcoin-core without the wallet and run:
  ```
  $ test/functional/mempool_limit.py
  ```

ACKs for top commit:
  amitiuttarwar:
    ACK 08634e8, only git changes since last push (and one new line).
  Zero-1729:
    ACK 08634e82c68ea1be79e1395f4f551082f497023f 🧉

Tree-SHA512: 0f744ad26bf7a5a784aac1ed5077b59c95a36d1ff3ad0087ffd10ac8d5979f7362c63c20c2ce2bfa650fda02dfbcd60b1fceee049a2465c8d221cce51c20369f
2024-12-06 17:48:07 +05:30
MarcoFalke
f147373a32
Merge bitcoin/bitcoin#24449: fuzz: FuzzedFileProvider::write should not return negative value
fc471814dc34abb4d5479803ebb1033b572eda43 fuzz: FuzzedFileProvider::write should not return negative value (eugene)

Pull request description:

  Doing so can lead to a glibc crash (from 2005 but I think it's relevant https://sourceware.org/bugzilla/show_bug.cgi?id=2074). Also the manpage for fopencookie warns against this: https://man7.org/linux/man-pages/man3/fopencookie.3.html. This would invalidate the autofile seeds (and maybe others?) in qa-assets.

  On another note, I noticed that FuzzedFileProvider::seek has some confusing behavior with SEEK_END. It seems to me that if these handlers are supposed to mimic the real functions, that SEEK_END would use the offset from the end of the stream, rather than changing the offset with a random value between 0 and 4096. I could also open a PR to fix SEEK_END, but it would invalidate the seeds.

ACKs for top commit:
  MarcoFalke:
    cr ACK fc471814dc34abb4d5479803ebb1033b572eda43

Tree-SHA512: 9db41637f0df7f2b2407b82531cbc34f4ba9393063b63ec6786372e808fe991f7f24df45936c203fe0f9fc49686180c65ad57c2ce7d49e0c5402240616bcfede
2024-12-06 17:48:07 +05:30
W. J. van der Laan
2a2a2693d0
Merge bitcoin/bitcoin#23253: bitcoin-tx: Reject non-integral and out of range int strings
fa6f29de516c7af5206b91b59ada466032329250 bitcoin-tx: Reject non-integral and out of range multisig numbers (MarcoFalke)
fafab8ea5e6ed6b87fac57a5cd16a8135236cdd6 bitcoin-tx: Reject non-integral and out of range sequence ids (MarcoFalke)
fa53d3d8266ad0257315d07b71b4f8a711134622 test: Check that bitcoin-tx accepts whitespace around sequence id and multisig numbers (MarcoFalke)

Pull request description:

  Seems odd to silently accept arbitrary strings that don't even represent integral values.

  Fix that.

ACKs for top commit:
  practicalswift:
    cr ACK fa6f29de516c7af5206b91b59ada466032329250
  laanwj:
    Code review ACK fa6f29de516c7af5206b91b59ada466032329250
  Empact:
    Code review ACK fa6f29de51
  promag:
    Code review ACK fa6f29de516c7af5206b91b59ada466032329250.

Tree-SHA512: e31f7f21fe55ac069e755557bdbcae8d5d29e20ff82e441ebdfc65153e3a31a4edd46ad3e6dea5190ecbd1b8ea5a8f94daa5d59a3b7558e46e794e30db0e6c79
2024-12-06 17:48:07 +05:30
pasta
65800cbeb9
Merge #6436: refactor: Introduce LogAcceptDebug() which is LogAcceptCategory() with Debug level
dfe86b4fb2 fix: follow-up fixes (UdjinM6)
a254a7b70c refactor: sping LogAcceptCategory and LogAcceptDebug (Konstantin Akimov)
82238e6be2 refactor: Set log level in `LogAcceptCategory()` to `Debug` by default (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  #6399 introduced severity-based logging via b046e091c9. We use `LogAcceptCategory()` in quite a few places and it's always `BCLog::Level::Debug` so  log level is kind of redundant for us and just makes it harder to read the code.

  ## What was done?
  ~Set log level in `LogAcceptCategory()` to `BCLog::Level::Debug` by default~. Introduce `LogAcceptDebug()` which is `LogAcceptCategory()` with `Debug` level. Simplify corresponding Dash-specific code.

  ## How Has This Been Tested?

  ## Breaking Changes
  n/a

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

ACKs for top commit:
  kwvg:
    utACK dfe86b4fb2

Tree-SHA512: 167da533af088c4a3bfca22abd223a2314848ec79af10f117368f6d94a4a7faa3b009477a7af455ff890f8001622494c1e3a05112f9a7204321cc237278bf387
2024-12-05 20:31:49 -06:00
pasta
758cd646a1
Merge #6452: fix: store ready queues on the mixing masternode
24dcce979b fix: store ready queues on the mixing masternode (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  We normally do not re-relay/store "ready" `dsq`-s because these are ment to be relayed between mixing clients and the mixing masternode only. I works ok when you simply send `dsq` messages because no extra steps are required. However since 70235 we send `dsq` _`inv`-s_ first and we send actual `dsq`-s only if they are requested via `getdata`. The problem here is that `ProcessGetData()` queries `vecCoinJoinQueue` via `GetQueueFromHash()` to get the data to send back but there is none because we never saved it.

  ## What was done?

  ## How Has This Been Tested?
  To test this patch you need a MN but you can test 2 cases _without this patch_ to indirectly test the idea:
  1. try mixing on develop: almost no mixing txes, maybe 10 or so in an hour if you are lucky to mix on an old MN that often
  2. ignore old MNs (`MIN_PEER_PROTO_VERSION = 70235`): 0 mixing txes, no matter how long you wait
  3. pretend being an old client to receive no-inv `dsq` only (`PROTOCOL_VERSION = 70233`): no issues, mixing on these nodes is as fast as usual, several txes per block (need a couple of nodes like that on the network so that a mixing session could be completed, I'm running one node for now so that anyone could join and test it)

  I'm running a testnet MN with this fix and applied "ignore old mn" patch on my local machine. Local wallet got mixing tx when it finally hit the patched mn. Also confirmed this via MN`debug.log` (`Create`/`Relay`/`CommitFinalTransaction` in logs).

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 24dcce979b

Tree-SHA512: 69cee5401d26eec3f66166a754b8020e7f550dac4a0fdea8ec48ea1082f1286e647ac0a26a189c4d39e1a9da4e7ac36f71913684b13ea0fb4b3cfe831174970e
2024-12-05 19:44:10 -06:00
pasta
395447bf30
Merge #6451: depends: update 'src/dashbls' to dashpay/bls-signatures@7e747e8a as 62fa6652
f25a93647b build: stop tracking cmake dependency relic_conf.h.in (Kittywhiskers Van Gogh)
62fa66524c Squashed 'src/dashbls/' changes from 4e070243ae..7e747e8a07 (Kittywhiskers Van Gogh)
b1b3840ac5 revert: stop tracking cmake dependency relic_conf.h.in (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Closes https://github.com/dashpay/dash/issues/6343
  * Includes [bls-signatures#102](https://github.com/dashpay/bls-signatures/pull/102) and [bls-signatures#104](https://github.com/dashpay/bls-signatures/pull/104)

  ## Breaking Changes

  None expected.

  ## Checklist:

  - [x] I have performed a self-review of my own code **(note: N/A)**
  - [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 f25a93647b
  UdjinM6:
    utACK f25a93647b

Tree-SHA512: 394a02a50f57538e9d12f836fd1ea1598d8a20e2d0079fcb44bb317a42a64a638a1ef906222f2d3bab06d2c0b8cfac43c6e0055d87fbdb86abe680c53ecd6b7a
2024-12-05 19:44:09 -06:00
pasta
1f58adc58d
Merge #6452: fix: store ready queues on the mixing masternode
24dcce979b fix: store ready queues on the mixing masternode (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  We normally do not re-relay/store "ready" `dsq`-s because these are ment to be relayed between mixing clients and the mixing masternode only. I works ok when you simply send `dsq` messages because no extra steps are required. However since 70235 we send `dsq` _`inv`-s_ first and we send actual `dsq`-s only if they are requested via `getdata`. The problem here is that `ProcessGetData()` queries `vecCoinJoinQueue` via `GetQueueFromHash()` to get the data to send back but there is none because we never saved it.

  ## What was done?

  ## How Has This Been Tested?
  To test this patch you need a MN but you can test 2 cases _without this patch_ to indirectly test the idea:
  1. try mixing on develop: almost no mixing txes, maybe 10 or so in an hour if you are lucky to mix on an old MN that often
  2. ignore old MNs (`MIN_PEER_PROTO_VERSION = 70235`): 0 mixing txes, no matter how long you wait
  3. pretend being an old client to receive no-inv `dsq` only (`PROTOCOL_VERSION = 70233`): no issues, mixing on these nodes is as fast as usual, several txes per block (need a couple of nodes like that on the network so that a mixing session could be completed, I'm running one node for now so that anyone could join and test it)

  I'm running a testnet MN with this fix and applied "ignore old mn" patch on my local machine. Local wallet got mixing tx when it finally hit the patched mn. Also confirmed this via MN`debug.log` (`Create`/`Relay`/`CommitFinalTransaction` in logs).

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 24dcce979b

Tree-SHA512: 69cee5401d26eec3f66166a754b8020e7f550dac4a0fdea8ec48ea1082f1286e647ac0a26a189c4d39e1a9da4e7ac36f71913684b13ea0fb4b3cfe831174970e
2024-12-05 19:40:47 -06:00
Kittywhiskers Van Gogh
7d26061170
refactor: move CConnman, PeerManager out of CCoinJoinClientQueueManager ctor 2024-12-05 22:42:16 +00:00
Kittywhiskers Van Gogh
953ba96ac9
refactor: move CConnman out of CoinJoinWalletManager ctor 2024-12-05 22:42:16 +00:00
Kittywhiskers Van Gogh
ac930a84d8
refactor: remove unused CConnman from CDeterministicMNManager ctor 2024-12-05 22:42:15 +00:00
Kittywhiskers Van Gogh
a14e604064
refactor: remove CConnman, PeerManager from LLMQContext ctor 2024-12-05 22:42:15 +00:00
Kittywhiskers Van Gogh
d9e5cc7c9a
refactor: move PeerManager out of CInstantSendManager ctor 2024-12-05 22:42:15 +00:00
Kittywhiskers Van Gogh
82d1aed1d6
refactor: move CConnman, PeerManager out of CSigSharesManager ctor
Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
2024-12-05 22:42:14 +00:00
Kittywhiskers Van Gogh
7498a38076
refactor: move PeerManager out of CSigningManager ctor 2024-12-05 22:37:49 +00:00
Kittywhiskers Van Gogh
7ebc61e375
refactor: move CConnman out of CQuorumManager ctor 2024-12-05 22:37:49 +00:00
Kittywhiskers Van Gogh
c07b522baa
refactor: move CConnman out of CDKGSession{,Handler,Manager} ctor 2024-12-05 22:37:49 +00:00
Kittywhiskers Van Gogh
01876c7e56
refactor: move PeerManager out of CDKGSession{,Handler,Manager} ctor 2024-12-05 22:37:49 +00:00
Kittywhiskers Van Gogh
cc0e771c29
refactor: start BLS thread in LLMQContext ctor, move Start downwards
Alternate fix as proposed in dash#5752, needed because dependencies for
threaded logic will be pulled out of ctor in upcoming commits and that
needs `Start` to be pushed downwards so we can avoid having to pass
`unique_ptr` references.
2024-12-05 22:37:49 +00:00
UdjinM6
24dcce979b
fix: store ready queues on the mixing masternode 2024-12-05 17:36:17 +03:00
Konstantin Akimov
efd4701d30
fix: intermittent error for feature_llmq_simplepose due to rotating quorums 2024-12-05 17:10:32 +07:00
Konstantin Akimov
2bafadfc34
feat: put DIP0024 activation to block 1 on RegTest 2024-12-05 17:10:32 +07:00
Konstantin Akimov
632c4c4bcd
feat: re-bury DIP0024 with new height when quorums actually appeared
For current implementation it is not important when exactly fork happened
yet important to know when first rotating quorum formed
2024-12-05 17:10:32 +07:00
Konstantin Akimov
343c74b779
fix: intermittent error in feature_index_prune due to DKG influence 2024-12-05 17:10:32 +07:00
Konstantin Akimov
de821b9b15
refactor: remove command line argument -bip147height, -dip8params
bip147height is superseeded by -testactivationheight=bip147@height
dip8params is superseeded by -testactivationheight=dip0008@height
2024-12-05 17:10:32 +07:00
Konstantin Akimov
d8ce0a74fa
docs: updated comment for DIP0003 activation on RegTest 2024-12-05 17:10:31 +07:00
Konstantin Akimov
4dafec870c
fix: add check that DIP0003 activated before retrieving CbTx for CreditPool 2024-12-05 17:10:31 +07:00
Konstantin Akimov
26e9813672
fix: assertion in Credit Pool validation during connecting blocks
It can happen because now order of activation of hardforks v20, mn_rr, dip3
can be changed by using testactivationheight on Regtest and no more
guarantee about this assertions
2024-12-05 17:10:27 +07:00
MarcoFalke
11eeae2ab9
Merge bitcoin/bitcoin#24219: Fix implicit-integer-sign-change in bloom
fad84a25956ec081f22aebbda309d168a3dc0004 refactor: Fixup uint64_t-cast style in touched line (MarcoFalke)
fa041878de786f5be74ec74a06ec407c99ca8656 Fix implicit-integer-sign-change in bloom (MarcoFalke)

Pull request description:

  Signed values don't really make sense when using `std::vector::operator[]`.

  Fix that and remove the suppression.

ACKs for top commit:
  PastaPastaPasta:
    utACK fad84a25956ec081f22aebbda309d168a3dc0004
  theStack:
    Code-review ACK fad84a25956ec081f22aebbda309d168a3dc0004

Tree-SHA512: 7139dd9aa098c41e4af1b6e63dd80e71a92b0a98062d1676b01fe550ffa8e21a5f84a578afa7a536d70dad1b8a5017625e3a9e2dda6f864b452ec77b130ddf2a
2024-12-05 08:43:28 +05:30
Hennadii Stepanov
f16265dd50
Merge bitcoin-core/gui#517: refactor, qt: Use std::chrono for parameters of QTimer methods
51250b0906e56b39488304208ad119c951b4ae7d refactor, qt: Use std::chrono for input_filter_delay constant (Hennadii Stepanov)
f3bdc143b67e8a5e763071a0774f6d994ca35c57 refactor, qt: Add SHUTDOWN_POLLING_DELAY constant (Hennadii Stepanov)
0e193deb523a4fa04e0ee69bd66f917895802ac9 refactor, qt: Use std::chrono for non-zero arguments in QTimer methods (Hennadii Stepanov)
6f0da958116ecc0e06332fad2f490e37b6884166 refactor, qt: Use std::chrono in ConfirmMessage parameter (Hennadii Stepanov)
33d520ac538fcd6285fd958578f1bd26295592e4 refactor, qt: Use std::chrono for MODEL_UPDATE_DELAY constant (Hennadii Stepanov)

Pull request description:

  Since Qt 5.8 `QTimer` methods have overloads that accept `std::chrono::milliseconds` arguments:
  - [`QTimer::singleShot`](https://doc.qt.io/archives/qt-5.9/qtimer.html#singleShot-8)
  - [`QTimer::start`](https://doc.qt.io/archives/qt-5.9/qtimer.html#start-2)

ACKs for top commit:
  promag:
    Code review ACK 51250b0906e56b39488304208ad119c951b4ae7d.
  shaavan:
    reACK 51250b0906e56b39488304208ad119c951b4ae7d

Tree-SHA512: aa843bb2322a84c0c2bb113d3b48d7bf02d7f09a770779dcde312c32887f973ef9445cdef42f39edaa599ff0f3d0457454f6153aa130efadd989e413d39c6062
2024-12-05 08:43:28 +05:30
laanwj
b212ca0515
Merge bitcoin/bitcoin#24365: wallet: Don't generate keys for wallets with private keys disabled during upgradewallet
c7376cc8d728f3a7c40f79bd57e7cef685def723 tests: Test upgrading wallet with privkeys disabled (Andrew Chow)
3d985d4f43b5344f998bcf6db22d02782e647a2a wallet: Don't generate keys when privkeys disabled when upgrading (Andrew Chow)

Pull request description:

  When we're upgrading a wallet, we shouldn't be trying to generate new keys for wallets where private keys are disabled.

  Fixes #23610

ACKs for top commit:
  laanwj:
    Code review ACK c7376cc8d728f3a7c40f79bd57e7cef685def723
  benthecarman:
    tACK c7376cc8d728f3a7c40f79bd57e7cef685def723 this fixed the issue for me

Tree-SHA512: fa07cf37df9196ff98671bb1ce5c9aa0bab46495066b4dab796d7e8e5d5c7adb414ff56adae4fd3e15658a610995bd19a9e1edb00c46144b0df635c5b343f3a6
2024-12-05 08:43:28 +05:30
MarcoFalke
66e77f7879
Merge bitcoin/bitcoin#23316: test: make the node param explicit in init_wallet()
7b3c9e4ee8feb552dc0fc4347db2d06e60894a9f Make explicit the node param in init_wallet() (lsilva01)

Pull request description:

  This PR changes the definition of `def init_wallet(self, i)` to `def init_wallet(self, *, node)` to make the node parameter explicit, as suggested in https://github.com/bitcoin/bitcoin/pull/22794#discussion_r713287448 .

ACKs for top commit:
  stratospher:
    tested ACK 7b3c9e4.

Tree-SHA512: 2ef036f4c2110b2f7dc893dc6eea8faa0a18edd7f8f59b25460a6c544df7238175ddd6a0d766e2bb206326b1c9afc84238c75613a0f01eeda89a8ccb7d86a4f1
2024-12-05 08:43:28 +05:30
MarcoFalke
995cae46af
Merge bitcoin/bitcoin#22794: test: Verify if wallet is compiled in rpc_invalid_address_message.py test
c2fbdca54915e85ffafe1a88858d3c70c2b1afe8 Add BECH32_INVALID_VERSION test (lsilva01)
b142f79ddb91a44f29fcb2afb7f2edf3ca17e168 skip test_getaddressinfo() if wallet is disabled (lsilva01)

Pull request description:

  Most of  `test/functional/rpc_invalid_address_message.py` does not requires wallet.
  But if the project is compiled in disable-wallet mode, the entire test will be skipped.

  This PR changes the test to run the RPC tests first and then checks if the wallet is compiled.

ACKs for top commit:
  stratospher:
    tested ACK c2fbdca

Tree-SHA512: 11fa2fedf4a15aa45e3f12490df8e22290a867d5de594247211499533c32289c68c0b60bd42dbf8305e43dbcc042789e7139317ef5c9f8cf386f2d84c91b9ac2
2024-12-05 08:43:28 +05:30
MarcoFalke
61a0140362
Merge bitcoin/bitcoin#23642: refactor: Call type-solver earlier in decodescript
33330702081f67cb05fd86e00b252f6355249513 refactor: Call type-solver earlier in decodescript (MarcoFalke)
fab0d998f4bf0f3f09afa51845d91408dd484408 style: Remove whitespace (MarcoFalke)

Pull request description:

  The current logic is a bit confusing. First creating the `UniValue` return dict, then parsing it again to get the type as `std::string`.

  Clean this up by using a strong type `TxoutType`. Also, remove whitespace.

ACKs for top commit:
  shaavan:
    ACK 33330702081f67cb05fd86e00b252f6355249513
  theStack:
    Code-review ACK 33330702081f67cb05fd86e00b252f6355249513

Tree-SHA512: 49db7bc614d2491cd3ec0177d21ad1e9924dbece1eb5635290cd7fd18cb30adf4711b891daf522e7c4f6baab3033b66393bbfcd1d4726f24f90a433124f925d6
2024-12-05 08:43:28 +05:30
UdjinM6
dfe86b4fb2
fix: follow-up fixes 2024-12-04 21:28:03 +03:00
Konstantin Akimov
a254a7b70c
refactor: sping LogAcceptCategory and LogAcceptDebug 2024-12-04 21:28:01 +03:00
UdjinM6
82238e6be2
refactor: Set log level in LogAcceptCategory() to Debug by default 2024-12-04 21:27:35 +03:00
Konstantin Akimov
dd1b36636c
feat: show human friendly error if missing spentindex, txindex or addressindex
It also fixes spam messages about missing txindex for each RPC call getrawtransaction

    node0 2024-12-03T18:54:33.349605Z [      http] [httpserver.cpp:248] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:40052
    node0 2024-12-03T18:54:33.349634Z [httpworker.3] [rpc/request.cpp:180] [parse] [rpc] ThreadRPCServer method=getrawtransaction user=__cookie__
    node0 2024-12-03T18:54:33.349729Z [httpworker.3] [util/system.h:57] [error] ERROR: Spent index not enabled
    node0 2024-12-03T18:54:33.349735Z [httpworker.3] [util/system.h:57] [error] ERROR: Spent index not enabled
    node0 2024-12-03T18:54:33.349738Z [httpworker.3] [util/system.h:57] [error] ERROR: Spent index not enabled
    node0 2024-12-03T18:54:33.349808Z [httpworker.3] [httprpc.cpp:93] [~RpcHttpRequest] [bench] HTTP RPC request handled: user=__cookie__ command=getrawtransaction external=false status=200 elapsed_time_ms=0
    node0 2024-12-03T18:54:33.349998Z [      http] [httpserver.cpp:248] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:40052
    node0 2024-12-03T18:54:33.350027Z [httpworker.0] [rpc/request.cpp:180] [parse] [rpc] ThreadRPCServer method=getrawtransaction user=__cookie__
    node0 2024-12-03T18:54:33.350128Z [httpworker.0] [util/system.h:57] [error] ERROR: Spent index not enabled
    node0 2024-12-03T18:54:33.350133Z [httpworker.0] [util/system.h:57] [error] ERROR: Spent index not enabled
    node0 2024-12-03T18:54:33.350137Z [httpworker.0] [util/system.h:57] [error] ERROR: Spent index not enabled
2024-12-04 02:00:59 +07:00
pasta
e0151e3dfe
Merge #6447: [v22.0.x] backport: v22.0.0 rc.3
c7b0d80939 Merge #6441: fix: hold wallet shared pointer in CJ Manager/Sessions to prevent concurrent unload (pasta)
c074e0965b Merge #6444: fix: add platform transfer to "most common" filter (pasta)
cb04114143 Merge #6442: fix: coin selection with `include_unsafe` option should respect `nCoinType` (pasta)
db5b53a9a7 Merge #6434: fix: early EHF and buried EHF are indistinguish (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  See commits; backports for rc.3

  ## What was done?

  ## How Has This Been Tested?
  built locally

  ## Breaking Changes

  ## 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:
  kwvg:
    ACK c7b0d80939
  UdjinM6:
    utACK c7b0d80939

Tree-SHA512: a64d6503a845ea86df8660d34cdf819c6fefcae5e82035bd8de40152f4f7d894cd1870315b791cca81e6d4db08d9929e4d1de3338a0338478072c9e6bb66952a
2024-12-03 12:57:42 -06:00
Konstantin Akimov
43778b07f5
refactor: pass CWallet reference to CTransactionBuilder 2024-12-04 01:00:11 +07:00
pasta
c7b0d80939
Merge #6441: fix: hold wallet shared pointer in CJ Manager/Sessions to prevent concurrent unload
2d7c7f81b8 fix: do not transfer wallet ownership to CTransactionBuilder{Output} (UdjinM6)
0aeeb8583a fix: add missing `AddWallet` call in `TestLoadWallet` (UdjinM6)
e800d9d09c fix: hold wallet shared pointer in CJ Manager/Sessions to prevent concurrent unload (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  https://github.com/dashpay/dash/pull/6440#discussion_r1865042366

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK 2d7c7f81b8

Tree-SHA512: 308e3bed077baa2167b7f9d81b87e5a61a113e4d465706548f303dfc499bc072d4e823e85772e591a879986b0fb0413d5afe0e3995e1f939fa772b29adc0300d
2024-12-03 08:45:43 -06:00
pasta
c074e0965b
Merge #6444: fix: add platform transfer to "most common" filter
36893e4ba4 fix: add platform transfer to "most common" filter on transactions tab (Konstantin Akimov)
d033a3ae06 refactor: change mask from Dec presentation to Hex for transaction filter (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  Follow-up https://github.com/dashpay/dash/pull/6131 - missing 'Platform Transfer' in the list of most common. Reported by splawik.

  ## What was done?
  Updated filter, added comment to prevent similar mistakes in future, present filter in hex for better readability.

  ## How Has This Been Tested?
  Transaction with platform transfer appeared in filter "Most Common"
  ![image](https://github.com/user-attachments/assets/ccc17553-d71a-45f8-be2f-8ce5fb699c1a)
  Also they are added to Overview page (compare screenshots by 'address' field)
  ![image](https://github.com/user-attachments/assets/ea657672-46c8-4a66-a972-15768feb4d57)

  ## 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 36893e4ba4
  PastaPastaPasta:
    utACK 36893e4ba4

Tree-SHA512: e072b78e257b2c262a912a3cc0daebde93aca655edfee9bbf4869f2528f10377d7d234c73c4fd7ab6006e87607d5a7c4eddd7634d55b16d1b3885d0bc48f225a
2024-12-03 08:38:18 -06:00
pasta
cb04114143
Merge #6442: fix: coin selection with include_unsafe option should respect nCoinType
e5114da325 fix: coin selection with `include_unsafe` option should respect `nCoinType` (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  The issue was introduced in #6074 via 69c5aa8947

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

ACKs for top commit:
  PastaPastaPasta:
    utACK e5114da325
  kwvg:
    utACK e5114da325

Tree-SHA512: 5d4e22f9d2cecf2239185e0f4c9d8b29b995b25b4f53a74d6c9b7929aac6ec918ebfb4029a83b72a003fe42fe82619f7ab4892d620bf5846cadf99f1f0cb0969
2024-12-03 08:38:08 -06:00
pasta
db5b53a9a7
Merge #6434: fix: early EHF and buried EHF are indistinguish
4629bb9ba5 fix: add missing cs_main annotation for ForceSignalDBUpdate (Konstantin Akimov)
05041a4572 fix: force ehf signal db update (UdjinM6)
94d80323d4 fix: typo name of key (Konstantin Akimov)
9ceba88cdb style: clang suggestion (Konstantin Akimov)
c6bb9a5685 perf: re-use evo data about signals between v20 and mn_rr as non-corrupted (Konstantin Akimov)
7a7c9f12a4 fix: early EHF and buried EHF are indistinguish (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  It seems as EHF signal will be mined before node is updated, this signal is lost and node can't activate hard-fork anymore.

  ## What was done?
  EHF signals doesn't expire anymore.
  To avoid full re-index key in database is changed.
  Client with enabled "pruned mode" will be required to do re-index.

  Alternate solution - revert this commit 4b046bb608 and introduce time-out for expiring EHF signals.

  ## How Has This Been Tested?
  Test on my local instance with testnet and mainnet.

  Testing on miner-1 on testnet is done.
  First start of miner took 50 seconds, 29 of them the node was re-scanning blockchain and looking for EHF transaction

  ## Breaking Changes
  It requires re-index for nodes with enabled pruning of blocks.

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

ACKs for top commit:
  PastaPastaPasta:
    utACK [4629bb9](4629bb9ba5)
  UdjinM6:
    utACK 4629bb9ba5

Tree-SHA512: 189533da5726edbcf2d9cf0e9a3957a10ebc223c25fd88aec3aa9095ae2e7d955ea1f7a1384bc2c97a0cc06110c9e38845a8cafdbd56ff9637bb907ddc639850
2024-12-03 08:37:57 -06:00
UdjinM6
f3be9bcb95
test: add tests for listunspent with coinType option 2024-12-03 15:59:35 +03:00
pasta
a6ee72576f
Merge #6432: [v22.0.x] backport: release v22.0.0-rc2
8b88ff7ed6 Merge #6414: chore: bump seeds for v22 (pasta)
02ad523a22 Merge #6411: chore: update nMinimumChainWork, defaultAssumeValid, checkpointData, chainTxData for mainnet and testnet (pasta)
3bbcd3d4f8 Merge #6393: docs: mention building for some HOSTs only in `release-process.md` (pasta)
18f636f9a4 Merge #6426: fix: respect SENDDSQUEUE message, move DSQ relay into net processing / peerman (pasta)
9fed4564f4 Merge #6407: fix: dataraces (pasta)
86105daab3 Merge #6408: refactor: removed pre-MN_RR logic of validation of CL (pasta)
a1f7e96025 Merge #6406: ci: use `actions/cache` to manage depends cache (pasta)
90a3807903 Merge #6402: ci: cache built (pasta)
66f67879dc Merge #6401: ci: deduplicate depends building (pasta)
7ca56632cf Merge #6397: ci: add powerpc64 to GH Guix job matrix (pasta)

Pull request description:

  ## What was done?
  See commits for each particular change

  ## How Has This Been Tested?
  To be deployed on testnet

  ## Breaking Changes
  N/A

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

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

Tree-SHA512: f7fac62996873503e7de875cc96d9cdf5675674345f1bb1df4a16bf19bddc17bc395a80cc761363a0121022d42c46fb313b0973b9cc71f568ef55c6b3d9e29d8
2024-11-26 12:41:59 -06:00
pasta
8b88ff7ed6
Merge #6414: chore: bump seeds for v22
5741d5da28 chore: update seeds (Kittywhiskers Van Gogh)
2d732fc66e chore: drop defunct onion seeds, add new existing onion hosts as seeds (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Update onion seeds for upcoming version

  ## What was done?
  Update onion seeds to reflect latest status

  ## How Has This Been Tested?
  As of today, all of these are able to be connected to on port 9999; I've not actually connected to all of them and verified they're on latest core or something like that; but their addresses my core knows about, and are able to be trivially connected to

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

ACKs for top commit:
  kwvg:
    utACK 5741d5da28
  UdjinM6:
    utACK 5741d5da28

Tree-SHA512: 541bcc510b2ebf6de08ac91f2b7e5b1c910536dca9bab0b38930d6e5cfa1cd05e8c014ba4c74c14c43ed211cda3275fffb5baaf1489bbd1221567130d804b0ec
2024-11-26 23:13:07 +07:00
pasta
02ad523a22
Merge #6411: chore: update nMinimumChainWork, defaultAssumeValid, checkpointData, chainTxData for mainnet and testnet
31243ca313 chore: update nMinimumChainWork, defaultAssumeValid, checkpointData, chainTxData for mainnet and testnet (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Bump chainparams in prep for v22

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

Tree-SHA512: 6a01bbbaefb69437e053340b968e0ce68e2bd9e5e5fd2900864d88ffc21c5cd3f9c2a50d8f5b19f16515cd4c62a4a8fc2d981dd6d0456e86ef96f40e350e786a
2024-11-26 23:12:36 +07:00
pasta
3bbcd3d4f8
Merge #6393: docs: mention building for some HOSTs only in release-process.md
87c31ad67a Update doc/release-process.md (UdjinM6)
55d74630b4 docs: mention building for some HOSTs only in `release-process.md` (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  https://github.com/dashpay/guix.sigs/pull/73

  #6390 follow-up

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

Top commit has no ACKs.

Tree-SHA512: b4a2cadf5899a8aea6612b4ff9c0e9f9c530a9e2344eb090967fbcf9a2ab219aff02f11f86434e4082f84c401d578cf2d033b6838c94705f532beca4ab604986
2024-11-26 23:12:36 +07:00
pasta
18f636f9a4
Merge #6426: fix: respect SENDDSQUEUE message, move DSQ relay into net processing / peerman
dafa7363a3 fix: respect SENDDSQUEUE message, move DSQ relay into net processing / peerman (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  in #6148, I broke the functionality where a peer must opt in / opt out of DSQUEUE messages. This was mostly ok, and not immediately detected, as with this bug, simply everyone would receive DSQ messages over inventory (or classically, old proto versions were not affected by this bug). But this still would result in quite a bit of wasted bandwidth for peers which may not care about DSQ at all.

  ## What was done?
  This commit should restore the prior functionality, where a node should send the SENDDSQUEUE message if they wish to receive DSQs. Once they've sent that, depending on their protocol version, they will either have the messages pushed to them as available, or on modern protocols, they will thereafter receive DSQs over the inventory system.

  NOTE: I also refactor the code in this commit, moving some network proccessing into.... wait for it... net_processing.cpp! This allowed us to remove some dependencies in coinjoin.h. DSQ messages are now relayed to peers by calling peer_manager.RelayDSQ

  ## How Has This Been Tested?
  I have not yet mixed on testnet with this; we should include it in rc.2 and test

  ## Breaking Changes
  Slightly breaking for v22.0.x (so rc.1), as they in theory could be relying on this new logic of always receiving the DSQ inv. But I don't think anyone besides core is using this new protocol.

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

ACKs for top commit:
  UdjinM6:
    light ACK dafa7363a3
  kwvg:
    utACK dafa7363a3

Tree-SHA512: 18f9b0dfe05cde19db451653db9bb9a00352efd1bc37adffd83f74958010475f2782b1111b1c0d2dd967e7a851c3c4795fa55033b4bd0cc810aa293e754ce314
2024-11-26 23:12:36 +07:00
pasta
9fed4564f4
Merge #6407: fix: dataraces
5078baea2b fix(test): wait for chainlock before mining a block we expect to include said chainlock (pasta)
f39c1e6f4c fix: guard m_can_tx_relay behind m_tx_relay_mutex; make it private; add additional annotations (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  See each commit; fixes two bugs, both discovered while running feature_llmq_chainlocks.py with tsan / debug.

  one a datarace in net_processing.cpp and the other in the test I was using to ensure this fix was correct, feature_llmq_chainlocks

  ## What was done?
  ### net_processing.cpp
  You can see the datarace here: https://gist.github.com/PastaPastaPasta/c966a9f805758b34524085e3d52ea7f8

  We simply guard it with an existing mutex that is always locked in close proximity.

  ### feature_llmq_chainlocks.py
  Most of the time, while generating the cycle quorum, there is sufficient time to generate a chainlock; however, this is racey, and I've observed locally where the block gets generated before a chainlock is present and as such `test_coinbase_best_cl` fails. We should instead wait for the chainlock first, and then mine the block. This was we can ensure the mined block will include that chainlock.

  This was observed locally maybe 1/10 times or so

  ## How Has This Been Tested?
  ran feature_llmq_chainlocks.py ~40 times locally with tsan / debug

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

ACKs for top commit:
  kwvg:
    utACK 5078baea2b
  knst:
    utACK 5078baea2b
  UdjinM6:
    utACK 5078baea2b

Tree-SHA512: b346fc60809df72d0161f625073dce7062bd2641d35e4f80160fac9afeec63707de552e2856940ac2604875908ae3b98a225d352de36bfbfc6ee3fbe1e1538ff
2024-11-26 23:12:36 +07:00
pasta
86105daab3
Merge #6408: refactor: removed pre-MN_RR logic of validation of CL
3f2e064b18 refactor: set `const auto& cbTx` to avoid using optional throughout method (pasta)
0c0d91e491 fix: functional test feature_llmq_chainlocks.py should activate MN_RR instead v20 (Konstantin Akimov)
af93e877f2 refactor: removed pre-MN_RR logic of validation of CL (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  The fork MN_RR is active awhile on testnet and mainnet and no more need legacy check

  ## What was done?
  Removes legacy version of checks for CL and related functional tests

  ## How Has This Been Tested?
  Run unit / functional test - DONE
  Reindex testnet - DONE
  Reindex mainnet - DONE

  ## Breaking Changes
  Removed pre-mn_rr version of checks for CL.
  It's no more relevant on mainnet and testnet.
  It affects behavior on new devnets and regtest for pre-mn_rr activation blocks.

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

ACKs for top commit:
  UdjinM6:
    utACK 3f2e064b18

Tree-SHA512: 8b4b3a20a54602f4df9d98e17c79004214493b15c0bce9c08c68d667a5cba86b817947f008d646c48ef9f2f86676c02085c7d0ed36e83548ef5425b64faffb89
2024-11-26 23:12:36 +07:00
pasta
a1f7e96025
Merge #6406: ci: use actions/cache to manage depends cache
9cc29a832e ci: use `actions/cache` to manage depends cache (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Builds after [dash#6401](https://github.com/dashpay/dash/pull/6401) have silently stopped building Dash Qt, see pre-[dash#6401](https://github.com/dashpay/dash/pull/6401) `develop` (6a51ab27)'s [build](https://github.com/dashpay/dash/actions/runs/11881892222/job/33106960691#step:7:725) compared against [build \#1](https://github.com/PastaPastaPasta/dash/actions/runs/11897504945/job/33152711720#step:7:1432) and [build \#2](https://github.com/kwvg/dash/actions/runs/11898510091/job/33156186503#step:7:1432) from [dash#6401](https://github.com/dashpay/dash/pull/6401)'s review process.

    This pull request aims to correct that regression.

  ## 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 9cc29a832e
  UdjinM6:
    utACK 9cc29a832e

Tree-SHA512: 09663987696d29e12c98b48297960c7c1e6484e337ddc8311f340fee1d026ace572674e8cbca578ba743ff781caabb6fcc1853cee8ddff3e13af3fe3d0361776
2024-11-26 23:12:36 +07:00
pasta
90a3807903
Merge #6402: ci: cache built
9604d87af1 ci: cache depends/built like gitlab (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Depends build didn't seem to be caching properly

  ## What was done?
  changed depends/${{ matrix.host }} to depends/built as gitlab does

  ## How Has This Been Tested?
  Depends "build" now takes only ~1 minute instead of ~15 minutes in CI: https://github.com/PastaPastaPasta/dash/actions/runs/11899038167

  ## Breaking Changes
  None

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

ACKs for top commit:
  UdjinM6:
    utACK 9604d87af1
  kwvg:
    utACK 9604d87af1

Tree-SHA512: 63d2321f41b284be6cc2f0b2d53294cf220b1623af464d411225c0e43ec14268e1c3a701e23973e5c641925b6ea28dcb92062d8cefb9e6baed6ac5bb619ce1a1
2024-11-26 23:12:36 +07:00
pasta
66f67879dc
Merge #6401: ci: deduplicate depends building
2f18c1af30 ci: deduplicate depends building (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Currently we build the same host / options multiple times. Don't do this!

  ## What was done?
  Now building depends only twice

  ## How Has This Been Tested?
  Local CI appears to be working

  ## 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:
  kwvg:
    utACK 2f18c1af30
  UdjinM6:
    utACK 2f18c1af30

Tree-SHA512: 67460508a2e9458152f7c8bb5f4a1a786aedcfded0e5c54fb03d85010ba8bb87362b66a0c322b51aeba75752e36418fc235d8dc4197ef10695e234ccc5a00a39
2024-11-26 23:12:36 +07:00
pasta
7ca56632cf
Merge #6397: ci: add powerpc64 to GH Guix job matrix
c5d5b14205 ci: add powerpc64 to GH Guix job matrix (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  I guess we should make sure that binaries for every possible platform can be built via Guix with no issues even if we do not want to provide "official" binaries for it.

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

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

Top commit has no ACKs.

Tree-SHA512: 6464b68a47e680bb379c82842599200d6917adb8f1493fa75ac80ddc7a6fea92a9190215cfa3f32b0bd88e2dd0425d4eb13846ea2d7e19e144afff9c1171ff13
2024-11-26 23:12:36 +07:00
265 changed files with 9894 additions and 7285 deletions

View File

@ -114,22 +114,22 @@ jobs:
- build_target: linux64
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_tsan
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_ubsan
- build_target: linux64_cxx20
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_fuzz
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_cxx20
- build_target: linux64_nowallet
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_sqlite
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_nowallet
- build_target: linux64_tsan
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_ubsan
host: x86_64-pc-linux-gnu
depends_on: linux64
container:

View File

@ -25,16 +25,20 @@ jobs:
- name: Check merge --ff-only
run: |
git fetch origin master:master
if [[ "${{ github.event_name }}" == "pull_request"* ]]; then
git fetch origin ${{ github.event.pull_request.base.ref }}:base_branch
git checkout base_branch
git pull --rebase=false origin pull/${{ github.event.pull_request.number }}/head
git checkout master
git merge --ff-only base_branch
if [[ "${{ github.ref_name }}" == "master" ]]; then
echo "Already on master, no need to check --ff-only"
else
git checkout master
git merge --ff-only ${{ github.sha }}
git fetch origin master:master
if [[ "${{ github.event_name }}" == "pull_request"* ]]; then
git fetch origin ${{ github.event.pull_request.base.ref }}:base_branch
git checkout base_branch
git pull --rebase=false origin pull/${{ github.event.pull_request.number }}/head
git checkout master
git merge --ff-only base_branch
else
git checkout master
git merge --ff-only ${{ github.sha }}
fi
fi
- name: add labels

View File

@ -40,26 +40,11 @@ builder-image:
needs:
- builder-image
image: $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
variables:
SDK_URL: https://bitcoincore.org/depends-sources/sdks
XCODE_VERSION: "15.0"
XCODE_BUILD_ID: 15A240d
before_script:
- echo HOST=$HOST
- |
if [ "$HOST" = "x86_64-apple-darwin" ]; then
mkdir -p depends/SDKs
mkdir -p depends/sdk-sources
OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz"
OSX_SDK_PATH="depends/sdk-sources/${OSX_SDK_BASENAME}"
if [ ! -f "$OSX_SDK_PATH" ]; then
echo "Downloading MacOS SDK"
curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH"
fi
if [ -f "$OSX_SDK_PATH" ]; then
echo "Extracting MacOS SDK"
tar -C depends/SDKs -xf "$OSX_SDK_PATH"
fi
echo HOST=${HOST}
if [[ "${HOST}" == "x86_64-apple-darwin" ]]; then
./contrib/containers/guix/scripts/setup-sdk
fi
script:
- make -j$(nproc) -C depends HOST=$HOST $DEP_OPTS
@ -73,7 +58,7 @@ builder-image:
- depends/built
- depends/sdk-sources
artifacts:
name: depends
name: depends-${CI_JOB_NAME}
when: on_success
paths:
- depends/$HOST
@ -95,14 +80,16 @@ builder-image:
else
# CI_EXTERNAL_PULL_REQUEST_IID is false every time until https://gitlab.com/gitlab-org/gitlab/issues/5667 is done
# Until then, we're using https://github.com/brndnmtthws/labhub atm to mirror Github pull requests as branches into Gitlab,
# which allows us to use Gitlab CI for Github. The following check detects such mirrored branches.
if [[ $CI_COMMIT_REF_NAME =~ ^pr-[^/]*/[^/]*/[^/]*/[^/]*$ ]]; then
# which allows us to use Gitlab CI for Github.
if [[ $CI_COMMIT_REF_NAME = "master" ]] || [[ $CI_COMMIT_REF_NAME = "develop" ]] || [[ $CI_COMMIT_REF_NAME =~ ^v([0-9]{1,2}\.)*x$ ]]; then
# These names are reserved for protected branches
export PULL_REQUEST="false"
else
# Everything else including experemental "feat/smth" branches must be merged via PRs, treat them as such
export PULL_REQUEST="true"
# CI_COMMIT_BEFORE_SHA is also invalid until #5667 is implemented, so we need to figure it out by ourself
git fetch origin develop
export CI_COMMIT_BEFORE_SHA="$(git merge-base origin/develop HEAD)"
else
export PULL_REQUEST="false"
fi
fi
- export COMMIT_RANGE="$CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA"
@ -128,12 +115,14 @@ builder-image:
paths:
- cache/ccache
artifacts:
name: binaries
name: build-${BUILD_TARGET}
when: always
paths:
- build-ci
# Exclude some less important binaries to reduce the size of the artifacts
exclude:
- build-ci/dashcore-$BUILD_TARGET/src/**/*.a
- build-ci/dashcore-$BUILD_TARGET/src/**/*.o
- build-ci/dashcore-$BUILD_TARGET/src/bench/bench_dash
- build-ci/dashcore-$BUILD_TARGET/src/bench/bench_dash.exe
- build-ci/dashcore-$BUILD_TARGET/src/qt/test/test_dash-qt
@ -189,13 +178,13 @@ x86_64-w64-mingw32:
variables:
HOST: x86_64-w64-mingw32
x86_64-pc-linux-gnu-debug:
x86_64-pc-linux-gnu_debug:
extends: .build-depends-template
variables:
HOST: x86_64-pc-linux-gnu
DEP_OPTS: "DEBUG=1"
x86_64-pc-linux-gnu-nowallet:
x86_64-pc-linux-gnu_nowallet:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
@ -203,13 +192,13 @@ x86_64-pc-linux-gnu-nowallet:
HOST: x86_64-pc-linux-gnu
DEP_OPTS: "NO_WALLET=1"
x86_64-pc-linux-gnu-multiprocess:
x86_64-pc-linux-gnu_multiprocess:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: x86_64-pc-linux-gnu
DEP_OPTS: "MULTIPROCESS=1"
DEP_OPTS: "DEBUG=1 MULTIPROCESS=1"
x86_64-apple-darwin:
extends:
@ -239,7 +228,7 @@ win64-build:
linux64-build:
extends: .build-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64
@ -248,7 +237,7 @@ linux64_cxx20-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64_cxx20
@ -257,7 +246,7 @@ linux64_sqlite-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64_sqlite
@ -266,7 +255,7 @@ linux64_fuzz-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64_fuzz
@ -275,7 +264,7 @@ linux64_fuzz-build:
# - .build-template
# - .skip-in-fast-mode-template
# needs:
# - x86_64-pc-linux-gnu-debug
# - x86_64-pc-linux-gnu_debug
# variables:
# BUILD_TARGET: linux64_asan
@ -284,7 +273,7 @@ linux64_tsan-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64_tsan
@ -293,7 +282,7 @@ linux64_ubsan-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64_ubsan
@ -302,7 +291,7 @@ linux64_nowallet-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-nowallet
- x86_64-pc-linux-gnu_nowallet
variables:
BUILD_TARGET: linux64_nowallet
@ -311,7 +300,7 @@ linux64_multiprocess-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-multiprocess
- x86_64-pc-linux-gnu_multiprocess
variables:
BUILD_TARGET: linux64_multiprocess
@ -320,7 +309,7 @@ linux64_multiprocess-build:
# - .build-template
# - .skip-in-fast-mode-template
# needs:
# - x86_64-pc-linux-gnu-debug
# - x86_64-pc-linux-gnu_debug
# variables:
# BUILD_TARGET: linux64_valgrind

View File

@ -4,9 +4,8 @@
| Version | Supported |
| ------- | ------------------ |
| 21 | :white_check_mark: |
| 20.1 | :white_check_mark: |
| < 20.1 | :x: |
| 22 | :white_check_mark: |
| < 22 | :x: |
## Reporting a Vulnerability

View File

@ -116,8 +116,8 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
BITCOIN_QT_CHECK([
TEMP_CPPFLAGS=$CPPFLAGS
TEMP_CXXFLAGS=$CXXFLAGS
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
CXXFLAGS="$PIC_FLAGS $CXXFLAGS"
CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS"
CXXFLAGS="$PIC_FLAGS $CORE_CXXFLAGS $CXXFLAGS"
_BITCOIN_QT_IS_STATIC
if test "x$bitcoin_cv_static_qt" = xyes; then
_BITCOIN_QT_CHECK_STATIC_LIBS
@ -177,8 +177,8 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
AC_MSG_CHECKING(whether -fPIE can be used with this Qt config)
TEMP_CPPFLAGS=$CPPFLAGS
TEMP_CXXFLAGS=$CXXFLAGS
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
CXXFLAGS="$PIE_FLAGS $CXXFLAGS"
CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS"
CXXFLAGS="$PIE_FLAGS $CORE_CXXFLAGS $CXXFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
#ifndef QT_VERSION
@ -200,7 +200,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
BITCOIN_QT_CHECK([
AC_MSG_CHECKING(whether -fPIC is needed with this Qt config)
TEMP_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <QtCore/qconfig.h>
#ifndef QT_VERSION

View File

@ -20,17 +20,8 @@ mkdir -p $CACHE_DIR/sdk-sources
ln -s $CACHE_DIR/depends ${DEPENDS_DIR}/built
ln -s $CACHE_DIR/sdk-sources ${DEPENDS_DIR}/sdk-sources
mkdir -p ${DEPENDS_DIR}/SDKs
if [ -n "$XCODE_VERSION" ]; then
OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz"
OSX_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${OSX_SDK_BASENAME}"
if [ ! -f "$OSX_SDK_PATH" ]; then
curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH"
fi
if [ -f "$OSX_SDK_PATH" ]; then
tar -C ${DEPENDS_DIR}/SDKs -xf "$OSX_SDK_PATH"
fi
if [[ "${HOST}" == "x86_64-apple-darwin" ]]; then
./contrib/containers/guix/scripts/setup-sdk
fi
make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS

View File

@ -18,28 +18,30 @@ export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/
if [ "$BUILD_TARGET" = "arm-linux" ]; then
source ./ci/test/00_setup_env_arm.sh
elif [ "$BUILD_TARGET" = "win64" ]; then
source ./ci/test/00_setup_env_win64.sh
elif [ "$BUILD_TARGET" = "linux64" ]; then
source ./ci/test/00_setup_env_native_qt5.sh
elif [ "$BUILD_TARGET" = "linux64_asan" ]; then
source ./ci/test/00_setup_env_native_asan.sh
elif [ "$BUILD_TARGET" = "linux64_cxx20" ]; then
source ./ci/test/00_setup_env_native_cxx20.sh
elif [ "$BUILD_TARGET" = "linux64_fuzz" ]; then
source ./ci/test/00_setup_env_native_fuzz.sh
elif [ "$BUILD_TARGET" = "linux64_multiprocess" ]; then
source ./ci/test/00_setup_env_native_multiprocess.sh
elif [ "$BUILD_TARGET" = "linux64_nowallet" ]; then
source ./ci/test/00_setup_env_native_nowallet.sh
elif [ "$BUILD_TARGET" = "linux64_sqlite" ]; then
source ./ci/test/00_setup_env_native_sqlite.sh
elif [ "$BUILD_TARGET" = "linux64_tsan" ]; then
source ./ci/test/00_setup_env_native_tsan.sh
elif [ "$BUILD_TARGET" = "linux64_ubsan" ]; then
source ./ci/test/00_setup_env_native_ubsan.sh
elif [ "$BUILD_TARGET" = "linux64_fuzz" ]; then
source ./ci/test/00_setup_env_native_fuzz.sh
elif [ "$BUILD_TARGET" = "linux64_cxx20" ]; then
source ./ci/test/00_setup_env_native_cxx20.sh
elif [ "$BUILD_TARGET" = "linux64_sqlite" ]; then
source ./ci/test/00_setup_env_native_sqlite.sh
elif [ "$BUILD_TARGET" = "linux64_nowallet" ]; then
source ./ci/test/00_setup_env_native_nowallet.sh
elif [ "$BUILD_TARGET" = "linux64_valgrind" ]; then
source ./ci/test/00_setup_env_native_valgrind.sh
elif [ "$BUILD_TARGET" = "mac" ]; then
source ./ci/test/00_setup_env_mac.sh
elif [ "$BUILD_TARGET" = "s390x" ]; then
source ./ci/test/00_setup_env_s390x.sh
elif [ "$BUILD_TARGET" = "win64" ]; then
source ./ci/test/00_setup_env_win64.sh
fi

View File

@ -42,7 +42,7 @@ echo "Using socketevents mode: $SOCKETEVENTS"
EXTRA_ARGS="--dashd-arg=-socketevents=$SOCKETEVENTS"
set +e
LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib ${TEST_RUNNER_ENV} ./test/functional/test_runner.py --ci --attempts=3 --ansi --combinedlogslen=4000 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} --failfast --nocleanup --tmpdir=$(pwd)/testdatadirs $PASS_ARGS $EXTRA_ARGS
LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib ./test/functional/test_runner.py --ci --attempts=3 --ansi --combinedlogslen=4000 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} --failfast --nocleanup --tmpdir=$(pwd)/testdatadirs $PASS_ARGS $EXTRA_ARGS
RESULT=$?
set -e

View File

@ -29,8 +29,8 @@ if [ "$DIRECT_WINE_EXEC_TESTS" = "true" ]; then
wine ./src/test/test_dash.exe
else
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
${TEST_RUNNER_ENV} ./src/test/test_dash --catch_system_errors=no -l test_suite
./src/test/test_dash --catch_system_errors=no -l test_suite
else
${TEST_RUNNER_ENV} make $MAKEJOBS check VERBOSE=1
make $MAKEJOBS check VERBOSE=1
fi
fi

View File

@ -25,8 +25,7 @@ export JOB_NUMBER=${JOB_NUMBER:-1}
echo "Fallback to default values in env (if not yet set)"
# The number of parallel jobs to pass down to make and test_runner.py
MAKEJOBS="-j$(nproc)"
export MAKEJOBS
export MAKEJOBS=${MAKEJOBS:--j$(nproc)}
# A folder for the ci system to put temporary files (ccache, datadirs for tests, ...)
# This folder only exists on the ci host.
export BASE_SCRATCH_DIR=${BASE_SCRATCH_DIR:-$BASE_ROOT_DIR/ci/scratch}
@ -44,7 +43,6 @@ export RUN_SECURITY_TESTS=${RUN_SECURITY_TESTS:-false}
# This is needed because some ci machines have slow CPU or disk, so sanitizers
# might be slow or a reindex might be waiting on disk IO.
export TEST_RUNNER_TIMEOUT_FACTOR=${TEST_RUNNER_TIMEOUT_FACTOR:-4}
export TEST_RUNNER_ENV=${TEST_RUNNER_ENV:-}
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
export EXPECTED_TESTS_DURATION_IN_SECONDS=${EXPECTED_TESTS_DURATION_IN_SECONDS:-1000}

View File

@ -10,5 +10,6 @@ export CONTAINER_NAME=ci_native_multiprocess
export PACKAGES="cmake python3 llvm clang"
export DEP_OPTS="DEBUG=1 MULTIPROCESS=1"
export GOAL="install"
export BITCOIN_CONFIG="--with-boost-process --enable-debug CC=clang CXX=clang++" # Use clang to avoid OOM
export TEST_RUNNER_ENV="BITCOIND=dash-node"
export TEST_RUNNER_EXTRA="--v2transport"
export BITCOIN_CONFIG="--with-boost-process --enable-debug CC=clang-16 CXX=clang++-16" # Use clang to avoid OOM
export BITCOIND=dash-node # Used in functional tests

View File

@ -9,8 +9,7 @@ export LC_ALL=C.UTF-8
export CONTAINER_NAME=ci_native_qt5
export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
export DEP_OPTS="NO_UPNP=1 DEBUG=1"
# TODO: we have few rpcs that aren't covered by any test, re-enable the line below once it's fixed
# export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_pruning,feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash
export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_pruning,feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash
export RUN_UNIT_TESTS_SEQUENTIAL="true"
export RUN_UNIT_TESTS="false"
export GOAL="install"

View File

@ -19,7 +19,6 @@ fi
# Use debian to avoid 404 apt errors
export CONTAINER_NAME=ci_s390x
export RUN_UNIT_TESTS=true
export TEST_RUNNER_ENV="LC_ALL=C"
export RUN_FUNCTIONAL_TESTS=true
export GOAL="install"
export BITCOIN_CONFIG="--enable-reduce-exports --disable-gui-tests --with-boost-process" # GUI tests disabled for now, see https://github.com/bitcoin/bitcoin/issues/23730

View File

@ -372,7 +372,9 @@ case $host in
esac
if test "x$enable_debug" = xyes; then
dnl Clear default -g -O2 flags
dnl If debugging is enabled, and the user hasn't overriden CXXFLAGS, clear
dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up
dnl with "-O0 -g3 -g -O2".
if test "x$CXXFLAGS_overridden" = xno; then
CXXFLAGS=""
fi
@ -397,11 +399,11 @@ else
# Stacktraces will be suboptimal due to optimization, but better than nothing. Also, -fno-omit-frame-pointer
# mitigates this a little bit
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -g1 -fno-omit-frame-pointer"
DEBUG_CFLAGS="$DEBUG_CFLAGS -g1 -fno-omit-frame-pointer"
fi
if test "x$GXX" = xyes; then
CXXFLAGS="$CXXFLAGS -g1 -fno-omit-frame-pointer"
DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -g1 -fno-omit-frame-pointer"
fi
fi
@ -429,7 +431,7 @@ if test x$LINK_WRAP_SUPPORTED = "xyes"; then
fi
# Needed for MinGW targets when debug symbols are enabled as compiled objects get very large
AX_CHECK_COMPILE_FLAG([-Wa,-mbig-obj], [CXXFLAGS="$CXXFLAGS -Wa,-mbig-obj"],,,)
AX_CHECK_COMPILE_FLAG([-Wa,-mbig-obj], [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -Wa,-mbig-obj"],,,)
if test x$use_sanitizers != x; then
dnl First check if the compiler accepts flags. If an incompatible pair like
@ -532,7 +534,7 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
fi
dnl Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
AX_CHECK_COMPILE_FLAG([-fno-extended-identifiers],[[CXXFLAGS="$CXXFLAGS -fno-extended-identifiers"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-fno-extended-identifiers],[[CORE_CXXFLAGS="$CORE_CXXFLAGS -fno-extended-identifiers"]],,[[$CXXFLAG_WERROR]])
enable_arm_crc=no
enable_arm_shani=no
@ -683,7 +685,7 @@ CXXFLAGS="$TEMP_CXXFLAGS"
fi
CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -DGSL_NO_IOSTREAMS"
CORE_CPPFLAGS="$CORE_CPPFLAGS -DHAVE_BUILD_INFO -DGSL_NO_IOSTREAMS"
AC_ARG_WITH([utils],
[AS_HELP_STRING([--with-utils],
@ -755,7 +757,10 @@ case $host in
AC_MSG_ERROR("windres not found")
fi
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN"
CORE_CPPFLAGS="$CORE_CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN"
dnl Prevent the definition of min/max macros.
dnl We always want to use the standard library.
CORE_CPPFLAGS="$CORE_CPPFLAGS -DNOMINMAX"
dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.
dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override
@ -766,14 +771,14 @@ case $host in
postdeps_CXX=
dnl We require Windows 7 (NT 6.1) or later
AX_CHECK_LINK_FLAG([[-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1]],[LDFLAGS="$LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"],,[[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1]],[CORE_LDFLAGS="$CORE_LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"],,[[$LDFLAG_WERROR]])
;;
*darwin*)
TARGET_OS=darwin
if test x$cross_compiling != xyes; then
BUILD_OS=darwin
AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"],, [[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-headerpad_max_install_names"],, [[$LDFLAG_WERROR]])
AC_CHECK_PROG([BREW],brew, brew)
if test x$BREW = xbrew; then
@ -800,8 +805,8 @@ case $host in
gmp_prefix=$($BREW --prefix gmp 2>/dev/null)
if test x$gmp_prefix != x; then
CPPFLAGS="$CPPFLAGS -I$gmp_prefix/include"
LDFLAGS="$LDFLAGS -L$gmp_prefix/lib"
CORE_CPPFLAGS="$CORE_CPPFLAGS -I$gmp_prefix/include"
CORE_LDFLAGS="$CORE_LDFLAGS -L$gmp_prefix/lib"
fi
case $host in
@ -813,20 +818,20 @@ case $host in
if test "x$use_upnp" != xno && $BREW list --versions miniupnpc >/dev/null; then
miniupnpc_prefix=$($BREW --prefix miniupnpc 2>/dev/null)
if test "x$suppress_external_warnings" != xno; then
CPPFLAGS="$CPPFLAGS -isystem $miniupnpc_prefix/include"
CORE_CPPFLAGS="$CORE_CPPFLAGS -isystem $miniupnpc_prefix/include"
else
CPPFLAGS="$CPPFLAGS -I$miniupnpc_prefix/include"
CORE_CPPFLAGS="$CORE_CPPFLAGS -I$miniupnpc_prefix/include"
fi
LDFLAGS="$LDFLAGS -L$miniupnpc_prefix/lib"
CORE_LDFLAGS="$CORE_LDFLAGS -L$miniupnpc_prefix/lib"
fi
if test "x$use_natpmp" != xno && $BREW list --versions libnatpmp >/dev/null; then
libnatpmp_prefix=$($BREW --prefix libnatpmp 2>/dev/null)
if test "x$suppress_external_warnings" != xno; then
CPPFLAGS="$CPPFLAGS -isystem $libnatpmp_prefix/include"
CORE_CPPFLAGS="$CORE_CPPFLAGS -isystem $libnatpmp_prefix/include"
else
CPPFLAGS="$CPPFLAGS -I$libnatpmp_prefix/include"
CORE_CPPFLAGS="$CORE_CPPFLAGS -I$libnatpmp_prefix/include"
fi
LDFLAGS="$LDFLAGS -L$libnatpmp_prefix/lib"
CORE_LDFLAGS="$CORE_LDFLAGS -L$libnatpmp_prefix/lib"
fi
;;
esac
@ -849,7 +854,7 @@ case $host in
esac
fi
CPPFLAGS="$CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0"
CORE_CPPFLAGS="$CORE_CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0"
OBJCXXFLAGS="$CXXFLAGS"
;;
*android*)
@ -912,11 +917,17 @@ if test x$use_lcov = xyes; then
AC_SUBST(COV_TOOL_WRAPPER, "cov_tool_wrapper.sh")
LCOV="$LCOV --gcov-tool $(pwd)/$COV_TOOL_WRAPPER"
AX_CHECK_LINK_FLAG([[--coverage]], [LDFLAGS="$LDFLAGS --coverage"],
AX_CHECK_LINK_FLAG([[--coverage]], [CORE_LDFLAGS="$CORE_LDFLAGS --coverage"],
[AC_MSG_ERROR("lcov testing requested but --coverage linker flag does not work")])
AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
AX_CHECK_COMPILE_FLAG([--coverage],[CORE_CXXFLAGS="$CORE_CXXFLAGS --coverage"],
[AC_MSG_ERROR("lcov testing requested but --coverage flag does not work")])
CXXFLAGS="$CXXFLAGS -Og"
dnl If coverage is enabled, and the user hasn't overriden CXXFLAGS, clear
dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up
dnl with "--coverage -Og -O0 -g -O2".
if test "$CXXFLAGS_overridden" = "no"; then
CXXFLAGS=""
fi
CORE_CXXFLAGS="$CORE_CXXFLAGS -Og -O0"
fi
if test x$use_lcov_branch != xno; then
@ -942,13 +953,13 @@ AC_FUNC_STRERROR_R
if test x$ac_cv_sys_file_offset_bits != x &&
test x$ac_cv_sys_file_offset_bits != xno &&
test x$ac_cv_sys_file_offset_bits != xunknown; then
CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
CORE_CPPFLAGS="$CORE_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
fi
if test x$ac_cv_sys_large_files != x &&
test x$ac_cv_sys_large_files != xno &&
test x$ac_cv_sys_large_files != xunknown; then
CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
CORE_CPPFLAGS="$CORE_CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
fi
if test "x$enable_gprof" = xyes; then
@ -1037,8 +1048,8 @@ dnl These flags are specific to ld64, and may cause issues with other linkers.
dnl For example: GNU ld will interpret -dead_strip as -de and then try and use
dnl "ad_strip" as the symbol for the entry point.
if test x$TARGET_OS = xdarwin; then
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"],, [[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip_dylibs]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"],, [[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-dead_strip"],, [[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip_dylibs]], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-dead_strip_dylibs"],, [[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,-fixup_chains]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-fixup_chains"], [], [[$LDFLAG_WERROR]])
fi
@ -1048,7 +1059,6 @@ AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],,
[#include <sys/types.h>
#include <ifaddrs.h>]
)
AC_CHECK_DECLS([strnlen])
dnl These are used for daemonization in dashd
AC_CHECK_DECLS([fork])
@ -1361,7 +1371,7 @@ if test "x$enable_fuzz" = "xyes"; then
[[-fsanitize=$use_sanitizers]],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes])
CPPFLAGS="$CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"],
CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"],
[],
[AC_LANG_PROGRAM([[
#include <cstdint>
@ -1385,7 +1395,7 @@ else
QT_TEST_INCLUDES=SUPPRESS_WARNINGS($QT_TEST_INCLUDES)
fi
CPPFLAGS="$CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"
CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"
fi
if test x$enable_wallet != xno; then
@ -1518,7 +1528,7 @@ fi
dnl Check for reduced exports
if test x$use_reduce_exports = xyes; then
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[CXXFLAGS="$CXXFLAGS -fvisibility=hidden"],
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[CORE_CXXFLAGS="$CORE_CXXFLAGS -fvisibility=hidden"],
[AC_MSG_ERROR([Cannot set hidden symbol visibility. Use --disable-reduce-exports.])],[[$CXXFLAG_WERROR]])
AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]],[RELDFLAGS="-Wl,--exclude-libs,ALL"],,[[$LDFLAG_WERROR]])
AX_CHECK_LINK_FLAG([-Wl,-no_exported_symbols], [LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -Wl,-no_exported_symbols"], [], [$LDFLAG_WERROR])
@ -1870,10 +1880,14 @@ AC_SUBST(BITCOIN_MP_NODE_NAME)
AC_SUBST(BITCOIN_MP_GUI_NAME)
AC_SUBST(RELDFLAGS)
AC_SUBST(CORE_LDFLAGS)
AC_SUBST(CORE_CPPFLAGS)
AC_SUBST(CORE_CXXFLAGS)
AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(DEBUG_CPPFLAGS)
AC_SUBST(DEBUG_CXXFLAGS)
AC_SUBST(WARN_CXXFLAGS)
AC_SUBST(NOWARN_CXXFLAGS)
AC_SUBST(DEBUG_CXXFLAGS)
AC_SUBST(ERROR_CXXFLAGS)
AC_SUBST(GPROF_CXXFLAGS)
AC_SUBST(GPROF_LDFLAGS)
@ -1995,10 +2009,10 @@ echo " target os = $host_os"
echo " build os = $build_os"
echo
echo " CC = $CC"
echo " CFLAGS = $PTHREAD_CFLAGS $CFLAGS"
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS"
echo " CFLAGS = $DEBUG_CFLAGS $PTHREAD_CFLAGS $CFLAGS"
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CORE_CPPFLAGS $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CORE_CXXFLAGS $CXXFLAGS"
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $CORE_LDFLAGS $LDFLAGS"
echo " ARFLAGS = $ARFLAGS"
echo

View File

@ -7,14 +7,17 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"
# (zlib1g-dev is needed for the Qt host binary builds, but should not be used by target binaries)
ENV APT_ARGS="-y --no-install-recommends --no-upgrade"
# Install packages for i386; disabled on aarch64 and arm64 hosts
RUN (dpkg --print-architecture | grep -Eq 'aarch64|arm64' || dpkg --add-architecture i386)
RUN (dpkg --print-architecture | grep -Eq 'aarch64|arm64' || (apt-get update && apt-get install $APT_ARGS \
g++-multilib \
wine32) && rm -rf /var/lib/apt/lists/*)
RUN apt-get update && apt-get install $APT_ARGS \
# Install packages for i386 on amd64 hosts, then install common packages
RUN set -ex; \
apt-get update && \
if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
dpkg --add-architecture i386 && \
apt-get update && \
apt-get install $APT_ARGS \
g++-multilib \
wine32; \
fi; \
apt-get install $APT_ARGS \
autotools-dev \
automake \
autoconf \
@ -23,13 +26,11 @@ RUN apt-get update && apt-get install $APT_ARGS \
bsdmainutils \
curl \
ccache \
clang \
cmake \
g++ \
gettext \
git \
libc++-dev \
libc++abi-dev \
gnupg \
libtool \
libxcb-icccm4 \
libxcb-image0 \
@ -42,11 +43,38 @@ RUN apt-get update && apt-get install $APT_ARGS \
libxcb-xinerama0 \
libxcb-xkb1 \
libxkbcommon-x11-0 \
wget \
lsb-release \
software-properties-common \
unzip \
wget \
m4 \
pkg-config \
zlib1g-dev
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Clang+LLVM and set it as default
# We don't need all packages but the default set doesn't include some
# packages we want so we will need to install some of them manually.
ARG LLVM_VERSION=16
RUN set -ex; \
echo "Installing LLVM and Clang ${LLVM_VERSION}..."; \
curl -sL https://apt.llvm.org/llvm.sh | bash -s "${LLVM_VERSION}"; \
echo "Installing additional packages..."; \
apt-get update && apt-get install $APT_ARGS \
"clang-format-${LLVM_VERSION}" \
"clang-tidy-${LLVM_VERSION}" \
"libc++-${LLVM_VERSION}-dev" \
"libc++abi-${LLVM_VERSION}-dev" \
"libclang-rt-${LLVM_VERSION}-dev"; \
rm -rf /var/lib/apt/lists/*; \
echo "Setting defaults..."; \
lldbUpdAltArgs="update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${LLVM_VERSION} 100"; \
for binName in clang clang++ clang-format clang-tidy clangd ld.lld lldb lldb-server; do \
lldbUpdAltArgs="${lldbUpdAltArgs} --slave /usr/bin/${binName} ${binName} /usr/bin/${binName}-${LLVM_VERSION}"; \
done; \
sh -c "${lldbUpdAltArgs}";
# LD_LIBRARY_PATH is empty by default, this is the first entry
ENV LD_LIBRARY_PATH="/usr/lib/llvm-${LLVM_VERSION}/lib"
# Python setup
# PYTHON_VERSION should match the value in .python-version
@ -61,10 +89,11 @@ RUN apt-get update && apt-get install $APT_ARGS \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
llvm \
make \
tk-dev \
xz-utils
xz-utils \
&& rm -rf /var/lib/apt/lists/*
ENV PYENV_ROOT="/usr/local/pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN curl https://pyenv.run | bash \
@ -82,19 +111,38 @@ RUN pip3 install \
pyzmq==22.3.0 \
vulture==2.3
# dash_hash
ARG DASH_HASH_VERSION=1.4.0
RUN git clone --depth 1 --no-tags --branch=${DASH_HASH_VERSION} https://github.com/dashpay/dash_hash
RUN cd dash_hash && pip3 install -r requirements.txt .
RUN set -ex; \
cd /tmp; \
git clone --depth 1 --no-tags --branch=${DASH_HASH_VERSION} https://github.com/dashpay/dash_hash; \
cd dash_hash && pip3 install -r requirements.txt .; \
cd .. && rm -rf dash_hash
ARG CPPCHECK_VERSION=2.13.0
RUN set -ex; \
curl -fL "https://github.com/danmar/cppcheck/archive/${CPPCHECK_VERSION}.tar.gz" -o /tmp/cppcheck.tar.gz; \
mkdir -p /opt/cppcheck && tar -xzf /tmp/cppcheck.tar.gz -C /opt/cppcheck --strip-components=1 && rm /tmp/cppcheck.tar.gz; \
cd /opt/cppcheck; \
mkdir build && cd build && cmake .. && cmake --build . -j "$(( $(nproc) - 1 ))"; \
mkdir /usr/local/share/Cppcheck && ln -s /opt/cppcheck/cfg/ /usr/local/share/Cppcheck/cfg; \
rm -rf /tmp/cppcheck.tar.gz
ENV PATH="/opt/cppcheck/build/bin:${PATH}"
ARG SHELLCHECK_VERSION=v0.7.1
RUN set -ex; \
curl -fL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" -o /tmp/shellcheck.tar.xz; \
mkdir -p /opt/shellcheck && tar -xf /tmp/shellcheck.tar.xz -C /opt/shellcheck --strip-components=1 && rm /tmp/shellcheck.tar.xz
ENV PATH="/opt/shellcheck:${PATH}"
# Add user with specified (or default) user/group ids and setup configuration files
ARG USER_ID=1000
ARG GROUP_ID=1000
# add user with specified (or default) user/group ids
ENV USER_ID="${USER_ID}"
ENV GROUP_ID="${GROUP_ID}"
RUN groupadd -g ${GROUP_ID} dash
RUN useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /home/dash dash
RUN set -ex; \
groupadd -g ${GROUP_ID} dash; \
useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /home/dash dash; \
mkdir -p /home/dash/.config/gdb; \
echo "add-auto-load-safe-path /usr/lib/llvm-${LLVM_VERSION}/lib" | tee /home/dash/.config/gdb/gdbinit; \
chown ${USER_ID}:${GROUP_ID} -R /home/dash
# Packages needed for all target builds
RUN apt-get update && apt-get install $APT_ARGS \
@ -111,17 +159,8 @@ RUN apt-get update && apt-get install $APT_ARGS \
valgrind \
wine-stable \
wine64 \
xorriso
ARG CPPCHECK_VERSION=2.13.0
RUN curl -sL "https://github.com/danmar/cppcheck/archive/${CPPCHECK_VERSION}.tar.gz" | tar -xvzf - --directory /tmp/
RUN cd /tmp/cppcheck-${CPPCHECK_VERSION} && mkdir build && cd build && cmake .. && cmake --build . -j 8
ENV PATH="/tmp/cppcheck-${CPPCHECK_VERSION}/build/bin:${PATH}"
RUN mkdir /usr/local/share/Cppcheck && ln -s /tmp/cppcheck-${CPPCHECK_VERSION}/cfg/ /usr/local/share/Cppcheck/cfg
ARG SHELLCHECK_VERSION=v0.7.1
RUN curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
ENV PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"
xorriso \
&& rm -rf /var/lib/apt/lists/*
# This is a hack. It is needed because gcc-multilib and g++-multilib are conflicting with g++-arm-linux-gnueabihf. This is
# due to gcc-multilib installing the following symbolic link, which is needed for -m32 support. However, this causes
@ -135,20 +174,6 @@ RUN \
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix; \
exit 0
ARG LLVM_VERSION=16
# Setup Clang+LLVM support
RUN apt-get update && apt-get install $APT_ARGS \
lsb-release \
software-properties-common \
gnupg \
&& rm -rf /var/lib/apt/lists/*
RUN cd /tmp && \
wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
/tmp/llvm.sh ${LLVM_VERSION} && \
rm -rf /tmp/llvm.sh
RUN \
mkdir -p /src/dash && \
mkdir -p /cache/ccache && \

View File

@ -1,17 +1,18 @@
version: "3.9"
services:
container:
entrypoint: /bin/bash
build:
context: '..'
dockerfile: './develop/Dockerfile'
tty: true # Equivalent to -t
stdin_open: true # Equivalent to -i
ports:
- "9998:9998" # Mainnet Ports
- "9999:9999"
- "19998:19998" # Testnet Ports
- "19999:19999"
security_opt:
- seccomp:unconfined
stdin_open: true # Equivalent to -i
tty: true # Equivalent to -t
# A note about volumes:
#

View File

@ -18,7 +18,11 @@ RUN apt-get update && \
sudo \
wget \
xz-utils && \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/*; \
targetLocale="en_US.UTF-8"; \
locale-gen ${targetLocale} && \
update-locale LC_ALL=${targetLocale} && \
update-locale LANG=${targetLocale};
ARG guix_download_path=ftp://ftp.gnu.org/gnu/guix
ARG guix_version=1.4.0
@ -30,8 +34,7 @@ ENV PATH="/usr/local/bin:/usr/local/guix/current/bin:$PATH"
# Application Setup
# https://guix.gnu.org/manual/en/html_node/Application-Setup.html
ENV GUIX_LOCPATH="/usr/local/guix/profile" \
LC_ALL="en_US.UTF-8"
ENV GUIX_LOCPATH="/usr/local/guix/profile"
RUN guix_file_name=guix-binary-${guix_version}.$(uname -m)-linux.tar.xz && \
eval "guix_checksum=\${guix_checksum_$(uname -m)}" && \
@ -74,18 +77,19 @@ RUN usermod -aG sudo ${USERNAME} && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Copy required files to container
COPY --from=docker_root ./motd.txt /etc/motd
COPY --from=docker_root ./scripts/entrypoint /usr/local/bin/entrypoint
COPY --from=docker_root ./scripts/guix-check /usr/local/bin/guix-check
COPY --from=docker_root ./scripts/guix-start /usr/local/bin/guix-start
COPY --from=docker_root ./motd.txt /etc/motd
COPY --from=docker_root ./scripts/entrypoint /usr/local/bin/entrypoint
COPY --from=docker_root ./scripts/guix-check /usr/local/bin/guix-check
COPY --from=docker_root ./scripts/guix-start /usr/local/bin/guix-start
COPY --from=docker_root ./scripts/setup-sdk /usr/local/bin/setup-sdk
# Create directories for mounting to save/restore cache and grant necessary permissions
RUN mkdir -p \
/home/${USERNAME}/.cache \
/src/dash/depends/{built,sources,work} && \
/src/dash/depends/{built,sources,work}; \
chown -R ${USER_ID}:${GROUP_ID} \
/home/${USERNAME}/.cache \
/src
/src;
WORKDIR "/src/dash"

View File

@ -1,4 +1,3 @@
version: "3.9"
services:
guix_ubuntu:
build:

View File

@ -9,19 +9,10 @@ if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPAC
exit 1
fi
XCODE_VERSION="15.0"
XCODE_RELEASE="15A240d"
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
XCODE_SOURCE="${XCODE_SOURCE:-https://bitcoincore.org/depends-sources/sdks}"
export SDK_PATH="${SDK_PATH:-${WORKSPACE_PATH}/depends/SDKs}"
export SDK_SRCS="${SDK_PATH:-${WORKSPACE_PATH}/depends/sdk-sources}"
# Check if macOS SDK is present, if not, download it
if [[ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]]; then
echo "Preparing macOS SDK..."
mkdir -p "${SDK_PATH}"
curl -L "${XCODE_SOURCE}/${XCODE_ARCHIVE}.tar.gz" | tar -xz -C "${SDK_PATH}"
fi
./contrib/containers/guix/scripts/setup-sdk
# Add safe.directory option only when WORKSPACE_PATH was specified via cmd-line arguments (happens in CI)
if [[ -n "${1}" ]]; then

View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Copyright (c) 2024 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C.UTF-8
set -eo pipefail
SDK_URL="${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}"
SDK_PATH="${SDK_PATH:-depends/SDKs}"
SDK_SRCS="${SDK_SOURCES:-depends/sdk-sources}"
XCODE_VERSION="${XCODE_VERSION:-15.0}"
XCODE_RELEASE="${XCODE_RELEASE:-15A240d}"
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
XCODE_AR_PATH="${SDK_SRCS}/${XCODE_ARCHIVE}.tar.gz"
if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then
if [ ! -f "${XCODE_AR_PATH}" ]; then
echo "Downloading macOS SDK..."
mkdir -p "${SDK_SRCS}"
curl --location --fail "${SDK_URL}/${XCODE_ARCHIVE}.tar.gz" -o "${XCODE_AR_PATH}"
fi
echo "Extracting macOS SDK..."
mkdir -p "${SDK_PATH}"
tar -C "${SDK_PATH}" -xf "${XCODE_AR_PATH}"
fi

View File

@ -159,9 +159,15 @@ $(package)_config_opts_linux += -dbus-runtime
ifneq ($(LTO),)
$(package)_config_opts_linux += -ltcg
endif
$(package)_config_opts_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
ifneq (,$(findstring -stdlib=libc++,$($(1)_cxx)))
$(package)_config_opts_x86_64_linux = -xplatform linux-clang-libc++
ifneq (,$(findstring clang,$($(package)_cxx)))
ifneq (,$(findstring -stdlib=libc++,$($(package)_cxx)))
$(package)_config_opts_linux += -platform linux-clang-libc++ -xplatform linux-clang-libc++
else
$(package)_config_opts_linux += -platform linux-clang -xplatform linux-clang
endif
else
$(package)_config_opts_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
endif
$(package)_config_opts_mingw32 = -no-opengl

View File

@ -41,5 +41,5 @@ Versions and PRs are relevant to Bitcoin's core if not mentioned other.
* [`BIP 158`](https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki): Compact Block Filters for Light Clients can be indexed as of **Dash Core v18.0** ([PR dash#4314](https://github.com/dashpay/dash/pull/4314), [PR #14121](https://github.com/bitcoin/bitcoin/pull/14121)).
* [`BIP 159`](https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki): The `NODE_NETWORK_LIMITED` service bit is signalled as of **v0.16.0** ([PR 11740](https://github.com/bitcoin/bitcoin/pull/11740)), and such nodes are connected to as of **v0.17.0** ([PR 10387](https://github.com/bitcoin/bitcoin/pull/10387)).
* [`BIP 174`](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki): RPCs to operate on Partially Signed Bitcoin Transactions (PSBT) are present as of **v18.0** ([PR 13557](https://github.com/bitcoin/bitcoin/pull/13557)).
* [`BIP 324`](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki): The v2 transport protocol specified by BIP324 and the associated `NODE_P2P_V2` service bit are supported as of **v22.0**, but off by default ([PR 28331](https://github.com/bitcoin/bitcoin/pull/28331)).
* [`BIP 324`](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki): The v2 transport protocol specified by BIP324 and the associated `NODE_P2P_V2` service bit are supported as of **v22.0**, but off by default ([PR 28331](https://github.com/bitcoin/bitcoin/pull/28331)). On by default as of **v22.1** ([PR 29347](https://github.com/bitcoin/bitcoin/pull/29347)).
* [`BIP 339`](https://github.com/bitcoin/bips/blob/master/bip-0339.mediawiki): Relay of transactions by wtxid is supported as of **v0.21.0** ([PR 18044](https://github.com/bitcoin/bitcoin/pull/18044)).

View File

@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASH-CLI "1" "August 2024" "dash-cli v21.1.0" "User Commands"
.TH DASH-CLI "1" "December 2024" "dash-cli v22.0.0" "User Commands"
.SH NAME
dash-cli \- manual page for dash-cli v21.1.0
dash-cli \- manual page for dash-cli v22.0.0
.SH SYNOPSIS
.B dash-cli
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR] \fI\,Send command to Dash Core\/\fR
@ -15,7 +15,7 @@ dash-cli \- manual page for dash-cli v21.1.0
.B dash-cli
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
.SH DESCRIPTION
Dash Core RPC client version v21.1.0
Dash Core RPC client version v22.0.0
.SH OPTIONS
.HP
\-?
@ -136,6 +136,8 @@ for the wallet passphrase.
.IP
Print version and exit
.PP
Debugging/Testing options:
.PP
Chain selection options:
.HP
\fB\-chain=\fR<chain>

View File

@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASH-QT "1" "August 2024" "dash-qt v21.1.0" "User Commands"
.TH DASH-QT "1" "December 2024" "dash-qt v22.0.0" "User Commands"
.SH NAME
dash-qt \- manual page for dash-qt v21.1.0
dash-qt \- manual page for dash-qt v22.0.0
.SH SYNOPSIS
.B dash-qt
[\fI\,command-line options\/\fR]
.SH DESCRIPTION
Dash Core version v21.1.0
Dash Core version v22.0.0
.SH OPTIONS
.HP
\-?
@ -23,9 +23,9 @@ message)
If this block is in the chain assume that it and its ancestors are valid
and potentially skip their script verification (0 to verify all,
default:
000000000000001889bd33ef019065e250d32bd46911f4003d3fdd8128b5358d,
000000000000001cf26547602d982dcaa909231bbcd1e70c0eb3c65de25473ba,
testnet:
00000034bfeb926662ba547c0b8dd4ba8cbb6e0c581f4e7d1bddce8f9ca3a608)
000000eef20eb0062abd4e799967e98bdebb165dd1c567ab4118c1c86c6e948f)
.HP
\fB\-blockfilterindex=\fR<type>
.IP
@ -140,12 +140,11 @@ Reduce storage requirements by enabling pruning (deleting) of old
blocks. This allows the pruneblockchain RPC to be called to
delete specific blocks, and enables automatic pruning of old
blocks if a target size in MiB is provided. This mode is
incompatible with \fB\-txindex\fR, \fB\-coinstatsindex\fR, \fB\-rescan\fR and
\fB\-disablegovernance\fR=\fI\,false\/\fR. Warning: Reverting this setting
requires re\-downloading the entire blockchain. (default: 0 =
disable pruning blocks, 1 = allow manual pruning via RPC, >945 =
automatically prune block files to stay under the specified
target size in MiB)
incompatible with \fB\-txindex\fR, \fB\-rescan\fR and \fB\-disablegovernance\fR=\fI\,false\/\fR.
Warning: Reverting this setting requires re\-downloading the
entire blockchain. (default: 0 = disable pruning blocks, 1 =
allow manual pruning via RPC, >945 = automatically prune block
files to stay under the specified target size in MiB)
.HP
\fB\-settings=\fR<file>
.IP
@ -277,7 +276,8 @@ Maximum per\-connection receive buffer, <n>*1000 bytes (default: 5000)
.HP
\fB\-maxsendbuffer=\fR<n>
.IP
Maximum per\-connection send buffer, <n>*1000 bytes (default: 1000)
Maximum per\-connection memory usage for the send buffer, <n>*1000 bytes
(default: 1000)
.HP
\fB\-maxtimeadjustment\fR
.IP
@ -287,9 +287,11 @@ amount. (default: 4200 seconds)
.HP
\fB\-maxuploadtarget=\fR<n>
.IP
Tries to keep outbound traffic under the given target (in MiB per 24h).
Limit does not apply to peers with 'download' permission. 0 = no
limit (default: 0)
Tries to keep outbound traffic under the given target per 24h. Limit
does not apply to peers with 'download' permission or blocks
created within past week. 0 = no limit (default: 0M). Optional
suffix units [k|K|m|M|g|G|t|T] (default: M). Lowercase is 1000
base while uppercase is 1024 base
.HP
\fB\-natpmp\fR
.IP
@ -379,6 +381,10 @@ Tor control port password (default: empty)
Use UPnP to map the listening port (default: 1 when listening and no
\fB\-proxy\fR)
.HP
\fB\-v2transport\fR
.IP
Support v2 transport (default: 0)
.HP
\fB\-whitebind=\fR<[permissions@]addr>
.IP
Bind to the given address and add permission flags to the peers
@ -410,13 +416,14 @@ unspent outputs for addresses (default: 0)
.HP
\fB\-reindex\fR
.IP
Rebuild chain state and block index from the blk*.dat files on disk
Rebuild chain state and block index from the blk*.dat files on disk.
This will also rebuild active optional indexes.
.HP
\fB\-reindex\-chainstate\fR
.IP
Rebuild chain state from the currently indexed blocks. When in pruning
mode or if blocks on disk might be corrupted, use full \fB\-reindex\fR
instead.
instead. Deactivate all optional indexes before running this.
.HP
\fB\-spentindex\fR
.IP
@ -435,6 +442,11 @@ call (default: 1)
.PP
Masternode options:
.HP
\fB\-deprecated\-platform\-user=\fR<user>
.IP
Set the username for the "platform user", a restricted user intended to
be used by Dash Platform, to the specified username.
.HP
\fB\-llmq\-data\-recovery=\fR<n>
.IP
Enable automated quorum data recovery (default: 1)
@ -451,29 +463,21 @@ defined by <quorum_name> if a member of any of the quorums)
.IP
Set the masternode BLS private key and enable the client to act as a
masternode
.HP
\fB\-platform\-user=\fR<user>
.IP
Set the username for the "platform user", a restricted user intended to
be used by Dash Platform, to the specified username.
.PP
Statsd options:
.HP
\fB\-statsenabled\fR
\fB\-statsbatchsize=\fR<bytes>
.IP
Publish internal stats to statsd (default: 0)
Specify the size of each batch of stats messages (default: 1024)
.HP
\fB\-statsduration=\fR<ms>
.IP
Specify the number of milliseconds between stats messages (default:
1000)
.HP
\fB\-statshost=\fR<ip>
.IP
Specify statsd host (default: 127.0.0.1)
.HP
\fB\-statshostname=\fR<ip>
.IP
Specify statsd host name (default: )
.HP
\fB\-statsns=\fR<ns>
.IP
Specify additional namespace prefix (default: )
Specify statsd host (default: )
.HP
\fB\-statsperiod=\fR<seconds>
.IP
@ -483,6 +487,14 @@ Specify the number of seconds between periodic measurements (default:
\fB\-statsport=\fR<port>
.IP
Specify statsd port (default: 8125)
.HP
\fB\-statsprefix=\fR<string>
.IP
Specify an optional string prepended to every stats key (default: )
.HP
\fB\-statssuffix=\fR<string>
.IP
Specify an optional string appended to every stats key (default: )
.PP
Wallet options:
.HP
@ -831,6 +843,14 @@ Enable publish raw transaction (locked via InstantSend) and ISLOCK in
.IP
Set publish raw transaction lock signature outbound message high water
mark (default: 1000)
.HP
\fB\-zmqpubsequence=\fR<address>
.IP
Enable publish hash block and tx sequence in <address>
.HP
\fB\-zmqpubsequencehwm=\fR<n>
.IP
Set publish hash sequence message high water mark (default: 1000)
.PP
Debugging/Testing options:
.HP
@ -840,11 +860,12 @@ Output debugging information (default: \fB\-nodebug\fR, supplying <category> is
optional). If <category> is not supplied or if <category> = 1,
output all debugging information. <category> can be: addrman,
bench, chainlocks, cmpctblock, coindb, coinjoin, creditpool, ehf,
estimatefee, gobject, http, i2p, instantsend, leveldb, libevent,
llmq, llmq\-dkg, llmq\-sigs, lock, mempool, mempoolrej, mnpayments,
mnsync, net, netconn, proxy, prune, qt, rand, reindex, rpc,
selectcoins, spork, tor, validation, walletdb, zmq. This option
can be specified multiple times to output multiple categories.
estimatefee, gobject, http, i2p, instantsend, ipc, leveldb,
libevent, llmq, llmq\-dkg, llmq\-sigs, lock, mempool, mempoolrej,
mnpayments, mnsync, net, netconn, proxy, prune, qt, rand,
reindex, rpc, selectcoins, spork, tor, txreconciliation,
validation, walletdb, zmq. This option can be specified multiple
times to output multiple categories.
.HP
\fB\-debugexclude=\fR<category>
.IP

View File

@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASH-TX "1" "August 2024" "dash-tx v21.1.0" "User Commands"
.TH DASH-TX "1" "December 2024" "dash-tx v22.0.0" "User Commands"
.SH NAME
dash-tx \- manual page for dash-tx v21.1.0
dash-tx \- manual page for dash-tx v22.0.0
.SH SYNOPSIS
.B dash-tx
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded dash transaction\/\fR
@ -9,7 +9,7 @@ dash-tx \- manual page for dash-tx v21.1.0
.B dash-tx
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded dash transaction\/\fR
.SH DESCRIPTION
Dash Core dash\-tx utility version v21.1.0
Dash Core dash\-tx utility version v22.0.0
.SH OPTIONS
.HP
\-?
@ -32,6 +32,8 @@ Output only the hex\-encoded transaction id of the resultant transaction.
.IP
Print version and exit
.PP
Debugging/Testing options:
.PP
Chain selection options:
.HP
\fB\-chain=\fR<chain>

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASH-WALLET "1" "August 2024" "dash-wallet v21.1.0" "User Commands"
.TH DASH-WALLET "1" "December 2024" "dash-wallet v22.0.0" "User Commands"
.SH NAME
dash-wallet \- manual page for dash-wallet v21.1.0
dash-wallet \- manual page for dash-wallet v22.0.0
.SH DESCRIPTION
Dash Core dash\-wallet version v21.1.0
Dash Core dash\-wallet version v22.0.0
.PP
dash\-wallet is an offline tool for creating and interacting with Dash Core wallet files.
By default dash\-wallet will act on wallets in the default mainnet wallet directory in the datadir.

View File

@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASHD "1" "August 2024" "dashd v21.1.0" "User Commands"
.TH DASHD "1" "December 2024" "dashd v22.0.0" "User Commands"
.SH NAME
dashd \- manual page for dashd v21.1.0
dashd \- manual page for dashd v22.0.0
.SH SYNOPSIS
.B dashd
[\fI\,options\/\fR] \fI\,Start Dash Core\/\fR
.SH DESCRIPTION
Dash Core version v21.1.0
Dash Core version v22.0.0
Copyright \(co 2014\-2024 The Dash Core developers
Copyright \(co 2009\-2024 The Bitcoin Core developers
.PP
@ -33,9 +33,9 @@ message)
If this block is in the chain assume that it and its ancestors are valid
and potentially skip their script verification (0 to verify all,
default:
000000000000001889bd33ef019065e250d32bd46911f4003d3fdd8128b5358d,
000000000000001cf26547602d982dcaa909231bbcd1e70c0eb3c65de25473ba,
testnet:
00000034bfeb926662ba547c0b8dd4ba8cbb6e0c581f4e7d1bddce8f9ca3a608)
000000eef20eb0062abd4e799967e98bdebb165dd1c567ab4118c1c86c6e948f)
.HP
\fB\-blockfilterindex=\fR<type>
.IP
@ -150,12 +150,11 @@ Reduce storage requirements by enabling pruning (deleting) of old
blocks. This allows the pruneblockchain RPC to be called to
delete specific blocks, and enables automatic pruning of old
blocks if a target size in MiB is provided. This mode is
incompatible with \fB\-txindex\fR, \fB\-coinstatsindex\fR, \fB\-rescan\fR and
\fB\-disablegovernance\fR=\fI\,false\/\fR. Warning: Reverting this setting
requires re\-downloading the entire blockchain. (default: 0 =
disable pruning blocks, 1 = allow manual pruning via RPC, >945 =
automatically prune block files to stay under the specified
target size in MiB)
incompatible with \fB\-txindex\fR, \fB\-rescan\fR and \fB\-disablegovernance\fR=\fI\,false\/\fR.
Warning: Reverting this setting requires re\-downloading the
entire blockchain. (default: 0 = disable pruning blocks, 1 =
allow manual pruning via RPC, >945 = automatically prune block
files to stay under the specified target size in MiB)
.HP
\fB\-settings=\fR<file>
.IP
@ -287,7 +286,8 @@ Maximum per\-connection receive buffer, <n>*1000 bytes (default: 5000)
.HP
\fB\-maxsendbuffer=\fR<n>
.IP
Maximum per\-connection send buffer, <n>*1000 bytes (default: 1000)
Maximum per\-connection memory usage for the send buffer, <n>*1000 bytes
(default: 1000)
.HP
\fB\-maxtimeadjustment\fR
.IP
@ -297,9 +297,11 @@ amount. (default: 4200 seconds)
.HP
\fB\-maxuploadtarget=\fR<n>
.IP
Tries to keep outbound traffic under the given target (in MiB per 24h).
Limit does not apply to peers with 'download' permission. 0 = no
limit (default: 0)
Tries to keep outbound traffic under the given target per 24h. Limit
does not apply to peers with 'download' permission or blocks
created within past week. 0 = no limit (default: 0M). Optional
suffix units [k|K|m|M|g|G|t|T] (default: M). Lowercase is 1000
base while uppercase is 1024 base
.HP
\fB\-natpmp\fR
.IP
@ -389,6 +391,10 @@ Tor control port password (default: empty)
Use UPnP to map the listening port (default: 1 when listening and no
\fB\-proxy\fR)
.HP
\fB\-v2transport\fR
.IP
Support v2 transport (default: 0)
.HP
\fB\-whitebind=\fR<[permissions@]addr>
.IP
Bind to the given address and add permission flags to the peers
@ -420,13 +426,14 @@ unspent outputs for addresses (default: 0)
.HP
\fB\-reindex\fR
.IP
Rebuild chain state and block index from the blk*.dat files on disk
Rebuild chain state and block index from the blk*.dat files on disk.
This will also rebuild active optional indexes.
.HP
\fB\-reindex\-chainstate\fR
.IP
Rebuild chain state from the currently indexed blocks. When in pruning
mode or if blocks on disk might be corrupted, use full \fB\-reindex\fR
instead.
instead. Deactivate all optional indexes before running this.
.HP
\fB\-spentindex\fR
.IP
@ -445,6 +452,11 @@ call (default: 1)
.PP
Masternode options:
.HP
\fB\-deprecated\-platform\-user=\fR<user>
.IP
Set the username for the "platform user", a restricted user intended to
be used by Dash Platform, to the specified username.
.HP
\fB\-llmq\-data\-recovery=\fR<n>
.IP
Enable automated quorum data recovery (default: 1)
@ -461,29 +473,21 @@ defined by <quorum_name> if a member of any of the quorums)
.IP
Set the masternode BLS private key and enable the client to act as a
masternode
.HP
\fB\-platform\-user=\fR<user>
.IP
Set the username for the "platform user", a restricted user intended to
be used by Dash Platform, to the specified username.
.PP
Statsd options:
.HP
\fB\-statsenabled\fR
\fB\-statsbatchsize=\fR<bytes>
.IP
Publish internal stats to statsd (default: 0)
Specify the size of each batch of stats messages (default: 1024)
.HP
\fB\-statsduration=\fR<ms>
.IP
Specify the number of milliseconds between stats messages (default:
1000)
.HP
\fB\-statshost=\fR<ip>
.IP
Specify statsd host (default: 127.0.0.1)
.HP
\fB\-statshostname=\fR<ip>
.IP
Specify statsd host name (default: )
.HP
\fB\-statsns=\fR<ns>
.IP
Specify additional namespace prefix (default: )
Specify statsd host (default: )
.HP
\fB\-statsperiod=\fR<seconds>
.IP
@ -493,6 +497,14 @@ Specify the number of seconds between periodic measurements (default:
\fB\-statsport=\fR<port>
.IP
Specify statsd port (default: 8125)
.HP
\fB\-statsprefix=\fR<string>
.IP
Specify an optional string prepended to every stats key (default: )
.HP
\fB\-statssuffix=\fR<string>
.IP
Specify an optional string appended to every stats key (default: )
.PP
Wallet options:
.HP
@ -841,6 +853,14 @@ Enable publish raw transaction (locked via InstantSend) and ISLOCK in
.IP
Set publish raw transaction lock signature outbound message high water
mark (default: 1000)
.HP
\fB\-zmqpubsequence=\fR<address>
.IP
Enable publish hash block and tx sequence in <address>
.HP
\fB\-zmqpubsequencehwm=\fR<n>
.IP
Set publish hash sequence message high water mark (default: 1000)
.PP
Debugging/Testing options:
.HP
@ -850,11 +870,12 @@ Output debugging information (default: \fB\-nodebug\fR, supplying <category> is
optional). If <category> is not supplied or if <category> = 1,
output all debugging information. <category> can be: addrman,
bench, chainlocks, cmpctblock, coindb, coinjoin, creditpool, ehf,
estimatefee, gobject, http, i2p, instantsend, leveldb, libevent,
llmq, llmq\-dkg, llmq\-sigs, lock, mempool, mempoolrej, mnpayments,
mnsync, net, netconn, proxy, prune, qt, rand, reindex, rpc,
selectcoins, spork, tor, validation, walletdb, zmq. This option
can be specified multiple times to output multiple categories.
estimatefee, gobject, http, i2p, instantsend, ipc, leveldb,
libevent, llmq, llmq\-dkg, llmq\-sigs, lock, mempool, mempoolrej,
mnpayments, mnsync, net, netconn, proxy, prune, qt, rand,
reindex, rpc, selectcoins, spork, tor, txreconciliation,
validation, walletdb, zmq. This option can be specified multiple
times to output multiple categories.
.HP
\fB\-debugexclude=\fR<category>
.IP

View File

@ -1,4 +0,0 @@
Compatibility
==============
Dash Core change appearance when macOS "dark mode" is activated.

View File

@ -1,7 +0,0 @@
Updated RPCs
------------
- `getpeerinfo` no longer returns the following fields: `addnode`,
and `whitelisted`, which were previously deprecated in v21. Instead of
`addnode`, the `connection_type` field returns manual. Instead of
`whitelisted`, the `permissions` field indicates if the peer has special
privileges. (#20755)

View File

@ -1,6 +0,0 @@
## Command-line options
### Changes in existing cmd-line options:
- `-walletnotify=<cmd>` has a new format options "%h" and "%b".
%b is replaced by the hash of the block including the transaction (set to 'unconfirmed' if the transaction is not included).
%h is replaced by the block height (-1 if not included).

View File

@ -1,5 +0,0 @@
## RPC changes
- `getblockfrompeer`, introduced in v21.0.0, named argument `block_hash` has been
renamed `blockhash` to be aligned with the rest of the codebase. This is a breaking
change if using named parameters. (#6149)

View File

@ -1,4 +0,0 @@
New functionality
-----------
- A new RPC command, `coinjoinsalt`, allows for manipulating a CoinJoin salt stored in a wallet. `coinjoinsalt get` will fetch an existing salt, `coinjoinsalt set` will allow setting a custom salt and `coinjoinsalt generate` will set a random hash as the new salt.

View File

@ -1,4 +0,0 @@
RPC changes
-----------
- `coinjoin stop` will now return an error if there is no CoinJoin mixing session to stop

View File

@ -1,4 +0,0 @@
RPC changes
-----------
- `getcoinjoininfo` will no longer report `keys_left` and will not incorrectly warn about keypool depletion with descriptor wallets

View File

@ -1,12 +0,0 @@
P2P and Network Changes
-----------------------
### Improved Onion Connectivity
To enhance censorship resistance and mitigate network partitioning risks, Dash Core now aims to maintain at least two
outbound onion connections and generally protects these connections from eviction. As a result of the low percentage
of gossiped addresses being onion nodes, it was often the case where, unless you specify `onlynet=onion`, a node
would rarely if ever establish any outbound onion connections. This change ensures that nodes which can access the
onion network maintain a few onion connections. As a result, network messages could continue to propagate across
the network even if non-onion IPv4 traffic is blocked, reducing the risk of partitioning. Additionally, this update improves
security by enabling p2p encryption for these peers. (#6147)

View File

@ -1,6 +0,0 @@
P2P and Network Changes
-----------------------
The DSQ message, starting in protocol version 70234, is broadcast using the inventory system, and not simply
relaying to all connected peers. This should reduce the bandwidth needs for all nodes, however, this affect will
be most noticeable on highly connected masternodes. (#6148)

View File

@ -1,4 +0,0 @@
New functionality
-----------
- LLMQ type LLMQ_50_60 is enabled for Devnet networks. This is needed when testing on a large Devnet.

View File

@ -1,3 +0,0 @@
## Devnet Breaking Changes
`BRR` (`realloc`), `DIP0020`, `DIP0024`, `V19`, `V20` and `MN_R` hardforks are activated at block 2 instead of block 300 on devnets now. Please note that this is a breaking change so you will no longer be able to sync on devnets created with earlier Dash Core versions and vice versa.

View File

@ -1,6 +0,0 @@
Tests
-----
- For the `regtest` network the activation heights of several softforks were
set to block height 1. They can be changed by the runtime setting
`-testactivationheight=name@height`. (dash#6214)

View File

@ -1,3 +0,0 @@
## Command-line options
- `-platform-user` is deprecated in favor of the whitelist feature. In releases 22.x of Dash Core it has been renamed to `-deprecated-platform-user` and will be removed in version 23.x

View File

@ -1,4 +0,0 @@
RPC changes
-----------
- `creditOutputs` entries in various RPCs that output transaction JSON are shown as objects now instead of being shown as strings.

View File

@ -1,5 +0,0 @@
P2P and Network Changes
-----------------------
The max number of compressed block headers which can be requested at once has been increased from 2000 to 8000. This
change activates with the protocol version `70235` and only applies to compressed block headers.

View File

@ -1,3 +0,0 @@
### RPC changes
- Deprecated `protx *_hpmn` RPC entry points have been droppepd in favor of `protx *_evo`. The following have been removed: `protx register_fund_hpmn`, `protx register_hpmn`, `protx register_prepare_hpmn`, `protx update_service_hpmn`

View File

@ -1,25 +0,0 @@
Statistics
-----------
### New Features
- The Statsd client now supports queueing and batching messages, reducing the number of packets and the rate at which
they are sent to the Statsd daemon.
- The maximum size of each batch of messages (default, 1KiB) can be adjusted using `-statsbatchsize` (in bytes)
and the frequency at which queued messages are sent to the daemon (default, 1 second) can be adjusted using
`-statsduration` (in milliseconds)
- `-statsduration` has no bearing on `-statsperiod`, which dictates how frequently some stats are _collected_.
### Deprecations
- `-statsenabled` has been deprecated and enablement will now be implied by the presence of `-statshost`. `-statsenabled`
will be removed in a future release.
- `-statshostname` has been deprecated and replaced with `-statssuffix` as the latter is better representative of the
argument's purpose. They behave identically to each other. `-statshostname` will be removed in a future
release.
- `-statsns` has been deprecated and replaced with `-statsprefix` as the latter is better representative of the
argument's purpose. `-statsprefix`, unlike `-statsns`, will enforce the usage of a delimiter between the prefix
and key. `-statsns` will be removed in a future release.

View File

@ -1,8 +0,0 @@
# Notable changes
## Asset Unlock transactions (platform transfer)
This version introduces a new fork `withdrawals` that changes consensus rules.
New logic of validation of Asset Unlock transactions's signature. It let to use all 24 active quorums and the most recent inactive, while previous version of Dash Core may refuse withdrawal with error `bad-assetunlock-not-active-quorum` even if quorum is active.
Limits for withdrawals has been increased to flat 2000 Dash per 576 latest blocks.

View File

@ -1,4 +0,0 @@
P2P and Network Changes
-----------------------
`MIN_PEER_PROTO_VERSION` has been bumped to `70216`

View File

@ -1,6 +0,0 @@
Updated settings
----------------
- `-maxuploadtarget` now allows human readable byte units [k|K|m|M|g|G|t|T].
E.g. `-maxuploadtarget=500g`. No whitespace, +- or fractions allowed.
Default is `M` if no suffix provided.

View File

@ -1,5 +0,0 @@
RPC changes
-----------
- `quorum dkgsimerror` will no longer accept a decimal value between 0 and 1 for the `rate` argument, it will now
expect an integer between 0 to 100.

View File

@ -0,0 +1,4 @@
Tests
-----
- Command line arguments -dip8params, -bip147height are removed in favour of -testactivationheight. (dash#6325)

View File

@ -1,5 +0,0 @@
GUI changes
-----------
A new option has been added in to the "Main" tab in "Options" that allow
users to enable RPC server functionality.

View File

@ -1,8 +0,0 @@
P2P and network changes
------
- Nodes with multiple reachable networks will actively try to have at least one
outbound connection to each network. This improves individual resistance to
eclipse attacks and network level resistance to partition attacks. Users no
longer need to perform active measures to ensure being connected to multiple
enabled networks.

View File

@ -1,5 +0,0 @@
Compatibility
=============
The minimum required glibc to run Dash Core is now 2.31. This means that RHEL 8 and Ubuntu 18.04 (Bionic)
are no-longer supported.

View File

@ -1,8 +1,9 @@
# Dash Core version v21.1.1
# Dash Core version v22.0.0
This is a new patch version release, bringing important bugfixes.
This is a new major version release, bringing new features, various bugfixes
and other improvements.
This release is **optional** but recommended for all nodes.
This release is **mandatory** for all nodes, as it includes a hard fork.
Please report bugs using the issue tracker at GitHub:
@ -20,28 +21,200 @@ dashd/dash-qt (on Linux).
## Downgrade warning
### Downgrade to a version < v21.0.0
### Downgrade to a version < v22.0.0
Downgrading to a version older than v21.0.0 may not be supported due to changes
if you are using descriptor wallets.
Downgrading to a version older than v22.0.0 may not be supported, and will
likely require a reindex.
### Downgrade to a version < v19.2.0
# Release Notes
Downgrading to a version older than v19.2.0 is not supported due to changes
in the evodb database. If you need to use an older version, you must either
reindex or re-sync the whole chain.
## Notable Changes
# Notable changes
- **Asset Unlock Transactions (Platform Transfer)**
- Introduces a new fork, `withdrawals`, that changes consensus rules.
- **Validation Logic Update:**
- Allows using all **24 active quorums** and the most recent inactive quorum.
- Previous versions may refuse withdrawals with `bad-assetunlock-not-active-quorum` even if the quorum is active.
- **Withdrawal Limits Increased:**
- Flat **2000 Dash** per **576 latest blocks**. The previous limit was 1000 Dash.
- **Increased Minimum Protocol Version**
- The minimum protocol version has been increased to **70216**.
- Masternode minimum protocol version has increased to **70235**.
- Core now categorizes asset unlock transactions as "Platform Transfers" on the Transactions tab in Dash-Qt and in the output of the `gettransaction` RPC (#6131)
- Persist Coinjoin Denoms options changes made via GUI over restarts (#6208)
- Fix incorrect payment predictions for evonodes in Dash-Qt and in RPC `masternode winners` (#6222)
- `creditOutputs` entries in various RPCs that output transaction JSON are shown as objects now instead of being shown as strings (#6229)
- Updated PGP key for builder 'pasta' to reflect new subkeys. You may need to reimport this key to validate signatures. (#6290)
- Build failures on Ubuntu 24.10 / clang 19.1.1 resolved (#6328)
- RPC errors in `masternode payments`, `getblock`, `getblockstats` related to Asset Unlock parsing have been fixed (#6336)
## P2P and Network Changes
# v21.1.0 Change log
- **Improved Onion Connectivity**
- Nodes with onion connectivity will attempt to maintain at least **two outbound onion connections** and will protect these connections from eviction.
- **Benefit:** Ensures nodes capable of accessing the onion network maintain a few onion connections, allowing network messages to propagate even if non-onion IPv4 traffic is blocked.
- **Security Enhancement:** Enables P2P encryption for these peers.
- **DSQ Message Broadcast Update**
- Starting in protocol version **70234**, DSQ messages are broadcast using the inventory system instead of relaying to all connected peers.
- **Benefit:** Reduces bandwidth needs for all nodes, especially noticeable on highly connected masternodes.
- **Compressed Block Headers Request Limit**
- Starting in protocol version **70235**, the maximum number of compressed block headers that can be requested at once has been increased from **2000** to **8000**.
- **Applies to:** Compressed block headers only.
- **Benefit:** Potential for improved header sync performance.
- **Multi-Network Connectivity Enhancement**
- Nodes with multiple reachable networks will actively try to maintain at least one outbound connection to each network.
- **Benefits:**
- Improves resistance to eclipse attacks.
- Enhances network-level resistance to partition attacks.
- **User Impact:** Users no longer need to perform active measures to ensure connections to multiple enabled networks.
- **BIP324 Encrypted Communication (Experimental)**
- Dash Core now experimentally implements [BIP324](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki), introducing encrypted communication for P2P network traffic.
- **Opt-In Adoption**
- **Enable Encryption:** Users can opt-in to use BIP324 by adding `v2transport=1` to their Dash Core configuration.
- **Default Behavior:** Encryption is **disabled by default** as this is currently experimental.
- **Benefits**
- **Enhanced Privacy:** Encrypts P2P messages for v2 connections, reducing the risk of traffic analysis and eavesdropping.
- **Improved Security:** Protects against certain types of network attacks by ensuring that communication between nodes is confidential and tamper-proof.
- **Limitations and Considerations**
- **Compatibility:** Encrypted connections may only be established between nodes that have BIP324 enabled. Nodes without encryption support will continue to communicate over unencrypted channels.
- **Status and Future Plans**
- **Experimental Phase:** This feature is currently in an experimental phase. Users are encouraged to test and provide feedback to ensure stability.
- **Future Development:** BIP324 will likely be enabled by default in the next minor version, v22.1.0.
## Compatibility
- **Dark Mode Appearance**
- Dash Core changes appearance when macOS "dark mode" is activated.
- **glibc Requirement**
- The minimum required glibc to run Dash Core is now **2.31**. This means that **RHEL 8** and **Ubuntu 18.04 (Bionic)** are no longer supported.
## New RPCs
- **`quorum platformsign`**
- A new subcommand has been introduced, offering a structured way to perform platform-related quorum signing operations.
- **`coinjoinsalt`**
- Allows manipulation of a CoinJoin salt stored in a wallet.
- `coinjoinsalt get`: Fetches an existing salt.
- `coinjoinsalt set`: Allows setting a custom salt.
- `coinjoinsalt generate`: Sets a random hash as the new salt.
## Updated RPCs
- **`getpeerinfo` Changes**
- `getpeerinfo` no longer returns the following fields: `addnode` and `whitelisted`, which were previously deprecated in v21.
- Instead of `addnode`, the `connection_type` field returns `manual`.
- Instead of `whitelisted`, the `permissions` field indicates if the peer has special privileges.
- **`getblockfrompeer` Parameter Renaming**
- The named argument `block_hash` has been renamed to `blockhash` to align with the rest of the codebase.
- **Breaking Change:** If using named parameters, make sure to update them accordingly.
- **`coinjoin stop` Error Handling**
- `coinjoin stop` will now return an error if there is no CoinJoin mixing session to stop.
- **`getcoinjoininfo` Adjustments**
- `getcoinjoininfo` will no longer report `keys_left` and will not incorrectly warn about keypool depletion with descriptor wallets.
- **`creditOutputs` Format Change**
- `creditOutputs` entries in various RPCs that output transactions as JSON are now shown as objects instead of strings.
- **`quorum dkgsimerror` Argument Update**
- `quorum dkgsimerror` will no longer accept a decimal value between 0 and 1 for the `rate` argument.
- It will now expect an integer between **0** to **100**.
- **Deprecated `protx *_hpmn` RPC Endpoints**
- Deprecated `protx *_hpmn` RPC entry points have been dropped in favor of `protx *_evo`.
- **Removed Endpoints:**
- `protx register_fund_hpmn`
- `protx register_hpmn`
- `protx register_prepare_hpmn`
- `protx update_service_hpmn`
- **`governance` Descriptor Wallet Support**
- The `governance votemany` and `governance votealias` RPC commands now support descriptor-based wallets.
- **`createwallet` Behavior for Descriptor Wallets**
- When creating descriptor wallets, `createwallet` now requires explicitly setting `load_on_startup`.
## Command-line Options
### Changes in Existing Command-line Options
- **`-walletnotify=<cmd>` Enhancements**
- Introduces new format options `%h` and `%b`.
- `%b`: Replaced by the hash of the block including the transaction (set to `'unconfirmed'` if the transaction is not included).
- `%h`: Replaced by the block height (**-1** if not included).
- **`-maxuploadtarget` Format Update**
- Now allows human-readable byte units `[k|K|m|M|g|G|t|T]`.
- **Example:** `-maxuploadtarget=500g`.
- **Constraints:** No whitespace, `+`, `-`, or fractions allowed.
- **Default:** `M` if no suffix is provided.
## Devnet Breaking Changes
- **Hardfork Activation Changes**
- `BRR` (`realloc`), `DIP0020`, `DIP0024`, `V19`, `V20`, and `MN_R` hardforks are now activated at **block 2** instead of block **300** on devnets.
- **Implications:**
- Breaking change.
- Inability to sync on devnets created with earlier Dash Core versions and vice versa.
- **LLMQ Type Enhancement**
- **LLMQ_50_60** is enabled for **Devnet** networks.
- Necessary for testing on a large Devnet.
## Tests
- **Regtest Network Softfork Activation Heights**
- For the `regtest` network, the activation heights of several softforks have been set to **block height 1**.
- **Customization:** Can be changed using the runtime setting `-testactivationheight=name@height`.
- *(dash#6214)*
## Statistics
### New Features
- **Statsd Client Enhancements**
- Supports queueing and batching messages.
- **Benefits:**
- Reduces the number of packets.
- Lowers the rate at which messages are sent to the Statsd daemon.
- **Batch Configuration Options**
- **Maximum Batch Size:**
- Adjustable using `-statsbatchsize` (in bytes).
- **Default:** **1KiB**.
- **Batch Send Frequency:**
- Adjustable using `-statsduration` (in milliseconds).
- **Default:** **1 second**.
- **Note:** `-statsduration` does not affect `-statsperiod`, which dictates how frequently some stats are *collected*.
### Deprecations
- **Deprecation of `-platform-user`**
- `-platform-user` is deprecated in favor of the whitelist feature.
- In releases **22.x** of Dash Core, it has been renamed to `-deprecated-platform-user`.
- It will be removed in version **23.x**.
- **`-statsenabled` Deprecation**
- Now implied by the presence of `-statshost`.
- It will be removed in version **23.x**.
- **`-statshostname` Replacement**
- Deprecated and replaced with `-statssuffix` for better representation of the argument's purpose.
- **Behavior:** Behave identically to each other.
- It will be removed in version **23.x**.
- **`-statsns` Replacement**
- Deprecated and replaced with `-statsprefix` for better representation of the argument's purpose.
- **Behavior:** `-statsprefix` enforces the usage of a delimiter between the prefix and key.
- It will be removed in version **23.x**.
## GUI Changes
- **RPC Server Functionality Option**
- A new option has been added to the "Main" tab in "Options" that allows users to enable RPC server functionality.
# v22.0.0 Change log
See detailed [set of changes][set-of-changes].
@ -49,18 +222,22 @@ See detailed [set of changes][set-of-changes].
Thanks to everyone who directly contributed to this release:
- AJ ONeal
- Kittywhiskers Van Gogh
- Konstantin Akimov
- Odysseas Gabrielides
- PastaPastaPasta
- UdjinM6
- Vijaydasmp
As well as everyone that submitted issues, reviewed pull requests and helped
debug the release candidates.
# Older releases
These release are considered obsolete. Old release notes can be found here:
These releases are considered obsolete. Old release notes can be found here:
- [v21.1.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.1.1.md) released Oct/22/2024
- [v21.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.1.0.md) released Aug/8/2024
- [v21.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.0.2.md) released Aug/1/2024
- [v21.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.0.0.md) released Jul/25/2024
@ -113,4 +290,4 @@ These release are considered obsolete. Old release notes can be found here:
- [v0.10.x](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.10.0.md) released Sep/25/2014
- [v0.9.x](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.9.0.md) released Mar/13/2014
[set-of-changes]: https://github.com/dashpay/dash/compare/v21.1.0...dashpay:v21.1.1
[set-of-changes]: https://github.com/dashpay/dash/compare/v21.1.1...dashpay:v22.0.0

View File

@ -0,0 +1,116 @@
# Dash Core version v21.1.1
This is a new patch version release, bringing important bugfixes.
This release is **optional** but recommended for all nodes.
Please report bugs using the issue tracker at GitHub:
<https://github.com/dashpay/dash/issues>
# Upgrading and downgrading
## How to Upgrade
If you are running an older version, shut it down. Wait until it has completely
shut down (which might take a few minutes for older versions), then run the
installer (on Windows) or just copy over /Applications/Dash-Qt (on Mac) or
dashd/dash-qt (on Linux).
## Downgrade warning
### Downgrade to a version < v21.0.0
Downgrading to a version older than v21.0.0 may not be supported due to changes
if you are using descriptor wallets.
### Downgrade to a version < v19.2.0
Downgrading to a version older than v19.2.0 is not supported due to changes
in the evodb database. If you need to use an older version, you must either
reindex or re-sync the whole chain.
# Notable changes
- Core now categorizes asset unlock transactions as "Platform Transfers" on the Transactions tab in Dash-Qt and in the output of the `gettransaction` RPC (#6131)
- Persist Coinjoin Denoms options changes made via GUI over restarts (#6208)
- Fix incorrect payment predictions for evonodes in Dash-Qt and in RPC `masternode winners` (#6222)
- `creditOutputs` entries in various RPCs that output transaction JSON are shown as objects now instead of being shown as strings (#6229)
- Updated PGP key for builder 'pasta' to reflect new subkeys. You may need to reimport this key to validate signatures. (#6290)
- Build failures on Ubuntu 24.10 / clang 19.1.1 resolved (#6328)
- RPC errors in `masternode payments`, `getblock`, `getblockstats` related to Asset Unlock parsing have been fixed (#6336)
# v21.1.0 Change log
See detailed [set of changes][set-of-changes].
# Credits
Thanks to everyone who directly contributed to this release:
- Kittywhiskers Van Gogh
- Konstantin Akimov
- PastaPastaPasta
- UdjinM6
As well as everyone that submitted issues, reviewed pull requests and helped
debug the release candidates.
# Older releases
These release are considered obsolete. Old release notes can be found here:
- [v21.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.1.0.md) released Aug/8/2024
- [v21.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.0.2.md) released Aug/1/2024
- [v21.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.0.0.md) released Jul/25/2024
- [v20.1.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.1.1.md) released April/3/2024
- [v20.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.1.0.md) released March/5/2024
- [v20.0.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.4.md) released Jan/13/2024
- [v20.0.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.3.md) released December/26/2023
- [v20.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.2.md) released December/06/2023
- [v20.0.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.1.md) released November/18/2023
- [v20.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.0.md) released November/15/2023
- [v19.3.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-19.3.0.md) released July/31/2023
- [v19.2.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-19.2.0.md) released June/19/2023
- [v19.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-19.1.0.md) released May/22/2023
- [v19.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-19.0.0.md) released Apr/14/2023
- [v18.2.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.2.2.md) released Mar/21/2023
- [v18.2.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.2.1.md) released Jan/17/2023
- [v18.2.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.2.0.md) released Jan/01/2023
- [v18.1.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.1.1.md) released January/08/2023
- [v18.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.1.0.md) released October/09/2022
- [v18.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.0.2.md) released October/09/2022
- [v18.0.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.0.1.md) released August/17/2022
- [v0.17.0.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.17.0.3.md) released June/07/2021
- [v0.17.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.17.0.2.md) released May/19/2021
- [v0.16.1.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.16.1.1.md) released November/17/2020
- [v0.16.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.16.1.0.md) released November/14/2020
- [v0.16.0.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.16.0.1.md) released September/30/2020
- [v0.15.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.15.0.0.md) released Febrary/18/2020
- [v0.14.0.5](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.5.md) released December/08/2019
- [v0.14.0.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.4.md) released November/22/2019
- [v0.14.0.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.3.md) released August/15/2019
- [v0.14.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.2.md) released July/4/2019
- [v0.14.0.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.1.md) released May/31/2019
- [v0.14.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.md) released May/22/2019
- [v0.13.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.3.md) released Apr/04/2019
- [v0.13.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.2.md) released Mar/15/2019
- [v0.13.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.1.md) released Feb/9/2019
- [v0.13.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.0.md) released Jan/14/2019
- [v0.12.3.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.4.md) released Dec/14/2018
- [v0.12.3.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.3.md) released Sep/19/2018
- [v0.12.3.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.2.md) released Jul/09/2018
- [v0.12.3.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.1.md) released Jul/03/2018
- [v0.12.2.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.2.3.md) released Jan/12/2018
- [v0.12.2.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.2.2.md) released Dec/17/2017
- [v0.12.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.2.md) released Nov/08/2017
- [v0.12.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.1.md) released Feb/06/2017
- [v0.12.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.0.md) released Aug/15/2015
- [v0.11.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.11.2.md) released Mar/04/2015
- [v0.11.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.11.1.md) released Feb/10/2015
- [v0.11.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.11.0.md) released Jan/15/2015
- [v0.10.x](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.10.0.md) released Sep/25/2014
- [v0.9.x](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.9.0.md) released Mar/13/2014
[set-of-changes]: https://github.com/dashpay/dash/compare/v21.1.0...dashpay:v21.1.1

View File

@ -9,9 +9,10 @@ print-%: FORCE
DIST_SUBDIRS = secp256k1
AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS)
AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS)
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS)
AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS) $(CORE_LDFLAGS)
AM_CFLAGS = $(DEBUG_CFLAGS)
AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS) $(CORE_CXXFLAGS)
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS) $(CORE_CPPFLAGS)
AM_LIBTOOLFLAGS = --preserve-dup-deps
PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
EXTRA_LIBRARIES =
@ -162,9 +163,9 @@ BITCOIN_CORE_H = \
coinjoin/util.h \
coins.h \
common/bloom.h \
compat.h \
compat/assumptions.h \
compat/byteswap.h \
compat/compat.h \
compat/cpuid.h \
compat/endian.h \
compressor.h \
@ -269,6 +270,8 @@ BITCOIN_CORE_H = \
netgroup.h \
netmessagemaker.h \
node/blockstorage.h \
node/caches.h \
node/chainstate.h \
node/coin.h \
node/coinstats.h \
node/connection_types.h \
@ -279,7 +282,7 @@ BITCOIN_CORE_H = \
node/psbt.h \
node/transaction.h \
node/txreconciliation.h \
node/ui_interface.h \
node/interface_ui.h \
node/utxo_snapshot.h \
noui.h \
outputtype.h \
@ -501,6 +504,8 @@ libbitcoin_server_a_SOURCES = \
netgroup.cpp \
net_processing.cpp \
node/blockstorage.cpp \
node/caches.cpp \
node/chainstate.cpp \
node/coin.cpp \
node/coinstats.cpp \
node/connection_types.cpp \
@ -512,7 +517,7 @@ libbitcoin_server_a_SOURCES = \
node/psbt.cpp \
node/transaction.cpp \
node/txreconciliation.cpp \
node/ui_interface.cpp \
node/interface_ui.cpp \
noui.cpp \
policy/fees.cpp \
policy/packages.cpp \
@ -792,7 +797,6 @@ libbitcoin_util_a_SOURCES = \
support/lockedpool.cpp \
chainparamsbase.cpp \
clientversion.cpp \
compat/strnlen.cpp \
fs.cpp \
interfaces/echo.cpp \
interfaces/handler.cpp \

View File

@ -188,11 +188,11 @@ std::optional<bilingual_str> LoadAddrman(const NetGroupManager& netgroupman, con
auto check_addrman = std::clamp<int32_t>(args.GetArg("-checkaddrman", DEFAULT_ADDRMAN_CONSISTENCY_CHECKS), 0, 1000000);
addrman = std::make_unique<AddrMan>(netgroupman, /*deterministic=*/false, /*consistency_check_ratio=*/check_addrman);
int64_t nStart = GetTimeMillis();
const auto start{SteadyClock::now()};
const auto path_addr{gArgs.GetDataDirNet() / "peers.dat"};
try {
DeserializeFileDB(path_addr, *addrman, CLIENT_VERSION);
LogPrintf("Loaded %i addresses from peers.dat %dms\n", addrman->Size(), GetTimeMillis() - nStart);
LogPrintf("Loaded %i addresses from peers.dat %dms\n", addrman->Size(), Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
} catch (const DbNotFoundError&) {
// Addrman can be in an inconsistent state after failure, reset it
addrman = std::make_unique<AddrMan>(netgroupman, /*deterministic=*/false, /*consistency_check_ratio=*/check_addrman);

View File

@ -14,10 +14,10 @@
#include <random.h>
#include <serialize.h>
#include <streams.h>
#include <timedata.h>
#include <tinyformat.h>
#include <uint256.h>
#include <util/check.h>
#include <util/time.h>
#include <cmath>
#include <optional>
@ -29,19 +29,19 @@ static constexpr uint32_t ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP{64};
/** Maximum number of times an address can occur in the new table */
static constexpr int32_t ADDRMAN_NEW_BUCKETS_PER_ADDRESS{8};
/** How old addresses can maximally be */
static constexpr int64_t ADDRMAN_HORIZON_DAYS{30};
static constexpr auto ADDRMAN_HORIZON{30 * 24h};
/** After how many failed attempts we give up on a new node */
static constexpr int32_t ADDRMAN_RETRIES{3};
/** How many successive failures are allowed ... */
static constexpr int32_t ADDRMAN_MAX_FAILURES{10};
/** ... in at least this many days */
static constexpr int64_t ADDRMAN_MIN_FAIL_DAYS{7};
/** ... in at least this duration */
static constexpr auto ADDRMAN_MIN_FAIL{7 * 24h};
/** How recent a successful connection should be before we allow an address to be evicted from tried */
static constexpr int64_t ADDRMAN_REPLACEMENT_HOURS{4};
static constexpr auto ADDRMAN_REPLACEMENT{4h};
/** The maximum number of tried addr collisions to store */
static constexpr size_t ADDRMAN_SET_TRIED_COLLISION_SIZE{10};
/** The maximum time we'll spend trying to resolve a tried table collision, in seconds */
static constexpr int64_t ADDRMAN_TEST_WINDOW{40*60}; // 40 minutes
/** The maximum time we'll spend trying to resolve a tried table collision */
static constexpr auto ADDRMAN_TEST_WINDOW{40min};
int AddrInfo::GetTriedBucket(const uint256& nKey, const NetGroupManager& netgroupman) const
{
@ -64,36 +64,39 @@ int AddrInfo::GetBucketPosition(const uint256& nKey, bool fNew, int bucket) cons
return hash1 % ADDRMAN_BUCKET_SIZE;
}
bool AddrInfo::IsTerrible(int64_t nNow) const
bool AddrInfo::IsTerrible(NodeSeconds now) const
{
if (nNow - nLastTry <= 60) { // never remove things tried in the last minute
if (now - m_last_try <= 1min) { // never remove things tried in the last minute
return false;
}
if (nTime > nNow + 10 * 60) // came in a flying DeLorean
return true;
if (nNow - nTime > ADDRMAN_HORIZON_DAYS * 24 * 60 * 60) { // not seen in recent history
if (nTime > now + 10min) { // came in a flying DeLorean
return true;
}
if (nLastSuccess == 0 && nAttempts >= ADDRMAN_RETRIES) // tried N times and never a success
if (now - nTime > ADDRMAN_HORIZON) { // not seen in recent history
return true;
}
if (nNow - nLastSuccess > ADDRMAN_MIN_FAIL_DAYS * 24 * 60 * 60 && nAttempts >= ADDRMAN_MAX_FAILURES) // N successive failures in the last week
if (TicksSinceEpoch<std::chrono::seconds>(m_last_success) == 0 && nAttempts >= ADDRMAN_RETRIES) { // tried N times and never a success
return true;
}
if (now - m_last_success > ADDRMAN_MIN_FAIL && nAttempts >= ADDRMAN_MAX_FAILURES) { // N successive failures in the last week
return true;
}
return false;
}
double AddrInfo::GetChance(int64_t nNow) const
double AddrInfo::GetChance(NodeSeconds now) const
{
double fChance = 1.0;
int64_t nSinceLastTry = std::max<int64_t>(nNow - nLastTry, 0);
// deprioritize very recent attempts away
if (nSinceLastTry < 60 * 10)
if (now - m_last_try < 10min) {
fChance *= 0.01;
}
// deprioritize 66% after each failed attempt, but at most 1/28th to avoid the search taking forever or overly penalizing outages.
fChance *= pow(0.66, std::min(nAttempts, 8));
@ -547,7 +550,7 @@ void AddrManImpl::MakeTried(AddrInfo& info, int nId)
m_network_counts[info.GetNetwork()].n_tried++;
}
bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty)
bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, std::chrono::seconds time_penalty)
{
AssertLockHeld(cs);
@ -559,15 +562,15 @@ bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, int64_
// Do not set a penalty for a source's self-announcement
if (addr == source) {
nTimePenalty = 0;
time_penalty = 0s;
}
if (pinfo) {
// periodically update nTime
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);
int64_t nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60);
if (pinfo->nTime < addr.nTime - nUpdateInterval - nTimePenalty) {
pinfo->nTime = std::max((int64_t)0, addr.nTime - nTimePenalty);
const bool currently_online{NodeClock::now() - addr.nTime < 24h};
const auto update_interval{currently_online ? 1h : 24h};
if (pinfo->nTime < addr.nTime - update_interval - time_penalty) {
pinfo->nTime = std::max(NodeSeconds{0s}, addr.nTime - time_penalty);
}
// add services
@ -593,7 +596,7 @@ bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, int64_
}
} else {
pinfo = Create(addr, source, &nId);
pinfo->nTime = std::max((int64_t)0, (int64_t)pinfo->nTime - nTimePenalty);
pinfo->nTime = std::max(NodeSeconds{0s}, pinfo->nTime - time_penalty);
}
int nUBucket = pinfo->GetNewBucket(nKey, source, m_netgroupman);
@ -622,13 +625,13 @@ bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, int64_
return fInsert;
}
bool AddrManImpl::Good_(const CService& addr, bool test_before_evict, int64_t nTime)
bool AddrManImpl::Good_(const CService& addr, bool test_before_evict, NodeSeconds time)
{
AssertLockHeld(cs);
int nId;
nLastGood = nTime;
m_last_good = time;
AddrInfo* pinfo = Find(addr, &nId);
@ -638,8 +641,8 @@ bool AddrManImpl::Good_(const CService& addr, bool test_before_evict, int64_t nT
AddrInfo& info = *pinfo;
// update info
info.nLastSuccess = nTime;
info.nLastTry = nTime;
info.m_last_success = time;
info.m_last_try = time;
info.nAttempts = 0;
// nTime is not updated here, to avoid leaking information about
// currently-connected peers.
@ -680,11 +683,11 @@ bool AddrManImpl::Good_(const CService& addr, bool test_before_evict, int64_t nT
}
}
bool AddrManImpl::Add_(const std::vector<CAddress> &vAddr, const CNetAddr& source, int64_t nTimePenalty)
bool AddrManImpl::Add_(const std::vector<CAddress>& vAddr, const CNetAddr& source, std::chrono::seconds time_penalty)
{
int added{0};
for (std::vector<CAddress>::const_iterator it = vAddr.begin(); it != vAddr.end(); it++) {
added += AddSingle(*it, source, nTimePenalty) ? 1 : 0;
added += AddSingle(*it, source, time_penalty) ? 1 : 0;
}
if (added > 0) {
LogPrint(BCLog::ADDRMAN, "Added %i addresses (of %i) from %s: %i tried, %i new\n", added, vAddr.size(), source.ToStringAddr(), nTried, nNew);
@ -692,7 +695,7 @@ bool AddrManImpl::Add_(const std::vector<CAddress> &vAddr, const CNetAddr& sourc
return added > 0;
}
void AddrManImpl::Attempt_(const CService& addr, bool fCountFailure, int64_t nTime)
void AddrManImpl::Attempt_(const CService& addr, bool fCountFailure, NodeSeconds time)
{
AssertLockHeld(cs);
@ -705,14 +708,14 @@ void AddrManImpl::Attempt_(const CService& addr, bool fCountFailure, int64_t nTi
AddrInfo& info = *pinfo;
// update info
info.nLastTry = nTime;
if (fCountFailure && info.nLastCountAttempt < nLastGood) {
info.nLastCountAttempt = nTime;
info.m_last_try = time;
if (fCountFailure && info.m_last_count_attempt < m_last_good) {
info.m_last_count_attempt = time;
info.nAttempts++;
}
}
std::pair<CAddress, int64_t> AddrManImpl::Select_(bool new_only, std::optional<Network> network) const
std::pair<CAddress, NodeSeconds> AddrManImpl::Select_(bool new_only, std::optional<Network> network) const
{
AssertLockHeld(cs);
@ -780,7 +783,7 @@ std::pair<CAddress, int64_t> AddrManImpl::Select_(bool new_only, std::optional<N
// With probability GetChance() * chance_factor, return the entry.
if (insecure_rand.randbits(30) < chance_factor * info.GetChance() * (1 << 30)) {
LogPrint(BCLog::ADDRMAN, "Selected %s from %s\n", info.ToStringAddrPort(), search_tried ? "tried" : "new");
return {info, info.nLastTry};
return {info, info.m_last_try};
}
// Otherwise start over with a (likely) different bucket, and increased chance factor.
@ -818,7 +821,7 @@ std::vector<CAddress> AddrManImpl::GetAddr_(size_t max_addresses, size_t max_pct
}
// gather a list of random nodes, skipping those of low quality
const int64_t now{GetAdjustedTime()};
const auto now{Now<NodeSeconds>()};
std::vector<CAddress> addresses;
for (unsigned int n = 0; n < vRandom.size(); n++) {
if (addresses.size() >= nNodes)
@ -843,7 +846,7 @@ std::vector<CAddress> AddrManImpl::GetAddr_(size_t max_addresses, size_t max_pct
return addresses;
}
void AddrManImpl::Connected_(const CService& addr, int64_t nTime)
void AddrManImpl::Connected_(const CService& addr, NodeSeconds time)
{
AssertLockHeld(cs);
@ -856,9 +859,10 @@ void AddrManImpl::Connected_(const CService& addr, int64_t nTime)
AddrInfo& info = *pinfo;
// update info
int64_t nUpdateInterval = 20 * 60;
if (nTime - info.nTime > nUpdateInterval)
info.nTime = nTime;
const auto update_interval{20min};
if (time - info.nTime > update_interval) {
info.nTime = time;
}
}
void AddrManImpl::SetServices_(const CService& addr, ServiceFlags nServices)
@ -914,22 +918,22 @@ void AddrManImpl::ResolveCollisions_()
int id_old = vvTried[tried_bucket][tried_bucket_pos];
AddrInfo& info_old = mapInfo[id_old];
const auto current_time{GetAdjustedTime()};
const auto current_time{Now<NodeSeconds>()};
// Has successfully connected in last X hours
if (current_time - info_old.nLastSuccess < ADDRMAN_REPLACEMENT_HOURS*(60*60)) {
if (current_time - info_old.m_last_success < ADDRMAN_REPLACEMENT) {
erase_collision = true;
} else if (current_time - info_old.nLastTry < ADDRMAN_REPLACEMENT_HOURS*(60*60)) { // attempted to connect and failed in last X hours
} else if (current_time - info_old.m_last_try < ADDRMAN_REPLACEMENT) { // attempted to connect and failed in last X hours
// Give address at least 60 seconds to successfully connect
if (current_time - info_old.nLastTry > 60) {
if (current_time - info_old.m_last_try > 60s) {
LogPrint(BCLog::ADDRMAN, "Replacing %s with %s in tried table\n", info_old.ToStringAddrPort(), info_new.ToStringAddrPort());
// Replaces an existing address already in the tried table with the new address
Good_(info_new, false, current_time);
erase_collision = true;
}
} else if (current_time - info_new.nLastSuccess > ADDRMAN_TEST_WINDOW) {
} else if (current_time - info_new.m_last_success > ADDRMAN_TEST_WINDOW) {
// If the collision hasn't resolved in some reasonable amount of time,
// just evict the old entry -- we must not be able to
// connect to it for some reason.
@ -938,7 +942,7 @@ void AddrManImpl::ResolveCollisions_()
erase_collision = true;
}
} else { // Collision is not actually a collision anymore
Good_(info_new, false, GetAdjustedTime());
Good_(info_new, false, Now<NodeSeconds>());
erase_collision = true;
}
}
@ -951,7 +955,7 @@ void AddrManImpl::ResolveCollisions_()
}
}
std::pair<CAddress, int64_t> AddrManImpl::SelectTriedCollision_()
std::pair<CAddress, NodeSeconds> AddrManImpl::SelectTriedCollision_()
{
AssertLockHeld(cs);
@ -976,7 +980,7 @@ std::pair<CAddress, int64_t> AddrManImpl::SelectTriedCollision_()
int tried_bucket_pos = newInfo.GetBucketPosition(nKey, false, tried_bucket);
const AddrInfo& info_old = mapInfo[vvTried[tried_bucket][tried_bucket_pos]];
return {info_old, info_old.nLastTry};
return {info_old, info_old.m_last_try};
}
std::optional<AddressPosition> AddrManImpl::FindAddressEntry_(const CAddress& addr)
@ -1057,8 +1061,9 @@ int AddrManImpl::CheckAddrman() const
int n = entry.first;
const AddrInfo& info = entry.second;
if (info.fInTried) {
if (!info.nLastSuccess)
if (!TicksSinceEpoch<std::chrono::seconds>(info.m_last_success)) {
return -1;
}
if (info.nRefCount)
return -2;
setTried.insert(n);
@ -1077,10 +1082,12 @@ int AddrManImpl::CheckAddrman() const
}
if (info.nRandomPos < 0 || (size_t)info.nRandomPos >= vRandom.size() || vRandom[info.nRandomPos] != n)
return -14;
if (info.nLastTry < 0)
if (info.m_last_try < NodeSeconds{0s}) {
return -6;
if (info.nLastSuccess < 0)
}
if (info.m_last_success < NodeSeconds{0s}) {
return -8;
}
}
if (setTried.size() != (size_t)nTried)
@ -1150,29 +1157,29 @@ size_t AddrManImpl::Size(std::optional<Network> net, std::optional<bool> in_new)
return ret;
}
bool AddrManImpl::Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, int64_t nTimePenalty)
bool AddrManImpl::Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, std::chrono::seconds time_penalty)
{
LOCK(cs);
Check();
auto ret = Add_(vAddr, source, nTimePenalty);
auto ret = Add_(vAddr, source, time_penalty);
Check();
return ret;
}
bool AddrManImpl::Good(const CService& addr, int64_t nTime)
bool AddrManImpl::Good(const CService& addr, NodeSeconds time)
{
LOCK(cs);
Check();
auto ret = Good_(addr, /*test_before_evict=*/true, nTime);
auto ret = Good_(addr, /*test_before_evict=*/true, time);
Check();
return ret;
}
void AddrManImpl::Attempt(const CService& addr, bool fCountFailure, int64_t nTime)
void AddrManImpl::Attempt(const CService& addr, bool fCountFailure, NodeSeconds time)
{
LOCK(cs);
Check();
Attempt_(addr, fCountFailure, nTime);
Attempt_(addr, fCountFailure, time);
Check();
}
@ -1184,7 +1191,7 @@ void AddrManImpl::ResolveCollisions()
Check();
}
std::pair<CAddress, int64_t> AddrManImpl::SelectTriedCollision()
std::pair<CAddress, NodeSeconds> AddrManImpl::SelectTriedCollision()
{
LOCK(cs);
Check();
@ -1193,7 +1200,7 @@ std::pair<CAddress, int64_t> AddrManImpl::SelectTriedCollision()
return ret;
}
std::pair<CAddress, int64_t> AddrManImpl::Select(bool new_only, std::optional<Network> network) const
std::pair<CAddress, NodeSeconds> AddrManImpl::Select(bool new_only, std::optional<Network> network) const
{
LOCK(cs);
Check();
@ -1211,11 +1218,11 @@ std::vector<CAddress> AddrManImpl::GetAddr(size_t max_addresses, size_t max_pct,
return addresses;
}
void AddrManImpl::Connected(const CService& addr, int64_t nTime)
void AddrManImpl::Connected(const CService& addr, NodeSeconds time)
{
LOCK(cs);
Check();
Connected_(addr, nTime);
Connected_(addr, time);
Check();
}
@ -1278,19 +1285,19 @@ size_t AddrMan::Size(std::optional<Network> net, std::optional<bool> in_new) con
return m_impl->Size(net, in_new);
}
bool AddrMan::Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, int64_t nTimePenalty)
bool AddrMan::Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, std::chrono::seconds time_penalty)
{
return m_impl->Add(vAddr, source, nTimePenalty);
return m_impl->Add(vAddr, source, time_penalty);
}
bool AddrMan::Good(const CService& addr, int64_t nTime)
bool AddrMan::Good(const CService& addr, NodeSeconds time)
{
return m_impl->Good(addr, nTime);
return m_impl->Good(addr, time);
}
void AddrMan::Attempt(const CService& addr, bool fCountFailure, int64_t nTime)
void AddrMan::Attempt(const CService& addr, bool fCountFailure, NodeSeconds time)
{
m_impl->Attempt(addr, fCountFailure, nTime);
m_impl->Attempt(addr, fCountFailure, time);
}
void AddrMan::ResolveCollisions()
@ -1298,12 +1305,12 @@ void AddrMan::ResolveCollisions()
m_impl->ResolveCollisions();
}
std::pair<CAddress, int64_t> AddrMan::SelectTriedCollision()
std::pair<CAddress, NodeSeconds> AddrMan::SelectTriedCollision()
{
return m_impl->SelectTriedCollision();
}
std::pair<CAddress, int64_t> AddrMan::Select(bool new_only, std::optional<Network> network) const
std::pair<CAddress, NodeSeconds> AddrMan::Select(bool new_only, std::optional<Network> network) const
{
return m_impl->Select(new_only, network);
}
@ -1313,9 +1320,9 @@ std::vector<CAddress> AddrMan::GetAddr(size_t max_addresses, size_t max_pct, std
return m_impl->GetAddr(max_addresses, max_pct, network);
}
void AddrMan::Connected(const CService& addr, int64_t nTime)
void AddrMan::Connected(const CService& addr, NodeSeconds time)
{
m_impl->Connected(addr, nTime);
m_impl->Connected(addr, time);
}
void AddrMan::SetServices(const CService& addr, ServiceFlags nServices)

View File

@ -10,7 +10,7 @@
#include <netgroup.h>
#include <protocol.h>
#include <streams.h>
#include <timedata.h>
#include <util/time.h>
#include <cstdint>
#include <memory>
@ -124,23 +124,23 @@ public:
*
* @param[in] vAddr Address records to attempt to add.
* @param[in] source The address of the node that sent us these addr records.
* @param[in] nTimePenalty A "time penalty" to apply to the address record's nTime. If a peer
* @param[in] time_penalty A "time penalty" to apply to the address record's nTime. If a peer
* sends us an address record with nTime=n, then we'll add it to our
* addrman with nTime=(n - nTimePenalty).
* addrman with nTime=(n - time_penalty).
* @return true if at least one address is successfully added. */
bool Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, int64_t nTimePenalty = 0);
bool Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, std::chrono::seconds time_penalty = 0s);
/**
* Mark an address record as accessible and attempt to move it to addrman's tried table.
*
* @param[in] addr Address record to attempt to move to tried table.
* @param[in] nTime The time that we were last connected to this peer.
* @param[in] time The time that we were last connected to this peer.
* @return true if the address is successfully moved from the new table to the tried table.
*/
bool Good(const CService& addr, int64_t nTime = GetAdjustedTime());
bool Good(const CService& addr, NodeSeconds time = Now<NodeSeconds>());
//! Mark an entry as connection attempted to.
void Attempt(const CService& addr, bool fCountFailure, int64_t nTime = GetAdjustedTime());
void Attempt(const CService& addr, bool fCountFailure, NodeSeconds time = Now<NodeSeconds>());
//! See if any to-be-evicted tried table entries have been tested and if so resolve the collisions.
void ResolveCollisions();
@ -150,9 +150,9 @@ public:
* attempting to evict.
*
* @return CAddress The record for the selected tried peer.
* int64_t The last time we attempted to connect to that peer.
* seconds The last time we attempted to connect to that peer.
*/
std::pair<CAddress, int64_t> SelectTriedCollision();
std::pair<CAddress, NodeSeconds> SelectTriedCollision();
/**
* Choose an address to connect to.
@ -164,9 +164,9 @@ public:
* @param[in] network Select only addresses of this network (nullopt = all). Passing a network may
* slow down the search.
* @return CAddress The record for the selected peer.
* int64_t The last time we attempted to connect to that peer.
* seconds The last time we attempted to connect to that peer.
*/
std::pair<CAddress, int64_t> Select(bool new_only = false, std::optional<Network> network = std::nullopt) const;
std::pair<CAddress, NodeSeconds> Select(bool new_only = false, std::optional<Network> network = std::nullopt) const;
/**
* Return all or many randomly selected addresses, optionally by network.
@ -188,9 +188,9 @@ public:
* not leak information about currently connected peers.
*
* @param[in] addr The address of the peer we were connected to
* @param[in] nTime The time that we were last connected to this peer
* @param[in] time The time that we were last connected to this peer
*/
void Connected(const CService& addr, int64_t nTime = GetAdjustedTime());
void Connected(const CService& addr, NodeSeconds time = Now<NodeSeconds>());
//! Update an entry's service bits.
void SetServices(const CService& addr, ServiceFlags nServices);

View File

@ -11,7 +11,9 @@
#include <protocol.h>
#include <serialize.h>
#include <sync.h>
#include <timedata.h>
#include <uint256.h>
#include <util/time.h>
#include <cstdint>
#include <optional>
@ -38,16 +40,16 @@ class AddrInfo : public CAddress
{
public:
//! last try whatsoever by us (memory only)
int64_t nLastTry{0};
NodeSeconds m_last_try{0s};
//! last counted attempt (memory only)
int64_t nLastCountAttempt{0};
NodeSeconds m_last_count_attempt{0s};
//! where knowledge about this address first came from
CNetAddr source;
//! last successful connection by us
int64_t nLastSuccess{0};
NodeSeconds m_last_success{0s};
//! connection attempts since last successful attempt
int nAttempts{0};
@ -64,7 +66,7 @@ public:
SERIALIZE_METHODS(AddrInfo, obj)
{
READWRITEAS(CAddress, obj);
READWRITE(obj.source, obj.nLastSuccess, obj.nAttempts);
READWRITE(obj.source, Using<ChronoFormatter<int64_t>>(obj.m_last_success), obj.nAttempts);
}
AddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource)
@ -91,10 +93,10 @@ public:
int GetBucketPosition(const uint256 &nKey, bool fNew, int bucket) const;
//! Determine whether the statistics about this entry are bad enough so that it can just be deleted
bool IsTerrible(int64_t nNow = GetAdjustedTime()) const;
bool IsTerrible(NodeSeconds now = Now<NodeSeconds>()) const;
//! Calculate the relative chance this entry should be given when selecting nodes to connect to
double GetChance(int64_t nNow = GetAdjustedTime()) const;
double GetChance(NodeSeconds now = Now<NodeSeconds>()) const;
};
class AddrManImpl
@ -112,26 +114,26 @@ public:
size_t Size(std::optional<Network> net, std::optional<bool> in_new) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
bool Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, int64_t nTimePenalty)
bool Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, std::chrono::seconds time_penalty)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
bool Good(const CService& addr, int64_t nTime)
bool Good(const CService& addr, NodeSeconds time)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
void Attempt(const CService& addr, bool fCountFailure, int64_t nTime)
void Attempt(const CService& addr, bool fCountFailure, NodeSeconds time)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
void ResolveCollisions() EXCLUSIVE_LOCKS_REQUIRED(!cs);
std::pair<CAddress, int64_t> SelectTriedCollision() EXCLUSIVE_LOCKS_REQUIRED(!cs);
std::pair<CAddress, NodeSeconds> SelectTriedCollision() EXCLUSIVE_LOCKS_REQUIRED(!cs);
std::pair<CAddress, int64_t> Select(bool new_only, std::optional<Network> network) const
std::pair<CAddress, NodeSeconds> Select(bool new_only, std::optional<Network> network) const
EXCLUSIVE_LOCKS_REQUIRED(!cs);
std::vector<CAddress> GetAddr(size_t max_addresses, size_t max_pct, std::optional<Network> network) const
EXCLUSIVE_LOCKS_REQUIRED(!cs);
void Connected(const CService& addr, int64_t nTime)
void Connected(const CService& addr, NodeSeconds time)
EXCLUSIVE_LOCKS_REQUIRED(!cs);
void SetServices(const CService& addr, ServiceFlags nServices)
@ -205,7 +207,7 @@ private:
int vvNew[ADDRMAN_NEW_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE] GUARDED_BY(cs);
//! last time Good was called (memory only). Initially set to 1 so that "never" is strictly worse.
int64_t nLastGood GUARDED_BY(cs){1};
NodeSeconds m_last_good GUARDED_BY(cs){1s};
//! Holds addrs inserted into tried table that collide with existing entries. Test-before-evict discipline used to resolve these collisions.
std::set<int> m_tried_collisions;
@ -244,15 +246,15 @@ private:
/** Attempt to add a single address to addrman's new table.
* @see AddrMan::Add() for parameters. */
bool AddSingle(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty) EXCLUSIVE_LOCKS_REQUIRED(cs);
bool AddSingle(const CAddress& addr, const CNetAddr& source, std::chrono::seconds time_penalty) EXCLUSIVE_LOCKS_REQUIRED(cs);
bool Good_(const CService& addr, bool test_before_evict, int64_t time) EXCLUSIVE_LOCKS_REQUIRED(cs);
bool Good_(const CService& addr, bool test_before_evict, NodeSeconds time) EXCLUSIVE_LOCKS_REQUIRED(cs);
bool Add_(const std::vector<CAddress> &vAddr, const CNetAddr& source, int64_t nTimePenalty) EXCLUSIVE_LOCKS_REQUIRED(cs);
bool Add_(const std::vector<CAddress>& vAddr, const CNetAddr& source, std::chrono::seconds time_penalty) EXCLUSIVE_LOCKS_REQUIRED(cs);
void Attempt_(const CService& addr, bool fCountFailure, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);
void Attempt_(const CService& addr, bool fCountFailure, NodeSeconds time) EXCLUSIVE_LOCKS_REQUIRED(cs);
std::pair<CAddress, int64_t> Select_(bool new_only, std::optional<Network> network) const EXCLUSIVE_LOCKS_REQUIRED(cs);
std::pair<CAddress, NodeSeconds> Select_(bool new_only, std::optional<Network> network) const EXCLUSIVE_LOCKS_REQUIRED(cs);
/** Helper to generalize looking up an addrman entry from either table.
*
@ -262,7 +264,7 @@ private:
std::vector<CAddress> GetAddr_(size_t max_addresses, size_t max_pct, std::optional<Network> network) const EXCLUSIVE_LOCKS_REQUIRED(cs);
void Connected_(const CService& addr, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);
void Connected_(const CService& addr, NodeSeconds time) EXCLUSIVE_LOCKS_REQUIRED(cs);
void SetServices_(const CService& addr, ServiceFlags nServices) EXCLUSIVE_LOCKS_REQUIRED(cs);
@ -270,7 +272,7 @@ private:
void ResolveCollisions_() EXCLUSIVE_LOCKS_REQUIRED(cs);
std::pair<CAddress, int64_t> SelectTriedCollision_() EXCLUSIVE_LOCKS_REQUIRED(cs);
std::pair<CAddress, NodeSeconds> SelectTriedCollision_() EXCLUSIVE_LOCKS_REQUIRED(cs);
std::optional<AddressPosition> FindAddressEntry_(const CAddress& addr) EXCLUSIVE_LOCKS_REQUIRED(cs);

View File

@ -6,7 +6,7 @@
#include <banman.h>
#include <netaddress.h>
#include <node/ui_interface.h>
#include <node/interface_ui.h>
#include <sync.h>
#include <util/system.h>
#include <util/time.h>
@ -31,12 +31,12 @@ void BanMan::LoadBanlist()
if (m_client_interface) m_client_interface->InitMessage(_("Loading banlist…").translated);
int64_t n_start = GetTimeMillis();
const auto start{SteadyClock::now()};
if (m_ban_db.Read(m_banned)) {
SweepBanned(); // sweep out unused entries
LogPrint(BCLog::NET, "Loaded %d banned node addresses/subnets %dms\n", m_banned.size(),
GetTimeMillis() - n_start);
Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
} else {
LogPrintf("Recreating the banlist database\n");
m_banned = {};
@ -58,13 +58,13 @@ void BanMan::DumpBanlist()
SetBannedSetDirty(false);
}
int64_t n_start = GetTimeMillis();
const auto start{SteadyClock::now()};
if (!m_ban_db.Write(banmap)) {
SetBannedSetDirty(true);
}
LogPrint(BCLog::NET, "Flushed %d banned node addresses/subnets to disk %dms\n", banmap.size(),
GetTimeMillis() - n_start);
Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
}
void BanMan::ClearBanned()

View File

@ -42,7 +42,7 @@ static void CreateAddresses()
CAddress ret(CService(addr, port), NODE_NETWORK);
ret.nTime = GetAdjustedTime();
ret.nTime = Now<NodeSeconds>();
return ret;
};
@ -118,7 +118,7 @@ static void AddrManSelectByNetwork(benchmark::Bench& bench)
CService i2p_service;
i2p_service.SetSpecial("udhdrtrcetjm5sxzskjyr5ztpeszydbh4dpl3pl4utgqqw2v4jna.b32.i2p");
CAddress i2p_address(i2p_service, NODE_NONE);
i2p_address.nTime = GetAdjustedTime();
i2p_address.nTime = Now<NodeSeconds>();
const CNetAddr source{LookupHost("252.2.2.2", false).value()};
addrman.Add({i2p_address}, source);

View File

@ -10,7 +10,8 @@
#include <chainparamsbase.h>
#include <clientversion.h>
#include <compat.h>
#include <compat/compat.h>
#include <compat/stdin.h>
#include <policy/feerate.h>
#include <rpc/client.h>
#include <rpc/mining.h>
@ -18,17 +19,19 @@
#include <rpc/request.h>
#include <stacktraces.h>
#include <tinyformat.h>
#include <univalue.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/translation.h>
#include <util/url.h>
#include <algorithm>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <functional>
#include <memory>
#include <optional>
#include <stdio.h>
#include <string>
#include <tuple>
@ -40,8 +43,10 @@
#include <event2/keyvalq_struct.h>
#include <support/events.h>
#include <univalue.h>
#include <compat/stdin.h>
// The server returns time values from a mockable system clock, but it is not
// trivial to get the mocked time from the server, nor is it needed for now, so
// just use a plain system_clock.
using CliClock = std::chrono::system_clock;
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
UrlDecodeFn* const URL_DECODE = urlDecode;
@ -75,7 +80,7 @@ static void SetupCliArgs(ArgsManager& argsman)
argsman.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-generate", strprintf("Generate blocks immediately, equivalent to RPC getnewaddress followed by RPC generatetoaddress. Optional positional integer arguments are number of blocks to generate (default: %s) and maximum iterations to try (default: %s), equivalent to RPC generatetoaddress nblocks and maxtries arguments. Example: dash-cli -generate 4 1000", DEFAULT_NBLOCKS, DEFAULT_MAX_TRIES), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-addrinfo", "Get the number of addresses known to the node, per network and total.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-addrinfo", "Get the number of addresses known to the node, per network and total, after filtering for quality and recency. The total number of addresses known to the node may be higher.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-getinfo", "Get general information from the remote server. Note that unlike server-side RPC calls, the results of -getinfo is the result of multiple non-atomic requests. Some entries in the result may represent results from different states (e.g. wallet balance may be as of a different block from the chain state reported)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-netinfo", "Get network peer connection information from the remote server. An optional integer argument from 0 to 4 can be passed for different peers listings (default: 0). Pass \"help\" for detailed help documentation.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
@ -454,7 +459,6 @@ private:
if (conn_type == "addr-fetch") return "addr";
return "";
}
const int64_t m_time_now{GetTimeSeconds()};
public:
static constexpr int ID_PEERINFO = 0;
@ -486,6 +490,7 @@ public:
if (networkinfo["version"].get_int() < 200000) {
throw std::runtime_error("-netinfo requires dashd server to be running v20.0 and up");
}
const int64_t time_now{TicksSinceEpoch<std::chrono::seconds>(CliClock::now())};
// Count peer connection totals, and if DetailsRequested(), store peer data in a vector of structs.
for (const UniValue& peer : batch[ID_PEERINFO]["result"].getValues()) {
@ -516,7 +521,7 @@ public:
const double min_ping{peer["minping"].isNull() ? -1 : peer["minping"].get_real()};
const double ping{peer["pingtime"].isNull() ? -1 : peer["pingtime"].get_real()};
const std::string addr{peer["addr"].get_str()};
const std::string age{conn_time == 0 ? "" : ToString((m_time_now - conn_time) / 60)};
const std::string age{conn_time == 0 ? "" : ToString((time_now - conn_time) / 60)};
const std::string sub_version{peer["subver"].get_str()};
const std::string transport{peer["transport_protocol_type"].isNull() ? "v1" : peer["transport_protocol_type"].get_str()};
const bool is_addr_relay_enabled{peer["addr_relay_enabled"].isNull() ? false : peer["addr_relay_enabled"].get_bool()};
@ -554,10 +559,10 @@ public:
peer.transport_protocol_type.rfind('v', 0) == 0 ? peer.transport_protocol_type[1] : ' ',
PingTimeToString(peer.min_ping),
PingTimeToString(peer.ping),
peer.last_send ? ToString(m_time_now - peer.last_send) : "",
peer.last_recv ? ToString(m_time_now - peer.last_recv) : "",
peer.last_trxn ? ToString((m_time_now - peer.last_trxn) / 60) : peer.is_block_relay ? "*" : "",
peer.last_blck ? ToString((m_time_now - peer.last_blck) / 60) : "",
peer.last_send ? ToString(time_now - peer.last_send) : "",
peer.last_recv ? ToString(time_now - peer.last_recv) : "",
peer.last_trxn ? ToString((time_now - peer.last_trxn) / 60) : peer.is_block_relay ? "*" : "",
peer.last_blck ? ToString((time_now - peer.last_blck) / 60) : "",
strprintf("%s%s", peer.is_bip152_hb_to ? "." : " ", peer.is_bip152_hb_from ? "*" : " "),
m_max_addr_processed_length, // variable spacing
peer.addr_processed ? ToString(peer.addr_processed) : peer.is_addr_relay_enabled ? "" : ".",
@ -640,8 +645,9 @@ public:
"Suggestion: use with the Linux watch(1) command for a live dashboard; see example below.\n\n"
"Arguments:\n"
+ strprintf("1. level (integer 0-%d, optional) Specify the info level of the peers dashboard (default 0):\n", MAX_DETAIL_LEVEL) +
" 0 - Connection counts and local addresses\n"
" 1 - Like 0 but with a peers listing (without address or version columns)\n"
" 0 - Peer counts for each reachable network as well as for block relay peers\n"
" and manual peers, and the list of local addresses and ports\n"
" 1 - Like 0 but preceded by a peers listing (without address and version columns)\n"
" 2 - Like 1 but with an address column\n"
" 3 - Like 1 but with a version column\n"
" 4 - Like 1 but with both address and version columns\n"
@ -680,13 +686,13 @@ public:
" id Peer index, in increasing order of peer connections since node startup\n"
" address IP address and port of the peer\n"
" version Peer version and subversion concatenated, e.g. \"70016/Satoshi:21.0.0/\"\n\n"
"* The connection counts table displays the number of peers by direction, network, and the totals\n"
" for each, as well as two special outbound columns for block relay peers and manual peers.\n\n"
"* The peer counts table displays the number of peers for each reachable network as well as\n"
" the number of block relay peers and manual peers.\n\n"
"* The local addresses table lists each local address broadcast by the node, the port, and the score.\n\n"
"Examples:\n\n"
"Connection counts and local addresses only\n"
"Peer counts table of reachable networks and list of local addresses\n"
"> dash-cli -netinfo\n\n"
"Compact peers listing\n"
"The same, preceded by a peers listing without address and version columns\n"
"> dash-cli -netinfo 1\n\n"
"Full dashboard\n"
+ strprintf("> dash-cli -netinfo %d\n\n", MAX_DETAIL_LEVEL) +
@ -868,7 +874,7 @@ static UniValue ConnectAndCallRPC(BaseRequestHandler* rh, const std::string& str
// Execute and handle connection failures with -rpcwait.
const bool fWait = gArgs.GetBoolArg("-rpcwait", false);
const int timeout = gArgs.GetArg("-rpcwaittimeout", DEFAULT_WAIT_CLIENT_TIMEOUT);
const auto deadline{GetTime<std::chrono::microseconds>() + 1s * timeout};
const auto deadline{std::chrono::steady_clock::now() + 1s * timeout};
do {
try {
@ -881,8 +887,7 @@ static UniValue ConnectAndCallRPC(BaseRequestHandler* rh, const std::string& str
}
break; // Connection succeeded, no need to retry.
} catch (const CConnectionFailed& e) {
const auto now{GetTime<std::chrono::microseconds>()};
if (fWait && (timeout <= 0 || now < deadline)) {
if (fWait && (timeout <= 0 || std::chrono::steady_clock::now() < deadline)) {
UninterruptibleSleep(1s);
} else {
throw CConnectionFailed(strprintf("timeout on transient error: %s", e.what()));

View File

@ -9,7 +9,7 @@
#include <chainparams.h>
#include <clientversion.h>
#include <coins.h>
#include <compat.h>
#include <compat/compat.h>
#include <consensus/consensus.h>
#include <core_io.h>
#include <key_io.h>
@ -220,6 +220,16 @@ static void MutateTxLocktime(CMutableTransaction& tx, const std::string& cmdVal)
tx.nLockTime = (unsigned int) newLocktime;
}
template <typename T>
static T TrimAndParse(const std::string& int_str, const std::string& err)
{
const auto parsed{ToIntegral<T>(TrimString(int_str))};
if (!parsed.has_value()) {
throw std::runtime_error(err + " '" + int_str + "'");
}
return parsed.value();
}
static void MutateTxAddInput(CMutableTransaction& tx, const std::string& strInput)
{
std::vector<std::string> vStrInputParts = SplitString(strInput, ':');
@ -245,8 +255,9 @@ static void MutateTxAddInput(CMutableTransaction& tx, const std::string& strInpu
// extract the optional sequence number
uint32_t nSequenceIn = CTxIn::SEQUENCE_FINAL;
if (vStrInputParts.size() > 2)
nSequenceIn = std::stoul(vStrInputParts[2]);
if (vStrInputParts.size() > 2) {
nSequenceIn = TrimAndParse<uint32_t>(vStrInputParts.at(2), "invalid TX sequence id");
}
// append to transaction input list
CTxIn txin(txid, vout, CScript(), nSequenceIn);
@ -324,10 +335,10 @@ static void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& s
CAmount value = ExtractAndValidateValue(vStrInputParts[0]);
// Extract REQUIRED
uint32_t required = stoul(vStrInputParts[1]);
const uint32_t required{TrimAndParse<uint32_t>(vStrInputParts.at(1), "invalid multisig required number")};
// Extract NUMKEYS
uint32_t numkeys = stoul(vStrInputParts[2]);
const uint32_t numkeys{TrimAndParse<uint32_t>(vStrInputParts.at(2), "invalid multisig total number")};
// Validate there are the correct number of pubkeys
if (vStrInputParts.size() < numkeys + 3)

View File

@ -8,7 +8,7 @@
#include <chainparams.h>
#include <chainparamsbase.h>
#include <compat.h>
#include <compat/compat.h>
#include <logging.h>
#include <util/strencodings.h>
#include <util/system.h>
@ -56,7 +56,7 @@ static bool WalletAppInit(ArgsManager& args, int argc, char* argv[])
strUsage += "\n"
"dash-wallet is an offline tool for creating and interacting with " PACKAGE_NAME " wallet files.\n"
"By default dash-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n"
"To change the target wallet, use the -datadir, -wallet and -testnet/-regtest arguments.\n\n"
"To change the target wallet, use the -datadir, -wallet and -regtest/-testnet arguments.\n\n"
"Usage:\n"
" dash-wallet [options] <command>\n";
strUsage += "\n" + args.GetHelpMessage();

View File

@ -10,12 +10,12 @@
#include <chainparams.h>
#include <clientversion.h>
#include <compat.h>
#include <compat/compat.h>
#include <init.h>
#include <interfaces/chain.h>
#include <interfaces/init.h>
#include <node/context.h>
#include <node/ui_interface.h>
#include <node/interface_ui.h>
#include <noui.h>
#include <shutdown.h>
#include <util/check.h>

View File

@ -123,6 +123,14 @@ public:
cachedHash.SetNull();
}
std::array<uint8_t, SerSize> ToBytes(const bool specificLegacyScheme) const
{
if (!fValid) {
return std::array<uint8_t, SerSize>{};
}
return impl.SerializeToArray(specificLegacyScheme);
}
std::vector<uint8_t> ToByteVector(const bool specificLegacyScheme) const
{
if (!fValid) {
@ -131,9 +139,9 @@ public:
return impl.Serialize(specificLegacyScheme);
}
std::vector<uint8_t> ToByteVector() const
std::array<uint8_t, SerSize> ToBytes() const
{
return ToByteVector(bls::bls_legacy_scheme.load());
return ToBytes(bls::bls_legacy_scheme.load());
}
const uint256& GetHash() const
@ -167,7 +175,7 @@ public:
template <typename Stream>
inline void Serialize(Stream& s, const bool specificLegacyScheme) const
{
s.write(AsBytes(Span{ToByteVector(specificLegacyScheme).data(), SerSize}));
s.write(AsBytes(Span{ToBytes(specificLegacyScheme)}));
}
template <typename Stream>
@ -206,7 +214,7 @@ public:
inline bool CheckMalleable(Span<uint8_t> vecBytes, const bool specificLegacyScheme) const
{
if (memcmp(vecBytes.data(), ToByteVector(specificLegacyScheme).data(), SerSize)) {
if (memcmp(vecBytes.data(), ToBytes(specificLegacyScheme).data(), SerSize)) {
// TODO not sure if this is actually possible with the BLS libs. I'm assuming here that somewhere deep inside
// these libs masking might happen, so that 2 different binary representations could result in the same object
// representation
@ -222,7 +230,7 @@ public:
inline std::string ToString(const bool specificLegacyScheme) const
{
std::vector<uint8_t> buf = ToByteVector(specificLegacyScheme);
auto buf = ToBytes(specificLegacyScheme);
return HexStr(buf);
}
@ -245,10 +253,12 @@ struct CBLSIdImplicit : public uint256
memcpy(instance.begin(), buffer, sizeof(CBLSIdImplicit));
return instance;
}
[[nodiscard]] std::vector<uint8_t> Serialize(const bool fLegacy) const
[[nodiscard]] std::vector<uint8_t> SerializeToVec(const bool fLegacy) const
{
return {begin(), end()};
}
[[nodiscard]] std::array<uint8_t, WIDTH> Serialize(const bool fLegacy) const { return m_data; }
[[nodiscard]] std::array<uint8_t, WIDTH> SerializeToArray(const bool fLegacy) const { return Serialize(fLegacy); }
};
class CBLSId : public CBLSWrapper<CBLSIdImplicit, BLS_CURVE_ID_SIZE, CBLSId>
@ -309,21 +319,6 @@ public:
};
class ConstCBLSPublicKeyVersionWrapper {
private:
const CBLSPublicKey& obj;
bool legacy;
public:
ConstCBLSPublicKeyVersionWrapper(const CBLSPublicKey& obj, bool legacy)
: obj(obj)
, legacy(legacy)
{}
template <typename Stream>
inline void Serialize(Stream& s) const {
obj.Serialize(s, legacy);
}
};
class CBLSPublicKeyVersionWrapper {
private:
CBLSPublicKey& obj;
@ -396,7 +391,7 @@ class CBLSLazyWrapper
private:
mutable std::mutex mutex;
mutable std::vector<uint8_t> vecBytes;
mutable std::array<uint8_t, BLSObject::SerSize> vecBytes{};
mutable bool bufValid{false};
mutable bool bufLegacyScheme{true};
@ -407,7 +402,6 @@ private:
public:
CBLSLazyWrapper() :
vecBytes(BLSObject::SerSize, 0),
bufLegacyScheme(bls::bls_legacy_scheme.load())
{}
@ -425,7 +419,6 @@ public:
if (r.bufValid) {
vecBytes = r.vecBytes;
} else {
vecBytes.resize(BLSObject::SerSize);
std::fill(vecBytes.begin(), vecBytes.end(), 0);
}
objInitialized = r.objInitialized;
@ -448,10 +441,9 @@ public:
{
std::unique_lock<std::mutex> l(mutex);
if (!objInitialized && !bufValid) {
vecBytes.resize(BLSObject::SerSize);
std::fill(vecBytes.begin(), vecBytes.end(), 0);
} else if (!bufValid || (bufLegacyScheme != specificLegacyScheme)) {
vecBytes = obj.ToByteVector(specificLegacyScheme);
vecBytes = obj.ToBytes(specificLegacyScheme);
bufValid = true;
bufLegacyScheme = specificLegacyScheme;
hash.SetNull();
@ -533,11 +525,10 @@ public:
{
std::unique_lock<std::mutex> l(mutex);
if (!objInitialized && !bufValid) {
vecBytes.resize(BLSObject::SerSize);
std::fill(vecBytes.begin(), vecBytes.end(), 0);
hash.SetNull();
} else if (!bufValid) {
vecBytes = obj.ToByteVector(bufLegacyScheme);
vecBytes = obj.ToBytes(bufLegacyScheme);
bufValid = true;
hash.SetNull();
}

View File

@ -49,8 +49,7 @@ bool CBLSIESEncryptedBlob::Encrypt(size_t idx, const CBLSPublicKey& peerPubKey,
return false;
}
std::vector<unsigned char> symKey = pk.ToByteVector();
symKey.resize(32);
auto symKey = pk.ToBytes();
uint256 iv = GetIV(idx);
return EncryptBlob(plainTextData, dataSize, data, symKey.data(), iv.begin());
@ -63,10 +62,9 @@ bool CBLSIESEncryptedBlob::Decrypt(size_t idx, const CBLSSecretKey& secretKey, C
return false;
}
std::vector<unsigned char> symKey = pk.ToByteVector();
symKey.resize(32);
uint256 iv = GetIV(idx);
auto symKey = pk.ToBytes();
return DecryptBlob(data.data(), data.size(), decryptedDataRet, symKey.data(), iv.begin());
}
@ -117,8 +115,7 @@ bool CBLSIESMultiRecipientBlobs::Encrypt(size_t idx, const CBLSPublicKey& recipi
return false;
}
std::vector<uint8_t> symKey = pk.ToByteVector();
symKey.resize(32);
auto symKey = pk.ToBytes();
return EncryptBlob(blob.data(), blob.size(), blobs[idx], symKey.data(), ivVector[idx].begin());
}
@ -134,13 +131,11 @@ bool CBLSIESMultiRecipientBlobs::Decrypt(size_t idx, const CBLSSecretKey& sk, Bl
return false;
}
std::vector<uint8_t> symKey = pk.ToByteVector();
symKey.resize(32);
uint256 iv = ivSeed;
for (size_t i = 0; i < idx; i++) {
iv = ::SerializeHash(iv);
}
auto symKey = pk.ToBytes();
return DecryptBlob(blobs[idx].data(), blobs[idx].size(), blobRet, symKey.data(), iv.begin());
}

View File

@ -237,7 +237,7 @@ public:
nDefaultPlatformP2PPort = 26656;
nDefaultPlatformHTTPPort = 443;
nPruneAfterHeight = 100000;
m_assumed_blockchain_size = 45;
m_assumed_blockchain_size = 50;
m_assumed_chain_state_size = 1;
genesis = CreateGenesisBlock(1390095618, 28917698, 0x1e0ffff0, 1, 50 * COIN);
@ -430,7 +430,7 @@ public:
nDefaultPlatformP2PPort = 22000;
nDefaultPlatformHTTPPort = 22001;
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 4;
m_assumed_blockchain_size = 5;
m_assumed_chain_state_size = 1;
genesis = CreateGenesisBlock(1390666206UL, 3861367235UL, 0x1e0ffff0, 1, 50 * COIN);
@ -790,14 +790,15 @@ public:
consensus.BIP147Height = 1; // Always active unless overridden
consensus.CSVHeight = 1; // Always active unless overridden
consensus.DIP0001Height = 1; // Always active unless overridden
consensus.DIP0003Height = 432;
consensus.DIP0003Height = 432; // Always active for DashTestFramework in functional tests (see dip3params)
// For unit tests and for BitcoinTestFramework is disabled due to missing quorum commitment for blocks created by helpers such as create_blocks
consensus.DIP0003EnforcementHeight = 500;
consensus.DIP0003EnforcementHash = uint256();
consensus.DIP0008Height = 1; // Always active unless overridden
consensus.BRRHeight = 1; // Always active unless overridden
consensus.DIP0020Height = 1; // Always active unless overridden
consensus.DIP0024Height = 900;
consensus.DIP0024QuorumsHeight = 900;
consensus.DIP0024Height = 1; // Always have dip0024 quorums unless overridden
consensus.DIP0024QuorumsHeight = 1; // Always have dip0024 quorums unless overridden
consensus.V19Height = 900;
consensus.V20Height = 900;
consensus.MN_RRHeight = 900;
@ -845,8 +846,6 @@ public:
UpdateActivationParametersFromArgs(args);
UpdateDIP3ParametersFromArgs(args);
UpdateDIP8ParametersFromArgs(args);
UpdateBIP147ParametersFromArgs(args);
UpdateBudgetParametersFromArgs(args);
genesis = CreateGenesisBlock(1417713337, 1096447, 0x207fffff, 1, 50 * COIN);
@ -965,21 +964,6 @@ public:
}
void UpdateDIP3ParametersFromArgs(const ArgsManager& args);
/**
* Allows modifying the DIP8 activation height
*/
void UpdateDIP8Parameters(int nActivationHeight)
{
consensus.DIP0008Height = nActivationHeight;
}
void UpdateDIP8ParametersFromArgs(const ArgsManager& args);
void UpdateBIP147Parameters(int nActivationHeight)
{
consensus.BIP147Height = nActivationHeight;
}
void UpdateBIP147ParametersFromArgs(const ArgsManager& args);
/**
* Allows modifying the budget regtest parameters.
*/
@ -1045,6 +1029,8 @@ static void MaybeUpdateHeights(const ArgsManager& args, Consensus::Params& conse
consensus.DIP0001Height = int{height};
} else if (name == "dip0008") {
consensus.DIP0008Height = int{height};
} else if (name == "dip0024") {
consensus.DIP0024QuorumsHeight = int{height};
} else if (name == "v20") {
consensus.V20Height = int{height};
} else if (name == "mn_rr") {
@ -1136,35 +1122,6 @@ void CRegTestParams::UpdateDIP3ParametersFromArgs(const ArgsManager& args)
UpdateDIP3Parameters(nDIP3ActivationHeight, nDIP3EnforcementHeight);
}
void CRegTestParams::UpdateDIP8ParametersFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-dip8params")) return;
std::string strParams = args.GetArg("-dip8params", "");
std::vector<std::string> vParams = SplitString(strParams, ':');
if (vParams.size() != 1) {
throw std::runtime_error("DIP8 parameters malformed, expecting <activation>");
}
int nDIP8ActivationHeight;
if (!ParseInt32(vParams[0], &nDIP8ActivationHeight)) {
throw std::runtime_error(strprintf("Invalid activation height (%s)", vParams[0]));
}
LogPrintf("Setting DIP8 parameters to activation=%ld\n", nDIP8ActivationHeight);
UpdateDIP8Parameters(nDIP8ActivationHeight);
}
void CRegTestParams::UpdateBIP147ParametersFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-bip147height")) return;
int nBIP147Height;
const std::string strParams = args.GetArg("-bip147height", "");
if (!ParseInt32(strParams, &nBIP147Height)) {
throw std::runtime_error(strprintf("Invalid activation height (%s)", strParams));
}
LogPrintf("Setting BIP147 parameters to activation=%lld\n", nBIP147Height);
UpdateBIP147Parameters(nBIP147Height);
}
void CRegTestParams::UpdateBudgetParametersFromArgs(const ArgsManager& args)
{
if (!args.IsArgSet("-budgetparams")) return;

View File

@ -20,9 +20,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman)
argsman.AddArg("-budgetparams=<masternode>:<budget>:<superblock>", "Override masternode, budget and superblock start heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-devnet=<name>", "Use devnet chain with provided name", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-dip3params=<activation>:<enforcement>", "Override DIP3 activation and enforcement heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-dip8params=<activation>", "Override DIP8 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-bip147height=<activation>", "Override BIP147 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (bip147, bip34, dersig, cltv, csv, brr, dip0001, dip0008, v20, mn_rr). (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (bip147, bip34, dersig, cltv, csv, brr, dip0001, dip0008, dip0024, v20, mn_rr). (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-highsubsidyblocks=<n>", "The number of blocks with a higher than normal subsidy to mine at the start of a chain. Block after that height will have fixed subsidy base. (default: 0, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-highsubsidyfactor=<n>", "The factor to multiply the normal block subsidy by while in the highsubsidyblocks window of a chain (default: 1, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
argsman.AddArg("-llmqchainlocks=<quorum name>", "Override the default LLMQ type used for ChainLocks. Allows using ChainLocks with smaller LLMQs. (default: llmq_devnet, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);

View File

@ -30,18 +30,20 @@
#include <memory>
#include <univalue.h>
PeerMsgRet CCoinJoinClientQueueManager::ProcessMessage(const CNode& peer, std::string_view msg_type, CDataStream& vRecv)
PeerMsgRet CCoinJoinClientQueueManager::ProcessMessage(const CNode& peer, CConnman& connman, PeerManager& peerman,
std::string_view msg_type, CDataStream& vRecv)
{
if (m_is_masternode) return {};
if (!m_mn_sync.IsBlockchainSynced()) return {};
if (msg_type == NetMsgType::DSQUEUE) {
return CCoinJoinClientQueueManager::ProcessDSQueue(peer, vRecv);
return CCoinJoinClientQueueManager::ProcessDSQueue(peer, connman, peerman, vRecv);
}
return {};
}
PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CDataStream& vRecv)
PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CConnman& connman, PeerManager& peerman,
CDataStream& vRecv)
{
assert(m_mn_metaman.IsValid());
@ -50,7 +52,7 @@ PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CDataS
{
LOCK(cs_main);
Assert(peerman)->EraseObjectRequest(peer.GetId(), CInv(MSG_DSQ, dsq.GetHash()));
peerman.EraseObjectRequest(peer.GetId(), CInv(MSG_DSQ, dsq.GetHash()));
}
if (dsq.masternodeOutpoint.IsNull() && dsq.m_protxHash.IsNull()) {
@ -102,8 +104,9 @@ PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CDataS
}
// if the queue is ready, submit if we can
if (dsq.fReady && m_walletman.ForAnyCJClientMan([this, &dmn](std::unique_ptr<CCoinJoinClientManager>& clientman) {
return clientman->TrySubmitDenominate(dmn->pdmnState->addr, this->connman);
if (dsq.fReady &&
m_walletman.ForAnyCJClientMan([this, &connman, &dmn](std::unique_ptr<CCoinJoinClientManager>& clientman) {
return clientman->TrySubmitDenominate(dmn->pdmnState->addr, connman);
})) {
LogPrint(BCLog::COINJOIN, "DSQUEUE -- CoinJoin queue (%s) is ready on masternode %s\n", dsq.ToString(),
dmn->pdmnState->addr.ToStringAddrPort());
@ -132,7 +135,7 @@ PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CDataS
WITH_LOCK(cs_vecqueue, vecCoinJoinQueue.push_back(dsq));
}
} // cs_ProcessDSQueue
peerman->RelayDSQ(dsq);
peerman.RelayDSQ(dsq);
return {};
}
@ -1482,7 +1485,7 @@ bool CCoinJoinClientSession::MakeCollateralAmounts(const CompactTallyItem& tally
return false;
}
CTransactionBuilder txBuilder(m_wallet, tallyItem);
CTransactionBuilder txBuilder(*m_wallet, tallyItem);
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::%s -- Start %s\n", __func__, txBuilder.ToString());
@ -1645,7 +1648,7 @@ bool CCoinJoinClientSession::CreateDenominated(CAmount nBalanceToDenominate, con
return false;
}
CTransactionBuilder txBuilder(m_wallet, tallyItem);
CTransactionBuilder txBuilder(*m_wallet, tallyItem);
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::%s -- Start %s\n", __func__, txBuilder.ToString());
@ -1917,11 +1920,11 @@ void CoinJoinWalletManager::Add(const std::shared_ptr<CWallet>& wallet)
g_wallet_init_interface.InitCoinJoinSettings(*this);
}
void CoinJoinWalletManager::DoMaintenance()
void CoinJoinWalletManager::DoMaintenance(CConnman& connman)
{
LOCK(cs_wallet_manager_map);
for (auto& [_, clientman] : m_wallet_manager_map) {
clientman->DoMaintenance(m_chainman, m_connman, m_mempool);
clientman->DoMaintenance(m_chainman, connman, m_mempool);
}
}

View File

@ -76,11 +76,10 @@ public:
using wallet_name_cjman_map = std::map<const std::string, std::unique_ptr<CCoinJoinClientManager>>;
public:
CoinJoinWalletManager(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman,
CMasternodeMetaMan& mn_metaman, const CTxMemPool& mempool, const CMasternodeSync& mn_sync,
CoinJoinWalletManager(ChainstateManager& chainman, CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman,
const CTxMemPool& mempool, const CMasternodeSync& mn_sync,
const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode) :
m_chainman(chainman),
m_connman(connman),
m_dmnman(dmnman),
m_mn_metaman(mn_metaman),
m_mempool(mempool),
@ -97,7 +96,7 @@ public:
}
void Add(const std::shared_ptr<CWallet>& wallet);
void DoMaintenance();
void DoMaintenance(CConnman& connman);
void Remove(const std::string& name);
void Flush(const std::string& name);
@ -122,7 +121,6 @@ public:
private:
ChainstateManager& m_chainman;
CConnman& m_connman;
CDeterministicMNManager& m_dmnman;
CMasternodeMetaMan& m_mn_metaman;
const CTxMemPool& m_mempool;
@ -234,8 +232,6 @@ public:
class CCoinJoinClientQueueManager : public CCoinJoinBaseManager
{
private:
CConnman& connman;
std::unique_ptr<PeerManager>& peerman;
CoinJoinWalletManager& m_walletman;
CDeterministicMNManager& m_dmnman;
CMasternodeMetaMan& m_mn_metaman;
@ -245,20 +241,18 @@ private:
const bool m_is_masternode;
public:
explicit CCoinJoinClientQueueManager(CConnman& _connman, std::unique_ptr<PeerManager>& _peerman,
CoinJoinWalletManager& walletman, CDeterministicMNManager& dmnman,
explicit CCoinJoinClientQueueManager(CoinJoinWalletManager& walletman, CDeterministicMNManager& dmnman,
CMasternodeMetaMan& mn_metaman, const CMasternodeSync& mn_sync,
bool is_masternode) :
connman(_connman),
peerman(_peerman),
m_walletman(walletman),
m_dmnman(dmnman),
m_mn_metaman(mn_metaman),
m_mn_sync(mn_sync),
m_is_masternode{is_masternode} {};
PeerMsgRet ProcessMessage(const CNode& peer, std::string_view msg_type, CDataStream& vRecv) EXCLUSIVE_LOCKS_REQUIRED(!cs_vecqueue);
PeerMsgRet ProcessDSQueue(const CNode& peer, CDataStream& vRecv);
PeerMsgRet ProcessMessage(const CNode& peer, CConnman& connman, PeerManager& peerman, std::string_view msg_type,
CDataStream& vRecv) EXCLUSIVE_LOCKS_REQUIRED(!cs_vecqueue);
PeerMsgRet ProcessDSQueue(const CNode& peer, CConnman& connman, PeerManager& peerman, CDataStream& vRecv);
void DoMaintenance();
};

View File

@ -55,7 +55,7 @@ bool CCoinJoinQueue::Sign(const CActiveMasternodeManager& mn_activeman)
if (!sig.IsValid()) {
return false;
}
vchSig = sig.ToByteVector(false);
vchSig = sig.ToBytes(false);
return true;
}
@ -94,7 +94,7 @@ bool CCoinJoinBroadcastTx::Sign(const CActiveMasternodeManager& mn_activeman)
if (!sig.IsValid()) {
return false;
}
vchSig = sig.ToByteVector(false);
vchSig = sig.ToBytes(false);
return true;
}

View File

@ -7,6 +7,7 @@
#include <coinjoin/common.h>
#include <bls/bls.h>
#include <core_io.h>
#include <netaddress.h>
#include <primitives/block.h>
@ -183,7 +184,7 @@ public:
uint256 m_protxHash;
int64_t nTime{0};
bool fReady{false}; //ready for submit
std::vector<unsigned char> vchSig;
std::array<unsigned char, BLS_CURVE_SIG_SIZE> vchSig;
// memory only
bool fTried{false};
@ -243,7 +244,7 @@ public:
CTransactionRef tx;
COutPoint masternodeOutpoint;
uint256 m_protxHash;
std::vector<unsigned char> vchSig;
std::array<unsigned char, BLS_CURVE_SIG_SIZE> vchSig;
int64_t sigTime{0};
CCoinJoinBroadcastTx() :
tx(MakeTransactionRef(CMutableTransaction{}))

View File

@ -15,12 +15,11 @@ CJContext::CJContext(ChainstateManager& chainman, CConnman& connman, CDeterminis
std::unique_ptr<PeerManager>& peerman, bool relay_txes) :
dstxman{std::make_unique<CDSTXManager>()},
#ifdef ENABLE_WALLET
walletman{std::make_unique<CoinJoinWalletManager>(chainman, connman, dmnman, mn_metaman, mempool, mn_sync, queueman,
/* is_masternode = */ mn_activeman != nullptr)},
queueman{relay_txes
? std::make_unique<CCoinJoinClientQueueManager>(connman, peerman, *walletman, dmnman, mn_metaman,
mn_sync, /* is_masternode = */ mn_activeman != nullptr)
: nullptr},
walletman{std::make_unique<CoinJoinWalletManager>(chainman, dmnman, mn_metaman, mempool, mn_sync, queueman,
/*is_masternode=*/mn_activeman != nullptr)},
queueman{relay_txes ? std::make_unique<CCoinJoinClientQueueManager>(*walletman, dmnman, mn_metaman, mn_sync,
/*is_masternode=*/mn_activeman != nullptr)
: nullptr},
#endif // ENABLE_WALLET
server{std::make_unique<CCoinJoinServer>(chainman, connman, dmnman, *dstxman, mn_metaman, mempool, mn_activeman,
mn_sync, peerman)}

View File

@ -520,6 +520,7 @@ void CCoinJoinServer::CheckForCompleteQueue()
"with %d participants\n", dsq.ToString(), vecSessionCollaterals.size());
dsq.Sign(*m_mn_activeman);
m_peerman->RelayDSQ(dsq);
WITH_LOCK(cs_vecqueue, vecCoinJoinQueue.push_back(dsq));
}
}

View File

@ -87,15 +87,14 @@ void CKeyHolderStorage::ReturnAll()
}
}
CTransactionBuilderOutput::CTransactionBuilderOutput(CTransactionBuilder* pTxBuilderIn,
const std::shared_ptr<CWallet>& wallet, CAmount nAmountIn) :
CTransactionBuilderOutput::CTransactionBuilderOutput(CTransactionBuilder* pTxBuilderIn, CWallet& wallet, CAmount nAmountIn) :
pTxBuilder(pTxBuilderIn),
dest(wallet.get()),
dest(&wallet),
nAmount(nAmountIn)
{
assert(pTxBuilder);
CTxDestination txdest;
LOCK(wallet->cs_wallet);
LOCK(wallet.cs_wallet);
dest.GetReservedDestination(txdest, false);
script = ::GetScriptForDestination(txdest);
}
@ -109,15 +108,15 @@ bool CTransactionBuilderOutput::UpdateAmount(const CAmount nNewAmount)
return true;
}
CTransactionBuilder::CTransactionBuilder(const std::shared_ptr<CWallet>& wallet, const CompactTallyItem& tallyItemIn) :
CTransactionBuilder::CTransactionBuilder(CWallet& wallet, const CompactTallyItem& tallyItemIn) :
m_wallet(wallet),
dummyReserveDestination(wallet.get()),
dummyReserveDestination(&wallet),
tallyItem(tallyItemIn)
{
// Generate a feerate which will be used to consider if the remainder is dust and will go into fees or not
coinControl.m_discard_feerate = ::GetDiscardRate(*m_wallet);
coinControl.m_discard_feerate = ::GetDiscardRate(m_wallet);
// Generate a feerate which will be used by calculations of this class and also by CWallet::CreateTransaction
coinControl.m_feerate = std::max(GetRequiredFeeRate(*m_wallet), m_wallet->m_pay_tx_fee);
coinControl.m_feerate = std::max(GetRequiredFeeRate(m_wallet), m_wallet.m_pay_tx_fee);
// Change always goes back to origin
coinControl.destChange = tallyItemIn.txdest;
// Only allow tallyItems inputs for tx creation
@ -132,16 +131,16 @@ CTransactionBuilder::CTransactionBuilder(const std::shared_ptr<CWallet>& wallet,
// Get a comparable dummy scriptPubKey, avoid writing/flushing to the actual wallet db
CScript dummyScript;
{
LOCK(m_wallet->cs_wallet);
WalletBatch dummyBatch(m_wallet->GetDatabase(), false);
LOCK(m_wallet.cs_wallet);
WalletBatch dummyBatch(m_wallet.GetDatabase(), false);
dummyBatch.TxnBegin();
CKey secret;
secret.MakeNewKey(m_wallet->CanSupportFeature(FEATURE_COMPRPUBKEY));
secret.MakeNewKey(m_wallet.CanSupportFeature(FEATURE_COMPRPUBKEY));
CPubKey dummyPubkey = secret.GetPubKey();
dummyBatch.TxnAbort();
dummyScript = ::GetScriptForDestination(PKHash(dummyPubkey));
// Calculate required bytes for the dummy signed tx with tallyItem's inputs only
nBytesBase = CalculateMaximumSignedTxSize(CTransaction(dummyTx), m_wallet.get(), false);
nBytesBase = CalculateMaximumSignedTxSize(CTransaction(dummyTx), &m_wallet, false);
}
// Calculate the output size
nBytesOutput = ::GetSerializeSize(CTxOut(0, dummyScript), PROTOCOL_VERSION);
@ -234,12 +233,12 @@ CAmount CTransactionBuilder::GetAmountUsed() const
CAmount CTransactionBuilder::GetFee(unsigned int nBytes) const
{
CAmount nFeeCalc = coinControl.m_feerate->GetFee(nBytes);
CAmount nRequiredFee = GetRequiredFee(*m_wallet, nBytes);
CAmount nRequiredFee = GetRequiredFee(m_wallet, nBytes);
if (nRequiredFee > nFeeCalc) {
nFeeCalc = nRequiredFee;
}
if (nFeeCalc > m_wallet->m_default_max_tx_fee) {
nFeeCalc = m_wallet->m_default_max_tx_fee;
if (nFeeCalc > m_wallet.m_default_max_tx_fee) {
nFeeCalc = m_wallet.m_default_max_tx_fee;
}
return nFeeCalc;
}
@ -274,9 +273,9 @@ bool CTransactionBuilder::Commit(bilingual_str& strResult)
CTransactionRef tx;
{
LOCK2(m_wallet->cs_wallet, cs_main);
LOCK2(m_wallet.cs_wallet, cs_main);
FeeCalculation fee_calc_out;
if (!m_wallet->CreateTransaction(vecSend, tx, nFeeRet, nChangePosRet, strResult, coinControl, fee_calc_out)) {
if (!m_wallet.CreateTransaction(vecSend, tx, nFeeRet, nChangePosRet, strResult, coinControl, fee_calc_out)) {
return false;
}
}
@ -313,8 +312,8 @@ bool CTransactionBuilder::Commit(bilingual_str& strResult)
}
{
LOCK2(m_wallet->cs_wallet, cs_main);
m_wallet->CommitTransaction(tx, {}, {});
LOCK2(m_wallet.cs_wallet, cs_main);
m_wallet.CommitTransaction(tx, {}, {});
}
fKeepKeys = true;

View File

@ -54,7 +54,7 @@ class CTransactionBuilderOutput
CScript script;
public:
CTransactionBuilderOutput(CTransactionBuilder* pTxBuilderIn, const std::shared_ptr<CWallet>& wallet, CAmount nAmountIn);
CTransactionBuilderOutput(CTransactionBuilder* pTxBuilderIn, CWallet& wallet, CAmount nAmountIn);
CTransactionBuilderOutput(CTransactionBuilderOutput&&) = delete;
CTransactionBuilderOutput& operator=(CTransactionBuilderOutput&&) = delete;
/// Get the scriptPubKey of this output
@ -77,7 +77,7 @@ public:
class CTransactionBuilder
{
/// Wallet the transaction will be build for
const std::shared_ptr<CWallet>& m_wallet;
CWallet& m_wallet;
/// See CTransactionBuilder() for initialization
CCoinControl coinControl;
/// Dummy since we anyway use tallyItem's destination as change destination in coincontrol.
@ -100,7 +100,7 @@ class CTransactionBuilder
friend class CTransactionBuilderOutput;
public:
CTransactionBuilder(const std::shared_ptr<CWallet>& wallet, const CompactTallyItem& tallyItemIn);
CTransactionBuilder(CWallet& wallet, const CompactTallyItem& tallyItemIn);
~CTransactionBuilder();
/// Check it would be possible to add a single output with the amount nAmount. Returns true if its possible and false if not.
bool CouldAddOutput(CAmount nAmountOutput) const EXCLUSIVE_LOCKS_REQUIRED(!cs_outputs);

View File

@ -314,8 +314,8 @@ void CRollingBloomFilter::insert(Span<const unsigned char> vKey)
/* FastMod works with the upper bits of h, so it is safe to ignore that the lower bits of h are already used for bit. */
uint32_t pos = FastRange32(h, data.size());
/* The lowest bit of pos is ignored, and set to zero for the first bit, and to one for the second. */
data[pos & ~1] = (data[pos & ~1] & ~(((uint64_t)1) << bit)) | ((uint64_t)(nGeneration & 1)) << bit;
data[pos | 1] = (data[pos | 1] & ~(((uint64_t)1) << bit)) | ((uint64_t)(nGeneration >> 1)) << bit;
data[pos & ~1U] = (data[pos & ~1U] & ~(uint64_t{1} << bit)) | (uint64_t(nGeneration & 1)) << bit;
data[pos | 1] = (data[pos | 1] & ~(uint64_t{1} << bit)) | (uint64_t(nGeneration >> 1)) << bit;
}
}
@ -326,7 +326,7 @@ bool CRollingBloomFilter::contains(Span<const unsigned char> vKey) const
int bit = h & 0x3F;
uint32_t pos = FastRange32(h, data.size());
/* If the relevant bit is not set in either data[pos & ~1] or data[pos | 1], the filter does not contain vKey */
if (!(((data[pos & ~1] | data[pos | 1]) >> bit) & 1)) {
if (!(((data[pos & ~1U] | data[pos | 1]) >> bit) & 1)) {
return false;
}
}

View File

@ -8,6 +8,7 @@
#ifndef BITCOIN_COMPAT_ASSUMPTIONS_H
#define BITCOIN_COMPAT_ASSUMPTIONS_H
#include <cstddef>
#include <limits>
// Assumption: We assume that the macro NDEBUG is not defined.

View File

@ -3,24 +3,24 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_COMPAT_H
#define BITCOIN_COMPAT_H
#ifndef BITCOIN_COMPAT_COMPAT_H
#define BITCOIN_COMPAT_COMPAT_H
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
// Windows defines FD_SETSIZE to 64 (see _fd_types.h in mingw-w64),
// which is too small for our usage, but allows us to redefine it safely.
// We redefine it to be 1024, to match glibc, see typesizes.h.
#ifdef WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifdef FD_SETSIZE
#undef FD_SETSIZE // prevent redefinition compiler warning
#undef FD_SETSIZE
#endif
#define FD_SETSIZE 1024 // max number of fds in fd_set
#define FD_SETSIZE 1024
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdint.h>
#include <cstdint>
#else
#include <fcntl.h>
#include <sys/mman.h>
@ -37,54 +37,46 @@
#include <unistd.h>
#endif
// We map Linux / BSD error functions and codes, to the equivalent
// Windows definitions, and use the WSA* names throughout our code.
// Note that glibc defines EWOULDBLOCK as EAGAIN (see errno.h).
#ifndef WIN32
typedef unsigned int SOCKET;
#include <errno.h>
#include <cerrno>
#define WSAGetLastError() errno
#define WSAEINVAL EINVAL
#define WSAEALREADY EALREADY
#define WSAEWOULDBLOCK EWOULDBLOCK
#define WSAEAGAIN EAGAIN
#define WSAEMSGSIZE EMSGSIZE
#define WSAEINTR EINTR
#define WSAEINPROGRESS EINPROGRESS
#define WSAEADDRINUSE EADDRINUSE
#define WSAENOTSOCK EBADF
#define INVALID_SOCKET (SOCKET)(~0)
#define SOCKET_ERROR -1
#define SD_SEND SHUT_WR
#else
#ifndef WSAEAGAIN
// WSAEAGAIN doesn't exist on Windows
#ifdef EAGAIN
#define WSAEAGAIN EAGAIN
#else
#define WSAEAGAIN WSAEWOULDBLOCK
#endif
#endif
#endif
#ifdef WIN32
#ifndef S_IRUSR
#define S_IRUSR 0400
#define S_IWUSR 0200
#endif
#else
// Windows defines MAX_PATH as it's maximum path length.
// We define MAX_PATH for use on non-Windows systems.
#ifndef WIN32
#define MAX_PATH 1024
#endif
// ssize_t is POSIX, and not present when using MSVC.
#ifdef _MSC_VER
#if !defined(ssize_t)
#ifdef _WIN64
typedef int64_t ssize_t;
#else
typedef int32_t ssize_t;
#endif
#endif
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif
#if HAVE_DECL_STRNLEN == 0
size_t strnlen( const char *start, size_t max_len);
#endif // HAVE_DECL_STRNLEN
// The type of the option value passed to getsockopt & setsockopt
// differs between Windows and non-Windows.
#ifndef WIN32
typedef void* sockopt_arg_type;
#else
@ -135,4 +127,4 @@ bool static inline IsSelectableSocket(const SOCKET& s) {
#define MSG_DONTWAIT 0
#endif
#endif // BITCOIN_COMPAT_H
#endif // BITCOIN_COMPAT_COMPAT_H

View File

@ -1,18 +0,0 @@
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
#include <cstring>
#if HAVE_DECL_STRNLEN == 0
size_t strnlen( const char *start, size_t max_len)
{
const char *end = (const char *)memchr(start, '\0', max_len);
return end ? (size_t)(end - start) : max_len;
}
#endif // HAVE_DECL_STRNLEN

View File

@ -1,5 +1,5 @@
AC_PREREQ([2.60])
AC_INIT([libdashbls],[1.3.4])
AC_INIT([libdashbls],[1.3.5])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux/m4])

View File

@ -59,6 +59,7 @@ public:
GTElement Pair(const G2Element &b) const;
uint32_t GetFingerprint(bool fLegacy = false) const;
std::vector<uint8_t> Serialize(bool fLegacy = false) const;
std::array<uint8_t, SIZE> SerializeToArray(bool fLegacy = false) const;
G1Element Copy();
friend bool operator==(const G1Element &a, const G1Element &b);
@ -102,6 +103,7 @@ public:
G2Element Negate() const;
GTElement Pair(const G1Element &a) const;
std::vector<uint8_t> Serialize(bool fLegacy = false) const;
std::array<uint8_t, G2Element::SIZE> SerializeToArray(bool fLegacy = false) const;
G2Element Copy();
friend bool operator==(G2Element const &a, G2Element const &b);
@ -127,6 +129,7 @@ public:
void Serialize(uint8_t *buffer) const;
std::vector<uint8_t> Serialize() const;
std::array<uint8_t, SIZE> SerializeToArray() const;
friend bool operator==(GTElement const &a, GTElement const &b);
friend bool operator!=(GTElement const &a, GTElement const &b);

View File

@ -82,6 +82,7 @@ class PrivateKey {
// Serialize the key into bytes
void Serialize(uint8_t *buffer) const;
std::vector<uint8_t> Serialize(bool fLegacy = false) const;
std::array<uint8_t, PrivateKey::PRIVATE_KEY_SIZE> SerializeToArray(bool fLegacy = false) const;
G2Element SignG2(
const uint8_t *msg,

View File

@ -171,11 +171,16 @@ uint32_t G1Element::GetFingerprint(const bool fLegacy) const
}
std::vector<uint8_t> G1Element::Serialize(const bool fLegacy) const {
const auto arr = G1Element::SerializeToArray(fLegacy);
return std::vector<uint8_t>{arr.begin(), arr.end()};
}
std::array<uint8_t, G1Element::SIZE> G1Element::SerializeToArray(const bool fLegacy) const {
uint8_t buffer[G1Element::SIZE + 1];
g1_write_bin(buffer, G1Element::SIZE + 1, p, 1);
std::array<uint8_t, G1Element::SIZE> result{};
if (buffer[0] == 0x00) { // infinity
std::vector<uint8_t> result(G1Element::SIZE, 0);
result[0] = 0xc0;
return result;
}
@ -187,7 +192,9 @@ std::vector<uint8_t> G1Element::Serialize(const bool fLegacy) const {
if (!fLegacy) {
buffer[1] |= 0x80; // indicate compression
}
return std::vector<uint8_t>(buffer + 1, buffer + 1 + G1Element::SIZE);
std::copy_n(buffer + 1, G1Element::SIZE, result.begin());
return result;
}
bool operator==(const G1Element & a, const G1Element &b)
@ -386,11 +393,18 @@ G2Element G2Element::Negate() const
GTElement G2Element::Pair(const G1Element& a) const { return a & (*this); }
std::vector<uint8_t> G2Element::Serialize(const bool fLegacy) const {
const auto arr = G2Element::SerializeToArray(fLegacy);
return std::vector<uint8_t>{arr.begin(), arr.end()};
}
std::array<uint8_t, G2Element::SIZE> G2Element::SerializeToArray(const bool fLegacy) const {
uint8_t buffer[G2Element::SIZE + 1];
g2_write_bin(buffer, G2Element::SIZE + 1, (g2_st*)q, 1);
std::array<uint8_t, G2Element::SIZE> result{};
if (buffer[0] == 0x00) { // infinity
std::vector<uint8_t> result(G2Element::SIZE, 0);
result.fill(0);
result[0] = 0xc0;
return result;
}
@ -410,7 +424,6 @@ std::vector<uint8_t> G2Element::Serialize(const bool fLegacy) const {
}
}
std::vector<uint8_t> result(G2Element::SIZE, 0);
if (fLegacy) {
std::memcpy(result.data(), buffer + 1, G2Element::SIZE);
} else {
@ -551,4 +564,11 @@ std::vector<uint8_t> GTElement::Serialize() const
return data;
}
std::array<uint8_t, GTElement::SIZE> GTElement::SerializeToArray() const
{
std::array<uint8_t, GTElement::SIZE> data{};
Serialize(data.data());
return data;
}
} // end namespace bls

View File

@ -284,6 +284,13 @@ std::vector<uint8_t> PrivateKey::Serialize(const bool fLegacy) const
return data;
}
std::array<uint8_t, PrivateKey::PRIVATE_KEY_SIZE> PrivateKey::SerializeToArray(bool fLegacy) const
{
std::array<uint8_t, PRIVATE_KEY_SIZE> data{};
Serialize(data.data());
return data;
}
G2Element PrivateKey::SignG2(
const uint8_t *msg,
size_t len,

View File

@ -31,21 +31,21 @@ using namespace bls;
void benchSigs() {
string testName = "Signing";
const int numIters = 5000;
PrivateKey sk = AugSchemeMPL().KeyGen(getRandomSeed());
PrivateKey sk = BasicSchemeMPL().KeyGen(getRandomSeed());
vector<uint8_t> message1 = sk.GetG1Element().Serialize();
auto start = startStopwatch();
for (int i = 0; i < numIters; i++) {
AugSchemeMPL().Sign(sk, message1);
BasicSchemeMPL().Sign(sk, message1);
}
endStopwatch(testName, start, numIters);
}
void benchVerification() {
string testName = "Verification";
const int numIters = 10000;
PrivateKey sk = AugSchemeMPL().KeyGen(getRandomSeed());
const int numIters = 1000;
PrivateKey sk = BasicSchemeMPL().KeyGen(getRandomSeed());
G1Element pk = sk.GetG1Element();
std::vector<G2Element> sigs;
@ -54,7 +54,7 @@ void benchVerification() {
uint8_t message[4];
Util::IntToFourBytes(message, i);
vector<uint8_t> messageBytes(message, message + 4);
sigs.push_back(AugSchemeMPL().Sign(sk, messageBytes));
sigs.push_back(BasicSchemeMPL().Sign(sk, messageBytes));
}
auto start = startStopwatch();
@ -62,34 +62,36 @@ void benchVerification() {
uint8_t message[4];
Util::IntToFourBytes(message, i);
vector<uint8_t> messageBytes(message, message + 4);
bool ok = AugSchemeMPL().Verify(pk, messageBytes, sigs[i]);
bool ok = BasicSchemeMPL().Verify(pk, messageBytes, sigs[i]);
ASSERT(ok);
}
endStopwatch(testName, start, numIters);
}
void benchBatchVerification() {
const int numIters = 100000;
const int numIters = 10000;
vector<vector<uint8_t>> sig_bytes;
vector<vector<uint8_t>> pk_bytes;
vector<vector<uint8_t>> ms;
auto start = startStopwatch();
for (int i = 0; i < numIters; i++) {
uint8_t message[4];
Util::IntToFourBytes(message, i);
vector<uint8_t> messageBytes(message, message + 4);
PrivateKey sk = AugSchemeMPL().KeyGen(getRandomSeed());
PrivateKey sk = BasicSchemeMPL().KeyGen(getRandomSeed());
G1Element pk = sk.GetG1Element();
sig_bytes.push_back(AugSchemeMPL().Sign(sk, messageBytes).Serialize());
sig_bytes.push_back(BasicSchemeMPL().Sign(sk, messageBytes).Serialize());
pk_bytes.push_back(pk.Serialize());
ms.push_back(messageBytes);
}
endStopwatch("Batch verification preparation", start, numIters);
vector<G1Element> pks;
pks.reserve(numIters);
auto start = startStopwatch();
start = startStopwatch();
for (auto const& pk : pk_bytes) {
pks.emplace_back(G1Element::FromBytes(Bytes(pk)));
}
@ -105,52 +107,71 @@ void benchBatchVerification() {
endStopwatch("Signature validation", start, numIters);
start = startStopwatch();
G2Element aggSig = AugSchemeMPL().Aggregate(sigs);
G2Element aggSig = BasicSchemeMPL().Aggregate(sigs);
endStopwatch("Aggregation", start, numIters);
start = startStopwatch();
bool ok = AugSchemeMPL().AggregateVerify(pks, ms, aggSig);
bool ok = BasicSchemeMPL().AggregateVerify(pks, ms, aggSig);
ASSERT(ok);
endStopwatch("Batch verification", start, numIters);
}
void benchFastAggregateVerification() {
const int numIters = 5000;
vector<G2Element> sigs;
vector<G1Element> pks;
vector<uint8_t> message = {1, 2, 3, 4, 5, 6, 7, 8};
vector<G2Element> pops;
for (int i = 0; i < numIters; i++) {
PrivateKey sk = PopSchemeMPL().KeyGen(getRandomSeed());
G1Element pk = sk.GetG1Element();
sigs.push_back(PopSchemeMPL().Sign(sk, message));
pops.push_back(PopSchemeMPL().PopProve(sk));
pks.push_back(pk);
}
void benchSerialize() {
const int numIters = 5000000;
PrivateKey sk = BasicSchemeMPL().KeyGen(getRandomSeed());
G1Element pk = sk.GetG1Element();
vector<uint8_t> message = sk.GetG1Element().Serialize();
G2Element sig = BasicSchemeMPL().Sign(sk, message);
auto start = startStopwatch();
G2Element aggSig = PopSchemeMPL().Aggregate(sigs);
endStopwatch("PopScheme Aggregation", start, numIters);
for (int i = 0; i < numIters; i++) {
sk.Serialize();
}
endStopwatch("Serialize PrivateKey", start, numIters);
start = startStopwatch();
for (int i = 0; i < numIters; i++) {
bool ok = PopSchemeMPL().PopVerify(pks[i], pops[i]);
ASSERT(ok);
pk.Serialize();
}
endStopwatch("PopScheme Proofs verification", start, numIters);
endStopwatch("Serialize G1Element", start, numIters);
start = startStopwatch();
bool ok = PopSchemeMPL().FastAggregateVerify(pks, message, aggSig);
ASSERT(ok);
endStopwatch("PopScheme verification", start, numIters);
for (int i = 0; i < numIters; i++) {
sig.Serialize();
}
endStopwatch("Serialize G2Element", start, numIters);
}
void benchSerializeToArray() {
const int numIters = 5000000;
PrivateKey sk = BasicSchemeMPL().KeyGen(getRandomSeed());
G1Element pk = sk.GetG1Element();
vector<uint8_t> message = sk.GetG1Element().Serialize();
G2Element sig = BasicSchemeMPL().Sign(sk, message);
auto start = startStopwatch();
for (int i = 0; i < numIters; i++) {
sk.SerializeToArray();
}
endStopwatch("SerializeToArray PrivateKey", start, numIters);
start = startStopwatch();
for (int i = 0; i < numIters; i++) {
pk.SerializeToArray();
}
endStopwatch("SerializeToArray G1Element", start, numIters);
start = startStopwatch();
for (int i = 0; i < numIters; i++) {
sig.SerializeToArray();
}
endStopwatch("SerializeToArray G2Element", start, numIters);
}
int main(int argc, char* argv[]) {
benchSigs();
benchVerification();
benchBatchVerification();
benchFastAggregateVerification();
benchSerialize();
benchSerializeToArray();
}

View File

@ -93,7 +93,7 @@ void CDSNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, con
m_llmq_ctx->isman->UpdatedBlockTip(pindexNew);
m_llmq_ctx->clhandler->UpdatedBlockTip();
m_llmq_ctx->qman->UpdatedBlockTip(pindexNew, fInitialDownload);
m_llmq_ctx->qman->UpdatedBlockTip(pindexNew, m_connman, fInitialDownload);
m_llmq_ctx->qdkgsman->UpdatedBlockTip(pindexNew, fInitialDownload);
m_llmq_ctx->ehfSignalsHandler->UpdatedBlockTip(pindexNew, /* is_masternode = */ m_mn_activeman != nullptr);
@ -107,7 +107,7 @@ void CDSNotificationInterface::TransactionAddedToMempool(const CTransactionRef&
{
assert(m_cj_ctx && m_llmq_ctx);
m_llmq_ctx->isman->TransactionAddedToMempool(ptx);
m_llmq_ctx->isman->TransactionAddedToMempool(m_peerman, ptx);
m_llmq_ctx->clhandler->TransactionAddedToMempool(ptx, nAcceptTime);
m_cj_ctx->dstxman->TransactionAddedToMempool(ptx);
}

View File

@ -112,24 +112,29 @@ void CCreditPoolManager::AddToCache(const uint256& block_hash, int height, const
}
}
static std::optional<CBlock> GetBlockForCreditPool(const CBlockIndex* const block_index, const Consensus::Params& consensusParams)
static std::optional<CBlock> GetBlockForCreditPool(const gsl::not_null<const CBlockIndex*> block_index,
const Consensus::Params& consensusParams)
{
// There's no CbTx before DIP0003 activation
if (!DeploymentActiveAt(*block_index, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0003)) {
return std::nullopt;
}
CBlock block;
if (!ReadBlockFromDisk(block, block_index, consensusParams)) {
throw std::runtime_error("failed-getcbforblock-read");
}
assert(!block.vtx.empty());
// Should not fail if V20 (DIP0027) is active but it happens for RegChain (unit tests)
if (!block.vtx[0]->IsSpecialTxVersion()) return std::nullopt;
assert(!block.vtx[0]->vExtraPayload.empty());
if (block.vtx.empty() || block.vtx[0]->vExtraPayload.empty() || !block.vtx[0]->IsSpecialTxVersion()) {
LogPrintf("%s: ERROR: empty CbTx for CreditPool at height=%d\n", __func__, block_index->nHeight);
return std::nullopt;
}
return block;
}
CCreditPool CCreditPoolManager::ConstructCreditPool(const CBlockIndex* const block_index, CCreditPool prev, const Consensus::Params& consensusParams)
CCreditPool CCreditPoolManager::ConstructCreditPool(const gsl::not_null<const CBlockIndex*> block_index,
CCreditPool prev, const Consensus::Params& consensusParams)
{
std::optional<CBlock> block = GetBlockForCreditPool(block_index, consensusParams);
if (!block) {
@ -210,7 +215,7 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const CBlockIndex* const blo
CCreditPool CCreditPoolManager::GetCreditPool(const CBlockIndex* block_index, const Consensus::Params& consensusParams)
{
std::stack<const CBlockIndex *> to_calculate;
std::stack<gsl::not_null<const CBlockIndex*>> to_calculate;
std::optional<CCreditPool> poolTmp;
while (block_index != nullptr && !(poolTmp = GetFromCache(*block_index)).has_value()) {

View File

@ -16,6 +16,7 @@
#include <evo/assetlocktx.h>
#include <gsl/pointers.h>
#include <optional>
#include <unordered_set>
@ -134,7 +135,8 @@ private:
std::optional<CCreditPool> GetFromCache(const CBlockIndex& block_index);
void AddToCache(const uint256& block_hash, int height, const CCreditPool& pool);
CCreditPool ConstructCreditPool(const CBlockIndex* block_index, CCreditPool prev, const Consensus::Params& consensusParams);
CCreditPool ConstructCreditPool(const gsl::not_null<const CBlockIndex*> block_index, CCreditPool prev,
const Consensus::Params& consensusParams);
};
std::optional<CCreditPoolDiff> GetCreditPoolDiffForBlock(CCreditPoolManager& cpoolman, const BlockManager& blockman, const llmq::CQuorumManager& qman,

View File

@ -30,7 +30,6 @@ class CBlock;
class CBlockIndex;
class CChainState;
class CCoinsViewCache;
class CConnman;
class CEvoDB;
class TxValidationState;
@ -583,7 +582,6 @@ private:
std::atomic<int> to_cleanup {0};
CChainState& m_chainstate;
CConnman& connman;
CEvoDB& m_evoDb;
std::unordered_map<uint256, CDeterministicMNList, StaticSaltedHasher> mnListsCache GUARDED_BY(cs);
@ -592,8 +590,11 @@ private:
const CBlockIndex* m_initial_snapshot_index GUARDED_BY(cs) {nullptr};
public:
explicit CDeterministicMNManager(CChainState& chainstate, CConnman& _connman, CEvoDB& evoDb) :
m_chainstate(chainstate), connman(_connman), m_evoDb(evoDb) {}
explicit CDeterministicMNManager(CChainState& chainstate, CEvoDB& evoDb) :
m_chainstate(chainstate),
m_evoDb(evoDb)
{
}
~CDeterministicMNManager() = default;
bool ProcessBlock(const CBlock& block, gsl::not_null<const CBlockIndex*> pindex, BlockValidationState& state,

View File

@ -7,7 +7,6 @@
#include <bls/bls.h>
#include <chain.h>
#include <chainparams.h>
#include <deploymentstatus.h>
#include <evo/deterministicmns.h>
#include <llmq/utils.h>
#include <masternode/meta.h>
@ -19,8 +18,7 @@
#include <util/time.h>
#include <validation.h>
void CMNAuth::PushMNAUTH(CNode& peer, CConnman& connman, const CActiveMasternodeManager& mn_activeman,
const CBlockIndex* tip)
void CMNAuth::PushMNAUTH(CNode& peer, CConnman& connman, const CActiveMasternodeManager& mn_activeman)
{
CMNAuth mnauth;
if (mn_activeman.GetProTxHash().IsNull()) {
@ -41,9 +39,8 @@ void CMNAuth::PushMNAUTH(CNode& peer, CConnman& connman, const CActiveMasternode
if (Params().NetworkIDString() != CBaseChainParams::MAIN && gArgs.IsArgSet("-pushversion")) {
nOurNodeVersion = gArgs.GetArg("-pushversion", PROTOCOL_VERSION);
}
const bool is_basic_scheme_active{DeploymentActiveAfter(tip, Params().GetConsensus(), Consensus::DEPLOYMENT_V19)};
auto pk = mn_activeman.GetPubKey();
const CBLSPublicKeyVersionWrapper pubKey(pk, !is_basic_scheme_active);
const CBLSPublicKey pubKey(pk);
uint256 signHash = [&]() {
if (peer.nVersion < MNAUTH_NODE_VER_VERSION || nOurNodeVersion < MNAUTH_NODE_VER_VERSION) {
return ::SerializeHash(std::make_tuple(pubKey, receivedMNAuthChallenge, peer.IsInboundConn()));
@ -61,7 +58,7 @@ void CMNAuth::PushMNAUTH(CNode& peer, CConnman& connman, const CActiveMasternode
}
PeerMsgRet CMNAuth::ProcessMessage(CNode& peer, ServiceFlags node_services, CConnman& connman, CMasternodeMetaMan& mn_metaman, const CActiveMasternodeManager* const mn_activeman,
const CChain& active_chain, const CMasternodeSync& mn_sync, const CDeterministicMNList& tip_mn_list,
const CMasternodeSync& mn_sync, const CDeterministicMNList& tip_mn_list,
std::string_view msg_type, CDataStream& vRecv)
{
assert(mn_metaman.IsValid());
@ -106,9 +103,7 @@ PeerMsgRet CMNAuth::ProcessMessage(CNode& peer, ServiceFlags node_services, CCon
if (Params().NetworkIDString() != CBaseChainParams::MAIN && gArgs.IsArgSet("-pushversion")) {
nOurNodeVersion = gArgs.GetArg("-pushversion", PROTOCOL_VERSION);
}
const CBlockIndex* tip = active_chain.Tip();
const bool is_basic_scheme_active{DeploymentActiveAfter(tip, Params().GetConsensus(), Consensus::DEPLOYMENT_V19)};
ConstCBLSPublicKeyVersionWrapper pubKey(dmn->pdmnState->pubKeyOperator.Get(), !is_basic_scheme_active);
const CBLSPublicKey pubKey(dmn->pdmnState->pubKeyOperator.Get());
// See comment in PushMNAUTH (fInbound is negated here as we're on the other side of the connection)
if (peer.nVersion < MNAUTH_NODE_VER_VERSION || nOurNodeVersion < MNAUTH_NODE_VER_VERSION) {
signHash = ::SerializeHash(std::make_tuple(pubKey, peer.GetSentMNAuthChallenge(), !peer.IsInboundConn()));

View File

@ -11,7 +11,6 @@
class CActiveMasternodeManager;
class CBlockIndex;
class CChain;
class CConnman;
class CDataStream;
class CDeterministicMNList;
@ -50,15 +49,14 @@ public:
READWRITE(obj.proRegTxHash, obj.sig);
}
static void PushMNAUTH(CNode& peer, CConnman& connman, const CActiveMasternodeManager& mn_activeman,
const CBlockIndex* tip);
static void PushMNAUTH(CNode& peer, CConnman& connman, const CActiveMasternodeManager& mn_activeman);
/**
* @pre CMasternodeMetaMan's database must be successfully loaded before
* attempting to call this function regardless of sync state
*/
static PeerMsgRet ProcessMessage(CNode& peer, ServiceFlags node_services, CConnman& connman, CMasternodeMetaMan& mn_metaman, const CActiveMasternodeManager* const mn_activeman,
const CChain& active_chain, const CMasternodeSync& mn_sync, const CDeterministicMNList& tip_mn_list,
const CMasternodeSync& mn_sync, const CDeterministicMNList& tip_mn_list,
std::string_view msg_type, CDataStream& vRecv);
static void NotifyMasternodeListChanged(bool undo, const CDeterministicMNList& oldMNList, const CDeterministicMNListDiff& diff, CConnman& connman);
};

View File

@ -267,16 +267,20 @@ bool CSpecialTxProcessor::CheckCreditPoolDiffForBlock(const CBlock& block, const
try {
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_DIP0003)) return true;
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_DIP0008)) return true;
if (!DeploymentActiveAt(*pindex, m_consensus_params, Consensus::DEPLOYMENT_V20)) return true;
auto creditPoolDiff = GetCreditPoolDiffForBlock(m_cpoolman, m_chainman.m_blockman, m_qman, block, pindex->pprev, m_consensus_params, blockSubsidy, state);
if (!creditPoolDiff.has_value()) return false;
// If we get there we have v20 activated and credit pool amount must be included in block CbTx
if (block.vtx.empty()) {
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-missing-cbtx");
}
const auto& tx = *block.vtx[0];
assert(tx.IsCoinBase());
assert(tx.IsSpecialTxVersion());
assert(tx.nType == TRANSACTION_COINBASE);
if (!tx.IsCoinBase() || !tx.IsSpecialTxVersion() || tx.nType != TRANSACTION_COINBASE) {
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-cbtx-type");
}
const auto opt_cbTx = GetTxPayload<CCbTx>(tx);
if (!opt_cbTx) {

View File

@ -39,7 +39,7 @@ private:
{
// LOCK(objToSave.cs);
int64_t nStart = GetTimeMillis();
const auto start{SteadyClock::now()};
// serialize, checksum data up to that point, then append checksum
CDataStream ssObj(SER_DISK, CLIENT_VERSION);
@ -65,7 +65,7 @@ private:
}
fileout.fclose();
LogPrintf("Written info to %s %dms\n", strFilename, GetTimeMillis() - nStart);
LogPrintf("Written info to %s %dms\n", strFilename, Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
LogPrintf(" %s\n", objToSave.ToString());
return true;
@ -75,7 +75,7 @@ private:
{
//LOCK(objToLoad.cs);
int64_t nStart = GetTimeMillis();
const auto start{SteadyClock::now()};
// open input file, and associate with CAutoFile
FILE *file = fsbridge::fopen(pathDB, "rb");
CAutoFile filein(file, SER_DISK, CLIENT_VERSION);
@ -149,7 +149,7 @@ private:
return ReadResult::IncorrectFormat;
}
LogPrintf("Loaded info from %s %dms\n", strFilename, GetTimeMillis() - nStart);
LogPrintf("Loaded info from %s %dms\n", strFilename, Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
LogPrintf(" %s\n", objToLoad.ToString());
return ReadResult::Ok;
@ -193,11 +193,11 @@ public:
T tmpObjToLoad;
if (!Read(tmpObjToLoad)) return false;
int64_t nStart = GetTimeMillis();
const auto start{SteadyClock::now()};
LogPrintf("Writing info to %s...\n", strFilename);
const bool ret = CoreWrite(objToSave);
LogPrintf("%s dump finished %dms\n", strFilename, GetTimeMillis() - nStart);
LogPrintf("%s dump finished %dms\n", strFilename, Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
return ret;
}

View File

@ -11,9 +11,6 @@
#include <sys/utsname.h>
#include <unistd.h>
#else
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <codecvt>
#include <limits>
#include <windows.h>

View File

@ -1432,11 +1432,12 @@ void CGovernanceManager::AddCachedTriggers()
void CGovernanceManager::InitOnLoad()
{
LOCK(cs);
int64_t nStart = GetTimeMillis();
const auto start{SteadyClock::now()};
LogPrintf("Preparing masternode indexes and governance triggers...\n");
RebuildIndexes();
AddCachedTriggers();
LogPrintf("Masternode indexes and governance triggers prepared %dms\n", GetTimeMillis() - nStart);
LogPrintf("Masternode indexes and governance triggers prepared %dms\n",
Ticks<std::chrono::milliseconds>(SteadyClock::now() - start));
LogPrintf(" %s\n", ToString());
}

View File

@ -10,7 +10,7 @@
#include <chainparamsbase.h>
#include <netbase.h>
#include <node/ui_interface.h>
#include <node/interface_ui.h>
#include <rpc/protocol.h> // For HTTP status codes
#include <shutdown.h>
#include <sync.h>

View File

@ -3,7 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <chainparams.h>
#include <compat.h>
#include <compat/compat.h>
#include <compat/endian.h>
#include <crypto/sha256.h>
#include <fs.h>

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_I2P_H
#define BITCOIN_I2P_H
#include <compat.h>
#include <compat/compat.h>
#include <fs.h>
#include <netaddress.h>
#include <sync.h>

Some files were not shown because too many files have changed in this diff Show More