sipa
commented at 11:02 PM on March 28, 2013:
member
Every block index entry currently requires a separately-allocated CBigNum. By replacing them with uint256, it's just 32 bytes extra in CBlockIndex itself.
This should save us a few megabytes in RAM (around 32 bytes per block), and less allocation overhead.
laanwj
commented at 6:35 AM on March 30, 2013:
member
Are these numbers always guaranteed to fit in a uint256?
A more general solution may be to change CBigNum to store numbers <2^256 inline, and only allocate for larger ones, like with some optimized string implementations.
TheBlueMatt
commented at 7:07 AM on March 30, 2013:
member
Our current work (printed as a uint256 with this patch) is 00000000000000000000000000000000000000000000003256b810087da1a920, assuming every 600MH card on the network is replaced with a 60GH ASIC and then we multiply that by 1000 for network growth, we get a network rate of 100,000x current, we are safe for another 92 septillion*time since genesis, so...I think we are safe.
TheBlueMatt
commented at 7:08 AM on March 30, 2013:
member
ACK
laanwj
commented at 12:50 PM on March 30, 2013:
member
ok, ACK
sipa
commented at 4:48 PM on March 30, 2013:
member
When 2^256 hashes are exceeded, it's quite likely we'll have found a preimage for double-SHA256, and Bitcoin is broken in the first place.
sipa
commented at 4:50 PM on March 30, 2013:
member
@BitcoinPullTester@TheBlueMatt I believe this will require a different pulltest, as I presume it tries to modify the global BigNums.
TheBlueMatt
commented at 6:06 PM on March 30, 2013:
member
Yea, this tries to modify the mindiff stuff so breaks on this pull. Ignore pulltester output for now and ping me before merge so I can update the patch.
sipa
commented at 1:11 PM on April 4, 2013:
member
Rebased.
sipa
commented at 1:21 AM on April 7, 2013:
member
Added a commit that prints the 2-log of nChainWork instead, which is somewhat more useful for human eyes.
gmaxwell
commented at 7:00 PM on April 8, 2013:
contributor
ACK. (Needs pulltester)
sipa
commented at 6:22 PM on April 9, 2013:
member
Rebased. This will need manual pulltester changes before it will succeed.
Use a uint256 for bnChainWork
Every block index entry currently requires a separately-allocated
CBigNum. By replacing them with uint256, it's just 32 bytes extra
in CBlockIndex itself.
This should save us a few megabytes in RAM, and less allocation
overhead.
1657c4bc49
sipa
commented at 10:19 AM on April 12, 2013:
member
@TheBlueMatt I've added a patch to your patch in this pullreq. If you update pulltester to use the tests in contrib, this should apply cleanly.
gavinandresen referenced this in commit 1b4b463c01 on Apr 12, 2013
gavinandresen merged this on Apr 12, 2013
gavinandresen closed this on Apr 12, 2013
sipa deleted the branch on May 3, 2013
laudney referenced this in commit 633486f6dc on Mar 19, 2014
rebroad
commented at 10:26 AM on June 25, 2015:
contributor
Would it be of any use to display a delta work (work since the last block) instead?
sipa
commented at 11:13 AM on June 25, 2015:
member
The work since last block is also called "difficulty".
rebroad
commented at 10:34 PM on June 25, 2015:
contributor
Doesn't seem like a very useful thing to display on every UpdateTip message.. Why not just output one debug line when the difficulty changes, and remove log2_work= altogether from the UpdateTip debug message?
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-04-19 09:15 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me