Skip to content
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

feat: 2 server #369

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ sp1-zkvm = { version = "4.0.0", features = ["verify", "embedded"] }
# TODO: Switch back to version tag once the Docker workspace directory change is merged.
sp1-build = { git = "https://github.com/succinctlabs/sp1", branch = "dev" }

rand = { version = "0.8.5", default-features = false }

[profile.release-client-lto]
inherits = "release"
panic = "abort"
Expand Down
Binary file modified elf/range-elf
Binary file not shown.
1 change: 1 addition & 0 deletions proposer/succinct/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ op-succinct-host-utils.workspace = true

# sp1
sp1-sdk.workspace = true
rand.workspace = true

anyhow.workspace = true
dotenv.workspace = true
Expand Down
17 changes: 16 additions & 1 deletion proposer/succinct/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use op_succinct_proposer::{
AggProofRequest, ProofResponse, ProofStatus, SpanProofRequest, SuccinctProposerConfig,
ValidateConfigRequest, ValidateConfigResponse,
};
use rand::Rng;
use sp1_sdk::{
network::{
proto::network::{ExecutionStatus, FulfillmentStatus},
Expand Down Expand Up @@ -182,7 +183,21 @@ async fn request_span_proof(
}
};

let client = ProverClient::builder().network().build();
let cluster_1_weight = env::var("CLUSTER_1_WEIGHT")
.unwrap_or_else(|_| "50".to_string())
.parse::<u8>()
.unwrap_or(50);

let private_key = if rand::thread_rng().gen_range(0..100) < cluster_1_weight {
env::var("NETWORK_PRIVATE_KEY_1").unwrap()
} else {
env::var("NETWORK_PRIVATE_KEY_2").unwrap()
};
let client = ProverClient::builder()
.network()
.private_key(&private_key)
.build();

let proof_id = client
.prove(&state.range_pk, &sp1_stdin)
.compressed()
Expand Down
Loading