Skip to content
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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Audit p2p sync errors #2353

wants to merge 21 commits into from

Conversation

CHr15F0x
Copy link
Member

@CHr15F0x CHr15F0x commented Nov 5, 2024

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).

@CHr15F0x CHr15F0x changed the title Chris/p2p errors Audit p2p sync errors Nov 5, 2024
@CHr15F0x CHr15F0x marked this pull request as ready for review November 5, 2024 19:18
@CHr15F0x CHr15F0x requested a review from a team as a code owner November 5, 2024 19:18
Copy link
Contributor

@kkovaacs kkovaacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

@vbar vbar left a 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
Copy link
Contributor

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 {
Copy link
Contributor

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)]?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit error types propagated from p2p client to checkpoint sync
3 participants