network

package
v1.0.0-beta.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

README

Evolve Network Module (beta)

Experimental attester networking module. Beta quality, simplified for validating the single-attester flow — expect rapid iteration and breaking changes.

This Cosmos SDK module prototypes the Evolve attester workflow. It keeps lightweight state about the attester set, tracks attestations per block, and emits checkpoint events so downstream components can reason about soft confirmations. The implementation is intentionally narrow: it only supports one active attester and omits many safety checks required for production.

Responsibilities

  • Register gRPC and message servers that expose three transactions: MsgJoinAttesterSet, MsgLeaveAttesterSet, and MsgAttest.
  • Maintain attester membership (keeper.SetAttesterSetMember) and the index map used to build bitmaps (keeper.BuildValidatorIndexMap).
  • Store per-height attestation bitmaps and raw signatures, deriving quorum and soft-confirmation status in Keeper.EndBlocker.
  • Track epoch participation bitmaps and prune/eject placeholders for future validator governance.
  • Surface query and genesis helpers so the attester CLI can discover participation state.

Workflow Overview

  1. An operator submits MsgJoinAttesterSet. The module stores the attester’s consensus public key and adds the address to the attester key set.
  2. For each block of interest, the attester submits MsgAttest containing a signed vote payload. The keeper records the signature, flips the appropriate bit in the attestation bitmap, and updates voted power.
  3. The end blocker evaluates quorum. When the single attester’s vote is present, the block is marked “soft confirmed” and a checkpoint event is emitted with validator and commit hashes.
  4. Epoch accounting updates participation bitmaps and rebuilds the index map so subsequent votes use consistent positions.

Current Limitations

  • Only one attester is supported end-to-end. Additional attesters will collide in the bitmap logic; multi-attester support is planned but not yet implemented.
  • Vote signatures are stored but not verified. Payload parsing and signature checks will land in a later milestone.
  • Ejection, pruning, and alternate sign modes are placeholders to keep the prototype minimal.
  • Parameter defaults (epoch length = 1, checkpoint-only sign mode) are tuned for local testing rather than production networks.

Genesis & Queries

  • InitGenesis seeds module parameters, the attester set, and any persisted bitmaps. If a height is flagged as soft-confirmed, it is re-emitted during init.
  • ExportGenesis walks the collections-backed store and exports the same structs for chain state syncing.
  • The autogenerated gRPC query service wraps keeper helpers so tooling can inspect attesters, bitmaps, and params.

Feedback is welcome. Treat this module as beta software meant to validate the single-attester design, and expect functionality to evolve quickly.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState

ExportGenesis returns the network module's exported genesis.

func InitGenesis

func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) error

InitGenesis initializes the network module's state from a provided genesis state.

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(
	cdc codec.Codec,
	keeper keeper.Keeper,
) AppModule

NewAppModule creates a new AppModule object

func (AppModule) AutoCLIOptions

func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions

AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.

func (AppModule) EndBlock

func (am AppModule) EndBlock(ctx context.Context) error

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage)

InitGenesis performs genesis initialization for the staking module.

func (AppModule) IsAppModule

func (am AppModule) IsAppModule()

IsAppModule implements the appmodule.AppModule interface.

func (AppModule) IsOnePerModuleType

func (am AppModule) IsOnePerModuleType()

IsOnePerModuleType implements the depinject.OnePerModuleType interface.

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

RegisterServices registers module services.

func (AppModule) RegisterStoreDecoder

func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for supply module's types

type AppModuleBasic

type AppModuleBasic struct {
	// contains filtered or unexported fields
}

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis returns default genesis state as raw bytes.

func (AppModuleBasic) Name

func (am AppModuleBasic) Name() string

Name returns the network module's name

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux)

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the network module.

func (AppModuleBasic) RegisterInterfaces

func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's interface types

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the network module's types on the given LegacyAmino codec.

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error

ValidateGenesis performs genesis state validation for the network module.

type ModuleInputs

type ModuleInputs struct {
	depinject.In

	Config        *modulev1.Module
	Cdc           codec.Codec
	StoreService  store.KVStoreService
	StakingKeeper types.StakingKeeper
	AccountKeeper types.AccountKeeper
	BankKeeper    types.BankKeeper
}

type ModuleOutputs

type ModuleOutputs struct {
	depinject.Out

	NetworkKeeper keeper.Keeper
	Module        appmodule.AppModule
}

func ProvideModule

func ProvideModule(in ModuleInputs) ModuleOutputs

Directories

Path Synopsis
client
cli
module
v1
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL