Skip to content

Commit 0cba48d

Browse files
authored
fix: address tmnt 157 (#16457)
Please read [contributing guidelines](CONTRIBUTING.md) and remove this line. For audit-related pull requests, please use the [audit PR template](?expand=1&template=audit.md).
2 parents da3a7ef + 262591f commit 0cba48d

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

l1-contracts/gas_benchmark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
|----------------------|---------|---------|---------------|--------------|
6666
| propose | 334,960 | 352,320 | 4,580 | 73,280 |
6767
| submitEpochRootProof | 895,025 | 933,081 | 6,308 | 100,928 |
68-
| aggregate3 | 373,091 | 390,443 | - | - |
68+
| aggregate3 | 373,092 | 390,455 | - | - |
6969
| setupEpoch | 49,728 | 542,190 | - | - |
7070

7171
**Avg Gas Cost per Second**: 10,901.5 gas/second

l1-contracts/gas_benchmark_results.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
},
5656
"aggregate3": {
5757
"calls": 100,
58-
"min": 239389,
58+
"min": 239377,
5959
"mean": 245657,
60-
"median": 245991,
60+
"median": 245997,
6161
"max": 265021
6262
}
6363
}
@@ -118,10 +118,10 @@
118118
},
119119
"aggregate3": {
120120
"calls": 100,
121-
"min": 357506,
122-
"mean": 373091,
123-
"median": 373535,
124-
"max": 390443
121+
"min": 357518,
122+
"mean": 373092,
123+
"median": 373541,
124+
"max": 390455
125125
}
126126
}
127127
}

l1-contracts/src/governance/GSE.sol

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,9 @@ contract GSE is IGSE, GSECore {
661661
/**
662662
* @notice Get the effective balance of the attester at the instance.
663663
*
664-
* The effective balance is the balance of the attester at the instance,
665-
* plus the balance of the attester at the bonus instance if the instance is the latest rollup.
664+
* The effective balance is the balance of the attester at the specific instance or at the bonus if the
665+
* instance is the latest rollup and he was not at the specific. We can do this as an `or` since the
666+
* attester may only be active at one of them.
666667
*
667668
* @param _instance - The instance to look at
668669
* @param _attester - The attester to look at
@@ -671,8 +672,8 @@ contract GSE is IGSE, GSECore {
671672
*/
672673
function effectiveBalanceOf(address _instance, address _attester) external view override(IGSE) returns (uint256) {
673674
uint256 balance = delegation.getBalanceOf(_instance, _attester);
674-
if (getLatestRollup() == _instance) {
675-
balance += delegation.getBalanceOf(BONUS_INSTANCE_ADDRESS, _attester);
675+
if (balance == 0 && getLatestRollup() == _instance) {
676+
return delegation.getBalanceOf(BONUS_INSTANCE_ADDRESS, _attester);
676677
}
677678
return balance;
678679
}

0 commit comments

Comments
 (0)