-
Notifications
You must be signed in to change notification settings - Fork 234
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
Audit p2p sync errors #2353
base: main
Are you sure you want to change the base?
Audit p2p sync errors #2353
Conversation
…mmitment missing are not fatal errors
1260dc7
to
fe3f4e4
Compare
Which have no associated peer.
fe3f4e4
to
ef8ad34
Compare
064c331
to
5f5ad9c
Compare
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.
LGTM.
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.
Another nit: the declaration of pathfinder_common::class_hash
in state_updates.rs
seems unused - not really part of error handling, but it is refactoring... :-)
Plus it needs to incorporate changes from #2349, naturally...
@@ -1557,6 +1557,8 @@ async fn try_next<T>( | |||
match count_stream.next().await { | |||
Some(Ok(cnt)) => Ok(cnt), | |||
Some(Err(e)) => Err(PeerData::new(PeerId::random(), e)), | |||
// This is a non-recovarable error, the stream is expected to yield the correct number of |
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.
"recoverable"
.map(|x| Self::new(peer, x)) | ||
.map_err(|e| PeerData::<E>::new(peer, e)) | ||
} | ||
|
||
pub fn for_tests(data: T) -> Self { |
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.
could it be behind #[cfg(test)]
?
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.
I'll try 👍
Fixes: #2302
Some ideas from the issue ⬆️ were not implemented or a more convenient solution was chosen (for example: log errors at source in checkpoint sync, keep variants small, allow for implicit conversion from
anyhow::Error
because only one variant uses it).