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

feat: Added implementation support for movePrecompileToAddress #8086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pr9t
Copy link
Contributor

@pr9t pr9t commented Jan 7, 2025

PR description

Fixed Issue(s)

fixes #8031

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

@macfarla
Copy link
Contributor

macfarla commented Jan 8, 2025

@pr9t this is great as a first step but it doesn't completely fix #8031 since the value isn't used in the simulation - that can be a follow-on PR if you like

@pr9t
Copy link
Contributor Author

pr9t commented Jan 8, 2025

Hey @macfarla, to use the value in the simulation, do I need to add it to this code?

protected void applyOverrides(final MutableAccount account, final AccountOverride override) {
    LOG.debug("applying overrides to state for account {}", account.getAddress());
    override.getNonce().ifPresent(account::setNonce);
    if (override.getBalance().isPresent()) {
      account.setBalance(override.getBalance().get());
    }
    override.getCode().ifPresent(n -> account.setCode(Bytes.fromHexString(n)));
    override
        .getStateDiff()
        .ifPresent(
            d ->
                d.forEach(
                    (key, value) ->
                        account.setStorageValue(
                            UInt256.fromHexString(key), UInt256.fromHexString(value))));
  }

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.

Simulation - implement movePrecompileToAddress in account overrides
2 participants