1
- use m1_da_light_node_util:: inner_blob :: InnerBlob ;
1
+ use m1_da_light_node_util:: ir_blob :: IntermediateBlobRepresentation ;
2
2
use std:: fmt:: { self , Debug , Formatter } ;
3
3
use std:: sync:: Arc ;
4
4
use tokio_stream:: { Stream , StreamExt } ;
@@ -12,7 +12,7 @@ use m1_da_light_node_grpc::light_node_service_server::LightNodeService;
12
12
use m1_da_light_node_grpc:: * ;
13
13
use m1_da_light_node_util:: {
14
14
config:: Config ,
15
- inner_blob :: { celestia:: CelestiaInnerBlob , InnerSignedBlobV1Data } ,
15
+ ir_blob :: { celestia:: CelestiaIntermediateBlobRepresentation , InnerSignedBlobV1Data } ,
16
16
} ;
17
17
use m1_da_light_node_verifier:: { permissioned_signers:: Verifier , VerifierOperations } ;
18
18
42
42
pub config : Config ,
43
43
pub celestia_namespace : Namespace ,
44
44
pub default_client : Arc < Client > ,
45
- pub verifier : Arc < Box < dyn VerifierOperations < CelestiaBlob , InnerBlob > + Send + Sync > > ,
45
+ pub verifier : Arc <
46
+ Box < dyn VerifierOperations < CelestiaBlob , IntermediateBlobRepresentation > + Send + Sync > ,
47
+ > ,
46
48
pub signing_key : SigningKey < C > ,
47
49
}
48
50
@@ -119,7 +121,8 @@ where
119
121
let data = InnerSignedBlobV1Data :: new ( data, timestamp) . try_to_sign ( & self . signing_key ) ?;
120
122
121
123
// create the celestia blob
122
- CelestiaInnerBlob ( data. into ( ) , self . celestia_namespace . clone ( ) ) . try_into ( )
124
+ CelestiaIntermediateBlobRepresentation ( data. into ( ) , self . celestia_namespace . clone ( ) )
125
+ . try_into ( )
123
126
}
124
127
125
128
/// Submits a CelestiaBlob to the Celestia node.
@@ -155,10 +158,10 @@ where
155
158
}
156
159
157
160
/// Gets the blobs at a given height.
158
- pub async fn get_inner_blobs_at_height (
161
+ pub async fn get_ir_blobs_at_height (
159
162
& self ,
160
163
height : u64 ,
161
- ) -> Result < Vec < InnerBlob > , anyhow:: Error > {
164
+ ) -> Result < Vec < IntermediateBlobRepresentation > , anyhow:: Error > {
162
165
let blobs = self . default_client . blob_get_all ( height, & [ self . celestia_namespace ] ) . await ;
163
166
164
167
if let Err ( e) = & blobs {
@@ -186,10 +189,10 @@ where
186
189
187
190
#[ tracing:: instrument( target = "movement_timing" , level = "debug" ) ]
188
191
async fn get_blobs_at_height ( & self , height : u64 ) -> Result < Vec < Blob > , anyhow:: Error > {
189
- let inner_blobs = self . get_inner_blobs_at_height ( height) . await ?;
192
+ let ir_blobs = self . get_ir_blobs_at_height ( height) . await ?;
190
193
let mut blobs = Vec :: new ( ) ;
191
- for inner_blob in inner_blobs {
192
- let blob = Self :: inner_blob_to_blob ( inner_blob , height) ?;
194
+ for ir_blob in ir_blobs {
195
+ let blob = Self :: ir_blob_to_blob ( ir_blob , height) ?;
193
196
// todo: update logging here
194
197
blobs. push ( blob) ;
195
198
}
@@ -277,26 +280,29 @@ where
277
280
as std:: pin:: Pin < Box < dyn Stream < Item = Result < Blob , anyhow:: Error > > + Send > > )
278
281
}
279
282
280
- pub fn inner_blob_to_blob ( inner_blob : InnerBlob , height : u64 ) -> Result < Blob , anyhow:: Error > {
283
+ pub fn ir_blob_to_blob (
284
+ ir_blob : IntermediateBlobRepresentation ,
285
+ height : u64 ,
286
+ ) -> Result < Blob , anyhow:: Error > {
281
287
Ok ( Blob {
282
- data : inner_blob . blob ( ) . to_vec ( ) ,
283
- signature : inner_blob . signature ( ) . to_vec ( ) ,
284
- timestamp : inner_blob . timestamp ( ) ,
285
- signer : inner_blob . signer ( ) . to_vec ( ) ,
286
- blob_id : inner_blob . id ( ) . to_vec ( ) ,
288
+ data : ir_blob . blob ( ) . to_vec ( ) ,
289
+ signature : ir_blob . signature ( ) . to_vec ( ) ,
290
+ timestamp : ir_blob . timestamp ( ) ,
291
+ signer : ir_blob . signer ( ) . to_vec ( ) ,
292
+ blob_id : ir_blob . id ( ) . to_vec ( ) ,
287
293
height,
288
294
} )
289
295
}
290
296
291
297
pub fn celestia_blob_to_blob ( blob : CelestiaBlob , height : u64 ) -> Result < Blob , anyhow:: Error > {
292
- let inner_blob : InnerBlob = blob. try_into ( ) ?;
298
+ let ir_blob : IntermediateBlobRepresentation = blob. try_into ( ) ?;
293
299
294
300
Ok ( Blob {
295
- data : inner_blob . blob ( ) . to_vec ( ) ,
296
- signature : inner_blob . signature ( ) . to_vec ( ) ,
297
- timestamp : inner_blob . timestamp ( ) ,
298
- signer : inner_blob . signer ( ) . to_vec ( ) ,
299
- blob_id : inner_blob . id ( ) . to_vec ( ) ,
301
+ data : ir_blob . blob ( ) . to_vec ( ) ,
302
+ signature : ir_blob . signature ( ) . to_vec ( ) ,
303
+ timestamp : ir_blob . timestamp ( ) ,
304
+ signer : ir_blob . signer ( ) . to_vec ( ) ,
305
+ blob_id : ir_blob . id ( ) . to_vec ( ) ,
300
306
height,
301
307
} )
302
308
}
0 commit comments