Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

feat: add transaction hash to zero trace #103

Merged
merged 4 commits into from
Jun 12, 2024
Merged

Conversation

atanmarko
Copy link
Member

@atanmarko atanmarko commented Jun 9, 2024

With the Erigon commit output of debug_traceBlockByNumber has changed, so now tx result json looks like:

{
	"txHash":"0x058c80b157b4fb4f8b925a81d384336e79afaa64820fbd133c73b774bf6953e7",
	"result":{"traces":{...},"meta": {...}}
}

Block witness returned from eth_getWitness now looks like:

"0x00055821033601462093b5945d1676df093446790fd31b20e7b12a2e8e5e09d068109616b0084a021e19e0c9bab240000005582103468288056310c82aa4c01a7e12a10f8111a0560e72b700555479031b86c357d0084101055820021df1fa259221d02aa4956eb0d35ace318ca24c0a33a64c1af96cf67cf245b6084101055820021703c5eda8644a64cec152c58f5aacec93d72fb0bfa705f0473f9043a8357c08410102188405582103b70e80538acdabd6137353b0f9d8d149f4dba91e8be2e7946e409bfdbe685b900841010558210389802d6ed1a28b049e9d4fe5334c5902fd9bc00c42821c82f82ee2da10be90800841010558200256274a27dd7524955417c11ecd917251cc7c4c8310f4c7e4bd3c304d3d9a79084a021e19e0c9bab2400000055820023ab0970b73895b8c9959bae685c3a19f45eb5ad89d42b52a340ec4ac204d190841010219102005582103876da518a393dbd067dc72abfa08d475ed6447fca96d92ec3f9e7eba503ca6100841010558210352688a8f926c816ca1e079067caba944f158e764817b83fc43594370ca9cf62008410105582103690b239ba3aaf993e443ae14aeffc44cf8d9931a79baed9fa141d0e4506e131008410102196573"

Deserialization logic in zero-bin has changed accordingly.
Trace decoder uses primitive-types H256 to represent hash, but as we are switching to Alloy we chose here alloy::primitives::TxHash for tx hash type.

Resolves #97

Block witness is now retrieved with a separate eth_getWitness rpc call.

@atanmarko atanmarko self-assigned this Jun 9, 2024
@atanmarko atanmarko changed the title feat: add transaction hash to zero trace WIP: feat: add transaction hash to zero trace Jun 9, 2024
@atanmarko atanmarko marked this pull request as ready for review June 10, 2024 10:18
@atanmarko atanmarko changed the title WIP: feat: add transaction hash to zero trace feat: add transaction hash to zero trace Jun 10, 2024
rpc/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@muursh muursh left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Is it tested?

@atanmarko
Copy link
Member Author

Looks fine to me. Is it tested?

@muursh Yes it is tested with the current Erigon feat/zero. Merging would also require update of zk_evm dependency to current develop branch, are there any obstacles for that?

Latest zk_evm has also some new parameter code_db in the BlockTrace prover input. Not sure how to initialize that (for test I just put default value)?

@Nashtare
Copy link
Collaborator

@atanmarko code_db can be defaulted to None for Jerigon. This is an add-on for the native tracer incoming through #81

Cargo.toml Outdated Show resolved Hide resolved
@vgnom vgnom added this to the Cancun - Q2 2024 milestone Jun 11, 2024
@Nashtare Nashtare removed this from the Cancun - Q2 2024 milestone Jun 11, 2024
@Nashtare
Copy link
Collaborator

@atanmarko New versions have been published :) Feel free to swap to tag v0.4.0 in your dependencies.

@atanmarko atanmarko merged commit 146242d into develop Jun 12, 2024
4 checks passed
@atanmarko atanmarko deleted the feat/add-txn-hash branch June 12, 2024 21:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Fix parsing of the latest Erigon witness format
4 participants