Skip to content

Commit

Permalink
Merge pull request #4883 from NomicFoundation/edr/main
Browse files Browse the repository at this point in the history
Merge edr/main into main
  • Loading branch information
fvictorio authored Feb 19, 2024
2 parents 2a280a7 + 93c1476 commit e04b0cb
Show file tree
Hide file tree
Showing 442 changed files with 49,407 additions and 22,608 deletions.
21 changes: 21 additions & 0 deletions .cargo-husky/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
#
# Intended to be in sync with .github/workflows/hardhat-core-ci.yml's
# test-edr-rs

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.
ALL_FEATURES="--features tracing,bench-once,serde,std"
else
ALL_FEATURES=--all-features
fi

# Set -x here to avoid printing secrets
set -xe

# Setting RUSTFLAGS env for clippy makes it not include custom rules
RUSTFLAGS=-Dwarnings cargo check --workspace --all-targets --profile bench ${ALL_FEATURES}
cargo clippy --all --all-targets ${ALL_FEATURES} -- -D warnings
cargo +nightly fmt --all -- --check
cargo test --doc --workspace ${ALL_FEATURES}
cargo test --workspace --all-targets ${ALL_FEATURES}
85 changes: 85 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
[alias]
gen-execution-api = "run --bin tools -- gen-execution-api"

[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::if-not-else",
"-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/cold-cobras-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hardhat": minor
---

Refactored Hardhat Network to use EDR instead of ethereumjs
37 changes: 30 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,36 @@
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "16" /* Keep in sync with the oldest version of Node.js that Hardhat supports */
},
"ghcr.io/devcontainers/features/rust:1": {
"version": "1.70" /* Keep in sync with rust-toolchain */,
"profile": "default"
"version": "18"
}
},
/* libudev-dev is required by hardhat-ledger. pkg-config is required by EDR to use OpenSSL */
"postCreateCommand": "sudo apt update && sudo apt install -y libudev-dev pkg-config"
"postAttachCommand": "scripts/setup.sh",
"portsAttributes": {
// The default port of mdbook
"3000": {
"label": "mdbook",
"onAutoForward": "openPreview"
}
},
"containerEnv": {
"ALCHEMY_URL": "${localEnv:ALCHEMY_URL}",
"INFURA_URL": "${localEnv:INFURA_URL}"
},
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode",
"NomicFoundation.hardhat-solidity",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"vadimcn.vscode-lldb"
],
"settings": {
"rust-analyzer.cargo.features": "all",
"rust-analyzer.rustfmt.extraArgs": [
"+nightly"
]
}
}
}
}
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.sol linguist-language=Solidity
# prevent github actions to checkout files with crlf line endings
* -text
* text=auto

*.sol text eol=lf
*.d.ts text eol=lf
8 changes: 7 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@

version: 2
updates:
- package-ecosystem: "npm"
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "bump"
- package-ecosystem: "pnpm"
directory: "/"
schedule:
interval: "daily"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/LATEST_DEPENDENCY_VERSIONS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
cache: "pnpm"
- name: Delete pnpm-lock.yaml
run: "rm pnpm-lock.yaml"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-docs-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
cache: "pnpm"
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/comment-on-linter-error.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
version: 8
- uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
cache: "pnpm"
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/compile-with-typescript-v4.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: E2E tests
on:
push:
branches:
- "**"
- "main"
pull_request:
branches:
- "main"

jobs:
run-e2e:
Expand Down
Loading

0 comments on commit e04b0cb

Please sign in to comment.