Skip to content

Commit d7ab3c2

Browse files
renaming
1 parent d346197 commit d7ab3c2

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

crates/prism/src/da/celestia.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use crate::{
22
cfg::CelestiaConfig,
3-
consts::CHANNEL_BUFFER_SIZE,
43
da::{DataAvailabilityLayer, FinalizedEpoch},
54
};
6-
use anyhow::{anyhow, bail, Context, Result};
5+
use anyhow::{anyhow, Context, Result};
76
use async_trait::async_trait;
87
use celestia_rpc::{BlobClient, Client, HeaderClient};
98
use celestia_types::{blob::GasPrice, nmt::Namespace, Blob};
@@ -99,7 +98,7 @@ impl DataAvailabilityLayer for CelestiaConnection {
9998
Ok(height)
10099
}
101100

102-
async fn get_snark(&self, height: u64) -> Result<Option<FinalizedEpoch>> {
101+
async fn get_finalized_epoch(&self, height: u64) -> Result<Option<FinalizedEpoch>> {
103102
trace!("searching for epoch on da layer at height {}", height);
104103

105104
match BlobClient::blob_get_all(&self.client, height, &[self.snark_namespace]).await {
@@ -128,7 +127,7 @@ impl DataAvailabilityLayer for CelestiaConnection {
128127
}
129128
}
130129

131-
async fn submit_snark(&self, epoch: FinalizedEpoch) -> Result<u64> {
130+
async fn submit_finalized_epoch(&self, epoch: FinalizedEpoch) -> Result<u64> {
132131
debug!("posting {}th epoch to da layer", epoch.height);
133132

134133
let data = bincode::serialize(&epoch).map_err(|e| {

crates/prism/src/da/memory.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl DataAvailabilityLayer for InMemoryDataAvailabilityLayer {
9292
self.get_latest_height().await
9393
}
9494

95-
async fn get_snark(&self, height: u64) -> Result<Option<FinalizedEpoch>> {
95+
async fn get_finalized_epoch(&self, height: u64) -> Result<Option<FinalizedEpoch>> {
9696
let blocks = self.blocks.read().await;
9797
Ok(blocks
9898
.iter()
@@ -101,7 +101,7 @@ impl DataAvailabilityLayer for InMemoryDataAvailabilityLayer {
101101
.unwrap_or_default())
102102
}
103103

104-
async fn submit_snark(&self, epoch: FinalizedEpoch) -> Result<u64> {
104+
async fn submit_finalized_epoch(&self, epoch: FinalizedEpoch) -> Result<u64> {
105105
let mut pending_epochs = self.pending_epochs.write().await;
106106
pending_epochs.push_back(epoch);
107107
self.get_latest_height().await

crates/prism/src/da/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ impl SignedContent for FinalizedEpoch {
5151
pub trait DataAvailabilityLayer: Send + Sync {
5252
async fn get_latest_height(&self) -> Result<u64>;
5353
async fn initialize_sync_target(&self) -> Result<u64>;
54-
async fn get_snark(&self, height: u64) -> Result<Option<FinalizedEpoch>>;
55-
async fn submit_snark(&self, epoch: FinalizedEpoch) -> Result<u64>;
54+
async fn get_finalized_epoch(&self, height: u64) -> Result<Option<FinalizedEpoch>>;
55+
async fn submit_finalized_epoch(&self, epoch: FinalizedEpoch) -> Result<u64>;
5656
async fn get_operations(&self, height: u64) -> Result<Vec<Operation>>;
5757
async fn submit_operations(&self, operations: Vec<Operation>) -> Result<u64>;
5858
async fn start(&self) -> Result<()>;

crates/prism/src/node_types/sequencer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl Sequencer {
121121
while current_height < end_height {
122122
let height = current_height + 1;
123123
let operations = self.da.get_operations(height).await?;
124-
let epoch_result = self.da.get_snark(height).await?;
124+
let epoch_result = self.da.get_finalized_epoch(height).await?;
125125

126126
self.process_height(
127127
height,
@@ -188,7 +188,7 @@ impl Sequencer {
188188
loop {
189189
let height = height_rx.recv().await?;
190190
let operations = self.da.get_operations(height).await?;
191-
let epoch_result = self.da.get_snark(height).await?;
191+
let epoch_result = self.da.get_finalized_epoch(height).await?;
192192

193193
self.process_height(
194194
height,
@@ -320,7 +320,7 @@ impl Sequencer {
320320
.prove_epoch(height, prev_commitment, new_commitment, proofs)
321321
.await?;
322322

323-
self.da.submit_snark(finalized_epoch).await?;
323+
self.da.submit_finalized_epoch(finalized_epoch).await?;
324324

325325
self.db.set_commitment(&height, &new_commitment)?;
326326
self.db.set_epoch(&height)?;

crates/prism/src/storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::{
1414
time::Duration,
1515
};
1616

17-
use crate::{cfg::RedisConfig, da::FinalizedEpoch};
17+
use crate::cfg::RedisConfig;
1818
use prism_common::{
1919
hashchain::{Hashchain, HashchainEntry},
2020
operation::Operation,

crates/prism/tests/integration_tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ use keystore_rs::create_signing_key;
66
use prism_common::operation::{AccountSource, Operation};
77
use prism_main::{
88
cfg::{Config, RedisConfig},
9-
da::{memory::InMemoryDataAvailabilityLayer, DataAvailabilityLayer},
9+
da::memory::InMemoryDataAvailabilityLayer,
1010
node_types::{lightclient::LightClient, sequencer::Sequencer, NodeType},
1111
storage::{Database, RedisConnection},
1212
webserver::OperationInput,
1313
};
1414
use rand::{rngs::StdRng, Rng, SeedableRng};
15-
use serde_json;
1615
use std::sync::Arc;
1716
use tokio::{spawn, time::Duration};
1817

0 commit comments

Comments
 (0)