Network Middleware
Architecture Overview
Subnetwork Comparison
Feature | Validator Subnetwork | Gateway Subnetwork |
---|---|---|
Duties | Basic block proposal | Preconfirmation tasks |
Rewards | Shared with Gateway Subnetwork | Shared with Validator Subnetwork |
Slashing Conditions | Accepting blocks from non-opt in relays | Reneging on preconfirmation commitments |
Symbiotic Integration
The SymbioticNetworkMiddleware
implements several key Symbiotic Primitive through Symbiotic Middleware SDK:
KeyManagerBLS
- Manages storage and validation of operator keys using BLS signaturesEpochCapture
- A middleware extension that captures timestamps based on epochsEqualStakePower
- Implementation of a 1:1 stake to voting power conversionOzAccessManaged
- A middleware extension that integrates OpenZeppelin’s AccessManaged for access controlBaseOperators
- Base contract for managing operator registration, keys, and vault relationshipsSubnetworks
- Contract for managing subnetworks that can be registered and controlled
1. Validator Subnetwork Registration
2. Gateway Subnetwork Registration
3. Both Subnetworks via Self-Delegation (Full Participation)
Functions
Subnetwork Operations
Initialization Functions
initialize
Initializes the contract with required parameters and sets up subnetworks.
Parameters:
Name | Type | Description |
---|---|---|
network | address | The address of the network |
slashingWindow | uint48 | The duration of the slashing window |
vaultRegistry | address | The address of the vault registry |
operatorRegistry | address | The address of the operator registry |
operatorNetOptIn | address | The address of the operator network opt-in service |
reader | address | The address of the reader contract used for delegatecall |
owner | address | The address of the contract owner |
_proposerRegistry | address | The address of the proposer registry contract |
Operator Management
registerOperator
Registers a new operator with the specified key, vault, and subnetwork.
Parameters:
Name | Type | Description |
---|---|---|
key | bytes | The BLS public key of the operator |
vault | address | The vault address associated with the operator |
signature | bytes | The signature proving ownership of the BLS key |
subnetwork | uint96 | The subnetwork identifier (VALIDATOR_SUBNETWORK or GATEWAY_SUBNETWORK) |
unregisterOperator
Unregisters the calling operator from the system.
unpauseOperator
Unpauses the calling operator’s operations.
Vault Management Functions
registerOperatorVault
Registers a vault for the calling operator.
Parameters:
Name | Type | Description |
---|---|---|
vault | address | The address of the vault to register |
unregisterOperatorVault
Unregisters a vault for the calling operator.
Parameters:
Name | Type | Description |
---|---|---|
vault | address | The address of the vault to unregister |
pauseOperatorVault
Pauses the operations of a vault for the calling operator.
Parameters:
Name | Type | Description |
---|---|---|
vault | address | The address of the vault to pause |
unpauseOperatorVault
Unpauses the operations of a vault for the calling operator.
Parameters:
Name | Type | Description |
---|---|---|
vault | address | The address of the vault to unpause |
Slashing Functions
slash
Slashes an operator’s stake across their active vaults. The slashing amount is distributed proportionally across the operator’s vaults based on their relative stake amounts. The function:
- Verifies the operator and their vaults are active at the given timestamp
- Calculates proportional slash amounts for each vault based on the would-be slashed operator stake percentage
- Executes slashing on each vault, with any dust amount from rounding going to the final vault
For example, if an operator has:
- Vault A with 1000 ETH staked (50%)
- Vault B with 800 ETH staked (40%)
- Vault C with 200 ETH staked (10%)
And a slash amount of 101 ETH is imposed:
- Vault A would be slashed 50.5 ETH (50% of 101)
- Vault B would be slashed 40.4 ETH (40% of 101)
- Vault C would be slashed 10.1 ETH (10% of 101)
Due to integer division and rounding, the actual amounts would be:
- Vault A: 50 ETH
- Vault B: 40 ETH
- Vault C: 11 ETH (10 ETH + 1 ETH remaining from rounding)
If the slash amount was 51 ETH instead, the extra 1 ETH “dust” from rounding would go to the final vault (Vault C), making its slash 6 ETH.
Parameters:
Name | Type | Description |
---|---|---|
params | SlashParams | The parameters for the slash operation including key, timestamp, subnetwork, amount and hints |
Query Functions
activeOperatorsAt
Retrieves the list of active operators at a specific timestamp.
Parameters:
Name | Type | Description |
---|---|---|
timestamp | uint48 | The timestamp to query active operators |
isOperatorRegistered
Checks if an operator is registered in the system.
Parameters:
Name | Type | Description |
---|---|---|
operator | address | The address of the operator to check |
activeOperatorVaults
Gets the list of active vaults for a specific operator.
Name | Type | Description |
---|---|---|
operator | address | The address of the operator to check |
activeOperatorVaultsAt
Gets the list of active vaults for a specific operator at a specific timestamp.
Parameters:
Name | Type | Description |
---|---|---|
timestamp | uint48 | The timestamp to query active vaults |
operator | address | The address of the operator to check |
activeVaults
Gets the list of all active vaults.
activeVaultsAt
Gets the list of active vaults at a specific timestamp.
Parameters:
Name | Type | Description |
---|---|---|
timestamp | uint48 | The timestamp to query active vaults |
getOperatorPower
Gets the power of an operator for a specific vault and subnetwork.
Parameters:
Name | Type | Description |
---|---|---|
operator | address | The address of the operator |
vault | address | The address of the vault |
subnetwork | uint96 | The subnetwork identifier |
getOperatorPowerAt
Gets the power of an operator for a specific vault and subnetwork at a specific timestamp. Parameters:
Name | Type | Description |
---|---|---|
timestamp | uint48 | The timestamp to query operator power |
operator | address | The address of the operator |
vault | address | The address of the vault |
subnetwork | uint96 | The subnetwork identifier |
totalPower
Gets the total power of all operators in the system.
getOperatorCollaterals
Retrieves the collateral tokens and their staked quantities for a given operator’s active vaults.
Parameters:
Name | Type | Description |
---|---|---|
operator | address | Address of the operator whose collateral stakes will be queried |