Page MenuHomePhabricator

mempool, validation: Explain cs_main locking semantics
ClosedPublic

Authored by fpelliccioni on Oct 8 2019, 19:09.

Details

Summary

Both the chain state and the transaction pool are validation specific, but access to them is protected by two locks. The two locks have the following semantics:

Backport of Bitcoin Core PR14963
https://github.com/bitcoin/bitcoin/pull/14963

Test Plan
  1. Build with Clang in Debug mode:
CXX=clang++ CC=clang cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug
ninja check-all
  1. Verify that the compiler has not emitted a thread-safety warning.
  2. Run the node: ./src/bitcoind -regtest
  3. Verify that text similar to "Assertion failed: lock ... not held ..." is not printed on stderr.
  1. Run benchmarks:
cmake .. -GNinja
ninja bench-bitcoin
./src/bench/bitcoin-bench

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I don't know what happened with Squash... I lost some of the changes...

fpelliccioni edited the test plan for this revision. (Show Details)

fix squashing

This revision is now accepted and ready to land.Oct 9 2019, 12:44