Skip to content

Conversation

sonhv0212
Copy link
Contributor

@sonhv0212 sonhv0212 commented May 13, 2025

@sonhv0212 sonhv0212 force-pushed the evm-tracer-config-evm branch from 9e1817d to 713dbe6 Compare May 14, 2025 07:03
@sonhv0212 sonhv0212 marked this pull request as ready for review May 14, 2025 07:05
@sonhv0212 sonhv0212 changed the title core/vm: evm supports live tracer core: state, evm supports live tracer May 14, 2025
@sonhv0212 sonhv0212 changed the title core: state, evm supports live tracer core: state transition, processor, evm support live tracer May 14, 2025
@sonhv0212 sonhv0212 requested a review from chiphamskymavis May 14, 2025 07:11
@sonhv0212 sonhv0212 merged commit 22db700 into ronin-chain:evm-tracer-struct May 14, 2025
1 check passed
}

// StateDB gives tracers access to the whole state.
type StateDB interface {
GetBalance(common.Address) *uint256.Int
GetBalance(common.Address) *big.Int
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently, the original state.StateDB defines GetBalance(common.Address) return big.Int instead of uint256 so I think it's neccessary to keep it for more clarify, and we will let PR changes big.Int to uint256.Int do it later

chiphamskymavis pushed a commit that referenced this pull request Jul 1, 2025
* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution
chiphamskymavis pushed a commit that referenced this pull request Jul 2, 2025
* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution
sonhv0212 added a commit that referenced this pull request Aug 11, 2025
* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution
sonhv0212 added a commit that referenced this pull request Aug 11, 2025
* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution
trantienduchn pushed a commit that referenced this pull request Sep 3, 2025
* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution
trantienduchn pushed a commit that referenced this pull request Sep 3, 2025
* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution
trantienduchn added a commit that referenced this pull request Sep 3, 2025
* all: remove Message interface

* core: renaming isFake to skipAccountChecks

* all: expose message fields to remove getter func

* simulate: call apply message for short

* light: remove unused callmsg struct

* core: refactor TransactionToMessage to use NewMessage constructor

* ci: update job name in EVM tests

* core: enhance TransactionToMessage to include ExpiredTime field

* core: update NewMessage constructor to include SetCodeAuthorizations

* core: rename TransactionToMessage function for clarity

* core: update TransactionToMessage to utilize SetCodeAuthorizations

* core/tracing: add hooks for live tracing of block processing and transaction execution

* core: add VM new tracing support with new configuration options

* core/state: add tracing hook to state db and state object (#73)

* core/state: add tracing hook to state db

* core/state: add tracing hook to state object

* workflows: enable unit test

* core/state: add BalanceChangeReason to state db and state object (#74)

* core/state: add BalanceChangeReason to state object

* core/state: add BalanceChangeReason to StateDB.AddBalance

* core/state: add BalanceChangeReason to StateDB.SubBalance

* core/state: add BalanceChangeReason to StateDB.SetBalance

* core: state transition, processor, evm support live tracer (#75)

* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution

* core: blockchain supports live tracer (#77)

* all: replace the older tracer by live tracer (#78)

* core/vm: remove usages of older tracer from interpreter

* core: remove usages of older tracer from state transition

* core/vm: remove usages of older tracer from evm

* core/vm: remove usages of older tracer from instructions

* all: replace the older tracer by live tracer

* eth/tracer/logger,internal/ethapi: update access list tracer

* all: replace LiveTracer by Tracer

* all: support calltracer2

* eth/tracer/internal/tracetest: fix test

* core, tests: add missing usages of live tracer in blockchain and statetest (#83)

* core: set logger for blockchain

* tests: state test supports live tracer

* eth/tracer/live: add supply live tracer (#84)

* eth/tracer/live: add supply live tracer

* eth/tracers: fix supply live tracer test

* core: Close all tracers when stop blockchain

* eth/tracers: fix supply live tracer test

* core, eth/tracers: move chainconfig to tracers and some refactors (#86)

* core, eth/tracers: move chainconfig to tracers

* eth/tracer/live: add noop live tracer

* core/tracers/live: rename supply to supplyTracer

* cmd/utils, eth/tracers: set default tracer config to empty object

* evm: remove EVMLogger interface (#91)

* core: minor cleanup in stateDB and Call (#96)

* core/vm/runtime: call OnTxStart before prepare state DB in Call

* core/state: simplify state selfdestruct

* core/vm: update gas usage to use Tracer instead of LiveTracer in EIP-7702 gas call variant

* eth/tracers/internal/tracetest: disable KotaroBlock in pre-Cancun tests

* core/vm/runtime: fix type error

* core/tracing: extends tracing.Hooks with OnSystemCallStartV2 (#30786)

This PR extends the Hooks interface with a new method,
`OnSystemCallStartV2`, which takes `VMContext` as its parameter.

Motivation

By including `VMContext` as a parameter, the `OnSystemCallStartV2` hook
achieves parity with the `OnTxStart` hook in terms of provided insights.
This alignment simplifies the inner tracer logic, enabling consistent
handling of state changes and internal calls within the same framework.

---------

Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>

* core: capture on gas change when applying eip-7623

Ref PR: ethereum/go-ethereum#30946

* all: remove Message interface

* core/state: add BalanceChangeReason to state db and state object (#74)

* core/state: add BalanceChangeReason to state object

* core/state: add BalanceChangeReason to StateDB.AddBalance

* core/state: add BalanceChangeReason to StateDB.SubBalance

* core/state: add BalanceChangeReason to StateDB.SetBalance

* core: state transition, processor, evm support live tracer (#75)

* core/vm: add VMError

* core/vm: use live tracer in EVMInterpreter.Run

* core: add live tracer to applyTransaction

* core: add live tracer to state transition flow

* core/vm: run precompiled contract with live tracer

* core/vm/runtime: add live tracer for runtime execution

* all: replace the older tracer by live tracer (#78)

* core/vm: remove usages of older tracer from interpreter

* core: remove usages of older tracer from state transition

* core/vm: remove usages of older tracer from evm

* core/vm: remove usages of older tracer from instructions

* all: replace the older tracer by live tracer

* eth/tracer/logger,internal/ethapi: update access list tracer

* all: replace LiveTracer by Tracer

* all: support calltracer2

* eth/tracer/internal/tracetest: fix test

* internal/ethapi: eth_multicall (#27720)

This is a successor PR to #25743. This PR is based on a new iteration of
the spec: ethereum/execution-apis#484.

`eth_multicall` takes in a list of blocks, each optionally overriding
fields like number, timestamp, etc. of a base block. Each block can
include calls. At each block users can override the state. There are
extra features, such as:

- Include ether transfers as part of the logs
- Overriding precompile codes with evm bytecode
- Redirecting accounts to another address

This PR includes the following breaking changes:

- Block override fields of eth_call and debug_traceCall have had the
following fields renamed
  - `coinbase` -> `feeRecipient`
  - `random` -> `prevRandao`
  - `baseFee` -> `baseFeePerGas`

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/vm: init precompile logic, update tests

* core/vm: init precompile logic, update tests

* gethclient: update block overwrite json

* ethapi: move validation from ToMessage to CallDefault

* ethapi: remove un-used fee logic

* ci: try enable test report

* internal/ethapi/api: for simulated calls, set gaspool to max value if global gascap is 0 (#30474)

In #27720, we introduced RPC global gas cap. A value of `0` means an unlimited gas cap. However, this was not the case for simulated calls. This PR fixes the behaviour.

* core/types: remove redundance hashes

* ethapi: correct simulate blocktime to 3s

* ethapi: add tests for simulate

* genesis: support nil balance when init genesis

* eth/api: remove err unmarshal block rpc

* simulate: apply evm txcontext, fix state hook

* internal/ethapi: fix simulate tests related to gas, base fee (#95)

* internal/ethapi: fix simulate tests related to gas, base fee

* ethapi: fix simulate validation tests

* ethapi: pass nonce to message

---------

Co-authored-by: chiphamskymavis <chi.pham@skymavis.com>

* core: remove redundant receipt bloom

* eth: lower blob basefee for gasestimator

* eth, internal: remove err in transaction to msg func

* core: remove receipt generator

* simulate: skip system transactions during simulation when signTxFn is unavailable (#110)

* ethapi: update gas used values in simulation tests for accuracy

* ci: trigger build nightly for simulate

* eth: Fix movePrecompileToAddress ignored on debug_traceCall (#114)

* eth/tracers: set logger hooks for stateDB (#115)

* eth/tracers: set logger hooks for stateDB

* core/state: ensure logger is included in StateDB copy

* cmd: add vm trace flags

* eth: add tracer initialization

* cmd: init live tracer

* internal/ethapi: remove hard code timeout

* ci: revert custom actions

* ci: revert custom trigger condition

* ethapi: remove duplicated code

* consensus,ethapi: remove skip system tx when simulate, remove unused allLogs, changed from engine FinalizeAndAssemble to manual types.NewBlock

* ci: trigger build nightly for simulate

* internal/ethapi: process EIP-2935 in simulation

* ci: revert build nightly

* internal/ethapi: use skipChecks in applyMessage()

* internal/ethapi: use vmConfig

* eth/gasestimator: use gasLimit

* internal/ethapi: fix test fails

* internal/ethapi: resolve comments

---------

Co-authored-by: sonhv0212 <son.ho@skymavis.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Tran Tien Duc <trantienduchn@gmail.com>
Co-authored-by: TuDo1403 <tudo.dev@gmail.com>
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.

2 participants