Skip to content

Conversation

@jmg-duarte
Copy link
Contributor

Description

Migrates the trace_callMany and trace_call functionality from legacy web3 types to alloy primitives and RPC types. This continues the ongoing effort to migrate the codebase to alloy.

Changes

  • Replace web3::CallRequest with alloy::TransactionRequest
  • Replace web3::BlockTrace with alloy::TraceResults
  • Update trace_many API to use alloy's TraceApi extension
  • Remove legacy type conversions (IntoLegacy, IntoAlloy)
  • Replace primitive_types::U256 and ethcontract::U256 with alloy::U256
  • Update error handling to use alloy::RpcError instead of web3::Error
  • Add provider-trace-api and rand features to alloy dependencies
  • Clean up unused imports and remove decode_u256 helper

How to test

  1. Run existing unit tests: cargo test --package shared --lib trace_many
  2. Run bad token detection tests: cargo test --package shared --lib bad_token::trace_call
  3. Verify e2e tests pass with trace_callMany functionality

This migrates the trace_callMany functionality from legacy web3 types to alloy primitives and RPC types, including:
- Replace web3 CallRequest with alloy TransactionRequest
- Replace web3 BlockTrace with alloy TraceResults
- Update trace_many API to use alloy types and TraceApi
- Remove legacy type conversions (IntoLegacy, IntoAlloy)
- Replace primitive_types and ethcontract U256 with alloy U256
- Update error handling to use alloy RPC errors
- Add provider-trace-api feature to alloy dependencies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@jmg-duarte jmg-duarte requested a review from a team as a code owner January 6, 2026 17:00
@gemini-code-assist
Copy link

Summary of Changes

Hello @jmg-duarte, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly advances the codebase's migration to Alloy by updating the core trace_callMany and trace_call functionalities. The changes involve a comprehensive replacement of legacy web3 types with their modern Alloy equivalents, streamlining the interaction with Ethereum RPCs and improving overall type safety and consistency across the project.

Highlights

  • Alloy Type Migration: Migrated trace_callMany and trace_call functionalities from legacy web3 types to alloy primitives and RPC types, aligning with the ongoing codebase modernization.
  • Type Replacements: Replaced web3::CallRequest with alloy::TransactionRequest, web3::BlockTrace with alloy::TraceResults, and primitive_types::U256 / ethcontract::U256 with alloy::U256.
  • API and Error Handling Updates: Updated the trace_many API to leverage Alloy's TraceApi extension and refined error handling to use alloy::RpcError instead of web3::Error.
  • Dependency and Code Cleanup: Added provider-trace-api and rand features to Alloy dependencies, removed obsolete IntoLegacy and IntoAlloy type conversions, and eliminated unused imports and helper functions like decode_u256.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant and well-executed migration from legacy web3 types to modern alloy primitives for trace_callMany and trace_call functionality. The changes are consistent across the codebase, resulting in cleaner code, notably the refactoring of trace_many to use alloy's TraceApi. I've identified a potential correctness issue in bad_token/trace_call.rs where the decoding of U256 from trace outputs has become less strict, which could affect bad token detection. My review includes suggestions to address this. Overall, this is an excellent refactoring effort.

Copy link
Contributor

@m-sz m-sz left a comment

Choose a reason for hiding this comment

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

LGTM with a small typo

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.

3 participants