Skip to content

feat: remove starknet-messaging feature #3005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2025
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
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
Loading