mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-15 09:48:20 +00:00
Refactor
This commit is contained in:
@@ -1055,7 +1055,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
);
|
||||
|
||||
// If a block is in the da_checker, sync maybe awaiting for an event when block is finally
|
||||
// imported. A block can become imported both after processing a block or data column. If
|
||||
// imported. A block can become imported both after processing a block or data column. If
|
||||
// importing a block results in `Imported`, notify. Do not notify of data column errors.
|
||||
self.send_sync_message(SyncMessage::GossipBlockProcessResult {
|
||||
block_root,
|
||||
|
||||
@@ -306,7 +306,6 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
let block_root = blob_id.block_root;
|
||||
self.chain
|
||||
.data_availability_checker
|
||||
.v1()
|
||||
.get_cached_block(&block_root)
|
||||
.and_then(|status| match status {
|
||||
BlockProcessStatus::NotValidated(block, _source) => Some(block),
|
||||
@@ -334,7 +333,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
}
|
||||
|
||||
// First attempt to get the blobs from the RPC cache.
|
||||
if let Ok(Some(blob)) = self.chain.data_availability_checker.v1().get_blob(id) {
|
||||
if let Ok(Some(blob)) = self.chain.data_availability_checker.get_blob(id) {
|
||||
self.send_response(
|
||||
peer_id,
|
||||
inbound_request_id,
|
||||
|
||||
@@ -739,7 +739,6 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
match self
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.v1()
|
||||
.batch_verify_kzg_for_available_blocks(&available_blocks)
|
||||
{
|
||||
Ok(()) => {}
|
||||
|
||||
@@ -490,7 +490,6 @@ mod tests {
|
||||
|
||||
use super::RangeBlockComponentsRequest;
|
||||
use beacon_chain::custody_context::NodeCustodyType;
|
||||
use beacon_chain::data_availability_router::AvailabilityCache;
|
||||
use beacon_chain::test_utils::{
|
||||
NumBlobs, generate_rand_block_and_blobs, generate_rand_block_and_data_columns,
|
||||
test_da_checker, test_spec,
|
||||
|
||||
@@ -967,7 +967,6 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
|
||||
let imported_blob_indexes = self
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.v1()
|
||||
.cached_blob_indexes(&block_root)
|
||||
.unwrap_or_default();
|
||||
// Include only the blob indexes not yet imported (received through gossip)
|
||||
@@ -1371,14 +1370,12 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
|
||||
if self
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.v1()
|
||||
.data_columns_required_for_epoch(epoch)
|
||||
{
|
||||
ByRangeRequestType::BlocksAndColumns
|
||||
} else if self
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.v1()
|
||||
.blobs_required_for_epoch(epoch)
|
||||
{
|
||||
ByRangeRequestType::BlocksAndBlobs
|
||||
|
||||
@@ -1082,7 +1082,6 @@ impl TestRig {
|
||||
.harness
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.v1()
|
||||
.put_executed_block(executed_block)
|
||||
.unwrap()
|
||||
{
|
||||
@@ -1098,7 +1097,6 @@ impl TestRig {
|
||||
.harness
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.v1()
|
||||
.put_gossip_verified_blobs(
|
||||
blob.block_root(),
|
||||
std::iter::once(GossipVerifiedBlob::<_, Observe>::__assumed_valid(
|
||||
@@ -1118,7 +1116,6 @@ impl TestRig {
|
||||
self.harness
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.v1()
|
||||
.put_pre_execution_block(block.canonical_root(), block, BlockImportSource::Gossip)
|
||||
.unwrap();
|
||||
}
|
||||
@@ -1127,7 +1124,6 @@ impl TestRig {
|
||||
self.harness
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.v1()
|
||||
.remove_block_on_execution_error(&block_root);
|
||||
|
||||
self.send_sync_message(SyncMessage::GossipBlockProcessResult {
|
||||
|
||||
Reference in New Issue
Block a user