Skip to content

Commit

Permalink
doc: update 1559 note
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich committed Jun 10, 2024
1 parent 578197b commit 8a7b98e
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions crates/provider/src/provider/trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,34 @@ pub type FilterPollerBuilder<T, R> = PollerBuilder<T, (U256,), Vec<R>>;
///
/// # Subscriptions
///
/// **IMPORTANT:** this is currently only available when `T` is `PubSubFrontend` or `BoxedClient`
/// over `PubSubFrontend` due to an internal limitation. This means that layering transports will
/// always disable subscription support. See [issue #296](https://github.com/alloy-rs/alloy/issues/296).
/// **IMPORTANT:** this is currently only available when `T` is
/// `PubSubFrontend` or `BoxedClient` over `PubSubFrontend` due to an internal
/// limitation. This means that layering transports will always disable
/// subscription support. See
/// [issue #296](https://github.com/alloy-rs/alloy/issues/296).
///
/// The provider supports `pubsub` subscriptions to new block headers and pending transactions. This
/// is only available on `pubsub` clients, such as WebSockets or IPC.
/// The provider supports `pubsub` subscriptions to new block headers and
/// pending transactions. This is only available on `pubsub` clients, such as
/// Websockets or IPC.
///
/// For a polling alternatives available over HTTP, use the `watch_*` methods. However, be aware
/// that polling increases RPC usage drastically.
/// For a polling alternatives available over HTTP, use the `watch_*` methods.
/// However, be aware that polling increases RPC usage drastically.
///
/// # EIP-1559
/// ## Special treatment of EIP-1559
///
/// The provider supports EIP-1559 fee estimation and transaction building. We generally assume
/// that EIP-1559 is supported by the client and will proactively use it by default. If the client
/// does not support EIP-1559, we fall back to legacy transaction building. We acknowledge that this
/// means EIP-1559 has a privileged status in comparison to other transaction types.
/// While many RPC features are encapsulated by traits like [`DebugApi`],
/// EIP-1559 fee estimation is generally assumed to be on by default. We
/// generally assume that EIP-1559 is supported by the client and will
/// proactively use it by default.
///
/// As a result, the provider supports EIP-1559 fee estimation the ethereum
/// [`TransactionBuilder`] will use it by default. We acknowledge that this
/// means EIP-1559 has a privileged status in comparison to other transaction
/// types. Networks that DO NOT support EIP-1559 should create their own
/// [`TransactionBuilder`] and Fillers to change this behavior.
///
/// [`TransactionBuilder`]: alloy_network::TransactionBuilder
/// [`DebugApi`]: crate::ext::DebugApi
#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
#[auto_impl::auto_impl(&, &mut, Rc, Arc, Box)]
Expand Down

0 comments on commit 8a7b98e

Please sign in to comment.