-
-
Notifications
You must be signed in to change notification settings - Fork 410
chore(testing): initial Kurtosis integration for exploratory migration #8296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
IreneBa26
wants to merge
4
commits into
ChainSafe:feature/kurtosis-sim-tests
Choose a base branch
from
IreneBa26:feature/kurtosis-sim-tests
base: feature/kurtosis-sim-tests
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,489
−428
Draft
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b33fb3c
chore(kurtosis): add initial runner and mock simulation scaffolding
IreneBa26 41b9c35
refactor(kurtosis): address PR feedback
IreneBa26 2ec1b92
refactor(kurtosis): network config improvements
IreneBa26 2ca92a7
refactor(kurtosis): NodePair[] integration
IreneBa26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,26 @@ | ||
| import {ChildProcess} from "node:child_process"; | ||
| //import {ChildProcess} from "node:child_process"; | ||
| import {SecretKey} from "@chainsafe/blst"; | ||
| import {ApiClient} from "@lodestar/api"; | ||
| import {ApiClient as KeyManagerApi} from "@lodestar/api/keymanager"; | ||
| import {ChainForkConfig} from "@lodestar/config"; | ||
| import {LogLevel, Logger} from "@lodestar/logger"; | ||
| import {ForkName} from "@lodestar/params"; | ||
| import {Epoch, SignedBeaconBlock, Slot} from "@lodestar/types"; | ||
| import {ServiceContext} from "kurtosis-sdk"; | ||
| import {Web3} from "web3"; | ||
| import {BeaconArgs} from "../../../src/cmds/beacon/options.js"; | ||
| import {IValidatorCliArgs} from "../../../src/cmds/validator/options.js"; | ||
| import {GlobalArgs} from "../../../src/options/index.js"; | ||
| import {EpochClock} from "./epochClock.js"; | ||
| import { KurtosisNetworkConfig, KurtosisServicesMap } from "./kurtosis/runner/kurtosisTypes.js"; | ||
|
|
||
| export type NodeId = string; | ||
|
|
||
| export type SimulationInitOptions = { | ||
| id: string; | ||
| logsDir: string; | ||
| forkConfig: ChainForkConfig; | ||
| trustedSetup?: boolean; | ||
| }; | ||
|
|
||
| export type SimulationOptions = { | ||
|
|
@@ -26,6 +29,7 @@ export type SimulationOptions = { | |
| rootDir: string; | ||
| controller: AbortController; | ||
| genesisTime: number; | ||
| trustedSetup?: boolean; | ||
| logLevel?: LogLevel; | ||
| }; | ||
|
|
||
|
|
@@ -45,11 +49,6 @@ export enum ExecutionClient { | |
| Nethermind = "execution-nethermind", | ||
| } | ||
|
|
||
| export enum ExecutionStartMode { | ||
| PreMerge = "pre-merge", | ||
| PostMerge = "post-merge", | ||
| } | ||
|
|
||
| export type BeaconClientsOptions = { | ||
| [BeaconClient.Lodestar]: Partial<BeaconArgs & GlobalArgs>; | ||
| [BeaconClient.Lighthouse]: Record<string, unknown>; | ||
|
|
@@ -136,7 +135,7 @@ export interface ExecutionGenesisOptions<E extends ExecutionClient = ExecutionCl | |
| export interface ExecutionGeneratorOptions<E extends ExecutionClient = ExecutionClient> | ||
| extends ExecutionGenesisOptions<E>, | ||
| GeneratorOptions { | ||
| mode: ExecutionStartMode; | ||
| //mode: ExecutionStartMode; //✅ REMOVED - ExecutionStartMode not needed anymore | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes remove that line completely. |
||
| mining: boolean; | ||
| paths: ExecutionPaths; | ||
| clientOptions: ExecutionClientsOptions[E]; | ||
|
|
@@ -164,52 +163,37 @@ export type LighthouseAPI = Omit<ApiClient, "lodestar"> & { | |
| }; | ||
| }; | ||
|
|
||
| // NEW - Kurtosis-specific BeaconNode | ||
| export interface BeaconNode<C extends BeaconClient = BeaconClient> { | ||
| readonly client: C; | ||
| readonly id: string; | ||
| /** | ||
| * Beacon Node Rest API URL accessible form the host machine if the process is running in private network inside docker | ||
| */ | ||
| readonly restPublicUrl: string; | ||
| /** | ||
| * Beacon Node Rest API URL accessible within private network | ||
| */ | ||
| readonly restPrivateUrl: string; | ||
| readonly restPublicUrl: string; //🔄 From Kurtosis? | ||
| readonly restPrivateUrl: string; //🔄 From Kurtosis? | ||
| readonly api: C extends BeaconClient.Lodestar ? LodestarAPI : LighthouseAPI; | ||
| readonly job: Job; | ||
| readonly serviceContext: ServiceContext; // ✅ NEW - Kurtosis-native | ||
| } | ||
|
|
||
| // NEW - Kurtosis-specific ValidatorNode | ||
| export interface ValidatorNode<C extends ValidatorClient = ValidatorClient> { | ||
| readonly client: C; | ||
| readonly id: string; | ||
| readonly keyManager: KeyManagerApi; | ||
| readonly keys: ValidatorClientKeys; | ||
| readonly job: Job; | ||
| readonly serviceContext: ServiceContext; // ✅ NEW - Kurtosis-native | ||
| } | ||
|
|
||
| // NEW - Kurtosis-specific executionNode | ||
| export interface ExecutionNode<E extends ExecutionClient = ExecutionClient> { | ||
| readonly client: E; | ||
| readonly id: string; | ||
| readonly ttd: bigint; | ||
| /** | ||
| * Engine URL accessible form the host machine if the process is running in private network inside docker | ||
| */ | ||
| readonly engineRpcPublicUrl: string; | ||
| /** | ||
| * Engine URL accessible within private network inside docker | ||
| */ | ||
| readonly engineRpcPrivateUrl: string; | ||
| /** | ||
| * RPC URL accessible form the host machine if the process is running in private network inside docker | ||
| */ | ||
| readonly ethRpcPublicUrl: string; | ||
| /** | ||
| * RPC URL accessible within private network inside docker | ||
| */ | ||
| readonly ethRpcPrivateUrl: string; | ||
| readonly engineRpcPublicUrl: string; //🔄 From Kurtosis? | ||
| readonly engineRpcPrivateUrl: string; //🔄 From Kurtosis? | ||
| readonly ethRpcPublicUrl: string; //🔄 From Kurtosis? | ||
| readonly ethRpcPrivateUrl: string; //🔄 From Kurtosis? | ||
| readonly jwtSecretHex: string; | ||
| readonly provider: E extends ExecutionClient.Mock ? null : Web3; | ||
| readonly job: Job; | ||
| readonly serviceContext: ServiceContext; // ✅ NEW - Kurtosis-native | ||
| } | ||
|
|
||
| export interface NodePair { | ||
|
|
@@ -287,17 +271,19 @@ export type RunnerOptions = { | |
| }; | ||
| }; | ||
|
|
||
| //✅ New Kurtosis Runner | ||
| export interface IRunner { | ||
| create: (jobOptions: JobOptions[]) => Job; | ||
| on(event: RunnerEvent, cb: (id: string) => void | Promise<void>): void; | ||
| start(): Promise<void>; | ||
| stop(): Promise<void>; | ||
| getNextIp(): string; | ||
| } | ||
| // Takes a structured config and instantiates the network | ||
| create: (config: KurtosisNetworkConfig) => Promise<KurtosisServicesMap>; // ✅ NEW - Kurtosis-native | ||
|
|
||
| // Starts the environment (e.g., enclave) | ||
| start: (enclaveName: string) => Promise<void>; // ✅ NEW - Kurtosis-native | ||
|
|
||
| export interface RunnerEnv<T extends RunnerType> { | ||
| type: T; | ||
| create: (jobOption: Omit<JobOptions<T>, "children">) => Job; | ||
| // Stops or tears down the environment | ||
| stop: () => Promise<void>; | ||
|
|
||
| // Attach listeners for events, such as service start, stop, crash, etc. | ||
| on(event: RunnerEvent, cb: (id: string) => void | Promise<void>): void; | ||
| } | ||
|
|
||
| export type RunnerEvent = "starting" | "started" | "stopping" | "stop"; | ||
|
|
@@ -383,7 +369,6 @@ export interface AssertionError { | |
| message: string; | ||
| data?: Record<string, unknown>; | ||
| } | ||
| export type ChildProcessWithJobOptions = {jobOptions: JobOptions; childProcess: ChildProcess}; | ||
|
|
||
| export type Eth1GenesisBlock = { | ||
| config: { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would remove this line when this PR get ready.