Skip to content

Commit 94f1492

Browse files
mds1fvictorio
andauthored
refactor: move to automated checks (#62)
* organize script folder * init bun scripts * style: init biome * save metadata to json * feat: check opcodes * chore: sort keys * feat: slice by feature * build: generate data with 'bun main {chainId}' * chore: slim down opcode output * refactor: change to arrays * feat: add deployed contracts checks * improve ux * feat: precompile support * refactor: move to checks folder * chore: remove log * chore: split up lint and fmt jobs * feat: add addresses that uniquely identify an evm stack * build: fix lint error * start UI work * feat: add opcodes back to UI * add deployed contracts to UI * add precompiles to UI * add stack addrs to UI * style: reduce row spacing * build: fix lint errors * build: move from pnpm to bun * style: switch from prettier to biome * chore: unify dirs * chore: some fixes * build: watch mode * chore: remove old comments * feat: add Base * feat: load in new chains * style: some info/UX cleanup * feat: json diffs * style: add logos * style: change toggle * feat: query params * update contributing * style: loading spinner * style: move things from footer to header * style: diff scroll improvements * ci: update for bun * ci: fix? * ci: add node * ci: remove jq from build pipeline since vercel has no jq * ci: revert ci as test * ci: back to bun * ci/style: fmt after merge, add node * ci: fix build command * chore: clarify copy * feat: opcode support for features view * feat: metadata and opcodes feature comparison * feat: back button * feat: more diff tables * feat: add chains * cleanup * refactor home page * tweaks * remove old code * fixes * add features to the comparison table * style: fmt * Add precompile test for secp256r1 (#65) * Add precompile test for secp256r1 * update chain data --------- Co-authored-by: Matt Solomon <[email protected]> * doc: add API key note * chore: dynamic branch name * refactor: dedupe feature declarations * refactor: more cleanup * cleanup * style: fmt * ci: add hourly job to check data * ci: add workflow dispatch * ci: limit diff to script/data * ci: tweak label * funding.yml --------- Co-authored-by: Franco Victorio <[email protected]>
1 parent 45de5e0 commit 94f1492

File tree

234 files changed

+12268
-15311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+12268
-15311
lines changed

.eslintrc.js

+35-35
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
module.exports = {
2-
env: {
3-
browser: true,
4-
es2021: true,
5-
},
6-
extends: [
7-
'next/core-web-vitals',
8-
'eslint:recommended',
9-
'plugin:@typescript-eslint/recommended',
10-
'plugin:react/recommended',
11-
],
12-
overrides: [
13-
{
14-
env: {
15-
node: true,
16-
},
17-
files: ['.eslintrc.{js,cjs}'],
18-
parserOptions: {
19-
sourceType: 'script',
20-
},
21-
},
22-
],
23-
parser: '@typescript-eslint/parser',
24-
parserOptions: {
25-
ecmaVersion: 'latest',
26-
sourceType: 'module',
27-
},
28-
plugins: ['@typescript-eslint', 'react'],
29-
rules: {
30-
'react/react-in-jsx-scope': 'off',
31-
// Allow unused variables that start with an underscore.
32-
'@typescript-eslint/no-unused-vars': [
33-
'error',
34-
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
35-
],
36-
},
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
},
6+
extends: [
7+
'next/core-web-vitals',
8+
'eslint:recommended',
9+
'plugin:@typescript-eslint/recommended',
10+
'plugin:react/recommended',
11+
],
12+
overrides: [
13+
{
14+
env: {
15+
node: true,
16+
},
17+
files: ['.eslintrc.{js,cjs}'],
18+
parserOptions: {
19+
sourceType: 'script',
20+
},
21+
},
22+
],
23+
parser: '@typescript-eslint/parser',
24+
parserOptions: {
25+
ecmaVersion: 'latest',
26+
sourceType: 'module',
27+
},
28+
plugins: ['@typescript-eslint', 'react'],
29+
rules: {
30+
'react/react-in-jsx-scope': 'off',
31+
// Allow unused variables that start with an underscore.
32+
'@typescript-eslint/no-unused-vars': [
33+
'error',
34+
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
35+
],
36+
},
3737
};

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [mds1]

.github/workflows/ci.yml

+23-26
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,40 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13-
1413
steps:
1514
- uses: actions/checkout@v4
16-
- uses: pnpm/action-setup@v2
17-
with:
18-
version: latest
19-
20-
- name: Use Node.js 18.x
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: 18.x
24-
cache: 'pnpm'
15+
- uses: oven-sh/setup-bun@v1
2516

2617
- name: Install dependencies
27-
run: pnpm install
18+
run: bun install
2819

29-
# This runs `next lint` before building.
3020
- name: Build
31-
run: pnpm build
21+
run: bun run build
3222

33-
fmt:
23+
lint:
3424
runs-on: ubuntu-latest
35-
3625
steps:
3726
- uses: actions/checkout@v4
38-
- uses: pnpm/action-setup@v2
39-
with:
40-
version: latest
27+
- uses: oven-sh/setup-bun@v1
28+
29+
- name: Install dependencies
30+
run: bun install
4131

42-
- name: Use Node.js 18.x
43-
uses: actions/setup-node@v4
44-
with:
45-
node-version: 18.x
46-
cache: 'pnpm'
32+
- name: Check linting and formatting
33+
run: bun check
34+
35+
chain-list:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: oven-sh/setup-bun@v1
4740

4841
- name: Install dependencies
49-
run: pnpm install
42+
run: bun install
43+
44+
- name: Generate list of chains for the UI
45+
run: bun prepare-chain-data
5046

51-
- name: Check formatting
52-
run: pnpm fmt:check
47+
# When this fails, run `bun prepare-chain-data` locally and commit the changes
48+
- name: Ensure no diff
49+
run: git diff --exit-code script/data

.github/workflows/fetch-data.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Fetch Chain Data
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 * * * *'
7+
8+
jobs:
9+
fetch-data:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: oven-sh/setup-bun@v1
14+
15+
- name: Install dependencies
16+
run: bun install
17+
18+
- name: Fetch data for all chains
19+
run: bun fetch-data
20+
21+
- name: Check for changes
22+
id: diff
23+
run: |
24+
if git diff --exit-code --quiet script/data; then
25+
echo "No changes detected"
26+
else
27+
echo "::set-output name=changed::true"
28+
exit 1
29+
fi
30+
31+
- name: Check for existing open issue
32+
if: failure() && steps.diff.outputs.changed == 'true'
33+
id: existing_issue
34+
run: |
35+
issue_title="Chain Data Updated"
36+
issue_search=$(gh issue list --state open --label "data mismatch" --limit 1 --json title --jq '.[].title')
37+
if [[ "$issue_search" == "$issue_title" ]]; then
38+
echo "::set-output name=exists::true"
39+
else
40+
echo "::set-output name=exists::false"
41+
fi
42+
env:
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Open issue if changes detected and no existing open issue
46+
if: failure() && steps.diff.outputs.changed == 'true' && steps.existing_issue.outputs.exists == 'false'
47+
run: |
48+
title="Chain Data Updated"
49+
body="The chain data has been updated. Please review the changes.
50+
51+
Triggered by GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
52+
53+
gh issue create --title "$title" --body "$body" --label "data mismatch"
54+
env:
55+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.prettierignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.next
22
pnpm-lock.yaml
33
public/prism-light.css
4-
public/prism-dark.css
4+
public/prism-dark.css
5+
script/

CONTRIBUTING.md

+30-23
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
11
# Contributing
22

3-
This repo uses [Next.js](https://github.com/vercel/next.js/), [Tailwind CSS](https://github.com/tailwindlabs/tailwindcss), [TypeScript](https://github.com/microsoft/TypeScript), [pnpm](https://github.com/pnpm/pnpm), and [viem](https://github.com/wagmi-dev/viem). To get started:
3+
## Issues
4+
5+
See the open [issues](https://github.com/mds1/evm-diff/issues) for current needs, and feel free to create new issues for bugs, feature requests, or other ideas.
6+
7+
## Development
8+
9+
If you are interested in working on an issue, please comment on the issue so it can be assigned to you.
10+
Before opening a PR, run `bun check` to ensure linting and formatting are correct.
11+
12+
This repo uses [Next.js](https://github.com/vercel/next.js/), [Tailwind CSS](https://github.com/tailwindlabs/tailwindcss), [TypeScript](https://github.com/microsoft/TypeScript), [bun](https://bun.sh/), and [viem](https://github.com/wagmi-dev/viem).
13+
14+
To get started building the app:
415

516
```sh
617
# Install dependencies.
7-
pnpm install
18+
bun install
819

920
# Start the development server.
10-
pnpm dev
21+
bun dev
1122

1223
# Format files.
13-
pnpm fmt
14-
```
15-
16-
See the open [issues](https://github.com/mds1/evm-diff/issues) for current needs, and feel free to create new issues for bugs, feature requests, or other ideas.
24+
bun fmt
1725

18-
## Bounties
26+
# Lint.
27+
bun lint
1928

20-
Most issues are eligible for bounties. Some issues will have something like "(bounty: X ETH 🔴)" at the end of the issue title, where `X ETH` is the number of ETH paid out for this bounty. Others will say nothing, but are still eligible—I just haven't gotten around to assigning a payment amount.
21-
22-
To apply for and claim a bounty:
29+
# Add a new chain to the UI, format, and lint.
30+
bun check
31+
```
2332

24-
1. If the issue has no bounty listed, message me on [Twitter](https://twitter.com/msolomon44), [Telegram](https://t.me/msolomon4), or [Discord](https://discordapp.com/users/417428774653657089) to work out an amount.
25-
2. Leave a brief comment explaining your work plan (may be very brief is issue is well-scoped), and wait to begin work until you are assigned to the issue. If you have any questions about the issue scope, you can ask in the issue or message me. (There is no guarantee that leaving a comment means you will be assigned, if multiple people are interested in the same issue).
26-
3. I'm not aware of any sufficient github issue bounty platforms, so there is no intermediary managing the bounties. This means you have to trust that I'll pay it out, which I will if the work meets the issue's requirements and is sufficiently high quality to close that issue.
27-
4. Feel free to open a draft PR before completion if you have any questions.
28-
5. Include your **OP Mainnet** payout address (all payouts will be on [OP Mainnet](https://docs.optimism.io/chain/networks#op-mainnet)) in the PR description, and once the PR is reviewed and merged I will transfer the ETH.
33+
To fetch chain data use the below commands.
34+
It's recommend to have an `INFURA_API_KEY` set in your environment to improve performance.
2935

30-
## Architecture
36+
```bash
37+
# Fetch all data for a single chain.
38+
bun fetch-data [chainId]
3139

32-
The specs for each chain live in `src/chains/[chainName]/*.ts`.
33-
Each chain's folder is structured similar to the [ethereum/execution-specs](https://github.com/ethereum/execution-specs) repo.
34-
For example, the `src/ethereum/shanghai` folder in that repo contains the specs for the latest hard fork (Shanghai) on Ethereum mainnet, and information about precompiles lives in the `vm/precompiled_contracts` subfolder.
35-
That folder contains one file for each precompile.
36-
Since EVM Diff doesn't have to actually implement the precompiles, we just use a single file for all precompile data, which lives in this repo at `src/chains/mainnet/vm/precompiles.ts`.
40+
# Fetch all data for all chains.
41+
bun fetch-data
3742

38-
As more aspects of the execution spec are added, they should be added in such a way to continue this pattern of mirroring the structure of the execution-specs repo.
43+
# Add a new chain to the UI, format, and lint.
44+
bun check
45+
```

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
Diff EVM-compatible chains in a friendly format.
44

5-
> [!NOTE]
6-
> This site is under active development. Check out the [issues](https://github.com/mds1/evm-diff/issues) if you'd like to contribute.
7-
85
## Overview
96

107
There are lots of EVM-compatible chains, and they can differ in various, subtle ways.

biome.jsonc

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
3+
"files": {
4+
"ignore": ["archive/**/*", ".next/**/*"]
5+
},
6+
"organizeImports": {
7+
"enabled": true
8+
},
9+
"formatter": {
10+
"lineWidth": 100
11+
},
12+
"javascript": {
13+
"formatter": {
14+
"quoteStyle": "single"
15+
}
16+
},
17+
"linter": {
18+
"enabled": true,
19+
"rules": {
20+
"recommended": true,
21+
"suspicious": {
22+
"noExplicitAny": "off", // Checked by eslint.
23+
"noArrayIndexKey": "off" // Sometimes required based on array data.
24+
},
25+
"a11y": {
26+
"all": false // This causes a lot of changes, will enable it later.
27+
},
28+
"complexity": {
29+
"useSimpleNumberKeys": "off"
30+
}
31+
}
32+
}
33+
}

bun.lockb

227 KB
Binary file not shown.

next.config.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module.exports = {
2-
images: {
3-
remotePatterns: [
4-
{
5-
protocol: 'https',
6-
hostname: 'icons.llamao.fi',
7-
},
8-
],
9-
},
2+
images: {
3+
remotePatterns: [
4+
{
5+
protocol: 'https',
6+
hostname: 'icons.llamao.fi',
7+
},
8+
],
9+
},
1010
};

0 commit comments

Comments
 (0)