middleware
Documentation for eth_defi.middleware Python module.
Web3 middleware.
Most for dealing with JSON-RPC unreliability issues with retries.
Taken from exception_retry_request.py from Web3.py
Modified to support sleep and throttling
Logs warnings to Python logging subsystem in the case there is need to retry
See also
eth_defi.provider.broken_provider
.
Module Attributes
List of Web3 exceptions we know we should retry after some timeout |
|
List of HTTP status codes we know we might want to retry after a timeout |
|
List of ValueError status codes we know we might want to retry after a timeout |
|
Because Ethreum JSON-RPC API is horribly broken, we also need to check for error messages besides error codes. |
|
Ethereum JSON-RPC calls where the value never changes |
Functions
Capture transactions sign and send as raw transactions |
|
|
Creates middleware that retries failed HTTP requests. |
A HTTP retry middleware with sleep and backoff. |
|
|
Helper to check retryable errors from JSON-RPC calls. |
|
Automatically show the transaction revert reason in Python traceback. |
|
Cache JSON-RPC call values that never chance. |
Exceptions
A special exception raised when we suspect JSON-RPC node does not yet have data for a block we asked. |