@@ -48,8 +48,8 @@ contract SFCState is Initializable, Ownable {
48
48
mapping (address => mapping (uint256 => uint256 )) public stashedRewardsUntilEpoch;
49
49
50
50
struct WithdrawalRequest {
51
- uint256 epoch; // epoch where undelegated
52
- uint256 time; // when undelegated
51
+ uint256 epoch; // epoch where undelegated
52
+ uint256 time; // when undelegated
53
53
uint256 amount;
54
54
}
55
55
@@ -71,6 +71,16 @@ contract SFCState is Initializable, Ownable {
71
71
72
72
mapping (address => mapping (uint256 => Rewards)) public getStashedLockupRewards;
73
73
74
+ // data structure to compute average uptime for each active validator
75
+ struct AverageData {
76
+ // average uptime
77
+ int32 averageUptime;
78
+ // average uptime error term
79
+ int32 averageUptimeError;
80
+ // number of alive epochs (counts only up to numEpochsAliveThreshold)
81
+ int32 numEpochsAlive;
82
+ }
83
+
74
84
struct EpochSnapshot {
75
85
// validator ID => validator weight in the epoch
76
86
mapping (uint256 => uint256 ) receivedStake;
@@ -79,11 +89,7 @@ contract SFCState is Initializable, Ownable {
79
89
// validator ID => accumulated online time
80
90
mapping (uint256 => uint256 ) accumulatedUptime;
81
91
// validator ID => average uptime as a percentage
82
- mapping (uint256 => int32 ) averageUptime;
83
- // validator ID => error term of average uptime
84
- mapping (uint256 => int32 ) averageUptimeError;
85
- // validator ID => number of epochs alive for average uptime calculation
86
- mapping (uint256 => int32 ) numEpochsAlive;
92
+ mapping (uint256 => AverageData) averageData;
87
93
// validator ID => gas fees from txs originated by the validator
88
94
mapping (uint256 => uint256 ) accumulatedOriginatedTxsFee;
89
95
mapping (uint256 => uint256 ) offlineTime;
0 commit comments