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
8 changes: 5 additions & 3 deletions .claude/skills/bump-version-release/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ Releases are made by the org release pipeline (megaeth-labs/.github). Two decisi
To regenerate it after a changelog edit, `gh workflow run release-settle.yml --ref main -f version=X.Y.Z` — the workflow's only input is `version`; the commit, release branch and version file are computed by the route and the action, so pass no `commit`.
Merging the settle PR is the settlement decision.
3. **Publish** — merging the settle PR pushes to `release-vX.Y.Z`, which routes to `publish`. That job runs in the `release` environment and waits for its reviewer, then creates the annotated tag `vX.Y.Z` on the merge commit and publishes the GitHub Release with the settle PR's notes. The dispatch is not the approval; the merge plus the environment reviewer is.
4. **Targets** — automatic on the Release: `on-release.yml` publishes the four crates to crates.io and uploads `mega-evme` to the MegaETH artifact registry and the Release page, in the `release` environment.
Rehearse it first on an existing tag, dispatching on that tag's ref: `gh workflow run on-release.yml --ref vX.Y.Z -f dry_run=true`.
4. **Targets** — automatic on the Release: `on-release.yml` uploads `mega-evme` to the MegaETH artifact registry, in the `release` environment.
crates.io publishing is paused while the OP crates are git-pinned (see the root `Cargo.toml`), so no crates are published.
Release assets are paused: Releases are immutable once published, so `on-release.yml` attaches nothing to them.
Rehearse `on-release.yml` first on an existing tag, dispatching on that tag's ref: `gh workflow run on-release.yml --ref vX.Y.Z -f dry_run=true`.
The tag being released is always the run's own ref; there is no separate tag input.
The publish credentials — `CARGO_REGISTRY_TOKEN` and `GCP_AUTH_KEY` — live in the `release` environment, whose deployment policy admits `main`, `release-v*` branches and `v*` tags.
The publish credential, `GCP_AUTH_KEY`, lives in the `release` environment, whose deployment policy admits `main`, `release-v*` branches and `v*` tags.

Do not create tags or Releases by hand; the tag ruleset rejects it.
83 changes: 19 additions & 64 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,43 @@ name: On Release
# Publish targets for a mega-evm release. Runs when the release pipeline
# publishes the GitHub Release (release-publish creates it after the tag),
# and on demand for a rehearsal: dispatch with an existing tag and
# dry_run=true runs every job with nothing published, uploaded or attached.
# dry_run=true runs the job with nothing uploaded.
#
# Targets, as independent jobs so one hiccup never blocks the other:
# crates — the four published crates to crates.io (replaces publish.yml)
# mega-evme — the CLI binary to the MegaETH artifact registry and, as a
# download for the public, to the GitHub Release page
# Target:
# mega-evme — the CLI binary to the MegaETH artifact registry
#
# Rehearse on a tag ref (these jobs must run on a tag ref):
# crates.io publishing is paused. The OP crates are pinned to a git revision
# (see the root Cargo.toml), and `cargo publish` rejects git dependencies, so
# no crates are published. To resume once those crates are on crates.io,
# restore the `crates` job from PR #424.
#
# Release assets are paused as well. Releases here are immutable once
# published, and this workflow runs only after publishing, so attaching the
# binary to the Release fails (HTTP 422). The binary goes to the registry
# only until the release pipeline attaches assets before it publishes.
#
# Rehearse on a tag ref (the job must run on a tag ref):
# gh workflow run on-release.yml --ref vX.Y.Z -f dry_run=true
# The tag being released is always the run's own ref: the environment
# authorises that ref, so nothing else may be checked out or published.
#
# Credentials (CARGO_REGISTRY_TOKEN, GCP_AUTH_KEY) live in the `release`
# environment, whose deployment policy admits the default branch, release
# branches and v* tags; both jobs below run in it.
# The credential (GCP_AUTH_KEY) lives in the `release` environment, whose
# deployment policy admits the default branch, release branches and v*
# tags; the job below runs in it.

on:
release:
types: [published]
workflow_dispatch:
inputs:
dry_run:
description: "Verify and build everything; publish, upload and attach nothing"
description: "Verify and build mega-evme; upload nothing"
required: false
type: boolean
default: true

# One run per tag: a release run and a dispatch on the same tag both end in
# uploads (`--clobber` on Release assets), so overlapping runs would race.
# a registry upload, so overlapping runs would race.
# Never cancel an upload mid-flight; queue instead.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -49,56 +57,10 @@ env:
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || false }}

jobs:
crates:
runs-on: ubuntu-24.04
timeout-minutes: 40
environment: release
steps:
- name: Require a tag ref
run: |
[[ "$GITHUB_REF_TYPE" == "tag" ]] || { echo "::error::this workflow publishes the run's own ref, which must be a tag (got $GITHUB_REF_TYPE $GITHUB_REF_NAME); dispatch it with --ref vX.Y.Z"; exit 1; }

- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
ref: ${{ env.TAG }}
submodules: recursive
persist-credentials: false

- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1
with:
cache: false

- uses: foundry-rs/foundry-toolchain@b00af27efadbc7b4ca8b82abbd903b17cc874d2a # v1

# Packaging fails fast on manifests crates.io would reject — e.g. git-pinned
# dependencies without a registry version — before anything is uploaded. Without this
# check a multi-crate publish can upload the first crates and then fail midway, leaving a
# partial release on crates.io. Keep the list in step with the allowlist below.
- name: Pre-flight packaging check
run: |
for crate in mega-system-contracts mega-evm mega-state-test mega-evme; do
cargo package -p "$crate" --no-verify --locked
done

- uses: megaeth-labs/.github/.github/actions/release-publish-rust-crates@main
with:
# Explicit allowlist: state-test is publish = false; mega-t8n is not published.
crates: |
mega-system-contracts
mega-evm
mega-state-test
mega-evme
version: ${{ env.TAG }}
# A rehearsal never needs the token; do not hand it to the job at all.
token: ${{ env.DRY_RUN != 'true' && secrets.CARGO_REGISTRY_TOKEN || '' }}
dry_run: ${{ env.DRY_RUN }}

mega-evme:
runs-on: ubuntu-24.04
timeout-minutes: 40
environment: release
permissions:
contents: write # release-assets attaches to the Release
steps:
- name: Require a tag ref
run: |
Expand Down Expand Up @@ -144,11 +106,4 @@ jobs:
version: ${{ env.TAG }}
dry_run: ${{ env.DRY_RUN }}

- uses: megaeth-labs/.github/.github/actions/release-assets@main
with:
tag: ${{ env.TAG }}
files: |
target/release/mega-evme
dry_run: ${{ env.DRY_RUN }}

- run: 'echo "mega-evme ${{ env.TAG }}: registry=${{ steps.registry.outputs.status }} ${{ steps.registry.outputs.uri }} sha256=${{ steps.registry.outputs.sha256 }}"'
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ mega-system-contracts = { path = "./crates/system-contracts", version = "1.7.3",
# since taking these crates over (its `op-revm` still carries 20.0.0, which on crates.io targets
# revm 38 — so a `version` alongside `git` would resolve to an incompatible crate). GitHub tags
# are the release channel until the monorepo's crate versions move past the handed-over ones;
# the publish workflow's pre-flight check aborts a crates.io release before any upload.
# until then on-release.yml publishes no crates, and crates.io stays at 1.7.2.
op-revm = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67d87cd5c9992b62d215c043917b94e3f019629", default-features = false }
revm = { version = "=40.0.3", default-features = false }
revm-inspectors = { version = "=0.40.1", default-features = false }
Expand Down
25 changes: 7 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,22 @@ A specialized Ethereum Virtual Machine (EVM) implementation tailored for MegaETH

## Installation

Install the CLI tool from crates.io:
Building `mega-evme` requires Foundry's `forge`.

```bash
cargo install mega-evme --locked
```

The `--locked` flag ensures the exact tested dependency versions are used.

Or build from source:
From GitHub:

```bash
cargo build --release -p mega-evme
cargo install --git https://github.com/megaeth-labs/mega-evm --locked mega-evme
```

### Prebuilt binary

Every release also attaches a prebuilt `mega-evme` (Linux x86_64, built on `ubuntu-24.04`) and a `SHA256SUMS` file to its [GitHub Release](https://github.com/megaeth-labs/mega-evm/releases).
Download both, verify the checksum, and make the binary executable:
From a Git checkout:

```bash
sha256sum --check --ignore-missing SHA256SUMS
chmod +x mega-evme
./mega-evme --version
git clone --recursive https://github.com/megaeth-labs/mega-evm
cd mega-evm
cargo install --locked --path bin/mega-evme
```

The same binary is published to the MegaETH artifact registry for internal use.

## Development

This repository uses git submodules.
Expand Down
6 changes: 3 additions & 3 deletions REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ This is the single most important correctness concern in mega-evm.
Follow the existing pattern: `#[cfg(not(feature = "std"))] use alloc as std;`.
- New workspace dependencies should use `default-features = false` — features are opted-in explicitly.
- **Release-blocking dependencies.**
A crate that gets published must not depend on an unpublished crate.
`cargo publish -p <crate> --locked --dry-run` has to resolve at release time.
Flag a new dependency that would break the next release's resolution.
crates.io publishing is paused while the OP crates are git-pinned (see the root `Cargo.toml`).
When it resumes, a crate that gets published must not depend on an unpublished crate, and `cargo publish -p <crate> --locked --dry-run` has to resolve at release time.
Until then, flag a new git dependency outside the pinned OP set: each one is another crate that must reach a registry before publishing can resume.

## Tests

Expand Down
26 changes: 7 additions & 19 deletions bin/mega-evme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,22 @@ A command-line tool for executing and debugging EVM bytecode, similar to go-ethe

## Installation

Install from crates.io:
Building requires Foundry's `forge`.

```bash
cargo install mega-evme --locked
```

Or build from source:
From GitHub:

```bash
cargo build --release -p mega-evme
# The binary will be at target/release/mega-evme
cargo install --git https://github.com/megaeth-labs/mega-evm --locked mega-evme
```

The `--locked` flag ensures the exact tested dependency versions are used.

### Prebuilt binary

Every release also attaches a prebuilt `mega-evme` (Linux x86_64, built on `ubuntu-24.04`) and a `SHA256SUMS` file to its [GitHub Release](https://github.com/megaeth-labs/mega-evm/releases).
Download both, verify the checksum, and make the binary executable:
From a Git checkout:

```bash
sha256sum --check --ignore-missing SHA256SUMS
chmod +x mega-evme
./mega-evme --version
git clone --recursive https://github.com/megaeth-labs/mega-evm
cd mega-evm
cargo install --locked --path bin/mega-evme
```

The same binary is published to the MegaETH artifact registry for internal use.

## Commands

### run Command
Expand Down
20 changes: 9 additions & 11 deletions docs/mega-evme/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,22 @@ Similar to go-ethereum's `evm` command, `mega-evme` provides full control over t

## Installation

Building requires Foundry's `forge`.

From GitHub:

```bash
cargo build --release -p mega-evme
# Binary: target/release/mega-evme
cargo install --git https://github.com/megaeth-labs/mega-evm --locked mega-evme
```

### Prebuilt binary

Every release also attaches a prebuilt `mega-evme` (Linux x86_64, built on `ubuntu-24.04`) and a `SHA256SUMS` file to its [GitHub Release](https://github.com/megaeth-labs/mega-evm/releases).
Download both, verify the checksum, and make the binary executable:
From a Git checkout:

```bash
sha256sum --check --ignore-missing SHA256SUMS
chmod +x mega-evme
./mega-evme --version
git clone --recursive https://github.com/megaeth-labs/mega-evm
cd mega-evm
cargo install --locked --path bin/mega-evme
```

The same binary is published to the MegaETH artifact registry for internal use.

## Commands

| Command | Description |
Expand Down
Loading