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

Implement debug_traceChain #909

Merged
merged 14 commits into from
Jul 22, 2024
Merged

Conversation

yaziciahmet
Copy link
Contributor

Description

Implements debug_traceChain subscription rpc.

Linked Issues

@yaziciahmet yaziciahmet added the T - enhancement New feature or request label Jul 19, 2024
@yaziciahmet yaziciahmet self-assigned this Jul 19, 2024
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

Attention: Patch coverage is 73.65269% with 44 lines in your changes missing coverage. Please review.

Project coverage is 79.1%. Comparing base (d69cfa2) to head (67aec5e).

Additional details and impacted files
Files Coverage Δ
crates/ethereum-rpc/src/lib.rs 81.7% <73.6%> (+1.1%) ⬆️

... and 1 file with indirect coverage changes

@yaziciahmet yaziciahmet changed the title WIP: debug_traceChain Implement debug_traceChain Jul 19, 2024
@yaziciahmet yaziciahmet force-pushed the yaziciahmet/debug_traceChain branch from bf97379 to 7b335d7 Compare July 19, 2024 13:34
@yaziciahmet yaziciahmet requested a review from rakanalh July 22, 2024 06:49
Copy link
Member

@eyusufatik eyusufatik left a comment

Choose a reason for hiding this comment

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

single nit. merge after fix. also, have you tested this query with something like ethers.js?

crates/ethereum-rpc/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@rakanalh rakanalh left a comment

Choose a reason for hiding this comment

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

LGTM

crates/ethereum-rpc/src/lib.rs Show resolved Hide resolved
@yaziciahmet
Copy link
Contributor Author

single nit. merge after fix. also, have you tested this query with something like ethers.js?

I wasn't able to. ethers.js doesn't support this out of the box. It supports custom rpc requests with custom method and params, and it supports custom subscription topics for eth_subscribe, but it doesn't support debug_subscribe. When I sent rpc request with simply provider.send("debug_subscribe", [<args>]), it just returns the subscription id as that is the first response returned, but it doesn't know that it should wait, hence it ignores the rest.

I tested with wscat using the following command:

wscat -c ws://localhost:12345 -w 10 -x '{"jsonrpc": "2.0", "id": 1, "method": "debug_subscribe", "params": ["traceChain", "0x1", "latest"]}'

@eyusufatik
Copy link
Member

  wasn't able to. ethers.js doesn't support this out of the box. It supports custom rpc requests with custom method and params, and it supports custom subscription topics for eth_subscribe, but it doesn't support debug_subscribe. When I sent rpc request with simply provider.send("debug_subscribe", []), it just returns the subscription id as that is the first response returned, but it doesn't know that it should wait, hence it ignores the rest.

I am suspecting more and more if this is going to replace trace filter 😅

anyways let's call it the more the merrier

@yaziciahmet yaziciahmet merged commit f7d9207 into nightly Jul 22, 2024
12 checks passed
@yaziciahmet yaziciahmet deleted the yaziciahmet/debug_traceChain branch July 22, 2024 14:15
okkothejawa added a commit that referenced this pull request Jul 25, 2024
* CI Check genesis files (#903)

* Test ci

* Test ci 2

* Test ci 3

* Test ci 4

* Gitkeep state dir for temp genesis files

* Test if ci works & revert python script

* Remove comments of cis

* Reduces unnecessary sleep

* New script using git diff

* Test ci works

* Test ci

* CI should work

* Add genesis production mode (#905)

* Add genesis production mode

* Owner seperation

* move e2e tests to different files (#906)

* move e2e tests to different files

* add comments to e2e tests

* Implement debug_traceChain (#909)

* Parse and validate parameters

* Further block number validation & spawn sender job

* Separate debug_Trace_by_block_number fn

* Finalize debug_traceChain

* Update error message

* Recreate working set on each block

* Add method to TestClient

* Remove unused import

* Lint

* Decrease inactive time to 5 secs in tests

* Fix test client

* Add assertions to test

* Only wait for block number of notifications

* Separate handler fn

* Pin cargo-binstall to 1.6.9 (#915)

Co-authored-by: Jouz0 <[email protected]>

* Add change upgradeability admin test (#913)

* Add change upgradeability admin test

* Call `owner` on ProxyAdmin

* format fix

---------

Co-authored-by: Erce Can Bektüre <[email protected]>
Co-authored-by: Esad Yusuf Atik <[email protected]>
Co-authored-by: Ahmet Yazıcı <[email protected]>
Co-authored-by: jfldde <[email protected]>
Co-authored-by: Jouz0 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T - enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement trace_filter
3 participants