diff --git a/bin/sozo/src/args.rs b/bin/sozo/src/args.rs
index 928bc8a4b1..d190da8fb9 100644
--- a/bin/sozo/src/args.rs
+++ b/bin/sozo/src/args.rs
@@ -12,7 +12,7 @@ use tracing_subscriber::{fmt, EnvFilter};
use crate::commands::Commands;
use crate::utils::generate_version;
-#[derive(Parser)]
+#[derive(Parser, Debug)]
#[command(author, version=generate_version(), about, long_about = None)]
#[command(propagate_version = true)]
pub struct SozoArgs {
diff --git a/bin/sozo/src/commands/options/account/controller.rs b/bin/sozo/src/commands/options/account/controller.rs
index cc2b385ba4..d863a39829 100644
--- a/bin/sozo/src/commands/options/account/controller.rs
+++ b/bin/sozo/src/commands/options/account/controller.rs
@@ -21,6 +21,8 @@ use url::Url;
use super::WorldAddressOrName;
+// This type comes from account_sdk, which doesn't derive Debug.
+#[allow(missing_debug_implementations)]
pub type ControllerSessionAccount
= SessionAccount
;
/// Create a new Catridge Controller account based on session key.
diff --git a/bin/sozo/src/commands/options/account/type.rs b/bin/sozo/src/commands/options/account/type.rs
index a0fda6fbc0..5e3eb4319c 100644
--- a/bin/sozo/src/commands/options/account/type.rs
+++ b/bin/sozo/src/commands/options/account/type.rs
@@ -31,6 +31,7 @@ pub enum SozoAccountSignError {
#[must_use]
#[non_exhaustive]
#[derive(derive_more::From)]
+#[allow(missing_debug_implementations)]
pub enum SozoAccount
where
P: Send,
diff --git a/crates/benches/src/helpers.rs b/crates/benches/src/helpers.rs
index 29ffd444a1..3e5e3bc950 100644
--- a/crates/benches/src/helpers.rs
+++ b/crates/benches/src/helpers.rs
@@ -11,7 +11,7 @@ use starknet::signers::LocalWallet;
use tokio::sync::OnceCell;
pub type OwnerAccount = SingleOwnerAccount, LocalWallet>;
-#[derive(Clone)]
+#[derive(Debug, Clone)]
pub struct BenchCall(pub &'static str, pub Vec);
// Because no calls are actually executed in the benchmark, we can use the same nonce for all of
diff --git a/crates/dojo-bindgen/src/plugins/unity/mod.rs b/crates/dojo-bindgen/src/plugins/unity/mod.rs
index f83fa84b50..2bdc954040 100644
--- a/crates/dojo-bindgen/src/plugins/unity/mod.rs
+++ b/crates/dojo-bindgen/src/plugins/unity/mod.rs
@@ -9,6 +9,7 @@ use crate::error::BindgenResult;
use crate::plugins::BuiltinPlugin;
use crate::{DojoContract, DojoData, DojoModel};
+#[derive(Debug)]
pub struct UnityPlugin {}
impl UnityPlugin {
diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs
index 54e4f631b6..faa07c22fa 100644
--- a/crates/dojo-lang/src/compiler.rs
+++ b/crates/dojo-lang/src/compiler.rs
@@ -51,6 +51,7 @@ pub(crate) const LOG_TARGET: &str = "dojo_lang::compiler";
#[path = "compiler_test.rs"]
mod test;
+#[derive(Debug)]
pub struct DojoCompiler;
#[derive(Debug, Default, Serialize, Deserialize)]
diff --git a/crates/dojo-lang/src/contract.rs b/crates/dojo-lang/src/contract.rs
index fb6f787c39..7a9dd4c122 100644
--- a/crates/dojo-lang/src/contract.rs
+++ b/crates/dojo-lang/src/contract.rs
@@ -23,11 +23,12 @@ use crate::utils::is_name_valid;
const DOJO_INIT_FN: &str = "dojo_init";
const CONTRACT_NAMESPACE: &str = "namespace";
-#[derive(Clone, Default)]
+#[derive(Debug, Clone, Default)]
pub struct ContractParameters {
namespace: Option,
}
+#[derive(Debug)]
pub struct DojoContract {
diagnostics: Vec,
dependencies: HashMap,
diff --git a/crates/dojo-lang/src/inline_macros/utils.rs b/crates/dojo-lang/src/inline_macros/utils.rs
index 46d23e7280..b0dde78018 100644
--- a/crates/dojo-lang/src/inline_macros/utils.rs
+++ b/crates/dojo-lang/src/inline_macros/utils.rs
@@ -12,6 +12,7 @@ lazy_static::lazy_static! {
pub static ref SYSTEM_READS: Mutex>> = Default::default();
}
+#[derive(Debug)]
pub enum SystemRWOpRecord {
StructCtor(ExprStructCtorCall),
Path(ExprPath),
diff --git a/crates/dojo-lang/src/interface.rs b/crates/dojo-lang/src/interface.rs
index b601ada9d3..bc30581ddf 100644
--- a/crates/dojo-lang/src/interface.rs
+++ b/crates/dojo-lang/src/interface.rs
@@ -8,6 +8,7 @@ use cairo_lang_utils::unordered_hash_map::UnorderedHashMap;
use crate::syntax::self_param;
use crate::syntax::world_param::{self, WorldParamInjectionKind};
+#[derive(Debug)]
pub struct DojoInterface {
diagnostics: Vec,
}
diff --git a/crates/dojo-lang/src/introspect/utils.rs b/crates/dojo-lang/src/introspect/utils.rs
index bf7be9964c..7e2a2acc5f 100644
--- a/crates/dojo-lang/src/introspect/utils.rs
+++ b/crates/dojo-lang/src/introspect/utils.rs
@@ -1,6 +1,6 @@
use std::collections::HashMap;
-#[derive(Clone, Default)]
+#[derive(Clone, Default, Debug)]
pub struct TypeIntrospection(pub usize, pub Vec);
// Provides type introspection information for primitive types
diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs
index fd6b46491c..2e619464e4 100644
--- a/crates/dojo-lang/src/plugin.rs
+++ b/crates/dojo-lang/src/plugin.rs
@@ -555,6 +555,7 @@ impl MacroPlugin for BuiltinDojoPlugin {
}
}
+#[derive(Debug)]
pub struct CairoPluginRepository(scarb::compiler::plugin::CairoPluginRepository);
impl Default for CairoPluginRepository {
diff --git a/crates/dojo-lang/src/plugin_test.rs b/crates/dojo-lang/src/plugin_test.rs
index 899cd8557c..ca266f465a 100644
--- a/crates/dojo-lang/src/plugin_test.rs
+++ b/crates/dojo-lang/src/plugin_test.rs
@@ -39,6 +39,7 @@ pub fn test_expand_plugin(
}
#[salsa::database(DefsDatabase, ParserDatabase, SyntaxDatabase, FilesDatabase)]
+#[allow(missing_debug_implementations)]
pub struct DatabaseForTesting {
storage: salsa::Storage,
}
diff --git a/crates/dojo-lang/src/semantics/test_utils.rs b/crates/dojo-lang/src/semantics/test_utils.rs
index 00e34b9b9b..e497417f55 100644
--- a/crates/dojo-lang/src/semantics/test_utils.rs
+++ b/crates/dojo-lang/src/semantics/test_utils.rs
@@ -28,6 +28,7 @@ use once_cell::sync::Lazy;
use crate::plugin::dojo_plugin_suite;
#[salsa::database(SemanticDatabase, DefsDatabase, ParserDatabase, SyntaxDatabase, FilesDatabase)]
+#[allow(missing_debug_implementations)]
pub struct DojoSemanticDatabase {
storage: salsa::Storage,
}
@@ -106,6 +107,7 @@ impl Upcast for DojoSemanticDatabase {
}
}
+#[derive(Debug)]
pub struct WithStringDiagnostics {
value: T,
diagnostics: String,
@@ -129,6 +131,7 @@ impl WithStringDiagnostics {
}
/// Helper struct for the return value of [setup_test_module].
+#[derive(Debug)]
pub struct TestModule {
pub crate_id: CrateId,
pub module_id: ModuleId,
@@ -172,6 +175,7 @@ pub fn setup_test_module(
}
/// Helper struct for the return value of [setup_test_function].
+#[derive(Debug)]
pub struct TestFunction {
pub module_id: ModuleId,
pub function_id: FunctionWithBodyId,
@@ -219,6 +223,7 @@ pub fn setup_test_function(
}
/// Helper struct for the return value of [setup_test_expr] and [setup_test_block].
+#[derive(Debug)]
pub struct TestExpr {
pub module_id: ModuleId,
pub function_id: FunctionWithBodyId,
diff --git a/crates/dojo-test-utils/src/rpc.rs b/crates/dojo-test-utils/src/rpc.rs
index c18a335c17..b3c84865f9 100644
--- a/crates/dojo-test-utils/src/rpc.rs
+++ b/crates/dojo-test-utils/src/rpc.rs
@@ -8,6 +8,7 @@ use serde_json::Value;
use starknet::providers::jsonrpc::{JsonRpcMethod, JsonRpcResponse, JsonRpcTransport};
use thiserror::Error;
+#[derive(Debug)]
pub struct MockJsonRpcTransport {
responses: HashMap<(String, String), String>,
}
diff --git a/crates/dojo-test-utils/src/sequencer.rs b/crates/dojo-test-utils/src/sequencer.rs
index 0e2307d5fe..d3225ac6b1 100644
--- a/crates/dojo-test-utils/src/sequencer.rs
+++ b/crates/dojo-test-utils/src/sequencer.rs
@@ -21,12 +21,14 @@ use starknet::providers::JsonRpcClient;
use starknet::signers::{LocalWallet, SigningKey};
use url::Url;
+#[derive(Debug)]
pub struct TestAccount {
pub private_key: Felt,
pub account_address: Felt,
}
#[allow(unused)]
+#[allow(missing_debug_implementations)]
pub struct TestSequencer {
url: Url,
handle: NodeHandle,
diff --git a/crates/dojo-types/src/schema.rs b/crates/dojo-types/src/schema.rs
index a9a15b5969..6556264f15 100644
--- a/crates/dojo-types/src/schema.rs
+++ b/crates/dojo-types/src/schema.rs
@@ -223,6 +223,7 @@ impl Ty {
}
}
+#[derive(Debug)]
pub struct TyIter<'a> {
stack: Vec<&'a Ty>,
}
diff --git a/crates/dojo-world/src/contracts/model.rs b/crates/dojo-world/src/contracts/model.rs
index 6c0742e848..de38198885 100644
--- a/crates/dojo-world/src/contracts/model.rs
+++ b/crates/dojo-world/src/contracts/model.rs
@@ -66,6 +66,7 @@ pub trait ModelReader {
async fn layout(&self) -> Result;
}
+#[derive(Debug)]
pub struct ModelRPCReader<'a, P: Provider + Sync + Send> {
/// Namespace of the model
namespace: String,
diff --git a/crates/dojo-world/src/utils.rs b/crates/dojo-world/src/utils.rs
index 4fd2c47800..a18798894c 100644
--- a/crates/dojo-world/src/utils.rs
+++ b/crates/dojo-world/src/utils.rs
@@ -59,6 +59,7 @@ pub enum TransactionWaitingError {
/// let receipt = TransactionWaiter::new(tx_hash, &provider).with_tx_status(TransactionFinalityStatus::AcceptedOnL2).await.unwrap();
/// ```
#[must_use = "TransactionWaiter does nothing unless polled"]
+#[allow(missing_debug_implementations)]
pub struct TransactionWaiter<'a, P: Provider> {
/// The hash of the transaction to wait for.
tx_hash: Felt,
diff --git a/crates/katana/core/src/backend/contract.rs b/crates/katana/core/src/backend/contract.rs
index 57966dc61c..1cfe9f57cf 100644
--- a/crates/katana/core/src/backend/contract.rs
+++ b/crates/katana/core/src/backend/contract.rs
@@ -1,6 +1,7 @@
use katana_primitives::class::DeprecatedCompiledClass;
use starknet::core::types::FlattenedSierraClass;
+#[derive(Debug)]
pub enum StarknetContract {
Legacy(DeprecatedCompiledClass),
Sierra(FlattenedSierraClass),
diff --git a/crates/katana/core/src/backend/mod.rs b/crates/katana/core/src/backend/mod.rs
index b1a73c08ae..11fc549021 100644
--- a/crates/katana/core/src/backend/mod.rs
+++ b/crates/katana/core/src/backend/mod.rs
@@ -31,6 +31,7 @@ use crate::utils::get_current_timestamp;
pub(crate) const LOG_TARGET: &str = "katana::core::backend";
+#[derive(Debug)]
pub struct Backend {
/// The config used to generate the backend.
pub config: StarknetConfig,
diff --git a/crates/katana/core/src/backend/storage.rs b/crates/katana/core/src/backend/storage.rs
index ad484a9f59..29060bfae6 100644
--- a/crates/katana/core/src/backend/storage.rs
+++ b/crates/katana/core/src/backend/storage.rs
@@ -34,6 +34,7 @@ pub trait Database:
+ 'static
+ Send
+ Sync
+ + core::fmt::Debug
{
}
@@ -54,9 +55,11 @@ impl Database for T where
+ 'static
+ Send
+ Sync
+ + core::fmt::Debug
{
}
+#[derive(Debug)]
pub struct Blockchain {
inner: BlockchainProvider>,
}
diff --git a/crates/katana/core/src/sequencer.rs b/crates/katana/core/src/sequencer.rs
index 0a0db8678d..5c71f865c3 100644
--- a/crates/katana/core/src/sequencer.rs
+++ b/crates/katana/core/src/sequencer.rs
@@ -47,6 +47,7 @@ pub struct SequencerConfig {
pub messaging: Option,
}
+#[allow(missing_debug_implementations)]
pub struct KatanaSequencer {
pub config: SequencerConfig,
pub pool: Arc,
diff --git a/crates/katana/core/src/service/block_producer.rs b/crates/katana/core/src/service/block_producer.rs
index 4205290389..9d3548be4e 100644
--- a/crates/katana/core/src/service/block_producer.rs
+++ b/crates/katana/core/src/service/block_producer.rs
@@ -68,6 +68,7 @@ type BlockProductionWithTxnsFuture =
/// The type which responsible for block production.
#[must_use = "BlockProducer does nothing unless polled"]
+#[allow(missing_debug_implementations)]
pub struct BlockProducer {
/// The inner mode of mining.
pub inner: RwLock>,
@@ -149,12 +150,14 @@ impl BlockProducer {
/// block producer will execute all the transactions in the mempool and mine a new block with the
/// resulting state. The block context is only updated every time a new block is mined as opposed to
/// updating it when the block is opened (in _interval_ mode).
+
+#[allow(missing_debug_implementations)]
pub enum BlockProducerMode {
Interval(IntervalBlockProducer),
Instant(InstantBlockProducer),
}
-#[derive(Clone, derive_more::Deref)]
+#[derive(Debug, Clone, derive_more::Deref)]
pub struct PendingExecutor(#[deref] Arc>>>);
impl PendingExecutor {
@@ -163,6 +166,7 @@ impl PendingExecutor {
}
}
+#[allow(missing_debug_implementations)]
pub struct IntervalBlockProducer {
/// The interval at which new blocks are mined.
interval: Option,
@@ -442,6 +446,7 @@ impl Stream for IntervalBlockProducer {
}
}
+#[allow(missing_debug_implementations)]
pub struct InstantBlockProducer {
/// Holds the backend if no block is being mined
backend: Arc>,
diff --git a/crates/katana/core/src/service/messaging/ethereum.rs b/crates/katana/core/src/service/messaging/ethereum.rs
index 90267b8a77..3977ab9e47 100644
--- a/crates/katana/core/src/service/messaging/ethereum.rs
+++ b/crates/katana/core/src/service/messaging/ethereum.rs
@@ -45,6 +45,7 @@ sol! {
}
}
+#[derive(Debug)]
pub struct EthereumMessaging {
provider: Arc>,
messaging_contract_address: Address,
diff --git a/crates/katana/core/src/service/messaging/mod.rs b/crates/katana/core/src/service/messaging/mod.rs
index f07b353e8c..7c40028b9b 100644
--- a/crates/katana/core/src/service/messaging/mod.rs
+++ b/crates/katana/core/src/service/messaging/mod.rs
@@ -162,6 +162,7 @@ pub trait Messenger {
) -> MessengerResult>;
}
+#[derive(Debug)]
pub enum MessengerMode {
Ethereum(EthereumMessaging),
#[cfg(feature = "starknet-messaging")]
diff --git a/crates/katana/core/src/service/messaging/service.rs b/crates/katana/core/src/service/messaging/service.rs
index a4a6810c29..3f14983bf4 100644
--- a/crates/katana/core/src/service/messaging/service.rs
+++ b/crates/katana/core/src/service/messaging/service.rs
@@ -21,6 +21,7 @@ type MessagingFuture = Pin + Send>>;
type MessageGatheringFuture = MessagingFuture>;
type MessageSettlingFuture = MessagingFuture>>;
+#[allow(missing_debug_implementations)]
pub struct MessagingService {
/// The interval at which the service will perform the messaging operations.
interval: Interval,
@@ -151,6 +152,7 @@ impl MessagingService {
}
}
+#[derive(Debug)]
pub enum MessagingOutcome {
Gather {
/// The latest block number of the settlement chain from which messages were gathered.
diff --git a/crates/katana/core/src/service/messaging/starknet.rs b/crates/katana/core/src/service/messaging/starknet.rs
index fc5d9083ce..d99406058b 100644
--- a/crates/katana/core/src/service/messaging/starknet.rs
+++ b/crates/katana/core/src/service/messaging/starknet.rs
@@ -29,6 +29,7 @@ const EXE_MAGIC: Felt = felt!("0x455845");
pub const HASH_EXEC: Felt = felt!("0xee");
+#[derive(Debug)]
pub struct StarknetMessaging {
chain_id: Felt,
provider: AnyProvider,
diff --git a/crates/katana/core/src/service/metrics.rs b/crates/katana/core/src/service/metrics.rs
index 3749ab8c03..e773a1630f 100644
--- a/crates/katana/core/src/service/metrics.rs
+++ b/crates/katana/core/src/service/metrics.rs
@@ -1,6 +1,7 @@
use dojo_metrics::Metrics;
use metrics::Counter;
+#[derive(Debug)]
pub(crate) struct ServiceMetrics {
pub(crate) block_producer: BlockProducerMetrics,
}
diff --git a/crates/katana/core/src/service/mod.rs b/crates/katana/core/src/service/mod.rs
index 01456be34b..694b305250 100644
--- a/crates/katana/core/src/service/mod.rs
+++ b/crates/katana/core/src/service/mod.rs
@@ -31,6 +31,7 @@ pub(crate) const LOG_TARGET: &str = "node";
/// This service is basically an endless future that continuously polls the miner which returns
/// transactions for the next block, then those transactions are handed off to the [BlockProducer]
/// to construct a new block.
+#[allow(missing_debug_implementations)]
pub struct NodeService {
/// the pool that holds all transactions
pub(crate) pool: Arc,
@@ -120,6 +121,7 @@ impl Future for NodeService {
}
/// The type which takes the transaction from the pool and feeds them to the block producer.
+#[derive(Debug)]
pub struct TransactionMiner {
/// stores whether there are pending transacions (if known)
has_pending_txs: Option,
diff --git a/crates/katana/executor/src/abstraction/executor.rs b/crates/katana/executor/src/abstraction/executor.rs
index 7f2e6957c9..7395c03882 100644
--- a/crates/katana/executor/src/abstraction/executor.rs
+++ b/crates/katana/executor/src/abstraction/executor.rs
@@ -11,7 +11,7 @@ use crate::{
};
/// A type that can create [BlockExecutor] instance.
-pub trait ExecutorFactory: Send + Sync + 'static {
+pub trait ExecutorFactory: Send + Sync + 'static + core::fmt::Debug {
/// Construct a new [BlockExecutor] with the given state.
fn with_state<'a, P>(&self, state: P) -> Box + 'a>
where
@@ -31,7 +31,7 @@ pub trait ExecutorFactory: Send + Sync + 'static {
}
/// An executor that can execute a block of transactions.
-pub trait BlockExecutor<'a>: ExecutorExt + Send + Sync {
+pub trait BlockExecutor<'a>: ExecutorExt + Send + Sync + core::fmt::Debug {
/// Executes the given block.
fn execute_block(&mut self, block: ExecutableBlock) -> ExecutorResult<()>;
diff --git a/crates/katana/executor/src/abstraction/mod.rs b/crates/katana/executor/src/abstraction/mod.rs
index ae57d8ceb6..0dcf0e9b50 100644
--- a/crates/katana/executor/src/abstraction/mod.rs
+++ b/crates/katana/executor/src/abstraction/mod.rs
@@ -148,6 +148,7 @@ pub struct ResultAndStates {
/// A wrapper around a boxed [StateProvider] for implementing the executor's own state reader
/// traits.
+#[derive(Debug)]
pub struct StateProviderDb<'a>(pub(crate) Box);
impl From> for StateProviderDb<'_> {
diff --git a/crates/katana/executor/src/implementation/blockifier/mod.rs b/crates/katana/executor/src/implementation/blockifier/mod.rs
index 94a344aab8..26de78046b 100644
--- a/crates/katana/executor/src/implementation/blockifier/mod.rs
+++ b/crates/katana/executor/src/implementation/blockifier/mod.rs
@@ -71,6 +71,7 @@ impl ExecutorFactory for BlockifierFactory {
}
}
+#[derive(Debug)]
pub struct StarknetVMProcessor<'a> {
block_context: BlockContext,
state: CachedState>,
diff --git a/crates/katana/executor/src/implementation/blockifier/state.rs b/crates/katana/executor/src/implementation/blockifier/state.rs
index 49d4b17462..2409a9f0cb 100644
--- a/crates/katana/executor/src/implementation/blockifier/state.rs
+++ b/crates/katana/executor/src/implementation/blockifier/state.rs
@@ -89,6 +89,7 @@ impl<'a> StateReader for StateProviderDb<'a> {
}
}
+#[derive(Debug)]
pub(super) struct CachedState(pub(super) Arc>>);
impl Clone for CachedState {
diff --git a/crates/katana/executor/src/implementation/noop.rs b/crates/katana/executor/src/implementation/noop.rs
index 3e6931b0ac..d9f1e205e0 100644
--- a/crates/katana/executor/src/implementation/noop.rs
+++ b/crates/katana/executor/src/implementation/noop.rs
@@ -118,6 +118,7 @@ impl<'a> BlockExecutor<'a> for NoopExecutor {
}
}
+#[derive(Debug)]
struct NoopStateProvider;
impl ContractClassProvider for NoopStateProvider {
diff --git a/crates/katana/executor/src/implementation/sir/mod.rs b/crates/katana/executor/src/implementation/sir/mod.rs
index 136e288703..6a687346dc 100644
--- a/crates/katana/executor/src/implementation/sir/mod.rs
+++ b/crates/katana/executor/src/implementation/sir/mod.rs
@@ -66,6 +66,7 @@ impl ExecutorFactory for NativeExecutorFactory {
}
}
+#[derive(Debug)]
pub struct StarknetVMProcessor<'a> {
block_context: BlockContext,
state: CachedState, PermanentContractClassCache>,
diff --git a/crates/katana/primitives/src/genesis/allocation.rs b/crates/katana/primitives/src/genesis/allocation.rs
index c267fee0fe..32f69c1e57 100644
--- a/crates/katana/primitives/src/genesis/allocation.rs
+++ b/crates/katana/primitives/src/genesis/allocation.rs
@@ -224,6 +224,7 @@ impl From for GenesisAllocation {
/// A helper type for allocating dev accounts in the genesis block.
#[must_use]
+#[derive(Debug)]
pub struct DevAllocationsGenerator {
total: u16,
seed: [u8; 32],
diff --git a/crates/katana/primitives/src/transaction.rs b/crates/katana/primitives/src/transaction.rs
index e4a4d0537d..fbbd754170 100644
--- a/crates/katana/primitives/src/transaction.rs
+++ b/crates/katana/primitives/src/transaction.rs
@@ -26,6 +26,7 @@ pub enum Tx {
DeployAccount(DeployAccountTx),
}
+#[derive(Debug)]
pub enum TxRef<'a> {
Invoke(&'a InvokeTx),
Declare(&'a DeclareTx),
diff --git a/crates/katana/rpc/rpc-types-builder/src/block.rs b/crates/katana/rpc/rpc-types-builder/src/block.rs
index 537da569d0..53638b1efa 100644
--- a/crates/katana/rpc/rpc-types-builder/src/block.rs
+++ b/crates/katana/rpc/rpc-types-builder/src/block.rs
@@ -5,6 +5,7 @@ use katana_provider::ProviderResult;
use katana_rpc_types::block::{BlockWithReceipts, BlockWithTxHashes, BlockWithTxs};
/// A builder for building RPC block types.
+#[derive(Debug)]
pub struct BlockBuilder
{
provider: P,
block_id: BlockHashOrNumber,
diff --git a/crates/katana/rpc/rpc-types-builder/src/receipt.rs b/crates/katana/rpc/rpc-types-builder/src/receipt.rs
index d46e85c389..05d220787b 100644
--- a/crates/katana/rpc/rpc-types-builder/src/receipt.rs
+++ b/crates/katana/rpc/rpc-types-builder/src/receipt.rs
@@ -5,6 +5,7 @@ use katana_provider::traits::transaction::{
use katana_rpc_types::receipt::{ReceiptBlock, TxReceiptWithBlockInfo};
/// A builder for building RPC transaction receipt types.
+#[derive(Debug)]
pub struct ReceiptBuilder
{
provider: P,
transaction_hash: TxHash,
diff --git a/crates/katana/rpc/rpc-types-builder/src/state_update.rs b/crates/katana/rpc/rpc-types-builder/src/state_update.rs
index 6b82b0748a..9f0fa78d0c 100644
--- a/crates/katana/rpc/rpc-types-builder/src/state_update.rs
+++ b/crates/katana/rpc/rpc-types-builder/src/state_update.rs
@@ -7,6 +7,7 @@ use katana_provider::ProviderResult;
use katana_rpc_types::state_update::{StateDiff, StateUpdate};
/// A builder for building RPC state update type.
+#[derive(Debug)]
pub struct StateUpdateBuilder
{
provider: P,
block_id: BlockHashOrNumber,
diff --git a/crates/katana/rpc/rpc-types/src/trace.rs b/crates/katana/rpc/rpc-types/src/trace.rs
index 938ca9485a..f071eb5f89 100644
--- a/crates/katana/rpc/rpc-types/src/trace.rs
+++ b/crates/katana/rpc/rpc-types/src/trace.rs
@@ -5,6 +5,7 @@ use starknet::core::types::{
CallType, ComputationResources, EntryPointType, OrderedEvent, OrderedMessage,
};
+#[derive(Debug)]
pub struct FunctionInvocation(pub starknet::core::types::FunctionInvocation);
impl From for FunctionInvocation {
diff --git a/crates/katana/rpc/rpc/src/dev.rs b/crates/katana/rpc/rpc/src/dev.rs
index e90290c1c5..db7a189984 100644
--- a/crates/katana/rpc/rpc/src/dev.rs
+++ b/crates/katana/rpc/rpc/src/dev.rs
@@ -7,6 +7,7 @@ use katana_primitives::FieldElement;
use katana_rpc_api::dev::DevApiServer;
use katana_rpc_types::error::katana::KatanaApiError;
+#[allow(missing_debug_implementations)]
pub struct DevApi {
sequencer: Arc>,
}
diff --git a/crates/katana/rpc/rpc/src/katana.rs b/crates/katana/rpc/rpc/src/katana.rs
index 46e5f61c68..fdd01ec2fc 100644
--- a/crates/katana/rpc/rpc/src/katana.rs
+++ b/crates/katana/rpc/rpc/src/katana.rs
@@ -6,6 +6,7 @@ use katana_executor::ExecutorFactory;
use katana_rpc_api::katana::KatanaApiServer;
use katana_rpc_types::account::Account;
+#[allow(missing_debug_implementations)]
pub struct KatanaApi {
sequencer: Arc>,
}
diff --git a/crates/katana/rpc/rpc/src/saya.rs b/crates/katana/rpc/rpc/src/saya.rs
index 317b128056..b6e6f7da5b 100644
--- a/crates/katana/rpc/rpc/src/saya.rs
+++ b/crates/katana/rpc/rpc/src/saya.rs
@@ -12,6 +12,7 @@ use katana_rpc_types::error::saya::SayaApiError;
use katana_rpc_types::trace::TxExecutionInfo;
use katana_tasks::TokioTaskSpawner;
+#[allow(missing_debug_implementations)]
pub struct SayaApi {
sequencer: Arc>,
}
diff --git a/crates/katana/rpc/rpc/src/starknet.rs b/crates/katana/rpc/rpc/src/starknet.rs
index f1e616ee58..19b5515c52 100644
--- a/crates/katana/rpc/rpc/src/starknet.rs
+++ b/crates/katana/rpc/rpc/src/starknet.rs
@@ -43,6 +43,7 @@ use starknet::core::types::{
TransactionExecutionStatus, TransactionStatus, TransactionTrace,
};
+#[allow(missing_debug_implementations)]
pub struct StarknetApi {
inner: Arc>,
}
diff --git a/crates/katana/rpc/rpc/src/torii.rs b/crates/katana/rpc/rpc/src/torii.rs
index ec2b8ff821..60a957fe37 100644
--- a/crates/katana/rpc/rpc/src/torii.rs
+++ b/crates/katana/rpc/rpc/src/torii.rs
@@ -16,6 +16,7 @@ use katana_tasks::TokioTaskSpawner;
const MAX_PAGE_SIZE: usize = 100;
+#[allow(missing_debug_implementations)]
pub struct ToriiApi {
sequencer: Arc>,
}
diff --git a/crates/katana/runner/src/logs.rs b/crates/katana/runner/src/logs.rs
index 29d70da32e..cdaa7a7ebe 100644
--- a/crates/katana/runner/src/logs.rs
+++ b/crates/katana/runner/src/logs.rs
@@ -8,7 +8,7 @@ use tokio::time::sleep;
use crate::KatanaRunner;
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, Debug)]
pub struct TimedLog {
timestamp: String,
level: String,
@@ -16,7 +16,7 @@ pub struct TimedLog {
target: String,
}
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, Debug)]
pub struct Message {
message: String,
}
diff --git a/crates/katana/storage/provider/src/lib.rs b/crates/katana/storage/provider/src/lib.rs
index 3f5581d94c..41750e2d90 100644
--- a/crates/katana/storage/provider/src/lib.rs
+++ b/crates/katana/storage/provider/src/lib.rs
@@ -38,6 +38,7 @@ pub type ProviderResult = Result;
///
/// Serves as the main entrypoint for interacting with the storage storage. Every read/write
/// operation is done through this provider.
+#[derive(Debug)]
pub struct BlockchainProvider {
provider: Db,
}
diff --git a/crates/katana/storage/provider/src/providers/db/state.rs b/crates/katana/storage/provider/src/providers/db/state.rs
index bb8f070646..d00db681b2 100644
--- a/crates/katana/storage/provider/src/providers/db/state.rs
+++ b/crates/katana/storage/provider/src/providers/db/state.rs
@@ -99,6 +99,7 @@ impl ContractClassWriter for DbProvider {
}
/// A state provider that provides the latest states from the database.
+#[derive(Debug)]
pub(super) struct LatestStateProvider(mdbx::tx::TxRO);
impl LatestStateProvider {
@@ -156,6 +157,7 @@ impl StateProvider for LatestStateProvider {
}
/// A historical state provider.
+#[derive(Debug)]
pub(super) struct HistoricalStateProvider {
/// The database transaction used to read the database.
tx: mdbx::tx::TxRO,
diff --git a/crates/katana/storage/provider/src/providers/fork/backend.rs b/crates/katana/storage/provider/src/providers/fork/backend.rs
index 5d3bfd9f6e..72756fd803 100644
--- a/crates/katana/storage/provider/src/providers/fork/backend.rs
+++ b/crates/katana/storage/provider/src/providers/fork/backend.rs
@@ -115,6 +115,7 @@ type BackendRequestFuture = BoxFuture<'static, ()>;
///
/// It is responsible for processing [requests](BackendRequest) to fetch data from the remote
/// provider.
+#[allow(missing_debug_implementations)]
pub struct Backend
{
/// The Starknet RPC provider that will be used to fetch data from.
provider: Arc
,
@@ -294,6 +295,7 @@ where
///
/// This is the primary interface for sending request to the backend to fetch data from the remote
/// network.
+#[derive(Debug)]
pub struct BackendHandle(Mutex>);
impl Clone for BackendHandle {
@@ -371,7 +373,7 @@ impl BackendHandle {
/// Check in cache first, if not found, then fetch from the forked provider and store it in the
/// cache to avoid fetching it again. This is shared across multiple instances of
/// [`ForkedStateDb`](super::state::ForkedStateDb).
-#[derive(Clone)]
+#[derive(Clone, Debug)]
pub struct SharedStateProvider(pub(crate) Arc>);
impl SharedStateProvider {
diff --git a/crates/katana/storage/provider/src/providers/fork/mod.rs b/crates/katana/storage/provider/src/providers/fork/mod.rs
index 0e55e1b99d..114857d4c6 100644
--- a/crates/katana/storage/provider/src/providers/fork/mod.rs
+++ b/crates/katana/storage/provider/src/providers/fork/mod.rs
@@ -38,6 +38,7 @@ use crate::traits::transaction::{
};
use crate::ProviderResult;
+#[derive(Debug)]
pub struct ForkedProvider {
// TODO: insert `ForkedBackend` into `CacheDb`
storage: RwLock>,
diff --git a/crates/katana/storage/provider/src/providers/fork/state.rs b/crates/katana/storage/provider/src/providers/fork/state.rs
index 83e099c28e..d2de6e065f 100644
--- a/crates/katana/storage/provider/src/providers/fork/state.rs
+++ b/crates/katana/storage/provider/src/providers/fork/state.rs
@@ -102,6 +102,7 @@ impl ContractClassProvider for CacheStateDb {
}
}
+#[derive(Debug)]
pub(super) struct LatestStateProvider(pub(super) Arc);
impl StateProvider for LatestStateProvider {
diff --git a/crates/katana/storage/provider/src/providers/in_memory/cache.rs b/crates/katana/storage/provider/src/providers/in_memory/cache.rs
index 6bd193b08c..d5b1df7685 100644
--- a/crates/katana/storage/provider/src/providers/in_memory/cache.rs
+++ b/crates/katana/storage/provider/src/providers/in_memory/cache.rs
@@ -18,12 +18,13 @@ type SierraClassesMap = HashMap;
type CompiledClassesMap = HashMap;
type CompiledClassHashesMap = HashMap;
-#[derive(Default)]
+#[derive(Default, Debug)]
pub struct SharedContractClasses {
pub(crate) sierra_classes: RwLock,
pub(crate) compiled_classes: RwLock,
}
+#[derive(Debug)]
pub struct CacheSnapshotWithoutClasses {
pub(crate) db: Db,
pub(crate) storage: ContractStorageMap,
@@ -31,6 +32,7 @@ pub struct CacheSnapshotWithoutClasses {
pub(crate) compiled_class_hashes: CompiledClassHashesMap,
}
+#[derive(Debug)]
pub struct CacheStateDb {
pub(crate) db: Db,
pub(crate) storage: RwLock,
@@ -69,6 +71,7 @@ impl CacheStateDb {
}
}
+#[derive(Debug)]
pub struct CacheDb {
pub(crate) db: Db,
pub(crate) block_headers: HashMap,
diff --git a/crates/katana/storage/provider/src/providers/in_memory/mod.rs b/crates/katana/storage/provider/src/providers/in_memory/mod.rs
index f59d0ec94a..6a27bad218 100644
--- a/crates/katana/storage/provider/src/providers/in_memory/mod.rs
+++ b/crates/katana/storage/provider/src/providers/in_memory/mod.rs
@@ -34,6 +34,7 @@ use crate::traits::transaction::{
};
use crate::ProviderResult;
+#[derive(Debug)]
pub struct InMemoryProvider {
storage: RwLock>,
state: Arc,
diff --git a/crates/katana/storage/provider/src/providers/in_memory/state.rs b/crates/katana/storage/provider/src/providers/in_memory/state.rs
index c50c254f2d..8a7adf7b2f 100644
--- a/crates/katana/storage/provider/src/providers/in_memory/state.rs
+++ b/crates/katana/storage/provider/src/providers/in_memory/state.rs
@@ -10,6 +10,7 @@ use crate::traits::contract::ContractClassProvider;
use crate::traits::state::StateProvider;
use crate::ProviderResult;
+#[derive(Debug)]
pub struct StateSnapshot {
// because the classes are shared between snapshots, when trying to fetch check the compiled
// hash first and then the sierra class to ensure the class should be present in the snapshot.
@@ -23,6 +24,7 @@ const MIN_HISTORY_LIMIT: usize = 10;
/// Represents the complete state of a single block.
///
/// It should store at N - 1 states, where N is the latest block number.
+#[derive(Debug)]
pub struct HistoricalStates {
/// The states at a certain block based on the block number
states: HashMap>,
@@ -165,6 +167,7 @@ impl ContractClassProvider for InMemorySnapshot {
}
}
+#[derive(Debug)]
pub(super) struct LatestStateProvider(pub(super) Arc);
impl StateProvider for LatestStateProvider {
diff --git a/crates/katana/storage/provider/src/traits/state.rs b/crates/katana/storage/provider/src/traits/state.rs
index 3ec9aade09..3c80891aac 100644
--- a/crates/katana/storage/provider/src/traits/state.rs
+++ b/crates/katana/storage/provider/src/traits/state.rs
@@ -13,7 +13,7 @@ pub trait StateRootProvider: Send + Sync {
}
#[auto_impl::auto_impl(&, Box, Arc)]
-pub trait StateProvider: ContractClassProvider + Send + Sync {
+pub trait StateProvider: ContractClassProvider + Send + Sync + std::fmt::Debug {
/// Returns the nonce of a contract.
fn nonce(&self, address: ContractAddress) -> ProviderResult