From d34b9c21ffbe671507e2ecdb0684bc409a456e99 Mon Sep 17 00:00:00 2001 From: zerosnacks <95942363+zerosnacks@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:38:08 +0200 Subject: [PATCH] feat(alloy): add `"full"` feature flag (#877) * add initial setup, make sure to enable rpc-client when setting rpc-client-ws flag * fix `alloy-serde` definition in `serde` flag * re-export alloy_rpc_client as client in the provider as we enable the rpc flags internally but require the user to import the rpc client for WsConnect / IpcConnect manually * only selectively enable WsConnect, IpcConnect - make available in root * add eips and kzg for 4844 tx and access lists * remove rpc-client from list --- crates/alloy/Cargo.toml | 21 ++++++++++++++++++--- crates/provider/src/lib.rs | 6 ++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/crates/alloy/Cargo.toml b/crates/alloy/Cargo.toml index afe5ab66f31..9ef936ce869 100644 --- a/crates/alloy/Cargo.toml +++ b/crates/alloy/Cargo.toml @@ -72,6 +72,21 @@ std = [ "alloy-consensus?/std", ] +# full +full = [ + "consensus", + "contract", + "eips", + "k256", + "kzg", + "network", + "provider-http", # includes `providers` + "provider-ws", # includes `providers` + "provider-ipc", # includes `providers` + "rpc-types", # includes `rpc-types-eth` + "signer-wallet", # includes `signers` +] + # configuration reqwest = [ "dep:reqwest", @@ -116,8 +131,8 @@ pubsub = [ rpc = [] json-rpc = ["rpc", "dep:alloy-json-rpc"] rpc-client = ["rpc", "dep:alloy-rpc-client"] -rpc-client-ws = ["rpc", "alloy-rpc-client?/ws"] -rpc-client-ipc = ["rpc", "alloy-rpc-client?/ipc"] +rpc-client-ws = ["rpc-client", "alloy-rpc-client?/ws"] +rpc-client-ipc = ["rpc-client", "alloy-rpc-client?/ipc"] rpc-types = ["rpc", "dep:alloy-rpc-types", "alloy-rpc-types?/eth"] rpc-types-anvil = ["rpc-types", "alloy-rpc-types?/anvil"] rpc-types-beacon = ["rpc-types", "alloy-rpc-types?/beacon"] @@ -165,7 +180,7 @@ postgres = ["alloy-core/postgres"] getrandom = ["alloy-core/getrandom"] rand = ["alloy-core/rand"] rlp = ["alloy-core/rlp"] -serde = ["alloy-core/serde", "alloy-eips?/serde", "alloy-serde"] +serde = ["alloy-core/serde", "alloy-eips?/serde", "dep:alloy-serde"] ssz = ["alloy-core/ssz", "alloy-rpc-types?/ssz"] arbitrary = [ "alloy-core/arbitrary", diff --git a/crates/provider/src/lib.rs b/crates/provider/src/lib.rs index 565bc82048e..a44cc35b79a 100644 --- a/crates/provider/src/lib.rs +++ b/crates/provider/src/lib.rs @@ -48,3 +48,9 @@ pub mod utils; #[doc(no_inline)] pub use alloy_network::{self as network, Network}; + +#[cfg(feature = "ws")] +pub use alloy_rpc_client::WsConnect; + +#[cfg(feature = "ipc")] +pub use alloy_rpc_client::IpcConnect;