Skip to content

Commit fad6345

Browse files
committed
wip
1 parent 971916f commit fad6345

File tree

7 files changed

+30
-27
lines changed

7 files changed

+30
-27
lines changed

Cargo.lock

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

crates/gateway/gateway-server/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ version.workspace = true
88
[dependencies]
99
katana-gateway-types.workspace = true
1010
katana-primitives.workspace = true
11+
katana-executor.workspace = true
12+
katana-core.workspace = true
1113
katana-metrics.workspace = true
1214
katana-pool.workspace = true
1315
katana-rpc.workspace = true

crates/gateway/gateway-server/src/handlers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use axum::extract::{Query, State};
22
use axum::http::StatusCode;
33
use axum::response::{IntoResponse, Json, Response};
44
use katana_core::service::block_producer::BlockProducer;
5+
use katana_executor::implementation::blockifier::BlockifierFactory;
56
use katana_gateway_types::{
67
Block, ConfirmedReceipt, ConfirmedTransaction, ContractClass, ErrorCode, GatewayError,
78
ReceiptBody, StateUpdate, StateUpdateWithBlock,

crates/gateway/gateway-server/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::time::Duration;
55
use axum::routing::get;
66
use axum::Router;
77
use katana_core::service::block_producer::BlockProducer;
8+
use katana_executor::implementation::blockifier::BlockifierFactory;
89
use katana_pool_api::TransactionPool;
910
use katana_rpc::cors::Cors;
1011
use katana_rpc::starknet::StarknetApi;

crates/node/src/full/pending/provider.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ use katana_rpc_types::RpcTxWithHash;
88

99
use crate::full::pending::PreconfStateFactory;
1010

11-
impl<P: StateFactoryProvider + Debug> PendingBlockProvider for PreconfStateFactory<P> {
11+
impl<P> PendingBlockProvider for PreconfStateFactory<P>
12+
where
13+
P: StateFactoryProvider + Debug + 'static,
14+
{
1215
fn get_pending_block_with_txs(
1316
&self,
1417
) -> StarknetApiResult<Option<katana_rpc_types::PreConfirmedBlockWithTxs>> {
@@ -114,4 +117,11 @@ impl<P: StateFactoryProvider + Debug> PendingBlockProvider for PreconfStateFacto
114117
fn pending_state(&self) -> StarknetApiResult<Option<Box<dyn StateProvider>>> {
115118
Ok(Some(Box::new(self.state())))
116119
}
120+
121+
fn get_pending_trace(
122+
&self,
123+
hash: TxHash,
124+
) -> StarknetApiResult<Option<katana_rpc_types::TxTrace>> {
125+
Ok(None)
126+
}
117127
}

crates/rpc/rpc/src/starknet/mod.rs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,7 @@ where
567567
{
568568
Result::<_, StarknetApiError>::Ok(pending_tx)
569569
} else {
570-
let tx = this
571-
.inner
572-
.backend
573-
.blockchain
574-
.provider()
575-
.transaction_by_hash(hash)?
576-
.map(RpcTxWithHash::from);
577-
570+
let tx = this.inner.storage.transaction_by_hash(hash)?.map(RpcTxWithHash::from);
578571
Result::<_, StarknetApiError>::Ok(tx)
579572
}
580573
})
@@ -597,7 +590,7 @@ where
597590
{
598591
StarknetApiResult::Ok(pending_receipt)
599592
} else {
600-
let provider = this.inner.backend.blockchain.provider();
593+
let provider = &this.inner.storage;
601594
StarknetApiResult::Ok(ReceiptBuilder::new(hash, provider).build()?)
602595
}
603596
})
@@ -685,11 +678,9 @@ where
685678
.build()?
686679
.map(MaybePreConfirmedBlock::Confirmed);
687680

688-
StarknetApiResult::Ok(block)
689-
} else {
690-
StarknetApiResult::Ok(None)
691-
}
692-
}
681+
StarknetApiResult::Ok(block)
682+
} else {
683+
StarknetApiResult::Ok(None)
693684
}
694685
})
695686
.await??;
@@ -724,11 +715,9 @@ where
724715
.build_with_receipts()?
725716
.map(GetBlockWithReceiptsResponse::Block);
726717

727-
StarknetApiResult::Ok(block)
728-
} else {
729-
StarknetApiResult::Ok(None)
730-
}
731-
}
718+
StarknetApiResult::Ok(block)
719+
} else {
720+
StarknetApiResult::Ok(None)
732721
}
733722
})
734723
.await??;
@@ -763,11 +752,9 @@ where
763752
.build_with_tx_hash()?
764753
.map(GetBlockWithTxHashesResponse::Block);
765754

766-
StarknetApiResult::Ok(block)
767-
} else {
768-
StarknetApiResult::Ok(None)
769-
}
770-
}
755+
StarknetApiResult::Ok(block)
756+
} else {
757+
StarknetApiResult::Ok(None)
771758
}
772759
})
773760
.await??;

crates/rpc/rpc/src/starknet/trace.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ where
135135
Ok(pending_trace)
136136
} else {
137137
// If not found in pending block, fallback to the provider
138-
let provider = self.inner.backend.blockchain.provider();
139-
let trace = provider.transaction_execution(tx_hash)?.ok_or(TxnHashNotFound)?;
138+
let trace =
139+
self.inner.storage.transaction_execution(tx_hash)?.ok_or(TxnHashNotFound)?;
140140
Ok(TxTrace::from(trace))
141141
}
142142
}

0 commit comments

Comments
 (0)