Skip to content

Commit 8263ada

Browse files
Merge branch 'unstable' into blob-backfill
2 parents 3de41b3 + 10e72df commit 8263ada

File tree

59 files changed

+1418
-811
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1418
-811
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ node_test_rig = { path = "testing/node_test_rig" }
198198
num_cpus = "1"
199199
once_cell = "1.17.1"
200200
opentelemetry = "0.30.0"
201-
opentelemetry-otlp = { version = "0.30.0", features = ["grpc-tonic"] }
201+
opentelemetry-otlp = { version = "0.30.0", features = ["grpc-tonic", "tls-roots"] }
202202
opentelemetry_sdk = "0.30.0"
203203
operation_pool = { path = "beacon_node/operation_pool" }
204204
parking_lot = "0.12"
@@ -223,7 +223,7 @@ reqwest = { version = "0.11", default-features = false, features = [
223223
ring = "0.17"
224224
rpds = "0.11"
225225
rusqlite = { version = "0.28", features = ["bundled"] }
226-
rust_eth_kzg = "0.8.0"
226+
rust_eth_kzg = "0.9.0"
227227
safe_arith = { path = "consensus/safe_arith" }
228228
sensitive_url = { path = "common/sensitive_url" }
229229
serde = { version = "1", features = ["derive"] }

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3059,6 +3059,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
30593059

30603060
/// Cache the data columns in the processing cache, process it, then evict it from the cache if it was
30613061
/// imported or errors.
3062+
#[instrument(skip_all, level = "debug")]
30623063
pub async fn process_gossip_data_columns(
30633064
self: &Arc<Self>,
30643065
data_columns: Vec<GossipVerifiedDataColumn<T>>,
@@ -3814,19 +3815,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
38143815
.await??
38153816
};
38163817

3817-
// Remove block components from da_checker AFTER completing block import. Then we can assert
3818-
// the following invariant:
3819-
// > A valid unfinalized block is either in fork-choice or da_checker.
3820-
//
3821-
// If we remove the block when it becomes available, there's some time window during
3822-
// `import_block` where the block is nowhere. Consumers of the da_checker can handle the
3823-
// extend time a block may exist in the da_checker.
3824-
//
3825-
// If `import_block` errors (only errors with internal errors), the pending components will
3826-
// be pruned on data_availability_checker maintenance as finality advances.
3827-
self.data_availability_checker
3828-
.remove_pending_components(block_root);
3829-
38303818
Ok(AvailabilityProcessingStatus::Imported(block_root))
38313819
}
38323820

beacon_node/beacon_chain/src/beacon_fork_choice_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ where
377377
.store
378378
.get_hot_state(&self.justified_state_root, update_cache)
379379
.map_err(Error::FailedToReadState)?
380-
.ok_or_else(|| Error::MissingState(self.justified_state_root))?;
380+
.ok_or(Error::MissingState(self.justified_state_root))?;
381381

382382
self.justified_balances = JustifiedBalances::from_justified_state(&state)?;
383383
}

beacon_node/beacon_chain/src/data_availability_checker.rs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ mod state_lru_cache;
2929

3030
use crate::data_column_verification::{
3131
CustodyDataColumn, GossipVerifiedDataColumn, KzgVerifiedCustodyDataColumn,
32-
KzgVerifiedDataColumn, verify_kzg_for_data_column_list_with_scoring,
32+
KzgVerifiedDataColumn, verify_kzg_for_data_column_list,
3333
};
3434
use crate::metrics::{
3535
KZG_DATA_COLUMN_RECONSTRUCTION_ATTEMPTS, KZG_DATA_COLUMN_RECONSTRUCTION_FAILURES,
@@ -38,19 +38,18 @@ use crate::observed_data_sidecars::ObservationStrategy;
3838
pub use error::{Error as AvailabilityCheckError, ErrorCategory as AvailabilityCheckErrorCategory};
3939
use types::non_zero_usize::new_non_zero_usize;
4040

41-
/// The LRU Cache stores `PendingComponents`, which can store up to `MAX_BLOBS_PER_BLOCK` blobs each.
41+
/// The LRU Cache stores `PendingComponents`, which store block and its associated blob data:
4242
///
4343
/// * Deneb blobs are 128 kb each and are stored in the form of `BlobSidecar`.
4444
/// * From Fulu (PeerDAS), blobs are erasure-coded and are 256 kb each, stored in the form of 128 `DataColumnSidecar`s.
4545
///
4646
/// With `MAX_BLOBS_PER_BLOCK` = 48 (expected in the next year), the maximum size of data columns
47-
/// in `PendingComponents` is ~12.29 MB. Setting this to 64 means the maximum size of the cache is
48-
/// approximately 0.8 GB.
47+
/// in `PendingComponents` is ~12.29 MB. Setting this to 32 means the maximum size of the cache is
48+
/// approximately 0.4 GB.
4949
///
50-
/// Under normal conditions, the cache should only store the current pending block, but could
51-
/// occasionally spike to 2-4 for various reasons e.g. components arriving late, but would very
52-
/// rarely go above this, unless there are many concurrent forks.
53-
pub const OVERFLOW_LRU_CAPACITY: NonZeroUsize = new_non_zero_usize(64);
50+
/// `PendingComponents` are now never removed from the cache manually are only removed via LRU
51+
/// eviction to prevent race conditions (#7961), so we expect this cache to be full all the time.
52+
pub const OVERFLOW_LRU_CAPACITY: NonZeroUsize = new_non_zero_usize(32);
5453
pub const STATE_LRU_CAPACITY_NON_ZERO: NonZeroUsize = new_non_zero_usize(32);
5554
pub const STATE_LRU_CAPACITY: usize = STATE_LRU_CAPACITY_NON_ZERO.get();
5655

@@ -349,11 +348,6 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
349348
.put_pending_executed_block(executed_block)
350349
}
351350

352-
pub fn remove_pending_components(&self, block_root: Hash256) {
353-
self.availability_cache
354-
.remove_pending_components(block_root)
355-
}
356-
357351
/// Verifies kzg commitments for an RpcBlock, returns a `MaybeAvailableBlock` that may
358352
/// include the fully available block.
359353
///
@@ -381,7 +375,7 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
381375
}
382376
if self.data_columns_required_for_block(&block) {
383377
return if let Some(data_column_list) = data_columns.as_ref() {
384-
verify_kzg_for_data_column_list_with_scoring(
378+
verify_kzg_for_data_column_list(
385379
data_column_list
386380
.iter()
387381
.map(|custody_column| custody_column.as_data_column()),
@@ -452,7 +446,7 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
452446
// verify kzg for all data columns at once
453447
if !all_data_columns.is_empty() {
454448
// Attributes fault to the specific peer that sent an invalid column
455-
verify_kzg_for_data_column_list_with_scoring(all_data_columns.iter(), &self.kzg)
449+
verify_kzg_for_data_column_list(all_data_columns.iter(), &self.kzg)
456450
.map_err(AvailabilityCheckError::InvalidColumn)?;
457451
}
458452

@@ -598,8 +592,8 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
598592

599593
// Check indices from cache again to make sure we don't publish components we've already received.
600594
let Some(existing_column_indices) = self.cached_data_column_indexes(block_root) else {
601-
return Ok(DataColumnReconstructionResult::RecoveredColumnsNotImported(
602-
"block already imported",
595+
return Err(AvailabilityCheckError::Unexpected(
596+
"block no longer exists in the data availability checker".to_string(),
603597
));
604598
};
605599

beacon_node/beacon_chain/src/data_availability_checker/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use types::{BeaconStateError, ColumnIndex, Hash256};
44
#[derive(Debug)]
55
pub enum Error {
66
InvalidBlobs(KzgError),
7-
InvalidColumn(Vec<(ColumnIndex, KzgError)>),
7+
InvalidColumn((Option<ColumnIndex>, KzgError)),
88
ReconstructColumnsError(KzgError),
99
KzgCommitmentMismatch {
1010
blob_commitment: KzgCommitment,

0 commit comments

Comments
 (0)