From ab9ee0c76ae5c6d266cadbe4232ab4c5891699bd Mon Sep 17 00:00:00 2001 From: mike Date: Fri, 13 Dec 2024 09:45:30 +0100 Subject: [PATCH] Fix inaccurate uptime calculation due to remainder --- contracts/sfc/SFC.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/sfc/SFC.sol b/contracts/sfc/SFC.sol index 159f91f..aa6e69c 100644 --- a/contracts/sfc/SFC.sol +++ b/contracts/sfc/SFC.sol @@ -1014,6 +1014,7 @@ contract SFC is OwnableUpgradeable, UUPSUpgradeable, Version { if (cur.averageUptime > Decimal.unit()) { cur.averageUptime = uint64(Decimal.unit()); + cur.remainder = 0; // reset the remainder when capping the averageUptime } if (prev.epochs < c.averageUptimeEpochWindow()) { cur.epochs = prev.epochs + 1;