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

feat(network): introduce relay reservation score #2634

Open
wants to merge 13 commits into
base: rc-2024.12.1-hotfix5
Choose a base branch
from

Conversation

RolandSherwin
Copy link
Member

No description provided.

ant-networking/src/relay_manager.rs Outdated Show resolved Hide resolved
ant-networking/src/relay_manager.rs Outdated Show resolved Hide resolved
ant-networking/src/relay_manager.rs Show resolved Hide resolved
ant-networking/src/relay_manager.rs Show resolved Hide resolved
ant-networking/src/relay_manager.rs Show resolved Hide resolved
ant-networking/src/relay_manager.rs Outdated Show resolved Hide resolved
ant-networking/src/relay_manager.rs Outdated Show resolved Hide resolved
ant-networking/src/relay_manager.rs Show resolved Hide resolved
}

for from_peer in to_remove {
debug!("Removing {from_peer:?} from the incoming_connections_from_remote_peer");
Copy link
Member

Choose a reason for hiding this comment

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

incoming_connections_from_remote_peer only got pruned when got updated within above block of code
what if entries remained in the container due to some bug/error, which makes it growing infinitely ?

Copy link
Member Author

Choose a reason for hiding this comment

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

The only scenario where this can happen is from the below code

 let Some(latest_time) = connections.iter().map(|(_, _, time, _)| time).max() else {
                debug!("The incoming connections from {from_peer:?} are empty. Skipping.");
                continue;
            };

            let Ok(elapsed) = SystemTime::now().duration_since(*latest_time) else {
                debug!("Could not obtain elapsed time.");
                continue;
            };

This can only happen if there is a bug in our code. The cleanup does not depend on the events, it depends on just the MAX_DURATION_TO_TRACK_INCOMING_CONNECTIONS_PER_PEER.

Just depending on a timer is fine because a connection cannot take more than 15s before a ConnectionEstablished or a IncomingConnectionError is emitted tbh.

Copy link
Member

Choose a reason for hiding this comment

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

ok. fine then.

just This can only happen if there is a bug in our code could happen

@RolandSherwin RolandSherwin force-pushed the relay_healthh branch 4 times, most recently from 4f71cc1 to f7b3521 Compare January 20, 2025 09:51
@RolandSherwin RolandSherwin changed the base branch from main to rc-2024.12.1-hotfix5 January 20, 2025 09:55
ant-networking/src/event/identify.rs Outdated Show resolved Hide resolved
ant-networking/src/event/identify.rs Outdated Show resolved Hide resolved
ant-networking/src/event/identify.rs Outdated Show resolved Hide resolved
ant-networking/src/event/identify.rs Outdated Show resolved Hide resolved
@RolandSherwin RolandSherwin force-pushed the relay_healthh branch 2 times, most recently from fa17cbc to bc9fad6 Compare January 21, 2025 10:03
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.

2 participants