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

Extended tracer sei #15

Merged
merged 59 commits into from
Mar 19, 2024

Conversation

maoueh
Copy link

@maoueh maoueh commented Feb 8, 2024

This is a backport of ethereum#27629 on version v1.13.5 used by Sei. I then took this modified v1.13.5 version and merge it into Sei codebase.

This PR is needed for Firehose tracing of EVM transaction executed by Sei chain. Once we have this merged, I'm going to open another PR on sei-chain that is going to bring that in.

karalabe and others added 9 commits November 14, 2023 15:02
We backported branch `extended-tracer` at commit 3078dfe back to v1.13.5 of Geth.

To achieve the backport, we did:
- git checkout -b extended-tracer-squashed
- git reset --hard 3078dfe
- git reset --mixed fc380f5 # This was the latest merged commit not from `extended-tracer` branch
- git commit -A -m "<This message>"
- git checkout v1.13.5
- git checkout -b extended-tracer-backport-v1.13.5
- git cherry-pick extended-tracer-squashed
…h3.0

# Conflicts:
#	accounts/abi/bind/backends/simulated.go
#	cmd/geth/config.go
#	consensus/beacon/consensus.go
#	consensus/ethash/consensus.go
#	core/state_processor.go
#	core/vm/contracts.go
#	core/vm/contracts_test.go
#	core/vm/evm.go
#	eth/tracers/api.go
#	eth/tracers/js/goja.go
#	lib/ethapi/api.go
#	light/odr_test.go
…ei-v1.13.5

# Conflicts:
#	core/state/statedb.go
SetStorage(common.Address, map[common.Hash]common.Hash)
Finalise(deleteEmptyObjects bool)
Commit(block uint64, deleteEmptyObjects bool) (common.Hash, error)
SetTxContext(thash common.Hash, ti int)
Copy() StateDB
Copy() interface{}
Copy link
Author

Choose a reason for hiding this comment

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

I had to change the interface a bit. I had to remove type vm.XXX like the Copy() StateDB here as well as SetEVM(evm *EVM).

Indeed, the new tracer in Geth code brings in go-ethereum/core/state but also adds go-ethereum/core/state inside go-ethereum/core/vm.

The problem that is was causing is that on the StateDB struct where vm.StateDB is implemented implicitly, with the Sei chain, go-ethereum/core/state/statedb.go is now in the obligation of pulling go-ethereum/core/vm so it can properly implement Copy and SetEVM. But this caused an import cycle now because go-ethereum/core/vm depends of ``go-ethereum/core/state` now.

So, I kept the copy but returned an interface{} and cast to vm.StateDB only when needed which breaks the dependency on vm.StateDB.

As for SetEVM, since this is actually used by the Sei DBImpl struct, I removed it from the interface so that Geth StateDB struct doesn't have to implement it.

Then you can see https://github.com/sei-protocol/go-ethereum/pull/15/files#diff-66f4d55a856f5b04d4c6e1ee99582788b0510add7bd64c7332b948c2aeadbfdfR216-R218

# Conflicts:
#	core/vm/contracts.go
#	core/vm/evm.go
@maoueh
Copy link
Author

maoueh commented Feb 22, 2024

Branch updated, ready to be merged.

maoueh added a commit to streamingfast/sei-chain that referenced this pull request Feb 23, 2024
This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- sei-protocol#1344
@maoueh
Copy link
Author

maoueh commented Feb 23, 2024

Associated PR sei-protocol/sei-chain#1375 that bump go-ethereum with enhanced tracing opened.

s1na and others added 11 commits March 14, 2024 16:23
# Conflicts:
#	core/vm/evm.go
# Conflicts:
#	core/blockchain.go
# Conflicts:
#	accounts/abi/bind/backends/simulated.go
#	cmd/evm/blockrunner.go
#	cmd/geth/config.go
#	cmd/geth/snapshot.go
#	core/genesis.go
#	core/genesis_test.go
#	core/state_processor.go
#	core/vm/contracts.go
#	eth/api_backend.go
#	eth/state_accessor.go
#	eth/tracers/api.go
#	eth/tracers/api_test.go
#	eth/tracers/js/goja.go
#	les/api_backend.go
#	les/state_accessor.go
#	lib/ethapi/api.go
#	light/odr_test.go
#	tests/block_test_util.go
…ing interface

The new tracing interface avoids an import cycle we have before around `core`, `core/vm` and `core/state`. So I can revert some of the changes needed previously.
maoueh added a commit to streamingfast/sei-chain that referenced this pull request Mar 15, 2024
This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- sei-protocol#1344
holiman and others added 5 commits March 18, 2024 15:56
This commit fixes several missing interface-checks, where the code did not properly
verify a Hook before calling it.
It also fixes an error where the tracer was not set in the vmconfig during t8n initialization.

It also adds a testcase which verifies the tracing-output during t8n executio. The
testcase currently only checks the jsonlogger, but can be extended.

This change also removes a spurious 'null' output in the tracing, when
tracing result is null.
maoueh added a commit to streamingfast/sei-chain that referenced this pull request Mar 18, 2024
This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- sei-protocol#1344
@stevenlanders stevenlanders merged commit 6587b72 into sei-protocol:master Mar 19, 2024
1 check failed
maoueh added a commit to streamingfast/sei-chain that referenced this pull request Mar 19, 2024
This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- sei-protocol#1344
@maoueh maoueh deleted the extended-tracer-sei branch March 19, 2024 16:53
maoueh added a commit to streamingfast/sei-chain that referenced this pull request Mar 27, 2024
This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- sei-protocol#1344
stevenlanders pushed a commit to sei-protocol/sei-chain that referenced this pull request Mar 29, 2024
* Update that brings `go-ethereum` with live tracer support

This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- #1344

* Added missing instrumentation when state changes in `DBImpl`
udpatil pushed a commit to sei-protocol/sei-chain that referenced this pull request Apr 17, 2024
* Update that brings `go-ethereum` with live tracer support

This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- #1344

* Added missing instrumentation when state changes in `DBImpl`
udpatil pushed a commit to sei-protocol/sei-chain that referenced this pull request Apr 17, 2024
* Update that brings `go-ethereum` with live tracer support

This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- #1344

* Added missing instrumentation when state changes in `DBImpl`
udpatil pushed a commit to sei-protocol/sei-chain that referenced this pull request Apr 17, 2024
* Update that brings `go-ethereum` with live tracer support

This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- #1344

* Added missing instrumentation when state changes in `DBImpl`
udpatil pushed a commit to sei-protocol/sei-chain that referenced this pull request Apr 18, 2024
* Update that brings `go-ethereum` with live tracer support

This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- #1344

* Added missing instrumentation when state changes in `DBImpl`
udpatil pushed a commit to sei-protocol/sei-chain that referenced this pull request Apr 19, 2024
* Update that brings `go-ethereum` with live tracer support

This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- #1344

* Added missing instrumentation when state changes in `DBImpl`
udpatil pushed a commit to sei-protocol/sei-chain that referenced this pull request Apr 19, 2024
* Update that brings `go-ethereum` with live tracer support

This only brings the dependency (will need to wait for a merge + tag of the branch before merging this PR) and the required changes to adapt `DBImpl` to support the new interface.

Relates to:
- sei-protocol/go-ethereum#15
- #1344

* Added missing instrumentation when state changes in `DBImpl`
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.

8 participants