📝 ajtowns opened a pull request: "Improve performance of p2p inv to send queues"
(https://github.com/bitcoin/bitcoin/pull/27610)
Couple of performance improvements when draining the inventory-to-send queue:
* drop txs that have already been evicted from the mempool (or included in a block) immediately, rather than at the end of processing
* marginally increase outgoing trickle rate during spikes in tx volume
(https://github.com/bitcoin/bitcoin/pull/27610)
Couple of performance improvements when draining the inventory-to-send queue:
* drop txs that have already been evicted from the mempool (or included in a block) immediately, rather than at the end of processing
* marginally increase outgoing trickle rate during spikes in tx volume
💬 ajtowns commented on pull request "net processing: avoid serving non-announced txs as a result of a MEMPOOL message":
(https://github.com/bitcoin/bitcoin/pull/27602#discussion_r1189250200)
Ah, I see what you mean. That makes sense.
Next point on those lines though: adding many things to `m_recently_announced_invs` can overflow the bloom filter, either causing false positives (leading to privacy bugs), or since it's a rolling bloom filter, causing overflow leading to false negatives (leading to functionality bugs where you can't get the txs from the MEMPOOL response). Wouldn't it be better to make the insertion conditional on `txinfo.m_time <= now - UNCONDITIONAL_RELAY_DELAY` ?
...
(https://github.com/bitcoin/bitcoin/pull/27602#discussion_r1189250200)
Ah, I see what you mean. That makes sense.
Next point on those lines though: adding many things to `m_recently_announced_invs` can overflow the bloom filter, either causing false positives (leading to privacy bugs), or since it's a rolling bloom filter, causing overflow leading to false negatives (leading to functionality bugs where you can't get the txs from the MEMPOOL response). Wouldn't it be better to make the insertion conditional on `txinfo.m_time <= now - UNCONDITIONAL_RELAY_DELAY` ?
...
💬 theStack commented on issue "CPU DoS on mainnet in debug mode":
(https://github.com/bitcoin/bitcoin/issues/27586#issuecomment-1541097841)
For the reporters using [htop](https://htop.dev/) to analyze CPU usage (which is the case for at least @poiuty @gits7r, according to the posted screenshots): could you go to the display settings (reachable via key F2) and activate "tree view" and the global option "show custom thread names"? This would show the CPU usage per thread, which could be interesting for further investigation, e.g.:

(FWI
...
(https://github.com/bitcoin/bitcoin/issues/27586#issuecomment-1541097841)
For the reporters using [htop](https://htop.dev/) to analyze CPU usage (which is the case for at least @poiuty @gits7r, according to the posted screenshots): could you go to the display settings (reachable via key F2) and activate "tree view" and the global option "show custom thread names"? This would show the CPU usage per thread, which could be interesting for further investigation, e.g.:

(FWI
...
💬 ajtowns commented on issue "CPU DoS on mainnet in debug mode":
(https://github.com/bitcoin/bitcoin/issues/27586#issuecomment-1541197101)
I think #27610 should improve the non-debug cpu usage in b-msghand. Both commits should cleanly cherry-pick for on top of v24.x; and the first commit (the "CompareDepthAndScore" one) should cleanly cherry-pick for v23.x.
(https://github.com/bitcoin/bitcoin/issues/27586#issuecomment-1541197101)
I think #27610 should improve the non-debug cpu usage in b-msghand. Both commits should cleanly cherry-pick for on top of v24.x; and the first commit (the "CompareDepthAndScore" one) should cleanly cherry-pick for v23.x.
👍 jarolrod approved a pull request: "add ryanofsky to trusted-keys"
(https://github.com/bitcoin/bitcoin/pull/27604#pullrequestreview-1419713726)
ACK https://github.com/bitcoin/bitcoin/commit/59ebee3fb4181baf20fab263cf1b587ece1bd5e2
(https://github.com/bitcoin/bitcoin/pull/27604#pullrequestreview-1419713726)
ACK https://github.com/bitcoin/bitcoin/commit/59ebee3fb4181baf20fab263cf1b587ece1bd5e2
⚠️ apex-quest opened an issue: "BTC"
(https://github.com/bitcoin-core/gui/issues/727)
(https://github.com/bitcoin-core/gui/issues/727)
✅ fanquake closed an issue: "BTC"
(https://github.com/bitcoin-core/gui/issues/727)
(https://github.com/bitcoin-core/gui/issues/727)
:lock: fanquake locked an issue: "BTC"
(https://github.com/bitcoin-core/gui/issues/727)
(https://github.com/bitcoin-core/gui/issues/727)
💬 ayeowch commented on issue "CPU DoS on mainnet in debug mode":
(https://github.com/bitcoin/bitcoin/issues/27586#issuecomment-1541373834)
> Using this command to identify those peers: `bitcoin-cli getpeerinfo | jq -r '.[] | if (.bytessent_per_msg.inv > 100000 and .bytesrecv_per_msg.inv == null) then .addr else empty end'`
Someone posted https://news.ycombinator.com/item?id=35824998 linking to a DoS script https://github.com/visualbasic6/drain/blob/c8373b55d83832f95fb0a77aca56436adeffb58d/drain-btc.py a day before this issue. It's possible someone may be using the script targeting public nodes.
Check your `bytessent_per_msg.
...
(https://github.com/bitcoin/bitcoin/issues/27586#issuecomment-1541373834)
> Using this command to identify those peers: `bitcoin-cli getpeerinfo | jq -r '.[] | if (.bytessent_per_msg.inv > 100000 and .bytesrecv_per_msg.inv == null) then .addr else empty end'`
Someone posted https://news.ycombinator.com/item?id=35824998 linking to a DoS script https://github.com/visualbasic6/drain/blob/c8373b55d83832f95fb0a77aca56436adeffb58d/drain-btc.py a day before this issue. It's possible someone may be using the script targeting public nodes.
Check your `bytessent_per_msg.
...
💬 ArmchairCryptologist commented on issue "CPU DoS on mainnet in debug mode":
(https://github.com/bitcoin/bitcoin/issues/27586#issuecomment-1541380556)
> It's possible someone may be using the script targeting public nodes.
FWIW, I was not seeing any ridiculous bytessent_per_msg.inv numbers on any of my nodes. In fact the highest counts on all of my public nodes is my private nodes, but not by much.
A notable change happened yesterday (May 9th) around 14:25 UTC where the CPU load on all the public nodes dropped drastically at the same time, and they all look normal at present. The high-fee BRC-20 token spam we were seeing also appear to h
...
(https://github.com/bitcoin/bitcoin/issues/27586#issuecomment-1541380556)
> It's possible someone may be using the script targeting public nodes.
FWIW, I was not seeing any ridiculous bytessent_per_msg.inv numbers on any of my nodes. In fact the highest counts on all of my public nodes is my private nodes, but not by much.
A notable change happened yesterday (May 9th) around 14:25 UTC where the CPU load on all the public nodes dropped drastically at the same time, and they all look normal at present. The high-fee BRC-20 token spam we were seeing also appear to h
...
📝 TheCharlatan opened a pull request: "refactor(follow-up): Use ChainType enum exhaustively"
(https://github.com/bitcoin/bitcoin/pull/27611)
This is a follow up of https://github.com/bitcoin/bitcoin/pull/27491, more concretely https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188847896, for not using default cases (as per the style guide), and https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188852707 and https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188851857 for avoiding dead code.
(https://github.com/bitcoin/bitcoin/pull/27611)
This is a follow up of https://github.com/bitcoin/bitcoin/pull/27491, more concretely https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188847896, for not using default cases (as per the style guide), and https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188852707 and https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188851857 for avoiding dead code.
💬 TheCharlatan commented on pull request "refactor (tidy): Fixes after enable-debug configure":
(https://github.com/bitcoin/bitcoin/pull/27353#issuecomment-1541422030)
Updated 3e76aff9d4709f44d6439cd0cbc2fd6c90cae6ab -> 27d182cef72e086afc4592cdfc565b3fdb52d0b4 ([clangTidyDebug_2](https://github.com/TheCharlatan/bitcoin/commits/clangTidyDebug_2) -> [clangTidyDebug_3](https://github.com/TheCharlatan/bitcoin/commits/clangTidyDebug_3), [compare](https://github.com/TheCharlatan/bitcoin/compare/clangTidyDebug_2..clangTidyDebug_3)).
* Dropped the commit changing the CI.
(https://github.com/bitcoin/bitcoin/pull/27353#issuecomment-1541422030)
Updated 3e76aff9d4709f44d6439cd0cbc2fd6c90cae6ab -> 27d182cef72e086afc4592cdfc565b3fdb52d0b4 ([clangTidyDebug_2](https://github.com/TheCharlatan/bitcoin/commits/clangTidyDebug_2) -> [clangTidyDebug_3](https://github.com/TheCharlatan/bitcoin/commits/clangTidyDebug_3), [compare](https://github.com/TheCharlatan/bitcoin/compare/clangTidyDebug_2..clangTidyDebug_3)).
* Dropped the commit changing the CI.
💬 MarcoFalke commented on pull request "refactor(follow-up): Use ChainType enum exhaustively":
(https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541423034)
Can remove `(follow-up)` from the title. Also, the docstring of the changed methods in the header is still wrong
(https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541423034)
Can remove `(follow-up)` from the title. Also, the docstring of the changed methods in the header is still wrong
💬 TheCharlatan commented on pull request "refactor(follow-up): Use ChainType enum exhaustively":
(https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541445444)
Re https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541423034
> Also, the docstring of the changed methods in the header is still wrong
Do you mean these https://github.com/TheCharlatan/bitcoin/commit/0e7abdcb589ac2d891abce0b1cd9babbe6d0d39e ?
(https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541445444)
Re https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541423034
> Also, the docstring of the changed methods in the header is still wrong
Do you mean these https://github.com/TheCharlatan/bitcoin/commit/0e7abdcb589ac2d891abce0b1cd9babbe6d0d39e ?
💬 TheCharlatan commented on pull request "refactor, kernel: Decouple ArgsManager from blockstorage":
(https://github.com/bitcoin/bitcoin/pull/27125#issuecomment-1541454221)
Updated 3b34ac7465919b968795063995f6610a73aa2d29 -> 24f1ace25081040af80ba4cf1636592266d8dbb5 ([removeBlockstorageArgs_21](https://github.com/TheCharlatan/bitcoin/tree/removeBlockstorageArgs_21) -> [removeBlockstorageArgs_22](https://github.com/TheCharlatan/bitcoin/tree/removeBlockstorageArgs_22), [compare](https://github.com/TheCharlatan/bitcoin/compare/removeBlockstorageArgs_21..removeBlockstorageArgs_22))
* Addressed @MarcoFalke's [comment](https://github.com/bitcoin/bitcoin/pull/27125#discus
...
(https://github.com/bitcoin/bitcoin/pull/27125#issuecomment-1541454221)
Updated 3b34ac7465919b968795063995f6610a73aa2d29 -> 24f1ace25081040af80ba4cf1636592266d8dbb5 ([removeBlockstorageArgs_21](https://github.com/TheCharlatan/bitcoin/tree/removeBlockstorageArgs_21) -> [removeBlockstorageArgs_22](https://github.com/TheCharlatan/bitcoin/tree/removeBlockstorageArgs_22), [compare](https://github.com/TheCharlatan/bitcoin/compare/removeBlockstorageArgs_21..removeBlockstorageArgs_22))
* Addressed @MarcoFalke's [comment](https://github.com/bitcoin/bitcoin/pull/27125#discus
...
💬 MarcoFalke commented on pull request "refactor: Use ChainType enum exhaustively":
(https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541456801)
I mean the ones of the touched methods `Create*Params()`, which are documented to throw the wrong exception type. Now that you changed to `assert`, there is no exception at all.
(https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541456801)
I mean the ones of the touched methods `Create*Params()`, which are documented to throw the wrong exception type. Now that you changed to `assert`, there is no exception at all.
💬 MarcoFalke commented on pull request "refactor: Use ChainType enum exhaustively":
(https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541457873)
Example:
```diff
diff --git a/src/chainparams.h b/src/chainparams.h
index 6a65f40f80..23b272cc41 100644
--- a/src/chainparams.h
+++ b/src/chainparams.h
@@ -26,7 +26,6 @@ class ArgsManager;
/**
* Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
* @returns a CChainParams* of the chosen chain.
- * @throws a std::runtime_error if the chain is not supported.
*/
std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, const ChainType
...
(https://github.com/bitcoin/bitcoin/pull/27611#issuecomment-1541457873)
Example:
```diff
diff --git a/src/chainparams.h b/src/chainparams.h
index 6a65f40f80..23b272cc41 100644
--- a/src/chainparams.h
+++ b/src/chainparams.h
@@ -26,7 +26,6 @@ class ArgsManager;
/**
* Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
* @returns a CChainParams* of the chosen chain.
- * @throws a std::runtime_error if the chain is not supported.
*/
std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, const ChainType
...
⚠️ Tia939 opened an issue: "Btc mining"
(https://github.com/bitcoin/bitcoin/issues/27612)
- 
Enterprise-level Bitcoin and Blockchain libraries. Built for businesses, miners, wallets, and hobbyists
TECHNOLOGY GITHUB
$ bcoin-cli info
{
"version": "2.0.0-dev",
"network": "main",
"chain": {
"height": 597278,
"tip": "000000000000000000114ab8c7d77b0bce885cbecc12f95f2f1cbdfcefb86aa6",
"progress": 1
},
"indexes": {
"addr": {
"enabled": true,
"height": 597278
},
"tx": {
"enabled": true,
"height": 59727
...
(https://github.com/bitcoin/bitcoin/issues/27612)
- 
Enterprise-level Bitcoin and Blockchain libraries. Built for businesses, miners, wallets, and hobbyists
TECHNOLOGY GITHUB
$ bcoin-cli info
{
"version": "2.0.0-dev",
"network": "main",
"chain": {
"height": 597278,
"tip": "000000000000000000114ab8c7d77b0bce885cbecc12f95f2f1cbdfcefb86aa6",
"progress": 1
},
"indexes": {
"addr": {
"enabled": true,
"height": 597278
},
"tx": {
"enabled": true,
"height": 59727
...
✅ fanquake closed an issue: "Btc mining"
(https://github.com/bitcoin/bitcoin/issues/27612)
(https://github.com/bitcoin/bitcoin/issues/27612)
:lock: fanquake locked an issue: "Btc mining"
(https://github.com/bitcoin/bitcoin/issues/27612)
(https://github.com/bitcoin/bitcoin/issues/27612)