-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat/add SSV Pool #205
base: mainnet_V0
Are you sure you want to change the base?
feat/add SSV Pool #205
Conversation
} | ||
isPoolThresholdValid(_poolId); | ||
uint256 sdToSlash = convertETHToSD(poolThresholdbyPoolId[_poolId].minThreshold); | ||
for (uint8 i; i < operatorIds.length; i++) { |
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.
gas optimization: use uint256
for i
instead of uint8
. use temporary variable for operatorIds.length
and use it.
for (uint8 i; i < operatorIds.length; i++) { | |
uint256 numOperatorIds = operatorIds.length; | |
for (uint256 i; i < numOperatorIds; ++i) { |
if you don't much care about the readability, you can move ++i
to the end of the loop and put it to unchecked
block.
import '../../../library/ValidatorStatus.sol'; | ||
|
||
struct SSVOperator { | ||
bool operatorType; // 0 for permissionless and 1 for permissioned |
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.
nit: true
or false
instead of 1
or 0
.
struct SSVOperator { | ||
bool operatorType; // 0 for permissionless and 1 for permissioned | ||
string operatorName; // name of the operator | ||
address payable operatorRewardAddress; //Eth1 address of node for reward | ||
address operatorAddress; // address of operator to interact with stader | ||
uint64 operatorSSVID; // operator ID on SSV Network | ||
uint64 keyShareCount; // count of key-share operator is running | ||
uint256 bondAmount; // amount of ETH bond for new key shares | ||
} |
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.
struct SSVOperator { | |
bool operatorType; // 0 for permissionless and 1 for permissioned | |
string operatorName; // name of the operator | |
address payable operatorRewardAddress; //Eth1 address of node for reward | |
address operatorAddress; // address of operator to interact with stader | |
uint64 operatorSSVID; // operator ID on SSV Network | |
uint64 keyShareCount; // count of key-share operator is running | |
uint256 bondAmount; // amount of ETH bond for new key shares | |
} | |
/// @param operatorType false for permissionless and true for permissioned | |
/// @param operatorName Name of the operator | |
/// @param operatorRewardAddress Eth1 address of node for reward | |
/// @param operatorAddress Address of operator to interact with stader | |
/// @param operatorSSVID Operator ID on SSV Network | |
/// @param keyShareCount Count of key-share operator is running | |
/// @param bondAmount Amount of ETH bond for new key shares | |
struct SSVOperator { | |
bool operatorType; | |
string operatorName; | |
address payable operatorRewardAddress; | |
address operatorAddress; | |
uint64 operatorSSVID; | |
uint64 keyShareCount; | |
uint256 bondAmount; | |
} |
struct SSVOperator { | ||
bool operatorType; // 0 for permissionless and 1 for permissioned | ||
string operatorName; // name of the operator | ||
address payable operatorRewardAddress; //Eth1 address of node for reward |
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.
nit: missed space
|
||
function fullDepositOnBeaconChain(bytes[] calldata _pubkey) external; | ||
|
||
//Getters |
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.
nit: missed space
event UpdatedOwner(address owner); | ||
event UpdatedStaderConfig(address staderConfig); | ||
|
||
//Getters |
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.
nit: missed space
|
||
function staderConfig() external view returns (IStaderConfig); | ||
|
||
//Setters |
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.
nit: missed space
// Distribute rewards | ||
uint64[] memory operatorIds = nodeRegistry.getOperatorsIdsForValidatorId(validatorId); | ||
uint256 totalOperators = operatorIds.length; | ||
for (uint8 i; i < totalOperators; ) { |
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.
gas optimization: use uint256
instead of uint8
for i
IPenalty(staderConfig.getPenaltyContract()).markValidatorSettled(poolId, validatorId); | ||
IStaderStakePoolManager(staderConfig.getStakePoolManager()).receiveWithdrawVaultUserShare{value: userShare}(); | ||
UtilLib.sendValue(payable(staderConfig.getStaderTreasury()), protocolShare); | ||
for (uint8 i; i < totalOperators; i++) { |
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.
gas optimization: same here, uint256
…n on SSV while doing full deposit
Adding new SSV Pool under DVT section, following are the big changes