Skip to content

Commit

Permalink
add submit relay checkpoint interval delay
Browse files Browse the repository at this point in the history
  • Loading branch information
perfogic committed Oct 3, 2024
1 parent 360b712 commit 356b42d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/orchestrator/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const RELAY_HEADER_BATCH_SIZE = 250;
export const SCAN_MEMPOOL_CHUNK_SIZE = 1000;
export const SCAN_MEMPOOL_CHUNK_INTERVAL_DELAY = 100;
export const SCAN_BLOCK_TXS_INTERVAL_DELAY = 100;
export const SUBMIT_RELAY_CHECKPOINT_INTERVAL_DELAY = 100;
export const RELAY_DEPOSIT_BLOCKS_SIZE = 200; // 10 blocks
export const RETRY_DELAY = 1000; // 1 second
export const ITERATION_DELAY = {
Expand Down
3 changes: 3 additions & 0 deletions packages/orchestrator/src/services/relayer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
SCAN_BLOCK_TXS_INTERVAL_DELAY,
SCAN_MEMPOOL_CHUNK_INTERVAL_DELAY,
SCAN_MEMPOOL_CHUNK_SIZE,
SUBMIT_RELAY_CHECKPOINT_INTERVAL_DELAY,
} from "../../constants";
import { chunkArray } from "../../utils/array";
import {
Expand Down Expand Up @@ -585,6 +586,8 @@ class RelayerService implements RelayerInterface {
relayed[checkpoint] = true;
console.log(`Relayed checkpoint tx ${tx}`);
} catch (err) {}

await setTimeout(SUBMIT_RELAY_CHECKPOINT_INTERVAL_DELAY);
}
} catch (err) {
this.logger.error(`[RELAY_CHECKPOINT] ${err?.message}`);
Expand Down

0 comments on commit 356b42d

Please sign in to comment.