Skip to content
Merged
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
18 changes: 0 additions & 18 deletions crates/bin/aggregator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 0 additions & 47 deletions crates/bin/aggregator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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:?}");

Expand Down
Loading