Documentation ¶
Overview ¶
Package ratelimiter provides functionalities for rate limiting the cross-chain transactions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRateLimiterUsable ¶
func IsRateLimiterUsable(rateLimiterFlags crosschaintypes.RateLimiterFlags) bool
IsRateLimiterUsable checks if the rate limiter is usable or not
Types ¶
type Input ¶
type Input struct { // zeta chain height Height int64 // the missed cctxs in range [?, NonceLow) across all chains CctxsMissed []*crosschaintypes.CrossChainTx // the pending cctxs in range [NonceLow, NonceHigh) across all chains CctxsPending []*crosschaintypes.CrossChainTx // the total value of the past cctxs within window across all chains PastCctxsValue sdkmath.Int // the total value of the pending cctxs across all chains PendingCctxsValue sdkmath.Int // the lowest height of the pending (not missed) cctxs across all chains LowestPendingCctxHeight int64 }
Input is the input data for the rate limiter
func NewInput ¶
func NewInput(resp crosschaintypes.QueryRateLimiterInputResponse) (*Input, bool)
NewInput creates a rate limiter input from gRPC response
type Output ¶
type Output struct { // the cctxs to be scheduled after rate limit check CctxsMap map[int64][]*crosschaintypes.CrossChainTx // the current sliding window within which the withdrawals are considered by the rate limiter CurrentWithdrawWindow int64 // the current withdraw rate (azeta/block) within the current sliding window CurrentWithdrawRate sdkmath.Int // wehther the current withdraw rate exceeds the given rate limit or not RateLimitExceeded bool }
Output is the output data for the rate limiter
Click to show internal directories.
Click to hide internal directories.