header-langage
简体中文
繁體中文
English
Tiếng Việt
한국어
日本語
ภาษาไทย
Türkçe
Scan to Download the APP

Ankr joins hands with BSC to successfully upgrade the performance of Erigon client

2021-12-12 17:00
Read this article in 20 Minutes
总结 AI summary
View the summary 收起
Original source: Ankr


 

 

Binance Smart Chain was originally launched as A fork of go-ethereum to improve interoperability, programmability, and compatibility with Ethereum smart contracts. The success of the Binance Smart Chain has also brought with it scalability issues that date back to its origins.

 

One of the key issues with running a BSC archive node is the need to store data locally up to about 17TB. This unwieldy amount of storage results in more time to index or compress the data, while also reducing the Geth client's performance for requesting data. Geth (Go Ethereum) is a command-line interface designed to run concurrently with the EVM (Ethereum Virtual Machine).

 

EVM compatibility is one of the main advantages of BSC, it has the ability to support a large number of existing Ethereum tools, promote block features such as speed and low cost. We need to create a more efficient storage mechanism to guarantee the best performance of BSC while ensuring Geth runs smoothly.

 

About Erigon Solutions


Erigon initially started An improvement on turbo-geth and Geth, and then a new name because it quickly evolved into a very different product from Geth.

 

Ankr is implementing https: //github.com/ledgerwatch/erigon is the BSC Erigon open source client, which solves many problems in BSC. The Erigon client is designed to improve data storage efficiency and blockchain performance in several key ways:


Erigon is modular in design , to support parallel development of clients


· When interacting with state, the database has fewer read/write operations


· Preprocessing data outside of the storage engine significantly improves database efficiency


· Through the same series at the same time, the overall faster Sync


Erigon's advantage


Compared with Geth and other modern The improvements to the Erigon client have significant advantages over other Ethereum clients:


Larger disk storage space Reduced: 1.2TB for archive nodes, 430GB for pruned nodes


Faster sync: >10 blocks per second


Bootstrap archive node faster: completed in less than 3 days


· More resilient to crashes: Erigon database can withstand power failure


· More modular: P2P and Web3 RPC services can be run as components

 

Erigon solution for BSC and Ankr are mutually beneficial. The Erigon open source client means that BSC node users can use it freely and contribute computing power to the Ankr protocol and multi-chain RPC network. With a fast and reliable BSC node network, Ankr will be able to better serve BSC protocol and dApp developers provide services.

 

Ankr’s Difficulties and Challenges


< p class="MsoNormal">Erigon is a highly anticipated solution. However, due to BSC's consensus mechanism and block processing, Erigon is not fully compatible with BSC. Therefore, Ankr has been working with the BSC team for a long time to solve the key Migrating challenges and merging Erigon functionality to BSC. Ensuring compatibility of all nodes is a priority throughout migration from BSC Geth to Erigon.

 

Features migrated from BSC nodes:



· Genesis block and chain configuration - Erigon will transfer all Genesis Information is stored in the source itself rather than a JSON file, and there is no need to pre-initialize the blockchain state before running a node. This is important, but means additional support for all possibilities in the source files. Also, it helps to run nodes by providing a chain flag with BSC value.


· Parlia consensus engine——BSC uses its own consensus engine Parlia, while Erigon's consensus interface is compatible with Geth Not fully compatible. Therefore, Ankr decided to modify the interface to make the two systems compatible without sacrificing compatibility with block processing, which made it easier to merge Erigon.


· Compatible system calls for BSC——Erigon already supports system calls, but due to the callee and Gas Due to the difference in restrictions, they are not compatible with BSC's system calls. The key difference with BSC is that each system transaction requires an intermediate block finalization, which Erigon does not support. Also, if multiple syscalls modify the same state object it may cause gas computation issues.


· Forks - we support all BSC forks, including Ramanujan, Niels, MirrorSync and Bruno.


· Block Processing - The BSC block processing method is relatively tricky, it attaches system transactions and receipts to each During the execution of a block, the modification of the block will change the transaction, receipt root and state root at the same time, which is why the block processing part of Erigon is changed, that is, the terms of the Erigon consensus engine can only be verified but cannot modify the state.


· System Contracts - All BSC system contracts are supported by a transport layer to facilitate BNB crossing communication function.

 

Erigon's Milestone


At the first In the BSC Erigon client, we decided not to enable the Validator mode and let it work as a complete blockchain node. Currently, Erigon does not support bookkeeping to avoid node outages, this will be supported in a future Erigon update.

 

The first milestone is to ensure that the Erigon solution has no Err, when full node functionality is complete, we will verify that Erigon is compatible with BSC validator nodes.

 

Erigon's improvement on BSC


·  ; Improved speed and performance - Erigon has increased the speed of MDBX repositories. MDBX is one of the fastest and lightest embedded databases, Erigon reduces database size and improves BSC performance. Of course, MDBX has some limitations like it only supports 2³¹ file system pages for addressing and limits the database size to 8TB, the solution is to fix it by increasing the page size on FS. Currently, storing a full archive BSC node in the database takes about 2.5TB using Erigon and the MDBX driver, which provides about a 30% performance boost compared to databases like RocksDB or LevelDB.

 

· New RPC Daemon Features - One of Erigon's main features is the RPC Daemon. By removing all RPC functionality from the node, we can create an independent transfer function between the node and the RPC daemon, letting developers extend their RPC with remote database functionality. This mechanism is so powerful that you can build a cluster from nodes just by setting an Erigon fully synchronous mode and increasing its scalability.

 

· Improve the synchronization process - synchronizing nodes is a time-consuming and arduous process, Erigon efficiently processing power and reduced database coverage to speed up the process. The idea behind phased sync is to split the sync process into 15 parts, such as downloading headers or bodies, chunk execution, or state verification. This division utilizes all resources of the device by using batching and shared caches, all intermediate caches are deleted after each stage, saving disk space and IO operations. Most stages allow for certain optimizations that would be difficult to achieve without a staged synchronization architecture. The heaviest stage is still block execution, which is difficult to parallelize due to the strict sequential nature of the transactions themselves, but all other parts have minimal impact on the synchronization process.

 

Benchmarks and Results


In Benchmarks Among them, the Erigon BSC client performed very well. The following is a brief overview of our testing process, and you can also find it on Ankr official website Docs——Node—Initial testing of the Erigon BSC testnet archive node for details.

 

Hardware Specifications


We use Digital Ocean A sub-average server of my own to test Erigon's excellent performance in BSC:


·Processor: 4 vCPU


Memory: 8GB


Operating System: 160 GB


· Storage: 1T GB disk for BSC testnet archive data

 

Synchronization process


Testnet sync process started on [INFO] [12–06|21:34:41.691] 


 

Proceeded all the way to [INFO] [12–07|22:54:31.442] [6/15 Execution] Completed on block=14778509.


 

 

The entire synchronization process took 25 hours 10 minutes. It is worth noting that Erigon only uses a single CPU processor, which leaves a lot of room for future improvements. Having only 1 CPU makes it very challenging to speed up since blocks and transactions are inherently sequential rather than parallel. We estimate that the actual process may be 4-5 times faster than our experiments, which is significantly better than the current Go-Ethereum-based client.

 

Benchmark


The Ankr team used ethspam and versus to test the performance of the Erigon client, tested 100, 200, and 300 concurrent requests respectively, and the error rate was 0%; compared with 100 Geth Goreli testnets on the same server, Geth Goreli testnet The test encountered a connection error of 6.75%, and the test results of Erigon were significantly better.

 

Erigon 100 concurrent requests


 

 

Erigon 200 concurrent requests


 

 

< h4>Erigon 300 concurrent requests


 

 

GETH Goreli Testnet 100 concurrent requests


A similar benchmark test on a Digital Ocean server with exactly the same specifications shows that tp95 and tp99 perform poorly , with a connection error of 6.75%.


 

 

Erigon's next step

< br>

Ankr now has more opportunities for improvement, and we will continue to communicate with the BSC team to plan and adjust our future work content. First, we will prioritize the following. You can follow our Github(https://github.com/binance-chain/bsc-erigon)to learn more More Erigon related information and test results.

 

· Using multi-core CPU to continuously improve the performance of BSC Erigon

< br>

· Enable validator mode


·  ;BSC 2.0

 

Binance Smart Chain Ecosystem Advantages


Ankr has a close relationship with the BSC ecosystem and we firmly believe that this new project is very beneficial to the BSC community and applications.

 

Ankr via our bscrpc.com

a> Public RPC further enhances the capabilities of BSC developers. This open, free RPC allows anyone to make requests to the chain and receive responses as if they were running a full BSC node themselves.

 

Ankr product director Josh Neuroth believes: "With the emerging markets such as DeFi, NFT and games being built on BSC, The transaction volume on BSC has reached an all-time high. Low Gas and EVM compatibility make it popular, but this comes at a price, that is, nodes are struggling to keep up. We have customized Erigon through Ankr open source, and we can help Node providers maintain block heights to ensure the continued prosperity of the BSC community."

 

BSC Ecological Coordinator Samy also said: " We are proud that BSC is achieving lofty goals as an open protocol and community-driven ecosystem.”

 

BSC projects and Users will benefit a lot from network upgrades. As BSC develops faster and more efficiently, it will be able to handle greater traffic and transactions, which means that new projects will be built on a more highly evolved BSC, and developers can build BSC dApps more quickly, all fields of encryption technology All have a BSC figure.


This article is from a contribution and does not represent the opinion of Rhythm BlockBeats.

 


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

举报 Correction/Report
This platform has fully integrated the Farcaster protocol. If you have a Farcaster account, you canLogin to comment
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit