Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/dependabot-auto-approve-minor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
strategy:
matrix:
dependencyStartsWith:
- '@sentry/'
- mocha
- '@glif/'
- debug
Expand Down
14 changes: 0 additions & 14 deletions bin/dry-run.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// dotenv must be imported before importing anything else
import 'dotenv/config'

import * as Sentry from '@sentry/node'
import { DATABASE_URL } from '../lib/config.js'
import { evaluate } from '../lib/evaluate.js'
import { preprocess, fetchMeasurements } from '../lib/preprocess.js'
Expand All @@ -21,13 +20,6 @@ const {
DUMP
} = process.env

Sentry.init({
dsn: 'https://d0651617f9690c7e9421ab9c949d67a4@o1408530.ingest.sentry.io/4505906069766144',
environment: process.env.SENTRY_ENVIRONMENT || 'dry-run',
// Performance Monitoring
tracesSampleRate: 0.1 // Capture 10% of the transactions
})

const cacheDir = fileURLToPath(new URL('../.cache', import.meta.url))
await mkdir(cacheDir, { recursive: true })

Expand Down Expand Up @@ -98,12 +90,6 @@ for (const cid of measurementCids) {
})
} catch (err) {
console.error(err)
Sentry.captureException(err, {
extra: {
roundIndex,
measurementsCid: cid
}
})
}
}

Expand Down
8 changes: 0 additions & 8 deletions bin/fetch-recent-miner-measurements.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import 'dotenv/config'

import { Point } from '@influxdata/influxdb-client'
import * as Sentry from '@sentry/node'
import createDebug from 'debug'
import fs from 'node:fs'
import { mkdir, readFile, writeFile } from 'node:fs/promises'
Expand All @@ -16,13 +15,6 @@ import * as SparkImpactEvaluator from '@filecoin-station/spark-impact-evaluator'

const { STORE_ALL_MINERS } = process.env

Sentry.init({
dsn: 'https://d0651617f9690c7e9421ab9c949d67a4@o1408530.ingest.sentry.io/4505906069766144',
environment: process.env.SENTRY_ENVIRONMENT || 'dry-run',
// Performance Monitoring
tracesSampleRate: 0.1 // Capture 10% of the transactions
})

const debug = createDebug('spark:bin')

const cacheDir = path.resolve('.cache')
Expand Down
9 changes: 0 additions & 9 deletions bin/spark-evaluate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from '@sentry/node'
import { DATABASE_URL } from '../lib/config.js'
import { startEvaluate } from '../index.js'
import { fetchRoundDetails } from '../lib/spark-api.js'
Expand All @@ -15,21 +14,13 @@ import { createStorachaClient } from '../lib/storacha.js'
import { createInflux } from '../lib/telemetry.js'

const {
SENTRY_ENVIRONMENT = 'development',
WALLET_SEED,
STORACHA_SECRET_KEY,
STORACHA_PROOF,
GIT_COMMIT,
INFLUXDB_TOKEN
} = process.env

Sentry.init({
dsn: 'https://d0651617f9690c7e9421ab9c949d67a4@o1408530.ingest.sentry.io/4505906069766144',
environment: SENTRY_ENVIRONMENT,
// Performance Monitoring
tracesSampleRate: 0.1 // Capture 10% of the transactions
})

assert(WALLET_SEED, 'WALLET_SEED required')
assert(STORACHA_SECRET_KEY, 'STORACHA_SECRET_KEY required')
assert(STORACHA_PROOF, 'STORACHA_PROOF required')
Expand Down
15 changes: 0 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import ms from 'ms'
import assert from 'node:assert'
import * as Sentry from '@sentry/node'
import { preprocess } from './lib/preprocess.js'
import { evaluate } from './lib/evaluate.js'
import { RoundData } from './lib/round.js'
Expand Down Expand Up @@ -52,7 +51,6 @@ export const startEvaluate = async ({
measurementsCid: cid
}
console.error(msg, details)
Sentry.captureException(new Error(msg), { extra: details })
return
}

Expand All @@ -73,12 +71,6 @@ export const startEvaluate = async ({
})
} catch (err) {
console.error('CANNOT PREPROCESS MEASUREMENTS [ROUND=%s]:', roundIndex, err)
Sentry.captureException(err, {
extra: {
roundIndex,
measurementsCid: cid
}
})
}
}

Expand Down Expand Up @@ -120,26 +112,19 @@ export const startEvaluate = async ({
prepareProviderRetrievalResultStats
}).catch(err => {
console.error('CANNOT EVALUATE ROUND %s:', evaluatedRoundIndex, err)
Sentry.captureException(err, {
extra: {
roundIndex: evaluatedRoundIndex
}
})
})
}

// Listen for events
ieContract.on('MeasurementsAdded', (...args) => {
onMeasurementsAdded(...args).catch(err => {
console.error('CANNOT ADD MEASUREMENTS:', err)
Sentry.captureException(err)
})
})

ieContract.on('RoundStart', (...args) => {
onRoundStart(...args).catch(err => {
console.error('CANNOT HANDLE START OF ROUND %s:', args[0], err)
Sentry.captureException(err)
})
})

Expand Down
6 changes: 0 additions & 6 deletions lib/evaluate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from '@sentry/node'
import createDebug from 'debug'
import { updatePublicStats } from './public-stats.js'
import { buildRetrievalStats, recordCommitteeSizes } from './retrieval-stats.js'
Expand Down Expand Up @@ -81,7 +80,6 @@ export const evaluate = async ({
} catch (err) {
console.error('Cannot record retrieval stats (honest).', err)
ignoredErrors.push(err)
Sentry.captureException(err)
}

try {
Expand All @@ -92,7 +90,6 @@ export const evaluate = async ({
} catch (err) {
console.error('Cannot record retrieval stats (all).', err)
ignoredErrors.push(err)
Sentry.captureException(err)
}

try {
Expand All @@ -109,7 +106,6 @@ export const evaluate = async ({
} catch (err) {
console.error('Cannot record committees.', err)
ignoredErrors.push(err)
Sentry.captureException(err)
}

if (createPgClient) {
Expand All @@ -126,7 +122,6 @@ export const evaluate = async ({
} catch (err) {
console.error('Cannot update public stats.', err)
ignoredErrors.push(err)
Sentry.captureException(err)
}
}

Expand All @@ -145,7 +140,6 @@ export const evaluate = async ({
} catch (err) {
console.error('Cannot prepare provider retrieval result stats.', err)
ignoredErrors.push(err)
Sentry.captureException(err)
}

return { ignoredErrors }
Expand Down
3 changes: 0 additions & 3 deletions lib/platform-stats.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import assert from 'node:assert'
import createDebug from 'debug'
import * as Sentry from '@sentry/node'
import pRetry from 'p-retry'

const debug = createDebug('spark:platform-stats')
Expand Down Expand Up @@ -240,7 +239,6 @@ export const refreshDatabase = async (
await func(pgClient)
} catch (err) {
console.error(`Error running function ${func.name}:`, err)
Sentry.captureException(err)
}
}

Expand All @@ -262,7 +260,6 @@ export const updateTopMeasurementParticipants = async (pgClient) => {
})
} catch (err) {
console.error('Error refreshing top measurement participants', err)
Sentry.captureException(err)
}
}

Expand Down
2 changes: 0 additions & 2 deletions lib/provider-retrieval-result-stats.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from '@sentry/node'
import timers from 'node:timers/promises'
import pRetry from 'p-retry'
import { createDagJsonCar } from './car.js'
Expand Down Expand Up @@ -137,7 +136,6 @@ export const runPublishLoop = async ({ createPgClient, storachaClient, rsrContra
await publish({ createPgClient, storachaClient, rsrContract })
} catch (err) {
console.error(err)
Sentry.captureException(err)
} finally {
await timers.setTimeout(ONE_HOUR)
}
Expand Down
13 changes: 0 additions & 13 deletions lib/public-stats.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from '@sentry/node'
import createDebug from 'debug'
import * as providerRetrievalResultStats from './provider-retrieval-result-stats.js'
import { updatePlatformStats } from './platform-stats.js'
Expand Down Expand Up @@ -120,12 +119,6 @@ const updateDailyDealsStats = async (pgClient, committees, findDealClients) => {
const clients = findDealClients(minerId, cid)
if (!clients || !clients.length) {
console.warn(`Invalid retrieval task (${minerId}, ${cid}): no deal clients found. Excluding the task from daily per-deal stats.`)
Sentry.captureException(new Error('Invalid retrieval task: no deal clients found.'), {
extra: {
minerId,
cid
}
})
continue
}

Expand Down Expand Up @@ -361,12 +354,6 @@ function buildPerPartyStats (committees, perDealParty, partyName) {
const parties = perDealParty(minerId, cid)
if (!parties || !parties.length) {
console.warn(`Invalid retrieval task (${minerId}, ${cid}): no deal ${partyName}s found. Excluding the task from daily per-${partyName} stats.`)
Sentry.captureException(new Error(`Invalid retrieval task: no deal ${partyName}s found.`), {
extra: {
minerId,
cid
}
})
continue
}

Expand Down
Loading