Skip to content

Commit 2b91778

Browse files
authored
Support RPC 0.9.0 (#3547)
<!-- Reference any GitHub issues resolved by this PR --> Closes #3515
1 parent 0bab717 commit 2b91778

File tree

35 files changed

+144
-109
lines changed

35 files changed

+144
-109
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
scarb 2.12.0 2.10.1
2-
starknet-devnet 0.4.3
2+
starknet-devnet 0.5.0

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

2121
- `--test-files` flag to `verify` command to include test files under src/ for verification (only applies to voyager)
2222

23+
### Cast
24+
25+
#### Changed
26+
27+
- The supported RPC version is now 0.9.0
28+
2329
## [0.48.1] - 2025-08-14
2430

2531
### Forge

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ rayon = "1.10"
6464
regex = "1.11.1"
6565
serde = { version = "1.0.219", features = ["derive"] }
6666
serde_json = "1.0.140"
67-
starknet = { git = "https://github.com/xJonathanLEI/starknet-rs", rev = "a70f4ce" }
67+
starknet = "0.17.0-rc.3"
6868
starknet-crypto = { git = "https://github.com/xJonathanLEI/starknet-rs", rev = "a70f4ce" }
6969
tempfile = "3.20.0"
7070
thiserror = "2.0.12"

crates/cheatnet/src/forking/state.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use flate2::read::GzDecoder;
1515
use num_bigint::BigUint;
1616
use runtime::starknet::context::SerializableGasPrices;
1717
use starknet::core::types::{
18-
ContractClass as ContractClassStarknet, MaybePendingBlockWithTxHashes, StarknetError,
18+
ContractClass as ContractClassStarknet, MaybePreConfirmedBlockWithTxHashes, StarknetError,
1919
};
2020
use starknet::core::utils::parse_cairo_short_string;
2121
use starknet::providers::ProviderError;
@@ -83,7 +83,7 @@ impl BlockInfoReader for ForkStateReader {
8383
}
8484

8585
match self.client.get_block_with_tx_hashes() {
86-
Ok(MaybePendingBlockWithTxHashes::Block(block)) => {
86+
Ok(MaybePreConfirmedBlockWithTxHashes::Block(block)) => {
8787
let block_info = BlockInfo {
8888
block_number: BlockNumber(block.block_number),
8989
sequencer_address: block.sequencer_address.into_(),
@@ -98,8 +98,8 @@ impl BlockInfoReader for ForkStateReader {
9898

9999
Ok(block_info)
100100
}
101-
Ok(MaybePendingBlockWithTxHashes::PendingBlock(_)) => {
102-
unreachable!("Pending block is not be allowed at the configuration level")
101+
Ok(MaybePreConfirmedBlockWithTxHashes::PreConfirmedBlock(_)) => {
102+
unreachable!("Preconfirmed block is not be allowed at the configuration level")
103103
}
104104
Err(ProviderError::Other(boxed)) => other_provider_error(boxed),
105105
Err(err) => Err(StateReadError(format!(

crates/cheatnet/src/sync_client.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use starknet::core::types::{BlockId, ContractClass, MaybePendingBlockWithTxHashes};
1+
use starknet::core::types::{BlockId, ContractClass, MaybePreConfirmedBlockWithTxHashes};
22
use starknet::providers::jsonrpc::HttpTransport;
33
use starknet::providers::{JsonRpcClient, Provider, ProviderError};
44
use starknet_api::block::BlockNumber;
@@ -27,7 +27,9 @@ impl SyncClient {
2727
self.sync(self.client.chain_id())
2828
}
2929

30-
pub fn get_block_with_tx_hashes(&self) -> Result<MaybePendingBlockWithTxHashes, ProviderError> {
30+
pub fn get_block_with_tx_hashes(
31+
&self,
32+
) -> Result<MaybePreConfirmedBlockWithTxHashes, ProviderError> {
3133
self.sync(self.client.get_block_with_tx_hashes(self.block_id))
3234
}
3335

crates/data-transformer/tests/integration/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static CLASS: OnceCell<ContractClass> = OnceCell::const_new();
2222

2323
async fn init_class(class_hash: Felt) -> ContractClass {
2424
let client = JsonRpcClient::new(HttpTransport::new(
25-
Url::parse("http://188.34.188.184:7070/rpc/v0_8").unwrap(),
25+
Url::parse("http://188.34.188.184:7070/rpc/v0_9").unwrap(),
2626
));
2727

2828
client

crates/forge/src/block_number_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use anyhow::{Result, anyhow};
22
use conversions::{IntoConv, string::IntoHexStr};
33
use starknet::{
4-
core::types::{BlockId, MaybePendingBlockWithTxHashes},
4+
core::types::{BlockId, MaybePreConfirmedBlockWithTxHashes},
55
providers::{JsonRpcClient, Provider, jsonrpc::HttpTransport},
66
};
77
use starknet_api::block::BlockNumber;
@@ -73,7 +73,7 @@ async fn fetch_block_number_for_hash(url: Url, block_hash: Felt) -> Result<Block
7373
.spawn(async move { client.get_block_with_tx_hashes(hash).await })
7474
.await?
7575
{
76-
Ok(MaybePendingBlockWithTxHashes::Block(block)) => Ok(BlockNumber(block.block_number)),
76+
Ok(MaybePreConfirmedBlockWithTxHashes::Block(block)) => Ok(BlockNumber(block.block_number)),
7777
_ => Err(anyhow!(
7878
"Could not get the block number for block with hash 0x{}",
7979
block_hash.into_hex_string()

crates/forge/src/scarb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ mod tests {
406406
[[tool.snforge.fork]]
407407
name = "SAME_NAME"
408408
url = "http://some.rpc.url"
409-
block_id.tag = "Pending"
409+
block_id.tag = "Preconfirmed"
410410
"#
411411
);
412412
temp.child("Scarb.toml").write_str(content).unwrap();

0 commit comments

Comments
 (0)