Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into feat/solidity-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agostbiro committed Jun 19, 2024
2 parents 4119750 + 28cd352 commit 5f79eed
Show file tree
Hide file tree
Showing 175 changed files with 12,381 additions and 9,419 deletions.
10 changes: 7 additions & 3 deletions .cargo-husky/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
#
# Intended to be in sync with .github/workflows/hardhat-core-ci.yml's
# test-edr-rs
# Intended to be in sync with .github/workflows/edr-ci.yml's `test-edr-rs` job.


if [ -z "${ALCHEMY_URL}" ] || [ -z "${INFURA_URL}" ]; then
echo WARNING: skipping remote tests because the ALCHEMY_URL and INFURA_URL environment variables are not defined. Local test results may differ from those in CI.
Expand All @@ -13,7 +13,11 @@ fi
# Set -x here to avoid printing secrets
set -xe

# Do not modify or set RUSTFLAGS as this overrides any flags that may have been set
# by the user and prevents from reusing the build cache.
# See https://github.com/rust-lang/cargo/issues/8424#issuecomment-1734683743 and the thread.

cargo clippy --workspace --all-targets ${ALL_FEATURES} -- --deny warnings
cargo +nightly fmt --all -- --check
cargo clippy --all --all-targets ${ALL_FEATURES} -- -D warnings
cargo test --doc --workspace ${ALL_FEATURES}
cargo test --workspace --all-targets ${ALL_FEATURES}
90 changes: 4 additions & 86 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,88 +1,6 @@
[alias]
gen-execution-api = "run --bin tools -- gen-execution-api"
scenario = "run --release --bin tools -- scenario"
scenario-with-tracing = "run --release --features tracing --bin tools -- scenario"
replay-block = "run --release --bin tools -- replay-block"
gen-execution-api = "run --bin tools -- gen-execution-api"
scenario = "run --release --bin tools -- scenario"
scenario-with-tracing = "run --release --features tracing --bin tools -- scenario"
replay-block = "run --release --bin tools -- replay-block"
generate-cheats-interface = "test -p foundry-cheatcodes-spec --features schema tests::"

[target.'cfg(all())']
rustflags = [
"-Wclippy::all",
"-Wclippy::await_holding_lock",
"-Wclippy::bool-to-int-with-if",
"-Wclippy::cast_lossless",
"-Wclippy::char_lit_as_u8",
"-Wclippy::checked_conversions",
"-Wclippy::dbg_macro",
"-Wclippy::debug_assert_with_mut_call",
"-Wclippy::default_trait_access",
"-Wclippy::doc_markdown",
"-Wclippy::empty_enum",
"-Wclippy::enum_glob_use",
"-Wclippy::exit",
"-Wclippy::expl_impl_clone_on_copy",
"-Wclippy::explicit_deref_methods",
"-Wclippy::explicit_into_iter_loop",
"-Wclippy::fallible_impl_from",
"-Wclippy::filter_map_next",
"-Wclippy::flat_map_option",
"-Wclippy::float_cmp_const",
"-Wclippy::fn_params_excessive_bools",
"-Wclippy::from_iter_instead_of_collect",
"-Wclippy::implicit_clone",
"-Wclippy::imprecise_flops",
"-Wclippy::inconsistent_struct_constructor",
"-Wclippy::inefficient_to_string",
"-Wclippy::invalid_upcast_comparisons",
"-Wclippy::items-after-statements",
"-Wclippy::large_digit_groups",
"-Wclippy::large_stack_arrays",
"-Wclippy::large_types_passed_by_value",
"-Wclippy::let_unit_value",
"-Wclippy::linkedlist",
"-Wclippy::lossy_float_literal",
"-Wclippy::macro_use_imports",
"-Wclippy::manual-assert",
"-Wclippy::manual_ok_or",
"-Wclippy::map_err_ignore",
"-Wclippy::map_flatten",
"-Wclippy::map_unwrap_or",
"-Wclippy::match_on_vec_items",
"-Wclippy::match_same_arms",
"-Wclippy::match_wild_err_arm",
"-Wclippy::match_wildcard_for_single_variants",
"-Wclippy::mem_forget",
"-Wclippy::missing_enforced_import_renames",
"-Wclippy::mut_mut",
"-Wclippy::mutex_integer",
"-Wclippy::needless_borrow",
"-Wclippy::needless_continue",
"-Wclippy::needless_for_each",
"-Wclippy::option_option",
"-Wclippy::path_buf_push_overwrite",
"-Wclippy::ptr_as_ptr",
"-Wclippy::rc_mutex",
"-Wclippy::redundant_closure_for_method_calls",
"-Wclippy::ref_option_ref",
"-Wclippy::rest_pat_in_fully_bound_structs",
"-Wclippy::same_functions_in_if_condition",
"-Wclippy::semicolon_if_nothing_returned",
"-Wclippy::single_match_else",
"-Wclippy::string_add_assign",
"-Wclippy::string_add",
"-Wclippy::string_lit_as_bytes",
"-Wclippy::string_to_string",
"-Wclippy::todo",
"-Wclippy::trait_duplication_in_bounds",
"-Wclippy::unimplemented",
"-Wclippy::uninlined_format_args",
"-Wclippy::unnested_or_patterns",
"-Wclippy::unused_self",
"-Wclippy::useless_transmute",
"-Wclippy::verbose_file_reads",
"-Wclippy::wildcard-imports",
"-Wclippy::zero_sized_map_values",
"-Wfuture_incompatible",
"-Wnonstandard_style",
"-Wrust_2018_idioms",
]
5 changes: 5 additions & 0 deletions .changeset/fair-rice-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/edr": patch
---

Provide a more helpful message when passing a timestamp bigger than 2^64 via JSON-RPC
5 changes: 5 additions & 0 deletions .changeset/modern-ways-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/edr": patch
---

Fixed a problem that prevented forking chains without mix hash fields in their blocks
5 changes: 5 additions & 0 deletions .changeset/twelve-yaks-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/edr": patch
---

Fixed missing remote contract code when setting storage
5 changes: 4 additions & 1 deletion .github/workflows/edr-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Install Node
uses: actions/setup-node@v2
with:
Expand All @@ -58,6 +58,9 @@ jobs:
- name: Install package
run: pnpm install --frozen-lockfile --prefer-offline

- name: Run benchmark tests
run: pnpm test

- name: Run benchmark
run: pnpm run -s benchmark

Expand Down
29 changes: 13 additions & 16 deletions .github/workflows/edr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
paths:
- ".github/workflows/edr.yml"
- ".github/workflows/edr-ci.yml"
- "rust-toolchain"
- "Cargo.lock"
- "Cargo.toml"
Expand All @@ -14,13 +14,16 @@ on:
branches:
- "**"
paths:
- ".github/workflows/edr.yml"
- ".github/workflows/edr-ci.yml"
- "rust-toolchain"
- "Cargo.lock"
- "Cargo.toml"
- "crates/**"
workflow_dispatch:

env:
RUSTFLAGS: -Dwarnings

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
Expand All @@ -29,10 +32,6 @@ jobs:
check-edr:
name: Check EDR
runs-on: ubuntu-latest
# Setting RUSTFLAGS env for clippy makes it not include custom rules
env:
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -66,11 +65,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
include:
- RUSTFLAGS: "-Dwarnings"
- os: "windows-latest"
RUSTFLAGS: "-Dwarnings -Ctarget-feature=+crt-static"
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v3

Expand All @@ -89,10 +84,15 @@ jobs:
**/edr-cache
key: edr-rs-rpc-cache-v1

- name: Build cargo tests
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-targets --all-features --no-run

- name: Run cargo test
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
ALCHEMY_URL: ${{ secrets.ALCHEMY_URL }}
INFURA_URL: ${{ secrets.INFURA_URL }}
with:
Expand All @@ -101,8 +101,6 @@ jobs:

- name: Doctests
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
with:
command: test
args: --doc --workspace --features tracing
Expand All @@ -119,7 +117,6 @@ jobs:
# - name: Test with latest nextest release
# uses: actions-rs/cargo@v1
# env:
# RUSTFLAGS: ${{ matrix.RUSTFLAGS }}
# CARGO_INCREMENTAL: ${{ matrix.CARGO_INCREMENTAL }}
# ALCHEMY_URL: ${{ secrets.ALCHEMY_URL }}
# with:
Expand Down Expand Up @@ -188,7 +185,7 @@ jobs:

- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Install Node
uses: actions/setup-node@v2
with:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/edr-npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Setup node
uses: actions/setup-node@v3
if: ${{ !matrix.settings.docker }}
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Setup node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Setup node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -237,7 +237,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Setup node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Download artifacts
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Download artifacts
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -382,7 +382,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Setup node
uses: actions/setup-node@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hardhat-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Install Node
uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:

- uses: pnpm/action-setup@v2
with:
version: 8
version: 9
- name: Install Node
uses: actions/setup-node@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
version: 9

- name: Setup Node.js 18.x
uses: actions/setup-node@v2
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/review-requested-slack-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: PR review requested Slack notification

on:
pull_request_target:
types: [review_requested]

jobs:
requested:
uses: NomicFoundation/github-actions-workflows/.github/workflows/review-requested-slack-notification.yml@main
secrets: inherit
10 changes: 10 additions & 0 deletions .github/workflows/review-submitted-slack-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: PR reviewed Slack notification

on:
pull_request_review:
types: [submitted]

jobs:
reviewed:
uses: NomicFoundation/github-actions-workflows/.github/workflows/review-submitted-slack-notification.yml@main
secrets: inherit
Loading

0 comments on commit 5f79eed

Please sign in to comment.