Skip to content

Commit

Permalink
perf(katana-rpc): spawn blocking tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Jan 18, 2024
1 parent c1de18e commit d50bd68
Show file tree
Hide file tree
Showing 6 changed files with 599 additions and 352 deletions.
11 changes: 11 additions & 0 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

0 comments on commit d50bd68

Please sign in to comment.