Skip to content

Commit

Permalink
deprecate endorser binary (#316)
Browse files Browse the repository at this point in the history
* deprecate endorser binary

Mondaynet starts on Hangzhou then upgrades to alpha. Hangzhou has an
endorser but alpha does not. Currently there is no way to handle this.
This PR fixes it.

The endorser days are numbered, so instead of giving people to start or
not start an endorser based on the protocol, I just hardcoded this
simple logic:

  Start endorser if granada or hangzhou, else not.

* fix mkchain
  • Loading branch information
nicolasochem authored Nov 18, 2021
1 parent 5cc9fee commit e2720f9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
18 changes: 6 additions & 12 deletions charts/tezos/templates/_containers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -234,24 +234,16 @@ https://github.com/helm/helm/issues/5979#issuecomment-518231758
{{- include "tezos.localvars.pod_envvars" $ | indent 4 }}
- name: DAEMON
value: baker
{{- end }}
{{- end }}
{{- end }}

{{- define "tezos.container.endorsers" }}
{{- if has "endorser" $.node_vals.runs }}
{{ $node_vals_images := $.node_vals.images | default dict }}
{{- range .Values.protocols }}
{{- if or (regexFind "GRANAD" .command) (regexFind "Hangz" .command) }}
{{- /*
Also start endorser for protocols that need it.
*/}}
- image: "{{ or $node_vals_images.octez $.Values.images.octez }}"
command:
- /bin/sh
args:
- "-c"
- |
{{- /*
Below set is a trick to get the range and global context. See:
https://github.com/helm/helm/issues/5979#issuecomment-518231758
*/}}
{{- $_ := set $ "command_in_tpl" .command }}
{{ tpl ($.Files.Get "scripts/baker-endorser.sh") $ | indent 6 }}
imagePullPolicy: IfNotPresent
Expand All @@ -273,6 +265,8 @@ https://github.com/helm/helm/issues/5979#issuecomment-518231758
{{- end }}
{{- end }}
{{- end }}
{{- end }}


{{- define "tezos.container.logger" }}
{{- if has "logger" $.node_vals.runs }}
Expand Down
1 change: 0 additions & 1 deletion charts/tezos/templates/nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ spec:
{{- include "tezos.container.node" $ | indent 8 }}
{{- include "tezos.container.tezedge" $ | indent 8 }}
{{- include "tezos.container.bakers" $ | indent 8 }}
{{- include "tezos.container.endorsers" $ | indent 8 }}
{{- include "tezos.container.logger" $ | indent 8 }}
{{- include "tezos.container.metrics" $ | indent 8 }}
{{- include "tezos.container.zerotier" $ | indent 8 }}
Expand Down
9 changes: 4 additions & 5 deletions charts/tezos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ accounts: {}
## Params at the statefulset level:
## - "storage_size": the size of the PV
## - "images": Optional specification of images to use for the tezos node and
## baker/endorser. Options are "octez" with a tezos/tezos image or
## baker. Options are "octez" with a tezos/tezos image or
## "tezedge" with a tezedge/tezedge image. If no images are provided,
## the containers will default to the images defined in the "images"
## field up above.
## - "runs": A list of containers to run. A tezos node implementation is required.
## Options being "octez_node" or "tezedge_node". Other optional
## containers are "baker", "endorser", "logger", and "metrics".
## containers are "baker", "logger", and "metrics".
## - "local_storage": use local storage instead of a volume. The storage will be
## wiped when the node restarts for any reason. Useful when
## faster IO is desired. Defaults to false.
Expand Down Expand Up @@ -117,7 +117,6 @@ accounts: {}
# - octez_node
# # - tezedge_node
# - baker
# - endorser
# instances:
# - bake_using_account: baker0
# is_bootstrap_node: true
Expand Down Expand Up @@ -207,8 +206,8 @@ node_config_network:
chain_name: mainnet

protocols:
# Tezos builds baker and endorser binaries for every supported protocol.
# List here the protocols that you wish to run bakers and endorsers for.
# Tezos builds baker binaries for every supported protocol.
# List here the protocols that you wish to run bakers for.
# These binaries must be present in the docker image specified.
# You may want to run two or more if you are expecting an on-chain upgrade.
# Be mindful that running more protocols will start more containers in your
Expand Down
2 changes: 1 addition & 1 deletion mkchain/tqchain/mkchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def main():
# archive mode. Any other bakers will be in rolling mode.
creation_nodes = {
BAKER_NODE_NAME: {
"runs": ["octez_node", "baker", "endorser"],
"runs": ["octez_node", "baker"],
"storage_size": "15Gi",
"instances": [
node_config(BAKER_NODE_NAME, n, is_baker=True)
Expand Down

0 comments on commit e2720f9

Please sign in to comment.