Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use array instead of bitmap #888

Merged
merged 3 commits into from
Dec 2, 2024
Merged

Conversation

mymphe
Copy link
Contributor

@mymphe mymphe commented Dec 2, 2024

This PR replaces the bitmap used for tracking deferred votes with a simple array. This solution is more readable but less elegant as it requires an extra variable for tracking whether the sender is a member of the committee at all. We can of course use the new array to do that but that would require iterating over it. Whereas in the old solution, the zero bitmap indicated that the sender has no roles.

@mymphe mymphe requested a review from a team as a code owner December 2, 2024 09:22
Copy link

github-actions bot commented Dec 2, 2024

badge

Hardhat Unit Tests Coverage Summary

Filename                                                       Stmts    Miss  Cover    Missing
-----------------------------------------------------------  -------  ------  -------  ---------------------------------------------
contracts/0.4.24/Lido.sol                                        178      39  78.09%   383-389, 492-500, 627-664, 721-771, 921, 1020
contracts/0.4.24/StETH.sol                                        72       0  100.00%
contracts/0.4.24/StETHPermit.sol                                  15       0  100.00%
contracts/0.4.24/lib/Packed64x4.sol                                5       0  100.00%
contracts/0.4.24/lib/SigningKeys.sol                              36       0  100.00%
contracts/0.4.24/lib/StakeLimitUtils.sol                          37       0  100.00%
contracts/0.4.24/nos/NodeOperatorsRegistry.sol                   485       0  100.00%
contracts/0.4.24/oracle/LegacyOracle.sol                          72       0  100.00%
contracts/0.4.24/utils/Pausable.sol                                9       0  100.00%
contracts/0.4.24/utils/Versioned.sol                               5       0  100.00%
contracts/0.6.12/WstETH.sol                                       17       0  100.00%
contracts/0.8.25/Accounting.sol                                   85      81  4.71%    114-481
contracts/0.8.25/interfaces/ILido.sol                              0       0  100.00%
contracts/0.8.25/interfaces/IOracleReportSanityChecker.sol         0       0  100.00%
contracts/0.8.25/interfaces/IPostTokenRebaseReceiver.sol           0       0  100.00%
contracts/0.8.25/interfaces/IStakingRouter.sol                     0       0  100.00%
contracts/0.8.25/interfaces/IWithdrawalQueue.sol                   0       0  100.00%
contracts/0.8.25/utils/Versioned.sol                              11      11  0.00%    26-55
contracts/0.8.25/vaults/Dashboard.sol                             41      28  31.71%   55, 86-221, 236-300
contracts/0.8.25/vaults/Delegation.sol                            86      37  56.98%   165-172, 242-253, 275-391
contracts/0.8.25/vaults/StakingVault.sol                          66      47  28.79%   133, 165-196, 212, 235-311, 332-343
contracts/0.8.25/vaults/VaultBeaconChainDepositor.sol             21      19  9.52%    56-102
contracts/0.8.25/vaults/VaultFactory.sol                          22       0  100.00%
contracts/0.8.25/vaults/VaultHub.sol                             147     108  26.53%   108-117, 141, 157, 163, 183-452
contracts/0.8.25/vaults/interfaces/IBeaconProxy.sol                0       0  100.00%
contracts/0.8.25/vaults/interfaces/IHubVault.sol                   0       0  100.00%
contracts/0.8.25/vaults/interfaces/IReportReceiver.sol             0       0  100.00%
contracts/0.8.25/vaults/interfaces/IStakingVault.sol               0       0  100.00%
contracts/0.8.4/WithdrawalsManagerProxy.sol                       61       0  100.00%
contracts/0.8.9/BeaconChainDepositor.sol                          21       2  90.48%   48, 51
contracts/0.8.9/Burner.sol                                        72       0  100.00%
contracts/0.8.9/DepositSecurityModule.sol                        104       0  100.00%
contracts/0.8.9/EIP712StETH.sol                                   16       0  100.00%
contracts/0.8.9/LidoExecutionLayerRewardsVault.sol                16       0  100.00%
contracts/0.8.9/LidoLocator.sol                                   19       0  100.00%
contracts/0.8.9/OracleDaemonConfig.sol                            28       0  100.00%
contracts/0.8.9/StakingRouter.sol                                303       0  100.00%
contracts/0.8.9/WithdrawalQueue.sol                               88       0  100.00%
contracts/0.8.9/WithdrawalQueueBase.sol                          146       0  100.00%
contracts/0.8.9/WithdrawalQueueERC721.sol                         89       0  100.00%
contracts/0.8.9/WithdrawalVault.sol                               21       0  100.00%
contracts/0.8.9/lib/Math.sol                                       4       0  100.00%
contracts/0.8.9/lib/PositiveTokenRebaseLimiter.sol                22       0  100.00%
contracts/0.8.9/lib/UnstructuredRefStorage.sol                     2       0  100.00%
contracts/0.8.9/oracle/AccountingOracle.sol                      171       1  99.42%   674
contracts/0.8.9/oracle/BaseOracle.sol                             89       1  98.88%   397
contracts/0.8.9/oracle/HashConsensus.sol                         263       1  99.62%   1005
contracts/0.8.9/oracle/ValidatorsExitBusOracle.sol                91      91  0.00%    96-461
contracts/0.8.9/proxy/OssifiableProxy.sol                         17       0  100.00%
contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol      155       0  100.00%
contracts/0.8.9/utils/DummyEmptyContract.sol                       0       0  100.00%
contracts/0.8.9/utils/PausableUntil.sol                           31       0  100.00%
contracts/0.8.9/utils/Versioned.sol                               11       0  100.00%
contracts/0.8.9/utils/access/AccessControl.sol                    23       0  100.00%
contracts/0.8.9/utils/access/AccessControlEnumerable.sol           9       0  100.00%
contracts/testnets/sepolia/SepoliaDepositAdapter.sol              21      21  0.00%    49-100
TOTAL                                                           3303     487  85.26%

Diff against master

Filename                                                       Stmts    Miss  Cover
-----------------------------------------------------------  -------  ------  --------
contracts/0.4.24/Lido.sol                                        -34     +39  -21.91%
contracts/0.4.24/nos/NodeOperatorsRegistry.sol                   -27       0  +100.00%
contracts/0.8.25/Accounting.sol                                  +85     +81  +4.71%
contracts/0.8.25/interfaces/ILido.sol                              0       0  +100.00%
contracts/0.8.25/interfaces/IOracleReportSanityChecker.sol         0       0  +100.00%
contracts/0.8.25/interfaces/IPostTokenRebaseReceiver.sol           0       0  +100.00%
contracts/0.8.25/interfaces/IStakingRouter.sol                     0       0  +100.00%
contracts/0.8.25/interfaces/IWithdrawalQueue.sol                   0       0  +100.00%
contracts/0.8.25/utils/Versioned.sol                             +11     +11  +100.00%
contracts/0.8.25/vaults/Dashboard.sol                            +41     +28  +31.71%
contracts/0.8.25/vaults/Delegation.sol                           +86     +37  +56.98%
contracts/0.8.25/vaults/StakingVault.sol                         +66     +47  +28.79%
contracts/0.8.25/vaults/VaultBeaconChainDepositor.sol            +21     +19  +9.52%
contracts/0.8.25/vaults/VaultFactory.sol                         +22       0  +100.00%
contracts/0.8.25/vaults/VaultHub.sol                            +147    +108  +26.53%
contracts/0.8.25/vaults/interfaces/IBeaconProxy.sol                0       0  +100.00%
contracts/0.8.25/vaults/interfaces/IHubVault.sol                   0       0  +100.00%
contracts/0.8.25/vaults/interfaces/IReportReceiver.sol             0       0  +100.00%
contracts/0.8.25/vaults/interfaces/IStakingVault.sol               0       0  +100.00%
contracts/0.8.9/Burner.sol                                        +1       0  +100.00%
contracts/0.8.9/DepositSecurityModule.sol                        -24       0  +100.00%
contracts/0.8.9/LidoLocator.sol                                   +1       0  +100.00%
contracts/0.8.9/StakingRouter.sol                                -13       0  +100.00%
contracts/0.8.9/oracle/AccountingOracle.sol                      -19      -1  +0.47%
contracts/0.8.9/sanity_checks/OracleReportSanityChecker.sol      -77       0  +100.00%
TOTAL                                                           +287    +369  -10.83%

Results for commit: 417d433

Minimum allowed coverage is 95%

♻️ This comment has been updated with latest results

Base automatically changed from vaults/fix-no to feat/vaults December 2, 2024 10:10
@mymphe mymphe merged commit d534778 into feat/vaults Dec 2, 2024
7 of 8 checks passed
@mymphe mymphe deleted the committee-replace-bitmap branch December 2, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant