Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move to automated checks #62

Merged
merged 76 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4eab520
organize script folder
mds1 Apr 13, 2024
da1e104
init bun scripts
mds1 Apr 13, 2024
9f13306
style: init biome
mds1 Apr 14, 2024
a260ceb
save metadata to json
mds1 Apr 14, 2024
b750baf
feat: check opcodes
mds1 Apr 15, 2024
e7561d9
chore: sort keys
mds1 Apr 15, 2024
033d101
feat: slice by feature
mds1 Apr 15, 2024
78a98b2
build: generate data with 'bun main {chainId}'
mds1 Apr 15, 2024
2191b42
chore: slim down opcode output
mds1 Apr 15, 2024
f5f82fa
refactor: change to arrays
mds1 Apr 16, 2024
03699bd
feat: add deployed contracts checks
mds1 Apr 17, 2024
7c4228c
improve ux
mds1 Apr 17, 2024
6ebc8d8
feat: precompile support
mds1 Apr 17, 2024
de92994
refactor: move to checks folder
mds1 Apr 17, 2024
a135007
chore: remove log
mds1 Apr 18, 2024
f140c55
chore: split up lint and fmt jobs
mds1 Apr 18, 2024
9339ceb
feat: add addresses that uniquely identify an evm stack
mds1 Apr 19, 2024
6b0840a
build: fix lint error
mds1 Apr 25, 2024
4dd3804
start UI work
mds1 Apr 28, 2024
df8838d
feat: add opcodes back to UI
mds1 Apr 29, 2024
2aa413e
add deployed contracts to UI
mds1 Apr 30, 2024
11f3fe0
add precompiles to UI
mds1 Apr 30, 2024
9d63605
add stack addrs to UI
mds1 May 1, 2024
d354f41
style: reduce row spacing
mds1 May 1, 2024
77b0d48
build: fix lint errors
mds1 May 1, 2024
4953eb3
build: move from pnpm to bun
mds1 May 1, 2024
b548b12
style: switch from prettier to biome
mds1 May 2, 2024
3f264c7
chore: unify dirs
mds1 May 5, 2024
39f0412
chore: some fixes
mds1 May 5, 2024
eaf9e3e
build: watch mode
mds1 May 5, 2024
81d322b
chore: remove old comments
mds1 May 5, 2024
308aa3b
feat: add Base
mds1 May 5, 2024
ad0cc85
feat: load in new chains
mds1 May 5, 2024
3c03669
style: some info/UX cleanup
mds1 May 5, 2024
54b1803
feat: json diffs
mds1 May 5, 2024
d5d77f7
style: add logos
mds1 May 6, 2024
c0c28f5
style: change toggle
mds1 May 6, 2024
27cd41e
feat: query params
mds1 May 8, 2024
666c6e8
update contributing
mds1 May 8, 2024
baf24d7
style: loading spinner
mds1 May 8, 2024
906eee9
style: move things from footer to header
mds1 May 8, 2024
8414d06
style: diff scroll improvements
mds1 May 9, 2024
241a825
ci: update for bun
mds1 May 9, 2024
016bac8
ci: fix?
mds1 May 10, 2024
6a31e00
ci: add node
mds1 May 10, 2024
ffdbd46
ci: remove jq from build pipeline since vercel has no jq
mds1 May 10, 2024
d244555
ci: revert ci as test
mds1 May 10, 2024
d956ea9
ci: back to bun
mds1 May 10, 2024
da3e9ad
Merge branch 'main' into refactor/automated
mds1 May 10, 2024
e9b635e
ci/style: fmt after merge, add node
mds1 May 10, 2024
52efdc1
ci: fix build command
mds1 May 10, 2024
7105c80
chore: clarify copy
mds1 May 10, 2024
084add4
feat: opcode support for features view
mds1 May 11, 2024
26f7c24
feat: metadata and opcodes feature comparison
mds1 May 13, 2024
e270bef
feat: back button
mds1 May 13, 2024
7940a80
feat: more diff tables
mds1 May 14, 2024
4c95e57
feat: add chains
mds1 May 15, 2024
4c2fb99
cleanup
mds1 May 16, 2024
6e4fef8
refactor home page
mds1 May 16, 2024
085a607
tweaks
mds1 May 16, 2024
b4f9b9a
remove old code
mds1 May 16, 2024
2e30906
fixes
mds1 May 16, 2024
df78ecf
add features to the comparison table
mds1 May 16, 2024
1a26ca1
style: fmt
mds1 May 16, 2024
20297a9
Add precompile test for secp256r1 (#65)
fvictorio May 16, 2024
9b253bb
doc: add API key note
mds1 May 18, 2024
531385f
chore: dynamic branch name
mds1 May 18, 2024
d31c013
refactor: dedupe feature declarations
mds1 May 18, 2024
f04a9c0
refactor: more cleanup
mds1 May 18, 2024
cb10a9d
cleanup
mds1 May 20, 2024
c7e9252
style: fmt
mds1 May 20, 2024
8cc2d10
ci: add hourly job to check data
mds1 May 20, 2024
46ac93e
ci: add workflow dispatch
mds1 May 20, 2024
9020e9b
ci: limit diff to script/data
mds1 May 20, 2024
ff00fee
ci: tweak label
mds1 May 20, 2024
3c4eed7
funding.yml
mds1 May 21, 2024
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
70 changes: 35 additions & 35 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'next/core-web-vitals',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
],
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'react'],
rules: {
'react/react-in-jsx-scope': 'off',
// Allow unused variables that start with an underscore.
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
env: {
browser: true,
es2021: true,
},
extends: [
'next/core-web-vitals',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
],
overrides: [
{
env: {
node: true,
},
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'react'],
rules: {
'react/react-in-jsx-scope': 'off',
// Allow unused variables that start with an underscore.
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
};
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [mds1]
49 changes: 23 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,40 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: latest

- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'pnpm'
- uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: pnpm install
run: bun install

# This runs `next lint` before building.
- name: Build
run: pnpm build
run: bun run build

fmt:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: latest
- uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install

- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'pnpm'
- name: Check linting and formatting
run: bun check

chain-list:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: pnpm install
run: bun install

- name: Generate list of chains for the UI
run: bun prepare-chain-data

- name: Check formatting
run: pnpm fmt:check
# When this fails, run `bun prepare-chain-data` locally and commit the changes
- name: Ensure no diff
run: git diff --exit-code script/data
55 changes: 55 additions & 0 deletions .github/workflows/fetch-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Fetch Chain Data

on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'

jobs:
fetch-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: bun install

- name: Fetch data for all chains
run: bun fetch-data

- name: Check for changes
id: diff
run: |
if git diff --exit-code --quiet script/data; then
echo "No changes detected"
else
echo "::set-output name=changed::true"
exit 1
fi

- name: Check for existing open issue
if: failure() && steps.diff.outputs.changed == 'true'
id: existing_issue
run: |
issue_title="Chain Data Updated"
issue_search=$(gh issue list --state open --label "data mismatch" --limit 1 --json title --jq '.[].title')
if [[ "$issue_search" == "$issue_title" ]]; then
echo "::set-output name=exists::true"
else
echo "::set-output name=exists::false"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Open issue if changes detected and no existing open issue
if: failure() && steps.diff.outputs.changed == 'true' && steps.existing_issue.outputs.exists == 'false'
run: |
title="Chain Data Updated"
body="The chain data has been updated. Please review the changes.

Triggered by GitHub Actions run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

gh issue create --title "$title" --body "$body" --label "data mismatch"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.next
pnpm-lock.yaml
public/prism-light.css
public/prism-dark.css
public/prism-dark.css
script/
53 changes: 30 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,45 @@
# Contributing

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:
## Issues

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.

## Development

If you are interested in working on an issue, please comment on the issue so it can be assigned to you.
Before opening a PR, run `bun check` to ensure linting and formatting are correct.

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).

To get started building the app:

```sh
# Install dependencies.
pnpm install
bun install

# Start the development server.
pnpm dev
bun dev

# Format files.
pnpm fmt
```

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.
bun fmt

## Bounties
# Lint.
bun lint

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.

To apply for and claim a bounty:
# Add a new chain to the UI, format, and lint.
bun check
```

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.
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).
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.
4. Feel free to open a draft PR before completion if you have any questions.
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.
To fetch chain data use the below commands.
It's recommend to have an `INFURA_API_KEY` set in your environment to improve performance.

## Architecture
```bash
# Fetch all data for a single chain.
bun fetch-data [chainId]

The specs for each chain live in `src/chains/[chainName]/*.ts`.
Each chain's folder is structured similar to the [ethereum/execution-specs](https://github.com/ethereum/execution-specs) repo.
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.
That folder contains one file for each precompile.
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`.
# Fetch all data for all chains.
bun fetch-data

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.
# Add a new chain to the UI, format, and lint.
bun check
```
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

Diff EVM-compatible chains in a friendly format.

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

## Overview

There are lots of EVM-compatible chains, and they can differ in various, subtle ways.
Expand Down
33 changes: 33 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"files": {
"ignore": ["archive/**/*", ".next/**/*"]
},
"organizeImports": {
"enabled": true
},
"formatter": {
"lineWidth": 100
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off", // Checked by eslint.
"noArrayIndexKey": "off" // Sometimes required based on array data.
},
"a11y": {
"all": false // This causes a lot of changes, will enable it later.
},
"complexity": {
"useSimpleNumberKeys": "off"
}
}
}
}
Binary file added bun.lockb
Binary file not shown.
16 changes: 8 additions & 8 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'icons.llamao.fi',
},
],
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'icons.llamao.fi',
},
],
},
};
Loading