Skip to content

Commit 26f053d

Browse files
committed
feat: adapt sdk to new verifyProofInclusion api
1 parent 27f77ad commit 26f053d

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

batcher/aligned-sdk/abi/AlignedProofAggregationService.json

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

batcher/aligned-sdk/src/core/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_MAINNET_STAGE: &str = "0x0";
7777
pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY_STAGE: &str =
7878
"0x7Eace34A8d4C4CacE633946C6F7CF4BeF3F33513";
7979
pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY: &str =
80-
"0xe84CD4084d8131841CE6DC265361f81F4C59a1d4";
80+
"0xB93be2158C2C498285634fb8cd10F075dFB568FA";
8181
pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_DEVNET: &str =
8282
"0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc";
8383

batcher/aligned-sdk/src/sdk/aggregation/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ pub use types::{AggregationModeVerificationData, ProofVerificationAggModeError};
88
use crate::{
99
core::types::Network, eth::aligned_proof_agg_service::aligned_proof_aggregation_service,
1010
};
11-
use ethers::providers::{Http, Provider};
11+
use ethers::{
12+
providers::{Http, Provider},
13+
types::Bytes,
14+
};
1215
use lambdaworks_crypto::merkle_tree::merkle::MerkleTree;
1316

1417
/// Given the [`AggregationModeVerificationData`], this function checks whether the proof was included in a
@@ -102,7 +105,11 @@ pub async fn is_proof_verified_on_chain(
102105
.map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?;
103106

104107
let res = contract_provider
105-
.verify_proof_inclusion(merkle_path, verification_data.commitment())
108+
.verify_proof_inclusion(
109+
merkle_path,
110+
verification_data.program_id(),
111+
Bytes::from(verification_data.public_inputs().clone()),
112+
)
106113
.call()
107114
.await
108115
.map_err(|e| ProofVerificationAggModeError::EthereumProviderError(e.to_string()))?;

batcher/aligned-sdk/src/sdk/aggregation/types.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ pub enum AggregationModeVerificationData {
1616
}
1717

1818
impl AggregationModeVerificationData {
19+
pub fn program_id(&self) -> [u8; 32] {
20+
match self {
21+
Self::Risc0 { image_id, .. } => *image_id,
22+
Self::SP1 { vk, .. } => *vk,
23+
}
24+
}
25+
26+
pub fn public_inputs(&self) -> &Vec<u8> {
27+
match self {
28+
Self::Risc0 { public_inputs, .. } => public_inputs,
29+
Self::SP1 { public_inputs, .. } => public_inputs,
30+
}
31+
}
32+
1933
pub fn commitment(&self) -> [u8; 32] {
2034
match self {
2135
AggregationModeVerificationData::SP1 { vk, public_inputs } => {

0 commit comments

Comments
 (0)