Skip to content

Commit

Permalink
Merge pull request #30 from gattaca-com/config_updates
Browse files Browse the repository at this point in the history
config update
  • Loading branch information
0w3n-d authored Aug 2, 2024
2 parents e711c40 + 9a0e6de commit 84e4770
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
15 changes: 12 additions & 3 deletions crates/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct RelayConfig {
pub logging: LoggingConfig,
#[serde(default)]
pub validator_preferences: ValidatorPreferences,
#[serde(default)]
pub router_config: RouterConfig,
#[serde(default = "default_duration")]
pub target_get_payload_propagation_duration_ms: u64,
Expand All @@ -44,7 +45,9 @@ pub struct PostgresConfig {
pub db_name: String,
pub user: String,
pub password: String,
#[serde(default)]
pub region: i16,
#[serde(default)]
pub region_name: String,
}

Expand Down Expand Up @@ -125,10 +128,16 @@ impl RouterConfig {

// Function to resolve condensed variants and replace them with real routes
pub fn resolve_condensed_routes(&mut self) {
if self.contains(Route::All) {
// If All is present, replace it with all real routes
self.remove(&Route::All);

if self.enabled_routes.is_empty() {
// If no routes are enabled, enable all real routes
self.extend([Route::BuilderApi, Route::ProposerApi, Route::DataApi]);
} else {
if self.contains(Route::All) {
// If All is present, replace it with all real routes
self.remove(&Route::All);
self.extend([Route::BuilderApi, Route::ProposerApi, Route::DataApi]);
}
}

// Replace BuilderApi, ProposerApi, DataApi with their real routes
Expand Down
5 changes: 0 additions & 5 deletions crates/housekeeper/src/housekeeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ impl<DB: DatabaseService, BeaconClient: MultiBeaconClientTrait, A: Auctioneer>
return;
}

// Skip processing if the GetPayload route is enabled.
if self.config.router_config.enabled_routes.iter().any(|r| r.route == Route::GetPayload) {
return;
}

// Only allow one housekeeper task to run at a time.
if !self.auctioneer.try_acquire_or_renew_leadership(&self.leader_id).await {
return;
Expand Down

0 comments on commit 84e4770

Please sign in to comment.