Skip to content

Commit a0b5730

Browse files
committed
Merge bitcoin#33415: [28.x] More backports
a5e4fec doc: update release notes for 28.x (fanquake) 4598dfc doc: Remove wrong and redundant doxygen tag (MarcoFalke) 9e56d88 net: Do not apply whitelist permission to onion inbounds (Martin Zumsande) a381de7 Fix benchmark CSV output (Hennadii Stepanov) Pull request description: Further backports for `28.x`: * bitcoin#33236 * bitcoin#33340 * bitcoin#33395 ACKs for top commit: achow101: ACK a5e4fec willcl-ark: ACK a5e4fec Tree-SHA512: eb00b395dea8a3e50e19683e824abd946d0e0ef5188cca3fddbc35a8e2ecc203cfc7a8f480e0fbf09cc48f660b1da324da4d777ec47346c52d230c5b93f536c3
2 parents f9043af + a5e4fec commit a0b5730

File tree

7 files changed

+48
-35
lines changed

7 files changed

+48
-35
lines changed

doc/release-notes.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Bitcoin Core version 28.x is now available from:
1+
Bitcoin Core version 28.3rc1 is now available from:
22

3-
<https://bitcoincore.org/bin/bitcoin-core-28.x/test.rc1/>
3+
<https://bitcoincore.org/bin/bitcoin-core-28.3/test.rc1/>
44

55
This release includes various bug fixes and performance
66
improvements, as well as updated translations.
@@ -37,6 +37,10 @@ unsupported systems.
3737
Notable changes
3838
===============
3939

40+
### P2P
41+
42+
- #33395 net: do not apply whitelist permissions to onion inbounds
43+
4044
### Test
4145

4246
- #32765 test: Fix list index out of range error in feature_bip68_sequence.py
@@ -54,6 +58,11 @@ Notable changes
5458
- #32777 doc: fix Transifex 404s
5559
- #33070 doc/zmq: fix unix socket path example
5660
- #33133 rpc: fix getpeerinfo ping duration unit docs
61+
- #33236 doc: Remove wrong and redundant doxygen tag
62+
63+
### Misc
64+
65+
- #33340 Fix benchmark CSV output
5766

5867
Credits
5968
=======
@@ -63,8 +72,11 @@ Thanks to everyone who directly contributed to this release:
6372
- fanquake
6473
- Hennadii Stepanov
6574
- MarcoFalke
75+
- Martin Zumsande
6676
- romanz
6777
- Sjors Provoost
78+
- theStack
79+
- Vasil Dimov
6880
- willcl-ark
6981
- zaidmstrr
7082

src/crypto/sha256.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem
627627
Transform = sha256_x86_shani::Transform;
628628
TransformD64 = TransformD64Wrapper<sha256_x86_shani::Transform>;
629629
TransformD64_2way = sha256d64_x86_shani::Transform_2way;
630-
ret = "x86_shani(1way,2way)";
630+
ret = "x86_shani(1way;2way)";
631631
have_sse4 = false; // Disable SSE4/AVX2;
632632
have_avx2 = false;
633633
}
@@ -641,14 +641,14 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem
641641
#endif
642642
#if defined(ENABLE_SSE41)
643643
TransformD64_4way = sha256d64_sse41::Transform_4way;
644-
ret += ",sse41(4way)";
644+
ret += ";sse41(4way)";
645645
#endif
646646
}
647647

648648
#if defined(ENABLE_AVX2)
649649
if (have_avx2 && have_avx && enabled_avx) {
650650
TransformD64_8way = sha256d64_avx2::Transform_8way;
651-
ret += ",avx2(8way)";
651+
ret += ";avx2(8way)";
652652
}
653653
#endif
654654
#endif // defined(HAVE_GETCPUID)
@@ -682,7 +682,7 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem
682682
Transform = sha256_arm_shani::Transform;
683683
TransformD64 = TransformD64Wrapper<sha256_arm_shani::Transform>;
684684
TransformD64_2way = sha256d64_arm_shani::Transform_2way;
685-
ret = "arm_shani(1way,2way)";
685+
ret = "arm_shani(1way;2way)";
686686
}
687687
#endif
688688
#endif // DISABLE_OPTIMIZED_SHA256

src/net.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,9 @@ void CNode::CloseSocketDisconnect()
557557
m_i2p_sam_session.reset();
558558
}
559559

560-
void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNetAddr &addr, const std::vector<NetWhitelistPermissions>& ranges) const {
560+
void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr, const std::vector<NetWhitelistPermissions>& ranges) const {
561561
for (const auto& subnet : ranges) {
562-
if (subnet.m_subnet.Match(addr)) {
562+
if (addr.has_value() && subnet.m_subnet.Match(addr.value())) {
563563
NetPermissions::AddFlag(flags, subnet.m_flags);
564564
}
565565
}
@@ -1731,7 +1731,11 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
17311731
{
17321732
int nInbound = 0;
17331733

1734-
AddWhitelistPermissionFlags(permission_flags, addr, vWhitelistedRangeIncoming);
1734+
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
1735+
1736+
// Tor inbound connections do not reveal the peer's actual network address.
1737+
// Therefore do not apply address-based whitelist permissions to them.
1738+
AddWhitelistPermissionFlags(permission_flags, inbound_onion ? std::optional<CNetAddr>{} : addr, vWhitelistedRangeIncoming);
17351739

17361740
{
17371741
LOCK(m_nodes_mutex);
@@ -1786,7 +1790,6 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
17861790
NodeId id = GetNewNodeId();
17871791
uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();
17881792

1789-
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
17901793
// The V2Transport transparently falls back to V1 behavior when an incoming V1 connection is
17911794
// detected, so use it whenever we signal NODE_P2P_V2.
17921795
ServiceFlags local_services = GetLocalServices();

src/net.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ class CConnman
13451345

13461346
bool AttemptToEvictConnection();
13471347
CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure, ConnectionType conn_type, bool use_v2transport) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex);
1348-
void AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNetAddr &addr, const std::vector<NetWhitelistPermissions>& ranges) const;
1348+
void AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr, const std::vector<NetWhitelistPermissions>& ranges) const;
13491349

13501350
void DeleteNode(CNode* pnode);
13511351

src/policy/feerate.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ class CFeeRate
4545
/**
4646
* Construct a fee rate from a fee in satoshis and a vsize in vB.
4747
*
48-
* param@[in] nFeePaid The fee paid by a transaction, in satoshis
49-
* param@[in] num_bytes The vsize of a transaction, in vbytes
5048
*/
5149
CFeeRate(const CAmount& nFeePaid, uint32_t num_bytes);
5250

src/wallet/coinselection.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,15 +590,15 @@ util::Result<SelectionResult> SelectCoinsSRD(const std::vector<OutputGroup>& utx
590590

591591
/** Find a subset of the OutputGroups that is at least as large as, but as close as possible to, the
592592
* target amount; solve subset sum.
593-
* param@[in] groups OutputGroups to choose from, sorted by value in descending order.
594-
* param@[in] nTotalLower Total (effective) value of the UTXOs in groups.
595-
* param@[in] nTargetValue Subset sum target, not including change.
596-
* param@[out] vfBest Boolean vector representing the subset chosen that is closest to
593+
* @param[in] groups OutputGroups to choose from, sorted by value in descending order.
594+
* @param[in] nTotalLower Total (effective) value of the UTXOs in groups.
595+
* @param[in] nTargetValue Subset sum target, not including change.
596+
* @param[out] vfBest Boolean vector representing the subset chosen that is closest to
597597
* nTargetValue, with indices corresponding to groups. If the ith
598598
* entry is true, that means the ith group in groups was selected.
599-
* param@[out] nBest Total amount of subset chosen that is closest to nTargetValue.
600-
* paramp[in] max_selection_weight The maximum allowed weight for a selection result to be valid.
601-
* param@[in] iterations Maximum number of tries.
599+
* @param[out] nBest Total amount of subset chosen that is closest to nTargetValue.
600+
* @param[in] max_selection_weight The maximum allowed weight for a selection result to be valid.
601+
* @param[in] iterations Maximum number of tries.
602602
*/
603603
static void ApproximateBestSubset(FastRandomContext& insecure_rand, const std::vector<OutputGroup>& groups,
604604
const CAmount& nTotalLower, const CAmount& nTargetValue,

src/wallet/spend.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ FilteredOutputGroups GroupOutputs(const CWallet& wallet,
123123
* the solution (according to the waste metric) will be chosen. If a valid input cannot be found from any
124124
* single OutputType, fallback to running `ChooseSelectionResult()` over all available coins.
125125
*
126-
* param@[in] chain The chain interface to get information on unconfirmed UTXOs bump fees
127-
* param@[in] nTargetValue The target value
128-
* param@[in] groups The grouped outputs mapped by coin eligibility filters
129-
* param@[in] coin_selection_params Parameters for the coin selection
130-
* param@[in] allow_mixed_output_types Relax restriction that SelectionResults must be of the same OutputType
126+
* @param[in] chain The chain interface to get information on bump fees for unconfirmed UTXOs
127+
* @param[in] nTargetValue The target value
128+
* @param[in] groups The grouped outputs mapped by coin eligibility filters
129+
* @param[in] coin_selection_params Parameters for the coin selection
130+
* @param[in] allow_mixed_output_types Relax restriction that SelectionResults must be of the same OutputType
131131
* returns If successful, a SelectionResult containing the input set
132132
* If failed, returns (1) an empty error message if the target was not reached (general "Insufficient funds")
133-
* or (2) an specific error message if there was something particularly wrong (e.g. a selection
133+
* or (2) a specific error message if there was something particularly wrong (e.g. a selection
134134
* result that surpassed the tx max weight size).
135135
*/
136136
util::Result<SelectionResult> AttemptSelection(interfaces::Chain& chain, const CAmount& nTargetValue, OutputGroupTypeMap& groups,
@@ -141,13 +141,13 @@ util::Result<SelectionResult> AttemptSelection(interfaces::Chain& chain, const C
141141
* Multiple coin selection algorithms will be run and the input set that produces the least waste
142142
* (according to the waste metric) will be chosen.
143143
*
144-
* param@[in] chain The chain interface to get information on unconfirmed UTXOs bump fees
145-
* param@[in] nTargetValue The target value
146-
* param@[in] groups The struct containing the outputs grouped by script and divided by (1) positive only outputs and (2) all outputs (positive + negative).
147-
* param@[in] coin_selection_params Parameters for the coin selection
144+
* @param[in] chain The chain interface to get information on bump fees for unconfirmed UTXOs
145+
* @param[in] nTargetValue The target value
146+
* @param[in] groups The struct containing the outputs grouped by script and divided by (1) positive only outputs and (2) all outputs (positive + negative).
147+
* @param[in] coin_selection_params Parameters for the coin selection
148148
* returns If successful, a SelectionResult containing the input set
149149
* If failed, returns (1) an empty error message if the target was not reached (general "Insufficient funds")
150-
* or (2) an specific error message if there was something particularly wrong (e.g. a selection
150+
* or (2) a specific error message if there was something particularly wrong (e.g. a selection
151151
* result that surpassed the tx max weight size).
152152
*/
153153
util::Result<SelectionResult> ChooseSelectionResult(interfaces::Chain& chain, const CAmount& nTargetValue, Groups& groups, const CoinSelectionParams& coin_selection_params);
@@ -181,10 +181,10 @@ util::Result<PreSelectedInputs> FetchSelectedInputs(const CWallet& wallet, const
181181

182182
/**
183183
* Select a set of coins such that nTargetValue is met; never select unconfirmed coins if they are not ours
184-
* param@[in] wallet The wallet which provides data necessary to spend the selected coins
185-
* param@[in] available_coins The struct of coins, organized by OutputType, available for selection prior to filtering
186-
* param@[in] nTargetValue The target value
187-
* param@[in] coin_selection_params Parameters for this coin selection such as feerates, whether to avoid partial spends,
184+
* @param[in] wallet The wallet which provides data necessary to spend the selected coins
185+
* @param[in] available_coins The struct of coins, organized by OutputType, available for selection prior to filtering
186+
* @param[in] nTargetValue The target value
187+
* @param[in] coin_selection_params Parameters for this coin selection such as feerates, whether to avoid partial spends,
188188
* and whether to subtract the fee from the outputs.
189189
* returns If successful, a SelectionResult containing the selected coins
190190
* If failed, returns (1) an empty error message if the target was not reached (general "Insufficient funds")

0 commit comments

Comments
 (0)