Fast and furious performance - roadmap update
Recap of recent and upcoming Cronos protocol improvements
As the leading EVM-compatible layer-1 blockchain built on the Cosmos SDK, Cronos benefits from open-source improvements developed by the two leading blockchain developer communities: the Ethereum community and the Cosmos community. Cronos can pick the “best of both worlds” from a broad range of robust, peer-reviewed ideas and technologies.
In this blog post, we recap the main recent and upcoming upgrades that are contributing to the scalability and reliability of the Cronos blockchain.
Cronos has validated more than 70 million transactions without interruption since launch, and has positioned itself as a top 10 blockchain by total value locked. The protocol roadmap aims to ensure that the chain continues to deliver world-class reliability while at the same time remaining fully competitive with other top chains.
TL;DR
During the first half of 2023, Cronos has implemented major improvements:
VersionDB database, leading to 62% smaller node storage requirements.
Fast node mode, enabling 50% faster node response time.
Address recovery caching, resulting in 30% increase of transaction execution speed.
More reliable public JSON-RPC endpoints, delivering more consistent data between 20% and 50% faster.
General availability of optimistic rollups on top of Cronos Mainnet, enabling the Cronos ecosystem to support hundreds or even thousands of transactions per second thanks to a mesh of layer-2’s sharing Cronos as the layer-1 settlement layer.
The following upgrades are being evaluated, for deployment to Mainnet in the coming few months:
Increase of block speed and capacity, enabling up to 2X increase of transaction per second (TPS) throughput.
MemIAVL blockchain data structure, making it >95% faster to load and export node snapshots.
Additionally, the protocol team continues to experiment with layer-2 technologies and data availability protocols to determine how they can further strengthen the Cronos ecosystem.
Please read below for important details.
Improvements already deployed to Cronos mainnet
VersionDB database
Cronos nodes can now utilize VersionDB as a database instead of RocksDB. Already 50% of the public endpoint infrastructure has been upgraded accordingly.
This improvement delivers a significant improvement in node storage, particularly for archive nodes. VersionDB can deliver up to 62% reduction in node storage requirements. In our experiments, archive node storage was reduced from 2.9TB to just 1.1TB, making it more efficient and cost-effective.
Fast node mode
An IAVL-fast node implementation has been used to revamp the key-value pair structure design of Cronos nodes. Nodes can enable the fast node option to deliver faster block execution and JSON-RPC response times, particularly if they are exposed to high query volume.
During testing, this enhancement has resulted in a remarkable 50% reduction in the response time of the JSON-RPC endpoints of pruned nodes, significantly enhancing the speed and quality of user and developer experience.
Address recovery caching
Cronos has adopted a new approach for signature verification, which reduces the number of times that the verification happens during transaction execution.
We had noticed scenarios where the recovery of the sender address was done multiple times during transaction execution (details here). This led to inefficient resource utilization and degraded performance.
The new approach makes it possible to perform the verification only once, resulting in a significant acceleration of transaction execution. During testing, we observed that transaction execution speed was increased by approximately 30%.
More reliable public JSON-RPC endpoints
A version 2.0 of the public JSON-RPC endpoint infrastructure was deployed. Thanks to its reverse proxy implementation, the updated infrastructure delivers:
More reliable data servicing. The upgrade solves the issue where various nodes, having synced at different block heights, return inconsistent smart contract call results from one call to the next.
Faster response time. With intelligent caching, response time has been improved by 50% for historical data, and 20% for current data.
This is a major win for end-users and developers alike.
Optimistic rollups on top of Cronos mainnet
Effective immediately, optimistic layer-2 rollups are commercially available on Cronos Mainnet to developers who wish to deploy high-throughput networks on top of the Cronos layer-1. The Cronos partnership with Caldera, announced recently, provides developers with technology and support for this.
Application-specific layer-2 chains are particularly relevant for Web3 games that have scaled up enough to achieve significant transaction volumes of hundreds of thousands of monthly active users. Other relevant high-volume use cases include social media platforms, NFT-enabled event ticketing, as well as a broad range of enterprise applications.
This means that the Cronos ecosystem can now support hundreds or even thousands of transactions per second (10x to 30x the current TPS of Cronos), with an ecosystem of layer-2 chains sharing Cronos as the layer-1 settlement layer.
Improvements coming soon
Increase of block speed and capacity
Blockchains produce blocks. In the case of Cronos, one new block is produced every 5 to 6 seconds. Each block contains 40 million gas, where gas is a unit of compute capacity. Each transaction requires 220,000 gas on average, but this varies a lot depending on whether the transaction is a simple transfer or a complex DeFi trade. Therefore, the theoretical capacity of Cronos layer-1 is around 35 transactions per second.
On Cronos testnet, block time was recently reduced from 5-6 seconds to 2 seconds, which mechanically increases transaction throughput (or TPS) by a factor of 2.75x.
It is unlikely that we will reduce block time to 2 seconds on mainnet right away, as it could potentially be challenging for all validators to keep up with such a rapid pace of synchronization. Hence, an aspirational target would be to aim for a block time of 3-4 seconds, which would increase TPS by a factor of 1.5x at layer 1.
We can potentially achieve bigger TPS increase by exploring an increase of block capacity from 40 million gas to, say, 80 million gas in the coming months.
Overall, when we consider both layer 1 and layer 2, the Cronos ecosystem can now support hundreds or even thousands of transactions per second, with an ecosystem of rollup chains sharing Cronos as the layer-1 settlement layer.
MemIAVL blockchain data structure
The protocol engineering team has been actively working on MemIAVL implementation, a drop-in replacement for the current IAVL implementation. IAVL is the data structure used to organize blockchain data and calculate hashes efficiently.
MemIAVL brings substantial performance improvements to the way that nodes export and load blockchain snapshots in order to synchronize faster to the latest block:
Snapshots can be stored locally and easily shared with others, eliminating the need to fetch them from the network. This addresses a known issue with the current Tendermint P2P design, where the fetching of snapshots sometimes fails to complete.
Snapshot restoration time has been shortened dramatically. Tests resulted in snapshot restoration time reduction from 16 hours to just 5 minutes. Additionally, snapshot size was reduced by 35%, from 22 GB to 14 GB.
Block execution performance can be improved significantly. Test resulted in over 10 times faster transaction execution speed by nodes.
Together with VersionDB, MemIAVL enhances the synchronization speed of nodes, leading to more up-to-date JSON-RPC endpoints.
Lastly, snapshot export time has been reduced from 10.5 hours to just 8 minutes, facilitating more frequent and up-to-date backup and sharing of snapshots.
These major improvements will benefit all node operators.
Looking ahead
The protocol team will continue to experiment with layer-2 technologies and data availability protocols to determine how they can further strengthen the Cronos ecosystem.
The Crypto.org chain’s governance recently voted for a proposal to reduce CRO inflation by burning approximately 100 million CRO per year. As a result, various Cronos protocol engineering contributors are looking into what are the possible technical options that could result in the burning of some share of the transaction fees paid by users on Cronos. They will publish updates and governance discussions in due course.
Additionally, there are a number of R&D efforts currently underway on topics such as account abstraction, MEV optimization, integration of new or updated Cosmos SDK modules, integration of additional IBC functionalities. These work streams will be incorporated into the protocol roadmap as soon as there is more clarity regarding their readiness and implementation timeframe.