diff --git a/contrib/indexer-service/start.sh b/contrib/indexer-service/start.sh index cbf5f3201..bfe128391 100755 --- a/contrib/indexer-service/start.sh +++ b/contrib/indexer-service/start.sh @@ -69,11 +69,6 @@ deployment_id = \"$network_deployment\""; fi) recently_closed_allocation_buffer_secs = 60 syncing_interval_secs = 30 -[subgraphs.escrow] -query_url = "http://graph-node:8000/subgraphs/name/semiotic/tap"$(if [ -n "$escrow_deployment" ] && [ "$escrow_deployment" != "null" ]; then echo " -deployment_id = \"$escrow_deployment\""; fi) -syncing_interval_secs = 30 - [blockchain] chain_id = 1337 receipts_verifier_address = "${tap_verifier}" @@ -85,7 +80,6 @@ free_query_auth_token = "freestuff" host_and_port = "0.0.0.0:7601" url_prefix = "/" serve_network_subgraph = false -serve_escrow_subgraph = false [service.tap] diff --git a/contrib/tap-agent/start.sh b/contrib/tap-agent/start.sh index 7b01a4c17..79d301537 100755 --- a/contrib/tap-agent/start.sh +++ b/contrib/tap-agent/start.sh @@ -120,11 +120,6 @@ deployment_id = \"$NETWORK_DEPLOYMENT\""; fi) recently_closed_allocation_buffer_secs = 60 syncing_interval_secs = 30 -[subgraphs.escrow] -query_url = "http://graph-node:${GRAPH_NODE_GRAPHQL}/subgraphs/name/semiotic/tap"$(if [ -n "$ESCROW_DEPLOYMENT" ] && [ "$ESCROW_DEPLOYMENT" != "null" ]; then echo " -deployment_id = \"$ESCROW_DEPLOYMENT\""; fi) -syncing_interval_secs = 30 - [blockchain] chain_id = 1337 receipts_verifier_address = "${tap_verifier}" @@ -135,7 +130,6 @@ subgraph_service_address = "${subgraph_service}" host_and_port = "0.0.0.0:${INDEXER_SERVICE}" url_prefix = "/" serve_network_subgraph = false -serve_escrow_subgraph = false [service.tap] diff --git a/crates/config/default_values.toml b/crates/config/default_values.toml index 0018be552..292858d9d 100644 --- a/crates/config/default_values.toml +++ b/crates/config/default_values.toml @@ -8,13 +8,9 @@ max_data_staleness_mins = 30 escrow_min_balance_grt_wei = "100000000000000000" max_signers_per_payer = 0 -[subgraphs.escrow] -syncing_interval_secs = 60 - [service] ipfs_url = "https://api.thegraph.com/ipfs/" serve_network_subgraph = false -serve_escrow_subgraph = false host_and_port = "0.0.0.0:7600" url_prefix = "/" max_cost_model_batch_size = 200 diff --git a/crates/config/maximal-config-example.toml b/crates/config/maximal-config-example.toml index 72423c8b7..8a39fec93 100644 --- a/crates/config/maximal-config-example.toml +++ b/crates/config/maximal-config-example.toml @@ -91,22 +91,6 @@ escrow_min_balance_grt_wei = "100000000000000000" # signers, orphaning receipts and enabling free queries. max_signers_per_payer = 0 -[subgraphs.escrow] -# NOTE: It is heavily recomended to use both `query_url` and `deployment_id`, -# Query URL for the Escrow subgraph (v1). This is the old escrow subgraph. -# NOTE: This is not used in v2, as the escrow subgraph is now in the network subgraph. -query_url = "http://example.com/escrow-subgraph" -# Optional, Auth token will used a "bearer auth" -# query_auth_token = "super-secret" - -# Optional, deployment to look for in the local `graph-node`, if locally indexed. -# Locally indexing the subgraph is recommended. -deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -# Refreshing interval for the Escrow contracts information from the Escrow subgraph. -syncing_interval_secs = 60 - -# NOTE: V2 escrow accounts are now in the network subgraph, not a separate escrow_v2 subgraph - [blockchain] # The chain ID of the network that the graph network is running on chain_id = 1337 @@ -125,8 +109,6 @@ host_and_port = "0.0.0.0:7600" url_prefix = "/" # Serve the network subgraph on `common.server.host_and_port`/network serve_network_subgraph = false -# Serve the escrow subgraph on `common.server.host_and_port`/escrow -serve_escrow_subgraph = false #### OPTIONAL VALUES #### ## use this to add a layer while serving network/escrow subgraph # serve_auth_token = "token" diff --git a/crates/config/minimal-config-example.toml b/crates/config/minimal-config-example.toml index d8b143b05..e5c09cde9 100644 --- a/crates/config/minimal-config-example.toml +++ b/crates/config/minimal-config-example.toml @@ -47,14 +47,6 @@ query_url = "http://example.com/network-subgraph" # NOTE: Use `query_url` or `deployment_id` only deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -[subgraphs.escrow] -# Query URL for the Escrow subgraph (v1). -query_url = "http://example.com/escrow-subgraph" -# Optional, deployment to look for in the local `graph-node`, if locally indexed. -# Locally indexing the subgraph is recommended. -# NOTE: Use `query_url` or `deployment_id` only -deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - [blockchain] # The chain ID of the network that the graph network is running on chain_id = 1337 diff --git a/crates/config/src/config.rs b/crates/config/src/config.rs index 00a19154f..a633a6e4b 100644 --- a/crates/config/src/config.rs +++ b/crates/config/src/config.rs @@ -41,7 +41,6 @@ pub struct Config { pub service: ServiceConfig, pub tap: TapConfig, pub dips: Option, - /// Deprecated: Horizon is always enabled. This section is ignored. #[serde(default)] pub horizon: HorizonConfig, } @@ -223,20 +222,13 @@ impl Config { } // Validate syncing_interval_secs is not zero - if self.subgraphs.escrow.config.syncing_interval_secs == Duration::ZERO { - return Err( - "subgraphs.escrow.syncing_interval_secs must be greater than 0".to_string(), - ); - } if self.subgraphs.network.config.syncing_interval_secs == Duration::ZERO { return Err( "subgraphs.network.syncing_interval_secs must be greater than 0".to_string(), ); } - if self.subgraphs.escrow.config.syncing_interval_secs < Duration::from_secs(10) - || self.subgraphs.network.config.syncing_interval_secs < Duration::from_secs(10) - { + if self.subgraphs.network.config.syncing_interval_secs < Duration::from_secs(10) { tracing::warn!( "Your `syncing_interval_secs` value it too low. \ This may overload your graph-node instance, \ @@ -244,9 +236,7 @@ impl Config { ); } - if self.subgraphs.escrow.config.syncing_interval_secs > Duration::from_secs(600) - || self.subgraphs.network.config.syncing_interval_secs > Duration::from_secs(600) - { + if self.subgraphs.network.config.syncing_interval_secs > Duration::from_secs(600) { tracing::warn!( "Your `syncing_interval_secs` value it too high. \ This may cause issues while reacting to updates in the blockchain. \ @@ -306,11 +296,46 @@ impl Config { self.subgraphs.network.config.query_auth_token.as_ref(), "subgraphs.network", ); - Self::warn_if_token_over_http( - &self.subgraphs.escrow.config.query_url, - self.subgraphs.escrow.config.query_auth_token.as_ref(), - "subgraphs.escrow", - ); + + // Warn about deprecated escrow config + #[allow(deprecated)] + if self.subgraphs.escrow.is_some() { + tracing::warn!( + "The `subgraphs.escrow` configuration is deprecated and will be ignored. \ + V2 escrow accounts are now sourced from the network subgraph. \ + You can safely remove the `[subgraphs.escrow]` section from your config." + ); + } + + // Warn about deprecated serve_escrow_subgraph + #[allow(deprecated)] + if self.service.serve_escrow_subgraph.is_some() { + tracing::warn!( + "The `service.serve_escrow_subgraph` configuration is deprecated and will be ignored. \ + The escrow subgraph endpoint is no longer served. \ + You can safely remove this setting from your config." + ); + } + + // Warn about deprecated receipts_verifier_address (V1) + #[allow(deprecated)] + if self.blockchain.receipts_verifier_address.is_some() { + tracing::warn!( + "The `blockchain.receipts_verifier_address` configuration is deprecated and will be ignored. \ + Horizon (V2) is now always enabled and uses `receipts_verifier_address_v2`. \ + You can safely remove `receipts_verifier_address` from your config." + ); + } + + // Warn about deprecated horizon.enabled + #[allow(deprecated)] + if self.horizon.enabled.is_some() { + tracing::warn!( + "The `horizon.enabled` configuration is deprecated and will be ignored. \ + Horizon is now always enabled. \ + You can safely remove the `[horizon]` section from your config." + ); + } Ok(()) } @@ -448,10 +473,12 @@ impl MetricsConfig { #[derive(Debug, Deserialize)] #[cfg_attr(test, derive(PartialEq))] +#[allow(deprecated)] // Allow using deprecated EscrowSubgraphConfig type pub struct SubgraphsConfig { pub network: NetworkSubgraphConfig, - pub escrow: EscrowSubgraphConfig, - // Note: V2 escrow accounts are in the network subgraph, not a separate escrow_v2 subgraph + #[deprecated(note = "V2 escrow accounts are in the network subgraph; this field is ignored.")] + #[serde(default)] + pub escrow: Option, } #[serde_as] @@ -497,11 +524,12 @@ fn default_max_signers_per_payer() -> usize { 0 } -#[derive(Debug, Deserialize)] +#[deprecated(note = "V2 escrow accounts are in the network subgraph; escrow config is ignored.")] +#[derive(Debug, Deserialize, Default)] #[cfg_attr(test, derive(PartialEq))] pub struct EscrowSubgraphConfig { - #[serde(flatten)] - pub config: SubgraphConfig, + #[serde(flatten, default)] + pub config: Option, } #[serde_as] @@ -532,7 +560,7 @@ pub enum TheGraphChainId { #[cfg_attr(test, derive(PartialEq))] pub struct BlockchainConfig { pub chain_id: TheGraphChainId, - /// Legacy verifier address (deprecated; optional, not used). + /// Legacy verifier address #[deprecated(note = "Use `receipts_verifier_address_v2` for Horizon receipts.")] pub receipts_verifier_address: Option
, /// Verifier address for Horizon receipts. @@ -552,7 +580,9 @@ impl BlockchainConfig { pub struct ServiceConfig { pub ipfs_url: Url, pub serve_network_subgraph: bool, - pub serve_escrow_subgraph: bool, + #[deprecated(note = "Escrow subgraph is no longer used; this field is ignored.")] + #[serde(default)] + pub serve_escrow_subgraph: Option, pub serve_auth_token: Option, pub host_and_port: SocketAddr, pub url_prefix: String, @@ -688,14 +718,13 @@ pub struct RavRequestConfig { /// Configuration for Horizon support. /// -/// Note: Horizon is always enabled. The `enabled` field is deprecated and ignored. +/// Note: This struct is kept for backwards compatibility. #[derive(Debug, Default, Deserialize)] #[cfg_attr(test, derive(PartialEq))] pub struct HorizonConfig { - /// Deprecated: Horizon is now always enabled. This field is ignored. #[deprecated(note = "Horizon is always enabled; this field is ignored.")] #[serde(default)] - pub enabled: bool, + pub enabled: Option, } #[cfg(test)] @@ -772,7 +801,7 @@ mod tests { Some(PathBuf::from("minimal-config-example.toml")).as_ref(), ) .unwrap(); - assert!(config_with_horizon_true.horizon.enabled); + assert_eq!(config_with_horizon_true.horizon.enabled, Some(true)); env::remove_var("INDEXER_SERVICE_HORIZON__ENABLED"); // Test with horizon.enabled = false via environment variable @@ -782,7 +811,7 @@ mod tests { Some(PathBuf::from("minimal-config-example.toml")).as_ref(), ) .unwrap(); - assert!(!config_with_horizon_false.horizon.enabled); + assert_eq!(config_with_horizon_false.horizon.enabled, Some(false)); env::remove_var("INDEXER_SERVICE_HORIZON__ENABLED"); // Test without horizon section (uses default) @@ -791,8 +820,8 @@ mod tests { Some(PathBuf::from("minimal-config-example.toml")).as_ref(), ) .unwrap(); - // Default is false since #[serde(default)] on bool defaults to false - assert!(!config_without_horizon.horizon.enabled); + // Default is None since #[serde(default)] on Option defaults to None + assert_eq!(config_without_horizon.horizon.enabled, None); } // Test that we can load config with unknown fields, in particular coming from environment variables diff --git a/crates/service/src/service.rs b/crates/service/src/service.rs index 8bf915c9c..316722306 100644 --- a/crates/service/src/service.rs +++ b/crates/service/src/service.rs @@ -155,13 +155,6 @@ pub async fn run() -> anyhow::Result<()> { } }; - let escrow_subgraph = create_subgraph_client( - http_client.clone(), - &config.graph_node, - &config.subgraphs.escrow.config, - ) - .await; - let router = ServiceRouter::builder() .database(database.clone()) .domain_separator_v2(domain_separator_v2.clone()) @@ -173,7 +166,6 @@ pub async fn run() -> anyhow::Result<()> { .blockchain(config.blockchain) .timestamp_buffer_secs(config.tap.rav_request.timestamp_buffer_secs) .network_subgraph(network_subgraph, config.subgraphs.network) - .escrow_subgraph(escrow_subgraph, config.subgraphs.escrow) .escrow_accounts_v2(v2_watcher) .build(); diff --git a/crates/service/src/service/router.rs b/crates/service/src/service/router.rs index 01e6ab444..5db470498 100644 --- a/crates/service/src/service/router.rs +++ b/crates/service/src/service/router.rs @@ -13,13 +13,12 @@ use axum::{ }; use governor::{clock::QuantaInstant, middleware::NoOpMiddleware}; use indexer_config::{ - BlockchainConfig, EscrowSubgraphConfig, GraphNodeConfig, IndexerConfig, NetworkSubgraphConfig, - ServiceConfig, ServiceTapConfig, + BlockchainConfig, GraphNodeConfig, IndexerConfig, NetworkSubgraphConfig, ServiceConfig, + ServiceTapConfig, }; use indexer_monitor::{ - attestation_signers, deployment_to_allocation, dispute_manager, escrow_accounts_v2, - indexer_allocations, AllocationWatcher, DisputeManagerWatcher, EscrowAccountsWatcher, - SubgraphClient, + attestation_signers, deployment_to_allocation, dispute_manager, indexer_allocations, + AllocationWatcher, DisputeManagerWatcher, EscrowAccountsWatcher, SubgraphClient, }; use reqwest::Method; use tap_core::{manager::Manager, receipt::checks::CheckList}; @@ -75,14 +74,8 @@ pub struct ServiceRouter { service: ServiceConfig, blockchain: BlockchainConfig, timestamp_buffer_secs: Duration, - - // either provide subgraph or watcher - #[builder(with = - |subgraph: &'static SubgraphClient, - config: EscrowSubgraphConfig| - (subgraph, config))] - escrow_subgraph: Option<(&'static SubgraphClient, EscrowSubgraphConfig)>, - escrow_accounts_v2: Option, + // V2 escrow accounts watcher (required, sourced from network subgraph) + escrow_accounts_v2: EscrowAccountsWatcher, // provide network subgraph or allocations + dispute manager #[builder(with = |subgraph: &'static SubgraphClient, @@ -101,9 +94,10 @@ impl ServiceRouter { mnemonic_count = operator_mnemonics.len(), "Loaded operator mnemonics for attestation signing" ); + #[allow(deprecated)] let ServiceConfig { serve_network_subgraph, - serve_escrow_subgraph, + serve_escrow_subgraph: _, // Deprecated and ignored serve_auth_token, url_prefix, tap: ServiceTapConfig { @@ -140,33 +134,6 @@ impl ServiceRouter { (None, None) => panic!("No allocations or network subgraph was provided"), }; - // Monitor escrow accounts v2 - // if not provided, create monitor from subgraph - let escrow_accounts_v2 = match (self.escrow_accounts_v2, self.escrow_subgraph.as_ref()) { - (Some(escrow_account), _) => escrow_account, - (_, Some((escrow_subgraph, escrow))) => { - let (min_balance, max_signers) = match self.network_subgraph.as_ref() { - Some((_, network)) => ( - network.escrow_min_balance_grt_wei.clone(), - network.max_signers_per_payer, - ), - None => ("100000000000000000".to_string(), 0), - }; - escrow_accounts_v2( - escrow_subgraph, - indexer_address, - escrow.config.syncing_interval_secs, - true, // Reject thawing signers eagerly - self.blockchain.receipts_verifier_address_v2, - min_balance, - max_signers, - ) - .await - .expect("Error creating escrow_accounts_v2 channel") - } - (None, None) => panic!("Escrow accounts v2 watcher must be provided"), - }; - // Monitor dispute manager address // if not provided, create monitor from subgraph let dispute_manager = match (self.dispute_manager, self.network_subgraph.as_ref()) { @@ -220,7 +187,7 @@ impl ServiceRouter { DEFAULT_ROUTE_PATH, post(static_subgraph_request_handler) .route_layer(auth_layer) - .route_layer(static_subgraph_rate_limiter.clone()) + .route_layer(static_subgraph_rate_limiter) .with_state(network_subgraph), ) } @@ -231,32 +198,6 @@ impl ServiceRouter { _ => Router::new(), }; - // load serve_escrow_subgraph route - let serve_escrow_subgraph = match ( - serve_auth_token.as_ref(), - serve_escrow_subgraph, - self.escrow_subgraph.as_ref(), - ) { - (Some(free_auth_token), true, Some((escrow_subgraph, _))) => { - tracing::info!("Serving escrow subgraph at /escrow"); - - let auth_layer = ValidateRequestHeaderLayer::bearer(free_auth_token); - - Router::new().route( - DEFAULT_ROUTE_PATH, - post(static_subgraph_request_handler) - .route_layer(auth_layer) - .route_layer(static_subgraph_rate_limiter) - .with_state(*escrow_subgraph), - ) - } - (_, true, _) => { - tracing::warn!("`serve_escrow_subgraph` is enabled but no `serve_auth_token` provided. Disabling it."); - Router::new() - } - _ => Router::new(), - }; - let network_subgraph_client = self.network_subgraph.as_ref().map(|(client, _)| *client); let post_request_handler = { @@ -276,7 +217,7 @@ impl ServiceRouter { let checks = IndexerTapContext::get_checks(TapChecksConfig { pgpool: self.database.clone(), indexer_allocations: allocations.clone(), - escrow_accounts_v2: escrow_accounts_v2.clone(), + escrow_accounts_v2: self.escrow_accounts_v2.clone(), network_subgraph: network_subgraph_client, indexer_address: self.indexer.indexer_address, timestamp_error_tolerance, @@ -326,7 +267,7 @@ impl ServiceRouter { deployment_to_allocation, }; let sender_state = SenderState { - escrow_accounts_v2, + escrow_accounts_v2: self.escrow_accounts_v2, domain_separator_v2: self.domain_separator_v2, }; @@ -432,7 +373,6 @@ impl ServiceRouter { .route("/info", get(operator_address)) .route("/healthz", get(healthz).with_state(healthz_state)) .nest("/version", version) - .nest("/escrow", serve_escrow_subgraph) .nest("/network", serve_network_subgraph) .route( "/subgraph/health/{deployment_id}", diff --git a/crates/service/tests/router_test.rs b/crates/service/tests/router_test.rs index a0adf03ee..bdc6b59c8 100644 --- a/crates/service/tests/router_test.rs +++ b/crates/service/tests/router_test.rs @@ -7,8 +7,8 @@ use axum::{body::to_bytes, extract::ConnectInfo, http::Request, Extension}; use axum_extra::headers::Header; use base64::prelude::*; use indexer_config::{ - BlockchainConfig, EscrowSubgraphConfig, GraphNodeConfig, IndexerConfig, NetworkSubgraphConfig, - NonZeroGRT, SubgraphConfig, + BlockchainConfig, GraphNodeConfig, IndexerConfig, NetworkSubgraphConfig, NonZeroGRT, + SubgraphConfig, }; use indexer_monitor::{DeploymentDetails, EscrowAccounts, SubgraphClient}; use indexer_service_rs::{ @@ -32,7 +32,6 @@ struct RouterInputs { http_client: reqwest::Client, graph_node_url: Url, subgraph_client: &'static SubgraphClient, - escrow_subgraph_config: SubgraphConfig, network_subgraph_config: SubgraphConfig, escrow_accounts_v2: watch::Receiver, allocations: @@ -54,20 +53,23 @@ fn build_service_router(inputs: RouterInputs) -> ServiceRouter { operator_mnemonic: Some(test_assets::INDEXER_MNEMONIC.clone()), operator_mnemonics: None, }) - .service(indexer_config::ServiceConfig { - serve_network_subgraph: false, - serve_escrow_subgraph: false, - serve_auth_token: None, - host_and_port: "0.0.0.0:0".parse().unwrap(), - url_prefix: "/".into(), - tap: indexer_config::ServiceTapConfig { - max_receipt_value_grt: NonZeroGRT::new(1000000000000).unwrap(), - }, - free_query_auth_token: None, - ipfs_url: "http://localhost:5001".parse().unwrap(), - max_cost_model_batch_size: 200, - max_request_body_size: 2 * 1024 * 1024, - max_status_request_body_size: 32 * 1024, + .service({ + #[allow(deprecated)] + indexer_config::ServiceConfig { + serve_network_subgraph: false, + serve_escrow_subgraph: None, // Deprecated and ignored + serve_auth_token: None, + host_and_port: "0.0.0.0:0".parse().unwrap(), + url_prefix: "/".into(), + tap: indexer_config::ServiceTapConfig { + max_receipt_value_grt: NonZeroGRT::new(1000000000000).unwrap(), + }, + free_query_auth_token: None, + ipfs_url: "http://localhost:5001".parse().unwrap(), + max_cost_model_batch_size: 200, + max_request_body_size: 2 * 1024 * 1024, + max_status_request_body_size: 32 * 1024, + } }) .blockchain({ #[allow(deprecated)] @@ -79,12 +81,6 @@ fn build_service_router(inputs: RouterInputs) -> ServiceRouter { } }) .timestamp_buffer_secs(Duration::from_secs(10)) - .escrow_subgraph( - inputs.subgraph_client, - EscrowSubgraphConfig { - config: inputs.escrow_subgraph_config, - }, - ) .network_subgraph( inputs.subgraph_client, NetworkSubgraphConfig { @@ -168,7 +164,7 @@ async fn full_integration_test() { let subgraph_query_url = Url::parse(&mock_server.uri()).unwrap(); - let escrow_subgraph_config = || SubgraphConfig { + let network_subgraph_config = || SubgraphConfig { query_url: subgraph_query_url.clone(), query_auth_token: None, deployment_id: None, @@ -180,8 +176,7 @@ async fn full_integration_test() { http_client, graph_node_url: graph_node_url.clone(), subgraph_client, - escrow_subgraph_config: escrow_subgraph_config(), - network_subgraph_config: escrow_subgraph_config(), + network_subgraph_config: network_subgraph_config(), escrow_accounts_v2: escrow_accounts, allocations: allocations.clone(), dispute_manager: dispute_manager.clone(), @@ -228,8 +223,7 @@ async fn full_integration_test() { .unwrap(), graph_node_url: failing_graph_node, subgraph_client, - escrow_subgraph_config: escrow_subgraph_config(), - network_subgraph_config: escrow_subgraph_config(), + network_subgraph_config: network_subgraph_config(), escrow_accounts_v2: escrow_accounts_fail, allocations, dispute_manager, diff --git a/crates/tap-agent/src/agent.rs b/crates/tap-agent/src/agent.rs index 8e2cd8d23..69b251cca 100644 --- a/crates/tap-agent/src/agent.rs +++ b/crates/tap-agent/src/agent.rs @@ -36,8 +36,8 @@ //! [std::sync::Mutex]s aren't needed. use indexer_config::{ - Config, EscrowSubgraphConfig, GraphNodeConfig, IndexerConfig, NetworkSubgraphConfig, - SubgraphConfig, SubgraphsConfig, TapConfig, + Config, GraphNodeConfig, IndexerConfig, NetworkSubgraphConfig, SubgraphConfig, SubgraphsConfig, + TapConfig, }; use indexer_monitor::{escrow_accounts_v2, indexer_allocations, DeploymentDetails, SubgraphClient}; use ractor::{concurrency::JoinHandle, Actor, ActorRef}; @@ -87,7 +87,8 @@ pub async fn start_agent( query_url: graph_node_query_endpoint, }, database, - subgraphs: + #[allow(deprecated)] + subgraphs: SubgraphsConfig { network: NetworkSubgraphConfig { @@ -103,7 +104,7 @@ pub async fn start_agent( ref escrow_min_balance_grt_wei, max_signers_per_payer, }, - escrow: EscrowSubgraphConfig { .. }, + escrow: _, // Deprecated and ignored }, tap: TapConfig { sender_aggregator_endpoints, diff --git a/crates/tap-agent/src/agent/sender_account.rs b/crates/tap-agent/src/agent/sender_account.rs index 9a1399657..b7e064608 100644 --- a/crates/tap-agent/src/agent/sender_account.rs +++ b/crates/tap-agent/src/agent/sender_account.rs @@ -398,7 +398,7 @@ pub struct SenderAccountConfig { pub rav_request_receipt_limit: u64, /// Current indexer address pub indexer_address: Address, - /// Polling interval for escrow subgraph + /// Polling interval for escrow accounts pub escrow_polling_interval: Duration, /// Timeout used while creating [SenderAccount] /// @@ -423,7 +423,7 @@ impl SenderAccountConfig { rav_request_buffer: config.tap.rav_request.timestamp_buffer_secs, rav_request_receipt_limit: config.tap.rav_request.max_receipts_per_request, indexer_address: config.indexer.indexer_address, - escrow_polling_interval: config.subgraphs.escrow.config.syncing_interval_secs, + escrow_polling_interval: config.subgraphs.network.config.syncing_interval_secs, max_amount_willing_to_lose_grt: config.tap.max_amount_willing_to_lose_grt.get_value(), trigger_value: config.tap.get_trigger_value(), rav_request_timeout: config.tap.rav_request.request_timeout_secs, diff --git a/docs/migration-config/README.md b/docs/migration-config/README.md index 16e3f717c..327a96d0b 100644 --- a/docs/migration-config/README.md +++ b/docs/migration-config/README.md @@ -11,30 +11,6 @@ Please take a deeper look at the config, but 90% of the time you'll be safe just using it. If you find any issues using this config, feel free to open an issue. -## Missing configuration fields - -The new stack requires adding an escrow subgraph, -similar to the current network subgraph field. - -You can edit the config yourself and add the following fields: - -``` -[subgraphs.escrow] -query_url = "" -deployment_id = "" -``` - -You can also add these environment variables in your new setup: - -``` -INDEXER_SUBGRAPHS__ESCROW__QUERY_URL= -INDEXER_SUBGRAPHS__ESCROW__DEPLOYMENT_ID= -``` - -Users typically have an easier time using the config over -environment variables, we recommend moving your environment -variables to plain text inside the config over time. - ## Booleans inside config The configuration doesn't accept booleans as strings, so in diff --git a/docs/migration-config/arbitrum-config.toml b/docs/migration-config/arbitrum-config.toml index 258ee0287..00d139a44 100644 --- a/docs/migration-config/arbitrum-config.toml +++ b/docs/migration-config/arbitrum-config.toml @@ -19,16 +19,10 @@ status_url = "${INDEXER_SERVICE_GRAPH_NODE_STATUS_ENDPOINT}" query_url = "${INDEXER_SERVICE_NETWORK_SUBGRAPH_ENDPOINT}" deployment_id = "${INDEXER_SERVICE_NETWORK_SUBGRAPH_DEPLOYMENT}" -# [subgraphs.escrow] -# INDEXER_SUBGRAPHS__ESCROW__QUERY_URL -# query_url = "" -# INDEXER_SUBGRAPHS__ESCROW__DEPLOYMENT_ID -# deployment_id = "" - [blockchain] chain_id = 42161 -# Contract address of TAP's receipt aggregate voucher (RAV) verifier. -receipts_verifier_address = "0x33f9E93266ce0E108fc85DdE2f71dab555A0F05a" +receipts_verifier_address_v2="0x8f69F5C07477Ac46FBc491B1E6D91E2bb0111A9e" +subgraph_service_address="0xb2Bb92d0DE618878E438b55D5846cfecD9301105" ############################################## # Specific configurations to indexer-service # @@ -40,9 +34,6 @@ host_and_port = "0.0.0.0:${INDEXER_SERVICE_PORT}" # Serve the network subgraph on `common.server.host_and_port`/network # INDEXER_SERVICE__SERVE_NETWORK_SUBGRAPH # serve_network_subgraph = false -# Serve the escrow subgraph on `common.server.host_and_port`/escrow -# INDEXER_SERVICE__SERVE_ESCROW_SUBGRAPH -# serve_escrow_subgraph = false free_query_auth_token = "${INDEXER_SERVICE_FREE_QUERY_AUTH_TOKEN}" diff --git a/docs/migration-config/arbitrum-sepolia-config.toml b/docs/migration-config/arbitrum-sepolia-config.toml index 5d487cdb8..af9689497 100644 --- a/docs/migration-config/arbitrum-sepolia-config.toml +++ b/docs/migration-config/arbitrum-sepolia-config.toml @@ -19,16 +19,10 @@ status_url = "${INDEXER_SERVICE_GRAPH_NODE_STATUS_ENDPOINT}" query_url = "${INDEXER_SERVICE_NETWORK_SUBGRAPH_ENDPOINT}" deployment_id = "${INDEXER_SERVICE_NETWORK_SUBGRAPH_DEPLOYMENT}" -# [subgraphs.escrow] -# INDEXER_SUBGRAPHS__ESCROW__QUERY_URL -# query_url = "" -# INDEXER_SUBGRAPHS__ESCROW__DEPLOYMENT_ID -# deployment_id = "" - [blockchain] chain_id = 421614 -# Contract address of TAP's receipt aggregate voucher (RAV) verifier. -receipts_verifier_address = "0xfC24cE7a4428A6B89B52645243662A02BA734ECF" +receipts_verifier_address_v2="0x382863e7B662027117449bd2c49285582bbBd21B" +subgraph_service_address="0xc24A3dAC5d06d771f657A48B20cE1a671B78f26b" ############################################## # Specific configurations to indexer-service # @@ -40,9 +34,6 @@ host_and_port = "0.0.0.0:${INDEXER_SERVICE_PORT}" # Serve the network subgraph on `common.server.host_and_port`/network # INDEXER_SERVICE__SERVE_NETWORK_SUBGRAPH # serve_network_subgraph = false -# Serve the escrow subgraph on `common.server.host_and_port`/escrow -# INDEXER_SERVICE__SERVE_ESCROW_SUBGRAPH -# serve_escrow_subgraph = false free_query_auth_token = "${INDEXER_SERVICE_FREE_QUERY_AUTH_TOKEN}"