Skip to content

Commit dde2216

Browse files
committed
Merge branch 'refs/heads/feat/aggregation-mode' into integrate-sp1-into-aggregation-mode
# Conflicts: # Makefile
2 parents 2956517 + 31f6cf7 commit dde2216

File tree

6 files changed

+35
-19
lines changed

6 files changed

+35
-19
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ anvil_start_with_block_time_with_more_prefunded_accounts:
154154
@echo "Starting Anvil..."
155155
anvil --load-state contracts/scripts/anvil/state/alignedlayer-deployed-anvil-state.json --block-time 7 -a 2000
156156

157-
__AGGREGATION_MODE__:
158-
start_proof_aggregator_local:
157+
__AGGREGATION_MODE__: ## ____
158+
start_proof_aggregator_local: ## Start the proof aggregator locally using Mock Verifier Contract
159159
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release -- config-files/config-proof-aggregator-mock.yaml
160160

161-
start_proof_aggregator_local_with_proving:
161+
start_proof_aggregator_local_with_proving: ## Start the proof aggregator locally using SP1 Verifier Contract
162162
cargo run --manifest-path ./aggregation_mode/Cargo.toml --release --features prove -- config-files/config-proof-aggregator.yaml
163163

164164
_AGGREGATOR_:

aggregation_mode/Cargo.lock

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aggregation_mode/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ serde_json = "1.0.117"
1212
serde_yaml = "0.9"
1313
tracing = { version = "0.1", features = ["log"] }
1414
tracing-subscriber = { version = "0.3.0", features = ["env-filter"] }
15-
alloy = { version = "0.11", features = ["default", "signer-keystore"] }
15+
alloy = { version = "0.11", features = ["default", "signer-keystore", "kzg"] }
1616
c-kzg = "1.0.3"
1717
bincode = "1.3.3"
1818
tokio = { version = "1", features = ["time"]}
@@ -27,7 +27,6 @@ sp1-build = { version = "4.1.3" }
2727

2828
[profile.release]
2929
opt-level = 3
30-
lto = true
3130

3231
[features]
3332
prove = []
File renamed without changes.

aggregation_mode/src/backend/fetcher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ pub struct ProofsFetcher {
2929

3030
impl ProofsFetcher {
3131
pub fn new(config: &Config) -> Self {
32-
let rpc_url = config.eth_rpc_url.parse().expect("correct url");
32+
let rpc_url = config.eth_rpc_url.parse().expect("RPC URL should be valid");
3333
let rpc_provider = ProviderBuilder::new().on_http(rpc_url);
3434
let aligned_service_manager = AlignedLayerServiceManager::new(
3535
Address::from_str(&config.aligned_service_manager_address)
36-
.expect("Address to be correct"),
36+
.expect("AlignedProofAggregationService address should be valid"),
3737
rpc_provider.clone(),
3838
);
3939

aggregation_mode/src/backend/mod.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ use crate::aggregators::{
1111
};
1212

1313
use alloy::{
14-
consensus::{Blob, BlobTransactionSidecar},
14+
consensus::{BlobTransactionSidecar},
1515
eips::eip4844::BYTES_PER_BLOB,
1616
hex,
1717
network::EthereumWallet,
18-
primitives::{Address, FixedBytes},
18+
primitives::{Address},
1919
providers::{PendingTransactionError, ProviderBuilder},
2020
rpc::types::TransactionReceipt,
2121
signers::local::LocalSigner,
@@ -47,17 +47,17 @@ pub struct ProofAggregator {
4747

4848
impl ProofAggregator {
4949
pub fn new(config: &Config) -> Self {
50-
let rpc_url = config.eth_rpc_url.parse().expect("correct url");
50+
let rpc_url = config.eth_rpc_url.parse().expect("RPC URL should be valid");
5151
let signer = LocalSigner::decrypt_keystore(
5252
config.ecdsa.private_key_store_path.clone(),
5353
config.ecdsa.private_key_store_password.clone(),
5454
)
55-
.expect("Correct keystore signer");
55+
.expect("Keystore signer should be `cast wallet` compliant");
5656
let wallet = EthereumWallet::from(signer);
5757
let rpc_provider = ProviderBuilder::new().wallet(wallet).on_http(rpc_url);
58-
let proof_aggregation_service: AlignedProofAggregationService::AlignedProofAggregationServiceInstance<(), alloy::providers::fillers::FillProvider<alloy::providers::fillers::JoinFill<alloy::providers::fillers::JoinFill<alloy::providers::Identity, alloy::providers::fillers::JoinFill<alloy::providers::fillers::GasFiller, alloy::providers::fillers::JoinFill<alloy::providers::fillers::BlobGasFiller, alloy::providers::fillers::JoinFill<alloy::providers::fillers::NonceFiller, alloy::providers::fillers::ChainIdFiller>>>>, alloy::providers::fillers::WalletFiller<EthereumWallet>>, alloy::providers::RootProvider>> = AlignedProofAggregationService::new(
58+
let proof_aggregation_service = AlignedProofAggregationService::new(
5959
Address::from_str(&config.proof_aggregation_service_address)
60-
.expect("Address to be correct"),
60+
.expect("AlignedProofAggregationService address should be valid"),
6161
rpc_provider,
6262
);
6363
let fetcher = ProofsFetcher::new(config);
@@ -207,12 +207,11 @@ impl ProofAggregator {
207207
c_kzg::KzgProof::compute_blob_kzg_proof(&blob, &commitment.to_bytes(), settings)
208208
.map_err(|_| AggregatedProofSubmissionError::BuildingBlobProof)?;
209209

210-
// convert to alloy types
211-
let blob = Blob::from_slice(&blob_data);
212-
let commitment: FixedBytes<48> = FixedBytes::from_slice(commitment.to_bytes().as_slice());
213-
let proof: FixedBytes<48> = FixedBytes::from_slice(proof.to_bytes().as_slice());
214-
215-
let blob = BlobTransactionSidecar::new(vec![blob], vec![commitment], vec![proof]);
210+
let blob = BlobTransactionSidecar::from_kzg(
211+
vec![blob],
212+
vec![commitment.to_bytes()],
213+
vec![proof.to_bytes()],
214+
);
216215
let blob_versioned_hash = blob
217216
.versioned_hash_for_blob(0)
218217
.ok_or(AggregatedProofSubmissionError::BuildingBlobVersionedHash)?

0 commit comments

Comments
 (0)