Skip to content
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

perf(katana-rpc): spawn blocking tasks #1450

Closed
wants to merge 5 commits into from
Closed
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
15 changes: 13 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions crates/katana/core/src/sequencer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ impl KatanaSequencer {
self.backend.chain_id
}

pub fn block_number(&self) -> BlockNumber {
BlockNumberProvider::latest_number(&self.backend.blockchain.provider()).unwrap()
pub fn block_number(&self) -> SequencerResult<BlockNumber> {
let num = BlockNumberProvider::latest_number(&self.backend.blockchain.provider())?;
Ok(num)
}

pub fn block_tx_count(&self, block_id: BlockIdOrTag) -> SequencerResult<Option<u64>> {
Expand Down Expand Up @@ -300,7 +301,7 @@ impl KatanaSequencer {
Ok(count)
}

pub async fn nonce_at(
pub fn nonce_at(
&self,
block_id: BlockIdOrTag,
contract_address: ContractAddress,
Expand Down Expand Up @@ -352,7 +353,7 @@ impl KatanaSequencer {
Ok(tx)
}

pub async fn events(
pub fn events(
&self,
from_block: BlockIdOrTag,
to_block: BlockIdOrTag,
Expand Down
1 change: 1 addition & 0 deletions crates/katana/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ katana-primitives = { path = "../primitives" }
katana-provider = { path = "../storage/provider" }
katana-rpc-types = { path = "rpc-types" }
katana-rpc-types-builder = { path = "rpc-types-builder" }
katana-tasks = { path = "../tasks" }

anyhow.workspace = true
cairo-lang-starknet = "2.3.1"
Expand Down
Loading
Loading