-
Notifications
You must be signed in to change notification settings - Fork 737
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
Resolve some PeerDAS todos #6434
Open
dapplion
wants to merge
1
commit into
sigp:unstable
Choose a base branch
from
dapplion:resolve-sampling-todos
base: unstable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -804,7 +804,6 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> { | |
self.log.clone(), | ||
); | ||
|
||
// TODO(das): start request | ||
// Note that you can only send, but not handle a response here | ||
match request.continue_requests(self) { | ||
Ok(_) => { | ||
|
@@ -814,7 +813,6 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> { | |
self.custody_by_root_requests.insert(requester, request); | ||
Ok(LookupRequestResult::RequestSent(req_id)) | ||
} | ||
// TODO(das): handle this error properly | ||
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. This refers to the fact that custody request errors are "nested" but it's okay. So far they are okay to debug |
||
Err(e) => Err(RpcRequestSendError::CustodyRequestError(e)), | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ pub type SamplingResult = Result<(), SamplingError>; | |
type DataColumnSidecarList<E> = Vec<Arc<DataColumnSidecar<E>>>; | ||
|
||
pub struct Sampling<T: BeaconChainTypes> { | ||
// TODO(das): stalled sampling request are never cleaned up | ||
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. Request can't go stale |
||
requests: HashMap<SamplingRequester, ActiveSamplingRequest<T>>, | ||
sampling_config: SamplingConfig, | ||
log: slog::Logger, | ||
|
@@ -268,9 +267,9 @@ impl<T: BeaconChainTypes> ActiveSamplingRequest<T> { | |
.iter() | ||
.position(|data| &data.index == column_index) | ||
else { | ||
// Peer does not have the requested data. | ||
// TODO(das) what to do? | ||
debug!(self.log, "Sampling peer claims to not have the data"; "block_root" => %self.block_root, "column_index" => column_index); | ||
// Peer does not have the requested data, mark peer as "dont have" and try | ||
// again with a different peer. | ||
debug!(self.log, "Custody peer claims to not have the data"; "block_root" => %self.block_root, "column_index" => column_index); | ||
request.on_sampling_error()?; | ||
continue; | ||
}; | ||
|
@@ -315,7 +314,9 @@ impl<T: BeaconChainTypes> ActiveSamplingRequest<T> { | |
sampling_request_id, | ||
}, | ||
) { | ||
// TODO(das): Beacon processor is overloaded, what should we do? | ||
// Beacon processor is overloaded, drop sampling attempt. Failing to sample | ||
// is not a permanent state so we should recover once the node has capacity | ||
// and receives a descendant block. | ||
error!(self.log, "Dropping sampling"; "block" => %self.block_root, "reason" => e.to_string()); | ||
return Err(SamplingError::SendFailed("beacon processor send failure")); | ||
} | ||
|
@@ -325,8 +326,8 @@ impl<T: BeaconChainTypes> ActiveSamplingRequest<T> { | |
debug!(self.log, "Sample download error"; "block_root" => %self.block_root, "column_indexes" => ?column_indexes, "error" => ?err); | ||
metrics::inc_counter_vec(&metrics::SAMPLE_DOWNLOAD_RESULT, &[metrics::FAILURE]); | ||
|
||
// Error downloading, maybe penalize peer and retry again. | ||
// TODO(das) with different peer or different peer? | ||
// Error downloading, malicious network errors are already penalized before | ||
// reaching this function. Mark the peer as failed and try again with another. | ||
for column_index in column_indexes { | ||
let Some(request) = self.column_requests.get_mut(column_index) else { | ||
warn!( | ||
|
@@ -386,7 +387,7 @@ impl<T: BeaconChainTypes> ActiveSamplingRequest<T> { | |
debug!(self.log, "Sample verification failure"; "block_root" => %self.block_root, "column_indexes" => ?column_indexes, "reason" => ?err); | ||
metrics::inc_counter_vec(&metrics::SAMPLE_VERIFY_RESULT, &[metrics::FAILURE]); | ||
|
||
// TODO(das): Peer sent invalid data, penalize and try again from different peer | ||
// Peer sent invalid data, penalize and try again from different peer | ||
// TODO(das): Count individual failures | ||
for column_index in column_indexes { | ||
let Some(request) = self.column_requests.get_mut(column_index) else { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
unnecessary comments