Skip to content
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: support for operator specific delegators #508

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading