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
17 changes: 10 additions & 7 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ export interface NetworkMeta {
}

export const NETWORK_META: Record<NetworkSlug, NetworkMeta> = {
solana: { ticker: 'SOL', color: '#14F195', name: 'Solana' },
ethereum: { ticker: 'ETH', color: '#849DFF', name: 'Ethereum' },
cosmos: { ticker: 'ATOM', color: '#A5A7C4', name: 'Cosmos Hub' },
sui: { ticker: 'SUI', color: '#4DA2FF', name: 'Sui' },
polkadot: { ticker: 'DOT', color: '#E6007A', name: 'Polkadot' },
celestia: { ticker: 'TIA', color: '#7B2BF9', name: 'Celestia' },
solana: { ticker: 'SOL', color: '#14F195', name: 'Solana' },
ethereum: { ticker: 'ETH', color: '#849DFF', name: 'Ethereum' },
cosmos: { ticker: 'ATOM', color: '#A5A7C4', name: 'Cosmos Hub' },
sui: { ticker: 'SUI', color: '#4DA2FF', name: 'Sui' },
polkadot: { ticker: 'DOT', color: '#E6007A', name: 'Polkadot' },
celestia: { ticker: 'TIA', color: '#7B2BF9', name: 'Celestia' },
avalanche: { ticker: 'AVAX', color: '#E84142', name: 'Avalanche' },
};

export const NETWORK_ORDER: readonly NetworkSlug[] = ['solana', 'ethereum', 'cosmos', 'sui', 'polkadot', 'celestia'];
export const NETWORK_ORDER: readonly NetworkSlug[] = ['solana', 'ethereum', 'cosmos', 'sui', 'polkadot', 'celestia', 'avalanche'];

export const EVENT_TYPE_LABELS: Record<EventType, string> = {
delinquent: 'Went dark. Missed votes.',
Expand All @@ -33,6 +34,7 @@ export const EVENT_TYPE_LABELS: Record<EventType, string> = {
jito_opted_in: 'Opted back into Jito-Solana — delegators earn MEV tips again.',
tia_slashed_downtime: 'Offline too long on Celestia. Jailed.',
tia_slashed_double_sign: 'Signed conflicting blocks at the same height on Celestia. Tombstoned.',
avax_uptime_below_threshold: 'Uptime fell below the Avalanche reward threshold. Stakers earn nothing this period.',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The addition of avax_uptime_below_threshold breaks the vertical alignment of values in the EVENT_TYPE_LABELS object. While the new entry follows the pattern of having at least one space after the colon, the existing entries are aligned to a shorter column (previously determined by tia_slashed_double_sign). To maintain the clean formatting style established in this file (and applied to NETWORK_META in this same PR), you should consider re-aligning the entire block to the new longest key.

};

export const EVENT_TYPE_DESCRIPTIONS: Record<EventType, string> = {
Expand All @@ -51,6 +53,7 @@ export const EVENT_TYPE_DESCRIPTIONS: Record<EventType, string> = {
jito_opted_in: 'Validator resumed running jito-solana after a prior opt-out. MEV tip revenue flows to delegators again.',
tia_slashed_downtime: 'Validator missed too many blocks on Celestia and was jailed. Stake receives a minor slash; validator must manually unjail before they can rejoin consensus. Delegators earn no rewards while jailed.',
tia_slashed_double_sign: 'Validator signed two different blocks at the same height on Celestia. A slashing penalty is applied to all bonded stake — the validator\'s and all delegators\' proportionally. The validator is permanently tombstoned and cannot rejoin the active set.',
avax_uptime_below_threshold: 'Validator\'s uptime over its current validation period dropped below the threshold (Avalanche convention is 80%). Validators below the threshold at the end of the period forfeit ALL rewards — for themselves and their delegators — even if their stake remains untouched. Recovers if uptime climbs back above the threshold before the period ends.',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to EVENT_TYPE_LABELS, the addition of avax_uptime_below_threshold here breaks the vertical alignment of the EVENT_TYPE_DESCRIPTIONS object. Consider re-aligning the values in this block to match the new longest key for consistency.

};

export function getEventLabel(eventType: string, penaltyAmount: number | null, penaltyToken: string | null): string {
Expand Down
7 changes: 4 additions & 3 deletions src/types/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type NetworkSlug = 'solana' | 'ethereum' | 'cosmos' | 'sui' | 'polkadot' | 'celestia';
export type NetworkSlug = 'solana' | 'ethereum' | 'cosmos' | 'sui' | 'polkadot' | 'celestia' | 'avalanche';

export type NetworkTicker = 'SOL' | 'ETH' | 'ATOM' | 'SUI' | 'DOT' | 'TIA';
export type NetworkTicker = 'SOL' | 'ETH' | 'ATOM' | 'SUI' | 'DOT' | 'TIA' | 'AVAX';

export type EventType =
| 'delinquent'
Expand All @@ -17,7 +17,8 @@ export type EventType =
| 'jito_opted_out'
| 'jito_opted_in'
| 'tia_slashed_downtime'
| 'tia_slashed_double_sign';
| 'tia_slashed_double_sign'
| 'avax_uptime_below_threshold';

export type Severity = 'info' | 'warning' | 'critical';

Expand Down
Loading