Tips, Tricks and Ideas 2.5$M
@eigencloud contest.
I've spent quite some time on this exact code-base at
@certora last month, so let me give you a list of tricks and ideas to help you π«΅ become a Millionaire.
- Documentation
The EG documentation is extremely extensive and
@cantinaxyz has done an excellent job of providing a list on the contest page.
Take a look at
SharesAccountingEdgeCases.md to avoid finding known issues. Do not get lost in the docs, the code is what matters!
- Scope
All contracts are in scope, which is a massive amount of code for 3 weeks. If you want to focus on the changes, go to EL github: feat/slashing-diff and the Rewards release.
- Tests
The amount of tests and fuzz tests is just stupendous and can demotivate any auditor.
Yet it could be interesting to focus on the use of mocks and mock functions. If the mock imitates but does not perfectly copy contract functionality, what actually was tested?
- Formal Verification
Every rule that is proven is a mathematical certainty, use it to quickly assess the validity of an attack vector.
Keep in mind that the Prover is limited by the imagination of the engineer. Any situation that was not conceptualized might prove valid.
- Magnitude
Magnitude is the core ruler that governs allocations.
Map out all possible actors and actions that might change this variable. Have they truly all been accounted for?
- Shares
OperatorShares, DepositShares, WithdrawalShares, ScaledShares, Slashed Shares, etc.. They are added, subtracted, multiplied, divided, cooked, braised, fried and minced.
Is there really no loss of precision? Do magnitude and shares always remain in perfect lockstep?
- Strategy != BeaconStrategy
The beaconETHStrategy is fundamentally different from all the others, yet they are supposed to work in a quasi-identical manner in allocation and delegation manager. Was there something overlooked?
- Containerization
An AVS should only be able to affect operators in his Operator Set. An Operator should only be able to affect his own stakers.
Are all variables perfectly separated and/or reset when actors move places?
- Access Control
Many functions are limited by _checkCanCall(AVS or Operator). Which are the actors and delegated actors. Is it possible there is a gap somewhere?
- Slashing
slashOperator and modifyAllocations are the critical functions around which this entire update revolves.
If there is a Crit to be found, it will likely be there.
- The BeaconChain
The beaconChain already slashes operators through a completely different system. Now this complex system is perfectly merged with another completely different complex system?
Complexity gives birth to bugs. Examine the connection between the two!
- Fix Reviews
The fix for a bug can sometimes introduce such complexity that somewhere else a closed door opens for a fraction and a bug comes rolling in.
Review the fixes in extreme detail!
That's all I got folks.
Good Luck to you all, I hope you will find the bugs but I also hope there are ZERO to be found. π