diff --git a/charts/sequencer-relayer/files/scripts/start-relayer.sh b/charts/sequencer-relayer/files/scripts/start-relayer.sh index 9ad150c..746d710 100644 --- a/charts/sequencer-relayer/files/scripts/start-relayer.sh +++ b/charts/sequencer-relayer/files/scripts/start-relayer.sh @@ -4,14 +4,19 @@ set -o errexit -o nounset -o pipefail echo "Starting the Astria Sequencer Relayer..." -if ! [ -f "$ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH" ]; then +if ! [ -z ${ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH+x} ] && ! [ -f "$ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH" ]; then echo "Pre-submit storage file not found, instantiating with ignore state. Post submit storage file will be created on first submit." echo "{\"state\": \"ignore\"}" > $ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH fi -if ! [ -f "$ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH" ]; then +if ! [ -z ${ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH+x} ] && ! [ -f "$ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH" ]; then echo "Post-submit storage file does not exist, instantiating with fresh state. Will start relaying from first sequencer block." echo "{\"state\": \"fresh\"}" > $ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH fi +if ! [ -z ${ASTRIA_SEQUENCER_RELAYER_SUBMISSION_STATE_PATH+x} ] && ! [ -f "$ASTRIA_SEQUENCER_RELAYER_SUBMISSION_STATE_PATH" ]; then + echo "Submission state file does not exist, instantiating with fresh state. Will start relaying from first sequencer block." + echo "{\"state\": \"fresh\"}" > $ASTRIA_SEQUENCER_RELAYER_SUBMISSION_STATE_PATH +fi + exec /usr/local/bin/astria-sequencer-relayer diff --git a/charts/sequencer-relayer/templates/_helpers.tpl b/charts/sequencer-relayer/templates/_helpers.tpl index 1185798..1dccd0a 100644 --- a/charts/sequencer-relayer/templates/_helpers.tpl +++ b/charts/sequencer-relayer/templates/_helpers.tpl @@ -20,3 +20,7 @@ Namepsace to deploy elements into. {{- define "sequencer-relayer.storage.postSubmitPath" -}} {{ include "sequencer-relayer.storage.mountPath" . }}/postsubmit.json {{- end }} + +{{- define "sequencer-relayer.storage.submissionStatePath" -}} +{{ include "sequencer-relayer.storage.mountPath" . }}/submission-state.json +{{- end }} diff --git a/charts/sequencer-relayer/templates/configmaps.yaml b/charts/sequencer-relayer/templates/configmaps.yaml index 50917b7..b76f6c4 100644 --- a/charts/sequencer-relayer/templates/configmaps.yaml +++ b/charts/sequencer-relayer/templates/configmaps.yaml @@ -11,8 +11,6 @@ data: ASTRIA_SEQUENCER_RELAYER_CELESTIA_APP_GRPC_ENDPOINT: "{{ .Values.config.relayer.celestiaAppGrpc }}" ASTRIA_SEQUENCER_RELAYER_CELESTIA_APP_KEY_FILE: "/celestia-key/{{ .Values.config.celestiaAppPrivateKey.secret.filename }}" ASTRIA_SEQUENCER_RELAYER_API_ADDR: "0.0.0.0:{{ .Values.ports.healthAPI }}" - ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH: "{{ include "sequencer-relayer.storage.preSubmitPath" . }}" - ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH: "{{ include "sequencer-relayer.storage.postSubmitPath" . }}" ASTRIA_SEQUENCER_RELAYER_NO_METRICS: "{{ not .Values.config.relayer.metrics.enabled }}" ASTRIA_SEQUENCER_RELAYER_METRICS_HTTP_LISTENER_ADDR: "0.0.0.0:{{ .Values.ports.metrics }}" ASTRIA_SEQUENCER_RELAYER_FORCE_STDOUT: "{{ .Values.global.useTTY }}" @@ -30,7 +28,10 @@ data: ASTRIA_SEQUENCER_RELAYER_SEQUENCER_CHAIN_ID: "{{ .Values.config.relayer.sequencerChainId }}" ASTRIA_SEQUENCER_RELAYER_CELESTIA_CHAIN_ID: "{{ .Values.config.relayer.celestiaChainId }}" {{- if not .Values.global.dev }} + ASTRIA_SEQUENCER_RELAYER_PRE_SUBMIT_PATH: "{{ include "sequencer-relayer.storage.preSubmitPath" . }}" + ASTRIA_SEQUENCER_RELAYER_POST_SUBMIT_PATH: "{{ include "sequencer-relayer.storage.postSubmitPath" . }}" {{- else }} + ASTRIA_SEQUENCER_RELAYER_SUBMISSION_STATE_PATH: "{{ include "sequencer-relayer.storage.submissionStatePath" . }}" {{- end }} --- apiVersion: v1 diff --git a/charts/sequencer/Chart.lock b/charts/sequencer/Chart.lock index 7807d9b..0e2b3ea 100644 --- a/charts/sequencer/Chart.lock +++ b/charts/sequencer/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: sequencer-relayer repository: file://../sequencer-relayer - version: 0.11.0 -digest: sha256:70434f4e37c36660ff9b89258d4de6770f206712020bda7398a22772e8f74fa8 -generated: "2024-07-19T12:21:51.250339+02:00" + version: 0.11.1 +digest: sha256:9c44f4901c4b89bbf6261f1a92bb18f71aef6d95e536aadc8a4a275a01eec25b +generated: "2024-07-23T20:01:42.179395482+01:00"