Skip to content

Enforce checksum address during EVM sync#4123

Merged
kajoseph merged 4 commits intobitpay:masterfrom
kajoseph:fixEvmTxToFromAddressesCase
Mar 12, 2026
Merged

Enforce checksum address during EVM sync#4123
kajoseph merged 4 commits intobitpay:masterfrom
kajoseph:fixEvmTxToFromAddressesCase

Conversation

@kajoseph
Copy link
Collaborator

Description

I believe a recent Geth upgrade made the to and from fields lowercase when syncing blocks & transactions. Regardless of the cause, txs are now being stored with lowercase to and from fields which is making those txs not be included in wallet tx histories per this db query.

Changelog

  • Enforces checksum addresses for to and from fields on EVM txs during sync
  • Adds a script to fix previously synced txs

Testing Notes

Prior to checking out my branch, sync a few blocks and you should see the to and from fields be lowercase on the recently synced transactions.

  • Checkout my branch and sync some more blocks. Those txs should be checksum cased.
  • Run the script and it should update the other txs.

Checklist

  • I have read CONTRIBUTING.md and verified that this PR follows the guidelines and requirements outlined in it.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses an EVM indexing regression where to/from addresses are being persisted in lowercase, causing wallet history queries (that expect checksummed addresses) to miss transactions.

Changes:

  • Normalize EVM transaction to and from to EIP-55 checksum format during transaction conversion/sync.
  • Add a maintenance script to rewrite previously-synced transactions in MongoDB to use checksum-cased to/from.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
packages/bitcore-node/src/providers/chain-state/evm/models/transaction.ts Enforces checksum casing for to/from when converting raw EVM transactions.
packages/bitcore-node/scripts/fixEvmTxToFromAddressesCase.js New DB migration script to checksum-case existing transactions over a block-height range (and mempool txs).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kajoseph kajoseph merged commit bcbc2de into bitpay:master Mar 12, 2026
15 checks passed
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.

4 participants