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

eigen crate : #116

Merged
merged 4 commits into from
Sep 16, 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
32 changes: 30 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ members = [
"crates/types/",
"crates/utils/",
"crates/nodeapi/",
"crates/eigensdk/",
"examples/anvil-utils",
"examples/avsregistry-read",
"examples/avsregistry-write",
Expand Down Expand Up @@ -57,7 +58,6 @@ ark-serialize = "0.4.2"
async-trait = "0.1.81"
aws-config = "1.5.4"
aws-sdk-kms = "1.37.0"
bn254 = { git = "https://github.com/sedaprotocol/bn254" }
clap = { version = "4.5.11", features = ["derive"] }
eigen-chainio-txmanager = { path = "crates/chainio/txmanager/" }
eigen-chainio-utils = { path = "crates/chainio/utils/" }
Expand All @@ -73,7 +73,7 @@ eigen-metrics = { version = "0.0.1-alpha", path = "crates/metrics/" }
eigen-metrics-collectors-economic = { path = "crates/metrics/collectors/economic" }
eigen-metrics-collectors-rpc-calls = { path = "crates/metrics/collectors/rpc_calls" }
eigen-services-avsregistry = { path = "crates/services/avsregistry" }
eigen-services-bls_aggregation = { path = "crates/services/bls_aggregation" }
eigen-services-blsaggregation = { path = "crates/services/bls_aggregation" }
eigen-services-operatorsinfo = { path = "crates/services/operatorsinfo" }
eigen-signer = { path = "crates/signer/" }
eigen-testing-utils = { path = "testing/testing-utils" }
Expand All @@ -99,7 +99,6 @@ quote = "1.0"
rand = "0.8"
rand_core = "0.6"
reqwest = "0.12.4"
reth = { git = "https://github.com/paradigmxyz/reth" }
rstest = "0.22.0"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.121"
Expand All @@ -114,7 +113,7 @@ tracing-subscriber = { version = "0.3", features = ["json"] }
url = "2.5.2"

#misc
rust-bls-bn254 = { git = "https://github.com/Layr-Labs/rust-bls-bn254.git", rev = "be3ef87", features = [
rust-bls-bn254 = { version = "0.2.0", features = [
"std",
] }
uuid = { version = "1.10.0", features = ["v4"] }
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ You can run any [example](https://github.com/Layr-Labs/eigensdk-rs/tree/main/exa

Example :

```
```bash
cargo run --example get_quorum_count
```

Expand All @@ -40,7 +40,7 @@ To test locally and raise a PR :-


You need `foundry` , `docker` and `make` and `nightly rust` to successfully run it. Also, the `docker` engine has to be running for all the tests to execute correctly.
```
```bash
make pr
```
At least 1 `approving` review is required to merge the PR.
Expand All @@ -55,7 +55,7 @@ Add the following variables to your env

and then run the following command

```
```bash
make fireblocks-tests

```
Expand All @@ -67,17 +67,17 @@ Test coverage should aim to be around 80%.
Here's how to generate test coverage reports:

Install llvm tools:
```
```bash
make deps
```

Run the tests with coverage instrumentations:
```
```bash
make coverage
```

Open the coverage html report in a web browser:
```
```bash
open target/llvm-cov/html/index.html
```

Expand Down
2 changes: 2 additions & 0 deletions crates/chainio/clients/eth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ version.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
description = "eigen layer instrumented client "
license-file.workspace = true

[dependencies]
alloy-consensus.workspace = true
Expand Down
2 changes: 2 additions & 0 deletions crates/chainio/clients/fireblocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ version.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
description = "fireblocks support for eigenlayer"
license-file.workspace = true

[dependencies]
alloy-contract.workspace = true
Expand Down
2 changes: 2 additions & 0 deletions crates/eigen-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ version.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
description = "eigen layer cli"
license-file.workspace = true

[dependencies]
alloy-contract.workspace = true
Expand Down
101 changes: 101 additions & 0 deletions crates/eigensdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
[package]
name = "eigensdk"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
description = "SDK for eigenlayer"
license-file.workspace = true

[dependencies]
eigen-chainio-txmanager = {workspace = true, optional = true}
eigen-chainio-utils = {workspace = true, optional = true}
eigen-client-avsregistry = {workspace = true, optional = true}
eigen-client-elcontracts = {workspace = true, optional = true}
eigen-client-eth = {workspace = true, optional = true}
eigen-client-fireblocks = {workspace = true, optional = true}
eigen-contract-bindings = {workspace = true, optional = true}
eigen-crypto-bls = {workspace = true, optional = true}
eigen-crypto-bn254 = {workspace = true, optional = true}
eigen-logging = {workspace = true, optional = true}
eigen-metrics = {workspace = true, optional = true}
eigen-metrics-collectors-economic = {workspace = true, optional = true}
eigen-metrics-collectors-rpc-calls = {workspace = true, optional = true}
eigen-services-avsregistry = {workspace = true, optional = true}
eigen-services-blsaggregation = {workspace = true, optional = true}
eigen-services-operatorsinfo = {workspace = true, optional = true}
eigen-signer = {workspace = true, optional = true}
eigen-testing-utils = {workspace = true, optional = true}
eigen-types = {workspace = true, optional = true}
eigen-utils = {workspace = true, optional = true}
eigen-nodeapi = {workspace = true, optional = true}


# Feature configurations
[features]
default = []


# Full features set for full usage
full = [
"chainio-txmanager",
"chainio-utils",
"client-avsregistry",
"client-elcontracts",
"client-eth",
"client-fireblocks",
"contract-bindings",
"crypto-bls",
"crypto-bn254",
"logging",
"metrics",
"services-avsregistry",
"services-blsaggregation",
"services-operatorsinfo",
"signer",
"testing-utils",
"nodeapi",
]

# Chain IO related features
chainio-txmanager = ["dep:eigen-chainio-txmanager"]
chainio-utils = ["dep:eigen-chainio-utils"]

# Client-related features
client-avsregistry = ["dep:eigen-client-avsregistry"]
client-elcontracts = ["dep:eigen-client-elcontracts"]
client-eth = ["dep:eigen-client-eth"]
client-fireblocks = ["dep:eigen-client-fireblocks"]

# Contract-related features
contract-bindings = ["dep:eigen-contract-bindings"]

# Crypto-related features
crypto-bls = ["dep:eigen-crypto-bls"]
crypto-bn254 = ["dep:eigen-crypto-bn254"]

# Metrics and collectors
metrics = ["dep:eigen-metrics"]
metrics-collectors-economic = ["dep:eigen-metrics-collectors-economic"]
metrics-collectors-rpc-calls = ["dep:eigen-metrics-collectors-rpc-calls"]

# Service-related features
services-avsregistry = ["dep:eigen-services-avsregistry"]
services-blsaggregation = ["dep:eigen-services-blsaggregation"]
services-operatorsinfo = ["dep:eigen-services-operatorsinfo"]

# Node API related features
nodeapi = ["dep:eigen-nodeapi"]

# Logging and utilities
logging = ["dep:eigen-logging"]
utils = ["dep:eigen-utils"]

# Testing utilities
testing-utils = ["dep:eigen-testing-utils"]

# Signer-related features
signer = ["dep:eigen-signer"]

# types
types = ["dep:eigen-types"]
97 changes: 97 additions & 0 deletions crates/eigensdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# eigen-rs

Rust <> EigenLayer developer tools

![eigen-rs](https://github.com/user-attachments/assets/bf1d1090-db70-487a-a49a-40f727849251)

## Overview

List of crates in the repository :-

- [eigen-client-avsregistry](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/chainio/clients/avsregistry) - Read, Write and subscribe methods for AvsRegistry
- [eigen-client-elcontracts](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/chainio/clients/elcontracts) - Convenience methods to call Eigenlayer contracts
- [eigen-chainio-utils](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/chainio/utils)
- [eigen-contracts-bindings](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/contracts/bindings) - Generate ethers bindings for Eigen Layer.
- [eigen-crypto-bls](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/crypto/bls) - bls utilities
- [eigen-crypto-bn254](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/crypto/bn254) - bn254 utilities
- [eigen-metrics](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/metrics) - performance , rpc and economic metrics
- [eigen-services](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/services) - Spawn tokio services for operators info , bls aggregation
- [eigen-types](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/types) - Common types
- [eigen-utils](https://github.com/Layr-Labs/eigensdk-rs/tree/main/crates/utils) - Publicly exportable `m2-mainnet` compatible alloy bindings.
- [eigen-testing-utils](https://github.com/Layr-Labs/eigensdk-rs/tree/main/testing/testing-utils) - Contains publicly exportable anvil , holesky , mainnet addresses for eigen contracts .


## Examples

You can run any [example](https://github.com/Layr-Labs/eigensdk-rs/tree/main/examples) using the command cargo run --example <example-name>

Example :

```bash
cargo run --example get_quorum_count
```

## Contributor Guidelines

We are actively looking for contributors. Thank you for your interest. We have strict ci checks in place. In case of any questions and support , feel free to raise an issue.

### PR
To test locally and raise a PR :-


You need `foundry` , `docker` and `make` and `nightly rust` to successfully run it. Also, the `docker` engine has to be running for all the tests to execute correctly.
```bash
make pr
```
At least 1 `approving` review is required to merge the PR.

### To run fireblocks tests

Add the following variables to your env

- FIREBLOCKS_API_KEY
- FIREBLOCKS_PRIVATE_KEY_PATH
- FIREBLOCKS_API_URL

and then run the following command

```bash
make fireblocks-tests

```
Note: The tests were written using sandbox environment , you would need to modify the testing parameters according to your own asset id's , tx-id etc.

### Test Coverage
Test coverage should aim to be around 80%.

Here's how to generate test coverage reports:

Install llvm tools:
```bash
make deps
```

Run the tests with coverage instrumentations:
```bash
make coverage
```

Open the coverage html report in a web browser:
```bash
open target/llvm-cov/html/index.html
```

## Supported Rust Version
Rolling `MSRV` policy of 6 months. The current `MSRV` is 1.79

## Disclaimer
This software is `unaudited`.This is experimental software and is provided on an "as is" and "as available" basis and may not work at all. It should not be used in production.

# Credits
- [Layer-labs](https://github.com/Layr-Labs/eigensdk-go/tree/master)

# Security Bugs
Please report security vulnerabilities to [email protected]. Do NOT report security bugs via Github Issues.

## Contact
Telegram - supernovahs444
Loading
Loading