Skip to content

Commit

Permalink
fix sgx ckzg issue (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
smtmfft authored May 6, 2024
1 parent 039d2fa commit 73a9da8
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
4 changes: 4 additions & 0 deletions host/src/preflight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ fn get_blob_data(beacon_rpc_url: &str, block_id: u64) -> Result<GetBlobsResponse
let blob_response: GetBlobsResponse = response.json().await?;
Ok(blob_response)
} else {
println!(
"Request {url} failed with status code: {}",
response.status()
);
Err(anyhow::anyhow!(
"Request failed with status code: {}",
response.status()
Expand Down
7 changes: 2 additions & 5 deletions lib/src/protocol_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ pub fn assemble_protocol_instance(
) -> Result<ProtocolInstance> {
let blob_used = input.taiko.block_proposed.meta.blobUsed;
let tx_list_hash = if blob_used {
#[cfg(not(any(feature = "sgx", feature = "sp1")))]
{
if cfg!(not(feature = "sp1")) {
println!("kzg check enabled!");
let mut data = Vec::from(KZG_TRUST_SETUP_DATA);
let kzg_settings = KzgSettings::from_u8_slice(&mut data);
Expand All @@ -108,9 +107,7 @@ pub fn assemble_protocol_instance(
let versioned_hash = kzg_to_versioned_hash(kzg_commit);
assert_eq!(versioned_hash, input.taiko.tx_blob_hash.unwrap());
versioned_hash
}
#[cfg(any(feature = "sgx", feature = "sp1"))]
{
} else {
println!("kzg check disabled!");
input.taiko.tx_blob_hash.unwrap()
}
Expand Down
34 changes: 20 additions & 14 deletions prove_block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,37 @@ elif [ "$proof" == "sgx" ]; then
proofParam='
"proof_type": "sgx",
"prover_args": {
"instance_id": 456,
"setup": true,
"bootstrap": true,
"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": {
"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": {
"bonsai": true,
"snark": true,
"profile": false,
"execution_po2": 20
"risc0": {
"bonsai": true,
"snark": true,
"profile": false,
"execution_po2": 20
}
}
'
else
Expand Down
1 change: 1 addition & 0 deletions provers/sgx/config/sgx-guest.docker.manifest.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ sgx.max_threads = 16
sgx.remote_attestation = "dcap"
sys.enable_extra_runtime_domain_names_conf = true
sys.insecure__allow_eventfd = true
sys.stack.size = "8M"
1 change: 1 addition & 0 deletions provers/sgx/config/sgx-guest.local.manifest.template
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ sgx.max_threads = 16
sgx.remote_attestation = "dcap"
sys.enable_extra_runtime_domain_names_conf = true
sys.insecure__allow_eventfd = true
sys.stack.size = "8M"

0 comments on commit 73a9da8

Please sign in to comment.