Skip to content

Commit 461314d

Browse files
authored
Disable voyager provider in sncast (#3350)
<!-- Reference any GitHub issues resolved by this PR --> Closes # ## Introduced changes <!-- A brief description of the changes --> - Voyager provider seems to be no longer available. Disabled it so we always use Blast ## Checklist <!-- Make sure all of these are complete --> - [ ] Linked relevant issue - [ ] Updated relevant documentation - [ ] Added relevant tests - [ ] Performed self-review of the code - [ ] Added changes to `CHANGELOG.md`
1 parent 8d0bfd0 commit 461314d

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

crates/shared/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pub const EXPECTED_RPC_VERSION: &str = "0.8.1";
22
pub const RPC_URL_VERSION: &str = "v0_8";
33
pub const SNFORGE_TEST_FILTER: &str = "SNFORGE_TEST_FILTER";
4-
pub const FREE_RPC_PROVIDER_URL: &str = "https://free-rpc.nethermind.io/sepolia-juno/v0_8";
4+
pub const FREE_RPC_PROVIDER_URL: &str = "https://starknet-sepolia.public.blastapi.io/rpc/v0_8";

crates/sncast/src/helpers/rpc.rs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use clap::Args;
55
use shared::consts::RPC_URL_VERSION;
66
use shared::verify_and_warn_if_incompatible_rpc_version;
77
use starknet::providers::{JsonRpcClient, jsonrpc::HttpTransport};
8-
use std::env::current_exe;
9-
use std::time::UNIX_EPOCH;
108

119
#[derive(Args, Clone, Debug, Default)]
1210
#[group(required = false, multiple = false)]
@@ -57,27 +55,13 @@ impl RpcArgs {
5755
}
5856
}
5957

60-
fn installation_constant_seed() -> Result<u64> {
61-
let executable_path = current_exe()?;
62-
let metadata = executable_path.metadata()?;
63-
let modified_time = metadata.modified()?;
64-
let duration = modified_time.duration_since(UNIX_EPOCH)?;
65-
66-
Ok(duration.as_secs())
67-
}
68-
6958
enum FreeProvider {
7059
Blast,
71-
Voyager,
7260
}
7361

7462
impl FreeProvider {
7563
fn semi_random() -> Self {
76-
let seed = installation_constant_seed().unwrap_or(2);
77-
if seed % 2 == 0 {
78-
return Self::Blast;
79-
}
80-
Self::Voyager
64+
FreeProvider::Blast
8165
}
8266
}
8367

@@ -94,9 +78,6 @@ impl Network {
9478
FreeProvider::Blast => {
9579
format!("https://starknet-mainnet.public.blastapi.io/rpc/{RPC_URL_VERSION}")
9680
}
97-
FreeProvider::Voyager => {
98-
format!("https://free-rpc.nethermind.io/mainnet-juno/{RPC_URL_VERSION}")
99-
}
10081
}
10182
}
10283

@@ -105,9 +86,6 @@ impl Network {
10586
FreeProvider::Blast => {
10687
format!("https://starknet-sepolia.public.blastapi.io/rpc/{RPC_URL_VERSION}")
10788
}
108-
FreeProvider::Voyager => {
109-
format!("https://free-rpc.nethermind.io/sepolia-juno/{RPC_URL_VERSION}")
110-
}
11189
}
11290
}
11391
}
@@ -120,7 +98,6 @@ mod tests {
12098
use starknet::providers::Provider;
12199
use test_case::test_case;
122100

123-
#[test_case(FreeProvider::Voyager)]
124101
#[test_case(FreeProvider::Blast)]
125102
#[tokio::test]
126103
async fn test_mainnet_url_happy_case(free_provider: FreeProvider) {
@@ -129,7 +106,6 @@ mod tests {
129106
assert!(is_expected_version(&Version::parse(&spec_version).unwrap()));
130107
}
131108

132-
#[test_case(FreeProvider::Voyager)]
133109
#[test_case(FreeProvider::Blast)]
134110
#[tokio::test]
135111
async fn test_sepolia_url_happy_case(free_provider: FreeProvider) {

rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "1.86.0"
3+
components = ["rustfmt", "clippy"]

0 commit comments

Comments
 (0)