论文标题
CBLOCKSIM:模块化高性能区块链模拟器
CBlockSim: A Modular High-Performance Blockchain Simulator
论文作者
论文摘要
自2008年出现以来,区块链引起了学术界和工业的关注。由于部署大型区块链的不便,区块链模拟器可用于促进区块链设计和实施。我们评估应用于比特币和以太坊的最新模拟器,发现它们的性能和可伸缩性低,这是很大的局限性。为了构建一个更通用,更快的区块链模拟器,我们扩展了现有的区块链模拟器,即Blocksim。我们添加了一个与网络拓扑生成算法集成的网络模块和一个块传播算法,以生成现实的区块链网络并有效地模拟块传播。我们设计了二进制交易池结构,并将块从Python迁移到C ++,因此可以使用位操作来加速模拟并减少存储器使用情况。此外,我们基于五个主要区块链过程对模拟器进行模块化。在单个模块中实现了重要的区块链元素,包括共识协议(POW和POS),信息传播算法(八卦)和最终化规则(最长的规则和幽灵规则),并可以灵活地组合以模拟不同类型的区块链。实验表明,新的模拟器通过数量级减少了模拟时间并提高可扩展性,从而使我们能够模拟一万个节点以上的节点,大约是比特币和以太坊网络的大小。提出了两个典型的用例来研究与大多数其他模拟器未涵盖的与网络相关的问题。
Blockchain has attracted much attention from both academia and industry since emerging in 2008. Due to the inconvenience of the deployment of large-scale blockchains, blockchain simulators are used to facilitate blockchain design and implementation. We evaluate state-of-the-art simulators applied to both Bitcoin and Ethereum and find that they suffer from low performance and scalability which are significant limitations. To build a more general and faster blockchain simulator, we extend an existing blockchain simulator, i.e. BlockSim. We add a network module integrated with a network topology generation algorithm and a block propagation algorithm to generate a realistic blockchain network and simulate the block propagation efficiently. We design a binary transaction pool structure and migrate BlockSim from Python to C++ so that bitwise operations can be used to accelerate the simulation and reduce memory usage. Moreover, we modularize the simulator based on five primary blockchain processes. Significant blockchain elements including consensus protocols (PoW and PoS), information propagation algorithms (Gossip) and finalization rules (Longest rule and GHOST rule) are implemented in individual modules and can be combined flexibly to simulate different types of blockchains. Experiments demonstrate that the new simulator reduces the simulation time by an order of magnitude and improves scalability, enabling us to simulate more than ten thousand nodes, roughly the size of the Bitcoin and Ethereum networks. Two typical use cases are proposed to investigate network-related issues which are not covered by most other simulators.