refactor(core): clean up EVM environmental structure #31061#1985
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
32f8d9a to
49206e3
Compare
There was a problem hiding this comment.
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.Addresscallers and*uint256.Intvalues. - Simplified
Contractconstruction/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.
| 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 |
There was a problem hiding this comment.
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).
| // the contract code, calling arguments. Contract implements ContractRef | |
| // the contract code, calling arguments, and directly stores the caller and contract address. |
49206e3 to
bdbe4ce
Compare
bdbe4ce to
4ab0903
Compare
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 applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that