Skip to content

Commit 56bf0ce

Browse files
authored
Streams: Deprecation support (#3245)
* Skip cache for deprecating feeds page to show fresh data * streams deprecaiton update * lint fix * add deprecating feeds to sidebar + exclusion to filter stream deprecations in feeds tables * added copy
1 parent f8f4b8b commit 56bf0ce

File tree

7 files changed

+402
-220
lines changed

7 files changed

+402
-220
lines changed

src/config/sidebar.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,10 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
596596
title: "Selecting Quality Data Feeds",
597597
url: "data-feeds/selecting-data-feeds",
598598
},
599+
{
600+
title: "Deprecating Feeds",
601+
url: "data-feeds/deprecating-feeds",
602+
},
599603
],
600604
},
601605
{
@@ -895,6 +899,10 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
895899
title: "Market Hours",
896900
url: "data-streams/market-hours",
897901
},
902+
{
903+
title: "Deprecating Streams",
904+
url: "data-streams/deprecating-streams",
905+
},
898906
],
899907
},
900908
{
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "Deprecation of Chainlink Data Streams"
3+
section: dataStreams
4+
metadata:
5+
description: "Deprecation of Chainlink Data Streams"
6+
date: Last Modified
7+
---
8+
9+
import StreamsPage from "@features/streams/components/StreamsPage.astro"
10+
11+
<StreamsPage ecosystem="deprecating" />

src/features/data/api/backend.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ import EleventyFetch from "@11ty/eleventy-fetch"
22
import { ChainMetadata, mergeWithMVRFeeds } from "./index.ts"
33
import { Chain, POR_MVR_FEEDS_URL } from "../chains.ts"
44

5-
export const getServerSideChainMetadata = async (chains: Chain[]): Promise<Record<string, ChainMetadata>> => {
5+
export const getServerSideChainMetadata = async (
6+
chains: Chain[],
7+
skipCache = false
8+
): Promise<Record<string, ChainMetadata>> => {
69
const cache = {}
710

811
for (const chain of chains) {
912
const requests = chain.networks.map((nw) =>
1013
nw?.rddUrl
1114
? EleventyFetch(nw?.rddUrl, {
12-
duration: "1d", // save for 1 day
15+
duration: skipCache ? "0s" : "1d", // No cache if skipCache is true
1316
type: "json", // we'll parse JSON for you
1417
}).then((metadata) => ({
1518
...nw,
@@ -26,7 +29,7 @@ export const getServerSideChainMetadata = async (chains: Chain[]): Promise<Recor
2629

2730
try {
2831
const mvrFeeds = await EleventyFetch(POR_MVR_FEEDS_URL, {
29-
duration: "1d",
32+
duration: skipCache ? "0s" : "1d",
3033
type: "json",
3134
})
3235

src/features/feeds/components/FeedList.tsx

Lines changed: 75 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsxImportSource preact */
22
import { useEffect, useState, useRef, useMemo } from "preact/hooks"
3-
import { MainnetTable, TestnetTable, StreamsNetworkAddressesTable } from "./Tables.tsx"
3+
import { MainnetTable, TestnetTable, StreamsNetworkAddressesTable, StreamsTHead, StreamsTr } from "./Tables.tsx"
44
import feedList from "./FeedList.module.css"
55
import tableStyles from "./Tables.module.css"
66
import { clsx } from "~/lib/clsx/clsx.ts"
@@ -744,6 +744,54 @@ export const FeedList = ({
744744
dataFeedType === "streamsExRate" ||
745745
dataFeedType === "streamsBacked"
746746
) {
747+
// For deprecating streams, show a consolidated table across all networks
748+
if (isDeprecating) {
749+
const allDeprecatingStreams: any[] = []
750+
751+
// Check both chainMetadata and initialCache for deprecating streams
752+
const networksToCheck =
753+
chainMetadata.processedData?.networks ||
754+
(initialCache && initialCache.deprecated ? (initialCache.deprecated as any).networks : [])
755+
756+
networksToCheck.forEach((network: any) => {
757+
network.metadata?.forEach((item: any) => {
758+
// Only include items that are actual streams (have verifier contract type and feedId)
759+
// and have a shutdown date
760+
if (item.contractType === "verifier" && item.feedId && item.docs?.shutdownDate) {
761+
allDeprecatingStreams.push({
762+
...item,
763+
networkName: network.name,
764+
})
765+
}
766+
})
767+
})
768+
769+
return (
770+
<>
771+
{chainMetadata.loading && !chainMetadata.processedData && !initialCache && <p>Loading...</p>}
772+
{chainMetadata.error && <p>There was an error loading the streams...</p>}
773+
774+
{allDeprecatingStreams.length > 0 ? (
775+
<SectionWrapper title="Deprecating Streams" depth={2}>
776+
<div className={feedList.tableWrapper}>
777+
<table className={clsx(tableStyles.table)}>
778+
<StreamsTHead />
779+
<tbody>
780+
{allDeprecatingStreams.map((stream, index) => (
781+
<StreamsTr key={`${stream.feedId}-${index}`} metadata={stream} isMainnet={true} />
782+
))}
783+
</tbody>
784+
</table>
785+
</div>
786+
</SectionWrapper>
787+
) : (
788+
!chainMetadata.loading && <p>No deprecating streams found at this time.</p>
789+
)}
790+
</>
791+
)
792+
}
793+
794+
// Regular streams view (non-deprecating)
747795
const mainnetFeeds: ChainNetwork[] = []
748796
const testnetFeeds: ChainNetwork[] = []
749797

@@ -759,20 +807,24 @@ export const FeedList = ({
759807

760808
return (
761809
<>
762-
{allowNetworkTableExpansion ? (
763-
<div style={{ marginBottom: "var(--space-2x)" }}>
764-
<StreamsNetworkAddressesTable
765-
allowExpansion={allowNetworkTableExpansion}
766-
defaultExpanded={defaultNetworkTableExpanded}
767-
/>
768-
</div>
769-
) : (
770-
<SectionWrapper title="Streams Verifier Network Addresses" depth={2}>
771-
<StreamsNetworkAddressesTable
772-
allowExpansion={allowNetworkTableExpansion}
773-
defaultExpanded={defaultNetworkTableExpanded}
774-
/>
775-
</SectionWrapper>
810+
{!isDeprecating && (
811+
<>
812+
{allowNetworkTableExpansion ? (
813+
<div style={{ marginBottom: "var(--space-2x)" }}>
814+
<StreamsNetworkAddressesTable
815+
allowExpansion={allowNetworkTableExpansion}
816+
defaultExpanded={defaultNetworkTableExpanded}
817+
/>
818+
</div>
819+
) : (
820+
<SectionWrapper title="Streams Verifier Network Addresses" depth={2}>
821+
<StreamsNetworkAddressesTable
822+
allowExpansion={allowNetworkTableExpansion}
823+
defaultExpanded={defaultNetworkTableExpanded}
824+
/>
825+
</SectionWrapper>
826+
)}
827+
</>
776828
)}
777829

778830
<SectionWrapper
@@ -1057,7 +1109,8 @@ export const FeedList = ({
10571109
.filter((network: any) => {
10581110
let foundDeprecated = false
10591111
network.metadata?.forEach((feed: any) => {
1060-
if (feed.feedCategory === "deprecating") {
1112+
// Only include actual feeds (not streams) with deprecating status
1113+
if (feed.feedCategory === "deprecating" && !(feed.contractType === "verifier" && feed.feedId)) {
10611114
foundDeprecated = true
10621115
}
10631116
})
@@ -1083,7 +1136,10 @@ export const FeedList = ({
10831136
}
10841137
network={{
10851138
...network,
1086-
metadata: network.metadata.filter((feed: any) => feed.feedCategory === "deprecating"),
1139+
metadata: network.metadata.filter(
1140+
(feed: any) =>
1141+
feed.feedCategory === "deprecating" && !(feed.contractType === "verifier" && feed.feedId)
1142+
),
10871143
}}
10881144
showExtraDetails={showExtraDetails}
10891145
showOnlySVR={showOnlySVR}
@@ -1108,7 +1164,8 @@ export const FeedList = ({
11081164
if (isDeprecating) {
11091165
let foundDeprecated = false
11101166
network.metadata?.forEach((feed: any) => {
1111-
if (feed.feedCategory === "deprecating") {
1167+
// Only include actual feeds (not streams) with deprecating status
1168+
if (feed.feedCategory === "deprecating" && !(feed.contractType === "verifier" && feed.feedId)) {
11121169
foundDeprecated = true
11131170
}
11141171
})

src/features/feeds/components/FeedPage.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import { FeedDataItem, monitoredFeeds } from "~/features/data"
2525
2626
const { initialNetwork, ecosystem, dataFeedType, allowNetworkTableExpansion, defaultNetworkTableExpanded } = Astro.props
2727
28-
const initialCache = await getServerSideChainMetadata([...CHAINS, ...ALL_CHAINS])
28+
// Skip cache for deprecating page to always fetch fresh data
29+
const isDeprecating = ecosystem === "deprecating"
30+
const initialCache = await getServerSideChainMetadata([...CHAINS, ...ALL_CHAINS], isDeprecating)
2931
const feedItems: FeedDataItem[] = monitoredFeeds.mainnet
3032
---
3133

0 commit comments

Comments
 (0)