erc_4626.warmup
Documentation for eth_defi.erc_4626.warmup Python module.
Warmup system to detect broken vault contract calls.
Before running historical price scans, we test each vault’s supported calls to detect which ones revert or are too expensive. Results are stored in VaultReaderState and persisted to disk.
See README-reader-states.md for documentation.
Module Attributes
Maximum gas allowed for warmup calls before marking as broken Calls using more gas than this are considered too expensive for multicall batching TelosC Surge uses 36M gas for maxDeposit() - entire Plasma block limit |
Functions
|
Test a single vault reader's supported calls. |
|
Run warmup checks on all vault readers. |
- DEFAULT_MAX_GAS = 1000000
Maximum gas allowed for warmup calls before marking as broken Calls using more gas than this are considered too expensive for multicall batching TelosC Surge uses 36M gas for maxDeposit() - entire Plasma block limit
- warmup_vault_reader(reader, block_number, max_gas=1000000)
Test a single vault reader’s supported calls.
The reader provides the calls to test via get_warmup_calls(). Each call is tested individually and the result stored in reader_state.
Uses gas estimation to detect expensive calls before executing them. Calls using more gas than max_gas are marked as broken without execution.
- Parameters
reader (eth_defi.erc_4626.vault.ERC4626HistoricalReader) – The vault reader to test
block_number (int) – Block number to use for testing
max_gas (int) – Maximum allowed gas for a call. Calls exceeding this are marked broken. Defaults to DEFAULT_MAX_GAS (1M gas).
- Returns
Dict of function_name -> (check_block, reverts) for newly checked calls
- Return type
- warmup_vault_readers(web3, readers, block_number=None)
Run warmup checks on all vault readers.
- Parameters
web3 (web3.main.Web3) – Web3 connection
readers (Iterable[eth_defi.erc_4626.vault.ERC4626HistoricalReader]) – Iterable of vault readers to test
block_number (int | None) – Block number to use for testing. Defaults to latest.
- Returns
Dict of vault_address -> {function_name -> (check_block, reverts)}
- Return type