-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Optimism bindings in N-API #664
Merged
Merged
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
09d7311
refactor: move prepublish script
Wodann 4f8e763
feat: add Optimism N-API package
Wodann 2499926
fix: edr_napi (test) target
Wodann fb093cf
ci: prevent RUSTFLAGS from overriding .cargo/config.toml
Wodann 74f55e8
refactor: revert to single NPM package
Wodann 80c3dc7
fix: remove Optimism bindings
Wodann 65a545e
ci: add environment variables for cargo hack
Wodann e750ef0
fix: pnpm testNoBuild
Wodann 7dd2b47
misc: apply review suggestions
Wodann fa4f9e4
ci: increase timeout for issue 543
Wodann e6c1908
ci: increase timeout for macOS
Wodann 1bb2508
ci: increase timeout for macOS
Wodann f335282
ci: increase timeout for macOS
Wodann 35219e5
ci: increase timeout for macOS
Wodann 92e9191
ci: decrease timeout for macOS
Wodann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,14 @@ edition = "2021" | |
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
ansi_term = { version = "0.12.1", default-features = false } | ||
derive-where = { version = "1.2.7", default-features = false } | ||
edr_eth = { path = "../edr_eth" } | ||
edr_evm = { path = "../edr_evm" } | ||
edr_generic = { path = "../edr_generic" } | ||
edr_napi_core = { path = "../edr_napi_core" } | ||
edr_optimism = { path = "../edr_optimism", optional = true } | ||
edr_provider = { path = "../edr_provider" } | ||
edr_rpc_client = { path = "../edr_rpc_client" } | ||
itertools = { version = "0.12.0", default-features = false } | ||
mimalloc = { version = "0.1.39", default-features = false, features = ["local_dynamic_tls"] } | ||
# when napi is pinned, be sure to pin napi-derive to the same version | ||
# The `async` feature ensures that a tokio runtime is available | ||
|
@@ -24,7 +23,6 @@ napi-derive = "2.16.0" | |
rand = { version = "0.8.4", optional = true } | ||
serde = { version = "1.0.209", features = ["derive"] } | ||
serde_json = { version = "1.0.127" } | ||
thiserror = { version = "1.0.37", default-features = false } | ||
tracing = { version = "0.1.37", default-features = false, features = ["std"] } | ||
tracing-flame = { version = "0.2.0", default-features = false, features = ["smallvec"] } | ||
tracing-subscriber = { version = "0.3.18", default-features = false, features = ["ansi", "env-filter", "fmt", "parking_lot", "smallvec", "std"] } | ||
|
@@ -45,11 +43,9 @@ openssl-sys = { version = "0.9.93", features = ["vendored"] } | |
napi-build = "2.0.1" | ||
|
||
[features] | ||
tracing = ["edr_evm/tracing", "edr_napi_core/tracing", "edr_provider/tracing"] | ||
optimism = ["dep:edr_optimism"] | ||
scenarios = ["rand"] | ||
|
||
[profile.release] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
lto = true | ||
tracing = ["edr_evm/tracing", "edr_napi_core/tracing", "edr_provider/tracing"] | ||
|
||
[lints] | ||
workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// Types for the generic L1 Ethereum implementation. | ||
pub mod generic; | ||
/// Types for L1 Ethereum implementation. | ||
pub mod l1; | ||
/// Types for Optimism implementation. | ||
#[cfg(feature = "optimism")] | ||
pub mod optimism; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was overriding the
.cargo/config.toml
file's rustflags.This change should not have any adverse side-effects, as we also manually pass this argument to
cargo clippy
which should fail if there are any warnings.For reference:
cargo clippy --workspace --all-targets --all-features -- -D warnings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanatory comment! I'm wondering if removing it has effect on the
check-edr
andtest-edr-rs
? E.g. if there are some unused imports with some feature combination, would the CI not fail now? It's not a merge blocker for me if it doesn't, just want to make sure we consider it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Given that we use
cargo hack
incheck-edr
, we would lose some functionality - I think. I've re-added the environment variables for that specific command here.Clippy catches all warnings that
cargo check|build|test
would catch, as it is a superset of the check command - under the hood. Since we runcargo clippy
with--all-targets
, the test target is also run.This means that it's possible for the
test-edr-rs
step to succeed with warnings, but the step runningcargo clippy
would fail the CI.To validate this, I just added two simple functions (dead code) to
lib.rs
:Running
cargo check --all-targets
gives the following warnings:These become errors when running
cargo clippy --all-targets -- -D warnings
(failing one at a time):