From b3352870e0b30091dfba14fac17410622185c0d4 Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Thu, 9 Jan 2025 19:48:11 +0530 Subject: [PATCH 1/6] feat(`meta`): add `full` to default features --- crates/alloy/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/alloy/Cargo.toml b/crates/alloy/Cargo.toml index fac399789e1..947c45dfa5c 100644 --- a/crates/alloy/Cargo.toml +++ b/crates/alloy/Cargo.toml @@ -65,7 +65,7 @@ alloy-transport-ws = { workspace = true, optional = true } # ----------------------------------------- Configuration ---------------------------------------- # [features] -default = ["std", "reqwest", "alloy-core/default"] +default = ["std", "reqwest", "alloy-core/default", "full"] # std std = [ From ab907d7ea58ef6eeddfc847b65594677d23e5911 Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:06:08 +0530 Subject: [PATCH 2/6] feat: essentials --- crates/alloy/Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/alloy/Cargo.toml b/crates/alloy/Cargo.toml index 947c45dfa5c..5300c841450 100644 --- a/crates/alloy/Cargo.toml +++ b/crates/alloy/Cargo.toml @@ -65,7 +65,7 @@ alloy-transport-ws = { workspace = true, optional = true } # ----------------------------------------- Configuration ---------------------------------------- # [features] -default = ["std", "reqwest", "alloy-core/default", "full"] +default = ["std", "reqwest", "alloy-core/default", "essentials"] # std std = [ @@ -76,6 +76,9 @@ std = [ "alloy-consensus?/std", ] +# essential features that enable bare minimal network interactions out of the box. +essentials = ["contract", "provider-http", "rpc-types", "signer-local"] + # full full = [ "consensus", From bec14d9fd8b70d7451fef8c7b346811f6df96b39 Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:10:38 +0530 Subject: [PATCH 3/6] fix: add `js` to getrandom for wasm32 --- crates/alloy/Cargo.toml | 2 +- crates/contract/Cargo.toml | 3 +++ crates/network/Cargo.toml | 3 +++ crates/node-bindings/Cargo.toml | 3 +++ crates/provider/Cargo.toml | 1 + crates/signer-local/Cargo.toml | 3 +++ crates/signer/Cargo.toml | 3 +++ 7 files changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/alloy/Cargo.toml b/crates/alloy/Cargo.toml index 5300c841450..b6546ab9493 100644 --- a/crates/alloy/Cargo.toml +++ b/crates/alloy/Cargo.toml @@ -76,7 +76,7 @@ std = [ "alloy-consensus?/std", ] -# essential features that enable bare minimal network interactions out of the box. +# essential features that enable basic network interactions out of the box. essentials = ["contract", "provider-http", "rpc-types", "signer-local"] # full diff --git a/crates/contract/Cargo.toml b/crates/contract/Cargo.toml index a65be56b6d6..6431d45650e 100644 --- a/crates/contract/Cargo.toml +++ b/crates/contract/Cargo.toml @@ -40,6 +40,9 @@ thiserror.workspace = true alloy-pubsub = { workspace = true, optional = true } +[target.'cfg(target_arch = "wasm32")'.dependencies] +getrandom = { version = "0.2", features = ["js"] } + [dev-dependencies] alloy-consensus.workspace = true alloy-rpc-client = { workspace = true, features = ["pubsub", "ws"] } diff --git a/crates/network/Cargo.toml b/crates/network/Cargo.toml index df86ae88ded..ddc56f76323 100644 --- a/crates/network/Cargo.toml +++ b/crates/network/Cargo.toml @@ -42,6 +42,9 @@ serde.workspace = true serde_json.workspace = true thiserror.workspace = true +[target.'cfg(target_arch = "wasm32")'.dependencies] +getrandom = { version = "0.2", features = ["js"] } + [dev-dependencies] [features] diff --git a/crates/node-bindings/Cargo.toml b/crates/node-bindings/Cargo.toml index 588ceae2644..8057267f43e 100644 --- a/crates/node-bindings/Cargo.toml +++ b/crates/node-bindings/Cargo.toml @@ -33,6 +33,9 @@ thiserror.workspace = true tracing.workspace = true url.workspace = true +[target.'cfg(target_arch = "wasm32")'.dependencies] +getrandom = { version = "0.2", features = ["js"] } + [dev-dependencies] ci_info.workspace = true tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } diff --git a/crates/provider/Cargo.toml b/crates/provider/Cargo.toml index c91ca38cd46..d4242014b50 100644 --- a/crates/provider/Cargo.toml +++ b/crates/provider/Cargo.toml @@ -71,6 +71,7 @@ url = { workspace = true, optional = true } parking_lot.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies] wasmtimer.workspace = true +getrandom = { version = "0.2", features = ["js"] } [dev-dependencies] alloy-consensus = { workspace = true, features = ["kzg"] } diff --git a/crates/signer-local/Cargo.toml b/crates/signer-local/Cargo.toml index f2052f6da68..81234916cb5 100644 --- a/crates/signer-local/Cargo.toml +++ b/crates/signer-local/Cargo.toml @@ -50,6 +50,9 @@ yubihsm = { version = "0.42", features = [ "usb", ], optional = true } +[target.'cfg(target_arch = "wasm32")'.dependencies] +getrandom = { version = "0.2", features = ["js"] } + [dev-dependencies] alloy-dyn-abi.workspace = true alloy-sol-types.workspace = true diff --git a/crates/signer/Cargo.toml b/crates/signer/Cargo.toml index 66498290295..ee9fff36e28 100644 --- a/crates/signer/Cargo.toml +++ b/crates/signer/Cargo.toml @@ -38,6 +38,9 @@ alloy-dyn-abi = { workspace = true, optional = true, features = [ "eip712", ] } +[target.'cfg(target_arch = "wasm32")'.dependencies] +getrandom = { version = "0.2", features = ["js"] } + [dev-dependencies] assert_matches.workspace = true serde.workspace = true From 3313b09fa51a4b85557bf7d5dc01de03e680fb91 Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:17:34 +0530 Subject: [PATCH 4/6] Revert "fix: add `js` to getrandom for wasm32" This reverts commit bec14d9fd8b70d7451fef8c7b346811f6df96b39. --- crates/contract/Cargo.toml | 3 --- crates/network/Cargo.toml | 3 --- crates/node-bindings/Cargo.toml | 3 --- crates/provider/Cargo.toml | 1 - crates/signer-local/Cargo.toml | 3 --- crates/signer/Cargo.toml | 3 --- 6 files changed, 16 deletions(-) diff --git a/crates/contract/Cargo.toml b/crates/contract/Cargo.toml index 6431d45650e..a65be56b6d6 100644 --- a/crates/contract/Cargo.toml +++ b/crates/contract/Cargo.toml @@ -40,9 +40,6 @@ thiserror.workspace = true alloy-pubsub = { workspace = true, optional = true } -[target.'cfg(target_arch = "wasm32")'.dependencies] -getrandom = { version = "0.2", features = ["js"] } - [dev-dependencies] alloy-consensus.workspace = true alloy-rpc-client = { workspace = true, features = ["pubsub", "ws"] } diff --git a/crates/network/Cargo.toml b/crates/network/Cargo.toml index ddc56f76323..df86ae88ded 100644 --- a/crates/network/Cargo.toml +++ b/crates/network/Cargo.toml @@ -42,9 +42,6 @@ serde.workspace = true serde_json.workspace = true thiserror.workspace = true -[target.'cfg(target_arch = "wasm32")'.dependencies] -getrandom = { version = "0.2", features = ["js"] } - [dev-dependencies] [features] diff --git a/crates/node-bindings/Cargo.toml b/crates/node-bindings/Cargo.toml index 8057267f43e..588ceae2644 100644 --- a/crates/node-bindings/Cargo.toml +++ b/crates/node-bindings/Cargo.toml @@ -33,9 +33,6 @@ thiserror.workspace = true tracing.workspace = true url.workspace = true -[target.'cfg(target_arch = "wasm32")'.dependencies] -getrandom = { version = "0.2", features = ["js"] } - [dev-dependencies] ci_info.workspace = true tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } diff --git a/crates/provider/Cargo.toml b/crates/provider/Cargo.toml index d4242014b50..c91ca38cd46 100644 --- a/crates/provider/Cargo.toml +++ b/crates/provider/Cargo.toml @@ -71,7 +71,6 @@ url = { workspace = true, optional = true } parking_lot.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies] wasmtimer.workspace = true -getrandom = { version = "0.2", features = ["js"] } [dev-dependencies] alloy-consensus = { workspace = true, features = ["kzg"] } diff --git a/crates/signer-local/Cargo.toml b/crates/signer-local/Cargo.toml index 81234916cb5..f2052f6da68 100644 --- a/crates/signer-local/Cargo.toml +++ b/crates/signer-local/Cargo.toml @@ -50,9 +50,6 @@ yubihsm = { version = "0.42", features = [ "usb", ], optional = true } -[target.'cfg(target_arch = "wasm32")'.dependencies] -getrandom = { version = "0.2", features = ["js"] } - [dev-dependencies] alloy-dyn-abi.workspace = true alloy-sol-types.workspace = true diff --git a/crates/signer/Cargo.toml b/crates/signer/Cargo.toml index ee9fff36e28..66498290295 100644 --- a/crates/signer/Cargo.toml +++ b/crates/signer/Cargo.toml @@ -38,9 +38,6 @@ alloy-dyn-abi = { workspace = true, optional = true, features = [ "eip712", ] } -[target.'cfg(target_arch = "wasm32")'.dependencies] -getrandom = { version = "0.2", features = ["js"] } - [dev-dependencies] assert_matches.workspace = true serde.workspace = true From b787748fd4f444cdb169d1b57529554c0bfc585c Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:18:25 +0530 Subject: [PATCH 5/6] fix: exclude alloy from wasm32 workflow --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5aa79b9a62..872481ef234 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,6 +90,7 @@ jobs: - name: cargo hack run: | cargo hack build --workspace --ignore-unknown-features --features ws --target wasm32-unknown-unknown \ + --exclude alloy \ --exclude alloy-contract \ --exclude alloy-network \ --exclude alloy-node-bindings \ From 59bc9dd128ca960de19e6686967fa5449addf605 Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:18:58 +0530 Subject: [PATCH 6/6] nit --- crates/alloy/Cargo.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/alloy/Cargo.toml b/crates/alloy/Cargo.toml index b6546ab9493..534cee430c3 100644 --- a/crates/alloy/Cargo.toml +++ b/crates/alloy/Cargo.toml @@ -82,16 +82,13 @@ essentials = ["contract", "provider-http", "rpc-types", "signer-local"] # full full = [ "consensus", - "contract", "eips", + "essentials", "k256", "kzg", "network", - "provider-http", "provider-ws", "provider-ipc", - "rpc-types", - "signer-local", ] # configuration