Skip to content
Draft
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
26 changes: 26 additions & 0 deletions Cargo.lock

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

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ members = [
"crates/primitives",
"crates/rpc",
"crates/sequencer",
"crates/spf",
"xtask",
]

Expand Down Expand Up @@ -126,6 +127,7 @@ zone-precompiles = { path = "crates/precompiles", default-features = false }
zone-primitives = { path = "crates/primitives", default-features = false }
zone-rpc = { path = "crates/rpc" }
zone-sequencer = { path = "crates/sequencer" }
zone-spf = { path = "crates/spf" }

# reth
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "1bf2384" }
Expand Down Expand Up @@ -159,6 +161,12 @@ reth-storage-api = { git = "https://github.com/paradigmxyz/reth", rev = "1bf2384
reth-tasks = { git = "https://github.com/paradigmxyz/reth", rev = "1bf2384" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth", rev = "1bf2384" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", rev = "1bf2384" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth", rev = "1bf2384", default-features = false, features = [
"std",
] }
reth-trie-sparse = { git = "https://github.com/paradigmxyz/reth", rev = "1bf2384", default-features = false, features = [
"std",
] }
revm = { version = "41.0.0", features = [
"optional_fee_charge",
], default-features = false }
Expand Down
2 changes: 2 additions & 0 deletions crates/contracts/src/precompiles/zone_portal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ crate::sol! {
EncryptedDepositPayload encrypted;
}

#[derive(PartialEq, Eq)]
struct BlockTransition {
bytes32 prevBlockHash;
bytes32 nextBlockHash;
}

#[derive(PartialEq, Eq)]
struct DepositQueueTransition {
bytes32 prevProcessedHash;
bytes32 nextProcessedHash;
Expand Down
7 changes: 7 additions & 0 deletions crates/primitives/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ pub const PORTAL_PENDING_SEQUENCER_SLOT: B256 = {
/// ZoneInbox storage slot 0: `processedDepositQueueHash` (bytes32).
pub const ZONE_INBOX_PROCESSED_HASH_SLOT: U256 = U256::ZERO;

/// ZoneInbox storage slot 1: `processedDepositNumber` (uint64, lower 8 bytes).
pub const ZONE_INBOX_PROCESSED_NUMBER_SLOT: U256 = {
let mut le = [0u8; 32];
le[0] = 1;
U256::from_le_bytes(le)
};

/// ZoneOutbox storage slot 1: `_lastBatch.withdrawalQueueHash` (bytes32).
///
/// Slot 0 is packed `(tempoGasRate, nextWithdrawalIndex, withdrawalBatchIndex)`.
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use alloy_rlp::Encodable as _;
/// Simplified zone block header for hash computation.
///
/// The zone block hash is `keccak256(rlp_encode(header))`.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ZoneHeader {
pub parent_hash: B256,
Expand Down
46 changes: 46 additions & 0 deletions crates/spf/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[package]
name = "zone-spf"
description = "Stateless proof function for Tempo Zones"
version.workspace = true
edition.workspace = true
license.workspace = true
rust-version.workspace = true
publish.workspace = true

[lints]
workspace = true

[dependencies]
tempo-zone-contracts = { workspace = true, features = ["std"] }
zone-chainspec.workspace = true
zone-evm.workspace = true
zone-precompiles = { workspace = true, features = ["std"] }
zone-primitives = { workspace = true, features = ["std"] }

# Tempo
tempo-chainspec.workspace = true
tempo-evm.workspace = true
tempo-primitives.workspace = true
tempo-revm.workspace = true

# Alloy / REVM
alloy-consensus.workspace = true
alloy-eips.workspace = true
alloy-evm.workspace = true
alloy-primitives.workspace = true
alloy-rlp.workspace = true
alloy-sol-types.workspace = true
reth-trie-common.workspace = true
reth-trie-sparse.workspace = true
revm.workspace = true
serde = { workspace = true, optional = true }
thiserror = "2"

[features]
default = ["serde"]
serde = [
"dep:serde",
"alloy-primitives/serde",
"tempo-zone-contracts/serde",
"zone-primitives/serde",
]
Loading
Loading