Skip to content

Commit a6c5078

Browse files
Savidclaude
andauthored
prysm: enable progressive merkleization on branches that gate it off (#397)
## Why `glamsterdam-devnet-7` introduces a `//tools:disable_progressive_merkleization` build setting and forces it on in its `.bazelrc` (spectest fixture compatibility). Without an override our devnet-7 images build with progressive SSZ merkleization dormant → wrong hash tree roots for the devnet. The prysm team asked us to pass `--//tools:disable_progressive_merkleization=false`. ## What All four prysm build scripts (beacon/validator × mainnet/minimal) now append `--//tools:disable_progressive_merkleization=false` to every bazelisk invocation **iff** the source tree defines the setting (grep of `tools/BUILD.bazel`): - Branches without the setting (`develop`, `master`, forks, old commits) run a byte-identical command to before — passing the flag there would fail with "no such target". - Any future branch carrying the setting (including an eventual merge to master) picks it up automatically, no per-branch config. ## Testing - Full local run of `build_beacon.sh` and `build_validator.sh` against a fresh `glamsterdam-devnet-7` clone: bazel build (remote cache hit), docker build, push, container runs and reports the branch head commit. - `bazel aquery` on `ssz_methodical` codegen: `--disable-progressive` present without the override, absent with it — the flag provably takes effect. - Negative check on `develop`: conditional adds nothing. Note: first CI build after merge is slower for devnet-7 (new remote-cache keys from the changed build setting). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 29f236e commit a6c5078

4 files changed

Lines changed: 40 additions & 12 deletions

File tree

prysm/build_beacon.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,22 @@ END
3838
;;
3939
"bazel")
4040
echo "Building with Bazel..."
41+
# Branches carrying the //tools:disable_progressive_merkleization build setting
42+
# (glamsterdam-devnet-7+) gate progressive SSZ merkleization off in their
43+
# .bazelrc for spectest compatibility; devnet images need it enabled.
44+
extra_bazel_flags=""
45+
if grep -qs "disable_progressive_merkleization" tools/BUILD.bazel; then
46+
extra_bazel_flags="--//tools:disable_progressive_merkleization=false"
47+
fi
4148
# Try with remote cache first
42-
if ! $HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=release --define pgo_enabled=0 --enable_bzlmod=false --remote_cache=grpcs://bazel-remote-cache-grpc.primary.production.platform.ethpandaops.io:443; then
49+
if ! $HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=release --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags} --remote_cache=grpcs://bazel-remote-cache-grpc.primary.production.platform.ethpandaops.io:443; then
4350
echo "Build failed with remote cache, trying without remote cache..."
4451
# Try without remote cache to avoid cache corruption issues
45-
if ! $HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=release --define pgo_enabled=0 --enable_bzlmod=false; then
52+
if ! $HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=release --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags}; then
4653
echo "Build still failing, cleaning local Bazel cache and retrying..."
4754
# Clean the local Bazel cache and try once more
4855
$HOME/go/bin/bazelisk clean --expunge
49-
$HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=release --define pgo_enabled=0 --enable_bzlmod=false
56+
$HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=release --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags}
5057
fi
5158
fi
5259
mv bazel-bin/cmd/beacon-chain/beacon-chain_/beacon-chain _beacon-chain

prysm/build_beacon_minimal.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,22 @@ END
3838
;;
3939
"bazel")
4040
echo "Building with Bazel..."
41+
# Branches carrying the //tools:disable_progressive_merkleization build setting
42+
# (glamsterdam-devnet-7+) gate progressive SSZ merkleization off in their
43+
# .bazelrc for spectest compatibility; devnet images need it enabled.
44+
extra_bazel_flags=""
45+
if grep -qs "disable_progressive_merkleization" tools/BUILD.bazel; then
46+
extra_bazel_flags="--//tools:disable_progressive_merkleization=false"
47+
fi
4148
# Try with remote cache first
42-
if ! $HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false --remote_cache=grpcs://bazel-remote-cache-grpc.primary.production.platform.ethpandaops.io:443; then
49+
if ! $HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags} --remote_cache=grpcs://bazel-remote-cache-grpc.primary.production.platform.ethpandaops.io:443; then
4350
echo "Build failed with remote cache, trying without remote cache..."
4451
# Try without remote cache to avoid cache corruption issues
45-
if ! $HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false; then
52+
if ! $HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags}; then
4653
echo "Build still failing, cleaning local Bazel cache and retrying..."
4754
# Clean the local Bazel cache and try once more
4855
$HOME/go/bin/bazelisk clean --expunge
49-
$HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false
56+
$HOME/go/bin/bazelisk build //cmd/beacon-chain:beacon-chain --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags}
5057
fi
5158
fi
5259
mv bazel-bin/cmd/beacon-chain/beacon-chain_/beacon-chain _beacon-chain

prysm/build_validator.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,22 @@ END
3838
;;
3939
"bazel")
4040
echo "Building with Bazel..."
41+
# Branches carrying the //tools:disable_progressive_merkleization build setting
42+
# (glamsterdam-devnet-7+) gate progressive SSZ merkleization off in their
43+
# .bazelrc for spectest compatibility; devnet images need it enabled.
44+
extra_bazel_flags=""
45+
if grep -qs "disable_progressive_merkleization" tools/BUILD.bazel; then
46+
extra_bazel_flags="--//tools:disable_progressive_merkleization=false"
47+
fi
4148
# Try with remote cache first
42-
if ! $HOME/go/bin/bazelisk build //cmd/validator:validator --config=release --define pgo_enabled=0 --enable_bzlmod=false --remote_cache=grpcs://bazel-remote-cache-grpc.primary.production.platform.ethpandaops.io:443; then
49+
if ! $HOME/go/bin/bazelisk build //cmd/validator:validator --config=release --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags} --remote_cache=grpcs://bazel-remote-cache-grpc.primary.production.platform.ethpandaops.io:443; then
4350
echo "Build failed with remote cache, trying without remote cache..."
4451
# Try without remote cache to avoid cache corruption issues
45-
if ! $HOME/go/bin/bazelisk build //cmd/validator:validator --config=release --define pgo_enabled=0 --enable_bzlmod=false; then
52+
if ! $HOME/go/bin/bazelisk build //cmd/validator:validator --config=release --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags}; then
4653
echo "Build still failing, cleaning local Bazel cache and retrying..."
4754
# Clean the local Bazel cache and try once more
4855
$HOME/go/bin/bazelisk clean --expunge
49-
$HOME/go/bin/bazelisk build //cmd/validator:validator --config=release --define pgo_enabled=0 --enable_bzlmod=false
56+
$HOME/go/bin/bazelisk build //cmd/validator:validator --config=release --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags}
5057
fi
5158
fi
5259
mv bazel-bin/cmd/validator/validator_/validator _validator

prysm/build_validator_minimal.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,22 @@ END
3838
;;
3939
"bazel")
4040
echo "Building with Bazel..."
41+
# Branches carrying the //tools:disable_progressive_merkleization build setting
42+
# (glamsterdam-devnet-7+) gate progressive SSZ merkleization off in their
43+
# .bazelrc for spectest compatibility; devnet images need it enabled.
44+
extra_bazel_flags=""
45+
if grep -qs "disable_progressive_merkleization" tools/BUILD.bazel; then
46+
extra_bazel_flags="--//tools:disable_progressive_merkleization=false"
47+
fi
4148
# Try with remote cache first
42-
if ! $HOME/go/bin/bazelisk build //cmd/validator:validator --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false --remote_cache=grpcs://bazel-remote-cache-grpc.primary.production.platform.ethpandaops.io:443; then
49+
if ! $HOME/go/bin/bazelisk build //cmd/validator:validator --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags} --remote_cache=grpcs://bazel-remote-cache-grpc.primary.production.platform.ethpandaops.io:443; then
4350
echo "Build failed with remote cache, trying without remote cache..."
4451
# Try without remote cache to avoid cache corruption issues
45-
if ! $HOME/go/bin/bazelisk build //cmd/validator:validator --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false; then
52+
if ! $HOME/go/bin/bazelisk build //cmd/validator:validator --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags}; then
4653
echo "Build still failing, cleaning local Bazel cache and retrying..."
4754
# Clean the local Bazel cache and try once more
4855
$HOME/go/bin/bazelisk clean --expunge
49-
$HOME/go/bin/bazelisk build //cmd/validator:validator --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false
56+
$HOME/go/bin/bazelisk build //cmd/validator:validator --config=minimal --stamp --define pgo_enabled=0 --enable_bzlmod=false ${extra_bazel_flags}
5057
fi
5158
fi
5259
mv bazel-bin/cmd/validator/validator_/validator _validator

0 commit comments

Comments
 (0)