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
BlobGasFiller from RecommendedFillers. Document this and ask users to use .filler(BlobGasFiller).
- Non-breaking - Introduce
new_with_network::<N>() constructor for the ProviderBuilder and implement the N::RecommendedFillers trait for the Optimism network in op-alloy. This makes the .network method redundant
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::newconstructor, custom networks such asop_alloy_network::Optimismare incompatible and won't compile.This is due to
BlobGasFillerbeing inserted as part ofRecommendedFillerswhen in thenewconstructor. TheBlobGasFillerrequires implementation of theTransactionBuilder4844trait which isn't implemented and shouldn't be implemented byOpTransactionRequest.The current workaround is pretty ugly:
Possible Solutions:
BlobGasFillerfromRecommendedFillers. Document this and ask users to use.filler(BlobGasFiller).new_with_network::<N>()constructor for theProviderBuilderand implement theN::RecommendedFillerstrait for theOptimismnetwork in op-alloy. This makes the.networkmethod redundant