diff --git a/fastlane_bot/events/async_backdate_utils.py b/fastlane_bot/events/async_backdate_utils.py index cfe396b69..845f27a24 100644 --- a/fastlane_bot/events/async_backdate_utils.py +++ b/fastlane_bot/events/async_backdate_utils.py @@ -90,7 +90,6 @@ def async_handle_initial_iteration( last_block: int, mgr: Any, start_block: int, - current_block: int, ): if last_block == 0: non_multicall_rows_to_update = mgr.get_rows_to_update(start_block) @@ -105,7 +104,7 @@ def async_handle_initial_iteration( ) mgr.cfg.logger.info( - f"Backdating {len(other_pool_rows)} pools from {start_block} to {current_block}" + f"Backdating {len(other_pool_rows)} pools from {start_block}" ) start_time = time.time() async_backdate_from_contracts( diff --git a/main.py b/main.py index 9d0bc3548..2cdee3a23 100644 --- a/main.py +++ b/main.py @@ -308,6 +308,14 @@ def run(mgr, args, tenderly_uri=None) -> None: mainnet_uri = mgr.cfg.w3.provider.endpoint_uri handle_static_pools_update(mgr) + # Handle the initial iteration (backdate pools, update pools from contracts, etc.) + async_handle_initial_iteration( + backdate_pools=args.backdate_pools, + last_block=last_block, + mgr=mgr, + start_block=args.replay_from_block, + ) + while True: try: # Save initial state of pool data to assert whether it has changed @@ -355,22 +363,22 @@ def run(mgr, args, tenderly_uri=None) -> None: args.use_cached_events, ) - latest_events = ( - get_cached_events(mgr, args.logging_path) - if args.use_cached_events - else get_latest_events( - current_block, - mgr, - args.n_jobs, - start_block, - args.cache_latest_only, - args.logging_path, - ) - ) + # latest_events = ( + # get_cached_events(mgr, args.logging_path) + # if args.use_cached_events + # else get_latest_events( + # current_block, + # mgr, + # args.n_jobs, + # start_block, + # args.cache_latest_only, + # args.logging_path, + # ) + # ) iteration_start_time = time.time() # Update the pools from the latest events - update_pools_from_events(args.n_jobs, mgr, latest_events) + #update_pools_from_events(args.n_jobs, mgr, latest_events) # Update new pool events from contracts if len(mgr.pools_to_add_from_contracts) > 0: @@ -395,14 +403,6 @@ def run(mgr, args, tenderly_uri=None) -> None: tenderly_fork_id=args.tenderly_fork_id, ) - # Handle the initial iteration (backdate pools, update pools from contracts, etc.) - async_handle_initial_iteration( - backdate_pools=args.backdate_pools, - current_block=current_block, - last_block=last_block, - mgr=mgr, - start_block=start_block, - ) # Run multicall every iteration multicall_every_iteration(current_block=current_block, mgr=mgr)