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(RPC): debug_traceCall #1

Open
wants to merge 57 commits into
base: feature/debug_tracecall-debug
Choose a base branch
from

Conversation

XinyuCRO
Copy link

Why a simpler transfer gas cost is not 21000?

According to evmos#1085, ethermint won't refund all gas unused, if we don't specify gasLimit and it it's a lot bigger than 21000, a simple transfer tx will cost more than 21000 gas

Why gasUsed in callTracer is 0?

The callTracer in the go-ethereum version we depend on didn't implement the CaptureTxStart and CaptureTxEnd transaction level hooks, so the gas used is not recorded

PS.

mmsqe and others added 20 commits October 27, 2023 11:09
* Problem: state overrides are not supported in eth_call

Closes: evmos#368

Solution:
- add the feature

* Update CHANGELOG.md

Signed-off-by: yihuang <[email protected]>

* integration test

* fix build

* revert renaming

* fix unmarshal

* fix build

* fix integration test

* Update tests/integration_tests/test_call.py

Signed-off-by: mmsqe <[email protected]>

* fix lint and test

* fix lint

---------

Signed-off-by: yihuang <[email protected]>
Signed-off-by: mmsqe <[email protected]>
Co-authored-by: mmsqe <[email protected]>
* Problem: state override not replacing the whole state

Solution:
- fix SetStorage semantics

* test state override

* fix lint

* Update tests/integration_tests/test_call.py

Signed-off-by: yihuang <[email protected]>

---------

Signed-off-by: yihuang <[email protected]>
* Problem: precompiles don't have access to statedb

Solution:
- add statedb pointer into sdk.Context

* Update CHANGELOG.md

Signed-off-by: yihuang <[email protected]>

---------

Signed-off-by: yihuang <[email protected]>
* Problem: internal websocket connection is heavy and unstable (evmos#373)

* Problem: internal websocket connection is heavy and unstable

Solution:
- use local node client directly.

* ignore duplicate subscriptions, it's possible in concurrency

* bigger start timeout

* handle error

* fix lint

* fix unit test

* rename

* fix test

* remove test

* add buffer

* Problem: channels are not efficient for broadcasting scenario (evmos#374)

* implement stream

* rpc stream

* websocket use stream

* filter apis use stream

* cleanup

* move modules

* cleanup

* fix cond race

* fix lint

* nit

* fix build

* fix lint

* err return

* fix empty logs

* fix filter initial offset

* fix filter

* fix filter

* fix test

* changelog

* add comments
@XinyuCRO XinyuCRO changed the title Feature/debug tracecall debug feat(RPC): debug_traceCall Nov 21, 2023
XinyuCRO and others added 9 commits November 21, 2023 11:27
* Problem: go-ethereum is not updated

replace PrepareAccessList to Prepare

update deps

* skip nil value

* add jsonrpc version for invalid request

* fill gasUsed

* pass intrinsic gas check

* fix migrate

keep params_v4

* fix grocksdb

* pin nix version

* more retries

* Apply suggestions from code review

Co-authored-by: yihuang <[email protected]>
Signed-off-by: mmsqe <[email protected]>

* clean up

* fix crosscheck

* fix mining without etherbase

* fix eth config

* rm evm with table

* enable shanghai fork

---------

Signed-off-by: mmsqe <[email protected]>
Co-authored-by: yihuang <[email protected]>
…feature/debug_tracecall-debug

# Conflicts:
#	go.mod
#	proto/ethermint/evm/v1/evm.proto
#	tests/integration_tests/expected_constants.py
#	x/evm/types/evm.pb.go
#	x/evm/types/query.pb.go
…evmos#380)

* Problem: no easy way to set chain config for precompile contract

* fix install nix
* Problem: tracer config is not aligned with go-ethereum

for more info, see https://github.com/ethereum/go-ethereum/blob/v1.11.2/eth/tracers/native/call.go#L109

* add crosscheck

* Update CHANGELOG.md

Signed-off-by: mmsqe <[email protected]>

* keep json str

* keep json str

---------

Signed-off-by: mmsqe <[email protected]>
mmsqe and others added 28 commits December 5, 2023 15:04
* Problem: no access to ctx params in precompile

* Update CHANGELOG.md

Signed-off-by: mmsqe <[email protected]>

---------

Signed-off-by: mmsqe <[email protected]>
…feature/debug_tracecall-debug

# Conflicts:
#	proto/ethermint/evm/v1/trace_config.proto
#	rpc/backend/backend.go
#	rpc/backend/tracing_test.go
#	tests/integration_tests/test_tracers.py
#	x/evm/keeper/grpc_query.go
* Problem: latest v1.11.x change is not included

* rm msg, EIP150Hash, debug
* for more info:
	https://github.com/ethereum/go-ethereum/pull/25977/files
	https://github.com/ethereum/go-ethereum/pull/27087/files
	https://github.com/ethereum/go-ethereum/pull/27048/files

* retry once when tx included in next blk

* update geth

* update deps

* fix lint
…vmos#387)

* Problem: f.cancel nil is not checked

* Update CHANGELOG.md



* cleanup

---------

Signed-off-by: mmsqe <[email protected]>
* Problem: no int64 check in error msg

* Update CHANGELOG.md



---------

Signed-off-by: mmsqe <[email protected]>
…feature/debug_tracecall-debug

# Conflicts:
#	x/evm/keeper/grpc_query.go
#	x/evm/keeper/state_transition.go
…thermint into feature/debug_tracecall-debug

# Conflicts:
#	tests/integration_tests/test_tracers.py
Co-authored-by: mmsqe <[email protected]>
Signed-off-by: Xinyu <[email protected]>
Co-authored-by: mmsqe <[email protected]>
Signed-off-by: Xinyu <[email protected]>
Co-authored-by: mmsqe <[email protected]>
Signed-off-by: Xinyu <[email protected]>
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.

3 participants