Skip to content

Commit

Permalink
Merge branch 'main' into update-verkle-transition
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Nov 29, 2023
2 parents 5ecbb98 + 32f862b commit 71d2322
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/tests/mix-with-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ additional_services:
- goomy_blob
- full_beaconchain_explorer
- custom_flood
- blobscan
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Specifically, this [package][package-reference] will:
3. Spin up a [transaction spammer](https://github.com/MariusVanDerWijden/tx-fuzz) to send fake transactions to the network
4. Spin up and connect a [testnet verifier](https://github.com/ethereum/merge-testnet-verifier)
5. Spin up a Grafana and Prometheus instance to observe the network
6. Spin up a Blobscan instance to analyze blob transactions (EIP-4844)

Optional features (enabled via flags or parameter files at runtime):

Expand Down Expand Up @@ -92,11 +93,6 @@ kurtosis files download my-testnet el-genesis-data ~/Downloads

To configure the package behaviour, you can modify your `network_params.yaml` file. The full YAML schema that can be passed in is as follows with the defaults provided:

<details>
<summary>Click to show all configuration options</summary>

<!-- Yes, it's weird that none of this is indented but it's intentional - indenting anything inside this "details" expandable will cause it to render weird" -->
```yaml
# Specification of the participants in the network
participants:
Expand Down Expand Up @@ -273,6 +269,7 @@ additional_services:
- dora
- full_beaconchain_explorer
- prometheus_grafana
- blobscan
# If set, the package will block until a finalized epoch has occurred.
wait_for_finalization: false
Expand Down Expand Up @@ -345,8 +342,6 @@ mev_params:
interval_between_transactions: 1
```

</details>
#### Example configurations

<details>
Expand Down
33 changes: 33 additions & 0 deletions examples/dencun.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
participants:
- el_client_type: geth
el_client_image: ethpandaops/geth:master-5b57727
cl_client_type: lighthouse
cl_client_image: ethpandaops/lighthouse:sidecar-inclusion-proof-c6be31c
- el_client_type: erigon
el_client_image: ethpandaops/erigon:devel-8cfafa4
cl_client_type: lodestar
cl_client_image: ethpandaops/lodestar:blobs-inclproof-d5a5a47
- el_client_type: nethermind
el_client_image: ethpandaops/nethermind:master-dcec565
cl_client_type: teku
cl_client_image: ethpandaops/teku:master-992b224
- el_client_type: besu
el_client_image: ethpandaops/besu:main-be5cc68
cl_client_type: teku
cl_client_image: ethpandaops/teku:master-992b224
- el_client_type: reth
el_client_image: ethpandaops/reth:main-c49cda6
cl_client_type: nimbus
cl_client_image: ethpandaops/nimbus:unstable-6dee4d5
- el_client_type: geth
el_client_image: ethpandaops/geth:master-5b57727
cl_client_type: nimbus
cl_client_image: ethpandaops/nimbus:unstable-6dee4d5
network_params:
deneb_fork_epoch: 1
launch_additional_services: true
additional_services:
- el_forkmon
- tx_spammer
- dora
snooper_enabled: true
10 changes: 10 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ beacon_metrics_gazer = import_module(
"./src/beacon_metrics_gazer/beacon_metrics_gazer_launcher.star"
)
dora = import_module("./src/dora/dora_launcher.star")
blobscan = import_module("./src/blobscan/blobscan_launcher.star")
full_beaconchain_explorer = import_module(
"./src/full_beaconchain/full_beaconchain_launcher.star"
)
Expand Down Expand Up @@ -337,6 +338,15 @@ def run(plan, args={}):
network_params.electra_fork_epoch,
)
plan.print("Successfully launched dora")
elif additional_service == "blobscan":
plan.print("Launching blobscan")
blobscan.launch_blobscan(
plan,
all_cl_client_contexts,
all_el_client_contexts,
network_params.network_id,
)
plan.print("Successfully launched blobscan")
elif additional_service == "full_beaconchain_explorer":
plan.print("Launching full-beaconchain-explorer")
full_beaconchain_explorer_config_template = read_file(
Expand Down
122 changes: 122 additions & 0 deletions src/blobscan/blobscan_launcher.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
shared_utils = import_module("../shared_utils/shared_utils.star")
postgres = import_module("github.com/kurtosis-tech/postgres-package/main.star")

WEB_SERVICE_NAME = "blobscan-web"
API_SERVICE_NAME = "blobscan-api"
INDEXER_SERVICE_NAME = "blobscan-indexer"

HTTP_PORT_ID = "http"
WEB_HTTP_PORT_NUMBER = 3000
API_HTTP_PORT_NUMBER = 3001

WEB_PORTS = {
HTTP_PORT_ID: shared_utils.new_port_spec(
WEB_HTTP_PORT_NUMBER,
shared_utils.TCP_PROTOCOL,
shared_utils.HTTP_APPLICATION_PROTOCOL,
)
}


API_PORTS = {
HTTP_PORT_ID: shared_utils.new_port_spec(
API_HTTP_PORT_NUMBER,
shared_utils.TCP_PROTOCOL,
shared_utils.HTTP_APPLICATION_PROTOCOL,
)
}

ENTRYPOINT_ARGS = ["/bin/sh", "-c"]


def launch_blobscan(
plan,
cl_client_contexts,
el_client_contexts,
chain_id,
):
beacon_node_rpc_uri = "http://{0}:{1}".format(
cl_client_contexts[0].ip_addr, cl_client_contexts[0].http_port_num
)
execution_node_rpc_uri = "http://{0}:{1}".format(
el_client_contexts[0].ip_addr, el_client_contexts[0].rpc_port_num
)

postgres_output = postgres.run(plan, service_name="blobscan-postgres")
api_config = get_api_config(postgres_output.url, beacon_node_rpc_uri, chain_id)
blobscan_config = plan.add_service(API_SERVICE_NAME, api_config)

blobscan_api_url = "http://{0}:{1}".format(
blobscan_config.ip_address, blobscan_config.ports[HTTP_PORT_ID].number
)

web_config = get_web_config(postgres_output.url, beacon_node_rpc_uri, chain_id)
plan.add_service(WEB_SERVICE_NAME, web_config)

indexer_config = get_indexer_config(
beacon_node_rpc_uri, execution_node_rpc_uri, blobscan_api_url
)
plan.add_service(INDEXER_SERVICE_NAME, indexer_config)


def get_api_config(database_url, beacon_node_rpc, chain_id):
IMAGE_NAME = "blossomlabs/blobscan:stable"

return ServiceConfig(
image=IMAGE_NAME,
ports=API_PORTS,
env_vars={
"BEACON_NODE_ENDPOINT": beacon_node_rpc,
"CHAIN_ID": chain_id,
"DATABASE_URL": database_url,
"SECRET_KEY": "supersecret",
},
cmd=["api"],
ready_conditions=ReadyCondition(
recipe=GetHttpRequestRecipe(
port_id="http",
endpoint="/api/healthcheck",
),
field="code",
assertion="==",
target_value=200,
interval="5s",
timeout="5s",
),
)


def get_web_config(database_url, beacon_node_rpc, chain_id):
# TODO: https://github.com/kurtosis-tech/kurtosis/issues/1861
# Configure NEXT_PUBLIC_BEACON_BASE_URL and NEXT_PUBLIC_EXPLORER_BASE env vars
# once retrieving external URLs from services are supported in Kurtosis.
IMAGE_NAME = "blossomlabs/blobscan:stable"

return ServiceConfig(
image=IMAGE_NAME,
ports=WEB_PORTS,
env_vars={
"DATABASE_URL": database_url,
"SECRET_KEY": "supersecret",
"NEXT_PUBLIC_NETWORK_NAME": "kurtosis-devnet",
"BEACON_NODE_ENDPOINT": beacon_node_rpc,
"CHAIN_ID": chain_id,
},
cmd=["web"],
)


def get_indexer_config(beacon_node_rpc, execution_node_rpc, blobscan_api_url):
IMAGE_NAME = "blossomlabs/blobscan-indexer:master"

return ServiceConfig(
image=IMAGE_NAME,
env_vars={
"SECRET_KEY": "supersecret",
"BLOBSCAN_API_ENDPOINT": blobscan_api_url,
"EXECUTION_NODE_ENDPOINT": execution_node_rpc,
"BEACON_NODE_ENDPOINT": beacon_node_rpc,
},
entrypoint=ENTRYPOINT_ARGS,
cmd=[" && ".join(["sleep 90", "/app/blob-indexer"])],
)
4 changes: 2 additions & 2 deletions src/cl/teku/teku_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ METRICS_PORT_NUM = 8008
# The min/max CPU/memory that the beacon node can use
BEACON_MIN_CPU = 50
BEACON_MAX_CPU = 1000
BEACON_MIN_MEMORY = 512
BEACON_MAX_MEMORY = 1024
BEACON_MIN_MEMORY = 1024
BEACON_MAX_MEMORY = 2048

# 1) The Teku container runs as the "teku" user
# 2) Teku requires write access to the validator secrets directory, so it can write a lockfile into it as it uses the keys
Expand Down
2 changes: 1 addition & 1 deletion src/mev_relay/mev_relay_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def launch_mev_relay(
password="postgres",
user="postgres",
database="postgres",
service_name="postgres",
service_name="mev-relay-postgres",
persistent=DONT_PERSIST_TO_DISK,
launch_adminer=LAUNCH_ADMINER,
)
Expand Down

0 comments on commit 71d2322

Please sign in to comment.