@@ -5,11 +5,6 @@ import { BigNumber, Wallet } from 'ethers'
5
5
import fs from 'fs'
6
6
import { parse as yaml_parse } from 'yaml'
7
7
8
- const DEFAULT_SUBGRAPH_MAX_BLOCK_DISTANCE = 0
9
- const SUGGESTED_SUBGRAPH_MAX_BLOCK_DISTANCE_ON_L2 =
10
- 50 + DEFAULT_SUBGRAPH_MAX_BLOCK_DISTANCE
11
- const DEFAULT_SUBGRAPH_FRESHNESS_SLEEP_MILLISECONDS = 5_000
12
-
13
8
import {
14
9
connectContracts ,
15
10
connectDatabase ,
@@ -31,7 +26,6 @@ import {
31
26
registerIndexerErrorMetrics ,
32
27
resolveChainId ,
33
28
validateProviderNetworkIdentifier ,
34
- SubgraphFreshnessChecker ,
35
29
} from '@graphprotocol/indexer-common'
36
30
37
31
import { createServer } from '../server'
@@ -182,18 +176,6 @@ export default {
182
176
type : 'string' ,
183
177
required : false ,
184
178
} )
185
- . option ( 'subgraph-max-block-distance' , {
186
- description : 'How many blocks subgraphs are allowed to stay behind chain head' ,
187
- type : 'number' ,
188
- default : DEFAULT_SUBGRAPH_MAX_BLOCK_DISTANCE ,
189
- group : 'Protocol' ,
190
- } )
191
- . option ( 'subgraph-freshness-sleep-milliseconds' , {
192
- description : 'How long to wait before retrying subgraph query if it is not fresh' ,
193
- type : 'number' ,
194
- default : DEFAULT_SUBGRAPH_FRESHNESS_SLEEP_MILLISECONDS ,
195
- group : 'Protocol' ,
196
- } )
197
179
198
180
. check ( argv => {
199
181
if ( ! argv [ 'network-subgraph-endpoint' ] && ! argv [ 'network-subgraph-deployment' ] ) {
@@ -317,45 +299,6 @@ export default {
317
299
const networkIdentifier = await networkProvider . getNetwork ( )
318
300
const protocolNetwork = resolveChainId ( networkIdentifier . chainId )
319
301
320
- // Warn about inappropriate max block distance for subgraph threshold checks for given networks.
321
- if ( protocolNetwork . startsWith ( 'eip155:42161' ) ) {
322
- // Arbitrum-One and Arbitrum-Goerli
323
- if ( argv . subgraphMaxBlockDistance <= SUGGESTED_SUBGRAPH_MAX_BLOCK_DISTANCE_ON_L2 ) {
324
- logger . warn (
325
- `Consider increasing 'subgraph-max-block-distance' for Arbitrum networks` ,
326
- {
327
- problem :
328
- 'A low subgraph freshness threshold might cause the Agent to discard too many subgraph queries in fast-paced networks.' ,
329
- hint : `Increase the 'subgraph-max-block-distance' parameter to a value that accomodates for block and indexing speeds.` ,
330
- configuredValue : argv . subgraphMaxBlockDistance ,
331
- } ,
332
- )
333
- }
334
- if (
335
- argv . subgraphFreshnessSleepMilliseconds <=
336
- DEFAULT_SUBGRAPH_FRESHNESS_SLEEP_MILLISECONDS
337
- ) {
338
- logger . warn (
339
- `Consider increasing 'subgraph-freshness-sleep-milliseconds' for Arbitrum networks` ,
340
- {
341
- problem :
342
- 'A short subgraph freshness wait time might be insufficient for the subgraph to sync with fast-paced networks.' ,
343
- hint : `Increase the 'subgraph-freshness-sleep-milliseconds' parameter to a value that accomodates for block and indexing speeds.` ,
344
- configuredValue : argv . subgraphFreshnessSleepMilliseconds ,
345
- } ,
346
- )
347
- }
348
- }
349
-
350
- const subgraphFreshnessChecker = new SubgraphFreshnessChecker (
351
- 'Network Subgraph' ,
352
- networkProvider ,
353
- argv . subgraphMaxBlockDistance ,
354
- argv . subgraphFreshnessSleepMilliseconds ,
355
- logger . child ( { component : 'FreshnessChecker' } ) ,
356
- Infinity ,
357
- )
358
-
359
302
const networkSubgraph = await NetworkSubgraph . create ( {
360
303
logger,
361
304
endpoint : argv . networkSubgraphEndpoint ,
@@ -365,7 +308,6 @@ export default {
365
308
deployment : new SubgraphDeploymentID ( argv . networkSubgraphDeployment ) ,
366
309
}
367
310
: undefined ,
368
- subgraphFreshnessChecker,
369
311
} )
370
312
logger . info ( `Successfully connected to network subgraph` )
371
313
0 commit comments