Skip to content

refactor(core): clean up EVM environmental structure #31061#1985

Merged
AnilChinchawale merged 1 commit intoXinFinOrg:dev-upgradefrom
gzliudan:evm-remove-accountref
Feb 10, 2026
Merged

refactor(core): clean up EVM environmental structure #31061#1985
AnilChinchawale merged 1 commit intoXinFinOrg:dev-upgradefrom
gzliudan:evm-remove-accountref

Conversation

@gzliudan
Copy link
Copy Markdown
Collaborator

Proposed changes

Ref: ethereum#31061

Types of changes

What types of changes does your code introduce to XDC network?
Put an in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Regular KTLO or any of the maintaince work. e.g code style
  • CICD Improvement

Impacted Components

Which part of the codebase this PR will touch base on,

Put an in the boxes that apply

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Checklist

Put an in the boxes once you have confirmed below actions (or provide reasons on not doing so) that

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

Copilot AI review requested due to automatic review settings January 23, 2026 10:42
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gzliudan gzliudan force-pushed the evm-remove-accountref branch from 32f8d9a to 49206e3 Compare January 29, 2026 06:26
Copilot AI review requested due to automatic review settings January 29, 2026 06:26
Copy link
Copy Markdown

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

Refactors the EVM execution “environment” plumbing to remove ContractRef/AccountRef usage and move call-value handling toward uint256.Int, aligning core call/create APIs and related tests/tracers with the new model.

Changes:

  • Updated EVM call/create/static/delegate APIs to use common.Address callers and *uint256.Int values.
  • Simplified Contract construction/state (including EVM-level jumpdest analysis caching) and removed legacy interfaces.
  • Updated runtime helpers, tracers, and VM tests to compile/work with the new EVM APIs.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/vm_test_util.go Updates VM test harness to call the new EVM.Call signature and uint256 value plumbing.
eth/tracers/logger/logger_test.go Adjusts logger tracer tests for new vm.NewContract signature and uint256 value.
eth/tracers/js/tracer_test.go Updates JS tracer tests for new vm.NewContract signature and value conversions.
core/vm/runtime/runtime.go Migrates runtime helpers (Execute/Create/Call) to new EVM.Call/Create signatures and uint256 values.
core/vm/interpreter.go Changes ScopeContext.CallValue() to return *uint256.Int to match tracing/op context changes.
core/vm/interface.go Removes legacy CallContext interface no longer used with the updated EVM API shape.
core/vm/instructions_test.go Updates instruction tests to construct contracts with the new NewContract signature.
core/vm/instructions.go Updates CALL/CREATE op implementations to pass uint256 values directly into the new EVM APIs.
core/vm/gas_table_test.go Updates EVM setup helpers (CanTransfer/Transfer signatures and call value types) for tests.
core/vm/evm.go Refactors core EVM call/create entrypoints to accept addresses + uint256 values; introduces EVM-level jumpdest cache.
core/vm/contract.go Redesigns Contract to store caller/address directly; updates value type to *uint256.Int; simplifies code hash handling.
core/tracing/hooks.go Updates tracing OpContext to expose call value as *uint256.Int.
core/state_transition.go Updates transaction execution to call EVM with *uint256.Int value and new call/create signatures.
core/evm.go Updates CanTransfer/Transfer helpers to accept *uint256.Int amounts.

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

Comment thread core/vm/runtime/runtime.go
Comment thread core/vm/runtime/runtime.go
Comment thread core/vm/runtime/runtime.go
Comment thread tests/vm_test_util.go
Comment thread core/evm.go Outdated
Comment thread core/evm.go Outdated
Comment thread core/vm/contract.go Outdated
func (ar AccountRef) Address() common.Address { return (common.Address)(ar) }

// Contract represents an ethereum contract in the state database. It contains
// the contract code, calling arguments. Contract implements ContractRef
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

This comment still references ContractRef, but the ContractRef type was removed in this change. Please update the comment to reflect the current design (e.g., that Contract carries caller/address directly).

Suggested change
// the contract code, calling arguments. Contract implements ContractRef
// the contract code, calling arguments, and directly stores the caller and contract address.

Copilot uses AI. Check for mistakes.
@gzliudan gzliudan force-pushed the evm-remove-accountref branch from 49206e3 to bdbe4ce Compare January 29, 2026 07:01
@gzliudan gzliudan changed the title core/vm: clean up EVM environmental structure #31061 refactor(core): clean up EVM environmental structure #31061 Feb 5, 2026
@gzliudan gzliudan force-pushed the evm-remove-accountref branch from bdbe4ce to 4ab0903 Compare February 5, 2026 08:35
@AnilChinchawale AnilChinchawale merged commit d7a42cb into XinFinOrg:dev-upgrade Feb 10, 2026
13 checks passed
@gzliudan gzliudan deleted the evm-remove-accountref branch February 10, 2026 11:15
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.

6 participants