Skip to content

Fix TransactionSelection.kind to accept tx-type integers#60

Open
ywzvennu wants to merge 1 commit into
enviodev:mainfrom
ywzvennu:fix-kind
Open

Fix TransactionSelection.kind to accept tx-type integers#60
ywzvennu wants to merge 1 commit into
enviodev:mainfrom
ywzvennu:fix-kind

Conversation

@ywzvennu
Copy link
Copy Markdown

@ywzvennu ywzvennu commented May 10, 2026

The server schema for transactions[].type is Vec (EIP-2718 tx-type bytes), as confirmed by the Node client (Array) and by direct HTTP probes. The Python wrapper had it as Vec on the Rust side and list[str] in the dataclass, which made server-side filtering by transaction type unreachable: string values were rejected at the wrapper's internal try_convert validation, and integer values were rejected by pyo3's FromPyObject.

Change the field type to Vec / list[int] to match the Node client and the actual server schema. The serde rename to "type" stays.

TraceSelection.kind is intentionally left as Vec: trace types are string enums ("call", "create", "suicide", "reward").

Summary by CodeRabbit

  • API Changes
    • Transaction type filtering now uses integer codes instead of strings for transaction type specifications.

Review Change Stack

The server schema for transactions[].type is Vec<u8> (EIP-2718 tx-type
bytes), as confirmed by the Node client (Array<number>) and by direct
HTTP probes. The Python wrapper had it as Vec<String> on the Rust side
and list[str] in the dataclass, which made server-side filtering by
transaction type unreachable: string values were rejected at the
wrapper's internal try_convert validation, and integer values were
rejected by pyo3's FromPyObject.

Change the field type to Vec<u8> / list[int] to match the Node client
and the actual server schema. The serde rename to "type" stays.

TraceSelection.kind is intentionally left as Vec<String>: trace types
are string enums ("call", "create", "suicide", "reward").

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: be7a3261-28d5-4ef8-b90f-3ab18c06afea

📥 Commits

Reviewing files that changed from the base of the PR and between cddabcf and 14c4ec4.

📒 Files selected for processing (2)
  • hypersync/__init__.py
  • src/query.rs

📝 Walkthrough

Walkthrough

This PR updates the TransactionSelection.kind filter field from string values to integer byte codes across both the Rust serialization layer and Python binding. The change aligns with EIP-2718 transaction type bytes (e.g., 0 for legacy, 2 for EIP-1559, 4 for EIP-7702).

Changes

Transaction Type Representation

Layer / File(s) Summary
Transaction Kind Type
src/query.rs, hypersync/__init__.py
TransactionSelection.kind converted from Option<Vec<String>>/Optional[list[str]] to Option<Vec<u8>>/Optional[list[int]] to represent EIP-2718 transaction type byte codes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through byte codes bright,
From strings of old to bytes so right,
EIP-2718 leads the way,
Transaction kinds now in array,
Legacy, 1559, and more in sight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting TransactionSelection.kind from string-based values to integer-based transaction type codes, which is the primary objective of this pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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