checks if --entrypoint is consistent with --allow-private-addr (#23559)

If entrypoints are excluded by SocketAddrSpace, the node cannot start.
Private --entrypoint addresses require --allow-private-addr.
This commit is contained in:
behzad nouri 2022-03-11 14:15:05 +00:00 committed by GitHub
parent 3d021cffa3
commit 043086081f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -2114,6 +2114,12 @@ pub fn main() {
.collect::<HashSet<_>>()
.into_iter()
.collect::<Vec<_>>();
for addr in &entrypoint_addrs {
if !socket_addr_space.check(addr) {
eprintln!("invalid entrypoint address: {}", addr);
exit(1);
}
}
// TODO: Once entrypoints are updated to return shred-version, this should
// abort if it fails to obtain a shred-version, so that nodes always join
// gossip with a valid shred-version. The code to adopt entrypoint shred