-
Notifications
You must be signed in to change notification settings - Fork 599
[Bug] Optimism network incompatible with ProviderBuilder::new constructor #2478
Copy link
Copy link
Closed
Labels
Description
Component
provider, pubsub
What version of Alloy are you on?
1.0
Operating System
None
Describe the bug
Ref https://t.me/ethers_rs/44750
With the current ProviderBuilder::new constructor, custom networks such as op_alloy_network::Optimism are incompatible and won't compile.
let op = ProviderBuilder::new()
.network::<Optimism>()
.connect("http://..").await?; // Won't compile This is due to BlobGasFiller being inserted as part of RecommendedFillers when in the new constructor. The BlobGasFiller requires implementation of the TransactionBuilder4844 trait which isn't implemented and shouldn't be implemented by OpTransactionRequest.
The current workaround is pretty ugly:
let op_provider = ProviderBuilder::new()
.disable_recommended_fillers()
.fetch_chain_id()
.with_gas_estimation()
.with_cached_nonce_management()
.network::<Optimism>()
.connect(&anvil.endpoint())
.await?;Possible Solutions:
- Breaking - Remove the
BlobGasFillerfromRecommendedFillers. Document this and ask users to use.filler(BlobGasFiller). - Non-breaking - Introduce
new_with_network::<N>()constructor for theProviderBuilderand implement theN::RecommendedFillerstrait for theOptimismnetwork in op-alloy. This makes the.networkmethod redundant
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Completed