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

add zeth support in rpc type #803

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

add zeth support in rpc type #803

wants to merge 2 commits into from

Conversation

temaniarpit27
Copy link
Contributor

@github-actions github-actions bot added the crate: zero_bin Anything related to the zero-bin subcrates. label Nov 18, 2024
@github-actions github-actions bot added the ci label Nov 18, 2024
@temaniarpit27 temaniarpit27 force-pushed the arpit/zeth-1 branch 19 times, most recently from 85e11ab to c5d07a1 Compare November 19, 2024 04:40
@temaniarpit27 temaniarpit27 marked this pull request as ready for review November 19, 2024 04:45
@temaniarpit27 temaniarpit27 mentioned this pull request Nov 19, 2024
uses: actions/checkout@v4
with:
repository: 0xPolygonZero/zeth
ref: "arpit/1"
Copy link
Member

Choose a reason for hiding this comment

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

When do we plan to merge your work to the main branch?

Copy link
Contributor Author

@temaniarpit27 temaniarpit27 Nov 19, 2024

Choose a reason for hiding this comment

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

PR - 0xPolygonZero/zeth#5
Whenever this is merged

Comment on lines +44 to +49
- name: Generate txn
run: |
cast send --async --legacy \
--from "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" \
--private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \
--rpc-url http://localhost:8545 --gas-limit 100000 --value 1 "0x852DA15b70a3e197d1D668a9a481B1F4c2168a5D"
Copy link
Member

Choose a reason for hiding this comment

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

You could probably use polycli loadtest to generate multiple blocks. As this integration test is about witness extraction, probably few different kind of transactions and blocks would be great.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a demo integration to kick things off. Issue for improvement:
#806

let block_trace = cached_provider
.get_provider()
.await?
.raw_request::<_, BlockTrace>("zero_getBlockTraceByNumber".into(), vec![block_number])
Copy link
Member

Choose a reason for hiding this comment

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

Isn't there a same standard API in zeth, debug_traceBlockByNumber?

https://github.com/paradigmxyz/reth/blob/main/crates/rpc/rpc-api/src/debug.rs#L73

Copy link
Contributor Author

Choose a reason for hiding this comment

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

zeth is a wrapper over reth. This was done by Francesco earlier. We can name this API whatever we want
0xPolygonZero/zeth#9

Copy link
Member

@atanmarko atanmarko Nov 19, 2024

Choose a reason for hiding this comment

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

I think we should stick with the standard API. It is not about renaming, reth already implements debug_traceBlockByNumber. Just the zero tracer option should be added to that one when you specify type of the tracer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya cool. Created task above to handle this in future

{
let block_number = match target_block_id {
BlockId::Number(block_number) => block_number,
_ => return Err(anyhow::anyhow!("block number expected")),
Copy link
Member

@atanmarko atanmarko Nov 19, 2024

Choose a reason for hiding this comment

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

We handle case where block hash is provided in the CLI for other blockchain clients, could we do the same for zeth? In the worst case that zeth api does not support hashes, we could get the block header by hash and learn the block number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci crate: zero_bin Anything related to the zero-bin subcrates.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants