some bug fixes and the start of deneb only tests

This commit is contained in:
realbigsean
2023-04-28 15:56:54 -04:00
parent bfb5242ee3
commit 93bcd6281c
5 changed files with 823 additions and 51 deletions

View File

@@ -147,10 +147,12 @@ impl<T: EthSpec, S: SlotClock> DataAvailabilityChecker<T, S> {
self.availability_cache self.availability_cache
.read() .read()
.get(block_root) .get(block_root)
.map_or(vec![], |cache| { .and_then(|cache| {
if let Some(block) = cache.executed_block.as_ref() { cache.executed_block.as_ref().map(|block| {
block.get_filtered_blob_ids(|i, _| cache.verified_blobs.get(i).is_none()) block.get_filtered_blob_ids(|i, _| cache.verified_blobs.get(i).is_none())
} else { })
})
.unwrap_or_else(|| {
let mut blob_ids = Vec::with_capacity(T::max_blobs_per_block()); let mut blob_ids = Vec::with_capacity(T::max_blobs_per_block());
for i in 0..T::max_blobs_per_block() { for i in 0..T::max_blobs_per_block() {
blob_ids.push(BlobIdentifier { blob_ids.push(BlobIdentifier {
@@ -159,7 +161,6 @@ impl<T: EthSpec, S: SlotClock> DataAvailabilityChecker<T, S> {
}); });
} }
blob_ids blob_ids
}
}) })
} else { } else {
vec![] vec![]

View File

@@ -51,4 +51,5 @@ execution_layer = { path = "../execution_layer" }
[features] [features]
deterministic_long_lived_attnets = [ "ethereum-types" ] deterministic_long_lived_attnets = [ "ethereum-types" ]
spec-minimal = ["beacon_chain/spec-minimal"] spec-minimal = ["beacon_chain/spec-minimal"]
fork_from_env = ["beacon_chain/fork_from_env"]
# default = ["deterministic_long_lived_attnets"] # default = ["deterministic_long_lived_attnets"]

View File

@@ -521,9 +521,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
self.search_block(block_root, peer_id, PeerShouldHave::BlockAndBlobs, cx); self.search_block(block_root, peer_id, PeerShouldHave::BlockAndBlobs, cx);
self.parent_lookups.push(parent_lookup) self.parent_lookups.push(parent_lookup)
} }
Err(e) => { Err(e) => {}
}
} }
} }
Ok(None) => { Ok(None) => {

View File

@@ -242,7 +242,7 @@ impl<const MAX_ATTEMPTS: u8, T: BeaconChainTypes> SingleBlockLookup<MAX_ATTEMPTS
&mut self, &mut self,
blob: Option<Arc<BlobSidecar<T::EthSpec>>>, blob: Option<Arc<BlobSidecar<T::EthSpec>>>,
) -> Result<Option<RootBlobsTuple<T::EthSpec>>, LookupVerifyError> { ) -> Result<Option<RootBlobsTuple<T::EthSpec>>, LookupVerifyError> {
match self.block_request_state.state { match self.blob_request_state.state {
State::AwaitingDownload => { State::AwaitingDownload => {
self.blob_request_state.register_failure_downloading(); self.blob_request_state.register_failure_downloading();
Err(LookupVerifyError::ExtraBlobsReturned) Err(LookupVerifyError::ExtraBlobsReturned)
@@ -277,6 +277,7 @@ impl<const MAX_ATTEMPTS: u8, T: BeaconChainTypes> SingleBlockLookup<MAX_ATTEMPTS
}, },
State::Processing { peer_id: _ } => match blob { State::Processing { peer_id: _ } => match blob {
Some(_) => { Some(_) => {
dbg!("here");
// We sent the blob for processing and received an extra blob. // We sent the blob for processing and received an extra blob.
self.blob_request_state.register_failure_downloading(); self.blob_request_state.register_failure_downloading();
Err(LookupVerifyError::ExtraBlobsReturned) Err(LookupVerifyError::ExtraBlobsReturned)
@@ -350,8 +351,9 @@ impl<const MAX_ATTEMPTS: u8, T: BeaconChainTypes> SingleBlockLookup<MAX_ATTEMPTS
.choose(&mut rand::thread_rng()) .choose(&mut rand::thread_rng())
{ {
let request = BlobsByRootRequest { let request = BlobsByRootRequest {
blob_ids: VariableList::from(missing_ids), blob_ids: VariableList::from(missing_ids.clone()),
}; };
self.requested_ids = missing_ids;
self.blob_request_state.state = State::Downloading { peer_id }; self.blob_request_state.state = State::Downloading { peer_id };
self.blob_request_state.used_peers.insert(peer_id); self.blob_request_state.used_peers.insert(peer_id);
Ok(Some((peer_id, request))) Ok(Some((peer_id, request)))

File diff suppressed because it is too large Load Diff