Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
0de8ddb
fix(token-distribution): deterministic GraphClient extraction
RembrandtK Jan 31, 2026
4e83401
feat: upgrade contracts and tooling for Hardhat 3 and Forge
RembrandtK Jan 30, 2026
ad68e97
refactor: move contrcats and issuance test packages
RembrandtK Jan 30, 2026
3239851
feat(lint): adding forge lint and other lint configuration updates
RembrandtK Jan 30, 2026
f069c43
fix(lint): mock and test lint fixes
RembrandtK Jan 31, 2026
3600b22
feat: add deployment package
RembrandtK Jan 31, 2026
0cce1a5
feat: deploy RewardsEligibilityOracle to Arbitrum Sepolia
RembrandtK Jan 31, 2026
15426cd
feat(build): suppress build/test/lint that depends on code to be audited
RembrandtK Jan 31, 2026
4288133
fix(build): add placeholder issuance types for baseline build
RembrandtK Feb 2, 2026
b838a8e
feat(build): suppress build/test/lint that depends on code to be audited
RembrandtK Jan 31, 2026
fdd4c35
chore: undo baseline test and package exclusions
RembrandtK Jan 30, 2026
32a5d1e
fix: upgrade CI Node.js to 22 for Hardhat 3.x compatibility
RembrandtK Feb 2, 2026
fe6b1c4
chore: lint fixes
RembrandtK Feb 1, 2026
e1d391d
refactor: lint optimisations
RembrandtK Feb 1, 2026
4eea0a1
feat(compiler): 0.8.33 with via IR Solidity compiler
RembrandtK Jan 31, 2026
214fbcd
feat: subgraph-service pragma 0.8.33
RembrandtK Feb 1, 2026
0d04b70
chore: update contract pragmas for 0.8.33
RembrandtK Feb 1, 2026
fb17025
refactor: consolidate public IssuanceAllocator interface
RembrandtK Feb 1, 2026
79e9538
refactor: consolidate public RewardsManager interface
RembrandtK Feb 1, 2026
8b365ad
refactor: consolidate public DisputeManager interface
RembrandtK Feb 1, 2026
23b77bc
refactor: consolidate public AllocationManager interface
RembrandtK Feb 1, 2026
b9b7a7c
refactor: consolidate public DataServicePausable interface
RembrandtK Feb 1, 2026
ce61f31
refactor: consolidate public SubgraphService interface
RembrandtK Feb 1, 2026
4ef521b
chore: add local minimal IGraphToken interface for issuance package
RembrandtK Feb 1, 2026
2252c19
fix: correct IGraphProxyAdmin interface signatures
RembrandtK Feb 1, 2026
9f1ddb4
refactor: rename RewardsReason to RewardsCondition
RembrandtK Feb 1, 2026
8481444
feat: extend RewardsCondition
RembrandtK Feb 1, 2026
354a11f
feat: add defaultReclaimAddress
RembrandtK Feb 2, 2026
bed8620
doc: IRewardsManager
RembrandtK Feb 2, 2026
ece40cd
feat: use AccessControlEnumerable in BaseUpgradeable
RembrandtK Feb 1, 2026
8ad2f28
feat: feat: split issuance getter (allocated/raw)
RembrandtK Feb 1, 2026
f86183f
feat: add private _getNewRewardsPerSignal to return unclaimable rewards
RembrandtK Feb 1, 2026
8a5ba11
feat: remove data param from RewardsReclaimed
RembrandtK Feb 2, 2026
8787824
feat: deny rewards for period that a subgraph deployment is denied
RembrandtK Feb 1, 2026
d99bf7b
refactor: simplify AllocationManager reward collection and add denial…
RembrandtK Feb 1, 2026
df0e0b8
docs: AllocationManager
RembrandtK Feb 2, 2026
620dec5
docs: RewardsManager
RembrandtK Feb 2, 2026
1e17d3e
docs: RewardsManagerStorage
RembrandtK Feb 2, 2026
781bf79
docs: rewards accounting
RembrandtK Feb 2, 2026
45f5af0
refactor: extract _getSubgraphRewardsState
RembrandtK Feb 2, 2026
7b8992e
refactor: _deniedRewards
RembrandtK Feb 2, 2026
80300d7
refactor: _reclaimRewards
RembrandtK Feb 2, 2026
bc7a67f
feat: reclaim for no signal in updateAccRewardsPerSignal
RembrandtK Feb 2, 2026
150b7a0
refactor: _getSubgraphAllocatedTokens
RembrandtK Feb 2, 2026
f830204
test: test updated rewards reclaim logic
RembrandtK Feb 1, 2026
2324bce
fixup! feat: reclaim for no signal in updateAccRewardsPerSignal
RembrandtK Feb 2, 2026
bbe4a9f
test: zero issuance timestamp update
RembrandtK Feb 2, 2026
a012282
refactor: cache storage variables in _onSubgraphSignalUpdate
RembrandtK Feb 2, 2026
ea39939
refactor: cache storage in updateAccRewardsPerSignal and onSubgraphSi…
RembrandtK Feb 2, 2026
025410f
fix: consistent reward reclaim for non-claimable subgraphs in both hooks
RembrandtK Feb 4, 2026
6d59cb8
refactor: replace bytes32(0) with RewardsCondition.NONE constant
RembrandtK Feb 4, 2026
74e0995
feat: update reward accumulators on deferred POI claims
RembrandtK Feb 4, 2026
16dbd73
fixup! fix: consistent reward reclaim for non-claimable subgraphs in …
RembrandtK Feb 5, 2026
80f8175
docs: document minimumSubgraphSignal retroactive application issue
RembrandtK Feb 16, 2026
22954a4
docs: improve reward documentation accuracy (TRST-R-2)
RembrandtK Feb 16, 2026
affc8b4
fix: remove redundant subgraphAllocatedTokens check (TRST-R-3)
RembrandtK Feb 16, 2026
5e31905
refactor: rename NO_ALLOCATION to NO_ALLOCATED_TOKENS
RembrandtK Feb 16, 2026
aa08230
fix: reclaim pending rewards on stale allocation resize (TRST-R-1)
RembrandtK Feb 16, 2026
3189519
Merge branch 'main' into issuance-baseline
RembrandtK Feb 17, 2026
ada3155
Merge pull request #1279 from graphprotocol/issuance-audit
RembrandtK Feb 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 31 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,35 @@ jobs:
echo "No YAML files to lint"
fi

- name: Lint Forge files
id: lint_forge
continue-on-error: true
run: |
# Find packages with lint:forge script defined
FORGE_PACKAGES=$(find packages -name "package.json" -exec grep -l '"lint:forge"' {} \; | xargs -I{} dirname {} | sort)
if [ -z "$FORGE_PACKAGES" ]; then
echo "No packages with lint:forge script found"
exit 0
fi
echo "Packages with lint:forge: $FORGE_PACKAGES"

if [ "${{ steps.lint_mode.outputs.mode }}" = "all" ]; then
echo "Linting all Forge files..."
pnpm lint:forge
elif [ "${{ steps.changed_files.outputs.sol_count }}" -gt "0" ]; then
# Build regex pattern from packages with lint:forge
FORGE_PATTERN=$(echo "$FORGE_PACKAGES" | tr '\n' '|' | sed 's/|$//')
FORGE_FILES=$(cat changed_sol.txt | grep -E "^($FORGE_PATTERN)/" || true)
if [ -n "$FORGE_FILES" ]; then
echo "Found Forge-related changes, running forge lint..."
pnpm lint:forge
else
echo "No Forge-related Solidity files changed"
fi
else
echo "No Solidity files to lint with Forge"
fi

- name: Check lint results
if: always()
run: |
Expand All @@ -238,7 +267,8 @@ jobs:
[ "${{ steps.lint_ts.outcome }}" = "failure" ] || \
[ "${{ steps.lint_md.outcome }}" = "failure" ] || \
[ "${{ steps.lint_json.outcome }}" = "failure" ] || \
[ "${{ steps.lint_yaml.outcome }}" = "failure" ]; then
[ "${{ steps.lint_yaml.outcome }}" = "failure" ] || \
[ "${{ steps.lint_forge.outcome }}" = "failure" ]; then
echo "❌ One or more linters failed"
exit 1
else
Expand Down
19 changes: 14 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,21 @@ packages/*/.eslintcache
dist/
dist-v5/
build/
deployments/hardhat/
*.js.map
*.d.ts.map

# Generated types (typechain output)
typechain/
typechain-src/
typechain-types/
types/
types-v5/
wagmi/
types/
deployments/hardhat/
*.js.map
*.d.ts.map
packages/contracts/types/
packages/contracts-test/types/
packages/interfaces/types/
packages/token-distribution/types/
packages/issuance/types/

# TypeScript incremental compilation cache
**/tsconfig.tsbuildinfo
Expand All @@ -52,6 +58,7 @@ bin/
.env
.DS_Store
.vscode
core

# Coverage and other reports
coverage/
Expand Down Expand Up @@ -104,3 +111,5 @@ tx-builder-*.json
# Tenderly
.tenderly-artifacts/

# NFS stale file handles
.nfs*
3 changes: 2 additions & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"MD013": false,
"MD024": { "siblings_only": true },
"MD029": { "style": "ordered" },
"MD033": false
"MD033": false,
"MD040": false
}
151 changes: 5 additions & 146 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,157 +165,16 @@ pnpm publish --recursive

Alternatively, there is a GitHub action that can be manually triggered to publish a package.

## Linting Configuration
## Linting

This monorepo uses a comprehensive linting setup with multiple tools to ensure code quality and consistency across all packages.

### Linting Tools Overview

- **ESLint**: JavaScript/TypeScript code quality and style enforcement
- **Prettier**: Code formatting for JavaScript, TypeScript, JSON, Markdown, YAML, and Solidity
- **Solhint**: Solidity-specific linting for smart contracts
- **Markdownlint**: Markdown formatting and style consistency
- **YAML Lint**: YAML file validation and formatting

### Configuration Architecture

The linting configuration follows a hierarchical structure where packages inherit from root-level configurations:

#### ESLint Configuration

- **Root Configuration**: `eslint.config.mjs` - Modern flat config format
- **Direct Command**: `npx eslint '**/*.{js,ts,cjs,mjs,jsx,tsx}' --fix`
- **Behavior**: ESLint automatically searches up parent directories to find configuration files
- **Package Inheritance**: Packages automatically inherit the root ESLint configuration without needing local config files
- **Global Ignores**: Configured to exclude autogenerated files (`.graphclient-extracted/`, `lib/`) and build outputs

#### Prettier Configuration

- **Root Configuration**: `prettier.config.cjs` - Base formatting rules for all file types
- **Direct Command**: `npx prettier -w --cache '**/*.{js,ts,cjs,mjs,jsx,tsx,json,md,sol,yml,yaml}'`
- **Package Inheritance**: Packages that need Prettier must have a `prettier.config.cjs` file that inherits from the shared config
- **Example Package Config**:

```javascript
const baseConfig = require('../../prettier.config.cjs')
module.exports = { ...baseConfig }
```

- **Ignore Files**: `.prettierignore` excludes lock files, build outputs, and third-party dependencies

#### Solidity Linting (Solhint)

- **Root Configuration**: `.solhint.json` - Base Solidity linting rules extending `solhint:recommended`
- **Direct Command**: `npx solhint 'contracts/**/*.sol'` (add `--fix` for auto-fixing)
- **List Applied Rules**: `npx solhint list-rules`
- **TODO Comment Checking**: `scripts/check-todos.sh` - Blocks commits and linting if TODO/FIXME/XXX/HACK comments are found in changed Solidity files
- **Package Inheritance**: Packages can extend the root config with package-specific rules
- **Configuration Inheritance Limitation**: Solhint has a limitation where nested `extends` don't work properly. When a local config extends a parent config that itself extends `solhint:recommended`, the built-in ruleset is ignored.
- **Recommended Package Extension Pattern**:

```json
{
"extends": ["solhint:recommended", "./../../.solhint.json"],
"rules": {
"no-console": "off",
"import-path-check": "off"
}
}
```

#### Markdown Linting (Markdownlint)

- **Root Configuration**: `.markdownlint.json` - Markdown formatting and style rules
- **Direct Command**: `npx markdownlint '**/*.md' --fix`
- **Ignore Files**: `.markdownlintignore` automatically picked up by markdownlint CLI
- **Global Application**: Applied to all markdown files across the monorepo

### Linting Scripts

#### Root Level Scripts

```bash
# Run all linting tools
pnpm lint

# Individual linting commands
pnpm lint:ts # ESLint + Prettier for TypeScript/JavaScript
pnpm lint:sol # TODO check + Solhint + Prettier for Solidity (runs recursively)
pnpm lint:md # Markdownlint + Prettier for Markdown
pnpm lint:json # Prettier for JSON files
pnpm lint:yaml # YAML linting + Prettier

# Lint only staged files (useful for manual pre-commit checks)
pnpm lint:staged # Run linting on git-staged files only
```

#### Package Level Scripts

Each package can define its own linting scripts that work with the inherited configurations:
This monorepo uses multiple linting tools: ESLint, Prettier, Solhint, Forge Lint, Markdownlint, and YAML Lint.

```bash
# Example from packages/contracts
pnpm lint:sol # Solhint for contracts in this package only
pnpm lint:ts # ESLint for TypeScript files in this package
pnpm lint # Run all linters
pnpm lint:staged # Lint only staged files
```

### Pre-commit Hooks (lint-staged)

The repository uses `lint-staged` with Husky to run linting on staged files before commits:

- **Automatic**: Runs automatically on `git commit` via Husky pre-commit hook
- **Manual**: Run `pnpm lint:staged` to manually check staged files before committing
- **Configuration**: Root `package.json` contains lint-staged configuration
- **Custom Script**: `scripts/lint-staged-run.sh` filters out generated files that shouldn't be linted
- **File Type Handling**:
- `.{js,ts,cjs,mjs,jsx,tsx}`: ESLint + Prettier
- `.sol`: TODO check + Solhint + Prettier
- `.md`: Markdownlint + Prettier
- `.json`: Prettier only
- `.{yml,yaml}`: YAML lint + Prettier

**Usage**: `pnpm lint:staged` is particularly useful when you want to check what linting changes will be applied to your staged files before actually committing.

### TODO Comment Enforcement

The repository enforces TODO comment resolution to maintain code quality:

- **Scope**: Applies only to Solidity (`.sol`) files
- **Detection**: Finds TODO, FIXME, XXX, and HACK comments (case-insensitive)
- **Triggers**:
- **Pre-commit**: Blocks commits if TODO comments exist in files being committed
- **Regular linting**: Flags TODO comments in locally changed, staged, or untracked Solidity files
- **Script**: `scripts/check-todos.sh` (must be run from repository root)
- **Bypass**: Use `git commit --no-verify` to bypass (not recommended for production)

### Key Design Principles

1. **Hierarchical Configuration**: Root configurations provide base rules, packages can extend as needed
2. **Tool-Specific Inheritance**: ESLint searches up automatically, Prettier requires explicit inheritance
3. **Generated File Exclusion**: Multiple layers of exclusion for autogenerated content
4. **Consistent Formatting**: Prettier ensures consistent code formatting across all file types
5. **Fail-Fast Linting**: Pre-commit hooks catch issues before they enter the repository

### Configuration Files Reference

| Tool | Root Config | Package Config | Ignore Files |
| ------------ | --------------------- | -------------------------------- | ---------------------------- |
| ESLint | `eslint.config.mjs` | Auto-inherited | Built into config |
| Prettier | `prettier.config.cjs` | `prettier.config.cjs` (inherits) | `.prettierignore` |
| Solhint | `.solhint.json` | `.solhint.json` (array extends) | N/A |
| Markdownlint | `.markdownlint.json` | Auto-inherited | `.markdownlintignore` |
| Lint-staged | `package.json` | N/A | `scripts/lint-staged-run.sh` |

### Troubleshooting

- **ESLint not finding config**: ESLint searches up parent directories automatically - no local config needed
- **Prettier not working**: Packages need a `prettier.config.cjs` that inherits from root config
- **Solhint missing rules**: If extending a parent config, use array format: `["solhint:recommended", "./../../.solhint.json"]` to ensure all rules are loaded
- **Solhint inheritance not working**: Nested extends don't work - parent config's `solhint:recommended` won't be inherited with simple string extends
- **Solhint rule reference**: Use `npx solhint list-rules` to see all available rules and their descriptions
- **Generated files being linted**: Check ignore patterns in `.prettierignore`, `.markdownlintignore`, and ESLint config
- **Preview lint changes before commit**: Use `pnpm lint:staged` to see what changes will be applied to staged files
- **Commit blocked by linting**: Fix the linting issues or use `git commit --no-verify` to bypass (not recommended)
See [docs/Linting.md](docs/Linting.md) for detailed configuration, inline suppression syntax, and troubleshooting.

## Documentation

Expand Down
Loading