Skip to content

Commit cee0bd9

Browse files
authored
Support for rpc v0.10.0-rc.1 (#3936)
<!-- Reference any GitHub issues resolved by this PR --> Closes #3903 #3734 ## Introduced changes <!-- A brief description of the changes --> - Add support for rpc `v0.10.0-rc.1` ## Checklist <!-- Make sure all of these are complete --> - [x] Linked relevant issue - [ ] Updated relevant documentation - [ ] Added relevant tests - [x] Performed self-review of the code - [x] Added changes to `CHANGELOG.md`
1 parent 940bbc3 commit cee0bd9

File tree

17 files changed

+139
-35
lines changed

17 files changed

+139
-35
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ jobs:
151151
with:
152152
name: nextest-archive-${{ runner.os }}
153153
- name: nextest partition ${{ matrix.partition }}/3
154+
# TODO(#3937): remove env override once new RPC URL is available in tests.
155+
env:
156+
SNCAST_IGNORE_RPC_0_9_CHECK: "1"
154157
run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}.tar.zst' e2e
155158

156159
test-forge-e2e-native:
@@ -199,6 +202,9 @@ jobs:
199202
with:
200203
name: nextest-archive-${{ runner.os }}-native
201204
- name: nextest partition ${{ matrix.partition }}/3
205+
# TODO(#3937): remove env override once new RPC URL is available in tests.
206+
env:
207+
SNCAST_IGNORE_RPC_0_9_CHECK: "1"
202208
run: cargo nextest run --no-fail-fast --partition 'count:${{ matrix.partition }}/3' --archive-file 'nextest-archive-${{ runner.os }}-native.tar.zst' e2e
203209

204210
test-plugin-checks:
@@ -284,6 +290,9 @@ jobs:
284290
- uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
285291
- uses: ./.github/actions/setup-tools
286292
- name: Run tests
293+
# TODO(#3937): remove env override once new RPC URL is available in tests.
294+
env:
295+
SNCAST_IGNORE_RPC_0_9_CHECK: "1"
287296
run: cargo test --profile ci -p sncast
288297

289298
test-conversions:

.github/workflows/scheduled.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ jobs:
9797
curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh
9898
9999
- run: cargo test --profile ci -p forge --features skip_test_for_only_latest_scarb,skip_test_for_scarb_since_2_11 e2e
100+
# TODO(#3937): remove env override once new RPC URL is available in tests.
101+
env:
102+
SNCAST_IGNORE_RPC_0_9_CHECK: "1"
100103

101104
test-cast:
102105
if: github.event.repository.fork == false
@@ -127,6 +130,9 @@ jobs:
127130
starknet-devnet ${{ steps.get-devnet-version.outputs.version }}
128131
129132
- run: cargo test --profile ci -p sncast
133+
# TODO(#3937): remove env override once new RPC URL is available in tests.
134+
env:
135+
SNCAST_IGNORE_RPC_0_9_CHECK: "1"
130136

131137
get-version:
132138
name: Get current foundry version

CHANGELOG.md

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

1414
- `--gas-report` flag to display a table of L2 gas breakdown for each contract and selector
1515

16+
### Cast
17+
18+
#### Changed
19+
20+
- The supported RPC version is now 0.10.0-rc.1
21+
1622
## [0.52.0] - 2025-11-05
1723

1824
### Forge

Cargo.lock

Lines changed: 85 additions & 30 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
@@ -72,7 +72,7 @@ rayon = "1.10"
7272
regex = "1.11.3"
7373
serde = { version = "1.0.219", features = ["derive"] }
7474
serde_json = "1.0.145"
75-
starknet = "0.17.0"
75+
starknet = { git = "https://github.com/software-mansion-labs/starknet-rs", rev = "6e3a394ebe9ded6c18fc56479fec9a196ff6f75e" }
7676
starknet-crypto = "0.8.1"
7777
tempfile = "3.23.0"
7878
thiserror = "2.0.17"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const NO_CONSTRUCTOR_CLASS_HASH: Felt =
2121
static CLASS: OnceCell<ContractClass> = OnceCell::const_new();
2222

2323
async fn init_class(class_hash: Felt) -> ContractClass {
24+
// TODO: (#3937) New RPC URL is not available yet
2425
let client = JsonRpcClient::new(HttpTransport::new(
2526
Url::parse("http://188.34.188.184:7070/rpc/v0_9").unwrap(),
2627
));

crates/shared/src/consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pub const EXPECTED_RPC_VERSION: &str = "0.9.0";
2-
pub const RPC_URL_VERSION: &str = "v0_9";
1+
pub const EXPECTED_RPC_VERSION: &str = "0.10.0";
2+
pub const RPC_URL_VERSION: &str = "v0_10";
33
pub const SNFORGE_TEST_FILTER: &str = "SNFORGE_TEST_FILTER";

crates/shared/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::rpc::{get_rpc_version, is_expected_version};
33
use anyhow::Result;
44
use foundry_ui::UI;
55
use foundry_ui::components::warning::WarningMessage;
6+
use semver::VersionReq;
67
use starknet::providers::JsonRpcClient;
78
use starknet::providers::jsonrpc::HttpTransport;
89
use std::fmt::Display;
@@ -22,6 +23,16 @@ pub async fn verify_and_warn_if_incompatible_rpc_version(
2223
ui: &UI,
2324
) -> Result<()> {
2425
let node_spec_version = get_rpc_version(client).await?;
26+
27+
// TODO: (#3937) New RPC URL is not available yet
28+
if std::env::var("SNCAST_IGNORE_RPC_0_9_CHECK").is_ok_and(|v| v == "1")
29+
&& VersionReq::parse("0.9.0")
30+
.expect("Failed to parse the expected RPC version")
31+
.matches(&node_spec_version)
32+
{
33+
return Ok(());
34+
}
35+
2536
if !is_expected_version(&node_spec_version) {
2637
ui.println(&WarningMessage::new(&format!(
2738
"RPC node with the url {url} uses incompatible version {node_spec_version}. Expected version: {EXPECTED_RPC_VERSION}")));

crates/shared/src/test_utils/node_url.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use url::Url;
55
/// - `node_url()` -> <https://example.com/>
66
#[must_use]
77
pub fn node_rpc_url() -> Url {
8+
// TODO: (#3937) New RPC URL is not available yet
89
Url::parse("http://188.34.188.184:7070/rpc/v0_9").expect("Failed to parse the sepolia RPC URL")
910
}
1011

crates/sncast/src/helpers/rpc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,15 @@ mod tests {
140140
use starknet::providers::Provider;
141141

142142
#[tokio::test]
143+
#[ignore = "TODO: (#3937) New RPC URL is not available yet"]
143144
async fn test_mainnet_url_happy_case() {
144145
let provider = get_provider(&Network::free_mainnet_rpc(&FreeProvider::Alchemy)).unwrap();
145146
let spec_version = provider.spec_version().await.unwrap();
146147
assert!(is_expected_version(&Version::parse(&spec_version).unwrap()));
147148
}
148149

149150
#[tokio::test]
151+
#[ignore = "TODO: (#3937) New RPC URL is not available yet"]
150152
async fn test_sepolia_url_happy_case() {
151153
let provider = get_provider(&Network::free_sepolia_rpc(&FreeProvider::Alchemy)).unwrap();
152154
let spec_version = provider.spec_version().await.unwrap();

0 commit comments

Comments
 (0)