Skip to content

Commit 81c6853

Browse files
authored
Merge pull request #5 from flashbots/rebase/2024-july
merge upstream/main with origin
2 parents 4ec4e16 + d349906 commit 81c6853

File tree

761 files changed

+48558
-33257
lines changed

Some content is hidden

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

761 files changed

+48558
-33257
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
* @danipopes @evalir @mattsse
22

3-
crates/anvil/ @evalir @mattsse
4-
crates/evm/coverage/ @evalir @onbjerg
3+
crates/anvil/ @danipopes @mattsse @evalir
4+
crates/cheatcodes/ @danipopes @mattsse @klkvr @evalir
5+
crates/evm/coverage/ @onbjerg
56
crates/fmt/ @rkrasiuk
6-
crates/macros/impls/ @danipopes
7+
crates/linking/ @klkvr
8+
crates/macros/ @danipopes
9+
crates/script/ @danipopes @mattsse @klkvr
10+
crates/wallets/ @klkvr

.github/scripts/matrices.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ def __init__(
6565
self.partition = partition
6666

6767

68+
profile = os.environ.get("PROFILE")
6869
is_pr = os.environ.get("EVENT_NAME") == "pull_request"
6970
t_linux_x86 = Target("ubuntu-latest", "x86_64-unknown-linux-gnu", "linux-amd64")
7071
# TODO: Figure out how to make this work
7172
# t_linux_arm = Target("ubuntu-latest", "aarch64-unknown-linux-gnu", "linux-aarch64")
72-
t_macos = Target("macos-latest", "x86_64-apple-darwin", "macosx-amd64")
73+
t_macos = Target("macos-latest", "aarch64-apple-darwin", "macosx-aarch64")
7374
t_windows = Target("windows-latest", "x86_64-pc-windows-msvc", "windows-amd64")
7475
targets = [t_linux_x86, t_windows] if is_pr else [t_linux_x86, t_macos, t_windows]
7576

@@ -119,6 +120,9 @@ def main():
119120
s = f"{partition}/{case.n_partitions}"
120121
name += f" ({s})"
121122
flags += f" --partition count:{s}"
123+
124+
if profile == "isolate":
125+
flags += " --features=isolate-by-default"
122126
name += os_str
123127

124128
obj = Expanded(

.github/scripts/prune-prereleases.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = async ({ github, context }) => {
3636

3737
// Pruning rules:
3838
// 1. only keep the earliest (by created_at) release of the month
39-
// 2. to keep the newest 3 nightlies
39+
// 2. to keep the newest 30 nightlies (to make sure nightlies are kept until the next monthly release)
4040
// Notes:
4141
// - This addresses https://github.com/foundry-rs/foundry/issues/6732
4242
// - Name of the release may deviate from created_at due to the usage of different timezones.
@@ -47,7 +47,7 @@ module.exports = async ({ github, context }) => {
4747
const groups = groupBy(nightlies, i => i.created_at.slice(0, 7));
4848
const nightliesToPrune = Object.values(groups)
4949
.reduce((acc, cur) => acc.concat(cur.slice(0, -1)), []) // rule 1
50-
.slice(3); // rule 2
50+
.slice(30); // rule 2
5151

5252
for (const nightly of nightliesToPrune) {
5353
console.log(`Deleting nightly: ${nightly.tag_name}`);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Daily CI job to update forge-std version used for tests if new release has been published
2+
3+
name: bump-forge-std
4+
5+
on:
6+
schedule:
7+
- cron: "0 0 * * *"
8+
workflow_dispatch:
9+
10+
jobs:
11+
update-tag:
12+
name: update forge-std tag
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Fetch and update forge-std tag
17+
run: curl 'https://api.github.com/repos/foundry-rs/forge-std/tags' | jq '.[0].commit.sha' -jr > testdata/forge-std-rev
18+
- name: Create pull request
19+
uses: peter-evans/create-pull-request@v5
20+
with:
21+
commit-message: "chore: bump forge-std version used for tests"
22+
title: "chore(tests): bump forge-std version"
23+
body: |
24+
New release of forge-std has been published, bump forge-std version used in tests. Likely some fixtures need to be updated.
25+
branch: chore/bump-forge-std

.github/workflows/deny.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
name: deny
22

33
on:
4-
push:
5-
branches: [master]
6-
paths: [Cargo.lock, deny.toml]
7-
pull_request:
8-
branches: [master]
9-
paths: [Cargo.lock, deny.toml]
4+
push:
5+
branches: [master]
6+
paths: [Cargo.lock, deny.toml]
7+
pull_request:
8+
branches: [master]
9+
paths: [Cargo.lock, deny.toml]
1010

1111
env:
12-
CARGO_TERM_COLOR: always
12+
CARGO_TERM_COLOR: always
1313

1414
jobs:
15-
cargo-deny:
16-
name: cargo deny check
17-
runs-on: ubuntu-latest
18-
timeout-minutes: 30
19-
steps:
20-
- uses: actions/checkout@v4
21-
- uses: EmbarkStudios/cargo-deny-action@v1
22-
with:
23-
command: check all
24-
# Clear out arguments to not pass `--all-features` to `cargo deny`.
25-
# many crates have an `openssl` feature which enables banned dependencies
26-
arguments: ""
15+
cargo-deny:
16+
name: cargo deny check
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 30
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: EmbarkStudios/cargo-deny-action@v1
22+
with:
23+
command: check all
24+
# Clear out arguments to not pass `--all-features` to `cargo deny`.
25+
# many crates have an `openssl` feature which enables banned dependencies
26+
arguments: ""

.github/workflows/dependencies.yml

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,61 @@
1-
# Automatically run `cargo update` periodically
1+
# Runs `cargo update` periodically.
22

33
name: dependencies
44

55
on:
6-
schedule:
7-
# Run weekly
8-
- cron: "0 0 * * SUN"
9-
workflow_dispatch:
10-
# Needed so we can run it manually
6+
schedule:
7+
# Run weekly
8+
- cron: "0 0 * * SUN"
9+
workflow_dispatch:
10+
# Needed so we can run it manually
1111

1212
env:
13-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14-
BRANCH: cargo-update
15-
TITLE: "chore(deps): weekly `cargo update`"
16-
BODY: |
17-
Automation to keep dependencies in `Cargo.lock` current.
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
BRANCH: cargo-update
15+
TITLE: "chore(deps): weekly `cargo update`"
16+
BODY: |
17+
Automation to keep dependencies in `Cargo.lock` current.
1818
19-
<details><summary><strong>cargo update log</strong></summary>
20-
<p>
19+
<details><summary><strong>cargo update log</strong></summary>
20+
<p>
2121
22-
```log
23-
$cargo_update_log
24-
```
22+
```log
23+
$cargo_update_log
24+
```
2525
26-
</p>
27-
</details>
26+
</p>
27+
</details>
2828
2929
jobs:
30-
update:
31-
name: Update
32-
runs-on: ubuntu-latest
33-
timeout-minutes: 30
34-
steps:
35-
- uses: actions/checkout@v4
36-
- uses: dtolnay/rust-toolchain@nightly
37-
38-
- name: cargo update
39-
# Remove first line that always just says "Updating crates.io index"
40-
run:
41-
cargo update --color never 2>&1 | sed '/crates.io index/d' | tee -a
42-
cargo_update.log
43-
44-
- name: craft commit message and PR body
45-
id: msg
46-
run: |
47-
export cargo_update_log="$(cat cargo_update.log)"
48-
49-
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
50-
printf "$TITLE\n\n$cargo_update_log\n" >> $GITHUB_OUTPUT
51-
echo "EOF" >> $GITHUB_OUTPUT
52-
53-
echo "body<<EOF" >> $GITHUB_OUTPUT
54-
echo "$BODY" | envsubst >> $GITHUB_OUTPUT
55-
echo "EOF" >> $GITHUB_OUTPUT
56-
57-
- name: Create Pull Request
58-
uses: peter-evans/create-pull-request@v5
59-
with:
60-
add-paths: ./Cargo.lock
61-
commit-message: ${{ steps.msg.outputs.commit_message }}
62-
title: ${{ env.TITLE }}
63-
body: ${{ steps.msg.outputs.body }}
64-
branch: ${{ env.BRANCH }}
30+
update:
31+
name: Update
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: dtolnay/rust-toolchain@nightly
36+
37+
- name: cargo update
38+
# Remove first line that always just says "Updating crates.io index"
39+
run: cargo update --color never 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
40+
41+
- name: craft commit message and PR body
42+
id: msg
43+
run: |
44+
export cargo_update_log="$(cat cargo_update.log)"
45+
46+
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
47+
printf "$TITLE\n\n$cargo_update_log\n" >> $GITHUB_OUTPUT
48+
echo "EOF" >> $GITHUB_OUTPUT
49+
50+
echo "body<<EOF" >> $GITHUB_OUTPUT
51+
echo "$BODY" | envsubst >> $GITHUB_OUTPUT
52+
echo "EOF" >> $GITHUB_OUTPUT
53+
54+
- name: Create Pull Request
55+
uses: peter-evans/create-pull-request@v6
56+
with:
57+
add-paths: ./Cargo.lock
58+
commit-message: ${{ steps.msg.outputs.commit_message }}
59+
title: ${{ env.TITLE }}
60+
body: ${{ steps.msg.outputs.body }}
61+
branch: ${{ env.BRANCH }}

.github/workflows/nextest.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Reusable workflow for running tests via `cargo nextest`
2+
3+
name: nextest
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
profile:
9+
required: true
10+
type: string
11+
12+
concurrency:
13+
group: tests-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
env:
17+
CARGO_TERM_COLOR: always
18+
19+
jobs:
20+
matrices:
21+
name: build matrices
22+
runs-on: ubuntu-latest
23+
outputs:
24+
test-matrix: ${{ steps.gen.outputs.test-matrix }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v4
28+
with:
29+
python-version: "3.11"
30+
- name: Generate matrices
31+
id: gen
32+
env:
33+
EVENT_NAME: ${{ github.event_name }}
34+
PROFILE: ${{ inputs.profile }}
35+
run: |
36+
output=$(python3 .github/scripts/matrices.py)
37+
echo "::debug::test-matrix=$output"
38+
echo "test-matrix=$output" >> $GITHUB_OUTPUT
39+
40+
test:
41+
name: test ${{ matrix.name }}
42+
runs-on: ${{ matrix.runner_label }}
43+
timeout-minutes: 60
44+
needs: matrices
45+
strategy:
46+
fail-fast: false
47+
matrix: ${{ fromJson(needs.matrices.outputs.test-matrix) }}
48+
env:
49+
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/C3JEvfW6VgtqZQa-Qp1E-2srEiIc02sD
50+
CARGO_PROFILE_DEV_DEBUG: 0
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: dtolnay/rust-toolchain@stable
54+
with:
55+
target: ${{ matrix.target }}
56+
- uses: taiki-e/install-action@nextest
57+
58+
# External tests dependencies
59+
- name: Setup Node.js
60+
if: contains(matrix.name, 'external')
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: 20
64+
- name: Install Bun
65+
if: contains(matrix.name, 'external') && !contains(matrix.runner_label, 'windows')
66+
uses: oven-sh/setup-bun@v1
67+
with:
68+
bun-version: latest
69+
- name: Setup Python
70+
if: contains(matrix.name, 'external')
71+
uses: actions/setup-python@v4
72+
with:
73+
python-version: 3.11
74+
- name: Install Vyper
75+
if: contains(matrix.name, 'external')
76+
run: pip install vyper~=0.4.0
77+
78+
- name: Forge RPC cache
79+
uses: actions/cache@v3
80+
with:
81+
path: |
82+
~/.foundry/cache
83+
~/.config/.foundry/cache
84+
key: rpc-cache-${{ hashFiles('crates/forge/tests/rpc-cache-keyfile') }}
85+
- uses: Swatinem/rust-cache@v2
86+
with:
87+
cache-on-failure: true
88+
- name: Setup Git config
89+
run: |
90+
git config --global user.name "GitHub Actions Bot"
91+
git config --global user.email "<>"
92+
git config --global url."https://github.com/".insteadOf "[email protected]:"
93+
- name: Test
94+
env:
95+
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
96+
run: cargo nextest run ${{ matrix.flags }}

0 commit comments

Comments
 (0)