Skip to content

Commit d01a015

Browse files
committed
feat(rpc): move from starknet to starknet-rust crate
`starknet` is now effectively deprecated, and `starknet-rust` is the new fork. This also means that we now require JSON-RPC 0.10.0, which is an incompatible change. (Requires the user to change the Starknet node URL).
1 parent 00633be commit d01a015

11 files changed

Lines changed: 107 additions & 105 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ rustls = "0.23.37"
1818
semver = "1.0.27"
1919
serde = "1.0.228"
2020
serde_json = "1.0.149"
21-
starknet = "0.17.0"
22-
starknet-crypto = "0.8.1"
23-
starknet-tokio-tungstenite = "0.3.0"
21+
starknet-rust = "0.18.0"
22+
starknet-rust-crypto = "0.9.0"
23+
starknet-rust-tokio-tungstenite = "0.4.0"
2424
thiserror = "2.0.18"
2525
tokio = { version = "1.50.0", features = ["full"] }
2626
tracing = "0.1.44"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This is a tool for attesting validators on Starknet. Implements the attestation
55

66
## Requirements
77

8-
- A Starknet node with support for the JSON-RPC 0.9.0 API specification. This tool has been tested with [Pathfinder](https://github.com/eqlabs/pathfinder) v0.20.0.
8+
- A Starknet node with support for the JSON-RPC 0.10.0 API specification. This tool has been tested with [Pathfinder](https://github.com/eqlabs/pathfinder) v0.21.5.
99
- Staking contracts set up and registered with Staking v2.
1010
- Sufficient funds in the operational account to pay for attestation transactions.
1111

@@ -22,7 +22,7 @@ docker run -it --rm --network host \
2222
-e VALIDATOR_ATTESTATION_OPERATIONAL_PRIVATE_KEY="0xdeadbeef" \
2323
ghcr.io/eqlabs/starknet-validator-attestation \
2424
--staker-operational-address 0x02e216b191ac966ba1d35cb6cfddfaf9c12aec4dfe869d9fa6233611bb334ee9 \
25-
--node-url http://localhost:9545/rpc/v0_9 \
25+
--node-url http://localhost:9545/rpc/v0_10 \
2626
--local-signer
2727
```
2828

examples/signer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use axum::{
33
routing::{get, post},
44
};
55
use serde::{Deserialize, Serialize};
6-
use starknet::core::types::{BroadcastedInvokeTransactionV3, Felt};
7-
use starknet::signers::SigningKey;
8-
use starknet_crypto::{PoseidonHasher, poseidon_hash_many};
6+
use starknet_rust::core::types::{BroadcastedInvokeTransactionV3, Felt};
7+
use starknet_rust::signers::SigningKey;
8+
use starknet_rust_crypto::{PoseidonHasher, poseidon_hash_many};
99
use std::sync::Arc;
1010
use tokio::sync::Mutex;
1111

@@ -171,14 +171,14 @@ fn transaction_hash(tx: &BroadcastedInvokeTransactionV3, chain_id: Felt) -> Felt
171171

172172
#[cfg(test)]
173173
mod tests {
174-
use starknet::core::{
174+
use starknet_rust::core::{
175175
chain_id,
176176
types::{
177177
BroadcastedInvokeTransactionV3, DataAvailabilityMode, ResourceBounds,
178178
ResourceBoundsMapping,
179179
},
180180
};
181-
use starknet::macros::felt;
181+
use starknet_rust::macros::felt;
182182

183183
use super::transaction_hash;
184184

src/attestation_info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use starknet::core::types::{Felt, NonZeroFelt};
2-
use starknet_crypto::PoseidonHasher;
1+
use starknet_rust::core::types::{Felt, NonZeroFelt};
2+
use starknet_rust_crypto::PoseidonHasher;
33

44
#[derive(Clone, Debug, PartialEq)]
55
pub struct AttestationInfo {

src/events.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::time::Duration;
22

33
use anyhow::Context;
4-
use starknet::core::{
4+
use starknet_rust::core::{
55
codec::Decode,
66
types::{EmittedEvent, Felt, ReorgData},
77
};
8-
use starknet::macros::selector;
9-
use starknet_tokio_tungstenite::{EventSubscriptionOptions, EventsUpdate, TungsteniteStream};
8+
use starknet_rust::macros::selector;
9+
use starknet_rust_tokio_tungstenite::{EventSubscriptionOptions, EventsUpdate, TungsteniteStream};
1010
use url::Url;
1111

1212
const SELECTOR_STAKER_ATTESTATION_SUCCESSFUL: Felt = selector!("StakerAttestationSuccessful");

src/headers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::time::Duration;
22

33
use anyhow::Context;
4-
use starknet::core::types::{BlockHeader, ConfirmedBlockId, ReorgData};
5-
use starknet_tokio_tungstenite::{NewHeadsUpdate, TungsteniteStream};
4+
use starknet_rust::core::types::{BlockHeader, ConfirmedBlockId, ReorgData};
5+
use starknet_rust_tokio_tungstenite::{NewHeadsUpdate, TungsteniteStream};
66
use url::Url;
77

88
pub async fn fetch(

0 commit comments

Comments
 (0)