forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
2,011 additions
and
699 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ mod access_list; | |
mod genesis_account; | ||
mod log; | ||
mod request; | ||
mod taiko; | ||
mod txkind; | ||
mod withdrawal; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//! Native Compact codec impl for Taiko types. | ||
use crate::Compact; | ||
use alloy_primitives::{B256, U256}; | ||
use alloy_rpc_types_engine::L1Origin as AlloyL1Origin; | ||
|
||
use reth_codecs_derive::main_codec; | ||
|
||
#[main_codec] | ||
#[derive(Debug, Clone, PartialEq, Eq, Default)] | ||
struct L1Origin { | ||
pub block_id: U256, | ||
pub l2_block_hash: B256, | ||
pub l1_block_height: U256, | ||
pub l1_block_hash: B256, | ||
} | ||
|
||
impl Compact for AlloyL1Origin { | ||
fn to_compact<B>(self, buf: &mut B) -> usize | ||
where | ||
B: bytes::BufMut + AsMut<[u8]>, | ||
{ | ||
let l1_origin = L1Origin { | ||
block_id: self.block_id, | ||
l2_block_hash: self.l2_block_hash, | ||
l1_block_height: self.l1_block_height, | ||
l1_block_hash: self.l1_block_hash, | ||
}; | ||
l1_origin.to_compact(buf) | ||
} | ||
|
||
fn from_compact(buf: &[u8], len: usize) -> (Self, &[u8]) { | ||
let (l1_origin, _) = L1Origin::from_compact(buf, len); | ||
let alloy_l1_origin = Self { | ||
block_id: l1_origin.block_id, | ||
l2_block_hash: l1_origin.l2_block_hash, | ||
l1_block_height: l1_origin.l1_block_height, | ||
l1_block_hash: l1_origin.l1_block_hash, | ||
}; | ||
(alloy_l1_origin, buf) | ||
} | ||
} |
Oops, something went wrong.