Bitcointalk · RFC: ship block chain 1-74000 with release tarballs?

中本聪,2010 年 11 月 28 日

SN-3680 已核对来源,附原文与上下文。

阅读语言
中文译文

尽管说了这么多,当前的下一步是:

理应有人用不同的 Berkeley DB 设置做实验,看看有没有能让下载显著加快的配置。倘若真发现了什么,我们再落实细节。

具体来说,我怀疑更多的读缓存可能帮大忙。

IRC 上又来了一个新用户,这次是 Linux,下载速度是每 4 秒 1 个区块——估计总下载时间要 4 天左右。

那就是出了更具体的问题。那不是正常初始下载时间。没有更多细节就无法诊断。如果是下载慢造成的,10-20 分钟后下一次区块广播本该让它切换到更快的来源,它提速了吗?debug.log 里恐有线索。他们的网络连接有多快?是一直慢,还是仅仅在某处变慢?

我们把创世区块到区块 74000 的哈希硬编码(编译)进了比特币,因而没理由不能从任何地方自动下载区块数据库的压缩包,解包、验证、进而开跑。

74000 检查点不足以保护你,而且倘若下载已然超过 74000 就毫无作用。-checkblocks 能够做更多,然而仍然容易被绕过。你终究得信任压缩包的提供者。

倘若真有一个「验证」步骤,那耗时和现在正常的初始下载一样长——瓶颈是建索引,不是数据下载。

想必某个时候会出现仅仅下载区块头的轻量客户端,然而那仍然会有成百上千个……

每个区块头 80 字节,不需要建索引。兴许 1 分钟就够。

未压缩的数据,用一个并非为批量数据传输设计的协议(比特币 P2P)。

数据主要是哈希、密钥和签名,不可压缩。

初始下载的速度并不反映协议的批量数据传输速率。真正的制约因素是下载过程中的建索引。

ORIGINAL · 英文原文
Despite everything else said, the current next step is:
Quote
Someone should experiment with different Berkeley DB settings and see if there's something that makes the download substantially faster.  If something substantial is discovered, then we can work out the particulars.
In particular, I suspect that more read caching might help a lot.

Another new user on IRC, Linux this time, was downloading at a rate of 1 block every 4 seconds -- estimated total download time around 4 days.
Then something more specific was wrong.  That's not due to normal initial download time.  Without more details, it can't be diagnosed.  If it was due to slow download, did it speed up after 10-20 minutes when the next block broadcast should have made it switch to a faster source?  debug.log might have clues.  How fast is their Internet connection?  Was it steadily slow, or just slow down at one point?

Quote
We have the hashes for genesis block through block 74000 hardcoded (compiled) into bitcoin, so there's no reason why we shouldn't be able to automatically download a compressed zipfile of the block database from anywhere, unpack it, verify it, and start running.
The 74000 checkpoint is not enough to protect you, and does nothing if the download is already past 74000.  -checkblocks does more, but is still easily defeated.  You still must trust the supplier of the zipfile.

If there was a "verify it" step, that would take as long as the current normal initial download, in which it is the indexing, not the data download, that is the bottleneck.

Presumably at some point there will be a lightweight client that only downloads block headers, but there will still be hundreds of thousands of those...
80 bytes per header and no indexing work.  Might take 1 minute.

Quote
uncompressed data using a protocol (bitcoin P2P) that wasn't designed for bulk data transfer.
The data is mostly hashes and keys and signatures that are uncompressible.

The speed of initial download is not a reflection of the bulk data transfer rate of the protocol.  The gating factor is the indexing while it downloads.

来源
Bitcointalk 原始链接 ↗ 记录编号 SN-3680