-
Notifications
You must be signed in to change notification settings - Fork 195
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
[Vaults] Immutably fix the node operator in the basic StakingVault
#897
base: feat/vaults
Are you sure you want to change the base?
Conversation
|
||
$.locked = SafeCast.toUint128(_locked); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, it's not worth to trust oracle here so much?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will definitely need a sanity checker here but for now we can leave the safecast.
* Key master can: | ||
* - deposit validators to the beacon chain | ||
*/ | ||
bytes32 public constant KEY_MASTER_ROLE = keccak256("Vault.Delegation.KeyMasterRole"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be preliminary to get rid of this role.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Keymaster does not have any duties in the delegation contract, since they use the base vault for depositing validator keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still can be a useful to have a role that can only deposit, but have no access to fees or role setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we have 3 different role hierarchy: independent operator in vault, operatir in delegation and default_admin in delegation.
But looks like it should be only two of them:
default_admin and operator(that is the same address that is in the basic vault)
* - Total value = report.valuation + (current inOutDelta - report.inOutDelta) | ||
* - Vault is "healthy" if total value >= locked amount | ||
* - Unlocked ETH = max(0, total value - locked amount) | ||
* 2. Valuation & Balance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Balance here is read as eth balance. Maybe, "Valuation and Lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚜 🚜 🚜
@@ -4,7 +4,7 @@ | |||
// See contracts/COMPILERS.md | |||
pragma solidity 0.8.25; | |||
|
|||
import {MemUtils} from "../../common/lib/MemUtils.sol"; | |||
import {MemUtils} from "contracts/common/lib/MemUtils.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what the process is here, do we need to import our contracts always under "contracts/" namespace or use a relative path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think imports relative to root are much more readable. You can clearly see where the file is imported from
@@ -26,7 +26,7 @@ interface IDepositContract { | |||
* | |||
* This contract will be refactored to support custom deposit amounts for MAX_EB. | |||
*/ | |||
contract VaultBeaconChainDepositor { | |||
contract BeaconChainDepositLogistics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this makes the naming better, tbh
/** | ||
* @notice Returns the current version of the contract | ||
* @return uint64 contract version number | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | |
* @notice Returns the current version of the contract | |
* @return uint64 contract version number | |
*/ | |
/// @return uint64 contract version number |
.connect(vaultOwner) | ||
.createVault({ managementFee: 0n, performanceFee: 0n, manager, operator }, "0x"); | ||
const vaultCreationReceipt = await vaultCreationTx.wait(); | ||
if (!vaultCreationReceipt) throw new Error("Vault creation receipt not found"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a possible scenario in the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it depends on the network. It is always defined in Hardhat but maybe null in some other network
address _owner = owner(); | ||
uint256 codeSize; | ||
|
||
assembly { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assembly { | |
// Checking if owner is a contract by getting its code size | |
assembly { |
|
||
try IReportReceiver(owner()).onReport(_valuation, _inOutDelta, _locked) {} catch (bytes memory reason) { | ||
emit OnReportFailed(address(this), reason); | ||
if (codeSize > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (codeSize > 0) { | |
// If owner is a contract (has code), try to notify it about the report | |
if (codeSize > 0) { |
# Conflicts: # package.json # test/0.8.25/vaults/delegation-voting.test.ts # test/0.8.25/vaults/delegation.test.ts # yarn.lock
Hardhat Unit Tests Coverage Summary
Diff against master
Results for commit: f7086b5 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
…/lidofinance/core into feat-immutable-operator-in-vault
…o feat-immutable-operator-in-vault
…/lidofinance/core into feat-immutable-operator-in-vault
This PR fixes the operator address in the basic vault. This means that the vault owner cannot change the node operator address in
Delegation
and, thus, we don't need the LIDO_DAO role inDelegation
to approve the change.