Skip to content

Dev#40

Merged
VaitaR merged 10 commits into
mainfrom
dev
Feb 24, 2026
Merged

Dev#40
VaitaR merged 10 commits into
mainfrom
dev

Conversation

@VaitaR
Copy link
Copy Markdown
Owner

@VaitaR VaitaR commented Feb 24, 2026

No description provided.

- Implement comprehensive tests for the AsyncIterator streaming pattern in `tests/test_streaming_pattern.py`, covering various scenarios including basic pagination, sliding window, deduplication, batch size control, early termination, progress callback, invalid batch size, empty dataset, and large dataset simulation.
- Introduce `tests/test_whale_block_pagination.py` to verify that the paging engine correctly detects and raises errors for whale blocks containing more transactions than the API's pagination limit, preventing silent data loss.
- Ensure proper exception handling and telemetry recording for whale block detection.
@cursor
Copy link
Copy Markdown

cursor Bot commented Feb 24, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 18.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c7a9f9b30

ℹ️ 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".

Comment on lines +906 to +907
http=http_client, # type: ignore[arg-type]
endpoint_builder=self._network._url_builder, # type: ignore[arg-type]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Wire streaming APIs to real HTTP and endpoint adapters

This streaming call is passing incompatible dependencies into the paging layer: http comes from self._network._http2 (a boolean flag) and endpoint_builder is a UrlBuilder instance, while downstream functions expect an HttpClient (get/post) and an EndpointBuilder (open). In practice, non-V2 streaming paths fail at runtime with AttributeError instead of returning batches.

Useful? React with 👍 / 👎.


# Fetch logs
try:
logs = await self.client.call(Method.EVENT_LOGS, **params)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Support EVENT_LOGS before calling SmartContract.iter_events

iter_events() unconditionally calls Method.EVENT_LOGS, but the new v2 scanners used by default (from_config('etherscan', ...)) and by the recommended BlockScout v2 path do not provide EVENT_LOGS in their scanner specs. That means this method raises immediately in those common configurations, so the advertised event iteration API is unusable.

Useful? React with 👍 / 👎.

Comment on lines +317 to +319
resolver_result = await self.client.call(
Method.PROXY_ETH_CALL,
to=ENS_REGISTRY_ADDRESS,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop swallowing ENS proxy-call failures on v2 scanners

Forward ENS resolution depends on Method.PROXY_ETH_CALL, but v2 scanners in this change do not expose that method, so client.call(...) fails and the broad exception handler returns None. This causes resolve_name() to silently miss for normal inputs on default/recommended scanner setups, making ENS support appear to work while dropping valid lookups.

Useful? React with 👍 / 👎.

- Add 15 new convenience methods to ChainscanClient covering ALL 28
  Method enum values (except CONTRACT_VERIFY/VERIFY_STATUS workflows)
- Fix get_transactions_df: use iter_transactions (full pagination)
  instead of single-page self.call() that silently truncated results
- Add whale block warning in logs.py sliding-window mode
- Add 38 new tests in test_client_convenience.py

All 587 tests pass, mypy --strict clean, ruff clean.
- AGENTS.md: complete method reference (28 methods), paginated vs single-page table, updated test count (587+)
- docs/skill.md: 30+ methods organized by category, common pitfalls table
- docs/ROADMAP.md: mark streaming API as done, add v0.4.1 section, update release plan and priority matrix
- README.md: replace client.call() examples with convenience methods, remove Moralis references, add streaming/DataFrame sections
- Bump version to 0.4.1
- Auto-format test files (ruff format)
@VaitaR
Copy link
Copy Markdown
Owner Author

VaitaR commented Feb 24, 2026

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 29c69e33c1

ℹ️ 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".

page += 1
return
# Get HTTP client from network
http_client = self._network._http2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass an HttpClient instead of the _http2 flag

iter_transactions_streaming() sets http_client = self._network._http2, but Network._http2 is a boolean configuration flag, not an HttpClient. The downstream streaming fetchers call http.get(...), so this path fails at runtime (e.g., when get_all_transactions() uses streaming) with an attribute error instead of fetching data; the same pattern is repeated in other new streaming helpers.

Useful? React with 👍 / 👎.

params['topic2'] = topic2
if topic3:
params['topic3'] = topic3
result: list[dict[str, Any]] = await self.call(Method.EVENT_LOGS, **params)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fall back when EVENT_LOGS is unsupported by scanner

get_logs() unconditionally dispatches Method.EVENT_LOGS through self.call(...), but BlockScoutV2Scanner.SPECS in aiochainscan/scanners/blockscout_v2.py does not define EVENT_LOGS. With a blockscout_v2 client this now raises a "method not supported" error instead of returning logs, so single-page log retrieval is broken unless this method routes through the generic logs service fallback.

Useful? React with 👍 / 👎.


# Fetch logs
try:
logs = await self.client.call(Method.EVENT_LOGS, **params)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Paginate SmartContract event iteration across pages

SmartContract.iter_events() fetches logs with a single Method.EVENT_LOGS request and iterates that one response, so it only processes the first provider page (typically capped around ~1000 logs) and silently misses additional events for busy contracts. Since this API is exposed as an iterator for large histories, it should use paginated fetching (get_all_logs/streaming) to avoid truncating results.

Useful? React with 👍 / 👎.

- Replace vague all-methods-everywhere claim with explicit support matrix
- blockscout_v2 supports ONLY 6 methods (balance, transactions, token
  portfolio, contract ABI, ENS reverse lookup x2)
- Add scanner selection guide at top (choose scanner by task)
- Document tx schema differences: blockscout_v2 uses nested from/to dicts
- Add accurate network caveats (polygon 500, optimism 301 redirect)
- Add per-scanner quick start examples and error handling patterns
- Validated by real test agent: 5/7 tasks succeeded, 2 failed expectedly
  (get_block/gas_oracle on mainnet without etherscan key, as documented)
@VaitaR VaitaR merged commit 4e64bb9 into main Feb 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant