Skip to content

Commit

Permalink
feat: remove starknet-messaging feature (#3005)
Browse files Browse the repository at this point in the history
remove starknet messaging feature
  • Loading branch information
glihm authored Feb 10, 2025
1 parent 9f744a0 commit d3a4f2d
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 19 deletions.
1 change: 0 additions & 1 deletion bin/katana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ default = [ "jemalloc", "katana-cli/slot" ]

init-custom-settlement-chain = [ ]
jemalloc = [ ]
starknet-messaging = [ "katana-cli/starknet-messaging" ]
1 change: 0 additions & 1 deletion crates/katana/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ starknet.workspace = true
default = [ "server", "slot" ]
server = [ ]
slot = [ "dep:katana-slot-controller", "katana-chain-spec/controller" ]
starknet-messaging = [ "katana-node/starknet-messaging" ]
5 changes: 1 addition & 4 deletions crates/katana/contracts/messaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ How to run the scripts:

```bash
# From installed Katana.
katana --messaging crates/katana/contracts/messaging/l3.messaging.json -p 6060`
# Dev mode
cargo run --bin katana --features "starknet-messaging" -- --messaging crates/katana/contracts/messaging/l3.messaging.json -p 6060
katana --messaging crates/katana/contracts/messaging/l3.messaging.json -p 6060
```

- Open an other terminal and `cd ~/dojo/crates/katana/core/contracts/messaging`.
Expand Down
5 changes: 1 addition & 4 deletions crates/katana/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ url.workspace = true

alloy-primitives = { workspace = true, features = [ "serde" ] }
alloy-sol-types = { workspace = true, default-features = false, features = [ "json" ] }
starknet-crypto = { workspace = true, optional = true }
starknet-crypto.workspace = true

alloy-contract = { workspace = true, default-features = false }
alloy-network = { workspace = true, default-features = false }
Expand All @@ -56,9 +56,6 @@ rstest.workspace = true
tempfile.workspace = true
pprof.workspace = true

[features]
starknet-messaging = [ "dep:starknet-crypto" ]

[[bench]]
name = "commit"
harness = false
7 changes: 1 addition & 6 deletions crates/katana/core/src/service/messaging/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! updates on Ethereum, since the process of proving and verifying of state updates, and then
//! posting in on the settlement layer are not yet present in Katana.
//!
//! Katana also has a `starknet-messaging` feature, where an opiniated implementation of L2 <-> L3
//! Katana also has starknet messaging built-in, where an opiniated implementation of L2 <-> L3
//! messaging is implemented using Starknet as settlement chain.
//!
//! With this feature, Katana also has the capability to directly send `invoke` transactions to a
Expand All @@ -34,7 +34,6 @@
mod ethereum;
mod service;
#[cfg(feature = "starknet-messaging")]
mod starknet;

use std::future::Future;
Expand All @@ -55,12 +54,10 @@ use serde::{Deserialize, Serialize};
use tracing::{error, info, trace};

pub use self::service::{MessagingOutcome, MessagingService};
#[cfg(feature = "starknet-messaging")]
use self::starknet::StarknetMessaging;

pub(crate) const LOG_TARGET: &str = "messaging";
pub(crate) const CONFIG_CHAIN_ETHEREUM: &str = "ethereum";
#[cfg(feature = "starknet-messaging")]
pub(crate) const CONFIG_CHAIN_STARKNET: &str = "starknet";

type MessengerResult<T> = Result<T, Error>;
Expand Down Expand Up @@ -170,7 +167,6 @@ pub trait Messenger {
#[derive(Debug)]
pub enum MessengerMode {
Ethereum(EthereumMessaging),
#[cfg(feature = "starknet-messaging")]
Starknet(StarknetMessaging),
}

Expand All @@ -188,7 +184,6 @@ impl MessengerMode {
}
},

#[cfg(feature = "starknet-messaging")]
CONFIG_CHAIN_STARKNET => match StarknetMessaging::new(config).await {
Ok(m_sn) => {
info!(target: LOG_TARGET, "Messaging enabled [Starknet].");
Expand Down
2 changes: 0 additions & 2 deletions crates/katana/core/src/service/messaging/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ impl<EF: ExecutorFactory> MessagingService<EF> {
Ok((block_num, txs_count))
}

#[cfg(feature = "starknet-messaging")]
MessengerMode::Starknet(inner) => {
let (block_num, txs) =
inner.gather_messages(from_block, max_block, backend.chain_spec.id()).await?;
Expand Down Expand Up @@ -146,7 +145,6 @@ impl<EF: ExecutorFactory> MessagingService<EF> {
Ok(Some((block_num, hashes.len())))
}

#[cfg(feature = "starknet-messaging")]
MessengerMode::Starknet(inner) => {
let hashes = inner.send_messages(&messages).await.map(|hashes| {
hashes.iter().map(|h| format!("{h:#x}")).collect::<Vec<_>>()
Expand Down
1 change: 0 additions & 1 deletion crates/katana/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ vergen = { version = "9.0.0", features = [ "build", "cargo", "emit_and_set" ] }
vergen-gitcl = { version = "1.0.0", features = [ "build", "cargo", "rustc", "si" ] }

[features]
starknet-messaging = [ "katana-core/starknet-messaging" ]
# experimental feature to test katana full node mode
full-node = [ "dep:katana-feeder-gateway", "dep:katana-provider", "dep:tokio" ]

Expand Down

1 comment on commit d3a4f2d

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: d3a4f2d Previous: 9f744a0 Ratio
Concurrent.Simulate/Blockifier.1 10964787 ns/iter (± 624057) 8385344 ns/iter (± 264177) 1.31

This comment was automatically generated by workflow using github-action-benchmark.

CC: @kariy @glihm @tarrencev

Please sign in to comment.