Skip to content

Conversation

@incrypto32
Copy link
Member

No description provided.

@incrypto32 incrypto32 force-pushed the krishna/alloy branch 2 times, most recently from c65688c to 28c39c2 Compare June 19, 2025 08:11
@incrypto32 incrypto32 self-assigned this Jun 19, 2025
@incrypto32 incrypto32 marked this pull request as draft July 3, 2025 18:16
@incrypto32 incrypto32 force-pushed the krishna/alloy branch 3 times, most recently from 36a4468 to 0ba7436 Compare July 8, 2025 15:04
@fordN fordN linked an issue Jul 8, 2025 that may be closed by this pull request
@incrypto32 incrypto32 force-pushed the krishna/alloy branch 3 times, most recently from 84f7992 to 50ad26b Compare July 29, 2025 08:42
@incrypto32 incrypto32 force-pushed the krishna/alloy branch 2 times, most recently from 98f97ad to 6a18f9a Compare September 23, 2025 13:33
@incrypto32 incrypto32 force-pushed the krishna/alloy branch 5 times, most recently from 074baab to c61c36a Compare October 4, 2025 05:31
@incrypto32 incrypto32 marked this pull request as ready for review October 7, 2025 14:51
@incrypto32 incrypto32 requested review from isum and lutter October 13, 2025 12:13
@incrypto32 incrypto32 force-pushed the krishna/alloy branch 3 times, most recently from 0bdb0c0 to 0dbe3ce Compare December 10, 2025 09:59
@incrypto32 incrypto32 force-pushed the krishna/alloy branch 4 times, most recently from 14555b4 to cf5a566 Compare December 24, 2025 19:10
@incrypto32 incrypto32 force-pushed the krishna/alloy branch 2 times, most recently from e2e8b62 to cf5a566 Compare December 24, 2025 19:14
@incrypto32 incrypto32 force-pushed the krishna/alloy branch 2 times, most recently from 59de59b to bf9fc99 Compare January 6, 2026 14:31
incrypto32 and others added 4 commits January 14, 2026 15:36
…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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch off of deprecated rust-web3 crate

3 participants