-
Notifications
You must be signed in to change notification settings - Fork 0
Release v1.1.1 #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release v1.1.1 #35
Changes from all commits
d6b5aa3
7e0cebd
682b73f
5831f55
0e2f798
f773449
61a4a89
038a75a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -223,7 +223,7 @@ | |
| const { data, loadedSourceCount } = await fetchAndBuildData(); | ||
|
|
||
| if (requireAtLeastOneSource && loadedSourceCount === 0) { | ||
| throw new Error('All data sources failed during background refresh'); | ||
| throw new Error('All data sources failed during data refresh'); | ||
|
Check failure on line 226 in dataService.js
|
||
| } | ||
|
|
||
| applyDataToCache(data); | ||
|
|
@@ -851,7 +851,7 @@ | |
| * Load and cache all data sources | ||
| */ | ||
| export async function loadData() { | ||
| return refreshDataWithGuard(); | ||
| return refreshDataWithGuard({ requireAtLeastOneSource: true }); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -913,6 +913,46 @@ | |
| return cachedData; | ||
| } | ||
|
|
||
| function flattenRpcHealthResults() { | ||
| return Object.entries(cachedData.rpcHealth || {}).flatMap(([chainId, results]) => { | ||
| const numericChainId = Number.parseInt(chainId, 10); | ||
| const chainName = cachedData.indexed?.byChainId?.[numericChainId]?.name ?? `Chain ${chainId}`; | ||
|
|
||
| return (Array.isArray(results) ? results : []).map((result) => ({ | ||
| chainId: numericChainId, | ||
| chainName, | ||
| url: result.url, | ||
| status: result.ok ? 'working' : 'failed', | ||
| clientVersion: result.clientVersion ?? null, | ||
| blockNumber: result.blockHeight ?? null, | ||
| latencyMs: result.latencyMs ?? null, | ||
| error: result.error ?? null | ||
| })); | ||
| }); | ||
|
Comment on lines
+916
to
+931
|
||
| } | ||
|
|
||
| export function getRpcMonitoringResults() { | ||
| const results = flattenRpcHealthResults(); | ||
| const workingEndpoints = results.filter(result => result.status === 'working').length; | ||
| const failedEndpoints = results.length - workingEndpoints; | ||
|
|
||
| return { | ||
| lastUpdated: cachedData.lastRpcCheck, | ||
| totalEndpoints: results.length, | ||
| testedEndpoints: results.length, | ||
| workingEndpoints, | ||
| failedEndpoints, | ||
| results | ||
| }; | ||
| } | ||
|
|
||
| export function getRpcMonitoringStatus() { | ||
| return { | ||
| isMonitoring: rpcCheckInProgress, | ||
| lastUpdated: cachedData.lastRpcCheck | ||
| }; | ||
| } | ||
|
|
||
| /** | ||
| * Search chains by various criteria | ||
| */ | ||
|
|
@@ -1033,9 +1073,9 @@ | |
| } | ||
|
|
||
| /** | ||
| * Count chains grouped by tag category | ||
| * Count chains by tag categories | ||
| * @param {Array} chains - Array of chain objects | ||
| * @returns {Object} Counts for each category | ||
| * @returns {{ totalChains: number, totalMainnets: number, totalTestnets: number, totalL2s: number, totalBeacons: number }} | ||
| */ | ||
| export function countChainsByTag(chains) { | ||
| const totalChains = chains.length; | ||
|
|
@@ -1839,3 +1879,6 @@ | |
| allErrors: errors | ||
| }; | ||
| } | ||
|
|
||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flattenRpcHealthResults()populateslatencyMsfromresult.latencyMs, but the RPC health check results currently stored incachedData.rpcHealth(fromcheckRpcEndpoint()/runRpcHealthCheck()) don’t set alatencyMsfield, so this will always benull. Either measure and persist endpoint latency in the health-check results, or omitlatencyMsfrom the normalized output to avoid advertising a field that can’t be produced.