SN-10016 附来源、原文与上下文。
Hal Finney 写道:
Hal Finney wrote:
引用的来信Hal Finney来源 ↗我认为,节点必须为每条候选链分别保存一个待处理交易列表。 ……也可以问……平均而言,一个节点必须同时跟踪多少条候选链?
I think it is necessary that nodes keep a separate pending-transaction list associated with each candidate chain. ... One might also ask ... how many candidate chains must a given node keep track of at one time, on average?
好在只需要为当前最佳分支保留一个待处理交易池。当最佳分支收到新区块时,ConnectBlock 会从待处理交易池中移除该区块的交易。如果另一个分支变得更长,就沿着主分支调用 DisconnectBlock,直到分叉点,把区块交易放回待处理交易池,然后在新分支上调用 ConnectBlock,再次移除两个分支中共有的交易。预计这样的重组会很少见,而且深度很浅。
Fortunately, it's only necessary to keep a pending-transaction pool for the current best branch. When a new block arrives for the best branch, ConnectBlock removes the block's transactions from the pending-tx pool. If a different branch becomes longer, it calls DisconnectBlock on the main branch down to the fork, returning the block transactions to the pending-tx pool, and calls ConnectBlock on the new branch, sopping back up any transactions that were in both branches. It's expected that reorgs like this would be rare and shallow.
有了这个优化,候选分支实际上不构成什么负担。它们只保存在磁盘上,除非有一天成为主链,否则无需理会。
With this optimisation, candidate branches are not really any burden. They just sit on the disk and don't require attention unless they ever become the main chain.
引用的来信Hal Finney来源 ↗或者,正如 James 之前提出的,如果网络广播可靠,却依赖一种可能很慢的泛洪算法,会怎样影响性能?
Or as James raised earlier, if the network broadcast is reliable but depends on a potentially slow flooding algorithm, how does that impact performance?
广播很可能几乎完全可靠。如今 TCP 传输几乎不会丢失,而广播协议有重试机制,过一段时间会从其他节点获取数据。如果实际广播速度比预期慢,可能就需要增加区块之间的目标时间,以免浪费资源。我们希望区块通常能在远少于生成它所需的时间内传播完毕,否则节点会花太多时间计算过时的区块。
Broadcasts will probably be almost completely reliable. TCP transmissions are rarely ever dropped these days, and the broadcast protocol has a retry mechanism to get the data from other nodes after a while. If broadcasts turn out to be slower in practice than expected, the target time between blocks may have to be increased to avoid wasting resources. We want blocks to usually propagate in much less time than it takes to generate them, otherwise nodes would spend too much time working on obsolete blocks.
我计划做一次自动化测试,让计算机随机互相发送付款,并随机丢弃数据包。
I'm planning to run an automated test with computers randomly sending payments to each other and randomly dropping packets.
引用的来信Hal Finney来源 ↗
- 比特币系统被证明对社会有用且有价值,因此节点运营者觉得自己的努力是在为世界作出有益贡献(类似各种“@Home”计算项目,人们自愿贡献计算资源来支持公益)。
- The bitcoin system turns out to be socially useful and valuable, so that node operators feel that they are making a beneficial contribution to the world by their efforts (similar to the various "@Home" compute projects where people volunteer their compute resources for good causes).
在这种情况下,我觉得单纯的利他主义就足以让网络正常运行。
In this case it seems to me that simple altruism can suffice to keep the network running properly.
如果我们能解释清楚,从自由意志主义的角度看,它会很有吸引力。不过,我更擅长写代码,不太擅长文字表达。
It's very attractive to the libertarian viewpoint if we can explain it properly. I'm better with code than with words though.
Satoshi Nakamoto
Satoshi Nakamoto