Skip to content

feat(launcher): Add ability to use the launcher also for non tee setups. - #1735

Merged
barakeinav1 merged 13 commits into
mainfrom
launcher-nontee-support
Jan 14, 2026
Merged

barakeinav1 merged 13 commits into
mainfrom
launcher-nontee-support

Conversation

@barakeinav1

@barakeinav1 barakeinav1 commented Jan 11, 2026 •

Copy link
Copy Markdown
Contributor

fixes #1590

This PR allows the MPC launcher to run both inside TEEs and outside TEEs using the same orchestration flow, without weakening any existing TEE security guarantees.

A new measured PLATFORM mode (TEE / NONTEE) explicitly controls whether dstack/attestation is required. TEE behavior remains fail-closed and fully attested, while non-TEE deployments can exercise the launcher logic without dstack.

High-level changes

  • Introduce measured PLATFORM={TEE|NONTEE} environment variable
  • Enforce strict, fail-closed behavior in PLATFORM=TEE
  • Skip dstack / RTMR extension in PLATFORM=NONTEE
  • Gate dstack socket mount and env vars on platform
  • Explicitly signal MPC node via MPC_TEE_MODE

tests:
added a few python tests.
I also run a manually test an started an MPC node using the launcher

@barakeinav1 barakeinav1 changed the title launcher: Add ability to use the launcher also for non tee setups. feat(launcher): Add ability to use the launcher also for non tee setups. Jan 11, 2026
@barakeinav1
barakeinav1 force-pushed the launcher-nontee-support branch 3 times, most recently from 6292270 to 7b0d1af Compare January 11, 2026 12:52
@barakeinav1
barakeinav1 force-pushed the launcher-nontee-support branch from 7b0d1af to c12dbe0 Compare January 11, 2026 16:08
@barakeinav1
barakeinav1 force-pushed the launcher-nontee-support branch from e04b57b to 4ae540c Compare January 13, 2026 08:47
DSharifi
DSharifi previously approved these changes Jan 14, 2026
Comment thread tee_launcher/test_launcher_config.py Resolved

@gilcu3 gilcu3 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks quite good. I have only two blockers, and a few suggestions:

  • I think there is a bug in the order of parameters for the docker_cmd not a bug see comment
  • I expected to see a CI step that could test this code, now that non-tee deployments are possible. We should have something similar to
    docker-tee-build:
    name: "Build MPC Node TEE Docker image"
    runs-on: warp-ubuntu-2204-x64-16x
    timeout-minutes: 60
    permissions:
    contents: read
    steps:
    - name: Checkout repository
    uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    with:
    persist-credentials: false
    - name: Install repro-env
    run: |
    wget 'https://github.com/kpcyrd/repro-env/releases/download/v0.4.3/repro-env'
    echo '2a00b21ac5e990e0c6a0ccbf3b91e34a073660d1f4553b5f3cda2b09cc4d4d8a repro-env' | sha256sum -c -
    sudo install -m755 repro-env -t /usr/bin
    - name: Build MPC Node binary and image
    run: |
    export NODE_IMAGE_NAME=test_image_tag_ci
    ./deployment/build-images.sh --node
    - name: Check Docker image can initialize and start
    run: |
    touch /tmp/image-digest.bin
    # Test container startup - fail if container can't start
    # Start container in background and check status after 60 seconds
    CONTAINER_ID=$(docker run -d \
    -v /tmp/:/data \
    -e MPC_HOME_DIR="/data" \
    -e MPC_ACCOUNT_ID=test_image.near \
    -e RUST_BACKTRACE="full" \
    -e RUST_LOG="mpc=debug,info" \
    -e MPC_SECRET_STORE_KEY=BD399143F5B3126098B0EAA023A0E730 \
    -e MPC_P2P_PRIVATE_KEY=ed25519:2WBi5gRyJntYA7dCyddiwNV2yNTdr5uZhrP4WX5GNBL5DSVCSR7ESvcXF2DBfY5oPYhzBmHnguPVSXjr6UCi8h1g \
    -e MPC_ACCOUNT_SK=ed25519:6X3Bnghdf89WjHQfHDFYjW2UeNaNqCQ1AUGxX7zgvbJT4KSoeXzuHEdux6A2jsphTZTmS4SUGQRyYqC2ik3UrMP \
    -e NEAR_BOOT_NODES=ed25519:ERguu7jQuYk8pxNsRC6FdezvNsegBPva1GRGqjmtD7i2@10.10.10.10:24567 \
    -e MPC_CONTRACT_ID=v1.signer_test \
    -e MPC_IMAGE_HASH=5ba283860c0efa3d4c3e08a76a2b77fab4725baad4f48504eac858e04af7fd64 \
    -e MPC_LATEST_ALLOWED_HASH_FILE=/tmp/image-digest.bin \
    -e MPC_BACKUP_ENCRYPTION_KEY_HEX=0000000000000000000000000000000000000000000000000000000000000000 \
    -e MPC_ENV=mainnet test_image_tag_ci)
    if [ -z "$CONTAINER_ID" ]; then
    echo "❌ Failed to start container"
    exit 1
    fi
    echo "Container started: $CONTAINER_ID"
    # Check if container is actually running
    sleep 60
    if [ -z "$(docker ps --filter "id=$CONTAINER_ID" --format "{{.ID}}")" ]; then
    docker logs "$CONTAINER_ID" 2>&1 | head -50
    echo "❌ Container cannot initialize/start properly"
    exit 1
    fi
    echo "✅ Container started successfully"
    but now including the NONTEE launcher part

Comment thread tee_launcher/launcher.py Resolved
Comment thread tee_launcher/launcher.py Resolved
Comment thread tee_launcher/launcher.py
Comment on lines +485 to +488
if not is_unix_socket(DSTACK_UNIX_SOCKET):
raise RuntimeError(
f"PLATFORM=TEE requires dstack unix socket at {DSTACK_UNIX_SOCKET}."
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is orthogonal to the issue? Something missing from before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related, not orthogonal. (let says 42 degrees)
If we don't have DSTACK_UNIX_SOCKET when running in TEE mode, this is a critical failure.
better to stop right away.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for consistency

Suggested change
image: nearone/mpc-launcher@sha256:72f16f1d1ca9119f5c19cb3ec7f6338949e2ad3082bd01ba2099c6649e845f61

Comment thread tee_launcher/test_launcher_config.py Resolved
Comment thread tee_launcher/test_launcher_config.py Resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this doc!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce to see these tests!

Comment thread tee_launcher/launcher.py Resolved
@barakeinav1
barakeinav1 force-pushed the launcher-nontee-support branch from 5fa62d7 to b4eedb4 Compare January 14, 2026 10:23
DSharifi
DSharifi previously approved these changes Jan 14, 2026
@barakeinav1

barakeinav1 commented Jan 14, 2026 •

Copy link
Copy Markdown
Contributor Author
  • I expected to see a CI step that could test this code, now that non-tee deployments are possible. We should have something similar to

let add this as a separate task

Add CI job to validate NON-TEE launcher-based MPC deployment
#1758

DSharifi
DSharifi previously approved these changes Jan 14, 2026
gilcu3
gilcu3 previously approved these changes Jan 14, 2026

@gilcu3 gilcu3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, left 2 nits in the doc

@barakeinav1
barakeinav1 added this pull request to the merge queue Jan 14, 2026
@barakeinav1
barakeinav1 removed this pull request from the merge queue due to a manual request Jan 14, 2026
@barakeinav1
barakeinav1 dismissed stale reviews from gilcu3 and DSharifi via d618976 January 14, 2026 13:15
@barakeinav1
barakeinav1 enabled auto-merge January 14, 2026 14:48
@barakeinav1
barakeinav1 added this pull request to the merge queue Jan 14, 2026
Merged via the queue into main with commit 1347c6e Jan 14, 2026
26 of 27 checks passed
@barakeinav1
barakeinav1 deleted the launcher-nontee-support branch January 14, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support running MPC nodes with the launcher in non-TDX environments

3 participants