Skip to content

Commit 5043ac7

Browse files
authored
refactor(REO): rename to RewardsEligibilityOracle, reduce initial requirements (#39)
* chore(SQO): lint markdown docs * chore(REO): update ServiceQualityOracle refs to RewardsEligibilityOracle * feat(REO): Reduce requirements for launch Indexers are now only expected to serve queries on 1 subgraph, at launch, to be eligible for rewards. * test(REO): update SQL snapshot for MIN_SUBGRAPHS=1 Updates the BigQuery SQL query snapshot to reflect the reduced MIN_SUBGRAPHS requirement from 10 to 1 for launch. * Empty commit
1 parent d1daf2d commit 5043ac7

File tree

15 files changed

+163
-151
lines changed

15 files changed

+163
-151
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4040
### Added
4141
- Daily BigQuery performance data fetching from Google BigQuery
4242
- Indexer eligibility processing based on threshold algorithms
43-
- On-chain oracle updates to ServiceQualityOracle contract
43+
- On-chain oracle updates to RewardsEligibilityOracle contract
4444
- RPC provider failover with circuit breaker pattern
4545
- Slack notifications for monitoring
4646
- Docker containerization with health checks

CLAUDE.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
77
Service Quality Oracle is a Python-based Docker containerized service that:
88
- Fetches indexer performance data from Google BigQuery daily at 10:00 UTC
99
- Processes data to determine indexer issuance rewards eligibility based on threshold algorithms
10-
- Posts eligibility updates on-chain to the ServiceQualityOracle contract
10+
- Posts eligibility updates on-chain to the RewardsEligibilityOracle contract
1111
- Implements resilient RPC failover with circuit breaker pattern
1212
- Sends Slack notifications for monitoring
1313

@@ -145,6 +145,7 @@ The system follows a clear data pipeline with daily scheduled execution:
145145
### ⚠️ CRITICAL: This is a PUBLIC repository
146146

147147
### Sensitive Information Handling
148+
148149
- **NEVER commit secrets, keys, or credentials** to the repository
149150
- **NEVER commit actual config.toml files** - only commit config.toml.example with placeholder values
150151
- Always follow security best practices when handling private keys and API tokens
@@ -153,26 +154,31 @@ The system follows a clear data pipeline with daily scheduled execution:
153154
- Verify that .gitignore properly excludes sensitive files before committing
154155

155156
### Protected File Types (automatically ignored by .gitignore)
157+
156158
- Environment files: `.env`, `.env.*`
157159
- Configuration: `config.toml`, `credentials.json`
158160
- Keys/Certificates: `*.key`, `*.pem`, `*.p12`, `*.pfx`
159161
- Secret directories: `**/secrets/`, `**/private/`, `.secrets`
160162

161163
### Security Checklist Before Commits
164+
162165
1. ✅ Run `git status` and verify no sensitive files are staged
163166
2. ✅ Review `git diff --cached` for any accidentally included secrets
164167
3. ✅ Ensure all examples use placeholder values (e.g., `"your_key_here"`)
165168
4. ✅ Never hardcode real addresses, URLs, or API endpoints
166169
5. ✅ Use descriptive placeholder text that shows expected format
167170

168171
### Emergency: If Sensitive Data is Committed
172+
169173
1. **DO NOT** just delete the file in a new commit - the data remains in Git history
170174
2. Immediately rotate/invalidate the exposed credentials
171175
3. Contact repository administrators to discuss history rewriting if necessary
172176
4. Consider the credential permanently compromised
173177

174178
# Session Context Import
179+
175180
@./SESSION_CONTEXT.md
176181

177182
# Style Guidelines Import
183+
178184
@./STYLE_GUIDELINES.md

ELIGIBILITY_CRITERIA.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# Indexing Rewards Eligibility Criteria
2+
13
This document defines the requirements an Indexer must meet to be eligible for indexing rewards. It includes the current active criteria, a schedule of any upcoming changes, and a log of all historical requirements. The goal is to provide a transparent and predictable set of standards for all network participants.
24

35
---
46

5-
# Upcoming Eligibility Criteria
7+
## Upcoming Eligibility Criteria
68

79
**We will announce changes to the eligibility criteria in the table below.** Once the change goes live, it will be reflected in the [Active Eligibility Criteria](https://github.com/graphprotocol/service-quality-oracle/blob/main/ELIGIBILITY_CRITERIA.md#active-eligibility-criteria) section of this document.
810

@@ -15,32 +17,32 @@ This document defines the requirements an Indexer must meet to be eligible for i
1517
1618
---
1719

18-
# Active Eligibility Criteria
20+
## Active Eligibility Criteria
1921

2022
The following criteria are used to identify indexers that should be eligible to receive indexing rewards.
2123

2224
- **Days Online Requirement:** Indexers must be active for **5+ days** in a given **28 day** period for rewards eligibility.
23-
- **Daily Query Requirement:** To be active, an indexer must serve at least **1 qualifying query** on **10 different subgraphs**.
25+
- **Daily Query Requirement:** To be active, an indexer must serve at least **1 qualifying query**.
2426
- **Query Quality Requirements:** A qualifying query is one that simultaneously meets **all** of the following criteria:
2527
- Query Response HTTP Status: **200 OK**.
2628
- Query Response Latency: **< 5,000 ms**.
2729
- Query Freshness: **< 50,000 blocks** behind chainhead.
2830

29-
Eligibility for indexing rewards is typically refreshed daily via the ServiceQualityOracle contract.
31+
Eligibility for indexing rewards is typically refreshed daily via the RewardsEligibilityOracle contract.
3032

3133
> **Note**:
32-
> Once an indexer has successfully qualified for indexing rewards by satisfying the active eligibility criteria, and a corresponding transaction has been submitted on chain by an authorized Oracle into the ServiceQualityOracle contract, the now eligible indexer can continue claiming indexing rewards from the protocol for the duration of the qualification period (default is 14 days), even if the active eligibility criteria change.
34+
> Once an indexer has successfully qualified for indexing rewards by satisfying the active eligibility criteria, and a corresponding transaction has been submitted on chain by an authorized Oracle into the RewardsEligibilityOracle contract, the now eligible indexer can continue claiming indexing rewards from the protocol for the duration of the qualification period (default is 14 days), even if the active eligibility criteria change.
3335
3436
---
3537

36-
# Eligibility Requirements Changelog
38+
## Eligibility Requirements Changelog
3739

3840
This table tracks changes to the indexing rewards eligibility requirements over time.
3941

4042
| Requirement Category | Requirement Details | Effective Date (YYYY-MM-DD) | Change Type: Initial, Updated, New, Removed | Justification | Notes |
4143
|----------------------|---------------------|-----------------------------|-------------|---------------|-------|
42-
| **Indexer Activity** | Indexers must be active for **5+ days** in a given **28 day** period for indexing rewards eligibility. | TBD | Initial | Encourages indexers to familiarize themselves with infrastructure maintenance and ongoing operations. | Planned for Service Quality Oracle launch |
43-
| **Query Qualification** | Indexers must serve **≥1 qualifying query** on **≥10 different subgraphs** in a day for the day to count towards the **Indexer Activity** requirement. | TBD | Initial | Encourages indexers to become familiar with the process of syncing a range of subgraphs. | Planned for Service Quality Oracle launch |
44-
| **Query Response Quality** | ** Query Response HTTP Status: **200 OK**<br>** Query Response Latency: **< 5,000 ms**<br>** Query Freshness: **< 50,000 blocks** behind chainhead. | TBD | Initial | ** Indexer infrastructure needs to serve successful queries to benefit data consumers.<br>** Fast query responses are important to data consumers.<br>** Encourages indexers to sync to chainhead. | Planned for Service Quality Oracle launch |
44+
| **Indexer Activity** | Indexers must be active for **5+ days** in a given **28 day** period for indexing rewards eligibility. | TBD | Initial | Encourages indexers to familiarize themselves with infrastructure maintenance and ongoing operations. | Planned for Rewards Eligibility Oracle launch |
45+
| **Query Qualification** | Indexers must serve **≥1 qualifying query** in a day for the day to count towards the **Indexer Activity** requirement. | TBD | Initial | Encourages indexers to become familiar with the process of syncing and serving subgraph data. | Planned for Rewards Eligibility Oracle launch |
46+
| **Query Response Quality** | ** Query Response HTTP Status: **200 OK**<br>** Query Response Latency: **< 5,000 ms**<br>** Query Freshness: **< 50,000 blocks** behind chainhead. | TBD | Initial | ** Indexer infrastructure needs to serve successful queries to benefit data consumers.<br>** Fast query responses are important to data consumers.<br>** Encourages indexers to sync to chainhead. | Planned for Rewards Eligibility Oracle launch |
4547

4648
---

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
## Overview
44

5-
This repository implements a Docker container service for the Service Quality Oracle. The oracle consumes data from BigQuery, processes it to determine indexer issuance rewards eligibility, based on a defined threshold algorithm, and posts issuance eligibility data on-chain.
5+
This repository implements a Docker container service for the Rewards Eligibility Oracle. The oracle consumes data from BigQuery, processes it to determine indexer rewards eligibility, based on a defined threshold algorithm, and posts rewards eligibility data on-chain.
66

77
### Key Features
88

99
The oracle runs with the following functionality:
1010
- **BigQuery Integration**: Fetches indexer performance data from Google BigQuery
11-
- **Eligibility Processing**: Applies threshold algorithm to determine issuance rewards eligibility based on service quality
12-
- **Blockchain Integration**: Posts issuance eligibility updates to the ServiceQualityOracle contract
11+
- **Eligibility Processing**: Applies threshold algorithm to determine rewards eligibility based on service quality
12+
- **Blockchain Integration**: Posts rewards eligibility updates to the RewardsEligibilityOracle contract
1313
- **Slack Notifications**: Sends success/failure notifications for monitoring
1414
- **Docker Deployment**: Containerized and running with health checks
1515
- **Scheduled Execution**: Runs daily at 10:00 UTC
@@ -43,7 +43,7 @@ export SLACK_WEBHOOK_URL="your_webhook_url"
4343

4444
## Eligibility Criteria
4545

46-
Please refer to the [ELIGIBILITY_CRITERIA.md](./ELIGIBILITY_CRITERIA.md) file to view the latest criteria for issuance. We are also posting upcoming criteria in that document.
46+
Please refer to the [ELIGIBILITY_CRITERIA.md](./ELIGIBILITY_CRITERIA.md) file to view the latest criteria for rewards eligibility. We are also posting upcoming criteria in that document.
4747

4848
## Data Flow
4949

STYLE_GUIDELINES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,43 @@ This document defines the coding style guidelines for Python code in this reposi
55
## Core Style Guidelines
66

77
### 1. Comments Before Logical Blocks
8+
89
Add descriptive comments above logical blocks when the purpose needs clarification or when explaining complex operations and error handling.
910

1011
### 2. Blank Lines Before Comments (Except After Docstrings)
12+
1113
Include a blank line before each comment that is before a logical block, except when the comment directly follows a function's docstring.
1214

1315
### 3. Blank Lines After Logical Sections Complete
16+
1417
After a logical block completes (end of loops, after appending to lists, etc.), include a blank line before the next comment/section. This helps improve readability of the code.
1518

1619
### 4. Comments Describe "What" Not "How"
20+
1721
Comments should describe what the code accomplishes rather than implementation details.
1822

1923
### 5. Spacing Within Control Structures
24+
2025
Inside try/except blocks and if/else statements, include a blank line after each branch's code block completes.
2126

2227
### 6. Comments for Primary and Fallback Logic
28+
2329
Both the main execution path and fallback/error handling should have descriptive comments when their purpose isn't immediately self-evident.
2430

2531
### 7. Comments for Final Actions
32+
2633
Simple operations at the end of functions should have descriptive comments when the purpose needs clarification.
2734

2835
### 8. Two Blank Lines Between Functions/Methods/Classes
36+
2937
Two blank lines before all function/method/class definitions, whether top-level or nested.
3038

3139
### 9. Compress long comments, don't truncate
40+
3241
When comments exceed the 115-character line limit, compress them by removing unnecessary articles and prepositions while preserving full meaning, rather than truncating important information.
3342

3443
### 10. Code clarity not guideline following perfection
44+
3545
The code is more important than the style guidelines
3646

3747
## Integration with Code Formatting Tools
@@ -42,6 +52,7 @@ These style guidelines work in conjunction with automated formatting tools:
4252
- **Custom formatter**: Applies additional spacing rules via `scripts/ruff_check_format_assets.sh`
4353

4454
Always run the formatting script before committing:
55+
4556
```bash
4657
./scripts/ruff_check_format_assets.sh
4758
```

config.toml.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ BIGQUERY_TABLE_ID = ""
1313

1414
[blockchain]
1515
BLOCKCHAIN_CONTRACT_ADDRESS = ""
16-
BLOCKCHAIN_FUNCTION_NAME = ""
16+
BLOCKCHAIN_FUNCTION_NAME = "renewIndexerEligibility"
1717
BLOCKCHAIN_CHAIN_ID = ""
1818
BLOCKCHAIN_RPC_URLS = [
1919
"",
@@ -44,7 +44,7 @@ FORCE_BIGQUERY_REFRESH = "false"
4444

4545
[eligibility_criteria]
4646
MIN_ONLINE_DAYS = "5"
47-
MIN_SUBGRAPHS = "10"
47+
MIN_SUBGRAPHS = "1"
4848
MAX_LATENCY_MS = "5000"
4949
MAX_BLOCKS_BEHIND = "50000"
5050

0 commit comments

Comments
 (0)