Skip to content

Commit 71efdb2

Browse files
committed
feat(config): enable horizon
1 parent 1ac24b9 commit 71efdb2

File tree

5 files changed

+39
-13
lines changed

5 files changed

+39
-13
lines changed

crates/config/default_values.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ max_receipts_per_request = 10000
3434
0xDD6a6f76eb36B873C1C184e8b9b9e762FE216490 = "https://tap-aggregator-arbitrum-one.graphops.xyz"
3535

3636
[horizon]
37-
enabled = false
37+
enabled = true

crates/config/maximal-config-example.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ recently_closed_allocation_buffer_secs = 3600
6767

6868
[subgraphs.escrow]
6969
# NOTE: It is heavily recomended to use both `query_url` and `deployment_id`,
70-
# Query URL for the Escrow subgraph.
71-
query_url = "http://example.com/network-subgraph"
70+
# Query URL for the Escrow subgraph (v1).
71+
query_url = "http://example.com/escrow-subgraph"
7272
# Optional, Auth token will used a "bearer auth"
7373
# query_auth_token = "super-secret"
7474

@@ -78,6 +78,8 @@ deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
7878
# Refreshing interval for the Escrow contracts information from the Escrow subgraph.
7979
syncing_interval_secs = 60
8080

81+
# NOTE: V2 escrow accounts are now in the network subgraph, not a separate escrow_v2 subgraph
82+
8183
[blockchain]
8284
# The chain ID of the network that the graph network is running on
8385
chain_id = 1337
@@ -170,4 +172,9 @@ hardhat = "100"
170172
"eip155:1337" = "hardhat"
171173

172174
[horizon]
173-
enabled = false
175+
# Enable Horizon migration support and detection
176+
# When enabled: Check if Horizon contracts are active in the network
177+
# - If Horizon contracts detected: Hybrid migration mode (new V2 receipts only, process existing V1 receipts)
178+
# - If Horizon contracts not detected: Remain in legacy mode (V1 receipts only)
179+
# When disabled: Pure legacy mode, no Horizon detection performed
180+
enabled = true

crates/config/minimal-config-example.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ query_url = "http://example.com/network-subgraph"
4242
deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
4343

4444
[subgraphs.escrow]
45-
# Query URL for the Escrow subgraph.
46-
query_url = "http://example.com/network-subgraph"
45+
# Query URL for the Escrow subgraph (v1).
46+
query_url = "http://example.com/escrow-subgraph"
4747
# Optional, deployment to look for in the local `graph-node`, if locally indexed.
4848
# Locally indexing the subgraph is recommended.
4949
# NOTE: Use `query_url` or `deployment_id` only
@@ -63,3 +63,11 @@ receipts_verifier_address = "0x2222222222222222222222222222222222222222"
6363
# Key-Value of all senders and their aggregator endpoints
6464
0xDDE4cfFd3D9052A9cb618fC05a1Cd02be1f2F467 = "https://tap-aggregator.network.thegraph.com"
6565
0xDD6a6f76eb36B873C1C184e8b9b9e762FE216490 = "https://tap-aggregator-arbitrum-one.graphops.xyz"
66+
67+
[horizon]
68+
# Enable Horizon migration support and detection
69+
# When enabled: Check if Horizon contracts are active in the network
70+
# - If Horizon contracts detected: Hybrid migration mode (new V2 receipts only, process existing V1 receipts)
71+
# - If Horizon contracts not detected: Remain in legacy mode (V1 receipts only)
72+
# When disabled: Pure legacy mode, no Horizon detection performed
73+
enabled = true

crates/config/src/config.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ impl MetricsConfig {
303303
pub struct SubgraphsConfig {
304304
pub network: NetworkSubgraphConfig,
305305
pub escrow: EscrowSubgraphConfig,
306+
// Note: V2 escrow accounts are in the network subgraph, not a separate escrow_v2 subgraph
306307
}
307308

308309
#[serde_as]
@@ -446,12 +447,24 @@ pub struct RavRequestConfig {
446447
pub max_receipts_per_request: u64,
447448
}
448449

449-
/// Configuration for the horizon
450-
/// standard
450+
/// Configuration for the horizon migration
451451
#[derive(Debug, Default, Deserialize)]
452452
#[cfg_attr(test, derive(PartialEq))]
453453
pub struct HorizonConfig {
454-
/// Whether the horizon is enabled or not
454+
/// Enable Horizon migration support and detection
455+
///
456+
/// When enabled (true):
457+
/// - System will check if Horizon contracts are active in the network
458+
/// - If Horizon contracts are detected: Enable hybrid migration mode
459+
/// * Accept new V2 TAP receipts only
460+
/// * Continue processing existing V1 receipts for RAV generation
461+
/// * Reject new V1 receipt submissions
462+
/// - If Horizon contracts are not detected: Remain in legacy mode
463+
///
464+
/// When disabled (false):
465+
/// - Pure legacy mode, no Horizon detection performed
466+
/// - Only V1 TAP receipts are supported
467+
#[serde(default)]
455468
pub enabled: bool,
456469
}
457470

crates/tap-agent/src/agent.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,8 @@ pub async fn start_agent() -> (ActorRef<SenderAccountsManagerMessage>, JoinHandl
176176

177177
let config = Box::leak(Box::new({
178178
let mut config = SenderAccountConfig::from_config(&CONFIG);
179-
// FIXME: This is a temporary measure to disable
180-
// Horizon, even if enabled through our configuration file.
181-
// Force disable Horizon support
182-
config.horizon_enabled = false;
179+
// Enable Horizon support
180+
config.horizon_enabled = true;
183181
// Add a warning log so operators know their setting was ignore
184182
if CONFIG.horizon.enabled {
185183
tracing::warn!(

0 commit comments

Comments
 (0)