-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: transaction trie needs tx rlp to support 4844 (#291)
* fix: transaction trie needs tx rlp to support 4844 No ZK circuit code was changed. To generate witness transaction MPT proofs, we reconstruct the transactions trie of a block from the raw transactions returns by a JSON-RPC call for a block. To construct the trie, we must compute the RLP encoding of each raw transaction. Previously, we used `ethers_core` to do this. However `ethers_core` has not been updated after EIP 4844 (Dencun) for the new Type 3 Blob Transaction. At first I tried to use `reth`'s transaction RLP encoding logic. However `reth` uses an internal type to represent transactions. Since we get transactions from RPC calls, we need an adapter from the RPC type. This latter type is provided in `alloy_rpc_types`, but in writing the converter from RPC type to reth primitive type, I ran into issues that many structs were defined in parallel in the two crates, and also there was inconsistency in the use of `ruint` primitives. I decided it was easier just to keep `ethers_core` types for now and add custom implementations of RLP for the new transaction type. Also added RLP support for OP stack deposit transactions. Moved some of the trie code from `axiom-query` to `axiom-eth` to remove redundancy. References: - https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md - https://github.com/paradigmxyz/reth/blob/28f3a2e2d9525bf2f6373e755e2d6dc0c2f97821/crates/primitives/src/transaction/mod.rs#L128 - https://github.com/alloy-rs/alloy/blob/d5967abdbae58dd84acc4c1ee31345108d42d041/crates/rpc-types/src/eth/transaction/mod.rs * feat: switch to `ethers` v2.0.14 so `OtherField` and "optimism" are compatible * chore: storageProof key is now U256 instead of H256 * chore: add rpc tests
- Loading branch information
1 parent
35151f0
commit 796d4db
Showing
14 changed files
with
307 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.