Skip to content

Commit a5dd889

Browse files
chore: remove dead code (#770)
* chore: remove dead code * bump version
1 parent b41a1ad commit a5dd889

File tree

8 files changed

+9
-72
lines changed

8 files changed

+9
-72
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ resolver = "2"
1212
default-members = ["node"]
1313

1414
[workspace.package]
15-
version = "1.23.31"
15+
version = "1.23.32"
1616
edition = "2024"
1717
repository = "https://github.com/NethermindEth/Catalyst"
1818
license = "MIT"

shasta/src/l1/protocol_config.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ use taiko_bindings::inbox::IInbox::Config;
44
#[derive(Clone, Default)]
55
pub struct ProtocolConfig {
66
basefee_sharing_pctg: u8,
7-
// TODO initialize these values correctly
8-
_min_anchor_offset: u64,
97
max_anchor_offset: u64,
108
codec_address: Address,
119
}
@@ -14,7 +12,6 @@ impl ProtocolConfig {
1412
pub fn from(shasta_config: &Config) -> Self {
1513
Self {
1614
basefee_sharing_pctg: shasta_config.basefeeSharingPctg,
17-
_min_anchor_offset: 2, // https://github.com/taikoxyz/taiko-mono/blob/main/packages/protocol/docs/Derivation.md#constants
1815
max_anchor_offset: 100, // 128 by document
1916
codec_address: shasta_config.codec,
2017
}
@@ -24,11 +21,6 @@ impl ProtocolConfig {
2421
self.basefee_sharing_pctg
2522
}
2623

27-
#[allow(dead_code)]
28-
pub fn get_min_anchor_height_offset(&self) -> u64 {
29-
self._min_anchor_offset
30-
}
31-
3224
pub fn get_max_anchor_height_offset(&self) -> u64 {
3325
self.max_anchor_offset
3426
}

shasta/src/l2/taiko.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ impl Taiko {
278278
block_number: l2_slot_context.info.parent_id() + 1,
279279
extra_data: format!("0x{:04x}", extra_data),
280280
fee_recipient: l2_block_payload.coinbase.to_string(),
281-
gas_limit: l2_slot_context.info.parent_gas_limit_without_anchor()
282-
+ ANCHOR_V3_V4_GAS_LIMIT,
281+
gas_limit: l2_block_payload.gas_limit_without_anchor + ANCHOR_V3_V4_GAS_LIMIT,
283282
parent_hash: format!("0x{}", hex::encode(l2_slot_context.info.parent_hash())),
284283
timestamp: l2_block_payload.timestamp_sec,
285284
transactions: format!("0x{}", hex::encode(tx_list_bytes)),

shasta/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
mod chain_monitor;
2-
#[allow(dead_code)] // TODO: remove this once we have a used create_shasta_node function
32
mod node;
4-
#[allow(dead_code)] // TODO: remove this once we have a used create_shasta_node function
53
mod utils;
64

75
mod forced_inclusion;

shasta/src/node/proposal_manager/batch_builder.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ impl BatchBuilder {
106106
});
107107
}
108108

109-
pub fn remove_current_proposal(&mut self) {
110-
self.current_proposal = None;
111-
}
112-
113109
pub fn add_l2_draft_block(
114110
&mut self,
115111
l2_draft_block: L2BlockV2Draft,
@@ -417,10 +413,6 @@ impl BatchBuilder {
417413
}
418414
}
419415

420-
pub fn get_number_of_batches_ready_to_send(&self) -> u64 {
421-
self.proposals_to_send.len() as u64
422-
}
423-
424416
/// Alias for `take_proposals_to_send` for compatibility
425417
pub fn take_batches_to_send(&mut self) -> VecDeque<Proposal> {
426418
std::mem::take(&mut self.proposals_to_send)
@@ -495,8 +487,4 @@ impl BatchBuilder {
495487
.map(|proposal| proposal.num_forced_inclusion += 1)
496488
.ok_or_else(|| anyhow::anyhow!("No current proposal to add forced inclusion to"))
497489
}
498-
499-
pub fn get_current_proposal(&self) -> Option<&Proposal> {
500-
self.current_proposal.as_ref()
501-
}
502490
}

shasta/src/node/proposal_manager/proposal.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -67,41 +67,6 @@ impl Proposal {
6767
self.total_bytes = manifest_data.len() as u64;
6868
}
6969

70-
pub fn get_last_block_timestamp(&self) -> Result<u64, anyhow::Error> {
71-
self.l2_blocks
72-
.last()
73-
.map(|block| block.timestamp_sec)
74-
.ok_or_else(|| anyhow::anyhow!("No L2 blocks in proposal"))
75-
}
76-
77-
pub fn has_only_one_common_block(&self) -> bool {
78-
self.num_forced_inclusion == 0 && self.l2_blocks.len() == 1
79-
}
80-
81-
pub fn is_empty(&self) -> bool {
82-
self.num_forced_inclusion == 0 && self.l2_blocks.is_empty()
83-
}
84-
85-
pub fn get_last_block_tx_list_copy(
86-
&self,
87-
) -> Result<Vec<alloy::rpc::types::Transaction>, anyhow::Error> {
88-
self.l2_blocks
89-
.last()
90-
.map(|block| block.prebuilt_tx_list.tx_list.clone())
91-
.ok_or_else(|| anyhow::anyhow!("No L2 blocks in proposal"))
92-
}
93-
94-
pub fn get_last_block_tx_len(&self) -> Result<usize, anyhow::Error> {
95-
self.l2_blocks
96-
.last()
97-
.map(|block| block.prebuilt_tx_list.tx_list.len())
98-
.ok_or_else(|| anyhow::anyhow!("No L2 blocks in proposal"))
99-
}
100-
101-
pub fn total_bytes(&self) -> u64 {
102-
self.total_bytes
103-
}
104-
10570
fn create_block_from_draft(&mut self, l2_draft_block: L2BlockV2Draft) -> L2BlockV2 {
10671
L2BlockV2::new_from(
10772
l2_draft_block.prebuilt_tx_list,

shasta/src/utils/config.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
use common::config::ConfigTrait;
22
use tracing::warn;
33

4-
#[derive(Debug, Clone)]
5-
pub struct L1ContractAddresses {
6-
pub shasta_inbox: String,
7-
}
8-
94
#[derive(Debug, Clone)]
105
pub struct ShastaConfig {
116
pub shasta_inbox: String,

0 commit comments

Comments
 (0)