Skip to content

Commit

Permalink
feat: support for operator specific delegators (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz authored Nov 29, 2024
1 parent a8add56 commit c2f42e3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,8 @@ contract MevCommitMiddleware is IMevCommitMiddleware, MevCommitMiddlewareStorage
IEntity delegator = IEntity(IVault(vault).delegator());
if (delegator.TYPE() == _FULL_RESTAKE_DELEGATOR_TYPE) {
revert FullRestakeDelegatorNotSupported(vault);
} else if (delegator.TYPE() != _NETWORK_RESTAKE_DELEGATOR_TYPE) {
// Only two delegator types are supported, network-restake and operator-specific.
} else if (delegator.TYPE() != _NETWORK_RESTAKE_DELEGATOR_TYPE && delegator.TYPE() != _OPERATOR_SPECIFIC_DELEGATOR_TYPE) {
revert UnknownDelegatorType(vault, delegator.TYPE());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ abstract contract MevCommitMiddlewareStorage {
/// @notice Enum TYPE for Symbiotic core FullRestakeDelegator.
uint64 internal constant _FULL_RESTAKE_DELEGATOR_TYPE = 1;

/// @notice Enum TYPE for Symbiotic core OperatorSpecificDelegator.
uint64 internal constant _OPERATOR_SPECIFIC_DELEGATOR_TYPE = 2;

/// @notice Enum TYPE for Symbiotic core InstantSlasher.
uint64 internal constant _INSTANT_SLASHER_TYPE = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For L1 validators to be *opted-in to mev-commit*, some collateral stake must be

Operators for the mev-commit network are responsible for bulk registering groups of L1 validator pubkeys to an associated vault. Every registered validator is represented by restaked collateral from a single Vault and Operator. Each Vault’s total collateral can be split up to secure/represent many validators in groups**.**

Our network middleware contract requires any Vault registering with the contract to have a delegator of the `NetworkRestakeDelegator` type. `FullRestakeDelegator` is disallowed due to its ability for vaults to reuse stake within the same network to multiple Operators. In other words, a single instance of `slashAmount` vault collateral can only be used to secure a single validator.
Our network middleware contract requires any Vault registering with the contract to have a delegator of the `NetworkRestakeDelegator` type or `OperatorSpecificDelegator` type. `FullRestakeDelegator` is disallowed due to its ability for vaults to reuse stake within the same network to multiple Operators. In other words, a single instance of `slashAmount` vault collateral can only be used to secure a single validator, through a single Operator. Vaults are still able to split their slashable collateral across multiple Operators.

# Steps for validator opt-in via symbiotic

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,10 @@ contract MevCommitMiddlewareTest is Test {
mevCommitMiddleware.registerVaults(vaults, slashAmounts);

uint64 networkRestakeDelegatorType = 0;
uint64 operatorSpecificDelegatorType = 2;

mockDelegator1.setType(networkRestakeDelegatorType);
mockDelegator2.setType(networkRestakeDelegatorType);
mockDelegator2.setType(operatorSpecificDelegatorType);

vm.prank(owner);
vm.expectRevert(
Expand Down

0 comments on commit c2f42e3

Please sign in to comment.