Module client

Source
Expand description

Due to the migration of the RPC client to the alloy crate, this module contains implementation and parameters of client layers. The underlying HTTP transport layer is defined in transport.rs.

Extended layers of RPC clients:

  • Replace the legacy retry backoff layer with the default [RetryBackoffService]. However the backoff calculation still needs to be improved, as the number of retries is not passed to the backoff_hint method.
  • Add Metrics Layer
  • Add Snapshot Layer
  • Use tokio runtime for most of the tests

This module contains defalut gas estimation constants for EIP-1559 for Gnosis chain,

Structs§

DefaultRetryPolicy
Defines a default retry policy suitable for RpcClient. This is a reimplementation of the legacy “retry policy suitable for JsonRpcProviderClient
GasOracleFiller
Use the underlying gas tracker API of GnosisScan to populate the gas price. It returns gas price in gwei. It implements the GasOracle trait. If no Oracle URL is given, it returns no values.
GasOracleResponse
GasOracleResponseResult
MetricsLayer
MetricsService
RequestorResponseSnapshot
Snapshot of a response cached by the SnapshotRequestorLayer.
SnapshotRequestor
Replays an RPC response to a request if it is found in the snapshot YAML file. If no such request has been seen before, it captures the new request/response pair obtained from the inner HttpRequestor and stores it into the snapshot file.
SnapshotRequestorLayer
SnapshotRequestorService
ZeroRetryPolicy

Enums§

GasCategory
Generic [GasOracle] gas price categories.

Constants§

EIP1559_FEE_ESTIMATION_DEFAULT_MAX_FEE_GNOSIS
Gas estimation constants for EIP-1559 for Gnosis chain. These values are used to estimate the gas price for transactions. As GasOracleMiddleware is migrated to GasFiller, they are replaced with default values.
EIP1559_FEE_ESTIMATION_DEFAULT_PRIORITY_FEE_GNOSIS

Functions§

create_rpc_client_to_anvil
Used for testing. Creates RPC client to the local Anvil instance.

Type Aliases§

AnvilRpcClient