Skip to content

Commit

Permalink
Prover config loading fix (#177)
Browse files Browse the repository at this point in the history
* fix: Fix prover specific args

* fix: Add serde flatten to properly read prover specific configs

---------

Co-authored-by: Brecht Devos <[email protected]>
  • Loading branch information
2 people authored and CeciliaZ030 committed May 11, 2024
1 parent 3dacb5e commit 10ed2b9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 37 deletions.
28 changes: 13 additions & 15 deletions host/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
"prover": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"graffiti": "8008500000000000000000000000000000000000000000000000000000000000",
"proof_type": "risc0",
"prover_args": {
"sgx": {
"instance_id": 456,
"setup": true,
"bootstrap": true,
"prove": true,
"input_path": null
},
"risc0": {
"bonsai": true,
"snark": true,
"profile": false,
"execution_po2": 20
}
"sgx": {
"instance_id": 456,
"setup": true,
"bootstrap": true,
"prove": true,
"input_path": null
},
"risc0": {
"bonsai": true,
"snark": true,
"profile": false,
"execution_po2": 20
}
}
}
1 change: 1 addition & 0 deletions host/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ pub struct ProofRequestOpt {
/// The proof type.
pub proof_type: Option<String>,
#[command(flatten)]
#[serde(flatten)]
/// Any additional prover params in JSON format.
pub prover_args: ProverSpecificOpts,
}
Expand Down
38 changes: 16 additions & 22 deletions script/prove-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,38 +52,32 @@ elif [ "$proof" == "sp1" ]; then
elif [ "$proof" == "sgx" ]; then
proofParam='
"proof_type": "sgx",
"prover_args": {
"sgx" : {
"instance_id": 123,
"setup": false,
"bootstrap": false,
"prove": true,
"input_path": null
}
"sgx" : {
"instance_id": 123,
"setup": false,
"bootstrap": false,
"prove": true,
"input_path": null
}
'
elif [ "$proof" == "risc0" ]; then
proofParam='
"proof_type": "risc0",
"prover_args": {
"risc0": {
"bonsai": false,
"snark": false,
"profile": true,
"execution_po2": 18
}
"risc0": {
"bonsai": false,
"snark": false,
"profile": true,
"execution_po2": 18
}
'
elif [ "$proof" == "risc0-bonsai" ]; then
proofParam='
"proof_type": "risc0",
"prover_args": {
"risc0": {
"bonsai": true,
"snark": true,
"profile": false,
"execution_po2": 20
}
"risc0": {
"bonsai": true,
"snark": true,
"profile": false,
"execution_po2": 20
}
'
else
Expand Down

0 comments on commit 10ed2b9

Please sign in to comment.