-
Notifications
You must be signed in to change notification settings - Fork 784
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
check the da cache and the attester cache in responding to RPC requests #5138
Changes from all commits
66b911f
0512420
2f6cf41
0cf408f
597e05f
1be438e
d097e9b
a6144f6
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ use crate::attestation_verification::{ | |
VerifiedUnaggregatedAttestation, | ||
}; | ||
use crate::attester_cache::{AttesterCache, AttesterCacheKey}; | ||
use crate::beacon_block_streamer::{BeaconBlockStreamer, CheckEarlyAttesterCache}; | ||
use crate::beacon_block_streamer::{BeaconBlockStreamer, CheckCaches}; | ||
use crate::beacon_proposer_cache::compute_proposer_duties_from_head; | ||
use crate::beacon_proposer_cache::BeaconProposerCache; | ||
use crate::blob_verification::{GossipBlobError, GossipVerifiedBlob}; | ||
|
@@ -1131,7 +1131,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> { | |
/// ## Errors | ||
/// | ||
/// May return a database error. | ||
pub fn get_blocks_checking_early_attester_cache( | ||
pub fn get_blocks_checking_caches( | ||
self: &Arc<Self>, | ||
block_roots: Vec<Hash256>, | ||
executor: &TaskExecutor, | ||
|
@@ -1144,10 +1144,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> { | |
>, | ||
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. should probably rename this function 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. |
||
Error, | ||
> { | ||
Ok( | ||
BeaconBlockStreamer::<T>::new(self, CheckEarlyAttesterCache::Yes)? | ||
.launch_stream(block_roots, executor), | ||
) | ||
Ok(BeaconBlockStreamer::<T>::new(self, CheckCaches::Yes)? | ||
.launch_stream(block_roots, executor)) | ||
} | ||
|
||
pub fn get_blocks( | ||
|
@@ -1163,10 +1161,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> { | |
>, | ||
Error, | ||
> { | ||
Ok( | ||
BeaconBlockStreamer::<T>::new(self, CheckEarlyAttesterCache::No)? | ||
.launch_stream(block_roots, executor), | ||
) | ||
Ok(BeaconBlockStreamer::<T>::new(self, CheckCaches::No)? | ||
.launch_stream(block_roots, executor)) | ||
} | ||
|
||
pub fn get_blobs_checking_early_attester_cache( | ||
|
@@ -2960,18 +2956,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> { | |
unverified_block: B, | ||
notify_execution_layer: NotifyExecutionLayer, | ||
) -> Result<AvailabilityProcessingStatus, BlockError<T::EthSpec>> { | ||
if let Ok(commitments) = unverified_block | ||
.block() | ||
.message() | ||
.body() | ||
.blob_kzg_commitments() | ||
{ | ||
self.data_availability_checker.notify_block_commitments( | ||
unverified_block.block().slot(), | ||
block_root, | ||
commitments.clone(), | ||
); | ||
}; | ||
self.data_availability_checker | ||
.notify_block(block_root, unverified_block.block_cloned()); | ||
let r = self | ||
.process_block(block_root, unverified_block, notify_execution_layer, || { | ||
Ok(()) | ||
|
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.
nit: why not use
bool
?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.
We usually try to use enums over bools when we need to pass something into a function. If you end up with two bools as params it can be ambiguous