Conversation
- Remove ScannerCapabilities and SCANNER_FEATURES (3 feature flag systems → 1) - Remove moralis/routscan phantom scanners from config, url_builder, tests - Fix config.py env mutation: use _env_state dict instead of os.environ - Replace json.dumps with orjson.dumps in decode.py and _executor.py - Consolidate _to_int duplicates → parse_hex_or_int_zero from dto_v2 - Deduplicate _resolve_end_block_factory → services/_block_utils.py - Replace magic 99_999_999 with MAX_BLOCK_NUMBER constant - Remove 400-line legacy fallback in get_all_transactions_optimized - Remove _sign shim, _facade aliases, Polars typing hack - Narrow bare except clauses to specific exception types
- Fix path injection in BlockScout V2 URL builder (urllib.parse.quote) - Fix cursor parsing ValueError vulnerability (safe_int helper) - Remove dead circuit breaker (_failures dict never read)
- Replace 150+ eager imports with lazy __getattr__ dispatch - Move 79 facade functions to _facade.py (deprecated, backward-compat) - Import time reduced ~70% (ChainscanClient import no longer loads all services) - Zero test changes needed — full backward compatibility preserved
- Delete unused orjson_parser.py (112 lines, never imported) - Make network_client required in Scanner.call() (remove phantom Network) - Remove AI instructions from exception __str__ (breaks Sentry/Datadog grouping) - Consolidate 3 batch decode methods into 1 (zero_copy/optimized → aliases) - Verify asyncio.to_thread wrapping for Rust FFI calls in streaming_decoder
- EtherscanV2 inherits from EtherscanLikeScanner, SPECS computed via dataclasses.replace() with chainid injection (200→83 lines, -60%) - Remove phantom Network creation from BlockScoutV1.call() (→ RuntimeError)
Clear __warningregistry__ before asserting deprecation warnings to prevent Python warning dedup from suppressing across test order.
- Add EthPriceDTO, DailySeriesDTO, MinedBlockDTO, BeaconWithdrawalDTO to dto_v2.py - Add backwards-compat aliases: NormalTxDTO, InternalTxDTO, ProxyTxDTO, LogEntryDTO, AddressBalanceDTO - Rewrite all 6 normalize_* in account.py → model_validate() one-liners (-107 lines) - Rewrite normalize_block, normalize_transaction, normalize_log_entry, normalize_gas_oracle, normalize_eth_price, normalize_proxy_tx → model_validate() (-100 lines total) - Update _facade.py imports to dto_v2 - Redirect all __init__.py DTO lazy-imports from domain.dto → domain.dto_v2 - Delete aiochainscan/domain/dto.py (165 lines)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec3c94c192
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -276,7 +236,7 @@ async def _fetch_page( | |||
| *, page: int, start_block: int, end_block: int, offset: int | |||
| ) -> list[dict[str, Any]]: | |||
| return await get_normal_transactions( | |||
There was a problem hiding this comment.
Pass ProviderContext into streaming fetch_all service calls
fetch_all_streaming still calls get_normal_transactions (and the sibling account/log methods in this module) with legacy kwargs like api_kind, network, and _endpoint_builder but without ctx; after this commit those services were migrated to ctx: ProviderContext, so the first fetch now raises TypeError instead of returning data. This breaks the ChainscanClient.iter_*_streaming paths that rely on these functions.
Useful? React with 👍 / 👎.
| @@ -233,7 +237,7 @@ async def _fetch_transaction_batches( | |||
| # Sliding window mode (Etherscan-style) | |||
| async for batch in self._fetch_sliding_batches( | |||
| fetch_fn=lambda sb, eb, p, o: get_normal_transactions( | |||
There was a problem hiding this comment.
Update StreamingDecoder callbacks to use ProviderContext
StreamingDecoder still invokes get_normal_transactions/get_logs using the old argument shape (passing api_kind/network and no ctx), but those services now require ctx: ProviderContext; this causes runtime TypeError before any request is made. As a result, decoded streaming entry points that use this decoder fail when iterating transactions or logs.
Useful? React with 👍 / 👎.
No description provided.