The locking order defined in the avalanche processor and peer manager is
currently cs_peerManager->cs_main. This makes it very difficult to call
from the network layer because most of the large functions here are
locking cs_main, causing a lock order issue
cs_main->cs_peerManager->cs_main.
This diff reverse the lock order to always use cs_main->cs_peerManager
at the expense of a holding cs_main for longer. This is done by passing
down the coins view needed to verify the utxos where it is needed.
Details
Details
- Reviewers
deadalnix - Group Reviewers
Restricted Project
With clang and debug enabled:
ninja all check-all
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- avalanche_reverse_lock_order
- Lint
Lint Errors Severity Location Code Message Error src/avalanche/test/processor_tests.cpp:424 CPPCHECK containerOutOfBounds Error src/avalanche/test/processor_tests.cpp:425 CPPCHECK containerOutOfBounds Error src/avalanche/test/processor_tests.cpp:445 CPPCHECK containerOutOfBounds Error src/avalanche/test/processor_tests.cpp:446 CPPCHECK containerOutOfBounds - Unit
No Test Coverage - Build Status
Buildable 15682 Build 31268: Build Diff build-clang-tidy · build-without-wallet · lint-circular-dependencies · build-diff · build-debug · build-clang Build 31267: arc lint + arc unit
Event Timeline
Comment Actions
That is a significant step backward. The contention on cs_main is obviously far greater than the one on the peer manager. What alternative have you considered? Why do they fail?