Simplify istio rate limits - #6933
Conversation
[backport] ReminderPlease consider backporting to the following branches:
And your PR is currently against base branch: main. Note: Any PR comment containing [backport] will be considered for auto-backporting upon merge, |
By default only have a global rate limit [static] Signed-off-by: Nicu Reut <nicu.reut@digitalasset.com>
2edaaeb to
8b03586
Compare
| scan: | ||
| externalRateLimits: | ||
| !include(./rate-limits/v0-acs.yaml;./rate-limits/unlimited.yaml;./rate-limits/public-banned.yaml;./rate-limits/token-registry.yaml) | ||
| enablePerEndpointRateLimits: false |
There was a problem hiding this comment.
So the idea is to keep the functionality around in case we want to use it after all, at least for our deployments?
There was a problem hiding this comment.
Yes, pretty much, as a safety precaution
| }); | ||
| }); | ||
|
|
||
| test('buildGlobalPerIpRateLimitAction keys only on the non-spoofable client address', () => { |
There was a problem hiding this comment.
what does "keys" even mean in this context 😕
There was a problem hiding this comment.
the key of the attribute used for the ip basically. making sure we don't change something unintentionally to not use the masked address
|
|
||
| globalPerIpLimits?: Limits; | ||
|
|
||
| enablePerEndpointRateLimits?: boolean; |
There was a problem hiding this comment.
Hm can we just skip this flag and simply leave the per-endpoint-rate limits unset if we don't want these?
Having something explicitly set in a config that is actually unused because of a boolean flag somewhere seems a bit meh.
There was a problem hiding this comment.
Agree, issue was that it would've made the PR more complex. Let me do it though
[static] Signed-off-by: Nicu Reut <nicu.reut@digitalasset.com>
|
/cluster_test |
|
Deploy cluster test triggered for Commit f6558566cd2a4ccab237245cc9198a1f88c5a87c in , please contact a Contributor to approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/79853 |
martinflorian-da
left a comment
There was a problem hiding this comment.
Removes more LOC than it adds, must be good. Thank you!
| tokensPerFill: 500 | ||
| fillInterval: 60s | ||
| perIpLimits: # per-IP limit | ||
| maxTokens: 10 |
There was a problem hiding this comment.
Talking to myself: this should be fine:
splice/cluster/images/scan-app/app.conf
Line 78 in 9af4459
| scan: | ||
| externalRateLimits: | ||
| !include(./rate-limits/v0-acs.yaml;./rate-limits/unlimited.yaml;./rate-limits/public-banned.yaml;./rate-limits/token-registry.yaml) | ||
| !include(./rate-limits/public-banned.yaml;./rate-limits/token-registry.yaml) |
There was a problem hiding this comment.
For token registry - is the medium-term to remove those as well in favor of relying only on the splice rate limits? (Shall we add a TODO if so?)
There was a problem hiding this comment.
Let me create an issue to revisit right before opening it up.
The idea is to remove it unless we explicitly want some higher limits for that part of the API
There was a problem hiding this comment.
higher limits for that part of the API
Can we do actually do that? Successful requests will not deplete the global and default per-IP buckets?
There was a problem hiding this comment.
no, the first match consumes the limit, the global one is basically the "default" and used if nothing else matches
so we can sort of partition out certain parts of the API
| const effectiveRateLimits = Object.fromEntries( | ||
| Object.entries(args.rateLimits || {}).filter( | ||
| (ent): ent is [string, LocalLimit<MatchedLimits>] => { | ||
| // TODO (#4201): in banned case, implement actual banning with special short-circuit for whitelisted IPs |
There was a problem hiding this comment.
Do we need to explicitly track this as nice-to-have for MainNet opening?
There was a problem hiding this comment.
tbh not sure if it's even worth doing.
we can just set the limit to 0 in the splice rate limiter, as we need to ship it to everyone anyway
There was a problem hiding this comment.
IMHO that would be a valid way to resolve this, but AFAIU banned currently is a NOP, which can mislead us in the future.
There was a problem hiding this comment.
good point, let me just delete the banned stuff
|
/cluster_test |
|
Deploy cluster test triggered for Commit 5f2d2f663b5607798ab45572ec5ee8ddb0c16996 in , please contact a Contributor to approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/79996 |
[static ] Signed-off-by: Nicu Reut <nicu.reut@digitalasset.com>
[static] Signed-off-by: Nicu Reut <nicu.reut@digitalasset.com>
|
/cluster_test |
|
Deploy cluster test triggered for Commit aedd3997ef7faf42b5017581c1348da90ea943aa in , please contact a Contributor to approve it in CircleCI: https://app.circleci.com/pipelines/github/DACH-NY/canton-network-internal/80012 |
By default only have a global rate limit
[static]
fixes https://github.com/DACH-NY/canton-network-internal/issues/2115
Pull Request Checklist
Cluster Testing
/cluster_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./upgrade_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./hdm_teston this PR to request it, and ping someone with access to the DA-internal system to approve it./lsu_teston this PR to request it, and ping someone with access to the DA-internal system to approve it.PR Guidelines
Fixes #n, and mention issues worked on using#nMerge Guidelines