ci: 🪓 Cutting BS (#43)

Due to our constrained CI resources available to us, this PR disables
`blockscout` from running in the CI.

This PR makes it so `minimal` runs don't use blockscout, and changes the
CI to use this instead of the verified network.
This commit is contained in:
Tim B 2025-04-15 20:06:17 +01:00 committed by GitHub
parent 6310f0d3fc
commit 7ac340e465
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 73 additions and 24 deletions

View file

@ -58,5 +58,5 @@ jobs:
${{ runner.os }}-foundry-
- run: bun install
- run: bun start:e2e:verified
- run: bun start:e2e:minimal
- run: bun test:e2e

View file

@ -0,0 +1,20 @@
# Ethereum Private Testnet Configuration
# This configuration file is used with the ethPandaOps Ethereum Package for Kurtosis
# (https://github.com/ethpandaops/ethereum-package)
#
# Purpose: Sets up a minimal Ethereum testnet with multiple execution and consensus clients
# Usage: kurtosis run github.com/ethpandaops/ethereum-package --args-file configs/minimal.yaml
participants:
- el_type: reth
cl_type: lighthouse
count: 2
additional_services:
- dora
- blockscout
network_params:
preset: minimal
num_validator_keys_per_node: 128
prefunded_accounts: '{"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266": {"balance": "10ETH"}, "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc": {"balance": "10ETH"}, "0x70997970C51812dc3A010C7d01b50e0d17dc79C8": {"balance": "10ETH"},"0x976ea74026e726554db657fa54763abd0c3a0aa9": {"balance": "10ETH"}}'

View file

@ -12,7 +12,6 @@ participants:
additional_services:
- dora
- blockscout
network_params:
preset: minimal

View file

@ -6,7 +6,7 @@
"scripts": {
"fmt": "biome check .",
"fmt:fix": "biome check --write .",
"start:e2e:verified": "bun run scripts/e2e-cli.ts --verified",
"start:e2e:verified": "bun run scripts/e2e-cli.ts --verified --blockscout",
"start:e2e:minimal": "bun run scripts/e2e-cli.ts",
"stop:e2e": "kurtosis enclave stop datahaven-ethereum && kurtosis clean && kurtosis engine stop && docker container prune -f",
"stop:e2e:verified": "bun stop:e2e",

View file

@ -1,15 +1,16 @@
import { $ } from "bun";
import invariant from "tiny-invariant";
import chalk from "chalk";
import invariant from "tiny-invariant";
import { logger, printDivider, printHeader } from "utils";
import sendTxn from "./send-txn";
import { launchKurtosis } from "./launch-kurtosis";
import { deployContracts } from "./deploy-contracts";
import { launchKurtosis } from "./launch-kurtosis";
import sendTxn from "./send-txn";
interface ScriptOptions {
verified: boolean;
launchKurtosis?: boolean;
deployContracts?: boolean;
blockscout?: boolean;
help?: boolean;
}
@ -21,6 +22,7 @@ async function main() {
verified: args.includes("--verified"),
launchKurtosis: parseFlag(args, "launchKurtosis"),
deployContracts: parseFlag(args, "deploy-contracts"),
blockscout: parseFlag(args, "blockscout"),
help: args.includes("--help") || args.includes("-h")
};
@ -40,7 +42,8 @@ async function main() {
// Clean up and launch Kurtosis enclave
const { services } = await launchKurtosis({
launchKurtosis: options.launchKurtosis
launchKurtosis: options.launchKurtosis,
blockscout: options.blockscout
});
// Send test transaction
@ -57,14 +60,22 @@ async function main() {
// Display service information in a clean table
printHeader("Service Endpoints");
console.table(
services
.filter((s) => ["reth-1-rpc", "reth-2-rpc", "blockscout-backend", "dora"].includes(s.service))
.concat([
{ service: "blockscout", port: "3000", url: "http://127.0.0.1:3000" },
{ service: "kurtosis-web", port: "9711", url: "http://127.0.0.1:9711" }
])
);
// Filter services to display based on blockscout option
const servicesToDisplay = services
.filter((s) => ["reth-1-rpc", "reth-2-rpc", "dora"].includes(s.service))
.concat([{ service: "kurtosis-web", port: "9711", url: "http://127.0.0.1:9711" }]);
// Conditionally add blockscout services
if (options.blockscout !== false) {
const blockscoutBackend = services.find((s) => s.service === "blockscout-backend");
if (blockscoutBackend) {
servicesToDisplay.push(blockscoutBackend);
// Only add frontend if backend exists
servicesToDisplay.push({ service: "blockscout", port: "3000", url: "http://127.0.0.1:3000" });
}
}
console.table(servicesToDisplay);
printDivider();
@ -77,7 +88,16 @@ async function main() {
printDivider();
// Deploy contracts using the extracted function
const blockscoutBackendUrl = services.find((s) => s.service === "blockscout-backend")?.url;
let blockscoutBackendUrl: string | undefined = undefined;
if (options.blockscout !== false) {
blockscoutBackendUrl = services.find((s) => s.service === "blockscout-backend")?.url;
} else if (options.verified) {
logger.warn(
"⚠️ Contract verification (--verified) requested, but Blockscout is disabled (--no-blockscout). Verification will be skipped."
);
}
await deployContracts({
rpcUrl: networkRpcUrl,
verified: options.verified,
@ -148,6 +168,7 @@ function getOptionsString(options: ScriptOptions): string {
optionStrings.push(`launchKurtosis=${options.launchKurtosis}`);
if (options.deployContracts !== undefined)
optionStrings.push(`deployContracts=${options.deployContracts}`);
if (options.blockscout !== undefined) optionStrings.push(`blockscout=${options.blockscout}`);
return optionStrings.length ? optionStrings.join(", ") : "no options";
}
@ -163,6 +184,8 @@ ${chalk.green("--launchKurtosis")} Clean and launch Kurtosis enclave if
${chalk.green("--no-launchKurtosis")} Keep existing Kurtosis enclave if already running
${chalk.green("--deploy-contracts")} Deploy smart contracts after Kurtosis starts
${chalk.green("--no-deploy-contracts")} Skip smart contract deployment
${chalk.green("--blockscout")} Launch Kurtosis with Blockscout services (uses minimal-with-bs.yaml)
${chalk.green("--no-blockscout")} Launch Kurtosis without Blockscout services (uses minimal.yaml)
${chalk.green("--help, -h")} Show this help menu
${chalk.yellow("Examples:")}

View file

@ -13,9 +13,12 @@ import { getServicesFromDocker, logger, printDivider, printHeader, promptWithTim
*
* @param options - Configuration options
* @param options.launchKurtosis - Whether to forcibly launch Kurtosis (true), keep existing (false), or prompt user (undefined)
* @param options.blockscout - Whether to add Blockscout service (true/undefined) or not (false)
* @returns Object containing success status and Docker services information
*/
export const launchKurtosis = async (options: { launchKurtosis?: boolean } = {}) => {
export const launchKurtosis = async (
options: { launchKurtosis?: boolean; blockscout?: boolean } = {}
) => {
if (await checkKurtosisRunning()) {
logger.info(" Kurtosis network is already running.");
@ -64,8 +67,13 @@ export const launchKurtosis = async (options: { launchKurtosis?: boolean } = {})
// Run Kurtosis
logger.info("🚀 Starting Kurtosis enclave...");
// Determine which config file to use based on the blockscout option
const configFile =
options.blockscout === true ? "configs/minimal-with-bs.yaml" : "configs/minimal.yaml";
logger.info(`Using Kurtosis config file: ${configFile}`);
const { stderr, stdout, exitCode } =
await $`kurtosis run github.com/ethpandaops/ethereum-package --args-file configs/minimal.yaml --enclave datahaven-ethereum`
await $`kurtosis run github.com/ethpandaops/ethereum-package --args-file ${configFile} --enclave datahaven-ethereum`
.nothrow()
.quiet();

View file

@ -45,8 +45,6 @@ export default async function main(privateKey: string, networkRpcUrl: string) {
value: parseEther("1.0")
});
console.log(`Transaction sent! Hash: http://localhost:3000/tx/${hash}`);
console.log(`Waiting for transaction ${hash} to be confirmed...`);
const receipt = await client.waitForTransactionReceipt({ hash });
console.log(`Transaction confirmed in block ${receipt.blockNumber}`);

View file

@ -9,6 +9,7 @@ import {
} from "utils";
import { isAddress, parseAbi, parseEther } from "viem";
// Tests are disabled because we lack ability to run blockscout reliably
describe("E2E: Read-only", () => {
let api: ViemClientInterface;
@ -33,7 +34,7 @@ describe("E2E: Read-only", () => {
expect(balance).toBeGreaterThan(parseEther("1"));
});
it("Snowbridge contract is deployed and verified", async () => {
it.skip("Snowbridge contract is deployed and verified", async () => {
const contractAddress = await fetchContractAddressByName("BeefyClient");
logger.info(`Contract BeefyClient deployed to ${contractAddress}`);
expect(isAddress(contractAddress)).toBeTrue();
@ -65,7 +66,7 @@ describe("E2E: Read-only", () => {
});
});
it("AVS contract is deployed and verified", async () => {
it.skip("AVS contract is deployed and verified", async () => {
const contractAddress = await fetchContractAddressByName("DataHavenServiceManager");
logger.info(`Contract DataHavenServiceManager deployed to ${contractAddress}`);
expect(isAddress(contractAddress)).toBeTrue();

View file

@ -1,5 +1,5 @@
import chalk from "chalk";
import readline from "node:readline";
import chalk from "chalk";
// Helper function to create an interactive prompt with timeout
export const promptWithTimeout = async (
question: string,

View file

@ -1,6 +1,6 @@
import chalk from "chalk";
import pino from "pino";
import pinoPretty from "pino-pretty";
import chalk from "chalk";
const logLevel = process.env.LOG_LEVEL || "info";