Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
update block number offset
Browse files Browse the repository at this point in the history
Signed-off-by: Pranay Valson <pranay.valson@gmail.com>
  • Loading branch information
noslav committed Jan 5, 2024
1 parent fbd83fc commit f4578af
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/dbmanspecimen.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __main_loop(self):
# we are catching up. So we only need to grab what we need to attempt for finalizing
if self.chain_table == "chain_moonbeam_moonbase_alpha":
cur.execute(
r'SELECT * FROM chain_moonbeam_moonbase_alpha."_proof_chain_specimen_events" WHERE observer_chain_session_start_block_id > %s AND observer_chain_finalization_tx_hash IS NULL AND origin_chain_block_height > 18621000;',
r'SELECT * FROM chain_moonbeam_moonbase_alpha."_proof_chain_specimen_events" WHERE observer_chain_session_start_block_id > %s AND observer_chain_finalization_tx_hash IS NULL AND origin_chain_block_height > 18781670;',
(self.last_block_id,),
)
else:
Expand All @@ -91,7 +91,9 @@ def __main_loop(self):
)
outputs = cur.fetchall()

self.logger.info(f"Processing {len(outputs)} specimen proof-session records...")
self.logger.info(
f"Processing {len(outputs)} specimen proof-session records..."
)
self._process_outputs(outputs)

self.caught_up = True
Expand All @@ -100,11 +102,13 @@ def __main_loop(self):
while True:
with self.__connect() as conn:
with conn.cursor() as cur:
self.logger.info(f"Incremental scan block_id={self.last_block_id}")
self.logger.info(
f"Incremental scan block_id={self.last_block_id}"
)
# we need everything after last max block number
if self.chain_table == "chain_moonbeam_moonbase_alpha":
cur.execute(
r'SELECT * FROM chain_moonbeam_moonbase_alpha."_proof_chain_specimen_events" WHERE observer_chain_session_start_block_id > %s AND origin_chain_block_height > 18621000;',
r'SELECT * FROM chain_moonbeam_moonbase_alpha."_proof_chain_specimen_events" WHERE observer_chain_session_start_block_id > %s AND origin_chain_block_height > 18781670;',
(self.last_block_id,),
)
else:
Expand Down

0 comments on commit f4578af

Please sign in to comment.