-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EVM Rollup + DAL Nodes support (#579)
* introduce smart rollups statefulsets * ensure it starts * fix rpc endpoint * add bootstrap param injection * add an empty boot sector for now * put bootstrap rollup params that work in values.yaml example * fix example * remove leftover signer code * add rollup ingress * set path type properly * make rollup node listen on 0.0.0.0 * use debug container, pass boot sector of evm rollup * use debug image in chain initiator to inject wasm * make debug image work * put hex of kernel in activation * add debug statements * fix typo * fix enumerate * revert config gen changes as the rollup is not in utils container * add a function to replace file with its content in hex * remove sleep * add evm proxy * add evm proxy script * add "run" to evm-proxy cmd * add evm proxy service * add ingress for evm proxy * add comment to chain-initiator * add persistent data dir for rollup node * support several evm rollups * fix path type for nginx * DAL initial * add service ports * new syntax for evm proxy * fix ports, remove wrong DAL vars * DAL permissions fix * DAL: use unsafe SRS in config-init * dal node new syntax * add ability for the baker to pick a DAL node * remove debug container workaround - evm rollup is now in main container * new EVM rollup model: installer kernel + small files * remove usafe srs param * fix xxd command * fix xxd in activation script as well * set -e: fail activation when a command fails * support for bootstrap profile in DAL * fix newlines in dal script * switch to --mode dev on evm proxy * switch to universal smart rollup node (instead of proto-dependent) * ensure you can add annotations to your evm proxy and evm node * proper match for annotation * add option to pass public IP to dal nodes * add ability to pass attester profiles to DAL node * dal: add ability to specify peer * new evm proxy CLI * actually mondaynet doesn't have evm rollup * remove --mode dev for evm proxy * put evm proxy in dev mode again * replace `--version dev` with `--devmode` * fix disappearing ingress issue * DAL update to 50Gi * DAL comments * optional hardcoded identity for DAL nodes * add ability to set storage size of dal nodes in values.yaml * remove tmp changes * fix tests
- Loading branch information
1 parent
6aea0dc
commit dbc851c
Showing
13 changed files
with
716 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
set -ex | ||
|
||
TEZ_VAR=/var/tezos | ||
TEZ_BIN=/usr/local/bin | ||
DAL_DATA_DIR="$TEZ_VAR/dal" | ||
|
||
mkdir -p ${DAL_DATA_DIR} | ||
|
||
extra_args="" | ||
if [ "${BOOTSTRAP_PROFILE}" == "true" ]; then | ||
extra_args="--bootstrap-profile" | ||
fi | ||
if [ "${ATTESTER_PROFILES}" != "" ]; then | ||
extra_args="${extra_args} --attester-profiles ${ATTESTER_PROFILES}" | ||
fi | ||
if [ "${PEER}" != "" ]; then | ||
extra_args="${extra_args} --peer ${PEER}" | ||
fi | ||
if [ "${PUBLIC_ADDR}" != "" ]; then | ||
extra_args="${extra_args} --public-addr ${PUBLIC_ADDR}" | ||
fi | ||
# populate identity, if provided | ||
if [ -n "$IDENTITY_JSON" ]; then | ||
identity_path=/var/tezos/dal/identity.json | ||
printf "Found persistent identity, writing to $identity_path" | ||
echo "$IDENTITY_JSON" > $identity_path | ||
fi | ||
# | ||
|
||
CMD="$TEZ_BIN/octez-dal-node run ${extra_args} --data-dir ${DAL_DATA_DIR} \ | ||
--endpoint http://tezos-node-rpc:8732 \ | ||
--net-addr 0.0.0.0:11732 \ | ||
--rpc-addr 0.0.0.0:10732" | ||
|
||
exec $CMD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set -ex | ||
|
||
TEZ_BIN=/usr/local/bin | ||
|
||
CMD="$TEZ_BIN/octez-evm-node run proxy \ | ||
with endpoint http://rollup-${MY_POD_NAME}:8932 \ | ||
--devmode \ | ||
--rpc-addr 0.0.0.0" | ||
|
||
exec $CMD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
set -ex | ||
|
||
TEZ_VAR=/var/tezos | ||
TEZ_BIN=/usr/local/bin | ||
CLIENT_DIR="$TEZ_VAR/client" | ||
ROLLUP_DATA_DIR="$TEZ_VAR/rollup" | ||
ROLLUP_DATA_DIR_PREIMAGES="$ROLLUP_DATA_DIR/wasm_2_0_0" | ||
|
||
xxd -p -c 0 /usr/local/share/tezos/evm_kernel/evm_installer.wasm | tr -d '\n' > /var/tezos/smart-rollup-boot-sector | ||
mkdir -p "$ROLLUP_DATA_DIR_PREIMAGES" | ||
cp /usr/local/share/tezos/evm_kernel/* "$ROLLUP_DATA_DIR_PREIMAGES" | ||
CMD="$TEZ_BIN/octez-smart-rollup-node \ | ||
--endpoint http://tezos-node-rpc:8732 \ | ||
-d $CLIENT_DIR \ | ||
run operator for ${ROLLUP_ADDRESS} with operators ${OPERATOR_ACCOUNT} \ | ||
--data-dir ${ROLLUP_DATA_DIR} \ | ||
--boot-sector-file /var/tezos/smart-rollup-boot-sector \ | ||
--rpc-addr 0.0.0.0" | ||
|
||
exec $CMD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
{{- range $k, $v := .Values.dalNodes }} | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: dal-{{ $k }} | ||
namespace: {{ $.Release.Namespace }} | ||
spec: | ||
type: NodePort | ||
ports: | ||
- port: 10732 | ||
name: rpc | ||
- port: 11732 | ||
name: p2p | ||
selector: | ||
app: dal-{{ $k }} | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: dal-{{ $k }} | ||
namespace: {{ $.Release.Namespace }} | ||
spec: | ||
podManagementPolicy: Parallel | ||
replicas: 1 | ||
serviceName: dal-{{ $k }} | ||
selector: | ||
matchLabels: | ||
app: dal-{{ $k }} | ||
template: | ||
metadata: | ||
labels: | ||
app: dal-{{ $k }} | ||
spec: | ||
containers: | ||
- name: octez-dal-node | ||
image: "{{ $.Values.images.octez }}" | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 10732 | ||
name: rpc | ||
- containerPort: 11732 | ||
name: p2p | ||
command: | ||
- /bin/sh | ||
volumeMounts: | ||
- mountPath: /var/tezos | ||
name: var-volume | ||
args: | ||
- "-c" | ||
- | | ||
{{ tpl ($.Files.Get "scripts/dal-node.sh") $ | indent 12 }} | ||
{{- if $v | default false }} | ||
env: | ||
{{- if $v.bootstrapProfile | default false }} | ||
- name: BOOTSTRAP_PROFILE | ||
value: "true" | ||
{{- end }} | ||
{{- if $v.attesterProfiles | default false }} | ||
- name: ATTESTER_PROFILES | ||
value: "{{ $v.attesterProfiles }}" | ||
{{- end }} | ||
{{- if $v.peer | default false }} | ||
- name: PEER | ||
value: "{{ $v.peer }}" | ||
{{- end }} | ||
{{- if $v.publicAddr | default false }} | ||
- name: PUBLIC_ADDR | ||
value: "{{ $v.publicAddr }}" | ||
{{- end }} | ||
{{- if $v.identity | default false }} | ||
- name: IDENTITY_JSON | ||
value: {{ toJson $v.identity | quote }} | ||
{{- end }} | ||
{{- end }} | ||
securityContext: | ||
fsGroup: 1000 | ||
volumeClaimTemplates: | ||
- metadata: | ||
name: var-volume | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
{{- if $v.storageSize | default false }} | ||
storage: "{{ $v.storageSize }}" | ||
{{- else }} | ||
storage: "50Gi" | ||
{{- end }} | ||
--- | ||
{{- if $v | default false }} | ||
{{- if $v.ingress | default false }} | ||
{{- if $v.ingress.enabled | default false }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: dal-{{ $k }} | ||
namespace: {{ $.Release.Namespace }} | ||
{{- with $v.ingress.labels }} | ||
labels: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $v.ingress.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
ingressClassName: {{ $v.ingress.className }} | ||
{{- if $v.ingress.tls }} | ||
tls: | ||
{{- range $v.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
rules: | ||
- host: {{ $v.ingress.host }} | ||
http: | ||
paths: | ||
- pathType: Prefix | ||
path: / | ||
backend: | ||
service: | ||
name: dal-{{ $k }} | ||
port: | ||
name: rpc | ||
--- | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.