Skip to content

Commit 37706b6

Browse files
committed
Merge remote-tracking branch 'origin/unstable' into drop-headtracker
2 parents be15847 + 578db67 commit 37706b6

Some content is hidden

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

62 files changed

+1066
-657
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ members = [
5151
"common/unused_port",
5252
"common/validator_dir",
5353
"common/warp_utils",
54+
"common/workspace_members",
5455

5556
"consensus/fixed_bytes",
5657
"consensus/fork_choice",
@@ -120,6 +121,7 @@ bincode = "1"
120121
bitvec = "1"
121122
byteorder = "1"
122123
bytes = "1"
124+
cargo_metadata = "0.19"
123125
clap = { version = "4.5.4", features = ["derive", "cargo", "wrap_help"] }
124126
# Turn off c-kzg's default features which include `blst/portable`. We can turn on blst's portable
125127
# feature ourselves when desired.
@@ -246,6 +248,7 @@ kzg = { path = "crypto/kzg" }
246248
metrics = { path = "common/metrics" }
247249
lighthouse_network = { path = "beacon_node/lighthouse_network" }
248250
lighthouse_version = { path = "common/lighthouse_version" }
251+
workspace_members = { path = "common/workspace_members" }
249252
lockfile = { path = "common/lockfile" }
250253
logging = { path = "common/logging" }
251254
lru_cache = { path = "common/lru_cache" }
@@ -278,7 +281,7 @@ validator_metrics = { path = "validator_client/validator_metrics" }
278281
validator_store = { path = "validator_client/validator_store" }
279282
validator_test_rig = { path = "testing/validator_test_rig" }
280283
warp_utils = { path = "common/warp_utils" }
281-
xdelta3 = { git = "http://github.com/sigp/xdelta3-rs", rev = "50d63cdf1878e5cf3538e9aae5eed34a22c64e4a" }
284+
xdelta3 = { git = "http://github.com/sigp/xdelta3-rs", rev = "4db64086bb02e9febb584ba93b9d16bb2ae3825a" }
282285
zstd = "0.13"
283286

284287
[profile.maxperf]

beacon_node/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "beacon_node"
3-
version = "7.0.0-beta.4"
3+
version = "7.0.0-beta.5"
44
authors = [
55
"Paul Hauner <paul@paulhauner.com>",
66
"Age Manning <Age@AgeManning.com",

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2983,6 +2983,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
29832983
pub async fn verify_block_for_gossip(
29842984
self: &Arc<Self>,
29852985
block: Arc<SignedBeaconBlock<T::EthSpec>>,
2986+
custody_columns_count: usize,
29862987
) -> Result<GossipVerifiedBlock<T>, BlockError> {
29872988
let chain = self.clone();
29882989
self.task_executor
@@ -2992,7 +2993,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
29922993
let slot = block.slot();
29932994
let graffiti_string = block.message().body().graffiti().as_utf8_lossy();
29942995

2995-
match GossipVerifiedBlock::new(block, &chain) {
2996+
match GossipVerifiedBlock::new(block, &chain, custody_columns_count) {
29962997
Ok(verified) => {
29972998
let commitments_formatted = verified.block.commitments_formatted();
29982999
debug!(
@@ -7099,10 +7100,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
70997100
block_root: Hash256,
71007101
block_data: AvailableBlockData<T::EthSpec>,
71017102
) -> Result<Option<StoreOp<T::EthSpec>>, String> {
7102-
// TODO(das) we currently store all subnet sampled columns. Tracking issue to exclude non
7103-
// custody columns: https://github.com/sigp/lighthouse/issues/6465
7104-
let _custody_columns_count = self.data_availability_checker.get_sampling_column_count();
7105-
71067103
match block_data {
71077104
AvailableBlockData::NoData => Ok(None),
71087105
AvailableBlockData::Blobs(blobs) => {

beacon_node/beacon_chain/src/block_verification.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ pub struct GossipVerifiedBlock<T: BeaconChainTypes> {
683683
pub block_root: Hash256,
684684
parent: Option<PreProcessingSnapshot<T::EthSpec>>,
685685
consensus_context: ConsensusContext<T::EthSpec>,
686+
custody_columns_count: usize,
686687
}
687688

688689
/// A wrapper around a `SignedBeaconBlock` that indicates that all signatures (except the deposit
@@ -718,6 +719,7 @@ pub trait IntoGossipVerifiedBlock<T: BeaconChainTypes>: Sized {
718719
fn into_gossip_verified_block(
719720
self,
720721
chain: &BeaconChain<T>,
722+
custody_columns_count: usize,
721723
) -> Result<GossipVerifiedBlock<T>, BlockError>;
722724
fn inner_block(&self) -> Arc<SignedBeaconBlock<T::EthSpec>>;
723725
}
@@ -726,6 +728,7 @@ impl<T: BeaconChainTypes> IntoGossipVerifiedBlock<T> for GossipVerifiedBlock<T>
726728
fn into_gossip_verified_block(
727729
self,
728730
_chain: &BeaconChain<T>,
731+
_custody_columns_count: usize,
729732
) -> Result<GossipVerifiedBlock<T>, BlockError> {
730733
Ok(self)
731734
}
@@ -738,8 +741,9 @@ impl<T: BeaconChainTypes> IntoGossipVerifiedBlock<T> for Arc<SignedBeaconBlock<T
738741
fn into_gossip_verified_block(
739742
self,
740743
chain: &BeaconChain<T>,
744+
custody_columns_count: usize,
741745
) -> Result<GossipVerifiedBlock<T>, BlockError> {
742-
GossipVerifiedBlock::new(self, chain)
746+
GossipVerifiedBlock::new(self, chain, custody_columns_count)
743747
}
744748

745749
fn inner_block(&self) -> Arc<SignedBeaconBlock<T::EthSpec>> {
@@ -808,6 +812,7 @@ impl<T: BeaconChainTypes> GossipVerifiedBlock<T> {
808812
pub fn new(
809813
block: Arc<SignedBeaconBlock<T::EthSpec>>,
810814
chain: &BeaconChain<T>,
815+
custody_columns_count: usize,
811816
) -> Result<Self, BlockError> {
812817
// If the block is valid for gossip we don't supply it to the slasher here because
813818
// we assume it will be transformed into a fully verified block. We *do* need to supply
@@ -817,19 +822,22 @@ impl<T: BeaconChainTypes> GossipVerifiedBlock<T> {
817822
// The `SignedBeaconBlock` and `SignedBeaconBlockHeader` have the same canonical root,
818823
// but it's way quicker to calculate root of the header since the hash of the tree rooted
819824
// at `BeaconBlockBody` is already computed in the header.
820-
Self::new_without_slasher_checks(block, &header, chain).map_err(|e| {
821-
process_block_slash_info::<_, BlockError>(
822-
chain,
823-
BlockSlashInfo::from_early_error_block(header, e),
824-
)
825-
})
825+
Self::new_without_slasher_checks(block, &header, chain, custody_columns_count).map_err(
826+
|e| {
827+
process_block_slash_info::<_, BlockError>(
828+
chain,
829+
BlockSlashInfo::from_early_error_block(header, e),
830+
)
831+
},
832+
)
826833
}
827834

828835
/// As for new, but doesn't pass the block to the slasher.
829836
fn new_without_slasher_checks(
830837
block: Arc<SignedBeaconBlock<T::EthSpec>>,
831838
block_header: &SignedBeaconBlockHeader,
832839
chain: &BeaconChain<T>,
840+
custody_columns_count: usize,
833841
) -> Result<Self, BlockError> {
834842
// Ensure the block is the correct structure for the fork at `block.slot()`.
835843
block
@@ -1036,6 +1044,7 @@ impl<T: BeaconChainTypes> GossipVerifiedBlock<T> {
10361044
block_root,
10371045
parent,
10381046
consensus_context,
1047+
custody_columns_count,
10391048
})
10401049
}
10411050

@@ -1183,6 +1192,7 @@ impl<T: BeaconChainTypes> SignatureVerifiedBlock<T> {
11831192
block: MaybeAvailableBlock::AvailabilityPending {
11841193
block_root: from.block_root,
11851194
block,
1195+
custody_columns_count: from.custody_columns_count,
11861196
},
11871197
block_root: from.block_root,
11881198
parent: Some(parent),

beacon_node/beacon_chain/src/block_verification_types.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use types::{
3131
pub struct RpcBlock<E: EthSpec> {
3232
block_root: Hash256,
3333
block: RpcBlockInner<E>,
34+
custody_columns_count: usize,
3435
}
3536

3637
impl<E: EthSpec> Debug for RpcBlock<E> {
@@ -44,6 +45,10 @@ impl<E: EthSpec> RpcBlock<E> {
4445
self.block_root
4546
}
4647

48+
pub fn custody_columns_count(&self) -> usize {
49+
self.custody_columns_count
50+
}
51+
4752
pub fn as_block(&self) -> &SignedBeaconBlock<E> {
4853
match &self.block {
4954
RpcBlockInner::Block(block) => block,
@@ -104,6 +109,8 @@ impl<E: EthSpec> RpcBlock<E> {
104109
Self {
105110
block_root,
106111
block: RpcBlockInner::Block(block),
112+
// Block has zero columns
113+
custody_columns_count: 0,
107114
}
108115
}
109116

@@ -145,13 +152,16 @@ impl<E: EthSpec> RpcBlock<E> {
145152
Ok(Self {
146153
block_root,
147154
block: inner,
155+
// Block is before PeerDAS
156+
custody_columns_count: 0,
148157
})
149158
}
150159

151160
pub fn new_with_custody_columns(
152161
block_root: Option<Hash256>,
153162
block: Arc<SignedBeaconBlock<E>>,
154163
custody_columns: Vec<CustodyDataColumn<E>>,
164+
custody_columns_count: usize,
155165
spec: &ChainSpec,
156166
) -> Result<Self, AvailabilityCheckError> {
157167
let block_root = block_root.unwrap_or_else(|| get_block_root(&block));
@@ -172,6 +182,7 @@ impl<E: EthSpec> RpcBlock<E> {
172182
Ok(Self {
173183
block_root,
174184
block: inner,
185+
custody_columns_count,
175186
})
176187
}
177188

@@ -239,10 +250,12 @@ impl<E: EthSpec> ExecutedBlock<E> {
239250
MaybeAvailableBlock::AvailabilityPending {
240251
block_root: _,
241252
block: pending_block,
253+
custody_columns_count,
242254
} => Self::AvailabilityPending(AvailabilityPendingExecutedBlock::new(
243255
pending_block,
244256
import_data,
245257
payload_verification_outcome,
258+
custody_columns_count,
246259
)),
247260
}
248261
}
@@ -308,18 +321,21 @@ pub struct AvailabilityPendingExecutedBlock<E: EthSpec> {
308321
pub block: Arc<SignedBeaconBlock<E>>,
309322
pub import_data: BlockImportData<E>,
310323
pub payload_verification_outcome: PayloadVerificationOutcome,
324+
pub custody_columns_count: usize,
311325
}
312326

313327
impl<E: EthSpec> AvailabilityPendingExecutedBlock<E> {
314328
pub fn new(
315329
block: Arc<SignedBeaconBlock<E>>,
316330
import_data: BlockImportData<E>,
317331
payload_verification_outcome: PayloadVerificationOutcome,
332+
custody_columns_count: usize,
318333
) -> Self {
319334
Self {
320335
block,
321336
import_data,
322337
payload_verification_outcome,
338+
custody_columns_count,
323339
}
324340
}
325341

@@ -437,19 +453,13 @@ impl<E: EthSpec> AsBlock<E> for MaybeAvailableBlock<E> {
437453
fn as_block(&self) -> &SignedBeaconBlock<E> {
438454
match &self {
439455
MaybeAvailableBlock::Available(block) => block.as_block(),
440-
MaybeAvailableBlock::AvailabilityPending {
441-
block_root: _,
442-
block,
443-
} => block,
456+
MaybeAvailableBlock::AvailabilityPending { block, .. } => block,
444457
}
445458
}
446459
fn block_cloned(&self) -> Arc<SignedBeaconBlock<E>> {
447460
match &self {
448461
MaybeAvailableBlock::Available(block) => block.block_cloned(),
449-
MaybeAvailableBlock::AvailabilityPending {
450-
block_root: _,
451-
block,
452-
} => block.clone(),
462+
MaybeAvailableBlock::AvailabilityPending { block, .. } => block.clone(),
453463
}
454464
}
455465
fn canonical_root(&self) -> Hash256 {

0 commit comments

Comments
 (0)