@@ -77,16 +77,26 @@ prepare:
7777
7878PARAMS_FILE_MAJORITY_FORK =./scenarios/majority-fork.yaml
7979
80- # Prepare images for the majority fork. Run the `prepare` step and build go-ethereum image.
80+ # Prepare images for the majority fork. Run the `prepare` step and build a misconfigured geth image.
8181.PHONY : prepare-majority-fork
8282prepare-majority-fork : prepare
83- @if [ ! -d " ../go-ethereum" ]; then \
84- git clone https://github.com/ethereum/go-ethereum.git ../go-ethereum; \
85- else \
86- echo " ✅ go-ethereum repo already cloned." ; \
87- cd ../go-ethereum && git fetch && git checkout master; \
88- fi
89- @docker image inspect geth > /dev/null 2>&1 || (cd ../go-ethereum && docker build -t node/ssv . && echo " ✅ Geth image built successfully." )
83+ @set -e; \
84+ if [ ! -d " ../geth-misconfigured" ]; then \
85+ git clone https://github.com/ethereum/go-ethereum.git ../geth-misconfigured; \
86+ fi ; \
87+ cd ../geth-misconfigured; \
88+ git fetch --all --tags; \
89+ git checkout v1.15.2
90+
91+ @set -e; \
92+ FILE="../geth-misconfigured/core/state_processor.go"; \
93+ test -f "$$FILE"; \
94+ cp "$$FILE" "$$FILE.bak"; \
95+ perl -0777 -pi -e 's/if\s+log\.Address\s*==\s*config\.DepositContractAddress/if log.Address == (common.Address{})/g' "$$FILE"; \
96+ grep -n "if log.Address == (common.Address{})" "$$FILE" >/dev/null || { echo "❌ Replacement not found in $$FILE"; exit 1; }; \
97+ echo "✅ Replacement applied in $$FILE"
98+
99+ @cd ../geth-misconfigured && docker build -t geth-misconfigured .
90100
91101# Run the majority fork scenario without prepare: Uses existing local repos and Docker images (for custom branches/versions).
92102# It must be prepared manually until its prepare step is implemented. Make sure all images are ready.
0 commit comments