Skip to content

Commit da2bdfd

Browse files
committed
refactor: configure system for transition mode
Signed-off-by: Joseph Livesey <[email protected]>
1 parent 8c06699 commit da2bdfd

File tree

9 files changed

+369
-92
lines changed

9 files changed

+369
-92
lines changed

contrib/indexer-service/config.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,8 @@ trigger_value_divisor = 500_000
4646
"ACCOUNT0_ADDRESS_PLACEHOLDER" = "http://tap-aggregator:7610"
4747

4848
[horizon]
49-
enabled = true
49+
# Horizon migration mode: legacy | transition | full
50+
# - legacy: Only v1 TAP receipts supported (pre-migration)
51+
# - transition: Both v1 and v2 TAP receipts supported (during migration)
52+
# - full: Only v2 TAP receipts supported (post-migration)
53+
mode = "transition"

contrib/tap-agent/config.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,8 @@ trigger_value_divisor = 500_000
4646
"ACCOUNT0_ADDRESS_PLACEHOLDER" = "http://tap-aggregator:7610"
4747

4848
[horizon]
49-
enabled = true
49+
# Horizon migration mode: legacy | transition | full
50+
# - legacy: Only v1 TAP receipts supported (pre-migration)
51+
# - transition: Both v1 and v2 TAP receipts supported (during migration)
52+
# - full: Only v2 TAP receipts supported (post-migration)
53+
mode = "transition"

crates/config/maximal-config-example.toml

Lines changed: 11 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,14 @@ deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
7878
# Refreshing interval for the Escrow contracts information from the Escrow subgraph.
7979
syncing_interval_secs = 60
8080

81+
[subgraphs.escrow_v2]
82+
# Query URL for the Escrow v2 subgraph (Horizon).
83+
query_url = "http://example.com/escrow-v2-subgraph"
84+
# Optional, Auth token will used a "bearer auth"
85+
# query_auth_token = "super-secret"
86+
# Refreshing interval for the Escrow v2 contracts information.
87+
syncing_interval_secs = 30
88+
8189
[blockchain]
8290
# The chain ID of the network that the graph network is running on
8391
chain_id = 1337
@@ -170,4 +178,4 @@ hardhat = "100"
170178
"eip155:1337" = "hardhat"
171179

172180
[horizon]
173-
enabled = false
181+
mode = "transition"

crates/config/minimal-config-example.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,18 @@ 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
5050
deployment_id = "Qmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
5151

52+
[subgraphs.escrow_v2]
53+
# Query URL for the Escrow v2 subgraph (Horizon).
54+
query_url = "http://example.com/escrow-v2-subgraph"
55+
syncing_interval_secs = 30
56+
5257
[blockchain]
5358
# The chain ID of the network that the graph network is running on
5459
chain_id = 1337
@@ -63,3 +68,6 @@ receipts_verifier_address = "0x2222222222222222222222222222222222222222"
6368
# Key-Value of all senders and their aggregator endpoints
6469
0xDDE4cfFd3D9052A9cb618fC05a1Cd02be1f2F467 = "https://tap-aggregator.network.thegraph.com"
6570
0xDD6a6f76eb36B873C1C184e8b9b9e762FE216490 = "https://tap-aggregator-arbitrum-one.graphops.xyz"
71+
72+
[horizon]
73+
mode = "transition"

crates/config/src/config.rs

Lines changed: 16 additions & 2 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+
pub escrow_v2: Option<EscrowSubgraphConfig>,
306307
}
307308

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

450+
/// Horizon upgrade mode configuration
451+
#[derive(Debug, Clone, Deserialize, PartialEq, Default)]
452+
#[serde(rename_all = "lowercase")]
453+
pub enum HorizonMode {
454+
/// Legacy mode: Only v1 TAP receipts supported
455+
#[default]
456+
Legacy,
457+
/// Transition mode: Both v1 and v2 TAP receipts supported (for migration)
458+
Transition,
459+
/// Full mode: Only v2 TAP receipts supported (post-migration)
460+
Full,
461+
}
462+
449463
/// Configuration for the horizon
450464
/// standard
451465
#[derive(Debug, Default, Deserialize)]
452466
#[cfg_attr(test, derive(PartialEq))]
453467
pub struct HorizonConfig {
454-
/// Whether the horizon is enabled or not
455-
pub enabled: bool,
468+
/// Horizon upgrade mode
469+
pub mode: HorizonMode,
456470
}
457471

458472
#[cfg(test)]

0 commit comments

Comments
 (0)