Skip to content

Commit

Permalink
Merge pull request #35 from bluealloy/main
Browse files Browse the repository at this point in the history
[pull] main from bluealloy:main
  • Loading branch information
fubuloubu authored Feb 21, 2024
2 parents d2ede35 + 2d4fb06 commit 14978fd
Show file tree
Hide file tree
Showing 145 changed files with 9,312 additions and 4,731 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
run: mdbook build documentation

- name: Build docs
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --all --no-deps
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo doc --all --no-deps

- name: Move docs to book folder
run: |
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/cachegrind.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Valgrind Cachegrind

on:
pull_request:
branches: [main]

jobs:
valgrind:
runs-on: ubuntu-latest
permissions: write-all

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup | Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable

- name: Install Valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind
- name: Run Valgrind
run: |
cargo b -r -p revm-test --bin snailtracer
valgrind --tool=cachegrind target/release/snailtracer 2>&1 | tee cachegrind_results.txt
- name: Valgrind results
id: valgrind_results
run: |
contents=$(printf "%s" "$(head -c 64000 cachegrind_results.txt)")
# dump line by line into a file
printf "Valgrind Results:\n\n\`\`\`\n%s\n\`\`\`" "$contents" > results.md
- name: Comment on PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Try to edit the last comment
if gh pr comment ${{ github.event.pull_request.number }} --edit-last --body-file results.md; then
echo "Successfully edited last comment."
else
echo "Failed to edit last comment. Trying to add a new comment instead!"
# If editing last comment fails, try to add a new comment
if ! gh pr comment ${{ github.event.pull_request.number }} --body-file results.md; then
echo "Comment failed to be made, printing out results here:"
cat results.md
fi
fi
122 changes: 78 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,99 @@ on:
pull_request:
branches: [main, "release/**"]

env:
CARGO_TERM_COLOR: always

jobs:
tests-stable:
name: Tests (Stable)
test:
name: test ${{ matrix.rust }} ${{ matrix.flags }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
rust: ["stable", "beta", "nightly"]
flags: ["--no-default-features", "", "--all-features"]
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
targets: riscv32imac-unknown-none-elf

toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo test --workspace ${{ matrix.flags }}

- name: cargo test
run: cargo test --workspace

- name: cargo test all features
run: cargo test --workspace --all-features

- name: cargo check no_std
run: cargo check --target riscv32imac-unknown-none-elf --no-default-features

lint:
name: Lint
test-no-std:
name: test no_std
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
cache-on-failure: true

- name: cargo fmt
run: cargo +nightly fmt --all -- --check

- name: cargo clippy
run: cargo +nightly clippy --workspace --all-features -- -D warnings
targets: riscv32imac-unknown-none-elf
- run: cargo check --target riscv32imac-unknown-none-elf --no-default-features

- name: cargo check no-default-features
run: |
check-no-default-features:
name: check no-default-features
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- run: |
cd crates/revm
cargo check --no-default-features
- name: cargo check serde
run: |
check-serde:
name: check serde
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- run: |
cd crates/revm
cargo check --no-default-features --features serde
- name: cargo check std
run: |
check-std:
name: check std
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- run: |
cd crates/revm
cargo check --no-default-features --features std
clippy:
name: clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo clippy --workspace --all-targets --all-features
env:
RUSTFLAGS: -Dwarnings

docs:
name: docs
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rust-docs
- run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: "--cfg docsrs -D warnings"

fmt:
name: fmt
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check
8 changes: 5 additions & 3 deletions .github/workflows/ethereum-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
pull_request:
branches: [main, "release/**"]


jobs:
tests-stable:
name: Ethereum Tests (Stable)
Expand All @@ -19,6 +18,7 @@ jobs:
strategy:
matrix:
profile: [ethtests, release]
target: [i686-unknown-linux-gnu, x86_64-unknown-linux-gnu]
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -37,11 +37,13 @@ jobs:
with:
cache-on-failure: true

- name: Install cross
run: cargo install cross

- name: Run Ethereum tests
run: |
cargo run --profile ${{ matrix.profile }} -p revme -- statetest \
cross run --target ${{matrix.target}} --profile ${{ matrix.profile }} -p revme -- statetest \
ethtests/GeneralStateTests/ \
ethtests/LegacyTests/Constantinople/GeneralStateTests/ \
ethtests/EIPTests/StateTests/stEIP1153-transientStorage/ \
ethtests/EIPTests/StateTests/stEIP4844-blobtransactions/ \
ethtests/EIPTests/StateTests/stEIP5656-MCOPY/
42 changes: 42 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Documentation: https://release-plz.ieni.dev/docs
name: Release-plz

permissions:
pull-requests: write
contents: write

on:
push:
branches:
- main

jobs:
release-plz:
name: Release-plz
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
# Commits the cargo lock (generally a good practice for upstream libraries)
- name: Commit Cargo.lock
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add Cargo.lock
git commit -m "Update Cargo.lock" || echo "No changes to commit"
# This will run the release-plz action
# The action dectect API breaking changes detection with cargo-semver-checks.
# Semver is auto incremneted based on this
# A PR with the semver bump is created with a new release tag and changelog
# if you configure the cargo registry token, the action will also publish the new version to crates.io
- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
with:
command: release-pr
env:
# The admin of the repository with need to configure the following secrets:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ target
.idea
pkg/


bins/revme/temp_folder
bins/revme/tests
ethereumjs-util.js
book

# Generated by the block traces example
traces

burntpix/svgs
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
Because this is workspace with multi libraries, tags will be simplified, and with this document you can match version of project with git tag.

# v29 tag
date: 17.02.2024

Small release, `return_memory_range` included inside `CallInput`.
Few fixes.

revm: 5.0.0 -> 6.0.0 (⚠️ API breaking changes)
revm-interpreter: 2.1.0 -> 3.0.0 (⚠️ API breaking changes)
revm-primitives: 2.0.0 -> 2.0.1 (✓ API compatible changes)
revm-precompile: 4.0.0 -> 4.0.1 (✓ API compatible changes)

# v28 tag
date: 12.02.2024

Small release, function renaming and some helper functions added.

* revm: 4.0.0 -> 5.0.0 (⚠️ API breaking changes)
* revm-interpreter: 2.0.0 -> 2.1.0 (✓ API compatible changes)
* revm-precompile: 3.0.0 -> 4.0.0 (⚠️ API breaking changes)
* revm-test: 0.1.0

# v27 tag
date: 07.02.2024

Refactor of Evm logic as list of handlers inside EvmHandler and EvmBuilder that open up the Evm and allow overwriting the default behavior.
Change how call loop (Previously it was recursion) is handled in Evm

* revm: v4.0.0
* revm-precompile: v3.0.0
* revm-primitives: v2.0.0
* revm-interpreter: v2.0.0
* revme: 0.2.1

# v26 tag
date 02.10.2023

Expand Down
Loading

0 comments on commit 14978fd

Please sign in to comment.