Documentation
¶
Index ¶
- func EndBlocker(ctx sdk.Context, bk types.BaseKeeper, n types.Nexus, m types.MultisigKeeper) ([]abci.ValidatorUpdate, error)
- type AppModule
- func (AppModule) ConsensusVersion() uint64
- func (am AppModule) EndBlock(ctx context.Context) ([]abci.ValidatorUpdate, error)
- func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate
- func (am AppModule) IsAppModule()
- func (am AppModule) IsOnePerModuleType()
- func (AppModule) QuerierRoute() string
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (am AppModule) RegisterServices(cfg module.Configurator)
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
- func (AppModuleBasic) GetQueryCmd() *cobra.Command
- func (AppModuleBasic) GetTxCmd() *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
- func (AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry)
- func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndBlocker ¶
func EndBlocker(ctx sdk.Context, bk types.BaseKeeper, n types.Nexus, m types.MultisigKeeper) ([]abci.ValidatorUpdate, error)
EndBlocker handles cross-chain message flow between EVM chains and the Axelar network. It performs two main operations each block:
1. ROUTING (EVM → Nexus): Process confirmed events from EVM chains
Events are confirmed by validators through the vote handler and queued for processing. Routing is intentionally deferred to the EndBlocker rather than being performed when the poll completes, because the last voter to complete a poll should not bear the gas cost of expensive routing operations. This ensures voting remains cheap and predictable.
Each confirmed event is routed based on its type:
ContractCall/ContractCallWithToken → Creates a GeneralMessage in nexus and enqueues it for routing to the destination chain.
TokenDeployed → Confirms the token deployment on the source chain, enabling cross-chain transfers for that token.
MultisigOperatorshipTransferred → Confirms key rotation on the chain, updating the active key used for signing outbound transactions.
Unsupported event types (TokenSent, Transfer) are marked as failed.
2. DELIVERY (Nexus → EVM): Deliver pending messages to destination EVM chains
Messages routed through nexus to EVM destinations are delivered by creating gateway commands:
- GeneralMessage (no asset) → ApproveContractCall command
- GeneralMessage (with asset) → ApproveContractCallWithMint command
Commands are signed by the validator set and batched for execution on the destination chain's gateway contract.
Error Handling:
- Each event/message is processed in a cached context (RunCached). If processing fails, the cached writes are discarded but the failure is recorded.
- Failed events emit EVMEventFailed; failed messages emit ContractCallFailed.
- Failures don't block processing of subsequent events/messages.
Bounded Computation:
- Processing is limited by EndBlockerLimit per chain per block.
- Remaining events/messages are processed in subsequent blocks.
Event Emission:
- Success events (ContractCallApproved, etc.) are emitted inside RunCached, so they roll back with state if something fails.
- Failure events (EVMEventFailed, ContractCallFailed) are emitted outside RunCached, so they persist for observability even if the event/message is retried later.
Types ¶
type AppModule ¶
type AppModule struct {
AppModuleBasic
// contains filtered or unexported fields
}
AppModule implements module.AppModule
func NewAppModule ¶
func NewAppModule(k *keeper.BaseKeeper, voter types.Voter, nexus types.Nexus, snapshotter types.Snapshotter, staking types.StakingKeeper, slashing types.SlashingKeeper, multisig types.MultisigKeeper, permission types.Permission) AppModule
NewAppModule creates a new AppModule object
func (AppModule) ConsensusVersion ¶
ConsensusVersion implements AppModule/ConsensusVersion.
func (AppModule) EndBlock ¶
EndBlock executes all state transitions this module requires at the end of each new block
func (AppModule) ExportGenesis ¶
ExportGenesis exports a genesis state from the module's keeper
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate
InitGenesis initializes the module's keeper from the given genesis state
func (AppModule) IsAppModule ¶ added in v1.3.0
func (am AppModule) IsAppModule()
IsAppModule implements the appmodule.AppModule interface.
func (AppModule) IsOnePerModuleType ¶ added in v1.3.0
func (am AppModule) IsOnePerModuleType()
IsOnePerModuleType implements the depinject.OnePerModuleType interface.
func (AppModule) QuerierRoute ¶
QuerierRoute returns this module's query route
func (AppModule) RegisterInvariants ¶
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
RegisterInvariants registers this module's invariants
func (AppModule) RegisterServices ¶
func (am AppModule) RegisterServices(cfg module.Configurator)
RegisterServices registers a GRPC query service to respond to the module-specific GRPC queries.
type AppModuleBasic ¶
type AppModuleBasic struct {
}
AppModuleBasic implements module.AppModuleBasic
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
DefaultGenesis returns the default genesis state
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd() *cobra.Command
GetQueryCmd returns all CLI query commands for this module
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd() *cobra.Command
GetTxCmd returns all CLI tx commands for this module
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the name of the module
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)
RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.
func (AppModuleBasic) RegisterInterfaces ¶
func (AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry)
RegisterInterfaces registers the module's interface types
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the types necessary in this module with the given codec
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error
ValidateGenesis checks the given genesis state for validity