From 6e86613ebd50183b0201d291e25bc85ec6a39aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Mon, 4 May 2026 12:19:28 -0300 Subject: [PATCH] chore: remove env var backwards comp for aggregator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- crates/bin/aggregator/README.md | 18 ------------ crates/bin/aggregator/src/main.rs | 47 ------------------------------- 2 files changed, 65 deletions(-) diff --git a/crates/bin/aggregator/README.md b/crates/bin/aggregator/README.md index 17f0dc4..26563d5 100644 --- a/crates/bin/aggregator/README.md +++ b/crates/bin/aggregator/README.md @@ -58,24 +58,6 @@ Options: Please refer to [GraphTallyCollector](https://github.com/graphprotocol/contracts/blob/main/packages/horizon/contracts/payments/collectors/GraphTallyCollector.sol) for more information about Receipt Aggregate Voucher signing keys. -### Deprecated Environment Variables - -For backwards compatibility, the following `TAP_*` environment variables are still supported but deprecated: - -| Deprecated | Use Instead | -|------------|-------------| -| `TAP_PORT` | `GRAPH_TALLY_PORT` | -| `TAP_PRIVATE_KEY` | `GRAPH_TALLY_PRIVATE_KEY` | -| `TAP_PUBLIC_KEYS` | `GRAPH_TALLY_PUBLIC_KEYS` | -| `TAP_MAX_REQUEST_BODY_SIZE` | `GRAPH_TALLY_MAX_REQUEST_BODY_SIZE` | -| `TAP_MAX_RESPONSE_BODY_SIZE` | `GRAPH_TALLY_MAX_RESPONSE_BODY_SIZE` | -| `TAP_MAX_CONNECTIONS` | `GRAPH_TALLY_MAX_CONNECTIONS` | -| `TAP_REQUEST_TIMEOUT_SECS` | `GRAPH_TALLY_REQUEST_TIMEOUT_SECS` | -| `TAP_METRICS_PORT` | `GRAPH_TALLY_METRICS_PORT` | -| `TAP_DOMAIN_CHAIN_ID` | `GRAPH_TALLY_DOMAIN_CHAIN_ID` | -| `TAP_DOMAIN_VERIFYING_CONTRACT` | `GRAPH_TALLY_DOMAIN_VERIFYING_CONTRACT` | -| `TAP_KAFKA_CONFIG` | `GRAPH_TALLY_KAFKA_CONFIG` | - ## Operational recommendations This is just meant to be a non-exhaustive list of reminders for safely operating the Graph Tally Aggregator. It being an HTTP diff --git a/crates/bin/aggregator/src/main.rs b/crates/bin/aggregator/src/main.rs index cbb0303..e283700 100644 --- a/crates/bin/aggregator/src/main.rs +++ b/crates/bin/aggregator/src/main.rs @@ -11,50 +11,6 @@ use thegraph_core::alloy::{ dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner, }; -/// Deprecated environment variable mappings (old -> new) -const DEPRECATED_ENV_VARS: &[(&str, &str)] = &[ - ("TAP_PORT", "GRAPH_TALLY_PORT"), - ("TAP_PRIVATE_KEY", "GRAPH_TALLY_PRIVATE_KEY"), - ("TAP_PUBLIC_KEYS", "GRAPH_TALLY_PUBLIC_KEYS"), - ( - "TAP_MAX_REQUEST_BODY_SIZE", - "GRAPH_TALLY_MAX_REQUEST_BODY_SIZE", - ), - ( - "TAP_MAX_RESPONSE_BODY_SIZE", - "GRAPH_TALLY_MAX_RESPONSE_BODY_SIZE", - ), - ("TAP_MAX_CONNECTIONS", "GRAPH_TALLY_MAX_CONNECTIONS"), - ( - "TAP_REQUEST_TIMEOUT_SECS", - "GRAPH_TALLY_REQUEST_TIMEOUT_SECS", - ), - ("TAP_METRICS_PORT", "GRAPH_TALLY_METRICS_PORT"), - ("TAP_DOMAIN_CHAIN_ID", "GRAPH_TALLY_DOMAIN_CHAIN_ID"), - ( - "TAP_DOMAIN_VERIFYING_CONTRACT", - "GRAPH_TALLY_DOMAIN_VERIFYING_CONTRACT", - ), - ("TAP_KAFKA_CONFIG", "GRAPH_TALLY_KAFKA_CONFIG"), -]; - -/// Checks for deprecated TAP_* environment variables and migrates them to GRAPH_TALLY_*. -/// Prints warnings for any deprecated variables found. -fn migrate_deprecated_env_vars() { - for (old, new) in DEPRECATED_ENV_VARS { - if let Ok(value) = std::env::var(old) { - eprintln!( - "WARNING: Environment variable {} is deprecated, use {} instead", - old, new - ); - // Only set the new var if it's not already set - if std::env::var(new).is_err() { - std::env::set_var(new, value); - } - } - } -} - #[derive(Parser)] #[command(author, version, about, long_about = None)] struct Args { @@ -141,9 +97,6 @@ async fn main() -> Result<()> { // See https://github.com/paritytech/jsonrpsee/pull/922 for more info. tracing_subscriber::fmt::init(); - // Migrate deprecated TAP_* env vars to GRAPH_TALLY_* with warnings - migrate_deprecated_env_vars(); - let args = Args::parse(); debug!("Settings: {args:?}");