Skip to content

Commit

Permalink
Merge pull request #153 from migalabs/fix/switch-active-vals
Browse files Browse the repository at this point in the history
Switch queries and types to num_active_vals
  • Loading branch information
tdahar authored Dec 12, 2023
2 parents 19f05c9 + f7ced93 commit 41c326d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions packages/client/components/layouts/Statitstics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -583,14 +583,14 @@ const Statitstics = ({ showCalculatingEpochs }: Props) => {
title='Target'
color='#343434'
backgroundColor='#f5f5f5'
percent={1 - epoch.f_missing_target / epoch.f_num_vals}
percent={1 - epoch.f_missing_target / epoch.f_num_active_vals}
tooltipColor='orange'
tooltipContent={
<>
<span>
Missing Target: {epoch.f_missing_target?.toLocaleString()}
</span>
<span>Attestations: {epoch.f_num_vals?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_active_vals?.toLocaleString()}</span>
</>
}
widthTooltip={220}
Expand All @@ -601,14 +601,14 @@ const Statitstics = ({ showCalculatingEpochs }: Props) => {
title='Source'
color='#343434'
backgroundColor='#f5f5f5'
percent={1 - epoch.f_missing_source / epoch.f_num_vals}
percent={1 - epoch.f_missing_source / epoch.f_num_active_vals}
tooltipColor='blue'
tooltipContent={
<>
<span>
Missing Source: {epoch.f_missing_source?.toLocaleString()}
</span>
<span>Attestations: {epoch.f_num_vals?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_active_vals?.toLocaleString()}</span>
</>
}
widthTooltip={220}
Expand All @@ -619,12 +619,12 @@ const Statitstics = ({ showCalculatingEpochs }: Props) => {
title='Head'
color='#343434'
backgroundColor='#f5f5f5'
percent={1 - epoch.f_missing_head / epoch.f_num_vals}
percent={1 - epoch.f_missing_head / epoch.f_num_active_vals}
tooltipColor='purple'
tooltipContent={
<>
<span>Missing Head: {epoch.f_missing_head?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_vals?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_active_vals?.toLocaleString()}</span>
</>
}
widthTooltip={220}
Expand Down Expand Up @@ -823,12 +823,12 @@ const Statitstics = ({ showCalculatingEpochs }: Props) => {
title='Target'
color='#343434'
backgroundColor='#f5f5f5'
percent={1 - epoch.f_missing_target / epoch.f_num_vals}
percent={1 - epoch.f_missing_target / epoch.f_num_active_vals}
tooltipColor='orange'
tooltipContent={
<>
<span>Missing Target: {epoch.f_missing_target?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_vals?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_active_vals?.toLocaleString()}</span>
</>
}
widthTooltip={220}
Expand All @@ -838,12 +838,12 @@ const Statitstics = ({ showCalculatingEpochs }: Props) => {
title='Source'
color='#343434'
backgroundColor='#f5f5f5'
percent={1 - epoch.f_missing_source / epoch.f_num_vals}
percent={1 - epoch.f_missing_source / epoch.f_num_active_vals}
tooltipColor='blue'
tooltipContent={
<>
<span>Missing Source: {epoch.f_missing_source?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_vals?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_active_vals?.toLocaleString()}</span>
</>
}
widthTooltip={220}
Expand All @@ -853,12 +853,12 @@ const Statitstics = ({ showCalculatingEpochs }: Props) => {
title='Head'
color='#343434'
backgroundColor='#f5f5f5'
percent={1 - epoch.f_missing_head / epoch.f_num_vals}
percent={1 - epoch.f_missing_head / epoch.f_num_active_vals}
tooltipColor='purple'
tooltipContent={
<>
<span>Missing Head: {epoch.f_missing_head?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_vals?.toLocaleString()}</span>
<span>Attestations: {epoch.f_num_active_vals?.toLocaleString()}</span>
</>
}
widthTooltip={220}
Expand Down Expand Up @@ -902,7 +902,7 @@ const Statitstics = ({ showCalculatingEpochs }: Props) => {
title='Attesting/Total active'
color='#343434'
backgroundColor='#f5f5f5'
percent={epoch.f_num_att_vals / epoch.f_num_vals}
percent={epoch.f_num_att_vals / epoch.f_num_active_vals}
tooltipColor='bluedark'
tooltipContent={
<>
Expand Down
2 changes: 1 addition & 1 deletion packages/client/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export type Epoch = {
f_epoch: number;
f_slot: number;
f_num_att_vals: number;
f_num_vals: number;
f_num_active_vals: number;
f_att_effective_balance_eth: number;
f_total_effective_balance_eth: number;
f_missing_source: number;
Expand Down
4 changes: 2 additions & 2 deletions packages/server/controllers/epochs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const getEpochsStatistics = async (req: Request, res: Response) => {
const [ epochsStats, blocksStats ] =
await Promise.all([
pgPool.query(`
SELECT f_epoch, f_slot, f_num_att_vals, f_num_vals,
SELECT f_epoch, f_slot, f_num_att_vals, f_num_active_vals,
f_att_effective_balance_eth, f_total_effective_balance_eth,
f_missing_source, f_missing_target, f_missing_head
FROM t_epoch_metrics_summary
Expand Down Expand Up @@ -67,7 +67,7 @@ export const getEpochById = async (req: Request, res: Response) => {
const [ epochStats, blocksProposed, withdrawals ] =
await Promise.all([
pgPool.query(`
SELECT f_epoch, f_slot, f_num_att_vals, f_num_vals,
SELECT f_epoch, f_slot, f_num_att_vals, f_num_active_vals,
f_att_effective_balance_eth, f_total_effective_balance_eth,
f_missing_source, f_missing_target, f_missing_head
FROM t_epoch_metrics_summary
Expand Down

0 comments on commit 41c326d

Please sign in to comment.