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

Don't Panic! #539

Closed
utkarshg6 opened this issue Oct 10, 2024 · 0 comments · Fixed by #540
Closed

Don't Panic! #539

utkarshg6 opened this issue Oct 10, 2024 · 0 comments · Fixed by #540
Assignees
Labels
bug Something isn't working

Comments

@utkarshg6
Copy link
Collaborator

utkarshg6 commented Oct 10, 2024

Don't Panic

The thing is if an originating node receives a gossip from the other Node saying, "Hey! Meet this guy.", and it turns out that we were already trying to build a neighborship with that guy, we're going to panic. 😱

We don't need to.

So, let's change the panic to an error log, here's your panic on node/src/neighborhood/overall_connection_status.rs:96 ==>

if self.connection_stage != ConnectionStage::TcpConnectionEstablished {
    panic!(
        "Can't update the stage from {:?} to {:?}",
        self.connection_stage,
        ConnectionStage::StageZero
    )
};

Now, we can in fact split this into following cases:

Case 1: if self.connection_stage == StageZero it means that we already know this guy 😉

Case 2: if self.connection_stage == TcpConnectionEstablished it means, we're on the ideal track 👍

Case 3: Other cases, we should panic!

@utkarshg6 utkarshg6 converted this from a draft issue Oct 10, 2024
@utkarshg6 utkarshg6 moved this from 🆕 New to 🏗 Development In Progress in MASQ Node v2 Oct 10, 2024
@utkarshg6 utkarshg6 self-assigned this Oct 10, 2024
utkarshg6 added a commit that referenced this issue Oct 10, 2024
utkarshg6 added a commit that referenced this issue Oct 10, 2024
@utkarshg6 utkarshg6 moved this from 🏗 Development In Progress to 📃 Quality Assurance Unfinished in MASQ Node v2 Oct 10, 2024
@kauri-hero kauri-hero added the bug Something isn't working label Oct 11, 2024
utkarshg6 added a commit that referenced this issue Oct 15, 2024
* GH-539: Don't Panic

* GH-539: remove commented out code
@github-project-automation github-project-automation bot moved this from 📃 Quality Assurance Unfinished to ✅ Done in MASQ Node v2 Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants