diff --git a/api/util.js b/api/util.js
index db17f274..aa3cee76 100644
--- a/api/util.js
+++ b/api/util.js
@@ -26,8 +26,9 @@ export function calculateUptimeValues(epochInfo, epochSchedule, uptimeValues) {
cumulativeUptimeCreditsEarned: null,
cumulativeUptimeCreditsPossible: null,
cumulativeUptimePercent: null,
- complete: false,
- epochs: 0,
+ uptimeComplete: false,
+ uptimeEpochs: 0,
+ uptimeEpochsSeen: {},
};
}
@@ -80,12 +81,17 @@ export function calculateUptimeValues(epochInfo, epochSchedule, uptimeValues) {
Math.min(DEFAULT_CUMULATIVE_UPTIME_EPOCHS, lastEpoch - firstEpoch + 1) *
slotsPerEpoch;
- const lastEpochUptimePercent =
+ const lastEpochUptimePercent = Math.min(
+ 100.0,
(100 * (lastEpochUptimeCreditsEarned * 1.0)) /
- (lastEpochUptimeCreditsPossible * 1.0);
- const cumulativeUptimePercent =
+ (lastEpochUptimeCreditsPossible * 1.0),
+ );
+
+ const cumulativeUptimePercent = Math.min(
+ 100.0,
(100 * (cumulativeUptimeCreditsEarned * 1.0)) /
- (cumulativeUptimeCreditsPossible * 1.0);
+ (cumulativeUptimeCreditsPossible * 1.0),
+ );
return {
lastEpoch,
@@ -95,8 +101,9 @@ export function calculateUptimeValues(epochInfo, epochSchedule, uptimeValues) {
cumulativeUptimeCreditsEarned,
cumulativeUptimeCreditsPossible,
cumulativeUptimePercent,
- complete: lastEpoch - firstEpoch >= DEFAULT_CUMULATIVE_UPTIME_EPOCHS,
+ uptimeComplete: lastEpoch - firstEpoch >= DEFAULT_CUMULATIVE_UPTIME_EPOCHS,
uptimeEpochs: _.size(epochsSeen),
+ uptimeEpochsSeen: epochsSeen,
};
}
diff --git a/api/views/tourdesol/index.js b/api/views/tourdesol/index.js
index cb84c492..ed95207b 100644
--- a/api/views/tourdesol/index.js
+++ b/api/views/tourdesol/index.js
@@ -113,6 +113,7 @@ export class TourDeSolIndexView {
lastEpochUptimePercent,
cumulativeUptimePercent,
uptimeEpochs,
+ uptimeComplete,
} = uptime;
const score = this.computeNodeScore(x, scoreParams);
@@ -127,6 +128,7 @@ export class TourDeSolIndexView {
lastEpochUptimePercent,
cumulativeUptimePercent,
uptimeEpochs,
+ uptimeComplete,
uptime,
score,
};
diff --git a/src/v2/components/TourDeSol/Table/index.jsx b/src/v2/components/TourDeSol/Table/index.jsx
index 0e63d490..078460f3 100644
--- a/src/v2/components/TourDeSol/Table/index.jsx
+++ b/src/v2/components/TourDeSol/Table/index.jsx
@@ -13,10 +13,11 @@ import HelpLink from 'v2/components/HelpLink';
import ValidatorName from 'v2/components/UI/ValidatorName';
import useStyles from './styles';
+import Uptime from '../../UI/Uptime';
const fields = [
{
- label: 'ranking',
+ label: 'rank',
id: 'rank',
text: '',
term: '',
@@ -33,6 +34,12 @@ const fields = [
text: '',
term: '',
},
+ {
+ label: 'Slot',
+ id: 'slot',
+ text: '',
+ term: '',
+ },
{
label: 'Uptime',
id: 'uptimePercent',
@@ -59,40 +66,32 @@ const ValidatorsTable = ({
avatarUrl,
activatedStake,
activatedStakePercent,
+ slot,
lastEpochUptimePercent,
cumulativeUptimePercent,
uptimeEpochs,
+ uptimeComplete,
rank,
} = row;
return (