MulticallHistoricalTask
Documentation for eth_defi.event_reader.multicall_batcher.MulticallHistoricalTask Python class.
- class MulticallHistoricalTask
Bases:
objectPickled task send between multicall reader loop and subprocesses.
Send a batch of calls to a specific block.
Attributes summary
Track which chain this call belongs to
Used to initialise web3 connection in the subprocess
Block number to sccan
Multicalls to perform
Debug parameter to early abort if we get invalid replies from Multicall contract
Fetch timestamp not given.
Running counter for task ids, for serialisation checks
Return a task-local counter to the parent when running under
loky.Shared parent counter when running under the threading backend.
Methods summary
__init__(chain_id, web3factory, ...[, ...])- chain_id: int
Track which chain this call belongs to
- web3factory: eth_defi.event_reader.web3factory.Web3Factory
Used to initialise web3 connection in the subprocess
- block_number: Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]
Block number to sccan
- calls: list[eth_defi.event_reader.multicall_batcher.EncodedCall]
Multicalls to perform
- require_multicall_result: bool
Debug parameter to early abort if we get invalid replies from Multicall contract
- timestamp: datetime.datetime
Fetch timestamp not given.
Otherwise prefetched
- task_id: int
Running counter for task ids, for serialisation checks
- collect_rpc_request_stats: bool
Return a task-local counter to the parent when running under
loky.
- rpc_request_stats: Optional[eth_defi.provider.rpcdb.RPCRequestStats]
Shared parent counter when running under the threading backend.
- __init__(chain_id, web3factory, block_number, calls, require_multicall_result=False, timestamp=None, task_id=<factory>, collect_rpc_request_stats=False, rpc_request_stats=None)
- Parameters
chain_id (int) –
web3factory (eth_defi.event_reader.web3factory.Web3Factory) –
block_number (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) –
calls (list[eth_defi.event_reader.multicall_batcher.EncodedCall]) –
require_multicall_result (bool) –
timestamp (datetime.datetime) –
task_id (int) –
collect_rpc_request_stats (bool) –
rpc_request_stats (Optional[eth_defi.provider.rpcdb.RPCRequestStats]) –
- Return type
None