mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Make BeaconChain::kzg field mandatory (#6267)
* make kzg field required * update todo * always load trusted setup WIP * fmt * use new rust_eth_kzg version * merge conlficts * add kzg fn with trusted setup disabled * as_slice * add kzg with no precomp * ignore udep for kzg * refactor kzg init * fix peerdas kzg schedule * fix * udeps * uuuudeps * merge conflict resolved * merge conflict * merge conflicts * resolve TODO * update * move kzg to a test util fn * remove trusted setup default impl * lint fmt * fix failing test * lint * fix test * Merge branch 'unstable' into beacon-chain-kzg-field-required
This commit is contained in:
@@ -8,10 +8,13 @@ edition = { workspace = true }
|
||||
sloggers = { workspace = true }
|
||||
genesis = { workspace = true }
|
||||
matches = "0.1.8"
|
||||
serde_json = { workspace = true }
|
||||
slog-term = { workspace = true }
|
||||
slog-async = { workspace = true }
|
||||
eth2 = { workspace = true }
|
||||
gossipsub = { workspace = true }
|
||||
eth2_network_config = { workspace = true }
|
||||
kzg = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
alloy-primitives = { workspace = true }
|
||||
|
||||
@@ -696,8 +696,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
column_sidecar,
|
||||
));
|
||||
}
|
||||
GossipDataColumnError::KzgNotInitialized
|
||||
| GossipDataColumnError::PubkeyCacheTimeout
|
||||
GossipDataColumnError::PubkeyCacheTimeout
|
||||
| GossipDataColumnError::BeaconChainError(_) => {
|
||||
crit!(
|
||||
self.log,
|
||||
@@ -839,9 +838,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
blob_sidecar,
|
||||
));
|
||||
}
|
||||
GossipBlobError::KzgNotInitialized
|
||||
| GossipBlobError::PubkeyCacheTimeout
|
||||
| GossipBlobError::BeaconChainError(_) => {
|
||||
GossipBlobError::PubkeyCacheTimeout | GossipBlobError::BeaconChainError(_) => {
|
||||
crit!(
|
||||
self.log,
|
||||
"Internal error when verifying blob sidecar";
|
||||
|
||||
@@ -385,8 +385,8 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
data_columns: Vec<Arc<DataColumnSidecar<T::EthSpec>>>,
|
||||
_seen_timestamp: Duration,
|
||||
) -> Result<(), String> {
|
||||
let kzg = self.chain.kzg.as_ref().ok_or("Kzg not initialized")?;
|
||||
verify_kzg_for_data_column_list(data_columns.iter(), kzg).map_err(|err| format!("{err:?}"))
|
||||
verify_kzg_for_data_column_list(data_columns.iter(), &self.chain.kzg)
|
||||
.map_err(|err| format!("{err:?}"))
|
||||
}
|
||||
|
||||
/// Process a sampling completed event, inserting it into fork-choice
|
||||
@@ -561,8 +561,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
Err(e) => match e {
|
||||
AvailabilityCheckError::StoreError(_)
|
||||
| AvailabilityCheckError::KzgNotInitialized => {
|
||||
AvailabilityCheckError::StoreError(_) => {
|
||||
return (
|
||||
0,
|
||||
Err(ChainSegmentFailed {
|
||||
|
||||
@@ -2,6 +2,7 @@ use super::*;
|
||||
use beacon_chain::{
|
||||
builder::{BeaconChainBuilder, Witness},
|
||||
eth1_chain::CachingEth1Backend,
|
||||
test_utils::get_kzg,
|
||||
BeaconChain,
|
||||
};
|
||||
use futures::prelude::*;
|
||||
@@ -45,12 +46,14 @@ impl TestBeaconChain {
|
||||
let store =
|
||||
HotColdDB::open_ephemeral(StoreConfig::default(), spec.clone(), log.clone()).unwrap();
|
||||
|
||||
let kzg = get_kzg(&spec);
|
||||
|
||||
let (shutdown_tx, _) = futures::channel::mpsc::channel(1);
|
||||
|
||||
let test_runtime = TestRuntime::default();
|
||||
|
||||
let chain = Arc::new(
|
||||
BeaconChainBuilder::new(MainnetEthSpec)
|
||||
BeaconChainBuilder::new(MainnetEthSpec, kzg.clone())
|
||||
.logger(log.clone())
|
||||
.custom_spec(spec.clone())
|
||||
.store(Arc::new(store))
|
||||
|
||||
Reference in New Issue
Block a user