Skip to content

added STUN-based TIER1 self-discovery - #8472

Merged
near-bulldozer[bot] merged 11 commits into
masterfrom
gprusak-stun
Feb 2, 2023
Merged

added STUN-based TIER1 self-discovery#8472
near-bulldozer[bot] merged 11 commits into
masterfrom
gprusak-stun

Conversation

@pompon0

@pompon0 pompon0 commented Jan 31, 2023

Copy link
Copy Markdown
Contributor

If no public_addrs are configured, a validator node will try to query STUN servers to discover its own IP.
By default a list of public STUN servers provided by Google is used, bu the user is recommended to overwrite it with whatever STUN servers they trust OR, preferably, specify the proxy addresses manually.

@pompon0
pompon0 requested a review from mm-near January 31, 2023 13:26
@pompon0
pompon0 requested a review from a team as a code owner January 31, 2023 13:26
Comment thread chain/network/src/stun/mod.rs
Comment thread chain/network/src/peer_manager/network_state/tier1.rs Outdated
}
// Check that we have received non-zero responses and that they are consistent.
if node_ips.len() == 0 {
vec![]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this means that we cannot get the IP address, right?

Is it visible somewhere?

I wonder if we should somehow export the current ip (in prometheus?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is exposed on the debug page, as AccountData. It is not really feasible to expose it in prometheus (gauge cannot have a string value), unless we abuse the system.

Comment thread chain/network/src/config_json.rs
Comment thread chain/network/src/config_json.rs
@near-bulldozer
near-bulldozer Bot merged commit c308df1 into master Feb 2, 2023
@near-bulldozer
near-bulldozer Bot deleted the gprusak-stun branch February 2, 2023 10:07
nikurt pushed a commit that referenced this pull request Feb 6, 2023
If no public_addrs are configured, a validator node will try to query STUN servers to discover its own IP.
By default a list of public STUN servers provided by Google is used, bu the user is recommended to overwrite it with whatever STUN servers they trust OR, preferably, specify the proxy addresses manually.
@pompon0 pompon0 linked an issue Feb 8, 2023 that may be closed by this pull request
near-bulldozer Bot pushed a commit that referenced this pull request May 8, 2023
[Audits](https://github.com/near/near-sdk-rs/actions/runs/4690517670/jobs/8376852068?pr=1010) in `near-sdk` highlight a security vulnerability [RUSTSEC-2023-0001](https://rustsec.org/advisories/RUSTSEC-2023-0001) that affects the Windows platform.

As far as I could tell, we're not directly impacted by this, but the severity suggests we make an upstream dep update.

#8309 (comment) pinned `tokio` to `1.18` and suggested not updating the minor version unconsciously. Whereas #8472 required a bump to `1.19`, which has no versions that patch this vulnerability.

This PR seizes the opportunity to re-pin the minor version to the latest, after which subsequent updates can uphold the bump requirement outlined in #8309.
nikurt pushed a commit that referenced this pull request May 10, 2023
[Audits](https://github.com/near/near-sdk-rs/actions/runs/4690517670/jobs/8376852068?pr=1010) in `near-sdk` highlight a security vulnerability [RUSTSEC-2023-0001](https://rustsec.org/advisories/RUSTSEC-2023-0001) that affects the Windows platform.

As far as I could tell, we're not directly impacted by this, but the severity suggests we make an upstream dep update.

#8309 (comment) pinned `tokio` to `1.18` and suggested not updating the minor version unconsciously. Whereas #8472 required a bump to `1.19`, which has no versions that patch this vulnerability.

This PR seizes the opportunity to re-pin the minor version to the latest, after which subsequent updates can uphold the bump requirement outlined in #8309.
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.

STUN server support [3 weeks]

2 participants