Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit 45ce215

Browse files
committed
Remove latest block timestamp check
1 parent 004f705 commit 45ce215

1 file changed

Lines changed: 0 additions & 21 deletions

File tree

scripts/ping-providers.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ async function main(): Promise<PromiseSettledResult<void>[]> {
2121
const client = createPublicClient({ transport: http(defaultProvider.rpcUrl!) });
2222

2323
await validateChain(client, chain);
24-
const latestRes = await go(() => validateLatestBlock(client, chain), {
25-
retries: 3,
26-
delay: { type: 'static', delayMs: 60_000 },
27-
});
28-
if (!latestRes.success) {
29-
throw latestRes.error;
30-
}
3124
});
3225

3326
return await Promise.allSettled(promises);
@@ -44,20 +37,6 @@ async function validateChain(client: PublicClient, chain: Chain): Promise<void>
4437
}
4538
}
4639

47-
async function validateLatestBlock(client: PublicClient, chain: Chain): Promise<void> {
48-
const blockRes = await go(() => client.getBlock({ blockTag: 'latest' }), { retries: 1 });
49-
if (!blockRes.success) {
50-
throw new Error(`Unable to fetch latest block for ${chain.alias}`);
51-
}
52-
const block = blockRes.data;
53-
const blockTimestamp = block.timestamp;
54-
const deltaTime = Number(BigInt(Math.floor(Date.now() / 1000)) - blockTimestamp);
55-
const cutoff = 60 * 5; // Arbitrary cutoff of 5 minutes
56-
if (Math.abs(deltaTime) > cutoff) {
57-
throw new Error(`${chain.alias} latest block timestamp is ${deltaTime} seconds behind the system clock`);
58-
}
59-
}
60-
6140
async function notifySlack(errors: Error[]): Promise<Error[]> {
6241
if (errors.length > 0 && slackChannel) {
6342
const text = errors.reduce((acc, error) => `${acc}\n${error.message}`, '');

0 commit comments

Comments
 (0)