sov-modules-api

The sov-modules-api crate provides essential traits for the Module System. Here are the key traits defined by the crate:

  1. The Module trait: Defines how to initialize and change the state of a module. This is the main trait that module developers need to implement. The author of a module must specify:

  2. The ModuleInfo trait: Provides additional information related to a module. This trait is automatically derived.

  3. The Spec trait: It defines all the types that modules are generic over. This separation allows the module logic to be independent of concerns such as the specific storage system or concrete signature schemes used for signing rollup transactions. Currently acceptable hashes for Spec should fit into 32 bytes.

  4. The Context trait implements the Spec and introduces additional methods accessible within modules. Currently, it includes the sender() method, which returns the address of the transaction sender. This trait will be further extended with other useful methods, such as batch_hash(), and more. This crate defines also the default implementation for the Context trait.

  5. The Genesis trait: Defines how the rollup is initialized during deployment phase.

  6. The DispatchCall trait: Defines how messages are forwarded to the appropriate module and how the call message is executed. The implementation of this trait can be generated automatically using a macro.