Skip to content

Commit

Permalink
ERPC upstream fix (#161)
Browse files Browse the repository at this point in the history
* [sc-7338]: refactor of spectre to use tor-controller

* some fixes to upstreams and projects
  • Loading branch information
WesleyCharlesBlake authored Aug 21, 2024
1 parent cbfdcd9 commit d179607
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 32 deletions.
2 changes: 1 addition & 1 deletion charts/erpc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1
version: 0.0.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
11 changes: 6 additions & 5 deletions charts/erpc/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# erpc

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.12](https://img.shields.io/badge/AppVersion-0.0.12-informational?style=flat-square)
![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.12](https://img.shields.io/badge/AppVersion-0.0.12-informational?style=flat-square)

A Helm chart for deploying eRPC — fault-tolerant evm rpc proxy with reorg-aware permanent caching to Kubernetes

Expand Down Expand Up @@ -28,11 +28,12 @@ A Helm chart for deploying eRPC — fault-tolerant evm rpc proxy with reorg-awar
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| env | object | `{}` | create env vars from secrets, eg RPC provider API keys (eg, Blast API, DRPC, Infura, Alchemy, etc. ) |
| erpc.cacheConfig | object | `{"driver":"memory"}` | provides a DB backend for caching. must be one of `memory`, `redis`, or `postgresql`. ref: https://docs.erpc.cloud/config/database |
| erpc.projects | list | `[{"id":"testnet","networkIds":["5","421614","11155111"]}]` | Projects define the networks and chains that eRPC will proxy for. ref: https://docs.erpc.cloud/config/projects |
| erpc.projects[0].networkIds | list | `["5","421614","11155111"]` | A network represents a chain in EVM, and it is a local grouping for upstreams. ref: https://docs.erpc.cloud/config/projects/networks |
| erpc.projects | list | `[{"id":"testnet","networkIds":["421614","84532","80084","5003","11155420","534351","11155111","2442","300"],"upstreams":[{"chainId":"11155111","endpoint":"https://ethereum-sepolia-rpc.publicnode.com","id":"sep-public-node","rateLimit":"p2"},{"chainId":"11155111","endpoint":"https://eth-sepolia.public.blastapi.io","id":"sep-blast-node","rateLimit":"p2"},{"chainId":"300","endpoint":"https://zksync-sepolia.drpc.org","id":"zksync-sep-drpc","rateLimit":"p3"},{"chainId":5,"endpoint":"https://zksync-era-sepolia.blockpi.network/v1/rpc/public","id":"zksync-sep-blockpi","rateLimit":"p1"},{"endpoint":"envio://rpc.hypersync.xyz","id":"envio-public","rateLimit":"p2"}]}]` | Projects define the networks and chains that eRPC will proxy for. ref: https://docs.erpc.cloud/config/projects |
| erpc.projects[0] | object | `{"id":"testnet","networkIds":["421614","84532","80084","5003","11155420","534351","11155111","2442","300"],"upstreams":[{"chainId":"11155111","endpoint":"https://ethereum-sepolia-rpc.publicnode.com","id":"sep-public-node","rateLimit":"p2"},{"chainId":"11155111","endpoint":"https://eth-sepolia.public.blastapi.io","id":"sep-blast-node","rateLimit":"p2"},{"chainId":"300","endpoint":"https://zksync-sepolia.drpc.org","id":"zksync-sep-drpc","rateLimit":"p3"},{"chainId":5,"endpoint":"https://zksync-era-sepolia.blockpi.network/v1/rpc/public","id":"zksync-sep-blockpi","rateLimit":"p1"},{"endpoint":"envio://rpc.hypersync.xyz","id":"envio-public","rateLimit":"p2"}]}` | each project must have a unique id, and is used in the URL structure: fqdn/{project_id}/{network-architecture}/{chain-id} |
| erpc.projects[0].networkIds | list | `["421614","84532","80084","5003","11155420","534351","11155111","2442","300"]` | A network represents a chain in EVM, and it is a local grouping for upstreams. ref: https://docs.erpc.cloud/config/projects/networks |
| erpc.projects[0].upstreams | list | `[{"chainId":"11155111","endpoint":"https://ethereum-sepolia-rpc.publicnode.com","id":"sep-public-node","rateLimit":"p2"},{"chainId":"11155111","endpoint":"https://eth-sepolia.public.blastapi.io","id":"sep-blast-node","rateLimit":"p2"},{"chainId":"300","endpoint":"https://zksync-sepolia.drpc.org","id":"zksync-sep-drpc","rateLimit":"p3"},{"chainId":5,"endpoint":"https://zksync-era-sepolia.blockpi.network/v1/rpc/public","id":"zksync-sep-blockpi","rateLimit":"p1"},{"endpoint":"envio://rpc.hypersync.xyz","id":"envio-public","rateLimit":"p2"}]` | A upstream is defined to handle 1 or more networks (a.k.a. chains). ref: https://docs.erpc.cloud/config/projects/upstreams |
| erpc.projects[0].upstreams[4] | object | `{"endpoint":"envio://rpc.hypersync.xyz","id":"envio-public","rateLimit":"p2"}` | Ref: https://docs.erpc.cloud/config/projects/upstreams#envio-json-rpc |
| erpc.rateLimiters | list | `[{"id":"p3","rules":[{"maxCount":10000,"method":"*","period":"1s"}]},{"id":"p2","rules":[{"maxCount":1000,"method":"*","period":"2s"}]},{"id":"p1","rules":[{"maxCount":300,"method":"*","period":"1s"}]}]` | Define rate limiters for upstreams. ref: https://docs.erpc.cloud/config/projects/rate-limiters |
| erpc.upstreams | list | `[{"chainId":"11155111","endpoint":"https://ethereum-sepolia-rpc.publicnode.com","id":"sep-public-node","rateLimit":"p2"},{"chainId":"11155111","endpoint":"https://eth-sepolia.public.blastapi.io","id":"sep-blast-node","rateLimit":"p2"},{"chainId":"300","endpoint":"https://zksync-sepolia.drpc.org","id":"zksync-sep-drpc","rateLimit":"p3"},{"chainId":5,"endpoint":"https://zksync-era-sepolia.blockpi.network/v1/rpc/public","id":"zksync-sep-blockpi","rateLimit":"p1"},{"endpoint":"envio://rpc.hypersync.xyz","id":"envio-public","rateLimit":"p2"}]` | A upstream is defined to handle 1 or more networks (a.k.a. chains). ref: https://docs.erpc.cloud/config/projects/upstreams |
| erpc.upstreams[4] | object | `{"endpoint":"envio://rpc.hypersync.xyz","id":"envio-public","rateLimit":"p2"}` | Ref: https://docs.erpc.cloud/config/projects/upstreams#envio-json-rpc |
| extraObjects | list | `[]` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
Expand Down
7 changes: 5 additions & 2 deletions charts/erpc/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ data:
delay: 3000ms
maxCount: 2
{{- end }}
{{- end }}
upstreams:
{{- range $upstream := .Values.erpc.upstreams }}
{{- range $upstream := $project.upstreams }}
- id: {{ $upstream.id }}
endpoint: {{ $upstream.endpoint }}
rateLimitBudget: {{ $upstream.rateLimit }}
{{- if $upstream.chainId }}
evm:
chainId: {{ $upstream.chainId }}
{{- end }}
failsafe:
timeout:
duration: 15s
Expand All @@ -59,6 +61,7 @@ data:
backoffFactor: 0.3
jitter: 500ms
{{- end }}
{{- end }}
rateLimiters:
budgets:
Expand Down
59 changes: 35 additions & 24 deletions charts/erpc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,32 +163,43 @@ erpc:

# -- Projects define the networks and chains that eRPC will proxy for. ref: https://docs.erpc.cloud/config/projects
projects:
# -- each project must have a unique id, and is used in the URL structure: fqdn/{project_id}/{network-architecture}/{chain-id}
- id: testnet
# -- A network represents a chain in EVM, and it is a local grouping for upstreams. ref: https://docs.erpc.cloud/config/projects/networks
networkIds: ['5', '421614', '11155111']

# -- A upstream is defined to handle 1 or more networks (a.k.a. chains). ref: https://docs.erpc.cloud/config/projects/upstreams
upstreams:
- id: sep-public-node
chainId: '11155111'
endpoint: https://ethereum-sepolia-rpc.publicnode.com
rateLimit: p2
- id: sep-blast-node
chainId: '11155111'
endpoint: https://eth-sepolia.public.blastapi.io
rateLimit: p2
- id: zksync-sep-drpc
chainId: '300'
endpoint: https://zksync-sepolia.drpc.org
rateLimit: p3
- id: zksync-sep-blockpi
chainId: 5
endpoint: https://zksync-era-sepolia.blockpi.network/v1/rpc/public
rateLimit: p1
# -- Ref: https://docs.erpc.cloud/config/projects/upstreams#envio-json-rpc
- id: envio-public
endpoint: envio://rpc.hypersync.xyz
rateLimit: p2
networkIds:
- '421614' # -- Arbitrum Sepolia
- '84532' # -- Base Sepolia
- '80084' # -- Berachain bartio
- '5003' # -- Mantle Sepolia
- '11155420' # -- Optimism Sepolia
- '534351' # -- Scroll Sepolia
- '11155111' # -- Sepolia
- '2442' # -- Zkevm Cardona
- '300' # -- ZkSync Sepolia

# -- A upstream is defined to handle 1 or more networks (a.k.a. chains). ref: https://docs.erpc.cloud/config/projects/upstreams
upstreams:
- id: sep-public-node
chainId: '11155111'
endpoint: https://ethereum-sepolia-rpc.publicnode.com
rateLimit: p2
- id: sep-blast-node
chainId: '11155111'
endpoint: https://eth-sepolia.public.blastapi.io
rateLimit: p2
- id: zksync-sep-drpc
chainId: '300'
endpoint: https://zksync-sepolia.drpc.org
rateLimit: p3
- id: zksync-sep-blockpi
chainId: 5
endpoint: https://zksync-era-sepolia.blockpi.network/v1/rpc/public
rateLimit: p1
# -- Ref: https://docs.erpc.cloud/config/projects/upstreams#envio-json-rpc
- id: envio-public
endpoint: envio://rpc.hypersync.xyz
rateLimit: p2

# -- Define rate limiters for upstreams. ref: https://docs.erpc.cloud/config/projects/rate-limiters
rateLimiters:
- id: p3
Expand Down

0 comments on commit d179607

Please sign in to comment.