mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-18 20:32:45 +00:00
Add Gloas data column support (#8682)
Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>
This commit is contained in:
@@ -127,7 +127,7 @@ impl<T: BeaconChainTypes> ActiveCustodyRequest<T> {
|
||||
// requested index. The worse case is 128 loops over a 128 item vec + mutation to
|
||||
// drop the consumed columns.
|
||||
let mut data_columns = HashMap::<ColumnIndex, _>::from_iter(
|
||||
data_columns.into_iter().map(|d| (d.index, d)),
|
||||
data_columns.into_iter().map(|d| (*d.index(), d)),
|
||||
);
|
||||
// Accumulate columns that the peer does not have to issue a single log per request
|
||||
let mut missing_column_indexes = vec![];
|
||||
@@ -209,7 +209,7 @@ impl<T: BeaconChainTypes> ActiveCustodyRequest<T> {
|
||||
peers
|
||||
.entry(peer)
|
||||
.or_default()
|
||||
.push(data_column.index as usize);
|
||||
.push(*data_column.index() as usize);
|
||||
seen_timestamps.push(seen_timestamp);
|
||||
Ok(data_column)
|
||||
})
|
||||
|
||||
@@ -28,18 +28,22 @@ impl<E: EthSpec> ActiveRequestItems for DataColumnsByRangeRequestItems<E> {
|
||||
{
|
||||
return Err(LookupVerifyError::UnrequestedSlot(data_column.slot()));
|
||||
}
|
||||
if !self.request.columns.contains(&data_column.index) {
|
||||
return Err(LookupVerifyError::UnrequestedIndex(data_column.index));
|
||||
if !self.request.columns.contains(data_column.index()) {
|
||||
return Err(LookupVerifyError::UnrequestedIndex(*data_column.index()));
|
||||
}
|
||||
if !data_column.verify_inclusion_proof() {
|
||||
|
||||
if let DataColumnSidecar::Fulu(data_column) = data_column.as_ref()
|
||||
&& !data_column.verify_inclusion_proof()
|
||||
{
|
||||
return Err(LookupVerifyError::InvalidInclusionProof);
|
||||
}
|
||||
|
||||
if self.items.iter().any(|existing| {
|
||||
existing.slot() == data_column.slot() && existing.index == data_column.index
|
||||
existing.slot() == data_column.slot() && *existing.index() == *data_column.index()
|
||||
}) {
|
||||
return Err(LookupVerifyError::DuplicatedData(
|
||||
data_column.slot(),
|
||||
data_column.index,
|
||||
*data_column.index(),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -56,16 +56,24 @@ impl<E: EthSpec> ActiveRequestItems for DataColumnsByRootRequestItems<E> {
|
||||
if self.request.block_root != block_root {
|
||||
return Err(LookupVerifyError::UnrequestedBlockRoot(block_root));
|
||||
}
|
||||
if !data_column.verify_inclusion_proof() {
|
||||
|
||||
if let DataColumnSidecar::Fulu(data_column) = data_column.as_ref()
|
||||
&& !data_column.verify_inclusion_proof()
|
||||
{
|
||||
return Err(LookupVerifyError::InvalidInclusionProof);
|
||||
}
|
||||
if !self.request.indices.contains(&data_column.index) {
|
||||
return Err(LookupVerifyError::UnrequestedIndex(data_column.index));
|
||||
|
||||
if !self.request.indices.contains(data_column.index()) {
|
||||
return Err(LookupVerifyError::UnrequestedIndex(*data_column.index()));
|
||||
}
|
||||
if self.items.iter().any(|d| d.index == data_column.index) {
|
||||
if self
|
||||
.items
|
||||
.iter()
|
||||
.any(|d| *d.index() == *data_column.index())
|
||||
{
|
||||
return Err(LookupVerifyError::DuplicatedData(
|
||||
data_column.slot(),
|
||||
data_column.index,
|
||||
*data_column.index(),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user