Unify docstrings for Target::MAX_ATTAINABLE_* consts
What changed, and why it matters
This commit only changes documentation comments (docstrings) for several constants in the proof-of-work module. It rewords descriptions to be consistent and adds a source reference comment. No code behavior is altered, so there is no security impact.
No action needed; this is a documentation-only change with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies only comments in bitcoin/src/pow.rs. It unifies the wording of docstrings for Target::MAX_ATTAINABLE_MAINNET, MAX_ATTAINABLE_TESTNET, MAX_ATTAINABLE_REGTEST, and MAX_ATTAINABLE_SIGNET, and adds a Bitcoin Core source reference comment for the mainnet constant. No executable code, constants, or logic were changed.
Changed components
bitcoin/src/pow.rs documentation commentsInspect captured patch +5 / −3
diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs
index 0abb2098..03a4fe21 100644
--- a/bitcoin/src/pow.rs
+++ b/bitcoin/src/pow.rs
@@ -148,19 +148,21 @@ impl Target {
///
/// Not all target values are attainable because consensus code uses the compact format to
/// represent targets (see [`CompactTarget`]).
+ // Taken from Bitcoin Core but had lossy conversion to/from compact form.
+ // https://github.com/bitcoin/bitcoin/blob/8105bce5b384c72cf08b25b7c5343622754e7337/src/kernel/chainparams.cpp#L88
pub const MAX_ATTAINABLE_MAINNET: Self = Self(U256(0xFFFF_u128 << (208 - 128), 0));
- /// The proof of work limit on testnet.
+ /// The maximum **attainable** target value on testnet.
// Taken from Bitcoin Core but had lossy conversion to/from compact form.
// https://github.com/bitcoin/bitcoin/blob/8105bce5b384c72cf08b25b7c5343622754e7337/src/kernel/chainparams.cpp#L208
pub const MAX_ATTAINABLE_TESTNET: Self = Self(U256(0xFFFF_u128 << (208 - 128), 0));
- /// The proof of work limit on regtest.
+ /// The maximum **attainable** target value on regtest.
// Taken from Bitcoin Core but had lossy conversion to/from compact form.
// https://github.com/bitcoin/bitcoin/blob/8105bce5b384c72cf08b25b7c5343622754e7337/src/kernel/chainparams.cpp#L411
pub const MAX_ATTAINABLE_REGTEST: Self = Self(U256(0x7FFF_FF00u128 << 96, 0));
- /// The proof of work limit on signet.
+ /// The maximum **attainable** target value on signet.
// Taken from Bitcoin Core but had lossy conversion to/from compact form.
// https://github.com/bitcoin/bitcoin/blob/8105bce5b384c72cf08b25b7c5343622754e7337/src/kernel/chainparams.cpp#L348
pub const MAX_ATTAINABLE_SIGNET: Self = Self(U256(0x0377_ae00 << 80, 0));
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.