Commit Graph

16589 Commits

Author SHA1 Message Date
sasha 01d5576a97
Merge pull request #5951 from str4d/book-platform-policy
book: Add platform support information and tier policy.

Admin merge requested by @str4d
2022-05-24 17:50:53 -07:00
Kris Nuttycombe cecd228fed
Merge pull request #5965 from nuttycom/bug/orchard_final_root_before_nu5_active
Revert "Only return active protocol components from z_gettreestate."
2022-05-24 10:48:08 -06:00
Kris Nuttycombe de934950c3 Only return `skipHash` for Orchard & Sapling roots at heights >= activation. 2022-05-24 07:53:29 -06:00
Jack Grigg dd51f0995e book: Add FreeBSD to tier 3 platforms list 2022-05-24 13:40:15 +00:00
Jack Grigg a94b26f029 book: Capitalize key words in platform tier policy 2022-05-24 13:11:12 +00:00
Kris Nuttycombe 00c0c03912 Revert "Only return active protocol components from z_gettreestate."
This reverts commit c44e58ea51.
2022-05-17 13:04:36 -06:00
Steven a45c2a2d4e
Merge pull request #5963 from nuttycom/bug/orchard_final_root_before_nu5_active
Do not return Orchard components from z_gettreestate before NU5 activation.
2022-05-17 07:10:07 -07:00
Kris Nuttycombe c44e58ea51 Only return active protocol components from z_gettreestate.
This adds checks that exclude both the Sapling and Orchard
portions of the result if the associated network upgrades
are not yet active.

Fixes #5957
2022-05-16 18:33:27 -06:00
Kris Nuttycombe 46c41f531f
Merge pull request #5961 from ebfull/fix-wallet-doc
Fix "transparent" example that should be "p2pkh"
2022-05-16 14:28:34 -06:00
Sean Bowe bb9518b1b4
Fix "transparent" example that should be "p2pkh" 2022-05-16 08:19:59 -06:00
str4d 09b02bedc9
Merge pull request #5057 from str4d/sync-backports
Sync backports
2022-05-14 04:36:37 +01:00
str4d 202203a3fa
Merge pull request #5959 from str4d/improve-thread-names
Improve thread names
2022-05-14 02:27:24 +01:00
MarcoFalke 31522012c2 doc: Add comment to cs_main and mempool::cs
(cherry picked from commit bitcoin/bitcoin@fa5c346c5a)
2022-05-14 01:25:08 +00:00
MarcoFalke d12488d694 sync: Add RecursiveMutex type alias
(cherry picked from commit bitcoin/bitcoin@fac4558462)
2022-05-14 01:25:08 +00:00
Russell Yanofsky fcd0b28616 scripted-diff: Small locking rename
Call sync.h primitives "locks" and "mutexes" instead of "blocks" and "waitable
critical sections" to match current coding conventions and c++11 standard
names.

This PR does not rename the "CCriticalSection" class (though this could be done
as a followup) because it is used everywhere and would swamp the other changes
in this PR. Plain mutexes should mostly be preferred instead of recursive
mutexes in new code anyway.

-BEGIN VERIFY SCRIPT-
set -x
set -e
ren() { git grep -l $1 | xargs sed -i s/$1/$2/; }
ren CCriticalBlock           UniqueLock
ren CWaitableCriticalSection Mutex
ren CConditionVariable       std::condition_variable
ren cs_GenesisWait           g_genesis_wait_mutex
ren condvar_GenesisWait      g_genesis_wait_cv
perl -0777 -pi -e 's/.*typedef.*condition_variable.*\n\n?//g' src/sync.h
-END VERIFY SCRIPT-

(cherry picked from commit bitcoin/bitcoin@190bf62be1)
2022-05-14 01:25:08 +00:00
Russell Yanofsky f17e43d61e Use LOCK macros for non-recursive locks
Instead of std::unique_lock.

Zcash: Excluding locks in code we haven't backported yet.

(cherry picked from commit bitcoin/bitcoin@9c4dc597dd)
2022-05-14 01:25:08 +00:00
Russell Yanofsky 28adc47fcd Make LOCK, LOCK2, TRY_LOCK work with CWaitableCriticalSection
They should also work with any other mutex type which std::unique_lock
supports.

There is no change in behavior for current code that calls these macros with
CCriticalSection mutexes.

(cherry picked from commit bitcoin/bitcoin@1382913e61)
2022-05-14 01:25:08 +00:00
Russell Yanofsky 016c139c80 MOVEONLY Move AnnotatedMixin declaration
Move AnnotatedMixin closer to where it's used, and after the DEBUG_LOCKORDER
function declarations so it can call them.

(cherry picked from commit bitcoin/bitcoin@ba1f095aad)
2022-05-14 01:25:08 +00:00
Russell Yanofsky 9ff8ae6419 Add unit test for DEBUG_LOCKORDER code
(cherry picked from commit bitcoin/bitcoin@41b88e9337)
2022-05-14 01:25:08 +00:00
Jesse Cohen 336ed85f65 Annotate AssertLockHeld() with ASSERT_CAPABILITY() for thread safety analysis
(cherry picked from commit bitcoin/bitcoin@f393a533be)
2022-05-14 01:25:08 +00:00
MarcoFalke 130871cb4f qa: Initialize lockstack to prevent null pointer deref
(cherry picked from commit bitcoin/bitcoin@fa9da85b7c)
2022-05-14 01:25:08 +00:00
Chun Kuan Lee 1c255a2fd6 break circular dependency: random/sync -> util -> random/sync
(cherry picked from commit bitcoin/bitcoin@84f41946b9)
2022-05-14 01:25:08 +00:00
John Newbery 6e401910e7 [logging] Comment all continuing logs.
Most logs should terminated with a '\n'. Some logs
are built up over multiple calls to logPrintf(), so
do not need a newline terminater. Comment all of
these 'continued' logs as a linter hing.

Zcash: Only the log lines we have. We also use a Rust logger that
doesn't actually support this kind of logging, but these annotations are
useful for knowing where to add potential future support.

(cherry picked from commit bitcoin/bitcoin@5c21e6c6d3)
2022-05-14 01:25:08 +00:00
Matt Corallo 327807e05a Fix fast-shutdown hang on ThreadImport+GenesisWait
If the user somehow manages to get into ShutdownRequested before
ThreadImport gets to ActivateBestChain() we may hang waiting on
condvar_GenesisWait forever. A simple wait_for and
ShutdownRequested resolves this case.

(cherry picked from commit bitcoin/bitcoin@1c9394ad47)
2022-05-14 01:25:08 +00:00
practicalswift 474aefcde6 Fix typos
Zcash: Only the typos we have.

(cherry picked from commit bitcoin/bitcoin@1340eda3b7)
2022-05-14 01:25:08 +00:00
Cory Fields f1c166d3db threads: add a thread_local autoconf check
(cherry picked from commit bitcoin/bitcoin@f7f7e2cd34)
2022-05-14 01:25:08 +00:00
Thomas Snider 4ad38a45e5 Switched sync.{cpp,h} to std threading primitives.
(cherry picked from commit bitcoin/bitcoin@bba9bd0d9d)
2022-05-14 01:25:08 +00:00
practicalswift eeba670d94 Use -Wthread-safety-analysis if available (+ -Werror=thread-safety-analysis if --enable-werror)
Zcash:
- Also added it to HARDENED_CXXFLAGS so we use it by default.
- We use -Werror if --enable-werror, so don't need the second part.

(cherry picked from commit bitcoin/bitcoin@4616c825a4)
2022-05-14 01:25:08 +00:00
Matt Corallo 8164dc35d7 Fix -Wthread-safety-analysis warnings. Change the sync.h primitives to std from boost.
Commit 1.

This code was written by @TheBlueMatt in the following branch:
* https://github.com/TheBlueMatt/bitcoin/commits/2017-08-test-10923

This commit message was written by me (@practicalswift) who also squashed
@TheBlueMatt's commits into one and tried to summarize the changes made.

Commit 2.

Remove boost include. Remove boost mentions in comments.

(cherry picked from commit bitcoin/bitcoin@7e319d6393)
2022-05-14 01:25:08 +00:00
João Barbosa e5d2a3a5a2 Remove unused fTry from push_lock
(cherry picked from commit bitcoin/bitcoin@92848e5058)
2022-05-14 01:25:08 +00:00
practicalswift 85fdbf3af8 Remove unused code
Zcash: Excludes code that is still in use for us.

(cherry picked from commit bitcoin/bitcoin@8dc957ae06)
2022-05-14 01:25:08 +00:00
Matt Corallo b031444591 Further-enforce lockordering by enforcing directly after TRY_LOCKs
(cherry picked from commit bitcoin/bitcoin@618ee9249b)
2022-05-14 01:25:08 +00:00
Matt Corallo 2d636a2814 Fixup style a bit by moving { to the same line as if statements
(cherry picked from commit bitcoin/bitcoin@2a962d4540)
2022-05-14 01:25:08 +00:00
Matt Corallo 709b11769d Always enforce lock strict lock ordering (try or not)
(cherry picked from commit bitcoin/bitcoin@8465631845)
2022-05-14 01:25:08 +00:00
Matt Corallo c2b5cf6e51 Lock cs_vSend and cs_inventory in a consistent order even in TRY
Zcash: We haven't removed cs_vRecv yet, so left it in between.

(cherry picked from commit bitcoin/bitcoin@fd13eca147)
2022-05-14 01:25:08 +00:00
Matt Corallo dadbb36e29 Make the cs_sendProcessing a LOCK instead of a TRY_LOCK
Technically cs_sendProcessing is entirely useless now because it
is only ever taken on the one MessageHandler thread, but because
there may be multiple of those in the future, it is left in place

(cherry picked from commit bitcoin/bitcoin@376b3c2c6e)
2022-05-14 01:25:08 +00:00
Matt Corallo 53b8b43567 Split CNode::cs_vSend: message processing and message sending
cs_vSend is used for two purposes - to lock the datastructures used
to queue messages to place on the wire and to only call
SendMessages once at a time per-node. I believe SendMessages used
to access some of the vSendMsg stuff, but it doesn't anymore, so
these locks do not need to be on the same mutex, and also make
deadlocking much more likely.

(cherry picked from commit bitcoin/bitcoin@d7c58ad514)
2022-05-14 01:25:08 +00:00
Pieter Wuille 8489f27afa Do diskspace check before import thread is started
(cherry picked from commit bitcoin/bitcoin@9d4eb9ad99)
2022-05-14 01:25:08 +00:00
Pieter Wuille 084906c845 Use a signal to continue init after genesis activation
Zcash: We set the Sprout tree root on the genesis block's index file in
InitBlockIndex because we were implicitly relying on this occurring via
ActivateBestChain previously.

(cherry picked from commit bitcoin/bitcoin@0fd2a33648)
2022-05-14 01:25:08 +00:00
Jack Grigg 1f1810c37d Name currently-unnamed threads that we can rename
After this, the only threads that aren't named are the LevelDB
background threads.
2022-05-14 00:07:34 +00:00
Charlie O'Keefe 3f09cfa00a
Merge pull request #5956 from nuttycom/fix/sendmany_orchard_minconf
Ensure anchor depth is > 0 when selecting an Orchard anchor.
2022-05-13 16:44:48 -06:00
Jack Grigg 6aa7c187d1 Shorten thread name prefix
Threads can be a maximum of 15 characters, so using `zc-` instead of
`zcash-` as a prefix means we can fit more information into the thread
names.
2022-05-13 21:18:20 +00:00
Kris Nuttycombe 0e1e4cbed7 Return an error if attempting to use z_shieldcoinbase for Orchard shielding. 2022-05-12 18:30:53 -06:00
Kris Nuttycombe 9e360f0d9d Add configure~ to .gitignore 2022-05-12 18:25:09 -06:00
Kris Nuttycombe 73b433c1cc Ensure that anchor depth is > 0 when selecting an Orchard anchor. 2022-05-12 18:24:45 -06:00
Kris Nuttycombe 730d245cea
Merge pull request #5952 from str4d/fix-cargo-patch-lint
lint: Fix cargo patches linter when no patches are present
2022-05-12 07:24:32 -06:00
str4d 70af58fa9d
Merge pull request #5950 from nuttycom/fix/copyright_dates
Fix Zcash developers copyright dates.
2022-05-12 14:21:24 +01:00
Jack Grigg 7b17b6f666 lint: Fix cargo patches linter when no patches are present 2022-05-12 11:19:52 +00:00
Jack Grigg 9f6b7ab85a book: Add platform support information and tier policy 2022-05-12 10:58:07 +00:00
Kris Nuttycombe c545f64356 scripted-diff: Add 2021-2022 copyright headers for files added/modified in 2021
-BEGIN VERIFY SCRIPT-
grep -l "Copyright" $(grep -L "The Zcash developers" $(git diff --name-only --diff-filter=ACM a960e896dd4c0b6d96db3d5ebbb1caa6c92a9f39..dfefab2f5587b873b02c4ed22ee3441d63f8a111 -- src/ test/ zcutil/ qa/)) | xargs -I {} sed -i"" -e "s#\(\(.*\)Copyright (c) .* The Bitcoin Core developers\)#\1\n\2Copyright (c) 2021-2022 The Zcash developers#" {}
-END VERIFY SCRIPT-
2022-05-11 17:34:50 -06:00