Skip to content

Commit 12e4c16

Browse files
committed
feat(config): enable horizon
1 parent 57283db commit 12e4c16

File tree

4 files changed

+38
-9
lines changed

4 files changed

+38
-9
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: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ 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). This is the old escrow subgraph.
71+
# NOTE: This is not used in v2, as the escrow subgraph is now in the network subgraph.
72+
query_url = "http://example.com/escrow-subgraph"
7273
# Optional, Auth token will used a "bearer auth"
7374
# query_auth_token = "super-secret"
7475

@@ -78,6 +79,8 @@ deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
7879
# Refreshing interval for the Escrow contracts information from the Escrow subgraph.
7980
syncing_interval_secs = 60
8081

82+
# NOTE: V2 escrow accounts are now in the network subgraph, not a separate escrow_v2 subgraph
83+
8184
[blockchain]
8285
# The chain ID of the network that the graph network is running on
8386
chain_id = 1337
@@ -170,4 +173,9 @@ hardhat = "100"
170173
"eip155:1337" = "hardhat"
171174

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

0 commit comments

Comments
 (0)