Skip to content

Commit 288215e

Browse files
authored
add shutdown wrapper and node config knobs (#24)
1 parent 96369a6 commit 288215e

3 files changed

Lines changed: 51 additions & 4 deletions

File tree

charts/abstract-node/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: abstract-node
33
description: External node for syncing and serving blockchain data for Abstract
4-
version: 0.1.36
4+
version: 0.1.37
55
type: application
66
icon: https://abstract-assets.abs.xyz/icons/light.png
77
keywords:

charts/abstract-node/templates/statefulset.yaml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,37 @@ spec:
6969
- name: {{ .Chart.Name }}
7070
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
7171
imagePullPolicy: {{ .Values.image.pullPolicy }}
72-
{{- if .Values.args }}
72+
{{- if .Values.shutdownWrapper.enabled }}
73+
command:
74+
- /bin/sh
75+
- -ec
76+
args:
77+
- |
78+
set -eu
79+
80+
child=0
81+
82+
forward_int() {
83+
if [ "$child" -ne 0 ]; then
84+
echo "Forwarding SIGINT to child process ${child}"
85+
kill -INT "$child" 2>/dev/null || true
86+
fi
87+
}
88+
89+
trap 'forward_int' TERM
90+
trap 'forward_int' INT
91+
92+
/usr/bin/entrypoint.sh "$@" &
93+
child=$!
94+
95+
status=0
96+
wait "$child" || status=$?
97+
exit "$status"
98+
- wrapper
99+
{{- range .Values.args }}
100+
- {{ . | quote }}
101+
{{- end }}
102+
{{- else if .Values.args }}
73103
args:
74104
{{- range .Values.args }}
75105
- {{ . | quote }}
@@ -97,7 +127,7 @@ spec:
97127
- name: EN_ESTIMATE_GAS_ACCEPTABLE_OVERESTIMATION
98128
value: "5000"
99129
- name: DATABASE_POOL_SIZE
100-
value: "10"
130+
value: {{ .Values.database.poolSize | quote }}
101131
- name: EN_HTTP_PORT
102132
value: {{ .Values.rpc.http.port | quote }}
103133
- name: EN_WS_PORT
@@ -130,6 +160,14 @@ spec:
130160
value: "warn,zksync=info,zksync_web3_decl::client=error"
131161
- name: EN_API_NAMESPACES
132162
value: {{ .Values.rpc.api | quote }}
163+
{{- if .Values.rpc.maxResponseBodySizeMb }}
164+
- name: EN_MAX_RESPONSE_BODY_SIZE_MB
165+
value: {{ .Values.rpc.maxResponseBodySizeMb | quote }}
166+
{{- end }}
167+
{{- if .Values.database.poolSizeMaster }}
168+
- name: EN_DATABASE_MAX_CONNECTIONS_MASTER
169+
value: {{ .Values.database.poolSizeMaster | quote }}
170+
{{- end }}
133171
{{- if .Values.node.batchCommitDataGeneratorMode }}
134172
- name: EN_L1_BATCH_COMMIT_DATA_GENERATOR_MODE
135173
value: {{ .Values.node.batchCommitDataGeneratorMode | quote }}

charts/abstract-node/values.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ image:
8181
pullPolicy: IfNotPresent
8282
tag: "v29.14.0"
8383

84+
shutdownWrapper:
85+
enabled: false
86+
8487
# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
8588
imagePullSecrets: []
8689
## Provide a name in place of abstract-node for `app:` labels
@@ -153,6 +156,10 @@ rpc:
153156
## API Namespaces available via RPC
154157
##
155158
api: "eth,net,web3,debug,zks,pubsub"
159+
##
160+
## Maximum JSON-RPC response body size in MiB.
161+
##
162+
maxResponseBodySizeMb: null
156163
## RPC configuration.
157164
##
158165
http:
@@ -242,6 +249,8 @@ resources: {}
242249
database:
243250
secretName: ""
244251
secretKey: "uri"
252+
poolSize: 10
253+
poolSizeMaster: null
245254

246255
node:
247256
## The URL of the Ethereum client.
@@ -362,4 +371,4 @@ cnpg:
362371
checkpoint_completion_target: "0.9"
363372
random_page_cost: "1.1"
364373
effective_io_concurrency: "200"
365-
max_worker_processes: "16"
374+
max_worker_processes: "16"

0 commit comments

Comments
 (0)