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

Closed
wants to merge 21 commits into from

Conversation

RolandSherwin
Copy link
Member

@RolandSherwin RolandSherwin commented Jan 15, 2025

This PR will now also merge #2617, #2618 and #2628 from the hotfix branch that was not released.

jacderida and others added 7 commits January 10, 2025 12:34
This should have been collected yesterday, but was forgotten.
…entt

feat(metrics): implement custom relay client metrics
…_on_restart

fix(network): set the record count metric as soon as we restart
…or_fix

fix(network): consider MultiAddrNotSupported as a serioud issu..
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
@jacderida jacderida changed the base branch from rc-2024.12.1-hotfix5 to main January 31, 2025 18:50
@RolandSherwin
Copy link
Member Author

superseded by #2691

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.

3 participants