Open
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
BlobGasFiller
fromRecommendedFillers
. Document this and ask users to use.filler(BlobGasFiller)
. - Non-breaking - Introduce
new_with_network::<N>()
constructor for theProviderBuilder
and implement theN::RecommendedFillers
trait for theOptimism
network in op-alloy. This makes the.network
method redundant
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Ready for Review