Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outbound rate limit: add rate limit flags to state and corresponding update message #2041

Closed
Tracked by #2056
ws4charlie opened this issue Apr 17, 2024 · 0 comments · Fixed by #2046
Closed
Tracked by #2056
Assignees
Labels
zetacore Issues related to ZetaCore

Comments

@ws4charlie
Copy link
Contributor

Describe the Issue
We'll need additional state-based rate limit flags to control the rate limit functionality. The structure may look like below

RateLimiterFlags {
  Enable bool
  Window uint64 //  in zeta blocks, for example: 1200, means 2 hours
  Rate   sdk.Int    //  in zeta, for example: 2000000, means 2M ZETA tokens
  ZRC20Rates []{
    ChainId   int64
    CoinType. coin.CoinType
    Asset     string    // the ERC20 token address in foreign chain
    ConversionRate // conversion rate zrc20 -> zeta, for example: 0.8, means 1USDT == 0.8ZETA
  }
}

Also, we'll need a MsgUpdateCrosschainFlags with proper policy type in order to update the fields of above structure.

Expected Outcome

  • The gRPC query will check Enable field to apply rate limit or not.
  • If rate limit is enabled, the parameters in RateLimiterFlags structure will be used to perform rate limiting.
  • To update the rate limit flags, a message of MsgUpdateCrosschainFlags is required with proper policy type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zetacore Issues related to ZetaCore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants