Upgrade rust-eth-kzg to 0.8.0 (#7870)

#7864

The main breaking change in v0.8.0 is the `TrustedSetup` initialisation - it now requires a json string via `PeerDASTrustedSetup::from_json`.
This commit is contained in:
Jimmy Chen
2025-08-18 12:52:39 +10:00
committed by GitHub
parent 9200042910
commit aa8cba3741
14 changed files with 185 additions and 192 deletions

View File

@@ -2,7 +2,7 @@ use super::*;
use crate::case_result::compare_result;
use beacon_chain::kzg_utils::validate_blob;
use kzg::trusted_setup::get_trusted_setup;
use kzg::{Cell, Error as KzgError, Kzg, KzgCommitment, KzgProof, TrustedSetup};
use kzg::{Cell, Error as KzgError, Kzg, KzgCommitment, KzgProof};
use serde::Deserialize;
use std::marker::PhantomData;
use std::sync::Arc;
@@ -10,10 +10,7 @@ use std::sync::LazyLock;
use types::Blob;
static KZG: LazyLock<Arc<Kzg>> = LazyLock::new(|| {
let trusted_setup: TrustedSetup = serde_json::from_reader(get_trusted_setup().as_slice())
.map_err(|e| Error::InternalError(format!("Failed to initialize trusted setup: {:?}", e)))
.expect("failed to initialize trusted setup");
let kzg = Kzg::new_from_trusted_setup_das_enabled(trusted_setup)
let kzg = Kzg::new_from_trusted_setup(&get_trusted_setup())
.map_err(|e| Error::InternalError(format!("Failed to initialize kzg: {:?}", e)))
.expect("failed to initialize kzg");
Arc::new(kzg)

View File

@@ -46,8 +46,7 @@ fn default_client_config(network_params: LocalNetworkParams, genesis_time: u64)
beacon_config.network.discv5_config.enable_packet_filter = false;
beacon_config.chain.enable_light_client_server = true;
beacon_config.chain.optimistic_finalized_sync = false;
beacon_config.trusted_setup = serde_json::from_reader(get_trusted_setup().as_slice())
.expect("Trusted setup bytes should be valid");
beacon_config.trusted_setup = get_trusted_setup();
let el_config = execution_layer::Config {
execution_endpoint: Some(