Skip to content

Commit

Permalink
Merge branch 'upgrade/upkeep-trigger-report' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejearley committed Oct 27, 2023
2 parents 8a9107e + d48716f commit 548ef08
Show file tree
Hide file tree
Showing 32 changed files with 4,915 additions and 458 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "contracts/ethereum/lib/forge-std"]
path = contracts/ethereum/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/ethereum/lib/ssv-network"]
path = contracts/ethereum/lib/ssv-network
url = https://github.com/bloxapp/ssv-network.git
Expand Down
32 changes: 20 additions & 12 deletions apps/docs/src/guide/operating.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
# Operating

Casimir operators are SSV operators with a distributed key generation (DKG) server enabled to participate in validator key ceremonies. Operators run validators in clusters of 4 or more using threshold signatures on the [Secret Shared Validator (SSV) network](https://ssv.network). Any registered SSV operator may be registered with Casimir, and once collateralized, the operator becomes eligible for validator selection. As an operator, you are paid based on your configured fee per-block per-validator.
As a Casimir operator, you will be selected to share validator duties with other operators in clusters of 4, using threshold signatures on the [Secret Shared Validator (SSV) network](https://ssv.network). You'll need an SSV operator extended with distributed key generation (DKG) support to participate in on-demand validator key generation and resharing ceremonies. Once set up, you'll be able to register your operator with SSV and deposit collateral to one of Casimir's [staking strategies](../introduction/staking-strategies.md) to become eligible for selection. You are able to set your operational fee with SSV, which dictates the amount you get paid per-block per-validator.

::: info
If you already have an SSV operator with a DKG server, you may skip to [Registration](#registration).
<!--@include: ../parts/casimir-operator-README.md{5,12}-->
::: tip
If you already have an SSV and DKG node, you may skip to [Registration](#registration).
:::
<!--@include: ../parts/casimir-operator-README.md{13,14}-->


<!--@include: ../parts/casimir-operator-README.md{5,13}-->
::: warning
This quickstart is still under development and does not yet run Ethereum clients out of the box. You'll want to review the [Ethereum RPC Node](#ethereum-rpc-node) requirements and sync your own execution and consensus clients. We do plan to add support for running Ethereum clients in the future.
This quickstart is still under development and does not yet set up [Ethereum clients](https://ethereum.org/en/developers/docs/nodes-and-clients) out of the box. You'll want to review the [Ethereum RPC node requirements](#ethereum-rpc-node-requirements) and set up your own execution and consensus clients. We are adding Ethereum clients set up in the near future.
:::
<!--@include: ../parts/casimir-operator-README.md{15,55}-->
<!--@include: ../parts/casimir-operator-README.md{15,69}-->

## Registration

For any new operator, you need to first register with SSV. As a registered SSV operator, you may now register and deposit collateral to one of Casimir's staking strategies (i.e., base or EigenLayer). Your SSV operator ID, DKG server URL, and initial collateral deposit (minimum of 1 ETH) need to be provided during registration.
As a Casimir operator, you must first register with SSV. Once registered with SSV, you may register and deposit collateral to into one of Casimir's [staking strategies](../introduction/staking-strategies.md). You will need to submit three items during registration:

1. Your SSV operator ID
2. Your public DKG node URL
3. An initial collateral deposit (minimum of 1 ETH)

### SSV Operator ID

### Public DKG Node URL

### Collateral

Your collateral serves as a 1 ETH security deposit for each validator you wish to operate. You may deactivate and withdraw your collateral at any time, but you will be ineligible for selection until you re-register and deposit collateral again.
You must deposit 1 ETH per validator that you would like to operate. If you have inactive collateral (i.e., 2 ETH deposited - 1 validator active = 1 ETH inactive), you can withdraw it at any time. If you have active collateral (any bound to a validator), you may deactivate (reshare) your operator to free your funds and withdraw.

#### Collateral Penalties

Collateral is used to recover lost validator effective balance at the time of resharing or completing an exit. In either case, when an operator is removed from a validator, they are held responsible for up to 1 ETH of the validator's effective balance if any is lost below the 32 ETH minimum. The potential nonzero amount an operator owes in this case is called the **blame amount**. The blame amount is calculated as follows:
Your collateral is used to recover lost validator effective balance for stakers at the time of resharing or completing an exit. In either case, whenever your operator is removed from a validator, your are held responsible for up to 1 ETH of the validator's effective balance if any is lost below the 32 ETH minimum. The potential nonzero amount you might owe is called the **blame amount**. The blame amount is calculated as follows:

Let:

Expand All @@ -48,8 +56,8 @@ The blame amounts are submitted by the DAO oracle in response to a completed val

### Selection

Operator clusters are selected for each new validator using a distribution algorithm that ensures high-performance but emphasizes decentralization. The algorithm uses attributes and metrics obtained from the Casimir and SSV contracts, and the SSV network. An operator is evaluated by available collateral (1 ETH per validator), previous performance, current validator count, and fees.
Once you've deposited collateral, your operator is eligible to be selected for a validator. Operators are selected in clusters of 4 for each new validator using a distribution algorithm that ensures high-performance but emphasizes decentralization. The algorithm uses attributes and metrics obtained from the Casimir and SSV contracts, and the SSV network. Your operator will be evaluated by available collateral (1 ETH per validator), previous performance, current validator count, and fees.

### Rewards

Operators earn rewards based on their configured fee per-block per-validator. This is configured during registration with SSV.
You can specify your operational fee (paid per-block per-validator) . This is configured during registration with SSV.
57 changes: 57 additions & 0 deletions apps/docs/src/introduction/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,63 @@ This page is incomplete.

# Architecture

The Casimir staking architecture consists of the following components:

- An [Ethereum RPC Node](#ethereum-rpc-node) that connects the SSV DVT node to the Ethereum network.
- An [SSV Node](#ssv-node) that performs cluster duties for validators.
- An [SSV DKG server](#ssv-dkg-server) that participates in key generation and resharing ceremonies.

```mermaid
%%{
init: {
'theme': 'base',
'themeVariables': {
'fontFamily': 'Inter',
'lineColor': '#E2E2E3',
'primaryColor': '#F6F6F7',
'primaryTextColor': '#3C3C43',
'primaryBorderColor': '#E2E2E3',
'secondaryColor': '#3C3C43',
'tertiaryColor': '#FFFFFF'
}
}
}%%
graph TB
%% CasimirFactory to UpgradeableBeacons Subgraph
CasimirFactory -.-> UpgradeableBeacons
%% Subgraphs for UpgradeableBeacons
subgraph UpgradeableBeacons[Upgradeable Beacons]
CasimirManagerBeacon -.- CasimirRegistryBeacon
CasimirRegistryBeacon -.- CasimirUpkeepBeacon
CasimirUpkeepBeacon -.- CasimirViewsBeacon
end
%% UpgradeableBeacons Subgraph to Strategies Subgraphs
UpgradeableBeacons -.-> BaseStrategy
UpgradeableBeacons -.-> EigenLayerStrategy
%% Subgraphs for Strategies
subgraph BaseStrategy[Base Strategy]
BaseCasimirManager(CasimirManager) -.- BaseCasimirRegistry(CasimirRegistry) -.- BaseCasimirUpkeep(CasimirUpkeep) -.- BaseCasimirViews(CasimirViews)
end
subgraph EigenLayerStrategy[EigenLayer Strategy]
EigenLayerCasimirManager(CasimirManager) -.- EigenLayerCasimirRegistry(CasimirRegistry) -.- EigenLayerCasimirUpkeep(CasimirUpkeep) -.- EigenLayerCasimirViews(CasimirViews)
end
%% Strategies Subgraphs to Pools Subgraphs
BaseStrategy -.-> BasePools
EigenLayerStrategy -.-> EigenLayerPools
%% Subgraphs for Pools
subgraph BasePools[Base Pools]
BasePool1(CasimirPool) -.- BasePool2(CasimirPool) -.- BasePool3(CasimirPool) -.- BasePool4(CasimirPool) -.- BasePoolN(...)
end
subgraph EigenLayerPools[EigenLayer Pools]
EigenLayerPool1(CasimirPool) -.- EigenLayerPool2(CasimirPool) -.- EigenLayerPool3(CasimirPool) -.- EigenLayerPool4(CasimirPool) -.- EigenLayerPoolN(...)
end
```

<!-- The Casimir staking system consists of the following components:
- A [factory contract](#factory-contract) that manages the creation of [staking strategies](#staking-strategies), each with a distinct [manager contract](#manager-contract), [registry contract](#registry-contract), [upkeep contract](#upkeep-contract), and [views contract](#views-contract).
Expand Down
8 changes: 4 additions & 4 deletions common/env/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import MOCK_VALIDATORS from './mock/validators.json'

const ETHEREUM_CONTRACTS = {
TESTNET: {
BEACON_LIBRARY_ADDRESS: '0xbc3681bDed4CaB8A4dCD155A1d9B8dd52Dd73e92',
BEACON_LIBRARY_ADDRESS: '0x0295bfe577d6833882Ee0E1Bccc4a5825d1Df653',
MANAGER_BEACON_ADDRESS: '0x69D830C11bbD81c0A9AC031d17A2599D3a0F632E',
POOL_BEACON_ADDRESS: '0x9Ef6fb4fe7F7EB9DDeB019028E978439b9aD72BF',
REGISTRY_BEACON_ADDRESS: '0xC0799f7643978828cEBCe4F327dcA233dE1871C8',
UPKEEP_BEACON_ADDRESS: '0x0CCA5B647598e86fc0518A462f2e61C58Dc6F5ac',
VIEWS_BEACON_ADDRESS: '0x7B07be561eA274a78D9dC30FCFAcEeb2C6Ac3962',
FACTORY_ADDRESS: '0xA6fd22c5633bCD82Ee25045de91351a8dfA2c76F',

FUNCTIONS_BILLING_REGISTRY_ADDRESS: '0x0076D4E763ca38D25d75DE40015435E809933F31',
FUNCTIONS_ORACLE_ADDRESS: '0x63bF34606227c69c419EDf63D4aF5ACC472A48c0',
FUNCTIONS_ORACLE_FACTORY_ADDRESS: '0x96B485FbBA4e527Ce8387a0c1D4b02FC7E54f501',
FUNCTIONS_BILLING_REGISTRY_ADDRESS: '0x566087488869A18767cBA3Adb19dfc713FE56Ac6',
FUNCTIONS_ORACLE_ADDRESS: '0x914F29Ddb0b8A8201a58e6eeaf71d6df36429214',
FUNCTIONS_ORACLE_FACTORY_ADDRESS: '0x1304Dc23DD83f5c374193839E880cCa5D040f5A7',

DEPOSIT_CONTRACT_ADDRESS: '0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b',
KEEPER_REGISTRAR_ADDRESS: '0x57A4a13b35d25EE78e084168aBaC5ad360252467',
Expand Down
Loading

0 comments on commit 548ef08

Please sign in to comment.