Skip to content

Commit

Permalink
use eu-central-1 and more ips
Browse files Browse the repository at this point in the history
  • Loading branch information
eaypek-tfh committed Jan 12, 2025
1 parent c6af361 commit 26fa82f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions iris-mpc/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,6 @@ struct StaticResolver {

impl StaticResolver {
fn new(ips: Vec<IpAddr>) -> Self {
assert!(
!ips.is_empty(),
"StaticResolver requires at least one IP address."
);
Self {
ips: Arc::new(ips),
current: Arc::new(AtomicUsize::new(0)),
Expand Down Expand Up @@ -729,7 +725,7 @@ async fn resolve_export_bucket_ips(host: String) -> eyre::Result<Vec<IpAddr>> {
let resolver = TokioAsyncResolver::tokio(ResolverConfig::default(), resolver_opts);
loop {
// Check if we've collected enough unique IPs
if all_ips.len() >= 10 {
if all_ips.len() >= 30 {
break;
}
match resolver.lookup_ip(&host).await {
Expand Down Expand Up @@ -759,7 +755,7 @@ async fn server_main(config: Config) -> eyre::Result<()> {
));
shutdown_handler.wait_for_shutdown_signal().await;

let shares_bucket_host = format!("{}.s3.{}.amazonaws.com", config.shares_bucket_name, REGION);
let shares_bucket_host = format!("{}.s3.{}.amazonaws.com", config.shares_bucket_name, "eu-central-1");
let shares_bucket_ips = resolve_export_bucket_ips(shares_bucket_host);
// Load batch_size config
*CURRENT_BATCH_SIZE.lock().unwrap() = config.max_batch_size;
Expand All @@ -780,9 +776,6 @@ async fn server_main(config: Config) -> eyre::Result<()> {
let sns_client = SNSClient::new(&shared_config);

// Increase S3 retries to 5
// let resolver = Resolver::new(ResolverConfig::default(),
// ResolverOpts::default()).unwrap();

let static_resolver = StaticResolver::new(shares_bucket_ips.await?);
let client = HyperClientBuilder::new()
.crypto_mode(CryptoMode::Ring)
Expand Down

0 comments on commit 26fa82f

Please sign in to comment.