Regen Network
Published in

Regen Network

Cosmos SDK and the Launch of the 0.40 Stargate Release

PC: Cosmos

Let’s begin with the big picture.

  1. The first elements of executing this vision in the Stargate release are the SDK upgrade module and the upgrade daemon Cosmovisor. Long-running chains need upgrade support.
  2. The second major element in the new Stargate SDK was the refactoring of the SDK to Protobuf. Protobuf brings a transformational upgrade in performance and improved UX for clients. However, what drove the architectural decision was an understanding of the importance of evolutionary schema design for a long running distributed system. A core goal of this engineering paradigm is to try not to break existing functionality when you add new functionality.
PC: BTC Manager

There are two main ways we accomplish the goal of resisting breaking changes for client developers.

  • Proto messages have field numbers. This makes it possible to add new fields to a schema and delete unused fields without causing breaking changes for downstream clients. When depreciation occurs, we simply deprecate the whole field and it’s number, and add a new field with a new number for new functionality. This ensures that clients do not arbitrarily break.
  • For instance, if you were to build a form with the following fields: 1- Name, 2- Date of Birth, 3 — Country, using amino it would be very easy to simply replace 2 — Date of birth with 2- Birthday. This breaks all downstream clients because computers just do what you tell them to. Protobuf makes it easy to check for these sorts of breaking changes and easy to deprecate field 2 if you no longer want to collect Date of Birth information. Instead of clobbering field 2 via renaming, instead, you create a new field 4 — “Account Balance,’’ to add new functionality in a way that downstream clients don’t break, but the update is reflected. This is an essential attribute in creating a stable interface for long-running distributed systems, and Protobuf has the tooling to make developing in this paradigm easy for developers.
  • Semantic Versioning is a paradigm that dictates how to version software releases. The basic idea is to have consistency in indicating breaking changes to an API in a common way. Implied within it is an engineering paradigm, in which breaking changes are postponed or minimized. For instance, you don’t want to push a software version 2.0 (denoting a large breaking change to your API) just because you can. Instead, you want to focus on a 1.1 release, and then a 1.1.1 after that, in which changes, as much as possible, are not breaking the core API. In the case of the Cosmos SDK, in order to embrace this Semantic Versioning concept, it is very important to apply the evolutionary schema paradigm described above.
  • If you are not careful, Semantic versioning can lead developers to stop worrying about breaking changes as long as they are appropriately named, which is a nightmare for client developers and what we need to avoid in the ecosystem. Instead of being aggressive with breaking changes, we want to postpone large breaking changes as long as possible. The fusion of evolutionary schema with semantic versioning ensures we have discipline about naming breaking changes, while also striving to avoid those breaking changes whenever possible.



Regen Network aligns economics with ecology to drive regenerative land management. Learn more: This blog is published by RND PBC, the development company building Regen Network

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Regen Network

A blockchain network of ecological knowledge changing the economics of regenerative agriculture to reverse global warming.