@@ -127,15 +127,15 @@ known_heap_size!(0, PeerInfo);
127127pub type PacketDecodeError = DecoderError ;
128128
129129/// 63 version of Ethereum protocol.
130- pub const ETH_PROTOCOL_VERSION_63 : u8 = 63 ;
130+ pub const ETH_PROTOCOL_VERSION_63 : ( u8 , u8 ) = ( 63 , 0x11 ) ;
131131/// 62 version of Ethereum protocol.
132- pub const ETH_PROTOCOL_VERSION_62 : u8 = 62 ;
133- /// 1 version of Parity protocol.
134- pub const PAR_PROTOCOL_VERSION_1 : u8 = 1 ;
132+ pub const ETH_PROTOCOL_VERSION_62 : ( u8 , u8 ) = ( 62 , 0x11 ) ;
133+ /// 1 version of Parity protocol and the packet count .
134+ pub const PAR_PROTOCOL_VERSION_1 : ( u8 , u8 ) = ( 1 , 0x15 ) ;
135135/// 2 version of Parity protocol (consensus messages added).
136- pub const PAR_PROTOCOL_VERSION_2 : u8 = 2 ;
136+ pub const PAR_PROTOCOL_VERSION_2 : ( u8 , u8 ) = ( 2 , 0x16 ) ;
137137/// 3 version of Parity protocol (private transactions messages added).
138- pub const PAR_PROTOCOL_VERSION_3 : u8 = 3 ;
138+ pub const PAR_PROTOCOL_VERSION_3 : ( u8 , u8 ) = ( 3 , 0x18 ) ;
139139
140140pub const MAX_BODIES_TO_SEND : usize = 256 ;
141141pub const MAX_HEADERS_TO_SEND : usize = 512 ;
@@ -169,8 +169,6 @@ pub const NODE_DATA_PACKET: u8 = 0x0e;
169169pub const GET_RECEIPTS_PACKET : u8 = 0x0f ;
170170pub const RECEIPTS_PACKET : u8 = 0x10 ;
171171
172- pub const ETH_PACKET_COUNT : u8 = 0x11 ;
173-
174172pub const GET_SNAPSHOT_MANIFEST_PACKET : u8 = 0x11 ;
175173pub const SNAPSHOT_MANIFEST_PACKET : u8 = 0x12 ;
176174pub const GET_SNAPSHOT_DATA_PACKET : u8 = 0x13 ;
@@ -179,8 +177,6 @@ pub const CONSENSUS_DATA_PACKET: u8 = 0x15;
179177const PRIVATE_TRANSACTION_PACKET : u8 = 0x16 ;
180178const SIGNED_PRIVATE_TRANSACTION_PACKET : u8 = 0x17 ;
181179
182- pub const SNAPSHOT_SYNC_PACKET_COUNT : u8 = 0x18 ;
183-
184180const MAX_SNAPSHOT_CHUNKS_DOWNLOAD_AHEAD : usize = 3 ;
185181
186182const WAIT_PEERS_TIMEOUT : Duration = Duration :: from_secs ( 5 ) ;
@@ -453,7 +449,7 @@ impl ChainSync {
453449 let last_imported_number = self . new_blocks . last_imported_block_number ( ) ;
454450 SyncStatus {
455451 state : self . state . clone ( ) ,
456- protocol_version : ETH_PROTOCOL_VERSION_63 ,
452+ protocol_version : ETH_PROTOCOL_VERSION_63 . 0 ,
457453 network_id : self . network_id ,
458454 start_block_number : self . starting_block ,
459455 last_imported_block_number : Some ( last_imported_number) ,
@@ -855,7 +851,7 @@ impl ChainSync {
855851 fn send_status ( & mut self , io : & mut SyncIo , peer : PeerId ) -> Result < ( ) , network:: Error > {
856852 let warp_protocol_version = io. protocol_version ( & WARP_SYNC_PROTOCOL_ID , peer) ;
857853 let warp_protocol = warp_protocol_version != 0 ;
858- let protocol = if warp_protocol { warp_protocol_version } else { ETH_PROTOCOL_VERSION_63 } ;
854+ let protocol = if warp_protocol { warp_protocol_version } else { ETH_PROTOCOL_VERSION_63 . 0 } ;
859855 trace ! ( target: "sync" , "Sending status to {}, protocol version {}" , peer, protocol) ;
860856 let mut packet = RlpStream :: new_list ( if warp_protocol { 7 } else { 5 } ) ;
861857 let chain = io. chain ( ) . chain_info ( ) ;
@@ -1019,11 +1015,11 @@ impl ChainSync {
10191015 }
10201016
10211017 fn get_consensus_peers ( & self ) -> Vec < PeerId > {
1022- self . peers . iter ( ) . filter_map ( |( id, p) | if p. protocol_version >= PAR_PROTOCOL_VERSION_2 { Some ( * id) } else { None } ) . collect ( )
1018+ self . peers . iter ( ) . filter_map ( |( id, p) | if p. protocol_version >= PAR_PROTOCOL_VERSION_2 . 0 { Some ( * id) } else { None } ) . collect ( )
10231019 }
10241020
10251021 fn get_private_transaction_peers ( & self ) -> Vec < PeerId > {
1026- self . peers . iter ( ) . filter_map ( |( id, p) | if p. protocol_version >= PAR_PROTOCOL_VERSION_3 { Some ( * id) } else { None } ) . collect ( )
1022+ self . peers . iter ( ) . filter_map ( |( id, p) | if p. protocol_version >= PAR_PROTOCOL_VERSION_3 . 0 { Some ( * id) } else { None } ) . collect ( )
10271023 }
10281024
10291025 /// Maintain other peers. Send out any new blocks and transactions
0 commit comments