Skip to content

Commit

Permalink
Bump citrea and update rpc calls for hexornum ledger rpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
ercecan committed Dec 20, 2024
1 parent c1fd14e commit a4407ce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ tokio = { version = "1.39", features = ["full"] }
toml = "0.8.0"
tracing = { version = "0.1.40", default-features = false }
tracing-subscriber = { version = "0.3.17", features = ["env-filter", "json", "fmt"] }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "a206eb3690e5a51d3c797fed2a6ed722e36863eb", default-features = false }

# Citrea dependencies
sov-ledger-rpc = { git = "https://github.com/chainwayxyz/citrea", rev = "82bf52d", default-features = false, features = ["client"] }
sov-rollup-interface = { git = "https://github.com/chainwayxyz/citrea", rev = "82bf52d" }
sov-ledger-rpc = { git = "https://github.com/chainwayxyz/citrea", rev = "879a075590250cd26e721f31c4cedf3b28832cb0", default-features = false, features = ["client"] }
sov-rollup-interface = { git = "https://github.com/chainwayxyz/citrea", rev = "879a075590250cd26e721f31c4cedf3b28832cb0" }

[patch.crates-io]
bitcoincore-rpc = { version = "0.18.0", git = "https://github.com/chainwayxyz/rust-bitcoincore-rpc.git", rev = "ede8097" }
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.79"
channel = "1.81"
components = ["rustfmt", "rust-src", "clippy"]
profile = "minimal"
10 changes: 6 additions & 4 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use jsonrpsee::{
http_client::{HttpClient, HttpClientBuilder},
rpc_params,
};
use reth_primitives::U64;
use sov_ledger_rpc::client::RpcClient;
use sov_ledger_rpc::HexHash;
use sov_rollup_interface::rpc::{
SequencerCommitmentResponse, SoftConfirmationResponse, VerifiedProofResponse,
};
Expand Down Expand Up @@ -54,7 +56,7 @@ impl Client {

pub async fn ledger_get_verified_proofs_by_slot_height(
&self,
height: u64,
height: U64,
) -> Result<Option<Vec<VerifiedProofResponse>>> {
Ok(self
.client
Expand All @@ -64,7 +66,7 @@ impl Client {

pub async fn ledger_get_sequencer_commitments_on_slot_by_number(
&self,
height: u64,
height: U64,
) -> Result<Option<Vec<SequencerCommitmentResponse>>> {
Ok(self
.client
Expand All @@ -74,14 +76,14 @@ impl Client {

pub async fn ledger_get_soft_confirmation_by_number(
&self,
num: u64,
num: U64,
) -> Result<Option<SoftConfirmationResponse>> {
Ok(self.client.get_soft_confirmation_by_number(num).await?)
}

pub async fn ledger_get_sequencer_commitments_on_slot_by_hash(
&self,
hash: [u8; 32],
hash: HexHash,
) -> Result<Option<Vec<SequencerCommitmentResponse>>> {
self.client
.get_sequencer_commitments_on_slot_by_hash(hash)
Expand Down
5 changes: 3 additions & 2 deletions src/full_node.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use anyhow::bail;
use reth_primitives::U64;
use sov_rollup_interface::rpc::{SequencerCommitmentResponse, VerifiedProofResponse};
use tokio::time::{sleep, Duration, Instant};

Expand All @@ -23,7 +24,7 @@ impl FullNode {

match self
.client
.ledger_get_sequencer_commitments_on_slot_by_number(height)
.ledger_get_sequencer_commitments_on_slot_by_number(U64::from(height))
.await
{
Ok(Some(commitments)) => return Ok(commitments),
Expand All @@ -48,7 +49,7 @@ impl FullNode {

match self
.client
.ledger_get_verified_proofs_by_slot_height(height)
.ledger_get_verified_proofs_by_slot_height(U64::from(height))
.await?
{
Some(proofs) => return Ok(proofs),
Expand Down

0 comments on commit a4407ce

Please sign in to comment.