On Mon Aug 16 20:55:54 2010, Satoshi modified the client to display 20 bytes of the block hash (up from 16 bytes). This pull request increases the number of significant bytes by 5, and reduces the number of insignificant bytes (almost always zeros) by 10, resulting in saved space in debug.log and improved uniqueness of block hashes.
Show more significant bytes of block hashes. #1426
pull rebroad wants to merge 1 commits into bitcoin:master from rebroad:MoreSignificantBits changing 7 files +38 −30-
rebroad commented at 10:44 PM on June 5, 2012: contributor
-
TheBlueMatt commented at 11:03 PM on June 5, 2012: member
I'd like to keep one leading 0 on diff-1 blocks, instead of removing all the 0s, which would leave only 6 0s on current-diff blocks, which IMHO is acceptable, but ACK on the idea.
-
gavinandresen commented at 12:09 AM on June 6, 2012: contributor
I like the at-least-one leading 0 on min-difficulty blocks idea; I've spent a lot of time staring at min difficulty testnet block hashes.
-
gavinandresen commented at 12:11 AM on June 6, 2012: contributor
One downside of this change: it might break blockexplorer.com's block lookup (please test, I know it works with the existing lots-of-leading-zeroes format).
-
rebroad commented at 8:51 AM on June 6, 2012: contributor
I see what you mean re testnet. Perhaps I should code it so that it's one leading zero whatever the situation...?
-
sipa commented at 2:12 PM on June 8, 2012: member
Solution: use the low bits of block hashes to identify them, instead of high bits which contain several zeroes?
-
luke-jr commented at 10:13 PM on June 8, 2012: member
I definitely prefer showing the low bits over high ones.
-
TheBlueMatt commented at 1:39 PM on June 9, 2012: member
Agreed, as long as someone pings theymos et al to get bbe/blockchain.info updated to support low bit-searching implemented before release.
-
luke-jr commented at 4:22 PM on June 9, 2012: member
BBE doesn't care which bits you use. Blockchain.info doesn't accept partial matches/searches at all.
-
TheBlueMatt commented at 5:55 PM on June 9, 2012: member
Ah, well then I guess we should just switch to low bits.
-
sipa commented at 3:54 PM on June 14, 2012: member
Using the 14 lowest hex characters of a block as identifier should suffice for 100 years (0.2% chance for a collision after 5.46 million blocks). So I'd say use the 16 lowest ones.
-
gmaxwell commented at 4:51 PM on June 14, 2012: contributor
I'd somewhat prefer to show the full values, because thats what the getblock rpc needs. If we're concerned about space we should create rotation that doesn't stink.
-
rebroad commented at 11:24 PM on June 14, 2012: contributor
@sipa it's just a debug.log. I doubt anyone will have a debug.log file as long as 100 years, so 14 characters would be an extreme overkill. @gmaxwell it doesn't currently show full values and never has. The current requirement seems to be that the numbers don't want to be duplicated within the entirity of the debug.log file. For that, the last 14 hex characters are more than sufficient (as sipa pointed out).
-
rebroad commented at 6:34 PM on June 21, 2012: contributor
Yes, very likely, when i next get access to a computer (next week sometime).
-
luke-jr commented at 9:13 PM on July 2, 2012: member
I'd just go with substr(504)
-
sipa commented at 12:14 AM on July 3, 2012: member
wth? 504? hex hashes are only 64 characters long.
-
luke-jr commented at 12:22 AM on July 3, 2012: member
... yeah, not sure how I got 504 (except I know I forgot to divide by 8)... long day :(
I meant .substr(56), but I don't mind 48
-
gmaxwell commented at 1:03 AM on July 3, 2012: contributor
@rebroad I know it doesn't currently show full values. @sipa I still think it should show the full value. The partial values are almost useless because there is no way to getblock by them. I don't think carrying another index for partial block values names sense, nor do I think precluding hash tables that require exact lookups makes sense. Reducing them by 1/4th while breaking lookup with getblock isn't a worthwhile tradeoff.
(Of, course, I'll continue to patch my nodes to log the full value regardless, but I think its a reasonable default).
-
Show more significant bytes of block hashes. 7a2670692e
-
rebroad commented at 1:09 PM on July 3, 2012: contributor
updated. now substr(48) (effectively). Next.. shall we shorten the work= field....?!
-
sipa commented at 1:19 PM on July 3, 2012: member
How about using the unit GHy? (gigahash year). We're currently at around 11874.5 GHy.
-
sipa commented at 12:21 AM on July 4, 2012: member
Divide the bnWork number by 31556926000000000 (1 billion times the number of seconds in a year).
-
midnightmagic commented at 7:21 PM on July 26, 2012: contributor
Currently there is no way for a user to go from the entries in the debug.log, using bitcoind calls only, to useful information. Is there no intention of correcting the api calls so they accept whatever it is we're dumping into debug.log? This way we can do investigation without writing our own extensive tools or being forced to visit a website? How is it that you guys debug problematic blocks? Do you maintain extensive patchsets of your own that don't depend on behaviour in the base client?
-
jgarzik commented at 4:54 PM on August 1, 2012: contributor
Weak ACK, mostly don't care.
BLOCKSUBSTR should be in a separate, zero-behavior-change commit.
-
Diapolo commented at 5:54 PM on August 1, 2012: none
BLOCKSUBSTR could take a little comment IMHO.
-
luke-jr commented at 5:57 PM on August 1, 2012: member
While we're fence-painting, it seems to me hash.ToString().substr(BLOCKSUBSTR).c_str() could be reduced to hash.BlockSubstr().c_str()
-
BitcoinPullTester commented at 1:40 AM on August 10, 2012: none
Automatic sanity-testing: FAILED MERGE, see http://jenkins.bluematt.me/pull-tester/7a2670692e7cf455899fdb3dafdff734ce2a794b for test log.
This pull does not merge cleanly onto current master
- laanwj closed this on Aug 20, 2012
- suprnurd referenced this in commit 86525601d5 on Dec 5, 2017
- lateminer referenced this in commit e5c6f93952 on Jan 22, 2019
- DrahtBot locked this on Sep 8, 2021