Skip to content

feat: introduce SP1_MOONGATE_SERVER_PORT env value as port for moongate-server #2420

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

Conversation

fyInALT
Copy link

@fyInALT fyInALT commented Aug 7, 2025

Motivation

In testing sp1 and op-succinct, we found that when using CUDA proving mode, the Moongate server's default port is set to 3000, which can easily cause port conflicts with other services on the machine. Since many proof service implementations do not actively configure this port parameter.

Solution

we could introduce an environment variable to specify the desired port. For example:

SP1_MOONGATE_SERVER_PORT=13001 SP1_PROVER=cuda RUST_LOG=debug ./target/release/fibonacci-script

This will instruct the Moongate server to use port 13001:

2025-08-07T15:42:59.954343Z DEBUG starting new connection: http://localhost:13001/

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@fyInALT fyInALT changed the title feat: use SP1_MOONGATE_SERVER_PORT env value as port for moongate-server feat: introduce SP1_MOONGATE_SERVER_PORT env value as port for moongate-server Aug 7, 2025
@leruaa
Copy link
Contributor

leruaa commented Aug 11, 2025

This can already be done with https://docs.rs/sp1-sdk/5.2.1/sp1_sdk/cuda/builder/struct.LocalMoongateServerCudaProverBuilder.html#method.port:

Something like:

let client = ProverClient::builder()
    .cuda()
    .local()
    .port(13001)
    .build()

@leruaa leruaa closed this Aug 11, 2025
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.

2 participants