-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove DataAvailabilityView trait from ChildComponents #5421
Changes from all commits
8c914c9
a6c4c09
2211634
0249408
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
use super::child_components::ChildComponents; | ||
use super::state_lru_cache::DietAvailabilityPendingExecutedBlock; | ||
use crate::blob_verification::KzgVerifiedBlob; | ||
use crate::block_verification_types::AsBlock; | ||
|
@@ -195,14 +194,6 @@ impl_availability_view!( | |
verified_blobs | ||
); | ||
|
||
impl_availability_view!( | ||
ChildComponents, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, looks like we may want to convert the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes and we should be able to get rid of the |
||
Arc<SignedBeaconBlock<E>>, | ||
Arc<BlobSidecar<E>>, | ||
downloaded_block, | ||
downloaded_blobs | ||
); | ||
|
||
pub trait GetCommitments<E: EthSpec> { | ||
fn get_commitments(&self) -> KzgCommitments<E>; | ||
} | ||
|
@@ -381,23 +372,6 @@ pub mod tests { | |
(block.into(), blobs, invalid_blobs) | ||
} | ||
|
||
type ChildComponentsSetup<E> = ( | ||
Arc<SignedBeaconBlock<E>>, | ||
FixedVector<Option<Arc<BlobSidecar<E>>>, <E as EthSpec>::MaxBlobsPerBlock>, | ||
FixedVector<Option<Arc<BlobSidecar<E>>>, <E as EthSpec>::MaxBlobsPerBlock>, | ||
); | ||
|
||
pub fn setup_child_components( | ||
block: SignedBeaconBlock<E>, | ||
valid_blobs: FixedVector<Option<Arc<BlobSidecar<E>>>, <E as EthSpec>::MaxBlobsPerBlock>, | ||
invalid_blobs: FixedVector<Option<Arc<BlobSidecar<E>>>, <E as EthSpec>::MaxBlobsPerBlock>, | ||
) -> ChildComponentsSetup<E> { | ||
let blobs = FixedVector::from(valid_blobs.into_iter().cloned().collect::<Vec<_>>()); | ||
let invalid_blobs = | ||
FixedVector::from(invalid_blobs.into_iter().cloned().collect::<Vec<_>>()); | ||
(Arc::new(block), blobs, invalid_blobs) | ||
} | ||
|
||
pub fn assert_cache_consistent<V: AvailabilityView<E>>(cache: V) { | ||
if let Some(cached_block) = cache.get_cached_block() { | ||
let cached_block_commitments = cached_block.get_commitments(); | ||
|
@@ -530,11 +504,4 @@ pub mod tests { | |
verified_blobs, | ||
setup_pending_components | ||
); | ||
generate_tests!( | ||
child_component_tests, | ||
ChildComponents::<E>, | ||
downloaded_block, | ||
downloaded_blobs, | ||
setup_child_components | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gossip blobs check the inclusion proof, with this PR also RPC blobs. So this case can not happen anymore.