Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ jobs:
with:
components: rustfmt
- run: cargo fmt --all --check

crate-checks:
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: rui314/setup-mold@v1
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: taiki-e/install-action@cargo-hack
- run: cargo hack check --feature-powerset --depth 1

docs:
name: docs
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ reth-ethereum-engine-primitives = { git = "https://github.com/paradigmxyz/reth",
reth-evm = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a", default-features = false }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-metrics = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
Expand All @@ -136,7 +136,7 @@ reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "020eb
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a", default-features = false }
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
reth-rpc-convert = { git = "https://github.com/paradigmxyz/reth", rev = "020eb6a" }
Expand Down
2 changes: 2 additions & 0 deletions bin/tempo-sidecar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ alloy = { workspace = true, default-features = false, features = [
"reqwest-rustls-tls",
"signers",
"signer-local",
"signer-mnemonic",
"rand",
] }
dashmap = "6.1"
eyre.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ serde = [
"p256/serde",
]
reth-codec = [
"serde",
"dep:reth-codecs",
"dep:reth-db-api",
"dep:modular-bitfield",
Expand Down Expand Up @@ -101,4 +102,4 @@ rpc = [
"dep:reth-rpc-convert",
"dep:alloy-network",
]
cli = ["dep:reth-cli-commands"]
cli = ["dep:reth-cli-commands", "serde", "serde-bincode-compat", "reth-codec"]
15 changes: 9 additions & 6 deletions crates/primitives/src/header.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use alloy_consensus::{BlockHeader, Header, Sealable};
use alloy_primitives::{Address, B64, B256, BlockNumber, Bloom, Bytes, U256, keccak256};
use alloy_rlp::{RlpDecodable, RlpEncodable};
use reth_codecs::Compact;
use reth_primitives_traits::{InMemorySize, serde_bincode_compat::RlpBincode};
use reth_primitives_traits::InMemorySize;

/// Tempo block header.
///
/// Encoded as `rlp([inner, general_gas_limit])` meaning that any new
/// fields added to the inner header will only affect the first list element.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, RlpEncodable, RlpDecodable, Compact)]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, RlpEncodable, RlpDecodable)]
#[cfg_attr(feature = "reth-codec", derive(reth_codecs::Compact))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
#[cfg_attr(any(test, feature = "arbitrary"), derive(arbitrary::Arbitrary))]
Expand Down Expand Up @@ -43,7 +43,8 @@ impl AsRef<Self> for TempoHeader {
}
}

impl RlpBincode for TempoHeader {}
#[cfg(feature = "serde-bincode-compat")]
impl reth_primitives_traits::serde_bincode_compat::RlpBincode for TempoHeader {}

impl BlockHeader for TempoHeader {
fn parent_hash(&self) -> B256 {
Expand Down Expand Up @@ -150,17 +151,19 @@ impl Sealable for TempoHeader {

impl reth_primitives_traits::BlockHeader for TempoHeader {}

#[cfg(feature = "reth-codec")]
impl reth_db_api::table::Compress for TempoHeader {
type Compressed = Vec<u8>;

fn compress_to_buf<B: alloy_primitives::bytes::BufMut + AsMut<[u8]>>(&self, buf: &mut B) {
let _ = Compact::to_compact(self, buf);
let _ = reth_codecs::Compact::to_compact(self, buf);
}
}

#[cfg(feature = "reth-codec")]
impl reth_db_api::table::Decompress for TempoHeader {
fn decompress(value: &[u8]) -> Result<Self, reth_db_api::DatabaseError> {
let (obj, _) = Compact::from_compact(value, value.len());
let (obj, _) = reth_codecs::Compact::from_compact(value, value.len());
Ok(obj)
}
}
Expand Down
14 changes: 8 additions & 6 deletions crates/primitives/src/transaction/envelope.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
use super::{
aa_signature::AASignature, aa_signed::AASigned, account_abstraction::TxAA,
fee_token::TxFeeToken,
};
use super::{aa_signed::AASigned, fee_token::TxFeeToken};
use alloy_consensus::{
EthereumTxEnvelope, Signed, TxEip1559, TxEip2930, TxEip7702, TxLegacy, TxType,
TypedTransaction,
error::{UnsupportedTransactionType, ValueError},
};
use alloy_primitives::{Address, B256, Bytes, Signature, SignatureError, U256};
use alloy_primitives::{Address, B256, Signature, SignatureError, U256};
use core::fmt;
use reth_primitives_traits::InMemorySize;
use tempo_precompiles::tip20::TIP20_PAYMENT_PREFIX;
Expand Down Expand Up @@ -364,9 +361,14 @@ impl reth_primitives_traits::serde_bincode_compat::RlpBincode for TempoTxEnvelop

#[cfg(feature = "reth-codec")]
mod codec {
use crate::{AASignature, TxAA};

use super::*;
use alloy_eips::eip2718::EIP7702_TX_TYPE_ID;
use alloy_primitives::{Signature, bytes, bytes::BufMut};
use alloy_primitives::{
Bytes, Signature,
bytes::{self, BufMut},
};
use reth_codecs::{
Compact,
alloy::transaction::{CompactEnvelope, Envelope},
Expand Down
Loading