Skip to content

`Support node Op registration via URC natively #88

@da-bao-jian

Description

@da-bao-jian

Currently validators join Linglong thru restaking protocols, Eigenalyer, Symbiotic, and soon SSV's bApps

For ease of onboarding, especially during the testing phase, we could support validator registration without going thru restaking protocols. This is done so by interacting with URC directly.

This design provide a third way, in addition to Eigenlayer and Symbiotic, to allow node ops join Linglong.

Middleware contract

LIN-48

registerValidators

    // copied from EigenLayerMiddlewareLib    
    function registerValidators(
        IRegistry registry,
        IRegistry.SignedRegistration[] calldata registrations,
        uint256 registrationMinCollateral
    )
        internal
        returns (bytes32 registrationRoot)
    {
        registrationRoot = registry.register{ value: registrationMinCollateral }(
            registrations, address(this)
        );
    }

We can register the validators directly calling the Registry contract in URC

optInToSlasher()

    function optInToSlasher(
        bytes32 registrationRoot,
        IRegistry.SignedRegistration[] calldata registrations,
        BLS.G2Point[] calldata delegationSignatures,
        BLS.G1Point calldata delegateePubKey,
        address delegateeAddress,
        bytes[] calldata data
    )
        external
    {
        // Todo: check if the delegatee address exits in underwriter operator set or subnetwork 

        // Use SlashingLib for validation checks
        SlashingLib.validateRegistrationConditions(
            REGISTRY, registrationRoot, registrations
        );

        // Validate delegation signatures length
        SlashingLib.validateDelegationSignaturesLength(
            delegationSignatures, registrations
        );

        SlashingLib.DelegationParams memory params = _constructDelegationParams(
            registrationRoot,
            registrations,
            delegationSignatures,
            delegateePubKey,
            delegateeAddress,
            data
        );

        SlashingLib.optInToSlasher(
            REGISTRY,
            operatorDelegations[msg.sender][registrationRoot],
            operatorRegistrationRoots[msg.sender],
            SLASHER,
            address(msg.sender),
            params
        );
    }

Here we need to add a check to see if the delegatee address exists in either Eigenlayer's Underwriter operatorset or Symbiotic Underwriter subnetwork.

Slashing

Slashing needs to be handled slightly differently compared to Eigenlayer or Symbiotic.

For example, in Eigenlayer, slashing is handled by Eigenlayer middleware, which initiates a a slashing request to Eigenlayer Core's AllocationManager.

Here slashing has to be handled by URC natively. Note that in the slashCommitment function on Registry, slashAmountWei was previously set to 0 in the case of Eigenlayer and Symbiotic since the slashing is done inside of the restaking protocols. If we were to use URC natively, we need LinglongSlahser to support this case as third way of slashing in addition to Eigenlayer and Symbiotic.

Reward

TBD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions