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

Modular architecture #67

Closed
65 of 77 tasks
geode-main opened this issue Apr 6, 2023 · 1 comment
Closed
65 of 77 tasks

Modular architecture #67

geode-main opened this issue Apr 6, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request Refactor Changes related to code quality test Things related with tests

Comments

@geode-main
Copy link
Member

geode-main commented Apr 6, 2023

Changes Overview

  • Internal audit fixes
    • missing zero checks within withdrawal contract
    • swapUtils struct should have a correct gap size (confirm all gaps are correct size)
    • storage variables => events => constants
    • set loop params to zero in appendAddressArrayBatch, regulateOperators and lastIdChange
    • check unused return statements from batchApproveOperators, approveOperators
    • gas improvements
      • no need to do uint256 _type = self._proposals[proposalId].TYPE in approveSenate (deleted)
      • use WC: in withdrawal contract
      • get address instead of the struct in onlyOracle (and maybe in other modifiers too)(seems like a no - increases typo risk)
      • uint256 operatorId = STAKER._validators[_pk].operatorId should be taken before using at all in _alienateValidator
      • _setMaintainer no need to use the memory variable currentMaintainer(check deleted already)
      • "su: not enough funds in Portal ?" delete ?
      • separate loops in proposeStake and batchApproveOperators
      • _decreaseWalletBalance delete return
      • Instead of feetheft and alienate events, imprison can take a parameter.(seems like doesn't make sense now)
      • " gu: already approved" has an empty space.(function deleted already)
  • Modular Architecture
    • Refactor: Interfaces
      • interfaces should be a top level external folder (try, but do not bother inheriting them in contracts)
      • interfaces holds only the contract interfaces. You can inherit module or external interfaces (from OZ) to construct them, so you don't need to override twice! Thats good.
      • modules should inherit relative interfaces, and external interfaces folder should be constructed from these module interfaces
    • Refactor: gETHInterfaces => gETHMiddlewares
    • Refactor: defaultModules, allowedModules => defaultPackage, allowedPackage
    • Refactor: Modules
      • geodeUtils to GeodeModuleLib
        • GeodeModule
        • IGeodeModule
      • DataStoreUtils to DataStoreModuleLib
        • DataStoreModule
        • IDataStoreModule
      • stakeUtils to StakeModuleLib,
        • StakeModule
        • IStakeModule
        • StakeManagerLib extending StakeModuleLib (modules upgradability) (WAIT IN ANOTHER BRANCH, ASK AUDITORS)
        • oracleUtils to OracleLib, extending StakeModuleLib
    • Turning Liquidity Pool into a module
      • SwapUtils: LiquidityModuleLib, add unnecessary libraries like MathUtils as inline.
      • Swap: LiquidityModule
      • LiquidityPool: inherits geodeModule and LiquidityModule
      • LPtoken address is given in construction (ok, since all instances of a version use the same ref)
      • Let controllers of the liquidity pools’ have a pause functionality
      • Let them have the adminFee, set/claim
      • tests
    • defaultModules:
      • all defaultModules are now going to be deployed with a generalized approach
      • create a general way to call initialize
      • create an Interface for that initialize (like IgeodeModule or IgETHInterface)
  • Withdrawal Contract
    • Renamed to WithdrawalPool
    • Implement QueueModule:
      • segregated by validators, allows earlyExit withdrawal
      • logic for early exit requests: https://www.desmos.com/calculator/zhexhcnzxw
      • seems like early exit fee is no longer a validator param
      • Telescope will need to provide a Merkle Root for the claimable balances
        • test if partial withdrawals can be implemented (without earlyExit requests)
        • Can a user get into the withdrawal queue without specifying a validator?
    • Implement BeaconModule
    • Implement EigenModule
    • check if there is a way to combine both in one contract, if not seperate them into BeaconCredential and EigenCredential contract.
    • Tests
    • should modules have gaps? or just packages and contracts?
  • change recoveryMode back to isolationMode
  • change gETH to gToken ===> more chain-ambiguous (no.)
  • change gETHInterfaces to gTokenMiddlewares, effectively interface => middleware...
  • delete ERC1155SupplyMinterPauser and actually use the contract from OZ wizard, removes a potential risk.
  • fallbackOperator;
    • is totalActiveValidators/totalProposedValidators separation necessary?
  • improved hardhat tasks (add as you go)
  • Improved deployment scripts
  • docs:
    • audits
    • Readme
    • contribution guide
    • in-folder docs
@geode-main geode-main changed the title Modular architecture et all Modular architecture Apr 6, 2023
@geode-main geode-main added enhancement New feature or request test Things related with tests Refactor Changes related to code quality labels Apr 7, 2023
@geode-main geode-main pinned this issue Apr 7, 2023
@geode-main
Copy link
Member Author

This is done, withdrawal logic is implemented very differently at the end of the day. Also, restaking as well as some other required functionalities will be reevaluated later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Refactor Changes related to code quality test Things related with tests
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants