From 036336bd2ef2cb9da64f846155ef0f34ace0e2c8 Mon Sep 17 00:00:00 2001 From: Lucas B Date: Tue, 23 Jan 2024 18:22:46 -0600 Subject: [PATCH] assert public ip is ipv4 --- transaction-relayer/src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/transaction-relayer/src/main.rs b/transaction-relayer/src/main.rs index 4c9a412c..9b77b8af 100644 --- a/transaction-relayer/src/main.rs +++ b/transaction-relayer/src/main.rs @@ -261,6 +261,13 @@ fn main() { response.parse().unwrap() }; info!("public ip: {:?}", public_ip); + assert!( + public_ip.is_ipv4(), + "Your public IP address needs to be IPV4 but is currently listed as {}. \ + If you are seeing this error and not passing in --public-ip, \ + please find your public ip address and pass it in on the command line", + public_ip + ); // Supporting IPV6 addresses is a DOS vector since they are cheap and there's a much larger amount of them. // The DOS is specifically with regards to the challenges queue filling up and starving other legitimate