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

Remove IP Check #1000

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions full-service/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use mc_connection::ConnectionManager;
use mc_consensus_scp::QuorumSet;
use mc_fog_report_resolver::FogResolver;
use mc_full_service::{
check_host,
config::{APIConfig, NetworkConfig, WebhookConfig},
wallet::{consensus_backed_rocket, validator_backed_rocket, APIKeyState, WalletState},
ValidatorLedgerSyncThread, WalletDb, WalletService,
Expand All @@ -39,7 +38,6 @@ extern crate diesel_migrations;
// Exit codes.
const EXIT_NO_DATABASE_CONNECTION: i32 = 2;
const EXIT_WRONG_PASSWORD: i32 = 3;
const EXIT_INVALID_HOST: i32 = 4;

#[launch]
fn rocket() -> Rocket<Build> {
Expand All @@ -50,16 +48,6 @@ fn rocket() -> Rocket<Build> {

let config = APIConfig::parse();

// Exit if the user is not in an authorized country.
if !cfg!(debug_assertions)
&& !config.offline
&& config.validator.is_none()
&& check_host::check_host_is_allowed_country_and_region().is_err()
{
eprintln!("Could not validate host");
exit(EXIT_INVALID_HOST);
}

let (logger, global_logger_guard) = create_app_logger(o!());

// This is necessary to prevent the logger from being reset when it goes out of
Expand Down
1 change: 0 additions & 1 deletion full-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![feature(proc_macro_hygiene, decl_macro)]
#![feature(assert_matches)]

pub mod check_host;
pub mod config;
pub mod db;
mod error;
Expand Down
10 changes: 0 additions & 10 deletions validator/service/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ use clap::Parser;
use mc_attest_core::MrSigner;
use mc_attestation_verifier::{TrustedIdentity, TrustedMrSignerIdentity};
use mc_common::logger::{create_app_logger, log, o};
use mc_full_service::check_host;
use mc_ledger_sync::{LedgerSyncServiceThread, PollingNetworkState, ReqwestTransactionsFetcher};
use mc_validator_service::{Config, Service};
use std::{
process::exit,
sync::{Arc, RwLock},
};

// Exit codes.
const EXIT_INVALID_HOST: i32 = 4;

fn main() {
mc_common::setup_panic_handler();
let _sentry_guard = mc_common::sentry::init();
Expand All @@ -25,12 +21,6 @@ fn main() {

let config = Config::parse();

// Exit if the user is not in an authorized country.
if check_host::check_host_is_allowed_country_and_region().is_err() {
eprintln!("Could not validate host");
exit(EXIT_INVALID_HOST);
}

log::info!(logger, "Read Configs: {:?}", config);

// Create enclave trusted identity.
Expand Down
Loading