From 855ad3a4e7b17e70cfb3dda4e39b931b3066a3ae Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 13 Nov 2025 15:52:28 -0800 Subject: [PATCH 1/5] Add githooks and env --- espresso/.env | 12 +++++++++++- espresso/.githooks/pre-commit | 12 ++++++++++++ espresso/docker-compose.yml | 6 +++--- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 espresso/.githooks/pre-commit diff --git a/espresso/.env b/espresso/.env index 26de758565de3..972797454512f 100644 --- a/espresso/.env +++ b/espresso/.env @@ -1,4 +1,11 @@ -# Example .env file for internal devnet. +# .env file for the devnet. + +############################################################################ +# WARNING: Keep Terraform in sync. +# +# Whenever changing any variable here, update the corresponding variable in +# https://github.com/espressosystems/tee-op-deploy, if applicable. +############################################################################ ESPRESSO_DEV_NODE_L1_DEPLOYMENT=skip # generated with ./scripts/espresso-allocs-to-env.jq ./environment/allocs.json @@ -47,3 +54,6 @@ L1_CHAIN_ID=11155111 L2_CHAIN_ID=22266222 COMPOSE_PROFILES=default + +LIGHTHOUSE_IMAGE=sigp/lighthouse:v7.1.0 +ESPRESSO_DEV_NODE_IMAGE=ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node:release-fix-cors diff --git a/espresso/.githooks/pre-commit b/espresso/.githooks/pre-commit new file mode 100644 index 0000000000000..600927b412423 --- /dev/null +++ b/espresso/.githooks/pre-commit @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +if git diff --cached --name-only | grep -q "^.env$"; then + echo "⚠️ WARNING: You updated .env." + echo "You MUST also update image versions in tee-op-deploy, or create a ticket to do so." + echo "See .env header for details." + echo "" + read -p "Proceed with commit? (yes/no): " yn + if [ "$yn" != "yes" ]; then + echo "Commit aborted." + exit 1 + fi +fi diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index 7a0e9fe59fdfd..aac7a5e3730d2 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -32,7 +32,7 @@ services: - l1-data:/data l1-validator: - image: sigp/lighthouse:v7.1.0 + image: ${LIGHTHOUSE_IMAGE} depends_on: l1-genesis: condition: service_completed_successfully @@ -57,7 +57,7 @@ services: - ${OPERATOR_ADDRESS} l1-beacon: - image: sigp/lighthouse:v7.1.0 + image: ${LIGHTHOUSE_IMAGE} depends_on: l1-genesis: condition: service_completed_successfully @@ -498,7 +498,7 @@ services: OP_CHALLENGER_TRACE_TYPE: permissioned espresso-dev-node: - image: ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node:release-fix-cors + image: ${ESPRESSO_DEV_NODE_IMAGE} depends_on: l1-geth: condition: service_healthy From 8753dbbe7433d30fc1aab349d05ea99aba2b194e Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 13 Nov 2025 15:55:01 -0800 Subject: [PATCH 2/5] update path --- espresso/.githooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 espresso/.githooks/pre-commit diff --git a/espresso/.githooks/pre-commit b/espresso/.githooks/pre-commit old mode 100644 new mode 100755 index 600927b412423..38c7291b15731 --- a/espresso/.githooks/pre-commit +++ b/espresso/.githooks/pre-commit @@ -1,5 +1,5 @@ #!/usr/bin/env bash -if git diff --cached --name-only | grep -q "^.env$"; then +if git diff --cached --name-only | grep -q "^espresso/.env$"; then echo "⚠️ WARNING: You updated .env." echo "You MUST also update image versions in tee-op-deploy, or create a ticket to do so." echo "See .env header for details." From 9778eea447a687d36833c506d67560a7bbccd610 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 13 Nov 2025 16:00:59 -0800 Subject: [PATCH 3/5] test hooks --- espresso/.env | 15 ++++++++------- espresso/.githooks/pre-commit | 11 +++-------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/espresso/.env b/espresso/.env index 972797454512f..09e67a37411a7 100644 --- a/espresso/.env +++ b/espresso/.env @@ -1,12 +1,13 @@ # .env file for the devnet. -############################################################################ -# WARNING: Keep Terraform in sync. -# -# Whenever changing any variable here, update the corresponding variable in -# https://github.com/espressosystems/tee-op-deploy, if applicable. -############################################################################ - +############################################################################# +# WARNING: Keep Terraform in sync. # +# # +# Whenever changing any variable here, update the corresponding variable in # +# https://github.com/espressosystems/tee-op-deploy, if applicable. # +############################################################################# + +### ESPRESSO_DEV_NODE_L1_DEPLOYMENT=skip # generated with ./scripts/espresso-allocs-to-env.jq ./environment/allocs.json ESPRESSO_SEQUENCER_ESP_TOKEN_ADDRESS=0x00c042c4d5d913277ce16611a2ce6e9003554ad5 diff --git a/espresso/.githooks/pre-commit b/espresso/.githooks/pre-commit index 38c7291b15731..3cbe8828dfe42 100755 --- a/espresso/.githooks/pre-commit +++ b/espresso/.githooks/pre-commit @@ -1,12 +1,7 @@ #!/usr/bin/env bash if git diff --cached --name-only | grep -q "^espresso/.env$"; then - echo "⚠️ WARNING: You updated .env." - echo "You MUST also update image versions in tee-op-deploy, or create a ticket to do so." + echo "⚠️ WARNING: You updated .env." + echo "You MUST also update image versions in tee-op-deploy, or create a ticket there." echo "See .env header for details." - echo "" - read -p "Proceed with commit? (yes/no): " yn - if [ "$yn" != "yes" ]; then - echo "Commit aborted." - exit 1 - fi + echo "After either updating tee-op-deploy or create a ticket, commit with: git commit --no-verify" fi From f08d08c5f0b7363056c96946641b13578d121f3f Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 13 Nov 2025 16:06:59 -0800 Subject: [PATCH 4/5] change wording --- espresso/.env | 1 - espresso/.githooks/pre-commit | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/espresso/.env b/espresso/.env index 09e67a37411a7..309d67b06d3ec 100644 --- a/espresso/.env +++ b/espresso/.env @@ -7,7 +7,6 @@ # https://github.com/espressosystems/tee-op-deploy, if applicable. # ############################################################################# -### ESPRESSO_DEV_NODE_L1_DEPLOYMENT=skip # generated with ./scripts/espresso-allocs-to-env.jq ./environment/allocs.json ESPRESSO_SEQUENCER_ESP_TOKEN_ADDRESS=0x00c042c4d5d913277ce16611a2ce6e9003554ad5 diff --git a/espresso/.githooks/pre-commit b/espresso/.githooks/pre-commit index 3cbe8828dfe42..ad165037e1755 100755 --- a/espresso/.githooks/pre-commit +++ b/espresso/.githooks/pre-commit @@ -4,4 +4,6 @@ if git diff --cached --name-only | grep -q "^espresso/.env$"; then echo "You MUST also update image versions in tee-op-deploy, or create a ticket there." echo "See .env header for details." echo "After either updating tee-op-deploy or create a ticket, commit with: git commit --no-verify" + echo "Commit aborted." + exit 1 fi From 83d91e3dff34415727de60b1166cbebc1271d985 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Thu, 13 Nov 2025 16:14:00 -0800 Subject: [PATCH 5/5] include docker compose --- espresso/.env | 12 ++++++------ espresso/.githooks/pre-commit | 9 ++++----- espresso/docker-compose.yml | 7 +++++++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/espresso/.env b/espresso/.env index 309d67b06d3ec..e64f70e85207b 100644 --- a/espresso/.env +++ b/espresso/.env @@ -1,11 +1,11 @@ # .env file for the devnet. -############################################################################# -# WARNING: Keep Terraform in sync. # -# # -# Whenever changing any variable here, update the corresponding variable in # -# https://github.com/espressosystems/tee-op-deploy, if applicable. # -############################################################################# +############################################################################################# +# WARNING: Keep Terraform in sync. # +# # +# Whenever changing any variable here, update the corresponding variable (if applicable) in # +# https://github.com/espressosystems/tee-op-deploy, or create a ticket there. # +############################################################################################# ESPRESSO_DEV_NODE_L1_DEPLOYMENT=skip # generated with ./scripts/espresso-allocs-to-env.jq ./environment/allocs.json diff --git a/espresso/.githooks/pre-commit b/espresso/.githooks/pre-commit index ad165037e1755..8ddab3f39a9fd 100755 --- a/espresso/.githooks/pre-commit +++ b/espresso/.githooks/pre-commit @@ -1,9 +1,8 @@ #!/usr/bin/env bash -if git diff --cached --name-only | grep -q "^espresso/.env$"; then - echo "⚠️ WARNING: You updated .env." - echo "You MUST also update image versions in tee-op-deploy, or create a ticket there." - echo "See .env header for details." - echo "After either updating tee-op-deploy or create a ticket, commit with: git commit --no-verify" +if git diff --cached --name-only | grep -qE "^espresso/(.env|docker-compose\.yml)$"; then + echo "⚠️ WARNING: You updated .env or docker-compose.yml." + echo "See their headers for details about updating tee-op-deploy." + echo "AFTER taking the required action, commit with: git commit --no-verify" echo "Commit aborted." exit 1 fi diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index aac7a5e3730d2..cde017f5a2788 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -1,6 +1,13 @@ # Espresso OP Integration Docker Setup # Trigger docker-images workflow +########################################################################################### +# WARNING: Keep Terraform in sync. # +# # +# Whenever changing any setting here, update the corresponding setting (if applicable) in # +# https://github.com/espressosystems/tee-op-deploy, or create a ticket there. # +########################################################################################### + services: l1-data-init: image: busybox