Skip to content

Commit

Permalink
docs: nit
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Jun 29, 2024
1 parent b6d76cc commit fbd2705
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ contract MevCommitAVS is IMevCommitAVS, MevCommitAVSStorage,
require(block.number >= validatorRegistrations[valPubKey].freezeHeight.blockHeight + unfreezePeriodBlocks,
"unfreeze must happen at least unfreezePeriodBlocks after freeze height");
EventHeightLib.del(validatorRegistrations[valPubKey].freezeHeight);
EventHeightLib.del(validatorRegistrations[valPubKey].deregRequestHeight);
emit ValidatorUnfrozen(valPubKey, validatorRegistrations[valPubKey].podOwner);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/contracts/validator-registry/avs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ While frozen, a validator will not accrue points or rewards. A validator cannot
To exit the frozen state, a configurable unfreeze period must first pass. Then any account can call `unfreeze`:

```solidity
function unfreeze(bytes calldata valPubKey) payable external;
function unfreeze(bytes[] calldata valPubKey) payable external;
```

where a minimum of `unfreezeFee` must be included in the transaction. If the validator was in the `REQUESTED_DEREGISTRATION` state prior to being frozen, the validator will be returned to the `REGISTERED` state. That is, a validator must *not* be frozen for a full deregistration period, before it's able to deregister.
Expand Down
11 changes: 1 addition & 10 deletions contracts/test/validator-registry/avs/MevCommitAVSTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -757,19 +757,11 @@ contract MevCommitAVSTest is Test {
vm.prank(freezeOracle);
mevCommitAVS.freeze(valPubkeys);

address podOwner = address(0x420);
bytes[] memory valPubkeysFirst = new bytes[](1);
valPubkeysFirst[0] = bytes("valPubkey1");
vm.prank(podOwner);
mevCommitAVS.requestValidatorsDeregistration(valPubkeysFirst);

assertTrue(mevCommitAVS.getValidatorRegInfo(valPubkeys[0]).exists);
assertTrue(mevCommitAVS.getValidatorRegInfo(valPubkeys[0]).freezeHeight.exists);
assertTrue(mevCommitAVS.getValidatorRegInfo(valPubkeys[0]).deregRequestHeight.exists);

assertTrue(mevCommitAVS.getValidatorRegInfo(valPubkeys[1]).exists);
assertTrue(mevCommitAVS.getValidatorRegInfo(valPubkeys[1]).freezeHeight.exists);
assertFalse(mevCommitAVS.getValidatorRegInfo(valPubkeys[1]).deregRequestHeight.exists);

vm.expectRevert("sender must pay at least the unfreeze fee for each validator");
vm.prank(newAccount);
Expand All @@ -793,6 +785,7 @@ contract MevCommitAVSTest is Test {
assertEq(address(newAccount).balance, unfreezeFee * 2);
assertEq(address(unfreezeReceiver).balance, 0);

address podOwner = address(0x420);
vm.expectEmit(true, true, true, true);
emit ValidatorUnfrozen(valPubkeys[0], podOwner);
vm.expectEmit(true, true, true, true);
Expand All @@ -806,11 +799,9 @@ contract MevCommitAVSTest is Test {

assertTrue(mevCommitAVS.getValidatorRegInfo(valPubkeys[0]).exists);
assertFalse(mevCommitAVS.getValidatorRegInfo(valPubkeys[0]).freezeHeight.exists);
assertFalse(mevCommitAVS.getValidatorRegInfo(valPubkeys[0]).deregRequestHeight.exists);

assertTrue(mevCommitAVS.getValidatorRegInfo(valPubkeys[1]).exists);
assertFalse(mevCommitAVS.getValidatorRegInfo(valPubkeys[1]).freezeHeight.exists);
assertFalse(mevCommitAVS.getValidatorRegInfo(valPubkeys[1]).deregRequestHeight.exists);
}

function testSetters() public {
Expand Down

0 comments on commit fbd2705

Please sign in to comment.