Skip to content
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

Fix eth_getCode for non-empty accounts without code #1474

Merged

Conversation

Stefan-Ethernal
Copy link
Contributor

@Stefan-Ethernal Stefan-Ethernal commented May 5, 2023

Description

This PR considers non-empty accounts without the code as a valid use case. If EmptyCodeHash is queried, it returns an empty bytes slice without querying the storage itself.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

* Fix and debugging logs

* remove debugging logs

* Move to types.EmptyCodeHash

* nit

---------

Co-authored-by: Stefan Negovanović <93934272+Stefan-Ethernal@users.noreply.github.com>
@Stefan-Ethernal Stefan-Ethernal linked an issue May 5, 2023 that may be closed by this pull request
@Stefan-Ethernal Stefan-Ethernal changed the title Fix eth_getCode for non-empty accounts without code (#1238) Fix eth_getCode for non-empty accounts without code May 5, 2023
@Stefan-Ethernal Stefan-Ethernal force-pushed the fix/1467-failed-to-get-account-eth_getcode-failing branch from c618329 to 9e48be1 Compare May 8, 2023 11:18
@Stefan-Ethernal Stefan-Ethernal requested a review from a team May 15, 2023 10:01
@Stefan-Ethernal Stefan-Ethernal self-assigned this May 15, 2023
@Stefan-Ethernal Stefan-Ethernal added the bug fix Functionality that fixes a bug label May 15, 2023
@Stefan-Ethernal Stefan-Ethernal marked this pull request as ready for review May 15, 2023 10:03
@Stefan-Ethernal Stefan-Ethernal changed the title Fix eth_getCode for non-empty accounts without code Fix eth_getCode for non-empty accounts without code May 15, 2023
Copy link
Contributor

@vcastellm vcastellm left a comment

Choose a reason for hiding this comment

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

LGTM

@Stefan-Ethernal Stefan-Ethernal merged commit e42d00c into develop May 16, 2023
6 checks passed
@Stefan-Ethernal Stefan-Ethernal deleted the fix/1467-failed-to-get-account-eth_getcode-failing branch May 16, 2023 14:39
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix Functionality that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to get account. eth_getCode() failing.
5 participants