-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Migrate from rust-web3 to alloy #6063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
incrypto32
wants to merge
5
commits into
master
Choose a base branch
from
krishna/alloy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c65688c to
28c39c2
Compare
36a4468 to
0ba7436
Compare
84f7992 to
50ad26b
Compare
98f97ad to
6a18f9a
Compare
074baab to
c61c36a
Compare
isum
approved these changes
Oct 21, 2025
0bdb0c0 to
0dbe3ce
Compare
14555b4 to
cf5a566
Compare
e2e8b62 to
cf5a566
Compare
59de59b to
bf9fc99
Compare
bf9fc99 to
23cdf79
Compare
…ehose or RPC on deserialization errors (#6240) * Add warning logs on block deserialization failures * add Firehose/RPC fallback for stale block cache in ancestor_block * chain/ethereum: Fix ABI conversion issues in alloy migration * store, chain/ethereum: Handle pre-Byzantium receipt status correctly * graph: Normalize ABI JSON to handle undefined stateMutability Some ABIs contain "undefined" as a stateMutability value, which is not part of the official Solidity ABI specification. The spec only defines four valid values: pure, view, nonpayable, and payable. Alloy's StateMutability enum strictly follows the spec and rejects "undefined" during deserialization, causing subgraph deployment failures with: unknown variant `undefined`, expected one of `pure`, `view`, `nonpayable`, `payable` This adds a normalize_abi_json() function that preprocesses ABI JSON before deserialization, replacing "undefined" with "nonpayable" (the default state mutability). This handles non-compliant ABIs gracefully while maintaining spec compliance. Also adds a unit test to verify the normalization works correctly. 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]> * graph: Handle duplicate constructors in ABIs Extends normalize_abi_json() to also remove duplicate constructors from ABIs. Some non-compliant ABIs contain multiple constructor entries (e.g., DolomiteMargin ABI has two constructors, likely from incorrectly merged contract ABIs). Alloy's JsonAbi only allows one constructor and fails with 'duplicate field self.constructor' when encountering duplicates. ethabi's Contract type silently handled this by only storing one constructor (the last one encountered during deserialization). The fix keeps only the first constructor and removes any subsequent ones, matching the Solidity spec that a contract can only have one constructor. Fixes subgraph QmacPbft3reGGGL4VBzrZCKHeLpRgU9X2wUJjvPBVweyRV deployment. * extend normalizer to handle all alloy parsing incompatibilities * Add fallback for ancestor_block to handle cache truncation (#6262) * ethereum: Add RPC fallback for ancestor_block to handle cache truncation * ethereum: Extract walk_back_ancestor logic and add tests * ethereum: Fetch full blocks with receipts in ancestor_block RPC fallback When ancestor_block falls back to RPC due to cache deserialization failures, fetch full blocks with receipts instead of light blocks. Empty receipts caused missing block handler call triggers and log triggers. --------- Co-authored-by: Claude <[email protected]>
Use From<(B256, u64)> which has proper i32::try_from().unwrap() overflow checking instead of direct `as i32` cast that silently truncates.
…ations - Rename BlockWrapper struct to LightEthereumBlock directly, removing the unnecessary type alias indirection - Fix silent truncation in AnyBlock::number() - use try_from().unwrap() instead of `as BlockNumber` - Fix silent truncation in AnyBlock::block_ptr() - route through From<(B256, u64)> instead of direct `as i32` cast
Localized traces from finalized blocks must have block_number and block_hash. Using ? would silently skip traces missing these fields, potentially hiding data integrity issues. Use expect() to fail fast. Also fixes silent truncation on block_number by using try_from().unwrap().
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.