Skip to content

Commit 7a78c2b

Browse files
committed
remove blutgang/nginx load balancer, add direct EL RPC and preconf load test
1 parent 3e32cca commit 7a78c2b

32 files changed

+911
-491
lines changed

.github/workflows/pipeline.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
matrix:
129129
args:
130130
- "test-e2e"
131+
- "test-e2e-preconf"
131132
os:
132133
- ubuntu-24.04-e2e
133134
name: ${{ matrix.args }}
@@ -151,6 +152,12 @@ jobs:
151152
with:
152153
username: ${{ secrets.DOCKERHUB_USERNAME }}
153154
password: ${{ secrets.DOCKERHUB_TOKEN }}
155+
- name: Login to GHCR
156+
uses: docker/login-action@v3.4.0
157+
with:
158+
registry: ghcr.io
159+
username: ${{ github.actor }}
160+
password: ${{ secrets.GITHUB_TOKEN }}
154161
- name: Setup Golang
155162
uses: actions/setup-go@v5
156163
with:
@@ -163,17 +170,19 @@ jobs:
163170
uses: docker/setup-buildx-action@v1
164171
- name: Install Kurtosis
165172
run: |
166-
sudo apt-get install ca-certificates
167-
sudo apt update
168-
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
169-
sudo apt update
170-
sudo apt install kurtosis-cli=$(go list -m -f '{{.Version}}' github.com/kurtosis-tech/kurtosis/api/golang | sed 's/^v//') -y
173+
KURTOSIS_VERSION=$(go list -m -f '{{.Version}}' github.com/kurtosis-tech/kurtosis/api/golang | sed 's/^v//')
174+
echo "Installing kurtosis-cli ${KURTOSIS_VERSION}"
175+
curl -sL "https://github.com/kurtosis-tech/kurtosis-cli-release-artifacts/releases/download/${KURTOSIS_VERSION}/kurtosis-cli_${KURTOSIS_VERSION}_linux_amd64.tar.gz" | tar xz -C /tmp
176+
sudo mv /tmp/kurtosis /usr/local/bin/kurtosis
177+
kurtosis version
171178
docker info
172179
for img in kurtosistech/engine:1.4.3 timberio/vector:0.31.0-debian traefik:2.10.6 alpine:3.17; do
173180
docker pull $img
174181
done
175182
kurtosis engine start
176-
if: ${{ matrix.args == 'test-e2e' }}
183+
- name: Pre-pull bera-reth image
184+
run: docker pull ghcr.io/berachain/bera-reth:af193b66839313cd75b86da0e371baaeb5e814fd
185+
if: matrix.args == 'test-e2e-preconf'
177186
- name: Run ${{ matrix.args }}
178187
run: |
179188
make ${{ matrix.args }}

consensus/cometbft/service/configs.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ func DefaultConfig() *cmtcfg.Config {
8585
consensus.TimeoutPrevote = minTimeoutPrevote
8686
consensus.TimeoutPrecommit = minTimeoutPrecommit
8787

88-
//nolint:staticcheck // setting to zero because it's deprecated
89-
consensus.TimeoutCommit = 0
88+
consensus.TimeoutCommit = 0 //nolint:staticcheck // deprecated but still needed
9089

9190
cfg.Storage.DiscardABCIResponses = true
9291

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ require (
6060
github.com/cosmos/ics23/go v0.11.0
6161
github.com/ethereum/go-ethereum v1.15.5
6262
github.com/ferranbt/fastssz v0.1.5-0.20240903094032-455b54c08c81
63-
github.com/kurtosis-tech/kurtosis/api/golang v1.13.2
63+
github.com/kurtosis-tech/kurtosis/api/golang v1.16.4
6464
github.com/protolambda/zrnt v0.34.1
6565
github.com/protolambda/ztyp v0.2.2
6666
github.com/rs/zerolog v1.34.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
474474
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
475475
github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230818182330-1a86869414d2 h1:izciXrFyFR+ihJ7nLTOkoIX5GzBPIp8gVKlw94gIc98=
476476
github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230818182330-1a86869414d2/go.mod h1:bWSMQK3WHVTGHX9CjxPAb/LtzcmfOxID2wdzakSWQxo=
477-
github.com/kurtosis-tech/kurtosis/api/golang v1.13.2 h1:DNtHkmSocbd2caPek8m38mNvdBm8TenaxhhOy7h6w3g=
478-
github.com/kurtosis-tech/kurtosis/api/golang v1.13.2/go.mod h1:7jsreUn/zOtlJbNJcGPfjXsh7GWMgDd08Vn4ypUN78o=
477+
github.com/kurtosis-tech/kurtosis/api/golang v1.16.4 h1:AP3nYi2la3JPDhLjip8h98m1TjPA+xU72bV/aVUEi1U=
478+
github.com/kurtosis-tech/kurtosis/api/golang v1.16.4/go.mod h1:7jsreUn/zOtlJbNJcGPfjXsh7GWMgDd08Vn4ypUN78o=
479479
github.com/kurtosis-tech/kurtosis/contexts-config-store v0.0.0-20230818184218-f4e3e773463b h1:hMoIM99QKcYQqsnK4AF7Lovi9ZD9ac6lZLZ5D/jx2x8=
480480
github.com/kurtosis-tech/kurtosis/contexts-config-store v0.0.0-20230818184218-f4e3e773463b/go.mod h1:4pFdrRwDz5R+Fov2ZuTaPhAVgjA2jhGh1Izf832sX7A=
481481
github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang v0.0.0-20230803130419-099ee7a4e3dc h1:7IlEpSehmWcNXOFpNP24Cu5HQI3af7GCBQw//m+LnvQ=

kurtosis/beaconkit-cloud.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ node_settings:
7979
images:
8080
geth: ghcr.io/berachain/bera-geth:latest
8181
reth: ghcr.io/berachain/bera-reth:nightly
82-
eth_json_rpc_endpoints:
83-
# type has to be either blutgang or nginx
84-
- type: blutgang
85-
clients:
86-
- el-full-reth-0
87-
- el-full-reth-1
88-
- el-full-geth-2
8982
additional_services:
9083
- name: "spamoor"
9184
- name: "tx-fuzz"

kurtosis/beaconkit-local.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ node_settings:
7676
images:
7777
geth: ghcr.io/berachain/bera-geth:latest
7878
reth: ghcr.io/berachain/bera-reth:nightly
79-
eth_json_rpc_endpoints:
80-
# type has to be either blutgang or nginx
81-
- type: blutgang
82-
clients:
83-
- el-full-reth-0
84-
- el-full-reth-1
85-
- el-full-geth-2
8679
additional_services:
8780
- name: "spamoor"
8881
- name: "tx-fuzz"

kurtosis/beaconkit-preconf.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,7 @@ node_settings:
8989
max_memory: 4096
9090
images:
9191
geth: ghcr.io/berachain/bera-geth:latest
92-
# Use local bera-reth image built with: cd /path/to/bera-reth && make docker-build-local
93-
reth: bera-reth:local
94-
eth_json_rpc_endpoints:
95-
# type has to be either blutgang or nginx
96-
- type: blutgang
97-
clients:
98-
- el-full-reth-0
99-
- el-full-geth-0
92+
reth: ghcr.io/berachain/bera-reth:af193b66839313cd75b86da0e371baaeb5e814fd
10093
additional_services:
10194
#- name: "spamoor"
10295
#- name: "tx-fuzz"

kurtosis/main.star

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,25 @@ beacond = import_module("./src/nodes/consensus/beacond/launcher.star")
88
networks = import_module("./src/networks/networks.star")
99
port_spec_lib = import_module("./src/lib/port_spec.star")
1010
nodes = import_module("./src/nodes/nodes.star")
11-
nginx = import_module("./src/services/nginx/nginx.star")
1211
constants = import_module("./src/constants.star")
1312
spamoor = import_module("./src/services/spamoor/launcher.star")
1413
prometheus = import_module("./src/observability/prometheus/prometheus.star")
1514
grafana = import_module("./src/observability/grafana/grafana.star")
1615
pyroscope = import_module("./src/observability/pyroscope/pyroscope.star")
1716
tx_fuzz = import_module("./src/services/tx_fuzz/launcher.star")
18-
blutgang = import_module("./src/services/blutgang/launcher.star")
1917
blockscout = import_module("./src/services/blockscout/launcher.star")
2018
sequencer = import_module("./src/services/sequencer/launcher.star")
2119
preconf_config = import_module("./src/preconf/config.star")
2220
flashblock_monitor = import_module("./src/services/flashblock-monitor/launcher.star")
2321

24-
def run(plan, network_configuration = {}, node_settings = {}, eth_json_rpc_endpoints = [], additional_services = [], metrics_enabled_services = [], preconf = {}):
22+
def run(plan, network_configuration = {}, node_settings = {}, additional_services = [], metrics_enabled_services = [], preconf = {}):
2523
"""
2624
Initiates the execution plan with the specified number of validators and arguments.
2725
2826
Args:
2927
plan: The execution plan to be run.
3028
network_configuration: Network configuration including validators, full nodes, seed nodes.
3129
node_settings: Node-specific settings.
32-
eth_json_rpc_endpoints: RPC endpoint configurations.
3330
additional_services: Additional services to launch.
3431
metrics_enabled_services: Services with metrics enabled.
3532
preconf: Preconfirmation configuration. If provided, enables preconf with:
@@ -172,9 +169,11 @@ def run(plan, network_configuration = {}, node_settings = {}, eth_json_rpc_endpo
172169
for n, seed in enumerate(seed_nodes):
173170
seed_node_config = beacond.create_node_config(plan, seed, consensus_node_peering_info, seed.el_service_name, chain_id, chain_spec, genesis_deposits_root, genesis_deposit_count_hex, jwt_file, kzg_trusted_setup)
174171
seed_node_configs[seed.cl_service_name] = seed_node_config
175-
seed_nodes_clients = plan.add_services(
176-
configs = seed_node_configs,
177-
)
172+
seed_nodes_clients = {}
173+
if seed_node_configs != {}:
174+
seed_nodes_clients = plan.add_services(
175+
configs = seed_node_configs,
176+
)
178177
for n, seed_client in enumerate(seed_nodes):
179178
peer_info = beacond.get_peer_info(plan, seed_client.cl_service_name)
180179
consensus_node_peering_info.append(peer_info)
@@ -356,38 +355,46 @@ def run(plan, network_configuration = {}, node_settings = {}, eth_json_rpc_endpo
356355
for n, seed_node in enumerate(seed_nodes):
357356
beacond.dial_unsafe_peers(plan, seed_node.cl_service_name, all_consensus_peering_info)
358357

359-
# Get only the first rpc endpoint
360-
eth_json_rpc_endpoint = eth_json_rpc_endpoints[0]
361-
endpoint_type = eth_json_rpc_endpoint["type"]
362-
plan.print("RPC Endpoint Type:", endpoint_type)
363-
if endpoint_type == "nginx":
364-
plan.print("Launching RPCs for ", endpoint_type)
365-
nginx.get_config(plan, eth_json_rpc_endpoint["clients"])
366-
367-
elif endpoint_type == "blutgang":
368-
plan.print("Launching blutgang")
369-
blutgang_config_template = read_file(
370-
constants.BLUTGANG_CONFIG_TEMPLATE_FILEPATH,
371-
)
372-
blutgang.launch_blutgang(
373-
plan,
374-
blutgang_config_template,
375-
full_node_el_clients,
376-
eth_json_rpc_endpoint["clients"],
377-
"kurtosis",
378-
)
379-
380-
else:
381-
plan.print("Invalid type for eth_json_rpc_endpoint")
358+
# If no seed nodes exist, bootstrap peering from the first validator
359+
# so that nodes can discover each other via PEX.
360+
if len(seed_nodes) == 0 and len(validators) > 0:
361+
beacond.dial_unsafe_peers(plan, validators[0].cl_service_name, all_consensus_peering_info)
362+
363+
# Bootstrap EL peering: use first validator as a static peer so
364+
# all EL nodes can discover each other via devp2p.
365+
bootstrap_enode = execution.get_enode_addr(plan, validators[0].el_service_name)
366+
el_services_to_peer = []
367+
for node in full_nodes:
368+
el_services_to_peer.append(node.el_service_name)
369+
for node in preconf_rpc_nodes:
370+
el_services_to_peer.append(node.el_service_name)
371+
if sequencer_node:
372+
el_services_to_peer.append(sequencer_node.el_service_name)
373+
for node in validators[1:]:
374+
el_services_to_peer.append(node.el_service_name)
375+
for el_name in el_services_to_peer:
376+
execution.add_peer(plan, el_name, bootstrap_enode)
377+
378+
# For preconf topologies: add direct EL peering between the sequencer
379+
# and tx-receiving nodes (preconf RPC, full nodes) so that transactions
380+
# gossip directly to the sequencer without routing through validator-0.
381+
if preconf_cfg and sequencer_node:
382+
sequencer_enode = execution.get_enode_addr(plan, sequencer_node.el_service_name)
383+
for node in preconf_rpc_nodes:
384+
execution.add_peer(plan, node.el_service_name, sequencer_enode)
385+
for node in full_nodes:
386+
execution.add_peer(plan, node.el_service_name, sequencer_enode)
382387

383388
# 8. Start additional services
384389
prometheus_url = ""
385390
for s_dict in additional_services:
386391
s = service_module.parse_service_from_dict(s_dict)
387392
if s.name == "spamoor":
388393
plan.print("Launching spamoor")
389-
ip_spamoor = plan.get_service(endpoint_type).ip_address
390-
port_spamoor = plan.get_service(endpoint_type).ports["http"].number
394+
first_full_el_name = full_nodes[0].el_service_name
395+
first_full_el = full_node_el_clients[first_full_el_name]
396+
ip_spamoor = first_full_el.ip_address
397+
port_spamoor = first_full_el.ports["eth-json-rpc"].number
391398
spamoor.launch_spamoor(
392399
plan,
393400
constants.PRE_FUNDED_ACCOUNTS[next_free_prefunded_account],
@@ -400,7 +407,6 @@ def run(plan, network_configuration = {}, node_settings = {}, eth_json_rpc_endpo
400407
if "replicas" not in s_dict:
401408
s.replicas = 1
402409
next_free_prefunded_account = tx_fuzz.launch_tx_fuzzes(plan, s.replicas, next_free_prefunded_account, full_node_el_client_configs, full_node_el_clients, [])
403-
# next_free_prefunded_account = tx_fuzz.launch_tx_fuzzes_gang(plan, s.replicas, next_free_prefunded_account, [])
404410

405411
elif s.name == "prometheus":
406412
prometheus_url = prometheus.start(plan, metrics_enabled_services)

kurtosis/src/constants.star

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ GLOBAL_LOG_LEVEL = struct(
1111
JWT_MOUNT_PATH_ON_CONTAINER = "/jwt/jwt-secret.hex"
1212
JWT_FILEPATH = "/kurtosis/src/nodes/jwt-secret.hex"
1313
KZG_TRUSTED_SETUP_FILEPATH = "/kurtosis/src/nodes/kzg-trusted-setup.json"
14-
BLUTGANG_CONFIG_TEMPLATE_FILEPATH = "/kurtosis/src/services/blutgang/config.toml.tmpl"
1514

1615
def new_prefunded_account(address, private_key):
1716
return struct(address = address, private_key = private_key)

kurtosis/src/nodes/execution/execution.star

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,20 @@ def generate_node_config(plan, node_modules, node_struct, chain_id, chain_spec,
160160

161161
return el_service_config_dict
162162

163+
def add_peer(plan, el_service_name, enode_addr):
164+
"""Adds a peer to the given EL node via admin_addPeer JSON-RPC."""
165+
request_recipe = PostHttpRequestRecipe(
166+
endpoint = "",
167+
body = '{{"method":"admin_addPeer","params":["{}"],"id":1,"jsonrpc":"2.0"}}'.format(enode_addr),
168+
content_type = "application/json",
169+
port_id = RPC_PORT_ID,
170+
)
171+
172+
plan.request(
173+
service_name = el_service_name,
174+
recipe = request_recipe,
175+
)
176+
163177
def add_metrics(metrics_enabled_services, node, el_service_name, el_client_service, node_modules):
164178
metrics_enabled_services.append({
165179
"name": el_service_name,

0 commit comments

Comments
 (0)