Skip to content
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
34 changes: 17 additions & 17 deletions src/pages/ethereum/consensus/overview/IndexPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
});
Expand All @@ -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,
});
Expand All @@ -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,
});
Expand All @@ -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,
});
Expand All @@ -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,
});
Expand All @@ -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,
});
Expand All @@ -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,
});
Expand All @@ -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,
});
Expand Down
19 changes: 11 additions & 8 deletions src/pages/ethereum/consensus/overview/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ export const consensusOverviewSearchSchema = z.object({
});
export type ConsensusOverviewSearch = z.infer<typeof consensusOverviewSearchSchema>;

/** 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 */
Expand Down
Loading