Skip to content

Commit 9a03c7e

Browse files
authored
Merge branch 'main' into serde-no-std
2 parents cf4da2f + 0629883 commit 9a03c7e

Some content is hidden

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

102 files changed

+5369
-3003
lines changed

.github/workflows/cachegrind.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Valgrind Cachegrind
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
valgrind:
9+
runs-on: ubuntu-latest
10+
permissions: write-all
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Setup | Rust
17+
uses: ATiltedTree/setup-rust@v1
18+
with:
19+
rust-version: stable
20+
21+
- name: Install Valgrind
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y valgrind
25+
26+
- name: Run Valgrind
27+
run: |
28+
cargo b -r -p revm-test --bin snailtracer
29+
valgrind --tool=cachegrind target/release/snailtracer 2>&1 | tee cachegrind_results.txt
30+
31+
- name: Valgrind results
32+
id: valgrind_results
33+
run: |
34+
contents=$(printf "%s" "$(head -c 64000 cachegrind_results.txt)")
35+
# dump line by line into a file
36+
printf "Valgrind Results:\n\n\`\`\`\n%s\n\`\`\`" "$contents" > results.md
37+
38+
- name: Comment on PR
39+
env:
40+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: |
42+
# Try to edit the last comment
43+
if gh pr comment ${{ github.event.pull_request.number }} --edit-last --body-file results.md; then
44+
echo "Successfully edited last comment."
45+
else
46+
echo "Failed to edit last comment. Trying to add a new comment instead!"
47+
# If editing last comment fails, try to add a new comment
48+
if ! gh pr comment ${{ github.event.pull_request.number }} --body-file results.md; then
49+
echo "Comment failed to be made, printing out results here:"
50+
cat results.md
51+
fi
52+
fi

.github/workflows/ci.yml

+78-44
Original file line numberDiff line numberDiff line change
@@ -10,65 +10,99 @@ on:
1010
pull_request:
1111
branches: [main, "release/**"]
1212

13+
env:
14+
CARGO_TERM_COLOR: always
15+
1316
jobs:
14-
tests-stable:
15-
name: Tests (Stable)
17+
test:
18+
name: test ${{ matrix.rust }} ${{ matrix.flags }}
1619
runs-on: ubuntu-latest
1720
timeout-minutes: 30
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
rust: ["stable", "beta", "nightly"]
25+
flags: ["--no-default-features", "", "--all-features"]
1826
steps:
19-
- name: Checkout sources
20-
uses: actions/checkout@v3
21-
22-
- name: Install toolchain
23-
uses: dtolnay/rust-toolchain@stable
27+
- uses: actions/checkout@v3
28+
- uses: dtolnay/rust-toolchain@master
2429
with:
25-
targets: riscv32imac-unknown-none-elf
26-
30+
toolchain: ${{ matrix.rust }}
2731
- uses: Swatinem/rust-cache@v2
28-
with:
29-
cache-on-failure: true
32+
- run: cargo test --workspace ${{ matrix.flags }}
3033

31-
- name: cargo test
32-
run: cargo test --workspace
33-
34-
- name: cargo test all features
35-
run: cargo test --workspace --all-features
36-
37-
- name: cargo check no_std
38-
run: cargo check --target riscv32imac-unknown-none-elf --no-default-features
39-
40-
lint:
41-
name: Lint
34+
test-no-std:
35+
name: test no_std
4236
runs-on: ubuntu-latest
4337
timeout-minutes: 30
4438
steps:
45-
- name: Checkout sources
46-
uses: actions/checkout@v3
47-
48-
- name: Install toolchain
49-
uses: dtolnay/rust-toolchain@nightly
50-
with:
51-
components: rustfmt, clippy
52-
53-
- uses: Swatinem/rust-cache@v2
39+
- uses: actions/checkout@v3
40+
- uses: dtolnay/rust-toolchain@stable
5441
with:
55-
cache-on-failure: true
56-
57-
- name: cargo fmt
58-
run: cargo +nightly fmt --all -- --check
59-
60-
- name: cargo clippy
61-
run: cargo +nightly clippy --workspace --all-features -- -D warnings
42+
targets: riscv32imac-unknown-none-elf
43+
- run: cargo check --target riscv32imac-unknown-none-elf --no-default-features
6244

63-
- name: cargo check no-default-features
64-
run: |
45+
check-no-default-features:
46+
name: check no-default-features
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 30
49+
steps:
50+
- uses: actions/checkout@v3
51+
- run: |
6552
cd crates/revm
6653
cargo check --no-default-features
67-
- name: cargo check serde
68-
run: |
54+
55+
check-serde:
56+
name: check serde
57+
runs-on: ubuntu-latest
58+
timeout-minutes: 30
59+
steps:
60+
- uses: actions/checkout@v3
61+
- run: |
6962
cd crates/revm
7063
cargo check --no-default-features --features serde
71-
- name: cargo check std
72-
run: |
64+
65+
check-std:
66+
name: check std
67+
runs-on: ubuntu-latest
68+
timeout-minutes: 30
69+
steps:
70+
- uses: actions/checkout@v3
71+
- run: |
7372
cd crates/revm
7473
cargo check --no-default-features --features std
74+
75+
clippy:
76+
name: clippy
77+
runs-on: ubuntu-latest
78+
timeout-minutes: 30
79+
steps:
80+
- uses: actions/checkout@v3
81+
- uses: dtolnay/rust-toolchain@clippy
82+
- run: cargo +nightly clippy --workspace --all-targets --all-features
83+
env:
84+
RUSTFLAGS: -Dwarnings
85+
86+
docs:
87+
name: docs
88+
runs-on: ubuntu-latest
89+
timeout-minutes: 30
90+
steps:
91+
- uses: actions/checkout@v3
92+
- uses: dtolnay/rust-toolchain@nightly
93+
with:
94+
components: rust-docs
95+
- run: cargo doc --workspace --all-features --no-deps --document-private-items
96+
env:
97+
RUSTDOCFLAGS: "--cfg docsrs -D warnings"
98+
99+
fmt:
100+
name: fmt
101+
runs-on: ubuntu-latest
102+
timeout-minutes: 30
103+
steps:
104+
- uses: actions/checkout@v3
105+
- uses: dtolnay/rust-toolchain@nightly
106+
with:
107+
components: rustfmt
108+
- run: cargo +nightly fmt --all --check

.github/workflows/ethereum-tests.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
pull_request:
1111
branches: [main, "release/**"]
1212

13-
1413
jobs:
1514
tests-stable:
1615
name: Ethereum Tests (Stable)
@@ -19,6 +18,7 @@ jobs:
1918
strategy:
2019
matrix:
2120
profile: [ethtests, release]
21+
target: [i686-unknown-linux-gnu, x86_64-unknown-linux-gnu]
2222
steps:
2323
- name: Checkout sources
2424
uses: actions/checkout@v3
@@ -37,11 +37,13 @@ jobs:
3737
with:
3838
cache-on-failure: true
3939

40+
- name: Install cross
41+
run: cargo install cross
42+
4043
- name: Run Ethereum tests
4144
run: |
42-
cargo run --profile ${{ matrix.profile }} -p revme -- statetest \
45+
cross run --target ${{matrix.target}} --profile ${{ matrix.profile }} -p revme -- statetest \
4346
ethtests/GeneralStateTests/ \
4447
ethtests/LegacyTests/Constantinople/GeneralStateTests/ \
4548
ethtests/EIPTests/StateTests/stEIP1153-transientStorage/ \
4649
ethtests/EIPTests/StateTests/stEIP4844-blobtransactions/ \
47-
ethtests/EIPTests/StateTests/stEIP5656-MCOPY/

.github/workflows/release-plz.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Documentation: https://release-plz.ieni.dev/docs
2+
name: Release-plz
3+
4+
permissions:
5+
pull-requests: write
6+
contents: write
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
release-plz:
15+
name: Release-plz
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Install Rust toolchain
23+
uses: dtolnay/rust-toolchain@stable
24+
# Commits the cargo lock (generally a good practice for upstream libraries)
25+
- name: Commit Cargo.lock
26+
run: |
27+
git config --local user.email "action@github.com"
28+
git config --local user.name "GitHub Action"
29+
git add Cargo.lock
30+
git commit -m "Update Cargo.lock" || echo "No changes to commit"
31+
# This will run the release-plz action
32+
# The action dectect API breaking changes detection with cargo-semver-checks.
33+
# Semver is auto incremneted based on this
34+
# A PR with the semver bump is created with a new release tag and changelog
35+
# if you configure the cargo registry token, the action will also publish the new version to crates.io
36+
- name: Run release-plz
37+
uses: MarcoIeni/release-plz-action@v0.5
38+
env:
39+
# The admin of the repository with need to configure the following secrets:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ target
66
.idea
77
pkg/
88

9-
109
bins/revme/temp_folder
1110
bins/revme/tests
1211
ethereumjs-util.js
1312
book
13+
14+
# Generated by the block traces example
15+
traces

0 commit comments

Comments
 (0)