mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
Partial columns cleanup (#9321)
#8314 left a few ugly potentially panicking location behind - all of them believed to be unreachable, but this PR fixes them regardless for good hygiene. Update to `ethereum_ssz 0.10.4` for two new helpers: `not_inplace` and `clone_zeroed`. Remove remaining `expect` and `todo!` in favour of these helpers and one new fallible (but practically infallible) method. Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
This commit is contained in:
@@ -1381,16 +1381,20 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
&[&data_column_index.to_string()],
|
||||
);
|
||||
|
||||
let mut column = col.to_partial();
|
||||
let header = column.sidecar.header.take();
|
||||
if let Some(header) = header {
|
||||
self.send_network_message(NetworkMessage::PublishPartialColumns {
|
||||
columns: vec![Arc::new(column)],
|
||||
header: Arc::new(header),
|
||||
});
|
||||
} else {
|
||||
crit!("Converting from full to partial yielded headerless partial")
|
||||
};
|
||||
match col.to_partial() {
|
||||
Ok(mut column) => {
|
||||
let header = column.sidecar.header.take();
|
||||
if let Some(header) = header {
|
||||
self.send_network_message(NetworkMessage::PublishPartialColumns {
|
||||
columns: vec![Arc::new(column)],
|
||||
header: Arc::new(header),
|
||||
});
|
||||
} else {
|
||||
crit!("Converting from full to partial yielded headerless partial")
|
||||
};
|
||||
}
|
||||
Err(err) => crit!(?err, "Could not convert from full to partial"),
|
||||
}
|
||||
}
|
||||
|
||||
let result = self
|
||||
|
||||
Reference in New Issue
Block a user