BNB Smart Chain (BSC) brings significant programmability and interoperability to the BNB ecosystem. The ever-increasing adoption and success of BNB Smart Chain have brought scalability challenges that trace back to its birth as a fork of Geth, the biggest challenges can be storing large amounts of data such as accounts, contract storage, transactions, etc. Currently, a BSC Archive Node with Geth Client needs to store around 50 TB of data and this size will only keep increasing, making it very heavy and difficult to maintain. However, Erigon currently only needs about 6 TB of disk storage to store all this data with better performance. Considering the many benefits that Erigon brings, NodeReal has decided to support Erigon for BSC (BSC-Erigon)
Erigon aims to improve data storage efficiency, increase blockchain scalability, and enhance node performance.
Here are some key features of Erigon:
- Staged sync: Erigon breaks down the synchronization process into 16 stages, like downloading headers, bodies, execution or state verification, and performs each stage sequentially. It’ll be much more tractable to optimize each stage, more importantly, the new mechanisms for computing state root and verification drastically reduce sync time.
- Flat KV Storage: Erigon stored data using a flat key-value pair with mdbx, which allows for efficient data storage.
- Preprocessing: Erigon uses an ETL(Extract, Transform, Load) framework that sorts data before saving it into the database, minimizing the write amplification and increasing speed.
- Independent components: Most of Erigon's components (txpool, rpcdaemon, snapshots downloader, sentry, etc.) can work inside Erigon and as an independent process, decreasing coupling dependencies.
- JSON-RPC daemon: RPC is extracted out of the main binary into a separate daemon that supports both local or remote DB calls.
Erigon has a new roadmap to provide better performance and new features.
Some key parts include:
- State-of-the-art Consensus Modularity: Make the Execution module(EL) independent from the Consensus Module(CL), build a more lightweight Erigon CL, and allow Erigon to sync without a consensus layer.
- State Download Protocol: The state can be downloaded from BitTorrent instead of executing and reconstituting locally.
- Flexible Commitment Engine: For block-related data commitment, make it easier to change/switch commitment type (e.g., from hexary to verkle or binary trees).
- Database improvements: Optimized data format in the Database, such as using Snappy SSZ compression.
- Faster synchronization time.
Generally, compared to Geth and other Clients, Erigon offers significant advantages, including:
- Much less disk storage: BSC Archive node requires only 6TB of disk storage with Erigon, while Geth needs around 50TB.
- Faster Initial Sync speed: Erigon can achieve more than 10 blocks per second during the initial sync.
- Highly compressible: The compressed tar file of Erigon's database storage is around 2.1TB, compared to the original size of about 6TB.
- Crash Tolerance: Erigon is designed to resist database crashes.
- Modularity: RPC, P2P, Txpool, and many components can run separately.
- Fewer Read/Write operations with the database.
The BNB Chain ecosystem is taking a significant leap forward with the adoption of Erigon, a move that promises faster and more efficient performance to the delight of both BNB Chain and NodeReal. The use of Erigon will optimize the BSC Archive Node's performance, ensuring that the BNB Chain can handle the ever-increasing amount of data storage requirements. This improvement is also a significant win for NodeReal, as it can now provide better solutions for high-speed blockchains. As the BNB Chain ecosystem continues to evolve, it is reassuring to know that there are solutions like Erigon that can meet the growing needs of high-speed blockchains and provide the best possible experience for all participants.
Future Work and Improvements
While Erigon is currently compatible with the BNB Smart Chain, there's still much work to be done to support the BNB Smart Chain’s evolving needs. Also, there are many chances we can do to optimize the current performance of Erigon with BSC.
Here are some future work and improvements for supporting Erigon with BSC:
- Support new BEPs of BNB Smart Chain, such as new features, enhancement proposals, hard forks, etc.
- Deliver more reliable snapshot download services to enable faster synchronization of Archive Nodes without syncing from the genesis block themselves.
- Improve RPC performance, supporting more RPC calls and optimizing RPC.
- Ensure that Erigon sync will not break by addressing any issues that may arise.
- Follow up and import new features to Erigon if necessary.
- Continuously improve the performance of Erigon for BSC.
- Support and participate in the BSC-Erigon community to answer questions and solve problems.
- Conduct deeper tests of Erigon with BSC and monitor its performance continuously.
NodeReal is a one-stop blockchain infrastructure and service provider that embraces the high-speed blockchain era and empowers developers by “Make your Web3 Real”. We provide scalable, reliable, and efficient blockchain solutions for everyone, aiming to support the adoption, growth, and long-term success of the Web3 ecosystem.
Join Our Community
Join our community to learn more about NodeReal and stay up to date!