Skip to content

Commit 9523803

Browse files
authored
Merge branch 'main' into feat/zkvm-for-pacaya
2 parents 3d2537f + e2f3ac6 commit 9523803

File tree

8 files changed

+83
-34
lines changed

8 files changed

+83
-34
lines changed

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ RUN ego-go build -o gaiko-ego ./cmd/gaiko
1313
# Sign with our enclave config and private key
1414
COPY gaiko/ego/enclave.json .
1515
COPY docker/enclave-key.pem private.pem
16-
RUN ego sign && ego bundle gaiko-ego gaiko && ego uniqueid gaiko-ego
16+
RUN ego sign && ego bundle gaiko-ego gaiko
17+
RUN ego uniqueid gaiko-ego
18+
RUN ego signerid gaiko-ego
1719

1820
FROM rust:1.85.0 AS chef
1921
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash

RELEASE.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# v1.7.0
2+
3+
## image
4+
5+
us-docker.pkg.dev/evmchain/images/raiko:1.7.0
6+
7+
## gaiko
8+
9+
- mrenclave: 0f70dbd91a6c39460e3e8d5a5037220d4115995c15d72a2d57cc93fe7c24ecce
10+
- mrsigner: ca0583a715534a8c981b914589a7f0dc5d60959d9ae79fb5353299a4231673d5
11+
12+
## raiko
13+
14+
- mrenclave: b1190d92e7abe39f2987ef5e3df90b98220b584f4372a45bea1b467a997f6839
15+
- mrsigner: ca0583a715534a8c981b914589a7f0dc5d60959d9ae79fb5353299a4231673d5
16+
17+
# v1.7.0-edmm
18+
19+
## image
20+
21+
us-docker.pkg.dev/evmchain/images/raiko:1.7.0-edmm
22+
23+
## gaiko
24+
25+
- mrenclave: 0f70dbd91a6c39460e3e8d5a5037220d4115995c15d72a2d57cc93fe7c24ecce
26+
- mrsigner: ca0583a715534a8c981b914589a7f0dc5d60959d9ae79fb5353299a4231673d5
27+
28+
## raiko
29+
30+
- mrenclave: b5cd6a283fcd221ffa893f56e8d9d533e07a2ece7e772d68c22949fd4783d16c
31+
- mrsigner: ca0583a715534a8c981b914589a7f0dc5d60959d9ae79fb5353299a4231673d5

core/src/lib.rs

+33
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,17 @@ mod tests {
451451
.generate_batch_input(provider)
452452
.await
453453
.expect("input generation failed");
454+
// let filename = format!("batch-input-{}.json", proof_request.batch_id);
455+
// let writer = std::fs::File::create(&filename).expect("Unable to create file");
456+
// serde_json::to_writer(writer, &input).expect("Unable to write data");
454457
trace!("batch guest input: {input:?}");
455458
let output = raiko
456459
.get_batch_output(&input)
457460
.expect("output generation failed");
458461
debug!("batch guest output: {output:?}");
462+
// let filename = format!("batch-output-{}.json", proof_request.batch_id);
463+
// let writer = std::fs::File::create(&filename).expect("Unable to create file");
464+
// serde_json::to_writer(writer, &output).expect("Unable to write data");
459465
raiko
460466
.batch_prove(input, &output, None)
461467
.await
@@ -492,6 +498,33 @@ mod tests {
492498
batch_prove_block(l1_chain_spec, taiko_chain_spec, proof_request).await;
493499
}
494500

501+
#[ignore]
502+
#[tokio::test(flavor = "multi_thread")]
503+
async fn test_prove_batch_block_taiko_a7() {
504+
env_logger::init();
505+
let proof_type = get_proof_type_from_env();
506+
let l1_network = "holesky".to_owned();
507+
let network = "taiko_a7".to_owned();
508+
let chain_specs = SupportedChainSpecs::default();
509+
let taiko_chain_spec = chain_specs.get_chain_spec(&network).unwrap();
510+
let l1_chain_spec = chain_specs.get_chain_spec(&l1_network).unwrap();
511+
512+
let proof_request = ProofRequest {
513+
block_number: 0,
514+
batch_id: 1306738,
515+
l1_inclusion_block_number: 3606914,
516+
l2_block_numbers: vec![1306738],
517+
network,
518+
graffiti: B256::ZERO,
519+
prover: Address::ZERO,
520+
l1_network,
521+
proof_type,
522+
blob_proof_type: BlobProofType::ProofOfEquivalence,
523+
prover_args: test_proof_params(false),
524+
};
525+
batch_prove_block(l1_chain_spec, taiko_chain_spec, proof_request).await;
526+
}
527+
495528
#[ignore]
496529
#[tokio::test(flavor = "multi_thread")]
497530
async fn test_batch_prove_block_taiko_mainnet() {

docs/README_Docker_and_RA.md

+7-28
Original file line numberDiff line numberDiff line change
@@ -368,30 +368,7 @@ pnpm install
368368
pnpm compile
369369
```
370370

371-
3. Ensure the values in the `script/layer1/provers/config_dcap_sgx_verifier.sh` script match whichever network you are registering for.
372-
373-
> **_NOTE:_** You will have to do this step twice for Hekla: once for the Ontake addresses and once for the Pacaya addresses. Please keep both SGX_INSTANCE_IDs.
374-
375-
Hekla Ontake Addresses:
376-
`SGX_VERIFIER_ADDRESS`=0x532EFBf6D62720D0B2a2Bb9d11066E8588cAE6D9
377-
`ATTESTATION_ADDRESS`=0xC6cD3878Fc56F2b2BaB0769C580fc230A95e1398
378-
`PEM_CERTCHAIN_ADDRESS`=0x08d7865e7F534d743Aba5874A9AD04bcB223a92E
379-
380-
Hekla Pacaya Addresses:
381-
`SGX_VERIFIER_ADDRESS`=0xa8cD459E3588D6edE42177193284d40332c3bcd4
382-
`ATTESTATION_ADDRESS`=0xC6cD3878Fc56F2b2BaB0769C580fc230A95e1398
383-
`PEM_CERTCHAIN_ADDRESS`=0x08d7865e7F534d743Aba5874A9AD04bcB223a92E
384-
385-
Mainnet Addresses:
386-
`SGX_VERIFIER_ADDRESS`=0xb0f3186FC1963f774f52ff455DC86aEdD0b31F81
387-
`ATTESTATION_ADDRESS`=0x8d7C954960a36a7596d7eA4945dDf891967ca8A3
388-
`PEM_CERTCHAIN_ADDRESS`=0x02772b7B3a5Bea0141C993Dbb8D0733C19F46169
389-
390-
These values are already in the script, it defaults to Hekla; please comment those lines out and uncomment the Mainnet ones if performing RA on Mainnet.
391-
392-
4. In the `script/layer1/provers/config_dcap_sgx_verifier.sh` script, replace `--fork-url https://any-holesky-rpc-url/` with the RPC URL of the hekla/mainnet network. Alternatively, export it like so: `export FORK_URL="https://any-holesky-rpc-url/"`.
393-
394-
5. If you've followed the Raiko Docker guide, you will have bootstrapped raiko and obtained a quote:
371+
3. If you've followed the Raiko Docker guide, you will have bootstrapped raiko and obtained a quote:
395372

396373
```
397374
"public_key": "0x02ab85f14dcdc93832f4bb9b40ad908a5becb840d36f64d21645550ba4a2b28892",
@@ -401,11 +378,13 @@ These values are already in the script, it defaults to Hekla; please comment tho
401378

402379
You can find it with `cat ~/.config/raiko/config/bootstrap.json` as shown above.
403380

404-
Copy your quote and use in the following step.
381+
4. Export an RPC url for the L1 network you are registering for. i.e. `FORK_URL=https://any_holesky_rpc_url/` for Hekla.
382+
383+
5. Call the script with `PRIVATE_KEY=0x{YOUR_PRIVATE_KEY} ./script/layer1/provers/config_dcap_sgx_verifier.sh --env {NETWORK} --quote {YOUR_QUOTE_HERE}`. "YOUR_QUOTE_HERE" comes from above step 5.
405384

406-
6. Call the script with `PRIVATE_KEY=0x{YOUR_PRIVATE_KEY} ./script/layer1/config_dcap_sgx_verifier.sh --quote {YOUR_QUOTE_HERE}`. "YOUR_QUOTE_HERE" comes from above step 5.
385+
`NETWORK` will be `hekla-<ontake|pacaya|pivot>` or `mainnet` depending on which verifier you are registering to.
407386

408-
> **_NOTE:_** You can use the same command for registering both verifiers, just comment out the Ontake addresses and uncomment the Pacaya ones in the script and re-run.
387+
> **_NOTE:_** You will have to do this step twice for Hekla: once for Ontake and once for Pacaya. Please keep both SGX_INSTANCE_IDs.
409388
410389
7. If you've been successful, you will get a SGX instance `id` which can be used to run Raiko!
411390

@@ -424,7 +403,7 @@ Once you've completed the above steps, you can actually run a prover.
424403

425404
Raiko now supports more configurations, which need to be carefully checked to avoid errors.
426405

427-
> **_NOTE:_** We have deprecated `SGX_INSTANCE_ID`, if you only register with the Ontake addresses please export to `SGX_ONTAKE_INSTANCE_ID`.
406+
> **_NOTE:_** We have deprecated `SGX_INSTANCE_ID`, if you only register for Pacaya please export to `SGX_PACAYA_INSTANCE_ID`.
428407
429408
- SGX_ONTAKE_INSTANCE_ID: SGX registered ID for ontake fork. (if raiko start before/in ontake, set this one)
430409
- SGX_PACAYA_INSTANCE_ID: SGX registered ID for pacaya fork. (if raiko start before/in pacaya, set this one)

host/config/chain_spec_list_default.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"SGX": "0xa8cD459E3588D6edE42177193284d40332c3bcd4",
116116
"SP1": "0x1138aA994477f0880001aa1E8106D749035b6250",
117117
"RISC0": "0xCDdf353C838542834E443C3c9dE3ab3F81F27aF2",
118-
"PIVOT": "0x9016078d9870e432cb47122609F83DeE025bC060"
118+
"PIVOT": "0x4361B85093720bD50d25236693CA58FD6e1b3a53"
119119
}
120120
},
121121
"genesis_time": 0,

provers/sgx/setup/src/setup_bootstrap.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub(crate) async fn setup_bootstrap(
3131
// Block until the lock is acquired.
3232
// Create the lock file if it does not exist.
3333
// Drop the lock file when the lock goes out of scope by drop guard.
34-
let _filelock = FileLock::lock(
34+
let filelock = FileLock::lock(
3535
config_dir.join("bootstrap.lock"),
3636
true,
3737
FileOptions::new().create(true).write(true),
@@ -43,7 +43,9 @@ pub(crate) async fn setup_bootstrap(
4343
ProofType::Sgx,
4444
)
4545
.await?;
46-
setup_bootstrap_inner(secret_dir, config_dir, bootstrap_args, ProofType::Pivot).await
46+
setup_bootstrap_inner(secret_dir, config_dir, bootstrap_args, ProofType::Pivot).await?;
47+
drop(filelock);
48+
Ok(())
4749
}
4850

4951
pub(crate) async fn setup_bootstrap_inner(
@@ -123,10 +125,10 @@ pub(crate) async fn setup_bootstrap_inner(
123125
fork_register_id.insert(*spec_id, register_id);
124126
}
125127
}
126-
println!("Saving instance id {registered_fork_ids:?}");
127128
// set check file
128129
set_instance_id(&config_dir, proof_type, &fork_register_id)?;
129130
registered_fork_ids = Some(fork_register_id);
131+
println!("Saving instance id {registered_fork_ids:?}");
130132
}
131133
// Always reset the configuration with a persistent instance ID upon restart.
132134
let file = File::open(&bootstrap_args.config_path)?;
@@ -140,6 +142,7 @@ pub(crate) async fn setup_bootstrap_inner(
140142
let new_config_path = config_dir.join("config.sgx.json");
141143
println!("Saving bootstrap data file {}", new_config_path.display());
142144
let json = serde_json::to_string_pretty(&file_config)?;
145+
println!("Saving config content {}", json);
143146
fs::write(&new_config_path, json).context(format!(
144147
"Saving bootstrap data file {} failed",
145148
new_config_path.display()

script/publish-image.sh

+1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ docker buildx build ./ \
2323
--progress=plain
2424

2525
docker tag raiko:$tag us-docker.pkg.dev/evmchain/images/raiko:$tag
26+
docker tag raiko:$tag ghcr.io/evmchain/raiko:$tag
2627

2728
echo "Done"

0 commit comments

Comments
 (0)