fedimint_core::module

Module version

Source
Expand description

Fedimint consensus and API versioning.

§Introduction

Fedimint federations are expected to last and serve over time diverse set of clients running on various devices and platforms with different versions of the client software. To ensure broad interoperability core Fedimint logic and modules use consensus and API version scheme.

§Definitions

  • Fedimint component - either a core Fedimint logic or one of the modules

§Consensus versions

By definition all instances of a given component on every peer inside a Federation must be running with the same consensus version at the same time.

Each component in the Federation can only ever be in one consensus version. The set of all consensus versions of each component is a part of consensus config that is identical for all peers.

The code implementing given component can however support multiple consensus versions at the same time, making it possible to use the same code for diverse set of Federations created at different times. The consensus version to run with is passed to the code during initialization.

The client side components need track consensus versions of each Federation they use and be able to handle the currently running version of it.

CoreConsensusVersion and ModuleConsensusVersion are used for consensus versioning.

§API versions

Unlike consensus version which has to be single and identical across Federation, both server and client side components can advertise simultaneous support for multiple API versions. This is the main mechanism to ensure interoperability in the face of hard to control and predict software changes across all the involved software.

Each peer in the Federation and each client can update the Fedimint software at their own pace without coordinating API changes.

Each client is expected to survey Federation API support and discover the API version to use for each component.

Notably the current consensus version of a software component is considered a prefix to the API version it advertises.

Software components implementations are expected to provide a good multi-API support to ensure clients and Federations can always find common API versions to use.

ApiVersion and MultiApiVersion is used for API versioning.

Structs§

Constants§