Elevating the Cosmos SDK: Eden (v0.50)

Cosmos SDK
The Interchain Foundation
5 min readNov 7, 2023

--

Eden (v0.50) marks a significant stride in the evolution of the Cosmos SDK, ushering in an era of enhanced modularity and performance.

This release is a powerful confluence of pivotal features, such as the completion of ABCI++, which revolutionizes consensus flexibility, and the introduction of AutoCLI, reducing the complexity of module creation, enabling a smoother and more efficient developer experience.

IAVL 1.0 is another highlight, bringing forth substantial improvements in disk storage and overall performance, representing a critical advancement in the Cosmos SDK infrastructure. New additions like Optimistic Execution further enhance performance, enabling the execution of block time ahead of consensus.

Also notable is the introduction of Sign Mode Textual, improving transaction signing experience, ensuring that the Cosmos SDK continues to stay at the forefront of technological innovation.

Below are some other key and notable changes in the Eden release. You can view the full changelog here.

ABCI++

With this release, CometBFT and Cosmos SDK teams will have delivered the final piece of ABCI++: Vote Extensions. In the previous release, we delivered the preliminary phases of ABCI++: Prepare and Process Proposal. Vote Extensions complete this process by allowing users to add arbitrary data to consensus. Some example use cases include leveraging vote extensions for oracles instead of having validators submit transactions to be included in a block. It also can be applied in conjunction with MEV use cases, addressing front-running issues or implementing Threshold Decryption.

Coinciding with the integration of ABCI++, other changes were made to the core layer including:

  • BeginBlock and Endblock are private and Finalizeblock is exposed for testing purposes. This allows modules to test in the same way as before.
  • When upgrading a chain, Preblock is meant to run before BeginBlock. This will upgrade the chain and migrate state. This was meant as a separation of concerns for upgrades to not conflate it with the normal operations of a chain.

AutoCLI

At the beginning of 2023, we set out to reduce the total lines of code needed to create a module. CLI is optional, but many users do implement it as CLI is used heavily by countless users.

With this in mind, we are pleased to announce the release of AutoCLI in Cosmos SDK Eden.

CLI for your custom modules can now be automatically generated when needed, reducing the amount of boilerplate when writing a module. If you’d like to learn more, the documentation can be found here.

IAVL 1.0

In conjunction with this release, the rollout of IAVL 1.0 has facilitated significant improvements to disk storage and overall performance, with a fundamental change in the key structure of the IAVL tree. In the earlier versions of IAVL, the original key format was a hash key meaning when the dataset grew, accessing the data became slower and less efficient.

The new key structure combines the version and local nonce within the key. The reason that this change improves data locality is because it reduces the randomness in how data is stored on disk. By including the version in the key, nodes are grouped together based on the version in which they were added to the tree, meaning that nodes from a particular version are stored together on disk. Similarly, the local nonce is used to distinguish nodes that belong to the same version but have different positions within that version allowing the tree to keep a specific order for nodes within the same version, again allowing retrieval to be more structured and organised.

Modules

Writing a module has been notoriously verbose in the past, with this release we have made it simpler with things like Collections and ORM. These packages are abstractions over the state layer providing powerful yet simple ways of interacting with state. In the future these packages will export the on-disk schema to be used with query layers, like GraphQL, to build complex and scalable clients. Additional changes include:

  • Gov added expedited proposals and stay tuned for multiple choice proposals and optimistic voting coming the next release.
  • Capability module was moved to the Cosmos SDK module.
  • BeginBlock signature does not import CometBFT types and returns an error
  • Endblock does not import CometBFT unless there is a need to return a validator set. This should be handled by the staking module, leaving all chains to not worry about this.
  • All modules have been migrated to use collections
  • Validate Basic is no longer required and validation of the method can be performed directly in the message server.

GetSignBytes which was part of sdk.Msg is no longer required. It is automatically inferred based on the protobut message. If you have existing modules and would like to keep the same encoding in Amino, you will need to annotate some of the fields in your proto messages. Documentation on the fields can be found here. In order to verify your encoding is the same we recommend creating a golden test.

Optimistic Execution

As previously stated, we are actively towards enhancing performance further and one of the features contributing to this is optimistic execution.

Optimistic Execution is the ability to be able to execute block time ahead of time, having the response ready prior to the consensus layer requesting it. It is Optimistic as it can still be rejected although we are executing the block.

In load tests on Sei Network, Optimistic Execution cut the block time by 50%. On fast block-producing networks like Injective, OE can help the network generate sub-1-second blocks without any extra effort.

To read more on Optimistic Execution, see our blog post here.

Sign Mode Textual

Eden also introduces a new sign mode, sign_mode_textual, which improves the signing of transactions with new hardware devices. The aim is to produce a more human-readable way to approve, review and view transaction details. Currently, this is only available on Ledger devices.

More information can be found here.

Funded by the Interchain Foundation, the development of the Cosmos SDK is led by Binary Builders. For their work and feedback on the Eden release, we would like to thank the following teams: Zondax, Orijtech, Crypto.com, Osmosis and Berachain.

We look forward to hearing your feedback and suggestions on how to further improve the Cosmos SDK.

About the Cosmos SDK

Cosmos SDK is the world’s most popular framework for building application-specific blockchains.

Written in Go, Cosmos SDK allows developers to quickly and easily build and deploy application-specific blockchains, reducing time to market, using a framework that is stable, secure and highly performant.

Cosmos SDK is the native application-building toolkit at the core of the interchain.

Learn more about Cosmos SDK or browse the docs here.

--

--

Cosmos SDK
The Interchain Foundation

The world's most popular framework for building application-specific blockchains. https://github.com/cosmos/cosmos-sdk