Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/gas-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ jobs:
- name: Test
run: pnpm run test
working-directory: gas-benchmarks
env:
SUBGRAPH_URL: ${{ secrets.SUBGRAPH_URL }}

- name: Benchmark
run: pnpm run benchmark
working-directory: gas-benchmarks
env:
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}
SCROLL_RPC_URL: ${{ secrets.SCROLL_RPC_URL }}
SUBGRAPH_URL: ${{ secrets.SUBGRAPH_URL }}
MIN_SAMPLES: ${{ vars.MIN_SAMPLES }}
MONERO_FAIL_NODES_API_URL: ${{ vars.MONERO_FAIL_NODES_API_URL }}
2 changes: 2 additions & 0 deletions .github/workflows/root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:

- name: Lint
run: pnpm run lint
env:
Comment thread
NicoSerranoP marked this conversation as resolved.
SUBGRAPH_URL: ${{ secrets.SUBGRAPH_URL }}

- name: Format
run: pnpm run format
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist
build
.cache
*.log
generated
10 changes: 9 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,13 @@ export default defineConfig([
gasConfig,
evalConfig,
subgraphConfig,
globalIgnores(["**/node_modules", "**/dist", "**/coverage", "**/build", "eslint.config.js", "subgraph/generated"]),
globalIgnores([
"**/node_modules",
"**/dist",
"**/coverage",
"**/build",
"eslint.config.js",
"gas-benchmarks/src/generated",
"subgraph/generated",
]),
]);
2 changes: 2 additions & 0 deletions gas-benchmarks/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ SCROLL_RPC_URL=https://scroll.gateway.tenderly.co

MONERO_FAIL_NODES_API_URL=https://monero.fail/nodes.json

SUBGRAPH_URL=https://api.studio.thegraph.com/query/<USER_ID>/<SUBGRAPH_SLUG>/<VERSION>

MIN_SAMPLES=10
1 change: 1 addition & 0 deletions gas-benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/generated
28 changes: 28 additions & 0 deletions gas-benchmarks/codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { config } from "dotenv";
import path from "node:path";

import type { CodegenConfig } from "@graphql-codegen/cli";

config();

if (!process.env.SUBGRAPH_URL) {
Comment thread
NicoSerranoP marked this conversation as resolved.
throw new Error("SUBGRAPH_URL is not set");
}

const codegenConfig: CodegenConfig = {
overwrite: true,
schema: [process.env.SUBGRAPH_URL, path.resolve(".", "scalars.graphql")],
ignoreNoDocuments: true,
documents: ["src/**/*.ts"],
emitLegacyCommonJSImports: false,
generates: {
"src/generated/": {
preset: "client-preset",
config: {
useTypeImports: true,
},
},
},
};

export default codegenConfig;
16 changes: 14 additions & 2 deletions gas-benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
"repository": "https://github.com/privacy-ethereum/private-transfers-benchmarks",
"type": "module",
"scripts": {
"prebenchmark": "pnpm run codegen",
"benchmark": "tsx src/index.ts",
"test": "vitest run"
"pretest": "pnpm run codegen",
"test": "vitest run",
"codegen": "graphql-codegen-esm --config codegen.ts"
},
"keywords": [
"private-transfers",
Expand All @@ -15,19 +18,28 @@
],
"author": "PSE",
"license": "MIT",
"packageManager": "pnpm@10.29.3",
"packageManager": "pnpm@10.33.0",
"engines": {
"node": "24",
"pnpm": "10"
},
"devDependencies": {
"@graphql-codegen/cli": "6.3.1",
"@graphql-codegen/client-preset": "5.3.0",
"@graphql-codegen/introspection": "5.0.2",
"@graphql-codegen/typed-document-node": "^6.1.8",
"@graphql-codegen/typescript": "^5.0.10",
"@graphql-codegen/typescript-operations": "^5.1.0",
"@types/node": "^25.2.3",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"vitest": "^4.0.18"
},
"dependencies": {
"@graphql-typed-document-node/core": "^3.2.0",
"dotenv": "^17.2.4",
"graphql": "^16.13.2",
"graphql-request": "^7.4.0",
"lowdb": "^7.0.1",
"viem": "^2.45.3"
}
Expand Down
Loading
Loading