@@ -7,11 +7,8 @@ pub mod sync_state;
77
88use crate :: {
99 lighthouse:: sync_state:: SyncState ,
10- types:: {
11- AdminPeer , DepositTreeSnapshot , Epoch , FinalizedExecutionBlock , GenericResponse ,
12- ValidatorId ,
13- } ,
14- BeaconNodeHttpClient , DepositData , Error , Eth1Data , Hash256 , Slot ,
10+ types:: { AdminPeer , Epoch , GenericResponse , ValidatorId } ,
11+ BeaconNodeHttpClient , DepositData , Error , Hash256 , Slot ,
1512} ;
1613use proto_array:: core:: ProtoArray ;
1714use serde:: { Deserialize , Serialize } ;
@@ -159,18 +156,6 @@ pub struct ProcessHealth {
159156 pub pid_process_seconds_total : u64 ,
160157}
161158
162- /// Indicates how up-to-date the Eth1 caches are.
163- #[ derive( Clone , Debug , PartialEq , Serialize , Deserialize ) ]
164- pub struct Eth1SyncStatusData {
165- pub head_block_number : Option < u64 > ,
166- pub head_block_timestamp : Option < u64 > ,
167- pub latest_cached_block_number : Option < u64 > ,
168- pub latest_cached_block_timestamp : Option < u64 > ,
169- pub voting_target_timestamp : u64 ,
170- pub eth1_node_sync_status_percentage : f64 ,
171- pub lighthouse_is_cached_and_ready : bool ,
172- }
173-
174159/// A fully parsed eth1 deposit contract log.
175160#[ derive( Debug , PartialEq , Clone , Serialize , Deserialize , Encode , Decode ) ]
176161pub struct DepositLog {
@@ -183,41 +168,6 @@ pub struct DepositLog {
183168 pub signature_is_valid : bool ,
184169}
185170
186- /// A block of the eth1 chain.
187- #[ derive( Debug , PartialEq , Clone , Serialize , Deserialize , Encode , Decode ) ]
188- pub struct Eth1Block {
189- pub hash : Hash256 ,
190- pub timestamp : u64 ,
191- pub number : u64 ,
192- #[ ssz( with = "four_byte_option_hash256" ) ]
193- pub deposit_root : Option < Hash256 > ,
194- #[ ssz( with = "four_byte_option_u64" ) ]
195- pub deposit_count : Option < u64 > ,
196- }
197-
198- impl Eth1Block {
199- pub fn eth1_data ( self ) -> Option < Eth1Data > {
200- Some ( Eth1Data {
201- deposit_root : self . deposit_root ?,
202- deposit_count : self . deposit_count ?,
203- block_hash : self . hash ,
204- } )
205- }
206- }
207-
208- impl From < Eth1Block > for FinalizedExecutionBlock {
209- fn from ( eth1_block : Eth1Block ) -> Self {
210- Self {
211- deposit_count : eth1_block. deposit_count . unwrap_or ( 0 ) ,
212- deposit_root : eth1_block
213- . deposit_root
214- . unwrap_or_else ( || DepositTreeSnapshot :: default ( ) . deposit_root ) ,
215- block_hash : eth1_block. hash ,
216- block_height : eth1_block. number ,
217- }
218- }
219- }
220-
221171impl BeaconNodeHttpClient {
222172 /// `GET lighthouse/health`
223173 pub async fn get_lighthouse_health ( & self ) -> Result < GenericResponse < Health > , Error > {
@@ -298,51 +248,6 @@ impl BeaconNodeHttpClient {
298248 self . get ( path) . await
299249 }
300250
301- /// `GET lighthouse/eth1/syncing`
302- pub async fn get_lighthouse_eth1_syncing (
303- & self ,
304- ) -> Result < GenericResponse < Eth1SyncStatusData > , Error > {
305- let mut path = self . server . full . clone ( ) ;
306-
307- path. path_segments_mut ( )
308- . map_err ( |( ) | Error :: InvalidUrl ( self . server . clone ( ) ) ) ?
309- . push ( "lighthouse" )
310- . push ( "eth1" )
311- . push ( "syncing" ) ;
312-
313- self . get ( path) . await
314- }
315-
316- /// `GET lighthouse/eth1/block_cache`
317- pub async fn get_lighthouse_eth1_block_cache (
318- & self ,
319- ) -> Result < GenericResponse < Vec < Eth1Block > > , Error > {
320- let mut path = self . server . full . clone ( ) ;
321-
322- path. path_segments_mut ( )
323- . map_err ( |( ) | Error :: InvalidUrl ( self . server . clone ( ) ) ) ?
324- . push ( "lighthouse" )
325- . push ( "eth1" )
326- . push ( "block_cache" ) ;
327-
328- self . get ( path) . await
329- }
330-
331- /// `GET lighthouse/eth1/deposit_cache`
332- pub async fn get_lighthouse_eth1_deposit_cache (
333- & self ,
334- ) -> Result < GenericResponse < Vec < DepositLog > > , Error > {
335- let mut path = self . server . full . clone ( ) ;
336-
337- path. path_segments_mut ( )
338- . map_err ( |( ) | Error :: InvalidUrl ( self . server . clone ( ) ) ) ?
339- . push ( "lighthouse" )
340- . push ( "eth1" )
341- . push ( "deposit_cache" ) ;
342-
343- self . get ( path) . await
344- }
345-
346251 /// `POST lighthouse/database/reconstruct`
347252 pub async fn post_lighthouse_database_reconstruct ( & self ) -> Result < String , Error > {
348253 let mut path = self . server . full . clone ( ) ;
0 commit comments