aboutsummaryrefslogtreecommitdiff
path: root/src/node/miner.cpp
AgeCommit message (Collapse)Author
2022-09-09scripted-diff: rename CChainState -> ChainstateJames O'Beirne
-BEGIN VERIFY SCRIPT- sed -i 's/CChainState/Chainstate/g' $(git grep -l CChainState ':(exclude)doc/release-notes*') -END VERIFY SCRIPT- Co-authored-by: MacroFake <falke.marco@gmail.com>
2022-08-05Make adjusted time type safeMacroFake
2022-06-06miner: Make mempool optional for BlockAssemblerCarl Dong
...also adjust callers Changes: - In BlockAssembler::CreateNewBlock, we now only lock m_mempool->cs and call addPackageTxs if m_mempool is not nullptr - BlockAssembler::addPackageTxs now takes in a mempool reference, and is annotated to require that mempool's lock. - In TestChain100Setup::CreateBlock and generateblock, don't construct an empty mempool, just pass in a nullptr for mempool
2022-05-27miner: Make UpdatePackagesForAdded staticCarl Dong
Since UpdatePackagesForAdded is a helper function that's only used in addPackageTxs we can make it static and avoid the unnecessary interface and in-header lock annotation.
2022-05-27miner: Absorb SkipMapTxEntry into addPackageTxsCarl Dong
SkipMapTxEntry is a short helper function that's only used in addPackageTxs, we can just inline it, keep the comments, and avoid the unnecessary interface and lock annotations.
2022-05-27Merge bitcoin/bitcoin#24934: refactor, miner: Delete call to ↵MacroFake
UpdatePackagesForAdded at beginning of addPackageTxs 7036cf52aa080d2a63993c2298555252d507dd2f Delete UpdatePackagesForAdded at beginning of addPackageTxs. (KevinMusgrave) Pull request description: In `CreateNewBlock` (in miner.cpp), `inBlock` is cleared before `addPackageTxs`, so `inBlock` will be empty in the first call to `UpdatePackagesForAdded`. I saw this brought up in these [PR review club logs](https://bitcoincore.reviews/24538) and there didn't seem to be a definitive answer for why the call is necessary. There's also an [old PR](https://github.com/bitcoin/bitcoin/pull/10200) where this change was going to be applied, but it got closed. If `addPackageTxs` can be called when `inBlock` is not empty, then maybe a test should be added for that case. All the tests seem to pass with this deletion. ACKs for top commit: glozow: utACK 7036cf52aa080d2a63993c2298555252d507dd2f Tree-SHA512: 9e757b71b9035f68a0c6fef229b8cd83f1bdbe23f05bb02cc1bab8c3c177805b388bceb2bb1f0bce354791ccb29f351a6c51979b96ffe4d9fc6c978f83e36afc
2022-05-20Add ChainstateManager::m_adjusted_time_callbackCarl Dong
This decouples validation.cpp from netaddress.cpp (transitively, timedata.cpp, and asmap.cpp). This is important for libbitcoinkernel as: - There is no reason for the consensus engine to be coupled with netaddress, timedata, and asmap - Users of libbitcoinkernel can now easily supply their own std::function that provides the adjusted time. See the src/Makefile.am changes for some satisfying removals.
2022-05-18Do not pass CChainParams& to BlockAssembler constructorMacroFake
2022-05-10validation: move g_versionbitscache into ChainstateManagerAnthony Towns
2022-05-10validation: move UpdateUncommittedBlockStructures and ↵Anthony Towns
GenerateCoinbaseCommitment into ChainstateManager
2022-04-22Delete UpdatePackagesForAdded at beginning of addPackageTxs.KevinMusgrave
As described in commit 9cea7e37158aa85119de2c81e93901da9e476ee5, this is no longer needed because priority transaction selection (addPriorityTxs) was removed in commit 272b25a6a99057fdcd5db5bce70b49625e973080.
2022-04-01Remove buggy and confusing IncrementExtraNonceMarcoFalke
2022-03-17Merge bitcoin/bitcoin#24515: Only load BlockMan in BlockMan member functionsMarcoFalke
f865cf8ded2b2fbc82a6fbc41226d991909a6880 Add and use BlockManager::GetAllBlockIndices (Carl Dong) 28ba0313eac37e4a900b7e97af7169ce999c4024 Add and use CBlockIndexHeightOnlyComparator (Carl Dong) 12eb05df63f930969115af6dc66e2e5d02f2a517 move-only: Move CBlockIndexWorkComparator to blockstorage (Carl Dong) c600ee38168a460d3026eae0e289c976194aad14 Only load BlockMan in BlockMan member functions (Carl Dong) 42e56d9b188f97c077ed2269e24acc0be35ece17 style-only: No need for std::pair for vSortedByHeight (Carl Dong) 3bbb6fea051f4e19bd2448e401a6c4e9b4cc7a41 style-only: Various blockstorage.cpp cleanups (Carl Dong) 5be9ee3c54dcb396ff52fc8c8b7e4e6e39ec4a3b refactor: more const annotations for uses of CBlockIndex* (Anthony Towns) Pull request description: The only important commit is "Only load BlockMan in BlockMan member functions", everything else is all just small style changes. Here's the commit message, reproduced: ``` This commit effectively splits the "load block index itself" logic from "derive Chainstate variables from loaded block index" logic. This means that BlockManager::LoadBlockIndex{,DB} will only load what's relevant to the BlockManager. ``` ACKs for top commit: ajtowns: ACK f865cf8ded2b2fbc82a6fbc41226d991909a6880 ; code review only MarcoFalke: review ACK f865cf8ded2b2fbc82a6fbc41226d991909a6880 🗂 Tree-SHA512: 7b204d782834e06fd7329d022e2ae860181b4e8105c33bfb928539a4ec24161dc7438a9c4d4ee279dcad77de310c160b997bb8aa18923243d0fd55ccf4ad7c3a
2022-03-09refactor: more const annotations for uses of CBlockIndex*Anthony Towns
2022-02-23[miner] always assume we can create witness blocksglozow
Given the low possibility of a reorg reverting the segwit soft fork, there is no need to check whether segwit is active here. Also, TestBlockValidity is run on the block template after it has been created.
2022-01-06Add src/node/* code to node:: namespaceRussell Yanofsky
2021-12-30scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: * 2020: fa0074e2d82928016a43ca408717154a1c70a4db * 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2021-12-07mining, refactor: add m_mempool.cs thread safety lock assertionsJon Atack
in src/node/miner to: - BlockAssembler::addPackageTxs() - BlockAssembler::SkipMapTxEntry() - BlockAssembler::UpdatePackagesForAdded() These functions have thread safety lock annotations in their declarations but are missing the corresponding run-time lock assertions in their definitions. Per doc/developer-notes.md: "Combine annotations in function declarations with run-time asserts in function definitions."
2021-12-01miner: Remove uncompiled MTP codeMarcoFalke
2021-12-01style: Add {} to if-bodies in node/minerMarcoFalke
Can be reviewed with --word-diff-regex=. --ignore-all-space
2021-11-16refactor: Replace validation.h include with forward-decl in miner.hMarcoFalke
2021-11-16scripted-diff: Move miner to src/nodeMarcoFalke
-BEGIN VERIFY SCRIPT- # Move module git mv src/miner.cpp src/node/ git mv src/miner.h src/node/ # Replacements sed -i 's:miner\.h:node/miner.h:g' $(git grep -l miner) sed -i 's:miner\.cpp:node/miner.cpp:g' $(git grep -l miner) sed -i 's:MINER_H:NODE_MINER_H:g' $(git grep -l MINER_H) -END VERIFY SCRIPT-