Skip to content

Latest commit

 

History

History
228 lines (187 loc) · 10.3 KB

File metadata and controls

228 lines (187 loc) · 10.3 KB

MiddlewareV2

The middlewareV2 architecture simplifies AVS development by:

  1. Utilizing core protocol contracts for operator key storage (KeyRegistrar) and task verification (BN254CertificateVerifier and ECDSACertificateVerifier)
  2. Utilizing core contracts for OperatorSet (ie. quorum) membership and strategy composition in the AllocationManager
  3. Utilizing the EigenLabs-run offchain services to update stakes instead of avs-sync

Contents


System Diagram

classDiagram 
direction TD
namespace Middleware-on-Ethereum{
    class OperatorTableCalculator {
        StakeCapping
        StakeWeighting (Multiplier, Oracle)
        ProtocolVotingPowerCalc
    }
    class AVSAdmin {
        metadataURI
        Permissions/multisigs/governance
        verificationDelay
        transportPayments
    }
    class AVSRegistrar {
         registerOperator
         deregisterOperator
    }
    class SlasherEjector {
      submitEvidence
      slashOperator ()
      ejectOperator ()
    }
    class RegistrationHooks{
        RegistrationLogic
        OperatorCaps
        Churn
        Sockets
    }
}
namespace Ethereum-EigenLayer-Core{
    class AllocationManager {
      registerForOperatorSets
      deregisterFromOperatorSets
      allocateStake
      deallocateStake
      slashOperator()
    }
    class KeyRegistrar{
      registerKey
      deregisterKey
      getKey (operator addr)
      isRegistered (operator addr)
    }
    class CrossChainRegistry{
      setOperatorTableCalculator
      getOperatorTableCalculator
      makeGenerationReservation
      addTransportDestination
      calculateOperatorTableBytes()
  }
}
namespace TargetChain{
    class OperatorTableUpdater{
      confirmGlobalTableRoot
      updateOperatorTable()
    }
    class CertificateVerifier{
      n Operator Tables
      updateOperatorTable()
      verifyCert (bool)
    }
    class AVSConsumer{
      requests Operator task 
      receives cert ()
    }
}

namespace Offchain{
 class Operator {
    consumer input
    return certificate()
 }
 class Transport{
    getOperatorTables
    n calculateOperatorTableBytes
    calculateGlobalStakeTable()
  }
}
AllocationManager --> AVSRegistrar
AVSAdmin --> CrossChainRegistry
CrossChainRegistry --> OperatorTableCalculator : Calculates Operator Tables
AVSRegistrar --> RegistrationHooks
RegistrationHooks --> KeyRegistrar
SlasherEjector --> AllocationManager : Slash or eject Operator 
CrossChainRegistry --> Transport : Transports Operator tables
Transport --> OperatorTableUpdater: Update global stake root 
OperatorTableUpdater --> CertificateVerifier: Update Operator Table
Operator --> AVSConsumer : Produces certificate
Operator <-- AVSConsumer : Requests task
AVS Consumer --> CertificateVerifier : Verifies Certificate
Loading

AVS developers only have to manage deployments of the the following contracts on-chain:

MiddlewareV2 architecture defines standards for the AVSRegistrar and OperatorTableCalculator.

See the multichain-ELIP and core contracts documentation for more information.


AVS Registrar

The AVS Registrar is the primary interface for managing operator registration and deregistration within an AVS. It integrates with core EigenLayer contracts to ensure operators have valid keys and are properly registered in operator sets.

File Type Description
AVSRegistrar.sol Proxy Core registrar contract that handles operator registration/deregistration
AVSRegistrarWithSocket.sol Proxy Adds socket URL registration for operator communication
AVSRegistrarWithAllowlist.sol Proxy Restricts registration to allowlisted operators
AVSRegistrarAsIdentifier.sol Proxy Serves as the AVS identifier and manages permissions

Base AVSRegistrar

The AVSRegistrar provides base functionality for AVSs to register and deregister operators to their operatorSet. A single AVSRegistrar supports multiple operatorSets. This contract expects operator registrations and deregistrations to originate from the AllocationManager.

See full documentation in ./AVSRegistrar.md.


Operator Table Calculator

File Type
BN254TableCalculatorBase.sol Abstract Contract
BN254TableCalculator.sol Basic table calculator that sums slashable stake across all strategies
ECDSATableCalculatorBase.sol Abstract Contract
ECDSATableCalculator.sol Basic table calculator that sums slashable stake across all strategies

These contracts define custom stake weights of operators in an operatorSet. They are segmented by key-type.

See full documentation in /operatorTableCalculator.md.


Core Contract Integrations

Key Registrar

The KeyRegistrar manages cryptographic keys for operators across different operator sets. It supports both ECDSA and BN254 key types and ensures global uniqueness of keys across all operator sets.

When an operator registers to an operatorSet, the AVSRegistrar checks membership of the key in the operatorSet.

Allocation Manager

The AllocationManager is the entrypoint for all operator<>avs interactions. It:

  • Manages operator registration and deregistration
  • Enables an AVS to configure its metadataURI and AVSRegistrar
  • Enables an AVS to configure strategy composition in an operatorSet
  • Manages allocation and deallocation of slashable stake
  • Enables an AVS to slash an operator

See the AVSRegistrar for how an AVS is initialized to the core protocol.

Certificate Verifier

The CertificateVerifier is responsible for verifying certificates from an offchain task, on-chain. The stakes in the certificate verifier are defined by the AVS-deployed OperatorTableCalculator and transported via an off-chain process run by Eigen labs. The CertificateVerifier contracts support two signature schemes: ECDSA for individual signatures and BN254 for aggregated signatures. See multichain docs for more information.


Migration

Migration from a SlashignRegistryCoordinator in MiddlewareV1 to MiddlewareV2 requires a net-new deployment and migration.

MiddlewareV1 MiddlewareV2 Migration Path
SlashingRegistryCoordinator registration AVSRegistrar AVSRegisrar is the SlashingRegistryCoordinator
SlashingRegistryCoordinator quorum (operator set) membership AVSRegistrar The AllocationManager manages operator set membership and introspection
StakeRegistry OperatorTableCalculator The OperatorTableCalculator calculates the weight of an operator for a given operatorSet.
BLSSignatureChecker BN254CertificateVerifier To validate certificates, AVSs MUST opt into the EigenLayer multichain protocol
AVSSync EigenLayer Multichain Operator stake weights are updated via the multichain protocol. Please see the core docs for more information on registering for transport. As part of the multichain protocol, operators of an AVS MUST register their key material in the core KeyRegistrar contract.
BLSApkRegistry KeyRegistrar The KeyRegistrar is an Eigenlayer-core contract that manages operator BN254 and ECDSA keys

As part of MiddlewareV2, AVS developers must deploy the following contracts:

  1. AVSRegistrar
  2. OperatorTableCalculator

The majority of middleware complexity has been subsumed by core protocol contracts and offchain processes. Migration requires a parallel system to be deployed and proceeds in the following steps:

Phase 1: Initialization

  1. Register a new AVS in the core protocol via AllocationManager.setAVSMetadataURI
  2. Deploy a new AVSRegistrar and set it via AllocationManager.setAVSRegistrar
  3. Create operatorSets via AllocationManager.createOperatorSet. This function will also set the slasher for the operatorSet.
  4. Configure CurveType via KeyRegistrar.configureOperatorSet
  5. Deploy an OperatorTableCalculator

Phase 2: Operator Re-Registration All operators will need to re-register for the new AVS and set.

  1. Register key via KeyRegistrar.registerKey
  2. Register to operatorSet via AllocationManager.registerForOperatorSets

Phase 3: Activation

  1. Activate the offchain node software for the new AVS of your operators. Note: This stage is AVS dependent and will be different depending on your offchain assumptions.

Phase 4: Decommisison old AVS

  1. Decommission your old AVS once sufficient guarantees (eg. signing rate) for the new AVS are met.