Dash - Reinventing Cryptocurrency
Go to file
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
.github Squashed 'src/dashbls/' changes from 4e070243ae..7e747e8a07 2024-12-04 16:04:26 +00:00
.tx fix: follow-up #5393 - should be used [dash.dash_ents] (#5472) 2023-07-01 14:16:50 +03:00
build-aux/m4 Merge bitcoin/bitcoin#29859: build: Fix false positive CHECK_ATOMIC test 2024-10-26 12:29:51 -05:00
ci partial bitcoin#25288: Reliably don't start itself (lint-all.py runs all tests twice) 2024-12-04 15:55:11 +00:00
contrib merge bitcoin#23506: Make more shell scripts verifiable by the shellcheck tool 2024-12-04 15:55:11 +00:00
depends merge bitcoin#30198: qt 5.15.14 and fix macOS build with Clang 18 2024-11-17 07:42:09 +00:00
doc Merge #6325: feat: start DIP0024 from block 1 - fire up test chains by first block - 7/n 2024-12-10 09:43:02 -06:00
share merge bitcoin#27676: Bump minimum required runtime version and prepare for building with upstream LLVM 2024-11-13 11:07:38 +00:00
src Merge #6470: fix: wrong lock order, observed locally on top of #6467 with custom changes 2024-12-10 22:35:56 -06:00
test Merge #6466: backport: merge bitcoin#18642, #25102, #25100, #25157, #25101, #25245, #25456, #24697, #24662, #25499 (clock backports) 2024-12-10 22:27:43 -06:00
.cirrus.yml merge bitcoin#27676: Bump minimum required runtime version and prepare for building with upstream LLVM 2024-11-13 11:07:38 +00:00
.dockerignore build: add dash minimal development environment container 2021-12-21 12:43:37 +05:30
.editorconfig Merge #21123: code style: Add EditorConfig file 2021-07-16 10:04:09 -05:00
.gitattributes Separate protocol versioning from clientversion 2014-10-29 00:24:40 -04:00
.gitignore merge bitcoin#24031: don't compress macOS DMG 2024-11-06 19:22:01 +00:00
.gitlab-ci.yml merge bitcoin#28622: use macOS 14 SDK (Xcode 15.0) 2024-11-16 02:24:19 +00:00
.python-version partial Merge bitcoin/bitcoin#28210: build: Bump clang minimum supported version to 13 2024-10-06 13:36:27 -05:00
.style.yapf Merge bitcoin/bitcoin#27802: Update .style.yapf 2024-10-25 09:12:00 -05:00
autogen.sh Merge bitcoin/bitcoin#27875: build: make sure we can overwrite config.{guess,sub} before doing so 2024-10-25 09:12:01 -05:00
CMakeLists.txt Squashed 'src/immer/' changes from 9cb6a5a845..5875f7739a 2024-11-02 17:50:50 +00:00
configure.ac Squashed 'src/dashbls/' changes from 4e070243ae..7e747e8a07 2024-12-04 16:04:26 +00:00
CONTRIBUTING.md Merge #6220: backport: Merge bitcoin#18448,24433, 24139, 23001, (partial) 24339, (partial) core/gui#420 2024-09-27 12:29:08 -05:00
COPYING docs: update license year range to 2024 (#5890) 2024-02-22 20:56:43 -06:00
INSTALL.md Dashify INSTALL.md and build-unix.md 2018-01-12 16:12:54 +01:00
libdashconsensus.pc.in revert dash#1432: Rename consensus source library and API 2022-08-09 14:16:28 +05:30
Makefile.am merge bitcoin#22861: Update test README and lint script 2024-11-27 04:55:46 +00:00
README.md doc: make build steps more prominent 2024-07-18 01:22:42 -06:00
SECURITY.md docs: update supported versions in SECURITY.md 2024-12-07 07:58:19 +00:00

Dash Core staging tree

CI master develop
Gitlab Build Status Build Status

https://www.dash.org

For an immediately usable, binary version of the Dash Core software, see https://www.dash.org/downloads/.

Further information about Dash Core is available in ./doc/.

What is Dash?

Dash is an experimental digital currency that enables instant, private payments to anyone, anywhere in the world. Dash uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Dash Core is the name of the open source software which enables the use of this currency.

For more information read the original Dash whitepaper.

License

Dash Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

Development Process

The master branch is meant to be stable. Development is normally done in separate branches. Tags are created to indicate new official, stable release versions of Dash Core.

The develop branch is regularly built (see doc/build-*.md for instructions) and tested, but is not guaranteed to be completely stable.

The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.

Build / Compile from Source

The ./configure, make, and cmake steps, as well as build dependencies, are in ./doc/ as well:

Testing

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.

Automated Testing

Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: make check. Further details on running and extending unit tests can be found in /src/test/README.md.

There are also regression and integration tests, written in Python. These tests can be run (if the test dependencies are installed) with: test/functional/test_runner.py

The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.

Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.

Translations

Changes to translations as well as new translations can be submitted to Dash Core's Transifex page.

Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.

Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.