-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Description
Summary
op-alloy-network fails to compile against alloy 1.8 due to a conflicting NetworkWallet implementation.
Details
Alloy 1.8 introduced a blanket impl in alloy-network:
impl<N: Network> NetworkWallet<N> for EthereumWallet
where
N::TxEnvelope: From<Signed<N::UnsignedTx>>,
N::UnsignedTx: SignableTransaction<Signature>,
{ ... }This conflicts with the manual impl in rust/op-alloy/crates/network/src/lib.rs:
impl NetworkWallet<Optimism> for EthereumWallet { ... }The compiler error:
error[E0119]: conflicting implementations of trait `alloy_network::NetworkWallet<Optimism>` for type `alloy_network::EthereumWallet`
Proposed Fix
The manual impl can be safely removed because op-alloy-consensus already provides the trait bounds required by the blanket impl:
OpTypedTransaction: SignableTransaction<Signature>OpTxEnvelope: From<Signed<OpTypedTransaction>>
The blanket impl delegates signing to SignableTransaction::sign_transaction + into_signed, which produces the same result as the manual variant-by-variant conversion.
The unused imports and the alloy-signer dependency should also be removed as they are only used by the manual impl.
(Previously filed as alloy-rs/op-alloy#627 before the repo was upstreamed.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels