accesscontrol

package
v0.45.10 Latest Latest
Warning

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

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

README

x/accesscontrol

The x/accesscontrol module is part of the Sei Protocol on Cosmos. This module is responsible for defining and managing the resource dependencies for each message type in the system to enable concurrent transaction execution.

Resource Dependency Mapping

The concept of a resource dependency mapping is central to the x/accesscontrol module. These mappings define which resources depend on other resources in the system, and allow users to define read and/or write access operations. By managing these dependencies, the module enables transactions to be executed concurrently in a block while ensuring deterministic results.

The module provides query commands for obtaining these resource dependency mappings. These commands return the current state of resource dependencies, either for a specific resource or for all resources in the system.

There is also a transaction command to update resource dependency mappings through a proposal mechanism. This allows the system's users to suggest changes to the resource dependencies, which can then be accepted or rejected by the system's governance process.

Wasm Dependency Mapping

In addition to the general resource dependency mappings, the x/accesscontrol module also has specific support for Wasm contract dependencies. This recognizes the fact that Wasm contracts are a key resource in the system and may have specific dependency requirements.

The module provides a query command to get the Wasm contract dependency mapping for a specific contract address. This can be used to inspect the dependencies of a Wasm contract.

There is also a transaction command to register dependencies for a Wasm contract. This allows the dependencies of a contract to be defined and updated as necessary.

Concurrent Transaction Execution

The x/accesscontrol module's primary function is to enable concurrent transaction execution within a block while maintaining deterministic results. By defining resource dependencies (including Wasm contract dependencies) when messages are added to the system, the module can build a dependency graph for each block. This allows transactions to be executed concurrently, increasing throughput and efficiency.

In summary, the x/accesscontrol module provides a mechanism for managing and enforcing access control in the system through the concept of resource dependencies. It allows for concurrent transaction execution within a block by defining read and write access operations, and maintaining a resource dependency graph for deterministic results.

Query Commands

The x/accesscontrol module supports various query commands:

Get Params: Returns the parameters for the x/accesscontrol module. Run with: seid q accesscontrol params

Get Resource Dependency Mapping: Returns the resource dependency mapping for a specific message key. Run with: seid q accesscontrol resource-dependency-mapping [messageKey].

List Resource Dependency Mapping: Lists all resource dependency mappings. Run with: seid q accesscontrol list-resource-dependency-mapping

Transaction Commands The x/accesscontrol module supports various transaction commands:

Update Resource Dependency Mapping Proposal: Submits a proposal to update resource dependencies between objects. The proposal should be provided as a JSON file with the following structure:

{
  "title": "[title]",
  "description": "[description]",
  "deposit": "[deposit]",
  "message_dependency_mapping": "[<list of message dependency mappings>]"
}

Run with: seid tx accesscontrol update-resource-dependency-mapping [proposal-file].

Register Wasm Dependency Mapping: Registers dependencies for a Wasm contract. The mapping should be provided as a JSON file with the following structure:

{
  "wasm_dependency_mapping": "<wasm dependency mapping>"
}

Run with: seid tx accesscontrol register-wasm-dependency-mapping [mapping-json-file].

Documentation

Index

Constants

View Source
const (
	DefaultCodespace = types.ModuleName
)

Variables

View Source
var (
	ErrUnexpectedWasmDependency         = sdkerrors.Register(DefaultCodespace, 2, "unexpected wasm dependency detected")
	ErrWasmDependencyRegistrationFailed = sdkerrors.Register(DefaultCodespace, 3, "wasm dependency registration failed")
)

Functions

func NewHandler

func NewHandler(k keeper.Keeper) sdk.Handler

NewHandler returns a handler for accesscontrol messages.

func NewProposalHandler

func NewProposalHandler(k keeper.Keeper) govtypes.Handler

Types

type AppModule

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

AppModule implements an application module for the accesscontrol module.

func NewAppModule

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

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)

BeginBlock returns the begin blocker for the accesscontrol module.

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

ConsensusVersion implements AppModule/ConsensusVersion.

func (AppModule) EndBlock

EndBlock returns the end blocker for the accesscontrol module. It returns no validator updates.

func (AppModule) ExportGenesis

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

ExportGenesis returns the exported genesis state as raw bytes for the mint module.

func (AppModule) ExportGenesisStream

func (am AppModule) ExportGenesisStream(ctx sdk.Context, cdc codec.JSONCodec) <-chan json.RawMessage

func (AppModule) GenerateGenesisState

func (AppModule) GenerateGenesisState(simState *module.SimulationState)

GenerateGenesisState creates a randomized GenState of the accesscontrol module.

func (AppModule) InitGenesis

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

InitGenesis performs genesis initialization for the accesscontrol module. It returns no validator updates.

func (AppModule) LegacyQuerierHandler

func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

LegacyQuerierHandler returns the x/accesscontrol module's sdk.Querier.

func (AppModule) Name

func (AppModule) Name() string

Name returns the accesscontrol module's name.

func (AppModule) ProposalContents

func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent

ProposalContents doesn't return any content functions for accesscontrol proposals.

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

QuerierRoute returns the accesscontrol module's querier route name.

func (AppModule) RandomizedParams

func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange

RandomizedParams creates randomized accesscontrol param changes for the simulator.

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

RegisterInvariants registers the accesscontrol module 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.

func (AppModule) RegisterStoreDecoder

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

RegisterStoreDecoder registers a decoder for accesscontrol module's types.

func (AppModule) Route

func (am AppModule) Route() sdk.Route

Route returns the message routing key for the accesscontrol module.

func (AppModule) WeightedOperations

func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation

WeightedOperations doesn't return any accesscontrol module operation.

type AppModuleBasic

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

AppModuleBasic defines the basic application module used by the accesscontrol module.

func (AppModuleBasic) DefaultGenesis

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

DefaultGenesis returns default genesis state as raw bytes for the accesscontrol module.

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

GetQueryCmd returns the root query command for the accesscontrol module.

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd() *cobra.Command

GetTxCmd returns no root tx command for the accesscontrol module.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the accesscontrol module's name.

func (AppModuleBasic) RegisterGRPCGatewayRoutes

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

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the accesscontrol module.

func (AppModuleBasic) RegisterInterfaces

func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's interface types

func (AppModuleBasic) RegisterLegacyAminoCodec

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

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

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router)

RegisterRESTRoutes registers the REST routes for the accesscontrol module.

func (AppModuleBasic) ValidateGenesis

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

ValidateGenesis performs genesis state validation for the accesscontrol module.

func (AppModuleBasic) ValidateGenesisStream

func (am AppModuleBasic) ValidateGenesisStream(cdc codec.JSONCodec, config client.TxEncodingConfig, genesisCh <-chan json.RawMessage) error

Directories

Path Synopsis
cli
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