-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow governance to send eth stored in timelock #174
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Governance whitelist allows anyone on the whitelist to make a proposal without meeting the COMP threshold requirements.
* Add Arr00's changes for split COMP distributions - Adds compBorrowSpeeds and compSupplySpeeds to ComptrollerV6Storage - Change _setCompSpeed to _setCompSpeeds - one function call to update distribution speeds for multiple markets - Change signature of setCompSpeedInternal - compSpeed split up into two parts: compSupplySpeed and compBorrowSpeed * Update setCompSpeedInternal to update COMP speeds and accruals using compSupplySpeeds and compBorrowSpeeds * Fix compilation errors in Comptroller * Update tests to use new split COMP distribution changes * Update tests and frameworks to support the new COMP distributions * Add tests for setting varying supply and borrow rates * Fix bugs in Comptroller#updateCompSupplyIndex and Comptroller#updateCompBorrowIndex - compSupplySpeeds and compBorrowSpeeds were flipped * Add tests for one-sided COMP distribution rates - These tests have been manually verified to fail when they are expected to fail => they work well * Add upgrade hooks for split COMP reward distributions * Add TODO * Update gas costs * Add market initialization and update market state info - Supply state and borrow state now initialized when a market is added, ensuring market state indices are always set * Modify upgrade hook to ensure all market state indices are set * Simplify setCompSpeedInternal logic - Now that market state indices are non lazily set, we can simply update market states when updating COMP speeds * Adjust comments in Comptroller * Add COMP accrual optimizations - Adds changes from PR compound-finance#173 - Second mint with comp accrued: reduced by 695 - Claim comp: reduced by 1268 * Add comments to accrual functions in Comptroller * Update FlywheelTest to account for initialization of borrow/supply state indices * Update Flywheel scenario test to use the latest Comptroller - Old scen test used ComptrollerG3 - Removed test for removed function which never actually worked * Update mainnet network config and abi to current (taken from compound-config) * Fix split COMP rewards upgrade hook - We need to call the upgrade function using the delegator address to use the storage at that contract address * Add Comptroller upgrade simulation - Asserts that the upgrade proposal passes - Asserts that old comp speeds are deleted - Asserts that new comp speeds are the same as they were previously - Asserts that market state indices are the same post upgrade, with 0 values initialized to 1e36 - Asserts that the 2 comp speed bugs were fixed - Asserts that the new _setCompSpeeds function works - Asserts that comp rewards accrual works * Refactor updateCompSupplyIndex and updateCompBorrowIndex slightly - Stores blockNumber as uint32 for safety * Update gas costs * Make style adjustment and fix typo * Update uninitialized rewards market block numbers in _upgradeSplitCompRewards * new branch * add new scen * add cases to new flywheel scen * Fix bug in distributeBorrowerComp identified by Coburn - Note: This change significantly increases gas usage (claim gas usage increased by 12K iirc) * Improve distributeBorrowerComp efficiency - Don't distribute borrower COMP (or update the user's borrow state) if the user is not in the borrower market. - Decreases gas usage of claim by 35K * Simplify distributeBorrowerComp - Removed the (borrowerIndex > 0) check - Since market state indices are always set now, this condition will always evaluate to true * Improve logic in borrowAllowed - It's possible that a borrower can be added to a market even if borrowAllowed returns an error. This can lead to inefficiences and possibly other problems. - This commit prevents this from happening * Add number fetcher to scenario runner * Move test from CompSpeed to Flywheel * Add new CompSpeed scenario tests * Remove old Flywheel scenario tests * Rename new Flywheel scen test to the old name * Add tests to Flywheel scenario tests - Ensures supply and borrow states properly initialized - Ensures COMP is accrued correctly when COMP rewards are added (after market activation), removed, then added again - This test covers the COMP speed bug identified on August 09, 2021 * Revert market membership changes - The logic didn't flow properly * Fix subtraction underflow problem - Underflow occurs when calling distributeBorrowerComp on markets whose borrowState.index didn't start at 1e36. - The COMP rewards on those markets work fine, so we just need to make a fix for people borrowing cMKR, cAAVE, and the other new markets whose indices haven't been set yet, which this commit does. * Increase gas limit in claimComp test - The change to distributeBorrowerComp to account for borrowers with uninitialized state indices increased the gas costs unfortunately * Add Coburn's scenario test for the flywheel - Ensures new COMP speeds apply to both prior borrowers+suppliers and later borrowers+suppliers correctly * Add another test to Flywheel scen tests - Ensures new COMP speeds apply to both prior borrowers+suppliers and later borrowers+suppliers correctly w/ uninitialized prior borrower/supplier state indices * Upgrade Grants simulation tests * Make distributeSupplierComp logic match distributeBorrowerComp logic * Update gas costs - Oof, the necessary change to distributeSupplierComp increased the gas cost of claim - Lastly, gm * Remove upgrade hook * Temporarily pause COMP rewards * Add failing test case for the proposal 62 bug * Fix the bug introduced in proposal 62 - The failing test of the prior commit is now passing * Add pessimistic authorizaion of transferring COMP rewards - There are COMP accrual values we need to fix before we can fully allow this - Allows COMP to be transferred to only the users which haven't interacted with the problematic markets * Remove forgotten merge conflict * Remove upgrade hook * Add ClaimCompInMarkets to the scenario runner * Add proposal 64 scenario test - Ensures proposal 64 does what it's expected to do - Please use the current mainnet configurations for this to run properly * Add additional checks of COMP accrued in the flywheel scenario tests * Add storage variable for proposal 65 fix execution * Add fixBadAccruals function to correct the accounting errors introduced in proposal 62 * Add accounting storage mapping (compReceivable) - Keeps track of the amount of COMP users owe the protocol * Add CompAccruedAdjusted and CompReceivableUpdated events * Add PrintNumber and DebugNumber to repl * Only adjust compAccrued if amountToSubtract > 0 * Make compReceivable public * Add CompReceivable view to repl * Add proposal 65 simulation - Verified that it passes * Add revert assertion to proposal 65 simulation * Revert grantCompInternal restrictions * Update proposal 65 simulation - Adds proposal 64 execution - Tests for restored claimComp functionality - Verified that the simulation passes * Add mainnet upgrade simulation - This simulation executes proposal 65 and verifies that it works as expected Co-authored-by: TRiLeZ <[email protected]>
…nd-finance#151) * Changed SimplePriceOracle so ETH price can be set on testnets * fix lens test
@arr00 Is the plan to upgrade the Governor so that these funds become usable? Is this being discussed publicly somewhere? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Timelock was recently sent a significant amount of ETH in this tx. Currently, it is not possible for governance to send ETH due to a quirk in the governor bravo implementation. This PR allows Governance to send ETH from the timelock.