Skip to content

Return 32-byte block hash from eth_getFilterChanges to ensure EVM compatibility #3863

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

romangzz
Copy link

Description:

Ensure eth_getFilterChanges returns a 32-byte block hash to match Ethereum's expectations.

  • Truncate Hedera's 48-byte block hash (from mirror node record files) to 32 bytes
  • Aligns with Ethereum's EVM compatibility requirements
  • Enables valid usage of returned hashes with eth_getBlockByHash
  • Fixes compatibility issue affecting downstream clients/tools

Notes for reviewer:

Previously, eth_getFilterChanges returned 48-byte block hashes, causing eth_getBlockByHash to fail with a parameter validation error. This PR ensures that only the first 32 bytes are returned, complying with Ethereum's JSON-RPC spec.

Example of uncorrected output response:

{
    "result": [
      "0x3c08bbbee74d287b1dcd3f0ca6d1d2cb92c90883c4acf9747de9f3f3162ad25b999fc7e86699f60f2a3fb3ed9a646c6b"
    ],
    "jsonrpc": "2.0",
    "id": 1
}

Example of corrected output response:

{
    "result": [
        "0x3c08bbbee74d287b1dcd3f0ca6d1d2cb92c90883c4acf9747de9f3f3162ad25b"
    ],
    "jsonrpc": "2.0",
    "id": 1
}

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@romangzz romangzz requested review from a team as code owners June 18, 2025 10:17
@romangzz romangzz requested a review from acuarica June 18, 2025 10:17
@lfdt-bot
Copy link

lfdt-bot commented Jun 18, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@quiet-node quiet-node added the enhancement New feature or request label Jun 18, 2025
@quiet-node quiet-node added this to the 0.70.0 milestone Jun 18, 2025
…M compatibility

Signed-off-by: Javier Roman <javier.rmgz@gmail.com>
@romangzz romangzz force-pushed the fix/get-filter-changes branch from 61885d8 to 0e572d0 Compare June 19, 2025 06:11
@quiet-node
Copy link
Contributor

quiet-node commented Jun 20, 2025

Hey @romangzz, thanks so much for the PR great catch indeed! Could you kindly include some links to documentation, if any, supporting this update like from official Ethereum's JSON-RPC spec or whatnot? It’ll help provide context for future reference. If possible, please add the links to the PR description for better clarity.

Copy link

codecov bot commented Jun 23, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...vices/ethService/ethFilterService/FilterService.ts 50.00% 1 Missing ⚠️
@@           Coverage Diff           @@
##             main    #3863   +/-   ##
=======================================
  Coverage        ?   50.66%           
=======================================
  Files           ?       83           
  Lines           ?     4767           
  Branches        ?      972           
=======================================
  Hits            ?     2415           
  Misses          ?     1990           
  Partials        ?      362           
Files with missing lines Coverage Δ
...vices/ethService/ethFilterService/FilterService.ts 17.50% <50.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants