Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1578aa3
chore: introduce separate structure for Shasta slot info
mikhailUshakoff Nov 27, 2025
88d20f3
chore: move l2SlotInfoV2 to common crate
mikhailUshakoff Nov 27, 2025
d52cbbf
feat: add L2SlotContext
mikhailUshakoff Nov 27, 2025
a3e36b2
feat: add dummy block
mikhailUshakoff Dec 2, 2025
1c862a8
Merge branch 'master' into mu/shasta-slot-info
mikhailUshakoff Dec 3, 2025
ba277dc
chore: rename to draft block
mikhailUshakoff Dec 4, 2025
2ebdacf
chore: add L2BlockV2Payload
mikhailUshakoff Dec 4, 2025
e1fe5c4
fix
mikhailUshakoff Dec 7, 2025
5143b6f
feat: add support for consecutive proofs
mikhailUshakoff Dec 7, 2025
292e696
chore: add comment
mikhailUshakoff Dec 7, 2025
ab93515
fix Inbox.getConfig ABI
mikhailUshakoff Dec 7, 2025
16122e6
cargo fmt
mikhailUshakoff Dec 7, 2025
c14ee5d
bump version
mikhailUshakoff Dec 7, 2025
0e3f3ce
fix
mikhailUshakoff Dec 8, 2025
297898e
Merge branch 'master' into mu/shasta-slot-info
mikhailUshakoff Dec 8, 2025
aa6d456
Merge branch 'mu/consecutive-proofs' into mu/shasta-slot-info
mikhailUshakoff Dec 8, 2025
0bc1d04
fix: remove bond instruction
mikhailUshakoff Dec 8, 2025
d82b70f
Merge branch 'master' into mu/shasta-slot-info
mikhailUshakoff Dec 8, 2025
7743571
chore: rename gas_limit to gas_limit_without_anchor
mikhailUshakoff Dec 13, 2025
4c844c1
Merge branch 'master' into mu/shasta-slot-info
mikhailUshakoff Dec 13, 2025
5d6a35e
feat: implement block payload
mikhailUshakoff Dec 15, 2025
d2b1f23
chore: remove comments
mikhailUshakoff Dec 16, 2025
68b38f1
Merge branch 'master' into mu/shasta-slot-info
mikhailUshakoff Dec 17, 2025
17ca3fc
bump version
mikhailUshakoff Dec 17, 2025
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
14 changes: 7 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resolver = "2"
default-members = ["node"]

[workspace.package]
version = "1.23.30"
version = "1.23.31"
edition = "2024"
repository = "https://github.com/NethermindEth/Catalyst"
license = "MIT"
Expand Down
17 changes: 12 additions & 5 deletions common/src/shared/l2_block_v2.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
use crate::shared::l2_tx_lists::PreBuiltTxList;
use alloy::primitives::Address;

#[derive(Debug, Clone)]
pub struct L2BlockV2Draft {
pub prebuilt_tx_list: PreBuiltTxList,
pub timestamp_sec: u64,
pub gas_limit_without_anchor: u64,
}

#[derive(Debug, Clone)]
pub struct L2BlockV2 {
pub prebuilt_tx_list: PreBuiltTxList,
pub timestamp_sec: u64,
pub coinbase: Address,
pub anchor_block_number: u64,
pub gas_limit: u64,
pub gas_limit_without_anchor: u64,
}

impl L2BlockV2 {
Expand All @@ -16,29 +23,29 @@ impl L2BlockV2 {
timestamp_sec: u64,
coinbase: Address,
anchor_block_number: u64,
gas_limit: u64,
gas_limit_without_anchor: u64,
) -> Self {
L2BlockV2 {
prebuilt_tx_list: tx_list,
timestamp_sec,
coinbase,
anchor_block_number,
gas_limit,
gas_limit_without_anchor,
}
}

pub fn new_empty(
timestamp_sec: u64,
coinbase: Address,
anchor_block_number: u64,
gas_limit: u64,
gas_limit_without_anchor: u64,
) -> Self {
L2BlockV2 {
prebuilt_tx_list: PreBuiltTxList::empty(),
timestamp_sec,
coinbase,
anchor_block_number,
gas_limit,
gas_limit_without_anchor,
}
}
}
27 changes: 20 additions & 7 deletions common/src/shared/l2_slot_info.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
use alloy::primitives::B256;

pub trait SlotData {
fn slot_timestamp(&self) -> u64;
fn parent_id(&self) -> u64;
fn parent_hash(&self) -> &B256;
}

pub struct L2SlotInfo {
base_fee: u64,
slot_timestamp: u64,
parent_id: u64,
parent_hash: B256,
parent_gas_used: u32,
parent_gas_limit_without_anchor: u64,
parent_timestamp: u64,
}

Expand All @@ -17,7 +22,6 @@ impl L2SlotInfo {
parent_id: u64,
parent_hash: B256,
parent_gas_used: u32,
parent_gas_limit_without_anchor: u64,
parent_timestamp: u64,
) -> Self {
Self {
Expand All @@ -26,7 +30,6 @@ impl L2SlotInfo {
parent_id,
parent_hash,
parent_gas_used,
parent_gas_limit_without_anchor,
parent_timestamp,
}
}
Expand All @@ -51,11 +54,21 @@ impl L2SlotInfo {
self.parent_gas_used
}

pub fn parent_gas_limit_without_anchor(&self) -> u64 {
self.parent_gas_limit_without_anchor
}

pub fn parent_timestamp(&self) -> u64 {
self.parent_timestamp
}
}

impl SlotData for L2SlotInfo {
fn slot_timestamp(&self) -> u64 {
self.slot_timestamp
}

fn parent_id(&self) -> u64 {
self.parent_id
}

fn parent_hash(&self) -> &B256 {
&self.parent_hash
}
}
76 changes: 76 additions & 0 deletions common/src/shared/l2_slot_info_v2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
use super::l2_slot_info::SlotData;
use alloy::primitives::B256;

pub struct L2SlotContext {
pub info: L2SlotInfoV2,
pub end_of_sequencing: bool,
pub allow_forced_inclusion: bool,
}

#[derive(Debug, Clone)]
pub struct L2SlotInfoV2 {
base_fee: u64,
slot_timestamp: u64,
parent_id: u64,
parent_hash: B256,
parent_gas_limit_without_anchor: u64,
parent_timestamp: u64,
}

impl L2SlotInfoV2 {
pub fn new(
base_fee: u64,
slot_timestamp: u64,
parent_id: u64,
parent_hash: B256,
parent_gas_limit_without_anchor: u64,
parent_timestamp: u64,
) -> Self {
Self {
base_fee,
slot_timestamp,
parent_id,
parent_hash,
parent_gas_limit_without_anchor,
parent_timestamp,
}
}

pub fn base_fee(&self) -> u64 {
self.base_fee
}

pub fn slot_timestamp(&self) -> u64 {
self.slot_timestamp
}

pub fn parent_id(&self) -> u64 {
self.parent_id
}

pub fn parent_hash(&self) -> &B256 {
&self.parent_hash
}

pub fn parent_gas_limit_without_anchor(&self) -> u64 {
self.parent_gas_limit_without_anchor
}

pub fn parent_timestamp(&self) -> u64 {
self.parent_timestamp
}
}

impl SlotData for L2SlotInfoV2 {
fn slot_timestamp(&self) -> u64 {
self.slot_timestamp
}

fn parent_id(&self) -> u64 {
self.parent_id
}

fn parent_hash(&self) -> &B256 {
&self.parent_hash
}
}
1 change: 1 addition & 0 deletions common/src/shared/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ pub mod head_verifier;
pub mod l2_block;
pub mod l2_block_v2;
pub mod l2_slot_info;
pub mod l2_slot_info_v2;
pub mod l2_tx_lists;
pub mod transaction_monitor;
3 changes: 0 additions & 3 deletions pacaya/src/l2/taiko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ impl Taiko {
let parent_id = block_info.header.number();
let parent_hash = block_info.header.hash;
let parent_gas_used = block_info.header.gas_used();
// For Pacaya we do not use that value so we can set it to zero
let parent_gas_limit_without_anchor = 0;
let parent_timestamp = block_info.header.timestamp();
// Safe conversion with overflow check
let parent_gas_used_u32 = u32::try_from(parent_gas_used).map_err(|_| {
Expand Down Expand Up @@ -196,7 +194,6 @@ impl Taiko {
parent_id,
parent_hash,
parent_gas_used_u32,
parent_gas_limit_without_anchor,
parent_timestamp,
))
}
Expand Down
29 changes: 16 additions & 13 deletions pacaya/src/node/operator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use common::{
fork_info::ForkInfo,
l1::slot_clock::{Clock, SlotClock},
l2::taiko_driver::{StatusProvider, models::TaikoStatus},
shared::l2_slot_info::L2SlotInfo,
shared::l2_slot_info::SlotData,
utils::{cancellation_token::CancellationToken, types::*},
};
pub use status::Status;
Expand Down Expand Up @@ -65,7 +65,7 @@ impl<T: PreconfOperator, U: Clock, V: StatusProvider> Operator<T, U, V> {
}

/// Get the current status of the operator based on the current L1 and L2 slots
pub async fn get_status(&mut self, l2_slot_info: &L2SlotInfo) -> Result<Status, Error> {
pub async fn get_status<S: SlotData>(&mut self, l2_slot_info: &S) -> Result<Status, Error> {
if !self
.execution_layer
.is_preconf_router_specified_in_taiko_wrapper()
Expand Down Expand Up @@ -183,9 +183,9 @@ impl<T: PreconfOperator, U: Clock, V: StatusProvider> Operator<T, U, V> {
}
}

async fn is_driver_synced(
async fn is_driver_synced<S: SlotData>(
&mut self,
l2_slot_info: &L2SlotInfo,
l2_slot_info: &S,
driver_status: &TaikoStatus,
) -> Result<bool, Error> {
let taiko_geth_synced_with_l1 = self.is_taiko_geth_synced_with_l1(l2_slot_info).await?;
Expand All @@ -209,12 +209,12 @@ impl<T: PreconfOperator, U: Clock, V: StatusProvider> Operator<T, U, V> {
Ok(false)
}

async fn is_preconfer(
async fn is_preconfer<S: SlotData>(
&mut self,
current_operator: bool,
handover_window: bool,
l1_slot: Slot,
l2_slot_info: &L2SlotInfo,
l2_slot_info: &S,
driver_status: &TaikoStatus,
) -> Result<bool, Error> {
if self
Expand Down Expand Up @@ -245,10 +245,10 @@ impl<T: PreconfOperator, U: Clock, V: StatusProvider> Operator<T, U, V> {
}
}

async fn is_handover_buffer(
async fn is_handover_buffer<S: SlotData>(
&self,
l1_slot: Slot,
l2_slot_info: &L2SlotInfo,
l2_slot_info: &S,
driver_status: &TaikoStatus,
) -> Result<bool, Error> {
if self.get_ms_from_handover_window_start(l1_slot)? <= self.handover_start_buffer_ms {
Expand All @@ -262,10 +262,10 @@ impl<T: PreconfOperator, U: Clock, V: StatusProvider> Operator<T, U, V> {
Ok(false)
}

fn end_of_sequencing_marker_received(
fn end_of_sequencing_marker_received<S: SlotData>(
&self,
driver_status: &TaikoStatus,
l2_slot_info: &L2SlotInfo,
l2_slot_info: &S,
) -> bool {
*l2_slot_info.parent_hash() == driver_status.end_of_sequencing_block_hash
}
Expand Down Expand Up @@ -299,10 +299,10 @@ impl<T: PreconfOperator, U: Clock, V: StatusProvider> Operator<T, U, V> {
Ok(result)
}

async fn is_block_height_synced_between_taiko_geth_and_the_driver(
async fn is_block_height_synced_between_taiko_geth_and_the_driver<S: SlotData>(
&self,
status: &TaikoStatus,
l2_slot_info: &L2SlotInfo,
l2_slot_info: &S,
) -> Result<bool, Error> {
if status.highest_unsafe_l2_payload_block_id == 0 {
return Ok(true);
Expand All @@ -319,7 +319,10 @@ impl<T: PreconfOperator, U: Clock, V: StatusProvider> Operator<T, U, V> {
Ok(taiko_geth_height == status.highest_unsafe_l2_payload_block_id)
}

async fn is_taiko_geth_synced_with_l1(&self, l2_slot_info: &L2SlotInfo) -> Result<bool, Error> {
async fn is_taiko_geth_synced_with_l1<S: SlotData>(
&self,
l2_slot_info: &S,
) -> Result<bool, Error> {
let taiko_inbox_height = self
.execution_layer
.get_l2_height_from_taiko_inbox()
Expand Down
Loading