Skip to content

Commit

Permalink
fix(charts): geth flags (#1957)
Browse files Browse the repository at this point in the history
## Summary
changes to how flags condition is evaluated and used.
## Background
Our current evm-rollup charts has a bug, the condition which helps
configuring geth flags is not being evaluated and always acts as `true`.
This PR changes the condition templating.
## Changes
- conditions are now being templated based on the key value. Also makes
sure this value is `true` if the condition exists.

## Testing
- locally running smoke test against a cluster 
- using the helm command for templating: ` helm template my-chart
./charts/evm-stack -f ./dev/values/rollup/dev.yaml`
## Changelogs
No updates required.
  • Loading branch information
quasystaty1 authored Feb 17, 2025
1 parent 2db84ed commit 1407332
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion charts/evm-rollup/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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: 1.1.0
version: 1.1.1

# 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
5 changes: 3 additions & 2 deletions charts/evm-rollup/files/scripts/init-geth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ if [ ! -d "$data_dir/" ]; then

exec geth \
{{- range $arg := .Values.config.geth.flags -}}
{{- if $arg.condition | default true -}}
{{- $noCondition := not (hasKey $arg "condition") }}
{{- if or ($noCondition) (eq (tpl $arg.condition $) "true") }}
--{{ $arg.name }}{{ if $arg.value }}={{ tpl $arg.value $ }}{{ end }} \
{{ end }}
{{- end }}
{{- end -}}
init $home_dir/genesis.json
elif ! cmp -s "/scripts/geth-genesis.json" "$home_dir/genesis.json"; then
Expand Down
3 changes: 2 additions & 1 deletion charts/evm-rollup/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ spec:
command: [ "geth" ]
args:
{{- range $arg := .Values.config.geth.flags }}
{{- if $arg.condition | default true }}
{{- $noCondition := not (hasKey $arg "condition") }}
{{- if or ($noCondition) (eq (tpl $arg.condition $) "true") }}
- --{{ $arg.name }}{{ if $arg.value }}={{ tpl $arg.value $ }}{{ end }}
{{- end }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/evm-rollup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ config:
- name: history.state
value: "{{- if .Values.config.geth.archiveNode -}} 0 {{- else -}} 540000 {{- end }}"
- name: metrics
condition: .Values.metrics.enabled
condition: "{{ .Values.metrics.enabled }}"
- name: metrics.addr
value: 0.0.0.0
condition: .Values.metrics.enabled
condition: "{{ .Values.metrics.enabled }}"
- name: metrics.port
value: "{{ .Values.ports.metrics }}"
condition: .Values.metrics.enabled
condition: "{{ .Values.metrics.enabled }}"
- name: txpool.nolocals
value: "true"

Expand Down
6 changes: 3 additions & 3 deletions charts/evm-stack/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies:
version: 0.4.0
- name: evm-rollup
repository: file://../evm-rollup
version: 1.1.0
version: 1.1.1
- name: flame-rollup
repository: file://../flame-rollup
version: 0.0.1
Expand All @@ -26,5 +26,5 @@ dependencies:
- name: blockscout-stack
repository: https://blockscout.github.io/helm-charts
version: 1.6.8
digest: sha256:6c61169417c2af9fd2cb20ae2fa46ac500a701575f0a15266633e0444695f7e9
generated: "2025-02-11T19:40:53.84221+05:30"
digest: sha256:03f8e53fd90f307d09aa02db8e65d2838af3c9cea285272f06d800329a92a813
generated: "2025-02-17T17:05:09.027931+02:00"
4 changes: 2 additions & 2 deletions charts/evm-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ 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: 1.0.9
version: 1.0.10
dependencies:
- name: celestia-node
version: 0.4.0
repository: "file://../celestia-node"
condition: celestia-node.enabled
- name: evm-rollup
version: 1.1.0
version: 1.1.1
repository: "file://../evm-rollup"
condition: evm-rollup.enabled
- name: flame-rollup
Expand Down

0 comments on commit 1407332

Please sign in to comment.