-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
134 lines (114 loc) · 4.49 KB
/
config.example.yaml
File metadata and controls
134 lines (114 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Lab Backend Configuration
# This config uses external URLs that work for local development
# In Kubernetes, these can be overridden via ConfigMap to use internal DNS
server:
# HTTP server settings
port: 8080
host: "0.0.0.0"
# Timeouts
read_timeout: 30s
write_timeout: 30s
shutdown_timeout: 10s
# Logging
log_level: "info" # trace, debug, info, warn, error, fatal, panic
# Redis config
redis:
address: "localhost:6379"
password: ""
db: 0
dial_timeout: 5s
read_timeout: 3s
write_timeout: 3s
pool_size: 10
# Leader election config
leader:
lock_key: "lab:leader:lock"
lock_ttl: 30s # Leader lock expires after 30s
renew_interval: 10s # Leader renews lock every 10s
retry_interval: 5s # Followers retry acquiring leadership every 5s
# Cartographoor integration
# Dynamically discover and manage networks from ethPandaOps cartographoor
cartographoor:
source_url: "https://ethpandaops-platform-production-cartographoor.ams3.cdn.digitaloceanspaces.com/networks.json"
refresh_interval: 5m # How often the leader refreshes network data from upstream
request_timeout: 30s # HTTP request timeout for fetching data
networks_ttl: 0s # Redis TTL for networks data (0s = no expiration)
# Bounds service configuration
# Fetches and caches min/max position bounds for incremental CBT tables
bounds:
refresh_interval: 10s # How often the leader refreshes bounds data from upstream (minimum 5s)
request_timeout: 30s # HTTP request timeout for fetching bounds (minimum 5s)
bounds_ttl: 0s # Redis TTL for bounds data (0s = no expiration)
# Rate limiting configuration
# IP-based rate limiting using Redis for distributed state across multiple instances
rate_limiting:
enabled: true
# Behavior when Redis is unavailable
# Options: "fail_open" (allow requests, prioritize availability) or "fail_closed" (deny requests, prioritize security)
failure_mode: "fail_open"
# IPs/CIDR ranges that bypass rate limiting (e.g., monitoring, internal services)
exempt_ips:
- "127.0.0.1" # Localhost IPv4
- "::1" # Localhost IPv6
# Add your internal network ranges here, e.g.:
# - "10.0.0.0/8" # Internal network
# - "172.16.0.0/12" # Docker default
# - "192.168.0.0/16" # Private network
# Rate limit rules (evaluated in order, first match wins)
rules:
# Expensive bounds queries - stricter limit
- name: "bounds_endpoint"
path_pattern: "^/api/v1/.*/bounds$"
limit: 60 # 60 requests per minute per IP
window: "1m"
# API proxy passthrough - moderate limit
- name: "api_proxy"
path_pattern: "^/api/v1/.*"
limit: 300 # 300 requests per minute per IP
window: "1m"
# Default catch-all for other endpoints
- name: "default"
path_pattern: ".*"
limit: 100 # 100 requests per minute per IP
window: "1m"
# Network configuration (optional overrides and additions)
# Cartographoor provides base networks - use this section to:
# 1. Disable specific cartographoor networks
# 2. Override metadata/URLs for cartographoor networks
# 3. Add custom/local networks not in cartographoor
#
# All fields except 'name' are optional. Cartographoor is the source of truth,
# and config.yaml values override cartographoor when explicitly set.
networks:
# Example: Disable a cartographoor network
# - name: sepolia
# enabled: false
# Example: Override URL and metadata for a cartographoor network
# - name: mainnet
# enabled: true
# target_url: "https://my-custom-cbt.example.com/api/v1"
# display_name: "Ethereum Mainnet"
# chain_id: 1
# genesis_time: 1606824023
# genesis_delay: 0
# Example: Add a custom network not in cartographoor
# - name: my-local-devnet
# enabled: true
# target_url: "http://localhost:8080/api/v1"
# display_name: "My Local Devnet"
# chain_id: 32382
# genesis_time: 1234567890
# genesis_delay: 10
# Note: Networks from cartographoor are automatically added with all metadata.
# Only add entries here to disable, override, or add custom networks.
# Experiment feature flags
# Controls which experiments are available per network
# By default, experiments are enabled for all networks unless overridden
experiments:
live-slots:
enabled: true
networks: ["mainnet"] # Only enabled for mainnet
block-production:
enabled: false # Disabled for all networks
attestation-performance:
enabled: true # Enabled for all networks (no networks specified = default)