diff --git a/src/pages/ethereum/consensus/overview/IndexPage.tsx b/src/pages/ethereum/consensus/overview/IndexPage.tsx index 5733b5892..f3823d5f9 100644 --- a/src/pages/ethereum/consensus/overview/IndexPage.tsx +++ b/src/pages/ethereum/consensus/overview/IndexPage.tsx @@ -53,7 +53,7 @@ import type { FctProposerRewardDaily, } from '@/api/types.gen'; import { ConsensusOverviewSkeleton } from './components'; -import { type TimePeriod, TIME_RANGE_CONFIG, TIME_PERIOD_OPTIONS } from './constants'; +import { type TimePeriod, TIME_RANGE_CONFIG, TIME_PERIOD_OPTIONS, PAGE_SIZE } from './constants'; import { fillTimeKeys, formatTooltipDate, @@ -99,14 +99,14 @@ export function IndexPage(): JSX.Element { query: { hour_start_date_time_gte: startTimestamp, order_by: 'hour_start_date_time asc', - page_size: config.pageSize, + page_size: PAGE_SIZE, }, }), enabled: !isDaily, }); const blobDailyQuery = useQuery({ ...fctBlobCountDailyServiceListOptions({ - query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: config.pageSize }, + query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: PAGE_SIZE }, }), enabled: isDaily, }); @@ -116,14 +116,14 @@ export function IndexPage(): JSX.Element { query: { hour_start_date_time_gte: startTimestamp, order_by: 'hour_start_date_time asc', - page_size: config.pageSize, + page_size: PAGE_SIZE, }, }), enabled: !isDaily, }); const attnDailyQuery = useQuery({ ...fctAttestationParticipationRateDailyServiceListOptions({ - query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: config.pageSize }, + query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: PAGE_SIZE }, }), enabled: isDaily, }); @@ -133,14 +133,14 @@ export function IndexPage(): JSX.Element { query: { hour_start_date_time_gte: startTimestamp, order_by: 'hour_start_date_time asc', - page_size: config.pageSize, + page_size: PAGE_SIZE, }, }), enabled: !isDaily, }); const hvDailyQuery = useQuery({ ...fctHeadVoteCorrectnessRateDailyServiceListOptions({ - query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: config.pageSize }, + query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: PAGE_SIZE }, }), enabled: isDaily, }); @@ -150,14 +150,14 @@ export function IndexPage(): JSX.Element { query: { hour_start_date_time_gte: startTimestamp, order_by: 'hour_start_date_time asc', - page_size: config.pageSize, + page_size: PAGE_SIZE, }, }), enabled: !isDaily, }); const reorgDailyQuery = useQuery({ ...fctReorgDailyServiceListOptions({ - query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: config.pageSize }, + query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: PAGE_SIZE }, }), enabled: isDaily, }); @@ -167,14 +167,14 @@ export function IndexPage(): JSX.Element { query: { hour_start_date_time_gte: startTimestamp, order_by: 'hour_start_date_time asc', - page_size: config.pageSize, + page_size: PAGE_SIZE, }, }), enabled: !isDaily, }); const missedSlotDailyQuery = useQuery({ ...fctMissedSlotRateDailyServiceListOptions({ - query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: config.pageSize }, + query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: PAGE_SIZE }, }), enabled: isDaily, }); @@ -184,14 +184,14 @@ export function IndexPage(): JSX.Element { query: { hour_start_date_time_gte: startTimestamp, order_by: 'hour_start_date_time asc', - page_size: config.pageSize, + page_size: PAGE_SIZE, }, }), enabled: !isDaily, }); const proposalStatusDailyQuery = useQuery({ ...fctBlockProposalStatusDailyServiceListOptions({ - query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: config.pageSize }, + query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: PAGE_SIZE }, }), enabled: isDaily, }); @@ -201,14 +201,14 @@ export function IndexPage(): JSX.Element { query: { hour_start_date_time_gte: startTimestamp, order_by: 'hour_start_date_time asc', - page_size: config.pageSize, + page_size: PAGE_SIZE, }, }), enabled: !isDaily, }); const inclusionDelayDailyQuery = useQuery({ ...fctAttestationInclusionDelayDailyServiceListOptions({ - query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: config.pageSize }, + query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: PAGE_SIZE }, }), enabled: isDaily, }); @@ -218,14 +218,14 @@ export function IndexPage(): JSX.Element { query: { hour_start_date_time_gte: startTimestamp, order_by: 'hour_start_date_time asc', - page_size: config.pageSize, + page_size: PAGE_SIZE, }, }), enabled: !isDaily, }); const proposerRewardDailyQuery = useQuery({ ...fctProposerRewardDailyServiceListOptions({ - query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: config.pageSize }, + query: { day_start_date_like: '20%', order_by: 'day_start_date desc', page_size: PAGE_SIZE }, }), enabled: isDaily, }); diff --git a/src/pages/ethereum/consensus/overview/constants.ts b/src/pages/ethereum/consensus/overview/constants.ts index 4bf2cca13..affad05e1 100644 --- a/src/pages/ethereum/consensus/overview/constants.ts +++ b/src/pages/ethereum/consensus/overview/constants.ts @@ -10,16 +10,19 @@ export const consensusOverviewSearchSchema = z.object({ }); export type ConsensusOverviewSearch = z.infer; +/** Page size for all overview queries — generous flat value to avoid truncation on dimensional data */ +export const PAGE_SIZE = 10_000; + /** Configuration for each time range option */ export const TIME_RANGE_CONFIG = { - '24h': { days: 1, dataType: 'hourly' as const, pageSize: 24 }, - '7d': { days: 7, dataType: 'hourly' as const, pageSize: 168 }, - '30d': { days: 30, dataType: 'daily' as const, pageSize: 30 }, - '90d': { days: 90, dataType: 'daily' as const, pageSize: 90 }, - '180d': { days: 180, dataType: 'daily' as const, pageSize: 180 }, - '1y': { days: 365, dataType: 'daily' as const, pageSize: 365 }, - '2y': { days: 730, dataType: 'daily' as const, pageSize: 730 }, - all: { days: null, dataType: 'daily' as const, pageSize: 10000 }, + '24h': { days: 1, dataType: 'hourly' as const }, + '7d': { days: 7, dataType: 'hourly' as const }, + '30d': { days: 30, dataType: 'daily' as const }, + '90d': { days: 90, dataType: 'daily' as const }, + '180d': { days: 180, dataType: 'daily' as const }, + '1y': { days: 365, dataType: 'daily' as const }, + '2y': { days: 730, dataType: 'daily' as const }, + all: { days: null, dataType: 'daily' as const }, } as const; /** Chart configuration with labels and series data */