Skip to content

[rust-launcher] Refactor main.rs into smaller logical modules #2609

@barakeinav1

Description

@barakeinav1

Context

Follow-up from PR #2326 (port node launcher to Rust). Tracked in #2598.

Problem

crates/tee-launcher/src/main.rs is ~1,279 lines mixing orchestration, registry interaction, image validation, compose rendering, config injection, and tests. This makes it hard to navigate and maintain.

Suggested Module Split

Module Contents ~Lines
registry.rs RegistryInfo trait, DockerRegistry, get_manifest_digest() 450
validation.rs validate_image_hash(), docker pull/inspect logic 150
compose.rs render_compose_file(), launch_mpc_container() 150
selection.rs select_image_hash() 100
config.rs intercept_node_config(), insert_reserved() 100
main.rs Entry points main() and run() only 100-150

Tests should move to their respective modules.

Action

  • Extract modules along the boundaries above
  • Move tests to their respective modules
  • Keep main.rs as orchestration-only (~100-150 lines)
  • Ensure all pub(crate) visibility is correct after split

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions