Blockchain systems suffer from high storage costs as every node needs to store and maintain the entire blockchain data. After investigating Ethereum's storage, we find that the storage cost mostly comes from the index, i.e., Merkle Patricia Trie (MPT). To support provenance queries, MPT persists the index nodes during the data update, which adds too much storage overhead. To reduce the storage size, an initial idea is to leverage the emerging learned index technique, which has been shown to have a smaller index size and more efficient query performance. However, directly applying it to the blockchain storage results in even higher overhead owing to the requirement of persisting index nodes and the learned index's large node size. To tackle this, we propose COLE, a novel column-based learned storage for blockchain systems. We follow the column-based database design to contiguously store each state's historical values, which are indexed by learned models to facilitate efficient data retrieval and provenance queries. We develop a series of write-optimized strategies to realize COLE in disk environments. Extensive experiments are conducted to validate the performance of the proposed COLE system. Compared with MPT, COLE reduces the storage size by up to 94\% while improving the system throughput by $1.4\times$-$5.4\times$.
翻译:摘要:区块链系统存在高存储成本的问题,因为每个节点都需要存储并维护完整的区块链数据。通过研究以太坊的存储机制,我们发现存储成本主要源于索引,即默克尔帕特里夏树(Merkle Patricia Trie, MPT)。为支持溯源查询,MPT在数据更新时会持久化索引节点,导致存储开销显著增加。为降低存储规模,一个初步思路是借鉴新兴的学习型索引技术——该技术已被证明具有更小的索引规模和更高效的查询性能。然而,直接将其应用于区块链存储会因需持久化索引节点且学习型索引节点体积庞大,反而导致更高的存储开销。为此,我们提出COLE——一种面向区块链系统的基于列的学习型存储方案。借鉴列式数据库设计思想,我们将每个状态的连续历史值进行连续存储,并通过学习模型建立索引,以支持高效的数据检索与溯源查询。我们开发了一系列写优化策略,以在磁盘环境中实现COLE。通过大量实验验证了所提COLE系统的性能。与MPT相比,COLE在将存储规模降低最高94%的同时,将系统吞吐量提升至1.4倍至5.4倍。