Skip to content

Commit ccc95e4

Browse files
Merge branch 'staging' into feat/aggregation-mode-rename-endpoints
2 parents 7d8e37a + 606dd80 commit ccc95e4

25 files changed

+2326
-2088
lines changed

.github/workflows/build-and-test-go.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- "common/**"
1414
- "core/**"
1515
- "metrics/**"
16-
- ".github/workflows/build-go.yml"
16+
- ".github/workflows/build-and-test-go.yml"
1717
env:
1818
FFI_FOR_RELEASE: false
1919
jobs:
@@ -34,18 +34,33 @@ jobs:
3434
- name: Build SP1 bindings
3535
run: make build_sp1_linux
3636

37+
- name: Clean SP1 build artifacts
38+
run: rm -rf operator/sp1/lib/target
39+
3740
- name: Build Risc Zero go bindings
3841
run: make build_risc_zero_linux
3942

43+
- name: Clean Risc Zero build artifacts
44+
run: rm -rf operator/risc_zero/lib/target
45+
4046
- name: Build Merkle Tree bindings
4147
run: make build_merkle_tree_linux
42-
48+
49+
- name: Clean Merkle Tree build artifacts
50+
run: rm -rf operator/merkle_tree/lib/target
51+
4352
- name: Build Mina bindings
4453
run: make build_mina_linux
45-
54+
55+
- name: Clean Mina build artifacts
56+
run: rm -rf operator/mina/lib/target
57+
4658
- name: Build Mina Account bindings
4759
run: make build_mina_account_linux
48-
60+
61+
- name: Clean Mina Account build artifacts
62+
run: rm -rf operator/mina_account/lib/target
63+
4964
- name: Build operator
5065
run: go build operator/cmd/main.go
5166

aggregation_mode/batcher/abi/AggregationModePaymentService.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

aggregation_mode/proof_aggregator/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ make proof_aggregator_write_program_ids
7474

7575
We are using docker to produce deterministic builds so that the program ids are the same for all systems.
7676

77-
### Updating the program id in `AlignedProofAggregationService` contract
77+
### Updating the verifier program commitment in `AlignedProofAggregationService` contract
7878

79-
If the program ids have changed, you will also need to update them in the `AlignedProofAggregationService` contract.
79+
If the verifier program commitments have changed, you will also need to add the updated one to the `AlignedProofAggregationService` contract. You can do this by calling the `allowVerifyingProgram` method with the new commitment and the proving system ID as parameters (you can check the last parameter in the ProvingSystemId definition at `contracts/src/core/IAlignedProofAggregationService.sol`).
8080

81-
- Risc0: call `setRisc0AggregatorProgramImageId` method with the value of `risc0_root_aggregator_image_id` from `aggregation_mode/program_ids.json`.
82-
- SP1: call: `setSP1AggregatorProgramVKHash` method with the value of `sp1_root_aggregator_vk_hash` from `aggregation_mode/program_ids.json`.
81+
You can fetch the verifier program commitment values from the following:
82+
83+
- Risc0: Use the value of `risc0_chunk_aggregator_image_id` from `aggregation_mode/program_ids.json`.
84+
- SP1: Use the value of `sp1_chunk_aggregator_vk_hash` from `aggregation_mode/program_ids.json`.

aggregation_mode/proof_aggregator/abi/AlignedProofAggregationService.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

aggregation_mode/proof_aggregator/src/backend/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ pub struct Config {
2323
pub ecdsa: ECDSAConfig,
2424
pub proofs_per_chunk: u16,
2525
pub total_proofs_limit: u16,
26+
pub sp1_chunk_aggregator_vk_hash: String,
27+
pub risc0_chunk_aggregator_image_id: String,
2628
}
2729

2830
impl Config {

aggregation_mode/proof_aggregator/src/backend/mod.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ pub struct ProofAggregator {
4444
proof_aggregation_service: AlignedProofAggregationServiceContract,
4545
fetcher: ProofsFetcher,
4646
config: Config,
47+
sp1_chunk_aggregator_vk_hash_bytes: [u8; 32],
48+
risc0_chunk_aggregator_image_id_bytes: [u8; 32],
4749
}
4850

4951
impl ProofAggregator {
@@ -66,11 +68,25 @@ impl ProofAggregator {
6668
ZKVMEngine::from_env().expect("AGGREGATOR env variable to be set to one of sp1|risc0");
6769
let fetcher = ProofsFetcher::new(&config);
6870

71+
let sp1_chunk_aggregator_vk_hash_bytes: [u8; 32] =
72+
hex::decode(&config.sp1_chunk_aggregator_vk_hash)
73+
.expect("Failed to decode SP1 chunk aggregator VK hash")
74+
.try_into()
75+
.expect("SP1 chunk aggregator VK hash must be 32 bytes");
76+
77+
let risc0_chunk_aggregator_image_id_bytes: [u8; 32] =
78+
hex::decode(&config.risc0_chunk_aggregator_image_id)
79+
.expect("Failed to decode Risc0 chunk aggregator image id")
80+
.try_into()
81+
.expect("Risc0 chunk aggregator image id must be 32 bytes");
82+
6983
Self {
7084
engine,
7185
proof_aggregation_service,
7286
fetcher,
7387
config,
88+
sp1_chunk_aggregator_vk_hash_bytes,
89+
risc0_chunk_aggregator_image_id_bytes,
7490
}
7591
}
7692

@@ -157,10 +173,11 @@ impl ProofAggregator {
157173
let tx_req = match aggregated_proof {
158174
AlignedProof::SP1(proof) => self
159175
.proof_aggregation_service
160-
.verifySP1(
176+
.verifyAggregationSP1(
161177
blob_versioned_hash.into(),
162178
proof.proof_with_pub_values.public_values.to_vec().into(),
163179
proof.proof_with_pub_values.bytes().into(),
180+
self.sp1_chunk_aggregator_vk_hash_bytes.into(),
164181
)
165182
.sidecar(blob)
166183
.into_transaction_request(),
@@ -169,10 +186,11 @@ impl ProofAggregator {
169186
AggregatedProofSubmissionError::Risc0EncodingSeal(e.to_string())
170187
})?;
171188
self.proof_aggregation_service
172-
.verifyRisc0(
189+
.verifyAggregationRisc0(
173190
blob_versioned_hash.into(),
174191
encoded_seal.into(),
175192
proof.receipt.journal.bytes.into(),
193+
self.risc0_chunk_aggregator_image_id_bytes.into(),
176194
)
177195
.sidecar(blob)
178196
.into_transaction_request()

config-files/config-proof-aggregator-ethereum-package.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ proofs_per_chunk: 512 # Amount of proofs to process per chunk
1313
# We can aggregate as much proofs as 126.976 / 32 = 3968 per blob
1414
total_proofs_limit: 3968
1515

16+
# These program ids are the ones from the chunk aggregator programs
17+
# Can be found in the Proof Aggregation Service deployment config
18+
# (remember to trim the 0x prefix)
19+
sp1_chunk_aggregator_vk_hash: "00ba19eed0aaeb0151f07b8d3ee7c659bcd29f3021e48fb42766882f55b84509"
20+
risc0_chunk_aggregator_image_id: "d8cfdd5410c70395c0a1af1842a0148428cc46e353355faccfba694dd4862dbf"
21+
1622
ecdsa:
1723
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"
1824
private_key_store_password: ""

config-files/config-proof-aggregator-mock-ethereum-package.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ proofs_per_chunk: 512 # Amount of proofs to process per chunk
1313
# We can aggregate as much proofs as 126.976 / 32 = 3968 per blob
1414
total_proofs_limit: 3968
1515

16+
# These program ids are the ones from the chunk aggregator programs
17+
# Can be found in the Proof Aggregation Service deployment config
18+
# (remember to trim the 0x prefix)
19+
sp1_chunk_aggregator_vk_hash: "00ba19eed0aaeb0151f07b8d3ee7c659bcd29f3021e48fb42766882f55b84509"
20+
risc0_chunk_aggregator_image_id: "d8cfdd5410c70395c0a1af1842a0148428cc46e353355faccfba694dd4862dbf"
1621

1722
ecdsa:
1823
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

config-files/config-proof-aggregator-mock.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ proofs_per_chunk: 512 # Amount of proofs to process per chunk
1313
# We can aggregate as much proofs as 126.976 / 32 = 3968 per blob
1414
total_proofs_limit: 3968
1515

16+
# These program ids are the ones from the chunk aggregator programs
17+
# Can be found in the Proof Aggregation Service deployment config
18+
# (remember to trim the 0x prefix)
19+
sp1_chunk_aggregator_vk_hash: "00ba19eed0aaeb0151f07b8d3ee7c659bcd29f3021e48fb42766882f55b84509"
20+
risc0_chunk_aggregator_image_id: "d8cfdd5410c70395c0a1af1842a0148428cc46e353355faccfba694dd4862dbf"
1621

1722
ecdsa:
1823
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

config-files/config-proof-aggregator.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ proofs_per_chunk: 512 # Amount of proofs to process per chunk
1313
# We can aggregate as much proofs as 126.976 / 32 = 3968 per blob
1414
total_proofs_limit: 3968
1515

16+
# These program ids are the ones from the chunk aggregator programs
17+
# Can be found in the Proof Aggregation Service deployment config
18+
# (remember to trim the 0x prefix)
19+
sp1_chunk_aggregator_vk_hash: "00ba19eed0aaeb0151f07b8d3ee7c659bcd29f3021e48fb42766882f55b84509"
20+
risc0_chunk_aggregator_image_id: "d8cfdd5410c70395c0a1af1842a0148428cc46e353355faccfba694dd4862dbf"
1621

1722
ecdsa:
1823
private_key_store_path: "config-files/anvil.proof-aggregator.ecdsa.key.json"

0 commit comments

Comments
 (0)