@@ -5,7 +5,13 @@ use std::net::SocketAddr;
55use std:: sync:: Arc ;
66use std:: time:: Duration ;
77
8+ use crate :: eth:: BatchVerifiedEventStream ;
9+ use aligned_sdk:: types:: {
10+ BatchInclusionData , ClientMessage , VerificationCommitmentBatch , VerificationData ,
11+ VerificationDataCommitment ,
12+ } ;
813use aws_sdk_s3:: client:: Client as S3Client ;
14+ use eth:: { BatchVerifiedFilter , BatcherPaymentService } ;
915use ethers:: prelude:: { Middleware , Provider } ;
1016use ethers:: providers:: Ws ;
1117use ethers:: types:: { Address , U256 } ;
@@ -20,18 +26,11 @@ use tokio_tungstenite::tungstenite::error::ProtocolError;
2026use tokio_tungstenite:: tungstenite:: protocol:: { frame:: coding:: CloseCode , CloseFrame } ;
2127use tokio_tungstenite:: tungstenite:: { Error , Message } ;
2228use tokio_tungstenite:: WebSocketStream ;
23-
24- use aligned_batcher_lib:: types:: {
25- BatchInclusionData , ClientMessage , VerificationCommitmentBatch , VerificationData ,
26- VerificationDataCommitment ,
27- } ;
28- use eth:: { BatchVerifiedFilter , BatcherPaymentService } ;
2929use types:: batch_queue:: BatchQueue ;
3030use types:: errors:: BatcherError ;
3131
3232use crate :: config:: { ConfigFromYaml , ContractDeploymentOutput , NonPayingConfig } ;
3333use crate :: eth:: AlignedLayerServiceManager ;
34- use crate :: eth:: BatchVerifiedEventStream ;
3534
3635mod config;
3736mod eth;
@@ -45,8 +44,6 @@ mod zk_utils;
4544
4645const S3_BUCKET_NAME : & str = "storage.alignedlayer.com" ;
4746
48- const PROTOCOL_VERSION : u16 = 0 ;
49-
5047pub struct Batcher {
5148 s3_client : S3Client ,
5249 eth_ws_provider : Provider < Ws > ,
@@ -59,7 +56,6 @@ pub struct Batcher {
5956 max_batch_size : usize ,
6057 last_uploaded_batch_block : Mutex < u64 > ,
6158 pre_verification_is_enabled : bool ,
62- protocol_version : u16 ,
6359 non_paying_config : Option < NonPayingConfig > ,
6460}
6561
@@ -121,7 +117,6 @@ impl Batcher {
121117 max_batch_size : config. batcher . max_batch_size ,
122118 last_uploaded_batch_block : Mutex :: new ( last_uploaded_batch_block) ,
123119 pre_verification_is_enabled : config. batcher . pre_verification_is_enabled ,
124- protocol_version : PROTOCOL_VERSION ,
125120 non_paying_config : config. batcher . non_paying ,
126121 }
127122 }
@@ -172,7 +167,11 @@ impl Batcher {
172167 let outgoing = Arc :: new ( RwLock :: new ( outgoing) ) ;
173168
174169 // Send the protocol version to the client
175- let protocol_version_msg = Message :: binary ( self . protocol_version . to_be_bytes ( ) . to_vec ( ) ) ;
170+ let protocol_version_msg = Message :: binary (
171+ aligned_sdk:: sdk:: CURRENT_PROTOCOL_VERSION
172+ . to_be_bytes ( )
173+ . to_vec ( ) ,
174+ ) ;
176175
177176 outgoing
178177 . write ( )
0 commit comments