handlers

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The default concentration of bonded tokens a validator is allowed as a multiple of equal shares
	DefaultConcentrationMultiple = 5.5 // Amounts to ~8% with 68 validators
	// Maximum Allowed Cap for Bonded stake of any single validator
	DefaultMaxCapPercent = 0.33
	// Minimum Allowed Cap for Bonded stake of any single validator
	DefaultMinCapPercent = 0.05
)

Variables

View Source
var DefaultRestrictionOptions = &RestrictionOptions{
	MaxConcentrationMultiple: DefaultConcentrationMultiple,
	MaxBondedCapPercent:      DefaultMaxCapPercent,
	MinBondedCapPercent:      DefaultMinCapPercent,
}

DefaultRestrictionOptions are default constraints that prevent single point of failure on validators

View Source
var UnlimitedRestrictionOptions = &RestrictionOptions{
	MaxConcentrationMultiple: 1.0,
	MaxBondedCapPercent:      1.0,
	MinBondedCapPercent:      1.0,
}

UnlimitedRestrictionOptions are used to remove restrictions for validator staking limits from delegations

Functions

func AggregateEvents added in v1.13.0

func AggregateEvents(anteEvents []abci.Event, resultEvents []abci.Event) ([]abci.Event, []abci.Event)

AggregateEvents is called in the baseapp after a transaction has completed This is used to modify the events that are emitted for a transaction. anteEvents will be populated on failure and success resultEvents will only be populated on success

func NewAdditionalMsgFeeHandler

func NewAdditionalMsgFeeHandler(options PioBaseAppKeeperOptions) (sdk.FeeHandler, error)

Types

type MsgFeeInvoker

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

func NewMsgFeeInvoker

func NewMsgFeeInvoker(bankKeeper bankkeeper.Keeper, accountKeeper msgfeestypes.AccountKeeper,
	feegrantKeeper msgfeestypes.FeegrantKeeper, msgFeeKeeper msgfeestypes.MsgFeesKeeper, decoder sdk.TxDecoder) MsgFeeInvoker

NewMsgFeeInvoker concrete impl of how to charge Msg Based Fees

func (MsgFeeInvoker) Invoke

func (afd MsgFeeInvoker) Invoke(ctx sdk.Context, _ bool) (sdk.Coins, sdk.Events, error)

type MsgServiceHandler

type MsgServiceHandler = func(ctx sdk.Context, req sdk.Msg) (*sdk.Result, error)

MsgServiceHandler defines a function type which handles Msg service message.

type PioBaseAppKeeperOptions

type PioBaseAppKeeperOptions struct {
	AccountKeeper  msgfeestypes.AccountKeeper
	BankKeeper     bankkeeper.Keeper
	FeegrantKeeper msgfeestypes.FeegrantKeeper
	MsgFeesKeeper  msgfeestypes.MsgFeesKeeper
	Decoder        sdk.TxDecoder
}

type PioMsgServiceRouter

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

PioMsgServiceRouter routes fully-qualified Msg service methods to their handler with additional fee processing of msgs.

func NewPioMsgServiceRouter

func NewPioMsgServiceRouter(decoder sdk.TxDecoder) *PioMsgServiceRouter

NewPioMsgServiceRouter creates a new PioMsgServiceRouter.

func (*PioMsgServiceRouter) Handler

func (msr *PioMsgServiceRouter) Handler(msg sdk.Msg) MsgServiceHandler

Handler returns the MsgServiceHandler for a given msg or nil if not found.

func (*PioMsgServiceRouter) HandlerByTypeURL

func (msr *PioMsgServiceRouter) HandlerByTypeURL(typeURL string) MsgServiceHandler

HandlerByTypeURL returns the MsgServiceHandler for a given query route path or nil if not found.

func (*PioMsgServiceRouter) RegisterService

func (msr *PioMsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{})

RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC service description, handler is an object which implements that gRPC service.

This function PANICs:

  • if it is called before the service `Msg`s have been registered using RegisterInterfaces,
  • or if a service is being registered twice.

func (*PioMsgServiceRouter) SetCircuit added in v1.16.0

func (msr *PioMsgServiceRouter) SetCircuit(cb baseapp.CircuitBreaker)

func (*PioMsgServiceRouter) SetInterfaceRegistry

func (msr *PioMsgServiceRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry)

SetInterfaceRegistry sets the interface registry for the router.

func (*PioMsgServiceRouter) SetMsgFeesKeeper

func (msr *PioMsgServiceRouter) SetMsgFeesKeeper(msgFeesKeeper msgfeeskeeper.Keeper)

SetMsgFeesKeeper sets the msg based fee keeper for retrieving msg fees.

type RestrictionOptions added in v1.14.0

type RestrictionOptions struct {
	MaxConcentrationMultiple float32
	MaxBondedCapPercent      float32
	MinBondedCapPercent      float32
}

type StakingRestrictionHooks added in v1.14.0

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

Hooks wrapper struct for slashing keeper

func NewStakingRestrictionHooks added in v1.14.0

func NewStakingRestrictionHooks(k *stakingkeeper.Keeper, opts RestrictionOptions) StakingRestrictionHooks

NewStakingRestrictionHooks configures a hook that validates changes to delegation modifications and prevents concentration of voting power beyond configured limits on active validators.

func (StakingRestrictionHooks) AfterDelegationModified added in v1.14.0

func (h StakingRestrictionHooks) AfterDelegationModified(ctx sdktypes.Context, _ sdktypes.AccAddress, valAddr sdktypes.ValAddress) error

Verifies that the delegation would not cause the validator's voting power to exceed our staking distribution limits

func (StakingRestrictionHooks) AfterValidatorBeginUnbonding added in v1.14.0

func (h StakingRestrictionHooks) AfterValidatorBeginUnbonding(_ sdktypes.Context, _ sdktypes.ConsAddress, _ sdktypes.ValAddress) error

Implements sdktypes.ValidatorHooks

func (StakingRestrictionHooks) AfterValidatorBonded added in v1.14.0

Implements sdktypes.ValidatorHooks

func (StakingRestrictionHooks) AfterValidatorCreated added in v1.14.0

func (h StakingRestrictionHooks) AfterValidatorCreated(_ sdktypes.Context, _ sdktypes.ValAddress) error

Implements sdktypes.ValidatorHooks

func (StakingRestrictionHooks) AfterValidatorRemoved added in v1.14.0

Implements sdktypes.ValidatorHooks

func (StakingRestrictionHooks) BeforeDelegationCreated added in v1.14.0

Implements sdktypes.ValidatorHooks

func (StakingRestrictionHooks) BeforeDelegationRemoved added in v1.14.0

Implements sdktypes.ValidatorHooks

func (StakingRestrictionHooks) BeforeDelegationSharesModified added in v1.14.0

func (h StakingRestrictionHooks) BeforeDelegationSharesModified(_ sdktypes.Context, _ sdktypes.AccAddress, _ sdktypes.ValAddress) error

Implements sdktypes.ValidatorHooks

func (StakingRestrictionHooks) BeforeValidatorModified added in v1.14.0

func (h StakingRestrictionHooks) BeforeValidatorModified(_ sdktypes.Context, _ sdktypes.ValAddress) error

Implements sdktypes.ValidatorHooks

func (StakingRestrictionHooks) BeforeValidatorSlashed added in v1.14.0

func (h StakingRestrictionHooks) BeforeValidatorSlashed(_ sdktypes.Context, _ sdktypes.ValAddress, _ sdktypes.Dec) error

Implements sdktypes.ValidatorHooks

Jump to

Keyboard shortcuts

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