diff --git a/Cargo.toml b/Cargo.toml index 28f69bc3b12..168c30f194b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,6 +79,10 @@ alloy-rlp = { version = "0.3", default-features = false } alloy-chains = { version = "0.1.18", default-features = false } +# eips +alloy-eip2930 = { version = "0.1.0", default-features = false } +alloy-eip7702 = { version = "0.1.0", default-features = false } + # ethereum ethereum_ssz_derive = "0.7.1" ethereum_ssz = "0.7.1" diff --git a/crates/alloy/Cargo.toml b/crates/alloy/Cargo.toml index a5329d9d289..542924c6895 100644 --- a/crates/alloy/Cargo.toml +++ b/crates/alloy/Cargo.toml @@ -269,9 +269,9 @@ arbitrary = [ k256 = [ "alloy-core/k256", "alloy-consensus?/k256", - "alloy-eips?/k256", "alloy-network?/k256", "alloy-rpc-types?/k256", + "alloy-eips?/k256", ] kzg = ["alloy-consensus?/kzg", "alloy-rpc-types?/kzg"] eip712 = [ diff --git a/crates/consensus/Cargo.toml b/crates/consensus/Cargo.toml index a9d68626365..d4f99be9541 100644 --- a/crates/consensus/Cargo.toml +++ b/crates/consensus/Cargo.toml @@ -48,11 +48,7 @@ default = ["std"] std = ["alloy-eips/std", "c-kzg?/std"] k256 = ["alloy-primitives/k256", "alloy-eips/k256"] kzg = ["dep:c-kzg", "alloy-eips/kzg", "std"] -arbitrary = [ - "std", - "dep:arbitrary", - "alloy-eips/arbitrary", -] +arbitrary = ["std", "dep:arbitrary", "alloy-eips/arbitrary"] serde = [ "dep:serde", "alloy-primitives/serde", diff --git a/crates/eips/Cargo.toml b/crates/eips/Cargo.toml index 72df135d83e..1e327cd7de9 100644 --- a/crates/eips/Cargo.toml +++ b/crates/eips/Cargo.toml @@ -19,6 +19,10 @@ rustdoc-args = ["--cfg", "docsrs"] workspace = true [dependencies] +# eips +alloy-eip2930.workspace = true +alloy-eip7702.workspace = true + alloy-primitives = { workspace = true, features = ["rlp"] } alloy-rlp = { workspace = true, features = ["derive"] } @@ -43,9 +47,6 @@ ethereum_ssz = { workspace = true, optional = true } # arbitrary arbitrary = { workspace = true, features = ["derive"], optional = true } -# for signed authorization list arbitrary -k256 = { workspace = true, optional = true } -rand = { workspace = true, optional = true } [dev-dependencies] alloy-primitives = { workspace = true, features = [ @@ -58,29 +59,22 @@ serde_json.workspace = true [features] default = ["std", "kzg-sidecar"] -std = [ - "alloy-primitives/std", - "alloy-rlp/std", - "serde?/std", - "c-kzg?/std", - "once_cell?/std", -] -serde = [ - "dep:alloy-serde", - "dep:serde", - "alloy-primitives/serde", - "c-kzg?/serde", -] +std = ["alloy-primitives/std", "alloy-rlp/std", +"serde?/std", "c-kzg?/std", "once_cell?/std"] +serde = ["dep:alloy-serde", "dep:serde", "alloy-primitives/serde", +"c-kzg?/serde", "alloy-eip2930/serde", "alloy-eip7702/serde"] kzg = ["kzg-sidecar", "sha2", "dep:derive_more", "dep:c-kzg", "dep:once_cell"] kzg-sidecar = ["sha2"] +k256 = ["alloy-eip7702/k256"] sha2 = ["dep:sha2"] -k256 = ["alloy-primitives/k256", "dep:k256"] ssz = ["std", "dep:ethereum_ssz", "dep:ethereum_ssz_derive"] arbitrary = [ "std", "kzg-sidecar", "dep:arbitrary", - "dep:rand", "alloy-primitives/arbitrary", "alloy-serde?/arbitrary", + "alloy-eip2930/arbitrary", + "alloy-eip7702/arbitrary", + "alloy-eip7702/k256", ] diff --git a/crates/eips/README.md b/crates/eips/README.md index 4956250ee6c..ee42eee817a 100644 --- a/crates/eips/README.md +++ b/crates/eips/README.md @@ -4,6 +4,8 @@ Ethereum Improvement Proprosal (EIP) implementations. Contains constants, helpers, and basic data structures for consensus EIPs. +EIPs 2930 and 7702 are re-exported from [alloy-rs/eips](https://github.com/alloy-rs/eips). + ## Current support - [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) diff --git a/crates/eips/src/eip2930.rs b/crates/eips/src/eip2930.rs index e215eec9e04..9eda390bbec 100644 --- a/crates/eips/src/eip2930.rs +++ b/crates/eips/src/eip2930.rs @@ -1,206 +1,2 @@ -//! [EIP-2930] types. -//! -//! [EIP-2930]: https://eips.ethereum.org/EIPS/eip-2930 - -#[cfg(not(feature = "std"))] -use alloc::{string::String, vec::Vec}; - -use alloy_primitives::{Address, B256, U256}; -use alloy_rlp::{RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper}; -use core::{mem, ops::Deref}; -/// A list of addresses and storage keys that the transaction plans to access. -/// Accesses outside the list are possible, but become more expensive. -#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, RlpDecodable, RlpEncodable)] -#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] -pub struct AccessListItem { - /// Account addresses that would be loaded at the start of execution - pub address: Address, - /// Keys of storage that would be loaded at the start of execution - pub storage_keys: Vec, -} - -impl AccessListItem { - /// Calculates a heuristic for the in-memory size of the [AccessListItem]. - #[inline] - pub fn size(&self) -> usize { - mem::size_of::
() + self.storage_keys.capacity() * mem::size_of::() - } -} - -/// AccessList as defined in EIP-2930 -#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, RlpDecodableWrapper, RlpEncodableWrapper)] -#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct AccessList(pub Vec); - -impl From> for AccessList { - fn from(list: Vec) -> Self { - Self(list) - } -} - -impl From for Vec { - fn from(this: AccessList) -> Self { - this.0 - } -} - -impl Deref for AccessList { - type Target = Vec; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl AccessList { - /// Converts the list into a vec, expected by revm - pub fn flattened(&self) -> Vec<(Address, Vec)> { - self.flatten().collect() - } - - /// Consumes the type and converts the list into a vec, expected by revm - pub fn into_flattened(self) -> Vec<(Address, Vec)> { - self.into_flatten().collect() - } - - /// Consumes the type and returns an iterator over the list's addresses and storage keys. - pub fn into_flatten(self) -> impl Iterator)> { - self.0.into_iter().map(|item| { - ( - item.address, - item.storage_keys.into_iter().map(|slot| U256::from_be_bytes(slot.0)).collect(), - ) - }) - } - - /// Returns an iterator over the list's addresses and storage keys. - pub fn flatten(&self) -> impl Iterator)> + '_ { - self.0.iter().map(|item| { - ( - item.address, - item.storage_keys.iter().map(|slot| U256::from_be_bytes(slot.0)).collect(), - ) - }) - } - - /// Returns the position of the given address in the access list, if present. - fn index_of_address(&self, address: Address) -> Option { - self.iter().position(|item| item.address == address) - } - - /// Checks if a specific storage slot within an account is present in the access list. - /// - /// Returns a tuple with flags for the presence of the account and the slot. - pub fn contains_storage(&self, address: Address, slot: B256) -> (bool, bool) { - self.index_of_address(address) - .map_or((false, false), |idx| (true, self.contains_storage_key_at_index(slot, idx))) - } - - /// Checks if the access list contains the specified address. - pub fn contains_address(&self, address: Address) -> bool { - self.iter().any(|item| item.address == address) - } - - /// Checks if the storage keys at the given index within an account are present in the access - /// list. - fn contains_storage_key_at_index(&self, slot: B256, index: usize) -> bool { - self.get(index).map_or(false, |entry| { - entry.storage_keys.iter().any(|storage_key| *storage_key == slot) - }) - } - - /// Adds an address to the access list and returns `true` if the operation results in a change, - /// indicating that the address was not previously present. - pub fn add_address(&mut self, address: Address) -> bool { - !self.contains_address(address) && { - self.0.push(AccessListItem { address, storage_keys: Vec::new() }); - true - } - } - - /// Calculates a heuristic for the in-memory size of the [AccessList]. - #[inline] - pub fn size(&self) -> usize { - // take into account capacity - self.0.iter().map(AccessListItem::size).sum::() - + self.0.capacity() * mem::size_of::() - } -} - -/// Access list with gas used appended. -#[derive(Clone, Debug, Default, PartialEq, Eq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] -pub struct AccessListWithGasUsed { - /// List with accounts accessed during transaction. - pub access_list: AccessList, - /// Estimated gas used with access list. - pub gas_used: U256, -} - -/// `AccessListResult` for handling errors from `eth_createAccessList` -#[derive(Clone, Debug, Default, PartialEq, Eq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] -pub struct AccessListResult { - /// List with accounts accessed during transaction. - pub access_list: AccessList, - /// Estimated gas used with access list. - pub gas_used: U256, - /// Optional error message if the transaction failed. - #[cfg_attr(feature = "serde", serde(default, skip_serializing_if = "Option::is_none"))] - pub error: Option, -} - -impl AccessListResult { - /// Ensures the result is OK, returning [`AccessListWithGasUsed`] if so, or an error message if - /// not. - pub fn ensure_ok(self) -> Result { - match self.error { - Some(err) => Err(err), - None => { - Ok(AccessListWithGasUsed { access_list: self.access_list, gas_used: self.gas_used }) - } - } - } - - /// Checks if there is an error in the result. - #[inline] - pub const fn is_err(&self) -> bool { - self.error.is_some() - } -} - -#[cfg(all(test, feature = "serde"))] -mod tests { - use super::*; - - #[test] - fn access_list_serde() { - let list = AccessList(vec![ - AccessListItem { address: Address::ZERO, storage_keys: vec![B256::ZERO] }, - AccessListItem { address: Address::ZERO, storage_keys: vec![B256::ZERO] }, - ]); - let json = serde_json::to_string(&list).unwrap(); - let list2 = serde_json::from_str::(&json).unwrap(); - assert_eq!(list, list2); - } - - #[test] - fn access_list_with_gas_used() { - let list = AccessListResult { - access_list: AccessList(vec![ - AccessListItem { address: Address::ZERO, storage_keys: vec![B256::ZERO] }, - AccessListItem { address: Address::ZERO, storage_keys: vec![B256::ZERO] }, - ]), - gas_used: U256::from(100), - error: None, - }; - let json = serde_json::to_string(&list).unwrap(); - let list2 = serde_json::from_str(&json).unwrap(); - assert_eq!(list, list2); - } -} +//! Re-export the EIP-2930 types. +pub use alloy_eip2930::*; diff --git a/crates/eips/src/eip7702.rs b/crates/eips/src/eip7702.rs new file mode 100644 index 00000000000..6c4e544101d --- /dev/null +++ b/crates/eips/src/eip7702.rs @@ -0,0 +1,2 @@ +//! Re-export the EIP-7702 types. +pub use alloy_eip7702::*; diff --git a/crates/eips/src/eip7702/auth_list.rs b/crates/eips/src/eip7702/auth_list.rs deleted file mode 100644 index deb9e6c23f5..00000000000 --- a/crates/eips/src/eip7702/auth_list.rs +++ /dev/null @@ -1,335 +0,0 @@ -use core::ops::Deref; - -#[cfg(not(feature = "std"))] -use alloc::vec::Vec; -use alloy_primitives::{keccak256, Address, Signature, B256, U256}; -use alloy_rlp::{ - length_of_length, BufMut, Decodable, Encodable, Header, Result as RlpResult, RlpDecodable, - RlpEncodable, -}; -use core::hash::{Hash, Hasher}; - -/// Represents the outcome of an attempt to recover the authority from an authorization. -/// It can either be valid (containing an [`Address`]) or invalid (indicating recovery failure). -#[derive(Debug, Clone, Hash, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub enum RecoveredAuthority { - /// Indicates a successfully recovered authority address. - Valid(Address), - /// Indicates a failed recovery attempt where no valid address could be recovered. - Invalid, -} - -impl RecoveredAuthority { - /// Returns an optional address if valid. - pub const fn address(&self) -> Option
{ - match *self { - Self::Valid(address) => Some(address), - Self::Invalid => None, - } - } - - /// Returns true if the authority is valid. - pub const fn is_valid(&self) -> bool { - matches!(self, Self::Valid(_)) - } - - /// Returns true if the authority is invalid. - pub const fn is_invalid(&self) -> bool { - matches!(self, Self::Invalid) - } -} - -/// An unsigned EIP-7702 authorization. -#[derive(Debug, Clone, Hash, RlpEncodable, RlpDecodable, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] -#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))] -pub struct Authorization { - /// The chain ID of the authorization. - pub chain_id: U256, - /// The address of the authorization. - pub address: Address, - /// The nonce for the authorization. - #[cfg_attr(feature = "serde", serde(with = "alloy_serde::quantity"))] - pub nonce: u64, -} - -impl Authorization { - /// Get the `chain_id` for the authorization. - /// - /// # Note - /// - /// Implementers should check that this matches the current `chain_id` *or* is 0. - pub const fn chain_id(&self) -> U256 { - self.chain_id - } - - /// Get the `address` for the authorization. - pub const fn address(&self) -> &Address { - &self.address - } - - /// Get the `nonce` for the authorization. - pub const fn nonce(&self) -> u64 { - self.nonce - } - - /// Computes the signature hash used to sign the authorization, or recover the authority from a - /// signed authorization list item. - /// - /// The signature hash is `keccak(MAGIC || rlp([chain_id, address, nonce]))` - #[inline] - pub fn signature_hash(&self) -> B256 { - use super::constants::MAGIC; - - let mut buf = Vec::new(); - buf.put_u8(MAGIC); - self.encode(&mut buf); - - keccak256(buf) - } - - /// Convert to a signed authorization by adding a signature. - pub const fn into_signed(self, signature: Signature) -> SignedAuthorization { - SignedAuthorization { inner: self, signature } - } -} - -/// A signed EIP-7702 authorization. -#[derive(Debug, Clone, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct SignedAuthorization { - #[cfg_attr(feature = "serde", serde(flatten))] - inner: Authorization, - #[cfg_attr(feature = "serde", serde(flatten))] - signature: Signature, -} - -impl SignedAuthorization { - /// Get the `signature` for the authorization. - pub const fn signature(&self) -> &Signature { - &self.signature - } - - /// Splits the authorization into parts. - pub const fn into_parts(self) -> (Authorization, Signature) { - (self.inner, self.signature) - } - - /// Decodes the transaction from RLP bytes, including the signature. - fn decode_fields(buf: &mut &[u8]) -> RlpResult { - Ok(Self { - inner: Authorization { - chain_id: Decodable::decode(buf)?, - address: Decodable::decode(buf)?, - nonce: Decodable::decode(buf)?, - }, - signature: Signature::decode_rlp_vrs(buf)?, - }) - } - - /// Outputs the length of the transaction's fields, without a RLP header. - fn fields_len(&self) -> usize { - self.inner.chain_id.length() - + self.inner.address.length() - + self.inner.nonce.length() - + self.signature.rlp_vrs_len() - } -} - -impl Hash for SignedAuthorization { - fn hash(&self, state: &mut H) { - self.inner.hash(state); - self.signature.r().hash(state); - self.signature.s().hash(state); - self.signature.v().to_u64().hash(state); - } -} - -impl Decodable for SignedAuthorization { - fn decode(buf: &mut &[u8]) -> alloy_rlp::Result { - let header = Header::decode(buf)?; - if !header.list { - return Err(alloy_rlp::Error::UnexpectedString); - } - Self::decode_fields(buf) - } -} - -impl Encodable for SignedAuthorization { - fn encode(&self, buf: &mut dyn BufMut) { - Header { list: true, payload_length: self.fields_len() }.encode(buf); - self.inner.chain_id.encode(buf); - self.inner.address.encode(buf); - self.inner.nonce.encode(buf); - self.signature.write_rlp_vrs(buf) - } - - fn length(&self) -> usize { - let len = self.fields_len(); - len + length_of_length(len) - } -} - -#[cfg(feature = "k256")] -impl SignedAuthorization { - /// Recover the authority for the authorization. - /// - /// # Note - /// - /// Implementers should check that the authority has no code. - pub fn recover_authority(&self) -> Result { - self.signature.recover_address_from_prehash(&self.inner.signature_hash()) - } - - /// Recover the authority and transform the signed authorization into a - /// [`RecoveredAuthorization`]. - pub fn into_recovered(self) -> RecoveredAuthorization { - let authority_result = self.recover_authority(); - let authority = - authority_result.map_or(RecoveredAuthority::Invalid, RecoveredAuthority::Valid); - - RecoveredAuthorization { inner: self.inner, authority } - } -} - -impl Deref for SignedAuthorization { - type Target = Authorization; - - fn deref(&self) -> &Self::Target { - &self.inner - } -} - -#[cfg(all(any(test, feature = "arbitrary"), feature = "k256"))] -impl<'a> arbitrary::Arbitrary<'a> for SignedAuthorization { - fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result { - use k256::{ - ecdsa::{signature::hazmat::PrehashSigner, SigningKey}, - NonZeroScalar, - }; - use rand::{rngs::StdRng, SeedableRng}; - - let rng_seed = u.arbitrary::<[u8; 32]>()?; - let mut rand_gen = StdRng::from_seed(rng_seed); - let signing_key: SigningKey = NonZeroScalar::random(&mut rand_gen).into(); - - let inner = u.arbitrary::()?; - let signature_hash = inner.signature_hash(); - - let (recoverable_sig, recovery_id) = - signing_key.sign_prehash(signature_hash.as_ref()).unwrap(); - let signature = Signature::from_signature_and_parity(recoverable_sig, recovery_id) - .map_err(|_| arbitrary::Error::IncorrectFormat)?; - - Ok(Self { inner, signature }) - } -} - -/// A recovered authorization. -#[derive(Debug, Clone, Hash, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct RecoveredAuthorization { - #[cfg_attr(feature = "serde", serde(flatten))] - inner: Authorization, - /// The result of the authority recovery process, which can either be a valid address or - /// indicate a failure. - authority: RecoveredAuthority, -} - -impl RecoveredAuthorization { - /// Instantiate without performing recovery. This should be used carefully. - pub const fn new_unchecked(inner: Authorization, authority: RecoveredAuthority) -> Self { - Self { inner, authority } - } - - /// Returns an optional address based on the current state of the authority. - pub const fn authority(&self) -> Option
{ - self.authority.address() - } - - /// Splits the authorization into parts. - pub const fn into_parts(self) -> (Authorization, RecoveredAuthority) { - (self.inner, self.authority) - } -} - -#[cfg(feature = "k256")] -impl From for RecoveredAuthority { - fn from(value: SignedAuthorization) -> Self { - value.into_recovered().authority - } -} - -#[cfg(feature = "k256")] -impl From for RecoveredAuthorization { - fn from(value: SignedAuthorization) -> Self { - value.into_recovered() - } -} -impl Deref for RecoveredAuthorization { - type Target = Authorization; - - fn deref(&self) -> &Self::Target { - &self.inner - } -} - -#[cfg(test)] -mod tests { - use super::*; - use alloy_primitives::{hex, Signature}; - use core::str::FromStr; - - fn test_encode_decode_roundtrip(auth: Authorization) { - let mut buf = Vec::new(); - auth.encode(&mut buf); - let decoded = Authorization::decode(&mut buf.as_ref()).unwrap(); - assert_eq!(buf.len(), auth.length()); - assert_eq!(decoded, auth); - } - - #[test] - fn test_encode_decode_auth() { - // fully filled - test_encode_decode_roundtrip(Authorization { - chain_id: U256::from(1u64), - address: Address::left_padding_from(&[6]), - nonce: 1, - }); - } - - #[test] - fn test_encode_decode_signed_auth() { - let auth = SignedAuthorization { - inner: Authorization { - chain_id: U256::from(1u64), - address: Address::left_padding_from(&[6]), - nonce: 1, - }, - signature: Signature::from_str("48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c8041b").unwrap(), - }; - let mut buf = Vec::new(); - auth.encode(&mut buf); - - let expected = "f85a01940000000000000000000000000000000000000006011ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"; - assert_eq!(hex::encode(&buf), expected); - - let decoded = SignedAuthorization::decode(&mut buf.as_ref()).unwrap(); - assert_eq!(buf.len(), auth.length()); - assert_eq!(decoded, auth); - } - - #[cfg(all(feature = "arbitrary", feature = "k256"))] - #[test] - fn test_arbitrary_auth() { - use arbitrary::Arbitrary; - let mut unstructured = arbitrary::Unstructured::new(b"unstructured auth"); - // try this multiple times - let _auth = SignedAuthorization::arbitrary(&mut unstructured).unwrap(); - let _auth = SignedAuthorization::arbitrary(&mut unstructured).unwrap(); - let _auth = SignedAuthorization::arbitrary(&mut unstructured).unwrap(); - let _auth = SignedAuthorization::arbitrary(&mut unstructured).unwrap(); - } -} diff --git a/crates/eips/src/eip7702/constants.rs b/crates/eips/src/eip7702/constants.rs deleted file mode 100644 index cc39b7f6a84..00000000000 --- a/crates/eips/src/eip7702/constants.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! [EIP-7702] constants. -//! -//! [EIP-7702]: https://eips.ethereum.org/EIPS/eip-7702 - -/// Identifier for EIP7702's set code transaction. -/// -/// See also [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702). -pub const EIP7702_TX_TYPE_ID: u8 = 4; - -/// Magic number used to calculate an EIP7702 authority. -/// -/// See also [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702). -pub const MAGIC: u8 = 0x05; - -/// An additional gas cost per EIP7702 authorization list item. -/// -/// See also [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702). -pub const PER_AUTH_BASE_COST: u64 = 2500; - -/// A gas refund for EIP7702 transactions if the authority account already exists in the trie. -/// -/// The refund is `PER_EMPTY_ACCOUNT_COST - PER_AUTH_BASE_COST`. -/// -/// See also [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702). -pub const PER_EMPTY_ACCOUNT_COST: u64 = 25000; diff --git a/crates/eips/src/eip7702/mod.rs b/crates/eips/src/eip7702/mod.rs deleted file mode 100644 index 26ad27a883c..00000000000 --- a/crates/eips/src/eip7702/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -//! [EIP-7702] constants, helpers, and types. -//! -//! [EIP-7702]: https://eips.ethereum.org/EIPS/eip-7702 - -mod auth_list; -pub use auth_list::*; - -pub mod constants; diff --git a/crates/eips/src/lib.rs b/crates/eips/src/lib.rs index b1111f8eeb5..393ba4f343e 100644 --- a/crates/eips/src/lib.rs +++ b/crates/eips/src/lib.rs @@ -11,11 +11,6 @@ #[macro_use] extern crate alloc; -// To ensure no unused imports, since signed auth list requires arbitrary _and_ k256 features, but -// is only enabled using the `arbitrary` feature. -#[cfg(all(not(feature = "k256"), feature = "arbitrary"))] -use rand as _; - pub mod eip1559; pub use eip1559::calc_next_block_base_fee; diff --git a/crates/rpc-types-eth/Cargo.toml b/crates/rpc-types-eth/Cargo.toml index 7c59ebf3732..1d40c304c78 100644 --- a/crates/rpc-types-eth/Cargo.toml +++ b/crates/rpc-types-eth/Cargo.toml @@ -61,7 +61,6 @@ arbitrary = [ "alloy-primitives/arbitrary", "alloy-serde/arbitrary", "alloy-eips/arbitrary", - "alloy-eips/k256", ] jsonrpsee-types = ["dep:jsonrpsee-types"] k256 = ["alloy-consensus/k256", "alloy-eips/k256"]