Skip to content

Commit dafd243

Browse files
committed
Minor gas savings
1 parent 898af10 commit dafd243

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

contracts/contract/deposit/RocketDepositPool.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,11 @@ contract RocketDepositPool is RocketBase, RocketDepositPoolInterface, RocketVaul
584584
RocketDAOProtocolSettingsDepositInterface rocketDAOProtocolSettingsDeposit = RocketDAOProtocolSettingsDepositInterface(getContractAddress("rocketDAOProtocolSettingsDeposit"));
585585
require(rocketDAOProtocolSettingsDeposit.getDepositEnabled(), "Deposits into Rocket Pool are currently disabled");
586586
// Check node operator has sufficient credit
587-
uint256 credit = getUint(keccak256(abi.encodePacked("node.deposit.credit.balance", _nodeAddress)));
587+
bytes32 creditKey = keccak256(abi.encodePacked("node.deposit.credit.balance", _nodeAddress));
588+
uint256 credit = getUint(creditKey);
588589
require(credit >= _amount, "Amount exceeds credit available");
589590
// Account for balance changes
590-
subUint(keccak256(abi.encodePacked("node.deposit.credit.balance", _nodeAddress)), _amount);
591+
subUint(creditKey, _amount);
591592
// Note: The funds are already stored in RocketVault under RocketDepositPool so no ETH transfer is required
592593
// Get the node operator's withdrawal address
593594
RocketNodeManagerInterface rocketNodeManager = RocketNodeManagerInterface(getContractAddress("rocketNodeManager"));

contracts/contract/megapool/RocketMegapoolDelegate.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ contract RocketMegapoolDelegate is RocketMegapoolDelegateBase, RocketMegapoolDel
252252
validator.lastRequestedBond = 0;
253253
validator.lastRequestedValue = 0;
254254
validators[_validatorId] = validator;
255+
// Delete prestake signature
256+
delete prestakeSignatures[_validatorId];
255257
// Emit event
256258
emit MegapoolValidatorDequeued(_validatorId, block.timestamp);
257259
}

contracts/contract/network/RocketNetworkPenalties.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ contract RocketNetworkPenalties is RocketBase, RocketNetworkPenaltiesInterface {
138138
uint256 currentTotal = uint256(currentRunningTotal) - earlierRunningTotal;
139139
require(currentTotal < maxPenalty, "Max penalty exceeded");
140140
uint256 currentMaxPenalty = maxPenalty - currentTotal;
141-
require(currentMaxPenalty > 0, "Max penalty exceeded");
142141
// Insert new running total
143142
rocketNetworkSnapshots.push(penaltyKey, currentRunningTotal + 1);
144143
// Increment the penalty count on this minipool

0 commit comments

Comments
 (0)