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 xmsgtypes.RateLimiterFlags) bool
IsRateLimiterUsable checks if the rate limiter is usable or not
Types ¶
type Input ¶
type Input struct {
// pell chain height
Height int64
// the missed cctxs in range [?, NonceLow) across all chains
XmsgsMissed []*xmsgtypes.Xmsg
// the pending cctxs in range [NonceLow, NonceHigh) across all chains
XmsgsPending []*xmsgtypes.Xmsg
// the total value of the past cctxs within window across all chains
PastXmsgsValue sdkmath.Int
// the total value of the pending cctxs across all chains
PendingXmsgsValue sdkmath.Int
// the lowest height of the pending (not missed) cctxs across all chains
LowestPendingXmsgHeight int64
}
Input is the input data for the rate limiter
type Output ¶
type Output struct {
// the cctxs to be scheduled after rate limit check
XmsgsMap map[int64][]*xmsgtypes.Xmsg
// the current sliding window within which the withdrawals are considered by the rate limiter
CurrentWithdrawWindow int64
// the current withdraw rate (apell/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.