From 66810a16d3405994578f8507b633dc204af37cec Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 23 Dec 2024 10:42:30 -0300 Subject: [PATCH] fix: Conditionally deploy deterministic deployment proxy The boot-node init script sent the deterministic deployment proxy [deployment tx](https://github.com/Arachnid/deterministic-deployment-proxy?tab=readme-ov-file#deployment-transaction) always, regardless of the code being present or not. If the tx had already been sent, this caused the command to fail with a `nonce too low`. This commit adds a check so that it only sends the tx if the proxy has not being deployed yet. --- spartan/aztec-network/templates/boot-node.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index 98a907624e63..e4ce5f4a6aa4 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -61,14 +61,17 @@ spec: - name: config mountPath: /shared/config {{- if .Values.bootNode.deployContracts }} - - name: deploy-create2-delpoyer + - name: deploy-create2-deployer image: {{ .Values.images.foundry.image }} command: - /bin/sh - -c - | source /shared/config/service-addresses - cast publish --rpc-url ${ETHEREUM_HOST} 0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222 + if [ "$(cast code --rpc-url ${ETHEREUM_HOST} 0x4e59b44847b379578588920ca78fbf26c0b4956c)" = "0x" ]; then + echo "Deploying Deterministic Deployment Proxy" + cast publish --rpc-url ${ETHEREUM_HOST} 0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222 + fi volumeMounts: - name: config mountPath: /shared/config