@@ -9,7 +9,7 @@ use init4_bin_base::{
99} ;
1010use signet_sim:: { BlockBuild , BuiltBlock , SimCache } ;
1111use signet_types:: constants:: SignetSystemConstants ;
12- use std:: time:: { Duration , Instant , SystemTime , UNIX_EPOCH } ;
12+ use std:: time:: { Duration , Instant } ;
1313use tokio:: {
1414 sync:: {
1515 mpsc:: { self } ,
@@ -94,7 +94,7 @@ impl Simulator {
9494 ) -> eyre:: Result < BuiltBlock > {
9595 debug ! (
9696 block_number = block_env. number,
97- deadline = ? self . instant_to_timestamp ( finish_by) ,
97+ ? finish_by,
9898 tx_count= sim_items. len( ) ,
9999 "starting block build" ,
100100 ) ;
@@ -208,14 +208,11 @@ impl Simulator {
208208 // We add a 1500 ms buffer to account for sequencer stopping signing.
209209 let deadline =
210210 Instant :: now ( ) + Duration :: from_secs ( remaining) - Duration :: from_millis ( 1500 ) ;
211- trace ! ( deadline = ? self . instant_to_timestamp ( deadline) , "calculated deadline for block simulation" ) ;
211+ trace ! ( ? deadline, "calculated deadline for block simulation" ) ;
212212
213213 let buffered_deadline = deadline. max ( Instant :: now ( ) ) ;
214214 trace ! ( ?buffered_deadline, "final deadline for block simulation" ) ;
215215
216- let timestamp = self . instant_to_timestamp ( buffered_deadline) ;
217- trace ! ( ?timestamp, "deadline converted to timestamp" ) ;
218-
219216 buffered_deadline
220217 }
221218
@@ -245,23 +242,4 @@ impl Simulator {
245242 let wrapped_db: AlloyDatabaseProvider = WrapDatabaseAsync :: new ( alloy_db) . unwrap ( ) ;
246243 Some ( wrapped_db)
247244 }
248-
249- /// Converts an `Instant` to a UNIX timestamp in seconds and milliseconds.
250- pub fn instant_to_timestamp ( & self , instant : Instant ) -> ( u64 , u128 ) {
251- let now_instant = Instant :: now ( ) ;
252- let now_system = SystemTime :: now ( ) ;
253-
254- let duration_from_now = now_instant. duration_since ( instant) ;
255-
256- // Subtract that duration from the system time
257- let target_system_time = now_system - duration_from_now;
258-
259- let duration_since_epoch =
260- target_system_time. duration_since ( UNIX_EPOCH ) . expect ( "Time went backwards" ) ;
261-
262- let seconds = duration_since_epoch. as_secs ( ) ;
263- let milliseconds = duration_since_epoch. as_millis ( ) ;
264-
265- ( seconds, milliseconds)
266- }
267245}
0 commit comments